yangyin
2024-11-18 efd9873b6400110f7651c29480ca1f3e46f6d845
修改部门管理
已修改1个文件
19 ■■■■■ 文件已修改
src/views/project/yw/systemManage/departmentMgr/optDlg/OptDlg.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/yw/systemManage/departmentMgr/optDlg/OptDlg.vue
@@ -51,12 +51,12 @@
import { deepClone } from '/@/utils/other';
import { travelTree } from '/@/utils/util';
const props = defineProps(['item', 'departmentTreeList']);
const { departmentTreeList } = toRefs(props);
const { departmentTreeList, item } = toRefs(props);
const emit = defineEmits(['update', 'insert']);
const parentSelectOptions = computed(() => {
    const cloneTreeData = deepClone(tableTreeData.value);
    travelTree(cloneTreeData, (value, index, array, parent) => {
        if ((value as any).id === parentForm.value.id) {
        if ((value as any).id === dialogFormValue.value.id) {
            if (parent === array) {
                parent?.splice(index, 1);
            } else {
@@ -74,7 +74,6 @@
const dialogHeaderIcon = computed(() => {
    return isEditDialog.value ? 'ele-Edit' : 'ele-Plus';
});
const dialogFormValue = ref(null);
const dialogIsShow = defineModel({
    type: Boolean,
});
@@ -120,14 +119,12 @@
};
//#endregion
const parentForm = ref(null);
const dialogFormValue = ref(null);
watch(
    () => dialogIsShow.value,
    (val) => {
        if (!val) return;
        const { id, parent_id, name, create_user, create_time } = props.item;
        parentForm.value = { id, parent_id, name, create_user, create_time };
        openOperateDialog(props.item);
        openOperateDialog(item.value);
    }
);
const tableTreeData = ref([]);
@@ -138,5 +135,13 @@
        tableTreeData.value = val;
    }
);
watch(
    () => item.value,
    (val) => {
        if (!val) return;
        const { id, parent_id, name, create_user, create_time } = item.value;
        dialogFormValue.value = { id, parent_id, name, create_user, create_time };
    }
);
</script>
<style scoped lang="scss"></style>