This commit is contained in:
parent
1a936db5cc
commit
d4aebdcf5b
|
|
@ -0,0 +1,28 @@
|
||||||
|
import request from '@/axios';
|
||||||
|
|
||||||
|
// 文件分类标记-通用下拉选
|
||||||
|
export async function getClassifyMarkSelApi(params) {
|
||||||
|
return await request({
|
||||||
|
url: '/blade-system/archive/getFilesClassifyMarkSelect',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 部门下拉树
|
||||||
|
export async function getDeptSelectApi(params) {
|
||||||
|
return await request({
|
||||||
|
url: '/blade-system/transferApply/getDeptSelect',
|
||||||
|
method: 'post',
|
||||||
|
data: {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 角色下拉选
|
||||||
|
export async function getRoleSelectApi(params) {
|
||||||
|
return await request({
|
||||||
|
url: '/blade-system/system/role/select',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -24,6 +24,9 @@
|
||||||
getStatusText(row.transferStatus)
|
getStatusText(row.transferStatus)
|
||||||
}}
|
}}
|
||||||
</template>
|
</template>
|
||||||
|
<template #deptId="{ row }">
|
||||||
|
{{ row.deptName }}
|
||||||
|
</template>
|
||||||
</avue-crud>
|
</avue-crud>
|
||||||
</basic-container>
|
</basic-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -32,6 +35,7 @@
|
||||||
import {
|
import {
|
||||||
getTransferRecordListApi,
|
getTransferRecordListApi,
|
||||||
} from '@/api/filesTransfer/record';
|
} from '@/api/filesTransfer/record';
|
||||||
|
import { getDeptSelectApi } from '@/api/select'
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import website from '@/config/website';
|
import website from '@/config/website';
|
||||||
|
|
||||||
|
|
@ -66,6 +70,7 @@ export default {
|
||||||
{
|
{
|
||||||
label: '项目名称',
|
label: '项目名称',
|
||||||
prop: 'proName',
|
prop: 'proName',
|
||||||
|
search: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -76,10 +81,25 @@ export default {
|
||||||
{
|
{
|
||||||
label: '移交时间',
|
label: '移交时间',
|
||||||
prop: 'transferTime',
|
prop: 'transferTime',
|
||||||
|
search: true,
|
||||||
|
type: 'date',
|
||||||
|
format: 'YYYY-MM-DD', // 👈 大写!Element Plus 格式
|
||||||
|
valueFormat: 'YYYY-MM-DD', // 👈 必须大写
|
||||||
|
dataType: 'string' // 推荐加上,确保返回字符串
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '接收部门',
|
label: '接收部门',
|
||||||
prop: 'deptName',
|
prop: 'deptId',
|
||||||
|
search: true,
|
||||||
|
type: 'tree',
|
||||||
|
dicData: [], // 初始空,后面动态赋值
|
||||||
|
props: {
|
||||||
|
label: 'label',
|
||||||
|
value: 'id',
|
||||||
|
children: 'children'
|
||||||
|
},
|
||||||
|
// 显示时用插槽展示 deptName(因为 row.deptName 是名称)
|
||||||
|
slot: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '移交清单',
|
label: '移交清单',
|
||||||
|
|
@ -94,6 +114,7 @@ export default {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
data: [],
|
data: [],
|
||||||
|
treeDataList:[],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -171,8 +192,42 @@ export default {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
loadDeptOptions() {
|
||||||
|
getDeptSelectApi().then(res => {
|
||||||
|
this.treeDataList = this.convertToVueTree(res.data.data);
|
||||||
|
// 找到 deptId 列并更新 dicData
|
||||||
|
const deptColumn = this.option.column.find(col => col.prop === 'deptId');
|
||||||
|
if (deptColumn) {
|
||||||
|
deptColumn.dicData = this.treeDataList; // Vue 3 可直接赋值;Vue 2 建议用 this.$set
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('加载部门列表失败', err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 树数据过滤 - 支持无限层级转换
|
||||||
|
convertToVueTree(data, level = 1) {
|
||||||
|
if (!data || !Array.isArray(data)) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
return data.map(item => {
|
||||||
|
const node = {
|
||||||
|
id: item.deptId,
|
||||||
|
label: item.deptName,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.children && Array.isArray(item.children) && item.children.length > 0) {
|
||||||
|
if (level < 3) {
|
||||||
|
const children = this.convertToVueTree(item.children, level + 1)
|
||||||
|
if (children.length > 0) node.children = children
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return node
|
||||||
|
})
|
||||||
|
},
|
||||||
onLoad(page, params = {}) {
|
onLoad(page, params = {}) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
this.loadDeptOptions();
|
||||||
let data = {
|
let data = {
|
||||||
...params,
|
...params,
|
||||||
pageNum:page.currentPage,
|
pageNum:page.currentPage,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue