smart_archives_web/src/views/archivesManagement/archClass/fileClassificationNamingCon.../index.vue

112 lines
3.7 KiB
Vue
Raw Normal View History

2025-09-09 10:42:12 +08:00
<template>
2025-09-12 16:48:03 +08:00
<!-- 档案多维度管理 -->
2025-09-09 10:42:12 +08:00
<div class="app-container">
2025-09-12 16:48:03 +08:00
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="true" ref="classifyNameStandardTableRef"
:columnsList="columnsList" :request-api="getClassifyNameStandardListAPI">
<template slot="btn">
<el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['classify:standard:add']"
@click="handleAdd">
新增
</el-button>
</template>
2025-09-09 10:42:12 +08:00
2025-09-12 16:48:03 +08:00
<template slot="handle" slot-scope="{ data }">
<el-button plain size="mini" type="primary" icon="el-icon-edit" v-hasPermi="['classify:standard:edit']"
@click="handleUpdate(data)">
修改
</el-button>
<el-button plain size="mini" type="danger" icon="el-icon-delete" v-hasPermi="['classify:standard:del']"
@click="handleDelete(data)">
删除
</el-button>
</template>
</TableModel>
<!-- 新增/编辑 -->
<ClassifyNameStandardForm v-if="isflag" :isAdd="isAdd" :rowData="row" @handleQuery="handleQuery" :title="title"
@closeDialog="closeDialog" @showColose="showColose" :dataForm="row" :disabled="loading" :width="600" />
2025-09-09 10:42:12 +08:00
</div>
</template>
<script>
2025-09-12 16:48:03 +08:00
import TableModel from '@/components/TableModel'
import { columnsList, formLabel } from './config'
import {
delClassifyNameStandardAPI,
getClassifyNameStandardListAPI,
} from '@/api/archivesManagement/classifyNameStandard'
import ClassifyNameStandardForm from './prop/classifyNameStandardForm.vue'
2025-09-09 10:42:12 +08:00
export default {
2025-09-12 16:48:03 +08:00
name: 'FileClassificationTags',
components: {
TableModel,
ClassifyNameStandardForm
},
2025-09-09 10:42:12 +08:00
data() {
return {
2025-09-12 16:48:03 +08:00
formLabel,
columnsList,
getClassifyNameStandardListAPI,
title: "",
isflag: false,
isAdd: '',
row: {},
loading: false,
2025-09-09 10:42:12 +08:00
}
},
2025-09-12 16:48:03 +08:00
2025-09-09 10:42:12 +08:00
created() {
2025-09-12 16:48:03 +08:00
2025-09-09 10:42:12 +08:00
},
2025-09-12 16:48:03 +08:00
2025-09-09 10:42:12 +08:00
methods: {
2025-09-12 16:48:03 +08:00
/** 新增按钮操作 */
handleAdd() {
this.title = "新增";
this.isAdd = 'add';
this.isflag = true;
2025-09-09 10:42:12 +08:00
},
2025-09-12 16:48:03 +08:00
closeDialog() {
this.isflag = false;
2025-09-09 10:42:12 +08:00
},
2025-09-12 16:48:03 +08:00
showColose() {
this.isflag = false;
2025-09-09 10:42:12 +08:00
},
2025-09-12 16:48:03 +08:00
/** 修改操作 */
handleUpdate(row) {
this.title = "修改";
this.isAdd = 'edit';
this.row = row;
this.isflag = true;
2025-09-09 10:42:12 +08:00
},
2025-09-12 16:48:03 +08:00
/* 搜索操作 */
handleQuery() {
this.$refs.classifyNameStandardTableRef.getTableList()
},
/** 删除操作 */
2025-09-09 10:42:12 +08:00
handleDelete(row) {
2025-09-12 16:48:03 +08:00
this.$modal.confirm(`是否确认删除文件命名识别规范类型为"${row.standardType}"的数据项?`).then(() => {
// 显示加载遮罩
this.$modal.loading("正在删除,请稍候...");
delClassifyNameStandardAPI({ id: row.id }).then(res => {
this.$modal.closeLoading();
if (res.code === 200) {
this.$modal.msgSuccess("删除成功");
this.handleQuery();
} else {
this.$modal.msgError(res.msg);
2025-09-09 10:42:12 +08:00
}
2025-09-12 16:48:03 +08:00
}).catch(error => {
this.$modal.closeLoading();
this.$modal.msgError("删除失败,请重试");
console.error('删除失败:', error);
});
}).catch(() => {
// 用户取消删除,不需要处理
});
2025-09-09 10:42:12 +08:00
},
},
}
</script>