This commit is contained in:
xuziqiang
2024-05-24 10:32:06 +08:00
2 changed files with 118 additions and 120 deletions

View File

@@ -85,9 +85,16 @@
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { uuid } from '@antv/x6/lib/util/string/uuid';
export default defineComponent({ export default defineComponent({
name: 'authorityManageIndex', name: 'AuthorityManageIndex',
setup() { setup() {
let formData = ref({});
let formData2 = ref({});
const activeKey = ref('1');
const activeKey2 = ref('1');
const disabled = ref(true);
const disabled2 = ref(true);
const ApartcheckedKeys = ref<string[]>([]); const ApartcheckedKeys = ref<string[]>([]);
const UsercheckedKeys = ref<string[]>([]); const UsercheckedKeys = ref<string[]>([]);
@@ -98,85 +105,13 @@
console.log('checkedKeys', UsercheckedKeys.value); console.log('checkedKeys', UsercheckedKeys.value);
}); });
const activeKey = ref('1'); const opMap: any = {
const activeKey2 = ref('1'); type: 'add',
const disabled = ref(false); fuc: () => {},
const disabled2 = ref(false); record: {},
const addApartment = () => {
disabled.value = false;
}; };
const addApartmentSon = () => { const apartmentTreeData = ref([
disabled.value = false;
};
const deleteApartment = () => {
Modal.confirm({
title: '是否确认删除',
icon: createVNode(ExclamationCircleOutlined),
content: createVNode('div', { style: 'color:red;' }, ''),
onOk() {},
onCancel() {
console.log('Cancel');
},
class: 'test',
});
};
const addUser = () => {
disabled2.value = false;
};
const addUserSon = () => {
disabled.value = false;
};
const deleteUser = () => {
Modal.confirm({
title: '是否确认删除',
icon: createVNode(ExclamationCircleOutlined),
content: createVNode('div', { style: 'color:red;' }, ''),
onOk() {},
onCancel() {
console.log('Cancel');
},
class: 'test',
});
};
const SelectApartmentTree = (selectedKeys: any, info: any) => {
console.log(selectedKeys, 'selectedKeys');
console.log(info, 'info');
};
const SelectUserTree = (selectedKeys: any, info: any) => {
console.log(selectedKeys, 'selectedKeys');
console.log(info, 'info');
};
const ApartmentSelect = (selectedKeys: any, info: any) => {
console.log(selectedKeys, 'selectedKeys');
console.log(info, 'info');
};
const UserSelect = (selectedKeys: any, info: any) => {
console.log(selectedKeys, 'selectedKeys');
console.log(info, 'info');
};
const ApartmentSure = () => {
disabled.value = !disabled.value;
};
const UserSure = () => {
disabled2.value = !disabled2.value;
};
const CancelApartment = () => {
disabled.value = true;
};
const CancelUser = () => {
disabled2.value = true;
};
const apartmentTreeData = [
{ {
title: '铁路总局', title: '铁路总局',
key: '0-0', key: '0-0',
@@ -185,8 +120,9 @@
{ title: '临沂站', key: '0-0-1' }, { title: '临沂站', key: '0-0-1' },
], ],
}, },
]; ]);
const userTreeData = [
const userTreeData = ref([
{ {
title: '产品总监', title: '产品总监',
key: '0-0', key: '0-0',
@@ -195,7 +131,7 @@
{ title: '产品助理', key: '0-0-1' }, { title: '产品助理', key: '0-0-1' },
], ],
}, },
]; ]);
const apartmentAdminTreeData = [ const apartmentAdminTreeData = [
{ {
@@ -219,36 +155,106 @@
}, },
]; ];
const userAdminTreeData = [ const userAdminTreeData = ref([
{ {
title: '首页', title: '产品总监',
key: '0-0', key: '0-0',
children: [ children: [
{ { title: '产品经理1', key: '0-0-0' },
title: '工作台', { title: '产品经理2', key: '0-0-1' },
key: '0-0-0',
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
], ],
}, },
{ ]);
title: '系统管理',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'sss' }],
},
],
},
];
let formData = reactive({ const addApartment = () => {
department: '', disabled.value = false;
remark: '', };
const addApartmentSon = () => {
disabled.value = false;
};
const addUser = () => {
disabled2.value = false;
};
const addUserSon = () => {
disabled.value = false;
};
const deleteApartment = () => {
Modal.confirm({
title: '是否确认删除',
icon: createVNode(ExclamationCircleOutlined),
content: createVNode('div', { style: 'color:red;' }, ''),
onOk() {},
onCancel() {
console.log('Cancel');
},
class: 'test',
}); });
let formData2 = reactive({ };
department: '',
remark: '', const deleteUser = () => {
Modal.confirm({
title: '是否确认删除',
icon: createVNode(ExclamationCircleOutlined),
content: createVNode('div', { style: 'color:red;' }, ''),
onOk() {},
onCancel() {
console.log('Cancel');
},
class: 'test',
}); });
};
const SelectApartmentTree = (selectedKeys: any, info: any) => {
disabled.value = false;
console.log(selectedKeys, 'selectedKeys');
console.log(info, 'info');
};
const SelectUserTree = (selectedKeys: any, info: any) => {
disabled2.value = false;
console.log(selectedKeys, 'selectedKeys');
console.log(info, 'info');
};
const CancelApartment = () => {
disabled.value = true;
};
const CancelUser = () => {
disabled2.value = true;
};
const ApartmentSelect = (selectedKeys: any, info: any) => {
console.log(selectedKeys, 'selectedKeys');
console.log(info, 'info');
};
const UserSelect = (selectedKeys: any, info: any) => {
console.log(selectedKeys, 'selectedKeys');
console.log(info, 'info');
};
const ApartmentSure = () => {
disabled.value = !disabled.value;
opMap.fuc && opMap.fuc(formData.value);
console.log(formData.value.name, 'formData');
apartmentTreeData.value[0].children.push({
title: formData.value.name,
key: 'a1',
});
};
const UserSure = () => {
disabled2.value = !disabled2.value;
opMap.fuc && opMap.fuc(formData2.value);
console.log(formData2.value, 'formData2');
userTreeData.value[0].children.push({
title: formData2.value.departname,
key: 'a2',
});
};
const formSchema = reactive([ const formSchema = reactive([
{ {
@@ -258,7 +264,7 @@
schemas: [ schemas: [
{ {
label: '部门名称', label: '部门名称',
field: 'department', field: 'name',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
disabled: disabled, disabled: disabled,
@@ -292,7 +298,7 @@
}, },
{ {
label: '部门编码', label: '部门编码',
field: 'department', field: 'code',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
disabled: disabled, disabled: disabled,
@@ -375,7 +381,7 @@
}, },
{ {
label: '节点编码', label: '节点编码',
field: 'department', field: 'code',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
disabled: disabled2, disabled: disabled2,
@@ -390,7 +396,7 @@
}, },
{ {
label: '是否部门领导', label: '是否部门领导',
field: 'sex', field: 'isleader',
component: 'NsRadioGroup', component: 'NsRadioGroup',
componentProps: { componentProps: {
disabled: disabled2, disabled: disabled2,

View File

@@ -41,7 +41,7 @@
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" class="table" /> <ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" />
</div> </div>
<a-drawer <a-drawer
:width="1200" :width="1200"
@@ -157,7 +157,7 @@
}; };
const handleOk = () => { const handleOk = () => {
opMap.fuc && opMap.fuc(formData2.value); // opMap.fuc && opMap.fuc(formData2.value);
addformvisible.value = false; addformvisible.value = false;
}; };
const handleClose = () => { const handleClose = () => {
@@ -646,8 +646,6 @@
} }
.left { .left {
width: 400px; width: 400px;
/* height: 95vh; */
// height: 92.7vh;
border-right: 5px solid rgb(229, 235, 240); border-right: 5px solid rgb(229, 235, 240);
min-width: fit-content; min-width: fit-content;
} }
@@ -661,17 +659,11 @@
} }
.ns-table-title { .ns-table-title {
text-align: left; text-align: left;
height: 46px; // height: 46px;
line-height: 46px; line-height: 46px;
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
user-select: text;
padding-left: 16px; padding-left: 16px;
width: 100%;
}
.table {
/* width: 2000px; */
/* width: auto; */
} }
.admin { .admin {
text-align: left; text-align: left;