|
|
@@ -130,6 +130,16 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <!-- 仅当是总控平台时显示 -->
|
|
|
+ <el-form-item v-if="isMainPlatform" label="所属平台" prop="platformCode">
|
|
|
+ <el-select v-model="form.platformCode" placeholder="请选择平台">
|
|
|
+ <el-option v-for="dict in sys_platform_code" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
@@ -146,6 +156,7 @@ import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild }
|
|
|
import { DeptForm, DeptQuery, DeptVO } from '@/api/system/dept/types';
|
|
|
import { UserVO } from '@/api/system/user/types';
|
|
|
import { listUserByDeptId } from '@/api/system/user';
|
|
|
+import { getPlatformCode } from '@/utils/platform';
|
|
|
|
|
|
interface DeptOptionsType {
|
|
|
deptId: number | string;
|
|
|
@@ -154,7 +165,7 @@ interface DeptOptionsType {
|
|
|
}
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
|
|
|
+const { sys_normal_disable, sys_platform_code } = toRefs<any>(proxy?.useDict('sys_normal_disable', 'sys_platform_code'));
|
|
|
|
|
|
const deptList = ref<DeptVO[]>([]);
|
|
|
const loading = ref(true);
|
|
|
@@ -162,6 +173,8 @@ const showSearch = ref(true);
|
|
|
const deptOptions = ref<DeptOptionsType[]>([]);
|
|
|
const isExpandAll = ref(true);
|
|
|
const deptUserList = ref<UserVO[]>([]);
|
|
|
+const currentPlatform = getPlatformCode();
|
|
|
+const isMainPlatform = computed(() => currentPlatform === 'main');
|
|
|
|
|
|
const dialog = reactive<DialogOption>({
|
|
|
visible: false,
|
|
|
@@ -181,7 +194,8 @@ const initFormData: DeptForm = {
|
|
|
leader: undefined,
|
|
|
phone: undefined,
|
|
|
email: undefined,
|
|
|
- status: '0'
|
|
|
+ status: '0',
|
|
|
+ platformCode: ''
|
|
|
};
|
|
|
const initData: PageData<DeptForm, DeptQuery> = {
|
|
|
form: { ...initFormData },
|
|
|
@@ -196,6 +210,7 @@ const initData: PageData<DeptForm, DeptQuery> = {
|
|
|
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
|
|
deptName: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
|
|
|
orderNum: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }],
|
|
|
+ platformCode: [{ required: true, message: '所属平台不能为空', trigger: 'blur' }],
|
|
|
email: [{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
|
|
|
phone: [{ pattern: /^1[3456789][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }]
|
|
|
}
|
|
|
@@ -267,6 +282,10 @@ const handleAdd = async (row?: DeptVO) => {
|
|
|
if (row && row.deptId) {
|
|
|
form.value.parentId = row?.deptId;
|
|
|
}
|
|
|
+ if (row && row.platformCode) {
|
|
|
+ form.value.platformCode = row?.platformCode;
|
|
|
+ }
|
|
|
+ console.log(row);
|
|
|
dialog.visible = true;
|
|
|
dialog.title = '添加部门';
|
|
|
}
|