fix: 页面字段/接口调整
This commit is contained in:
@@ -36,20 +36,20 @@ let queryParams = reactive({
|
||||
/**部门名称 */
|
||||
deptName: '',
|
||||
/**部门状态 */
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
});
|
||||
|
||||
/**查询参数重置 */
|
||||
function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
deptName: '',
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
});
|
||||
fnGetList();
|
||||
}
|
||||
|
||||
/**表格全展开行key */
|
||||
let expandedRowKeys: string[] = [];
|
||||
let expandedRowKeys: number[] = [];
|
||||
|
||||
/**表格状态类型 */
|
||||
type TabeStateType = {
|
||||
@@ -93,15 +93,15 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.dept.classSort'),
|
||||
dataIndex: 'orderNum',
|
||||
dataIndex: 'deptSort',
|
||||
align: 'left',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: t('views.system.dept.status'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
dataIndex: 'statusFlag',
|
||||
key: 'statusFlag',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
@@ -165,12 +165,12 @@ let modalState: ModalStateType = reactive({
|
||||
deptName: '',
|
||||
email: '',
|
||||
leader: '',
|
||||
orderNum: 0,
|
||||
deptSort: 0,
|
||||
parentId: '100',
|
||||
ancestors: '',
|
||||
parentName: null,
|
||||
phone: '',
|
||||
status: '0',
|
||||
statusFlag: '0',
|
||||
},
|
||||
confirmLoading: false,
|
||||
treeData: [],
|
||||
@@ -386,14 +386,15 @@ function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listDept(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
const treeData = parseDataToTree(res.data, 'deptId');
|
||||
// 初始上级部门和展开编号key
|
||||
if (treeDataAll.length <= 0) {
|
||||
// 转换树状数据
|
||||
treeDataAll = treeData;
|
||||
// 展开编号key
|
||||
expandedRowKeys = [...new Set(res.data.map(item => item.parentId))];
|
||||
const parentIds: number[] = res.data.map((item: any) => item.parentId);
|
||||
expandedRowKeys = [...new Set(parentIds)];
|
||||
fnTableExpandedRowsAll(tableState.expandedRowAll);
|
||||
}
|
||||
tableState.data = treeData;
|
||||
@@ -436,9 +437,12 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.dept.status')" name="status">
|
||||
<a-form-item
|
||||
:label="t('views.system.dept.status')"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
v-model:value="queryParams.statusFlag"
|
||||
allow-clear
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
@@ -547,8 +551,11 @@ onMounted(() => {
|
||||
@expandedRowsChange="fnTableExpandedRowsChange"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
|
||||
<template v-if="column.key === 'statusFlag'">
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="record.statusFlag"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'deptId'">
|
||||
<a-space :size="8" align="center">
|
||||
@@ -582,7 +589,7 @@ onMounted(() => {
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topRight" v-if="record.status !== '0'">
|
||||
<a-tooltip placement="topRight" v-if="record.statusFlag !== '0'">
|
||||
<template #title>{{
|
||||
t('views.system.dept.addClass')
|
||||
}}</template>
|
||||
@@ -643,19 +650,22 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dept.classSort')"
|
||||
name="orderNum"
|
||||
name="deptSort"
|
||||
>
|
||||
{{ modalState.from.orderNum }}
|
||||
{{ modalState.from.deptSort }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.dept.status')" name="status">
|
||||
<a-form-item
|
||||
:label="t('views.system.dept.status')"
|
||||
name="statusFlag"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
:value="modalState.from.statusFlag"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -755,9 +765,12 @@ onMounted(() => {
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.dept.status')" name="status">
|
||||
<a-form-item
|
||||
:label="t('views.system.dept.status')"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
v-model:value="modalState.from.statusFlag"
|
||||
default-value="0"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
@@ -767,10 +780,10 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dept.classSort')"
|
||||
name="orderNum"
|
||||
name="deptSort"
|
||||
>
|
||||
<a-input-number
|
||||
v-model:value="modalState.from.orderNum"
|
||||
v-model:value="modalState.from.deptSort"
|
||||
:min="0"
|
||||
:max="9999"
|
||||
:step="1"
|
||||
|
||||
Reference in New Issue
Block a user