fix: bug 修复
This commit is contained in:
@@ -73,23 +73,26 @@
|
||||
|
||||
<a-modal
|
||||
title="用户信息"
|
||||
:width="600"
|
||||
:width="520"
|
||||
:visible="addformvisible"
|
||||
cancelText="取消"
|
||||
@ok="handleOk"
|
||||
@cancel="handleClose">
|
||||
<ns-form ref="modalFormRef" :schemas="formSchema2" :model="formData2" formLayout="vertical" />
|
||||
<ns-form
|
||||
ref="modalFormRef"
|
||||
:wrapperCol="{ span: 24 }"
|
||||
:schemas="formSchema2"
|
||||
:model="formData2"
|
||||
formLayout="vertical" />
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { computed, createVNode, defineComponent, nextTick, reactive, ref } from 'vue';
|
||||
import { computed, createVNode, defineComponent, reactive, ref, watchEffect } from 'vue';
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { NsMessage, NsModal } from '/nerv-lib/component';
|
||||
import { formConfig, formConfig2 } from './config';
|
||||
import { origanizemanage, department } from '/@/api/origanizemanage';
|
||||
import { origanizemanage } from '/@/api/origanizemanage';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'OrderListIndex',
|
||||
@@ -97,14 +100,24 @@
|
||||
const mainRef = ref();
|
||||
const data = reactive({});
|
||||
let formData = ref({});
|
||||
let formData2 = ref({ userRoleList: [1, 1, 3] });
|
||||
let formData2 = ref({});
|
||||
const formRef = ref();
|
||||
const modalFormRef = ref();
|
||||
const visible = ref(false);
|
||||
const addformvisible = ref(false);
|
||||
const searchValue = ref<string>('');
|
||||
const searchValue2 = ref<string>('');
|
||||
const formSchema = formConfig;
|
||||
const disabled = ref(false);
|
||||
|
||||
const opMap: any = ref({
|
||||
type: 'add',
|
||||
fuc: () => {},
|
||||
record: {},
|
||||
});
|
||||
watchEffect(() => {
|
||||
disabled.value = opMap.value.type === 'edit';
|
||||
});
|
||||
const formSchema = formConfig(disabled);
|
||||
const casData = ref([]);
|
||||
const formSchema2 = formConfig2(casData);
|
||||
const treeData = ref([]);
|
||||
@@ -120,30 +133,25 @@
|
||||
};
|
||||
|
||||
// 企业树
|
||||
fetch(origanizemanage.queryOrgTree).then((res) => {
|
||||
const otherOrg = res.data[0].listOrg;
|
||||
// 特殊处理
|
||||
treeData.value = res.data;
|
||||
otherOrg?.map((item) => {
|
||||
treeData.value.push({ orgInfo: item } as never);
|
||||
const getOrgTree = (params?) => {
|
||||
fetch(origanizemanage.queryOrgTree, params).then((res) => {
|
||||
const otherOrg = res.data[0].listOrg;
|
||||
// 特殊处理
|
||||
treeData.value = res.data;
|
||||
otherOrg?.map((item) => {
|
||||
treeData.value.push({ orgInfo: item } as never);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
getOrgTree();
|
||||
// 部门树
|
||||
fetch(origanizemanage.queryDeptTree).then((res) => {
|
||||
treeData2.value = res.data;
|
||||
});
|
||||
const opMap: any = {
|
||||
type: 'add',
|
||||
fuc: () => {},
|
||||
record: {},
|
||||
};
|
||||
|
||||
const onSearch = () => {
|
||||
console.log(searchValue.value);
|
||||
fetch(origanizemanage.queryOrgTree, { orgName: searchValue.value, orgId }).then((res) => {
|
||||
treeData.value = res.data;
|
||||
});
|
||||
getOrgTree({ orgName: searchValue.value, orgId });
|
||||
};
|
||||
const onSearch2 = () => {
|
||||
console.log(searchValue2.value);
|
||||
@@ -190,7 +198,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
opMap.fuc && opMap.fuc({ ...formData.value, userRoleList: userAuthList.value, orgId });
|
||||
opMap.value.fuc &&
|
||||
opMap.value.fuc({ ...formData.value, userRoleList: userAuthList.value, orgId });
|
||||
visible.value = false;
|
||||
});
|
||||
};
|
||||
@@ -225,8 +234,14 @@
|
||||
name: 'userAdd',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
opMap.type = 'add';
|
||||
opMap.fuc = (formData: any) => {
|
||||
opMap.value.type = 'add';
|
||||
setTimeout(() => {
|
||||
formData.value = {
|
||||
orgName: JSON.parse(sessionStorage.getItem('userInfo')).orgName,
|
||||
};
|
||||
userAuthList.value.splice(0);
|
||||
});
|
||||
opMap.value.fuc = (formData: any) => {
|
||||
http.post(origanizemanage.addUser, formData).then(() => {
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
visible.value = false;
|
||||
@@ -353,8 +368,8 @@
|
||||
formData.value = record;
|
||||
userAuthList.value.push(...record.userRoleInfos);
|
||||
}, 10);
|
||||
opMap.type = 'edit';
|
||||
opMap.fuc = (formData: any) => {
|
||||
opMap.value.type = 'edit';
|
||||
opMap.value.fuc = (formData: any) => {
|
||||
http.post(origanizemanage.editUser, formData).then(() => {
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
visible.value = false;
|
||||
@@ -466,7 +481,7 @@
|
||||
params: {},
|
||||
},
|
||||
// pagination: { defaultPageSize: 10 },
|
||||
rowKey: 'id',
|
||||
rowKey: 'userId',
|
||||
});
|
||||
const tableConfig2 = {
|
||||
// api: {
|
||||
|
Reference in New Issue
Block a user