This commit is contained in:
liang.chao 2025-11-26 10:52:53 +08:00
parent 9a061e0840
commit 368b4532da
2 changed files with 253 additions and 2 deletions

View File

@ -19,7 +19,10 @@ export function editArchivalCatalogueAPI(data) {
}
// 删除文件分类标记
export function delArchivalCatalogueAPI(data) {
export function delArchivalCatalogueAPI(id) {
let data = {
id: id
};
return request({
url: '/blade-system/filesClassifyMark/delArchivalCatalogue',
method: 'POST',
@ -31,7 +34,7 @@ export function delArchivalCatalogueAPI(data) {
export function getFilesClassifyMarkListAPI(data) {
return request({
url: '/blade-system/filesClassifyMark/list',
method: 'GET',
method: 'POST',
data: data,
})
}

View File

@ -0,0 +1,248 @@
<template>
<basic-container>
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model:page="page"
:permission="permissionList"
:before-open="beforeOpen"
v-model="form"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
</avue-crud>
</basic-container>
</template>
<script>
import {
addArchivalCatalogueAPI,
editArchivalCatalogueAPI,
delArchivalCatalogueAPI,
getFilesClassifyMarkListAPI,
} from '@/api/archivesManagement/fileClassificationTags';
import { mapGetters } from 'vuex';
import website from '@/config/website';
export default {
data() {
return {
form: {},
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
selectionList: [],
option: {
height: 'auto',
calcHeight: 32,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
viewBtn: true,
selection: false,
addBtn:true,
dialogClickModal: false,
column: [
{
label: '文件分类标记名称',
prop: 'classifyMarkName',
search: true,
rules: [
{
required: true,
message: '请输入文件分类标记名称',
trigger: 'blur',
},
],
},
{
label: '更新人',
prop: 'updateUserName',
display: false,
},
{
label: '更新时间',
prop: 'updateTime',
display: false,
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
span: 24,
minRows: 6,
},
],
},
data: [],
};
},
computed: {
...mapGetters(['permission']),
permissionList() {
return {
addBtn: this.validData(this.permission.post_add, false),
viewBtn: this.validData(this.permission.post_view, false),
delBtn: this.validData(this.permission.post_delete, false),
editBtn: this.validData(this.permission.post_edit, false),
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(',');
},
},
methods: {
rowSave(row, done, loading) {
//
const submitData = {
classifyMarkName: row.classifyMarkName,
remark: row.remark
};
addArchivalCatalogueAPI(submitData).then(
() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
done();
},
error => {
console.error('新增失败:', error);
loading(); // loading
}
);
},
rowUpdate(row, index, done, loading) {
//
const submitData = {
id: row.id,
classifyMarkName: row.classifyMarkName,
remark: row.remark,
};
editArchivalCatalogueAPI(submitData).then(
() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
done();
},
error => {
console.log(error);
loading(); //
}
);
},
rowDel(row) {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return delArchivalCatalogueAPI(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return delArchivalCatalogueAPI(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type, row) {
done(); // done()
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
let data = {
...params,
pageNum:page.currentPage,
pageSize:page.pageSize
};
getFilesClassifyMarkListAPI(data).then(res => {
const data = res.data;
this.page.total = data.total;
this.data = data.rows;
this.loading = false;
this.selectionClear();
});
},
},
};
</script>
<style></style>