文件分类命名规范修改
This commit is contained in:
parent
60394f82c6
commit
3b8febe221
|
|
@ -0,0 +1,37 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 新增文件分类命名规范识别
|
||||||
|
export function addClassifyNameStandardAPI(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smartArchives/classifyNameStandard/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改文件分类命名规范识别
|
||||||
|
export function editClassifyNameStandardAPI(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smartArchives/classifyNameStandard/edit',
|
||||||
|
method: 'POST',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除文件分类命名规范识别
|
||||||
|
export function delClassifyNameStandardAPI(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smartArchives/classifyNameStandard/del',
|
||||||
|
method: 'POST',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询文件分类命名规范识别列表
|
||||||
|
export function getClassifyNameStandardListAPI(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smartArchives/classifyNameStandard/list',
|
||||||
|
method: 'GET',
|
||||||
|
params: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
export const formLabel = [
|
||||||
|
{
|
||||||
|
isShow: false, // 是否展示label
|
||||||
|
f_type: 'ipt',
|
||||||
|
f_label: '文件命名识别规范类型',
|
||||||
|
f_model: 'standardType',
|
||||||
|
f_max: 32,
|
||||||
|
f_width: '250px',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
export const columnsList = [
|
||||||
|
{ t_props: 'standardType', t_label: '文件命名识别规范类型' },
|
||||||
|
{ t_props: 'standardName', t_label: '规范识别值' },
|
||||||
|
{ t_props: 'updateUserName', t_label: '更新人' },
|
||||||
|
{ t_props: 'updateTime', t_label: '更新时间' },
|
||||||
|
{ t_props: 'remark', t_label: '备注' }
|
||||||
|
]
|
||||||
|
|
@ -1,395 +1,111 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 基础页面 -->
|
<!-- 档案多维度管理 -->
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form
|
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="true" ref="classifyNameStandardTableRef"
|
||||||
v-show="showSearch"
|
:columnsList="columnsList" :request-api="getClassifyNameStandardListAPI">
|
||||||
:model="queryParams"
|
<template slot="btn">
|
||||||
ref="queryForm"
|
<el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['classify:standard:add']"
|
||||||
size="small"
|
@click="handleAdd">
|
||||||
inline
|
新增
|
||||||
@submit.native.prevent
|
|
||||||
>
|
|
||||||
<el-form-item label="" prop="name">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.name"
|
|
||||||
placeholder="数据类型名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
style="width: 240px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<!-- 表单按钮 -->
|
|
||||||
<el-form-item>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-search"
|
|
||||||
@click="handleQuery"
|
|
||||||
>查询</el-button
|
|
||||||
>
|
|
||||||
<el-button icon="el-icon-refresh" @click="handleReset"
|
|
||||||
>重置</el-button
|
|
||||||
>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleDialog(null, 'add')"
|
|
||||||
>新增</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar
|
|
||||||
:showSearch.sync="showSearch"
|
|
||||||
@queryTable="getList"
|
|
||||||
/>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table
|
|
||||||
:data="tableList"
|
|
||||||
fit
|
|
||||||
highlight-current-row
|
|
||||||
style="width: 100%"
|
|
||||||
v-loading="isLoading"
|
|
||||||
:max-height="650"
|
|
||||||
border
|
|
||||||
>
|
|
||||||
<el-table-column
|
|
||||||
type="index"
|
|
||||||
width="55"
|
|
||||||
label="序号"
|
|
||||||
align="center"
|
|
||||||
:index="
|
|
||||||
(index) =>
|
|
||||||
(queryParams.pageNum - 1) * queryParams.pageSize +
|
|
||||||
index +
|
|
||||||
1
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
v-for="(column, index) in tableColumns"
|
|
||||||
show-overflow-tooltip
|
|
||||||
:key="index"
|
|
||||||
:label="column.label"
|
|
||||||
:prop="column.prop"
|
|
||||||
align="center"
|
|
||||||
/>
|
|
||||||
<!-- 操作 -->
|
|
||||||
<el-table-column label="操作" align="center" width="300">
|
|
||||||
<template slot-scope="{ row }">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleDialog(row, 'edit')"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
</template>
|
||||||
size="mini"
|
|
||||||
type="text"
|
<template slot="handle" slot-scope="{ data }">
|
||||||
icon="el-icon-delete"
|
<el-button plain size="mini" type="primary" icon="el-icon-edit" v-hasPermi="['classify:standard:edit']"
|
||||||
@click="handleDelete(row)"
|
@click="handleUpdate(data)">
|
||||||
style="color: #f56c6c"
|
修改
|
||||||
>
|
</el-button>
|
||||||
|
<el-button plain size="mini" type="danger" icon="el-icon-delete" v-hasPermi="['classify:standard:del']"
|
||||||
|
@click="handleDelete(data)">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</TableModel>
|
||||||
</el-table>
|
<!-- 新增/编辑 -->
|
||||||
|
<ClassifyNameStandardForm v-if="isflag" :isAdd="isAdd" :rowData="row" @handleQuery="handleQuery" :title="title"
|
||||||
<!-- 分页 -->
|
@closeDialog="closeDialog" @showColose="showColose" :dataForm="row" :disabled="loading" :width="600" />
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 弹框 -->
|
|
||||||
<el-dialog
|
|
||||||
:title="dialogTitle"
|
|
||||||
:visible.sync="dialogVisible"
|
|
||||||
width="40%"
|
|
||||||
v-loading="isLoading"
|
|
||||||
>
|
|
||||||
<el-form
|
|
||||||
ref="dialogForm"
|
|
||||||
:model="dialogForm"
|
|
||||||
:rules="dialogRules"
|
|
||||||
label-width=""
|
|
||||||
size="small"
|
|
||||||
@submit.native.prevent
|
|
||||||
>
|
|
||||||
<el-form-item label="文件命名识别规范类型" prop="namingConvention">
|
|
||||||
<el-select
|
|
||||||
v-model="dialogForm.namingConvention"
|
|
||||||
placeholder="请选择"
|
|
||||||
clearable
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in namingConventionList"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="规范识别值" prop="conventionValue">
|
|
||||||
<el-input
|
|
||||||
v-model="dialogForm.conventionValue"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
maxlength="50"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input
|
|
||||||
v-model="dialogForm.remark"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{ minRows: 2, maxRows: 4 }"
|
|
||||||
maxlength="200"
|
|
||||||
show-word-limit
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<span slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="dialogVisible = false">关 闭</el-button>
|
|
||||||
<el-button type="primary" @click="handleSubmit"
|
|
||||||
>提 交</el-button
|
|
||||||
>
|
|
||||||
</span>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { } from '@/api/'
|
import TableModel from '@/components/TableModel'
|
||||||
|
import { columnsList, formLabel } from './config'
|
||||||
|
import {
|
||||||
|
delClassifyNameStandardAPI,
|
||||||
|
getClassifyNameStandardListAPI,
|
||||||
|
} from '@/api/archivesManagement/classifyNameStandard'
|
||||||
|
import ClassifyNameStandardForm from './prop/classifyNameStandardForm.vue'
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: 'FileClassificationTags',
|
||||||
|
components: {
|
||||||
|
TableModel,
|
||||||
|
ClassifyNameStandardForm
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isLoading: false,
|
formLabel,
|
||||||
showSearch: true,
|
columnsList,
|
||||||
pickerOptions: {
|
getClassifyNameStandardListAPI,
|
||||||
disabledDate(time) {
|
title: "",
|
||||||
return time.getTime() > Date.now()
|
isflag: false,
|
||||||
},
|
isAdd: '',
|
||||||
},
|
row: {},
|
||||||
queryParams: {
|
loading: false,
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
name: '', // 数据类型名称
|
|
||||||
},
|
|
||||||
total: 0, // 总条数
|
|
||||||
// 表头
|
|
||||||
tableColumns: [
|
|
||||||
{ label: '文件命名识别规范类型', prop: 'namingConvention' },
|
|
||||||
{ label: '规范识别值', prop: 'conventionValue' },
|
|
||||||
{ label: '更新人', prop: 'updater' },
|
|
||||||
{ label: '更新时间', prop: 'updateTime' },
|
|
||||||
{ label: '备注', prop: 'remark' },
|
|
||||||
],
|
|
||||||
// 表格数据
|
|
||||||
tableList: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
namingConvention: '测试',
|
|
||||||
conventionValue: '测试维度',
|
|
||||||
updater: '张三',
|
|
||||||
updateTime: '2024-06-20 12:00:00',
|
|
||||||
remark: '测试数据',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
isOut: false, // 是否出库
|
|
||||||
dialogTitle: '详情',
|
|
||||||
dialogVisible: false,
|
|
||||||
dialogForm: {
|
|
||||||
namingConvention: '',
|
|
||||||
remark: '',
|
|
||||||
},
|
|
||||||
dialogRules: {
|
|
||||||
namingConvention: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入文件命名识别规范类型',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
conventionValue: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入规范识别值',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
namingConventionList: [
|
|
||||||
{ label: '变电', value: 1 },
|
|
||||||
{ label: '线路', value: 2 },
|
|
||||||
{ label: '电缆', value: 3 },
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// 查询
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.title = "新增";
|
||||||
|
this.isAdd = 'add';
|
||||||
|
this.isflag = true;
|
||||||
|
},
|
||||||
|
closeDialog() {
|
||||||
|
this.isflag = false;
|
||||||
|
},
|
||||||
|
showColose() {
|
||||||
|
this.isflag = false;
|
||||||
|
},
|
||||||
|
/** 修改操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.title = "修改";
|
||||||
|
this.isAdd = 'edit';
|
||||||
|
this.row = row;
|
||||||
|
this.isflag = true;
|
||||||
|
},
|
||||||
|
/* 搜索操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1
|
this.$refs.classifyNameStandardTableRef.getTableList()
|
||||||
this.getList()
|
|
||||||
},
|
},
|
||||||
// 重置
|
/** 删除操作 */
|
||||||
handleReset() {
|
|
||||||
this.$refs.queryForm.resetFields()
|
|
||||||
this.queryParams.pageNum = 1
|
|
||||||
this.queryParams.pageSize = 10
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
// 获取列表
|
|
||||||
async getList() {
|
|
||||||
console.log('列表-查询', this.queryParams)
|
|
||||||
this.isLoading = true
|
|
||||||
try {
|
|
||||||
const params = {
|
|
||||||
...this.queryParams,
|
|
||||||
}
|
|
||||||
console.log('🚀 ~ getList ~ params:', params)
|
|
||||||
// const res = await (params)
|
|
||||||
// console.log('🚀 ~ 获取列表 ~ res:', res)
|
|
||||||
// this.tableList = res.data.rows || []
|
|
||||||
// this.total = res.data.total || 0
|
|
||||||
} catch (error) {
|
|
||||||
console.log('🚀 ~ 获取列表 ~ error:', error)
|
|
||||||
this.tableList = []
|
|
||||||
this.total = 0
|
|
||||||
} finally {
|
|
||||||
this.isLoading = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleDialog(row, type) {
|
|
||||||
console.log('🚀 ~ handleDialog ~ row:', row)
|
|
||||||
this.dialogTitle = type == 'add' ? '新增' : '编辑'
|
|
||||||
this.dialogVisible = true
|
|
||||||
setTimeout(() => {
|
|
||||||
this.$refs.dialogForm.resetFields()
|
|
||||||
if (type == 'edit') {
|
|
||||||
this.dialogForm.fileName = row.fileName
|
|
||||||
this.dialogForm.remark = row.remark
|
|
||||||
this.getDialogInfo()
|
|
||||||
}
|
|
||||||
}, 100)
|
|
||||||
},
|
|
||||||
// 删除
|
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
console.log('删除', row)
|
this.$modal.confirm(`是否确认删除文件命名识别规范类型为"${row.standardType}"的数据项?`).then(() => {
|
||||||
this.$confirm('是否确认删除?', '提示', {
|
// 显示加载遮罩
|
||||||
confirmButtonText: '确定',
|
this.$modal.loading("正在删除,请稍候...");
|
||||||
cancelButtonText: '取消',
|
delClassifyNameStandardAPI({ id: row.id }).then(res => {
|
||||||
type: 'warning',
|
this.$modal.closeLoading();
|
||||||
})
|
if (res.code === 200) {
|
||||||
.then(async () => {
|
this.$modal.msgSuccess("删除成功");
|
||||||
try {
|
this.handleQuery();
|
||||||
if (this.isLoading) return
|
} else {
|
||||||
this.isLoading = true
|
this.$modal.msgError(res.msg);
|
||||||
const params = { id: row.id }
|
|
||||||
console.log('🚀 ~ handleDelete ~ params:', params)
|
|
||||||
// const res = await (params)
|
|
||||||
// console.log('🚀 ~ 删除 ~ res:', res)
|
|
||||||
this.$message({
|
|
||||||
type: 'success',
|
|
||||||
message: '删除成功',
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
console.log('🚀 ~ handleDelete ~ error:', error)
|
|
||||||
} finally {
|
|
||||||
this.isLoading = false
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
this.$message({
|
|
||||||
type: 'info',
|
|
||||||
message: '已取消删除',
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 获取弹框信息
|
|
||||||
async getDialogInfo() {
|
|
||||||
try {
|
|
||||||
this.isLoading = true
|
|
||||||
const params = { ...this.dialogForm }
|
|
||||||
console.log('🚀 ~ getDialogInfo ~ params:', params)
|
|
||||||
// const res = await (params)
|
|
||||||
// console.log('🚀 ~ 获取弹框信息 ~ res:', res)
|
|
||||||
} catch (error) {
|
|
||||||
console.log('🚀 ~ 获取弹框信息 ~ error:', error)
|
|
||||||
} finally {
|
|
||||||
this.isLoading = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 提交弹框
|
|
||||||
handleSubmit() {
|
|
||||||
this.$refs.dialogForm.validate((valid) => {
|
|
||||||
console.log('🚀 ~ handleSubmit ~ valid:', valid)
|
|
||||||
if (!valid) return
|
|
||||||
try {
|
|
||||||
if (this.isLoading) return
|
|
||||||
this.isLoading = true
|
|
||||||
const params = { ...this.dialogForm }
|
|
||||||
console.log('🚀 ~ handleSubmit ~ params:', params)
|
|
||||||
} catch (error) {
|
|
||||||
console.log('🚀 ~ handleSubmit ~ error:', error)
|
|
||||||
} finally {
|
|
||||||
this.isLoading = false
|
|
||||||
this.dialogVisible = false
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 导出数据
|
|
||||||
formatTime(date) {
|
|
||||||
const year = date.getFullYear()
|
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
||||||
const day = String(date.getDate()).padStart(2, '0')
|
|
||||||
const hours = String(date.getHours()).padStart(2, '0')
|
|
||||||
const minutes = String(date.getMinutes()).padStart(2, '0')
|
|
||||||
const seconds = String(date.getSeconds()).padStart(2, '0')
|
|
||||||
return `${year}${month}${day}_${hours}${minutes}${seconds}`
|
|
||||||
},
|
|
||||||
// 导出数据
|
|
||||||
handleExport() {
|
|
||||||
// 提示
|
|
||||||
this.$message({
|
|
||||||
type: 'warning',
|
|
||||||
message: '导出功能开发中,敬请期待!',
|
|
||||||
})
|
|
||||||
try {
|
|
||||||
let fileName = `导出_${this.formatTime(new Date())}.xLsx`
|
|
||||||
let url = '/material/backstage/costPush/exportPushCheck'
|
|
||||||
const params = { ...this.queryParams }
|
|
||||||
console.log('🚀 ~ 导出 ~ params:', params)
|
|
||||||
// this.derive(url, params, fileName)
|
|
||||||
// this.download(url, params, fileName)
|
|
||||||
} catch (error) {
|
|
||||||
console.log('导出数据失败', error)
|
|
||||||
}
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
this.$modal.closeLoading();
|
||||||
|
this.$modal.msgError("删除失败,请重试");
|
||||||
|
console.error('删除失败:', error);
|
||||||
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
// 用户取消删除,不需要处理
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,193 @@
|
||||||
|
<template>
|
||||||
|
<!-- 小型弹窗,用于完成,删除,保存等操作 -->
|
||||||
|
<el-dialog class="l-dialog" :class="lDialog" :title="title" :visible.sync="dialogVisible" :showClose="true"
|
||||||
|
:closeOnClickModal="false" @close="handleClose" :append-to-body="true">
|
||||||
|
<div>
|
||||||
|
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="180px">
|
||||||
|
<el-form-item label="文件命名识别规范类型" prop="standardType">
|
||||||
|
<el-select class="form-item" v-model="form.standardType" filterable clearable
|
||||||
|
placeholder="请选择文件命名识别规范类型">
|
||||||
|
<el-option v-for="item in dict.type.files_classify_name_standard_type" :key="item.value" :label="item.label"
|
||||||
|
:value="item.label"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="规范识别值" prop="standardName">
|
||||||
|
<el-input class="form-item" v-model="form.standardName" clearable show-word-limit
|
||||||
|
placeholder="请输入规范识别值" maxlength="32"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" class="form-item"
|
||||||
|
v-model="form.remark" clearable show-word-limit placeholder="请输入备注" maxlength="200"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button class="clear-btn" @click="handleClose" :disabled="disabled">取消</el-button>
|
||||||
|
<el-button type="primary" class="search-btn" :disabled="disabled"
|
||||||
|
@click="submitForm('ruleForm')">确认</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import _ from 'lodash'
|
||||||
|
import {
|
||||||
|
addClassifyNameStandardAPI,
|
||||||
|
editClassifyNameStandardAPI ,
|
||||||
|
} from '@/api/archivesManagement/classifyNameStandard'
|
||||||
|
export default {
|
||||||
|
name: "ClassifyNameStandardForm",
|
||||||
|
props: ["width", "dataForm", "title", "disabled", "isAdd", "rowData"],
|
||||||
|
dicts: ['files_classify_name_standard_type'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
lDialog: this.width > 500 ? "w700" : "w500",
|
||||||
|
dialogVisible: true,
|
||||||
|
isDisabled: true,
|
||||||
|
form: {
|
||||||
|
standardType: null,
|
||||||
|
standardName: null,
|
||||||
|
remark: null,
|
||||||
|
},
|
||||||
|
loading: null,
|
||||||
|
rules: {
|
||||||
|
standardType: [
|
||||||
|
{ required: true, message: '请选择文件命名识别规范类型', trigger: 'change' }
|
||||||
|
],
|
||||||
|
standardName: [
|
||||||
|
{ required: true, message: '规范识别值不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.initFormData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 初始化表单数据 */
|
||||||
|
initFormData() {
|
||||||
|
if (this.isAdd === 'edit' && this.rowData) {
|
||||||
|
// 编辑模式:填充表单数据
|
||||||
|
this.form = {
|
||||||
|
id: this.rowData.id,
|
||||||
|
standardType: this.rowData.standardType || null,
|
||||||
|
standardName: this.rowData.standardName || null,
|
||||||
|
remark: this.rowData.remark || null,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// 新增模式:重置表单
|
||||||
|
this.form = {
|
||||||
|
standardType: null,
|
||||||
|
standardName: null,
|
||||||
|
remark: null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/*关闭弹窗 */
|
||||||
|
handleClose() {
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$emit("closeDialog");
|
||||||
|
setTimeout(() => {
|
||||||
|
this.dialogVisible = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**确认弹窗 */
|
||||||
|
sureBtnClick() {
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$emit("closeDialog");
|
||||||
|
setTimeout(() => {
|
||||||
|
this.dialogVisible = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**重置表单*/
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
standardType: null,
|
||||||
|
standardName: null,
|
||||||
|
remark: null,
|
||||||
|
};
|
||||||
|
this.resetForm("ruleForm");
|
||||||
|
},
|
||||||
|
handleReuslt(res) {
|
||||||
|
this.$modal.msgSuccess(res.msg);
|
||||||
|
this.reset();
|
||||||
|
this.$emit('handleQuery');
|
||||||
|
this.handleClose();
|
||||||
|
},
|
||||||
|
/**验证 */
|
||||||
|
submitForm(formName) {
|
||||||
|
this.$refs[formName].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
// 显示遮罩层
|
||||||
|
this.loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: "数据提交中,请稍候...",
|
||||||
|
background: 'rgba(0,0,0,0.5)',
|
||||||
|
target: this.$el.querySelector('.el-dialog') || document.body
|
||||||
|
})
|
||||||
|
let params = _.cloneDeep(this.form);
|
||||||
|
if (this.isAdd === 'add') {
|
||||||
|
addClassifyNameStandardAPI(params).then(res => {
|
||||||
|
this.loading.close();
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.handleReuslt(res);
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError(res.msg);
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
this.loading.close();
|
||||||
|
// this.$modal.msgError('提交失败,请重试');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
editClassifyNameStandardAPI(params).then(res => {
|
||||||
|
this.loading.close();
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.handleReuslt(res);
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError(res.msg);
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
this.loading.close();
|
||||||
|
// this.$modal.msgError('提交失败,请重试');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.w700 .el-dialog {
|
||||||
|
width: 700px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w500 .el-dialog {
|
||||||
|
width: 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w500 .el-dialog__header,
|
||||||
|
.w700 .el-dialog__header {
|
||||||
|
// background: #eeeeee;
|
||||||
|
|
||||||
|
.el-dialog__title {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.yxq .el-range-separator {
|
||||||
|
margin-right: 7px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-date-editor--daterange.el-input__inner {
|
||||||
|
width: 260px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-style {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -4,18 +4,18 @@
|
||||||
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="true" ref="fileClassificationTagsTableRef"
|
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="true" ref="fileClassificationTagsTableRef"
|
||||||
:columnsList="columnsList" :request-api="getFilesClassifyMarkListAPI">
|
:columnsList="columnsList" :request-api="getFilesClassifyMarkListAPI">
|
||||||
<template slot="btn">
|
<template slot="btn">
|
||||||
<el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['files:multi:add']"
|
<el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['files:classify:add']"
|
||||||
@click="handleAdd">
|
@click="handleAdd">
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot="handle" slot-scope="{ data }">
|
<template slot="handle" slot-scope="{ data }">
|
||||||
<el-button plain size="mini" type="primary" icon="el-icon-edit" v-hasPermi="['files:multi:update']"
|
<el-button plain size="mini" type="primary" icon="el-icon-edit" v-hasPermi="['files:classify:edit']"
|
||||||
@click="handleUpdate(data)">
|
@click="handleUpdate(data)">
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button plain size="mini" type="danger" icon="el-icon-delete" v-hasPermi="['files:multi:del']"
|
<el-button plain size="mini" type="danger" icon="el-icon-delete" v-hasPermi="['files:classify:del']"
|
||||||
@click="handleDelete(data)">
|
@click="handleDelete(data)">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue