This commit is contained in:
parent
9f60bc37d5
commit
42759b3574
|
|
@ -35,3 +35,11 @@ export function getKyFilesMultiClassifyListAPI(data) {
|
||||||
data: data,
|
data: data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function detail(data) {
|
||||||
|
return request({
|
||||||
|
url: '/blade-system/files/multi/detail',
|
||||||
|
method: 'POST',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,285 @@
|
||||||
|
<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 { getList, getDetail, add, update, remove } from '@/api/archivesManagement/archClassification';
|
||||||
|
import {
|
||||||
|
delKyFilesMultiClassifyAPI,
|
||||||
|
getKyFilesMultiClassifyListAPI,
|
||||||
|
updateKyFilesMultiClassifyAPI,
|
||||||
|
addKyFilesMultiClassifyAPI,
|
||||||
|
detail } from '@/api/archivesManagement/archClassification';
|
||||||
|
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: 'pid', //该列对应的数据字段名(即后端返回或提交时使用的 key)。
|
||||||
|
type: 'select', //指定该字段在表单中的输入类型为“下拉选择框”
|
||||||
|
dicUrl: '/blade-system/system/dict/data/type', // 接口地址
|
||||||
|
dicMethod: 'post', // 指定为 POST 请求
|
||||||
|
dicQuery: {
|
||||||
|
dictType: 'file_related_type' //作为请求体(body)发送(Avue 内部会处理)
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
label: 'dictLabel',
|
||||||
|
value: 'dictValue',
|
||||||
|
},
|
||||||
|
slot: true,
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择分类类型',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '分类名称',
|
||||||
|
prop: 'classifyName',
|
||||||
|
search: true,
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入分类名称',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '维度',
|
||||||
|
prop: 'pid', //该列对应的数据字段名(即后端返回或提交时使用的 key)。
|
||||||
|
type: 'select', //指定该字段在表单中的输入类型为“下拉选择框”
|
||||||
|
dicUrl: '/blade-system/system/dict/data/type', // 接口地址
|
||||||
|
dicMethod: 'post', // 指定为 POST 请求
|
||||||
|
dicQuery: {
|
||||||
|
dictType: 'dimension' //作为请求体(body)发送(Avue 内部会处理)
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
label: 'dictLabel',
|
||||||
|
value: 'dictValue',
|
||||||
|
},
|
||||||
|
slot: true,
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择维度',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
label: '更新人',
|
||||||
|
prop: 'updateUserName',
|
||||||
|
editDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '更新时间',
|
||||||
|
prop: 'updateTime',
|
||||||
|
editDisplay:false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '备注',
|
||||||
|
prop: 'classifyDesc',
|
||||||
|
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) {
|
||||||
|
addKyFilesMultiClassifyAPI(row).then(
|
||||||
|
() => {
|
||||||
|
this.onLoad(this.page);
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '操作成功!',
|
||||||
|
});
|
||||||
|
done();
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
window.console.log(error);
|
||||||
|
loading();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
rowUpdate(row, index, done, loading) {
|
||||||
|
updateKyFilesMultiClassifyAPI(row).then(
|
||||||
|
() => {
|
||||||
|
this.onLoad(this.page);
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '操作成功!',
|
||||||
|
});
|
||||||
|
done();
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
window.console.log(error);
|
||||||
|
loading();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
rowDel(row) {
|
||||||
|
this.$confirm('确定将选择数据删除?', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
return delKyFilesMultiClassifyAPI(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 delKyFilesMultiClassifyAPI(this.ids);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.onLoad(this.page);
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '操作成功!',
|
||||||
|
});
|
||||||
|
this.$refs.crud.toggleSelection();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
beforeOpen(done, type) {
|
||||||
|
if (['edit', 'view'].includes(type)) {
|
||||||
|
detail(this.form.id).then(res => {
|
||||||
|
this.form = res.data.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
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
|
||||||
|
};
|
||||||
|
getKyFilesMultiClassifyListAPI(data).then(res => {
|
||||||
|
const data = res.data;
|
||||||
|
this.page.total = data.total;
|
||||||
|
this.data = data.rows;
|
||||||
|
this.loading = false;
|
||||||
|
this.selectionClear();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
Loading…
Reference in New Issue