|
@@ -33,6 +33,15 @@
|
|
<BatchTagsDialog ref="batchTagsDialogRef" :crudExpose="crudExpose" />
|
|
<BatchTagsDialog ref="batchTagsDialogRef" :crudExpose="crudExpose" />
|
|
<BatchCategoryDialog ref="batchCategoryDialogRef" :crudExpose="crudExpose" />
|
|
<BatchCategoryDialog ref="batchCategoryDialogRef" :crudExpose="crudExpose" />
|
|
<BatchCompetencyTagsDialog ref="batchCompetencyTagsDialogRef" :crudExpose="crudExpose" />
|
|
<BatchCompetencyTagsDialog ref="batchCompetencyTagsDialogRef" :crudExpose="crudExpose" />
|
|
|
|
+ <el-drawer v-model="drawerVisible" title="添加分类" direction="rtl" size="500px" :close-on-click-modal="false" :before-close="handleDrawerClose">
|
|
|
|
+ <DocumentFormCom
|
|
|
|
+ v-if="drawerVisible"
|
|
|
|
+ :initFormData="drawerFormData"
|
|
|
|
+ :cacheData="documentTreeCacheData"
|
|
|
|
+ :treeData="documentTreeData"
|
|
|
|
+ @drawerClose="handleDrawerClose"
|
|
|
|
+ />
|
|
|
|
+ </el-drawer>
|
|
</fs-page>
|
|
</fs-page>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -46,7 +55,13 @@ import { RoleMenuFieldStores } from './stores/RoleMenuFieldStores';
|
|
import { RoleUsersStores } from './stores/RoleUsersStores';
|
|
import { RoleUsersStores } from './stores/RoleUsersStores';
|
|
import { successMessage } from '../../../utils/message';
|
|
import { successMessage } from '../../../utils/message';
|
|
import TreeList from './components/treeList.vue';
|
|
import TreeList from './components/treeList.vue';
|
|
-import { GetDocumentTree, GetCategoryList, GetTagList } from '../positionList/api';
|
|
|
|
|
|
+import { GetDocumentTree, GetCategoryList, GetTagList,DeleteDocumentCategory } from '../positionList/api';
|
|
|
|
+import { successNotification } from '/@/utils/message';
|
|
|
|
+import DocumentFormCom from '../positionList/components/DocumentFormCom/index.vue';
|
|
|
|
+
|
|
|
|
+/* import { GetDocumentTree, DeleteDocumentCategory, UpdateDocument ,UpdateSequence, GetInterviewQuestions,AddDocument,
|
|
|
|
+ GetCategoryList, GetTagList
|
|
|
|
+ } from '../positionList/api'; */
|
|
|
|
|
|
const PermissionDrawerCom = defineAsyncComponent(() => import('./components/RoleDrawer.vue'));
|
|
const PermissionDrawerCom = defineAsyncComponent(() => import('./components/RoleDrawer.vue'));
|
|
const BatchTagsDialog = defineAsyncComponent(() => import('./components/BatchTagsDialog.vue'));
|
|
const BatchTagsDialog = defineAsyncComponent(() => import('./components/BatchTagsDialog.vue'));
|
|
@@ -56,6 +71,10 @@ const BatchCompetencyTagsDialog = defineAsyncComponent(() => import('./component
|
|
const batchTagsDialogRef = ref();
|
|
const batchTagsDialogRef = ref();
|
|
const batchCategoryDialogRef = ref();
|
|
const batchCategoryDialogRef = ref();
|
|
const batchCompetencyTagsDialogRef = ref();
|
|
const batchCompetencyTagsDialogRef = ref();
|
|
|
|
+const drawerVisible = ref(false);
|
|
|
|
+const drawerFormData = ref({});
|
|
|
|
+const documentTreeRef = ref<DocumentTreeRef | null>(null);
|
|
|
|
+ const documentTreeCacheData = ref<any[]>([]);
|
|
|
|
|
|
const RoleDrawer = RoleDrawerStores(); // 角色-抽屉
|
|
const RoleDrawer = RoleDrawerStores(); // 角色-抽屉
|
|
const RoleMenuBtn = RoleMenuBtnStores(); // 角色-菜单
|
|
const RoleMenuBtn = RoleMenuBtnStores(); // 角色-菜单
|
|
@@ -64,6 +83,16 @@ const RoleUsers = RoleUsersStores();// 角色-用户
|
|
const treeListRef = ref();
|
|
const treeListRef = ref();
|
|
const treeData = ref([]);
|
|
const treeData = ref([]);
|
|
|
|
|
|
|
|
+// 添加类型定义
|
|
|
|
+interface DocumentTreeRef {
|
|
|
|
+ treeRef?: {
|
|
|
|
+ currentNode?: {
|
|
|
|
+ parent?: {
|
|
|
|
+ data: any;
|
|
|
|
+ };
|
|
|
|
+ };
|
|
|
|
+ };
|
|
|
|
+}
|
|
// 定义树节点的类型
|
|
// 定义树节点的类型
|
|
interface TreeNode {
|
|
interface TreeNode {
|
|
id: string;
|
|
id: string;
|
|
@@ -101,6 +130,30 @@ const { crudBinding, crudRef, crudExpose } = useFs({
|
|
|
|
|
|
const selectedCategoryId = ref(1);
|
|
const selectedCategoryId = ref(1);
|
|
|
|
|
|
|
|
+// 关闭抽屉
|
|
|
|
+const handleDrawerClose = (type: string) => {
|
|
|
|
+ if (type === 'submit') {
|
|
|
|
+ getTreeData();
|
|
|
|
+ }
|
|
|
|
+ drawerVisible.value = false;
|
|
|
|
+ drawerFormData.value = {};
|
|
|
|
+};
|
|
|
|
+// 删除文档分类
|
|
|
|
+const handleDeleteDocument = (id: any, callback: any) => {
|
|
|
|
+ ElMessageBox.confirm('您确认删除该文档分类吗?', '温馨提示', {
|
|
|
|
+ confirmButtonText: '确认',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ }).then(async () => {
|
|
|
|
+ const res = await DeleteDocumentCategory(id);
|
|
|
|
+ callback();
|
|
|
|
+ if (res?.code === 2000) {
|
|
|
|
+ successNotification(res.msg);
|
|
|
|
+ getTreeData();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
const handleTreeClick = (node: any) => {
|
|
const handleTreeClick = (node: any) => {
|
|
console.log('record', node);
|
|
console.log('record', node);
|
|
|
|
|
|
@@ -151,13 +204,24 @@ const handleTreeClick = (node: any) => {
|
|
crudExpose.doSearch(searchParams);
|
|
crudExpose.doSearch(searchParams);
|
|
};
|
|
};
|
|
|
|
|
|
-const handleUpdateDocument = (node: any) => {
|
|
|
|
- console.log('node', node);
|
|
|
|
|
|
+// 处理文档分类的新增或编辑
|
|
|
|
+const handleUpdateDocument = (type: any, record: any) => {
|
|
|
|
+ if (type === 'update' && record) {
|
|
|
|
+ const parentData = documentTreeRef.value?.treeRef?.currentNode?.parent?.data || {};
|
|
|
|
+ documentTreeCacheData.value = [parentData];
|
|
|
|
+ drawerFormData.value = record;
|
|
|
|
+ }
|
|
|
|
+ drawerVisible.value = true;
|
|
};
|
|
};
|
|
|
|
|
|
-const handleDeleteDocument = (node: any) => {
|
|
|
|
- console.log('node', node);
|
|
|
|
-};
|
|
|
|
|
|
+// 关闭抽屉
|
|
|
|
+/* const handleDrawerClose = (type: string) => {
|
|
|
|
+ if (type === 'submit') {
|
|
|
|
+ getTreeData();
|
|
|
|
+ }
|
|
|
|
+ drawerVisible.value = false;
|
|
|
|
+ drawerFormData.value = {};
|
|
|
|
+}; */
|
|
|
|
|
|
// 获取文档树数据
|
|
// 获取文档树数据
|
|
const getTreeData = () => {
|
|
const getTreeData = () => {
|