Browse Source

reactor:对接预案库;

zhangchong 4 months ago
parent
commit
5a88a112c6
4 changed files with 125 additions and 647 deletions
  1. 11 0
      src/api/plan/index.ts
  2. 28 180
      src/views/plan/index/edit.vue
  3. 50 177
      src/views/plan/index/index.vue
  4. 36 290
      src/views/plan/retrieval/index.vue

+ 11 - 0
src/api/plan/index.ts

@@ -13,4 +13,15 @@ export const getPlanList = (params?: object) => {
 		method: 'get',
 		params,
 	});
+};
+/**
+ * @description 案例查重
+ * @param {object} data
+ */
+export const planRepeat = (data: object) => {
+	return request({
+		url: '/api/v1/Plan/list/exist',
+		method: 'post',
+		data,
+	});
 };

+ 28 - 180
src/views/plan/index/edit.vue

@@ -3,24 +3,6 @@
 		<el-card shadow="never" style="padding: 0 50px">
 			<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="120px" scroll-to-error>
 				<el-row :gutter="35">
-					<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
-						<el-skeleton :loading="state.loading" animated>
-							<template #template>
-								<el-form-item label="知识归属">
-									<el-skeleton-item variant="h1" />
-								</el-form-item>
-							</template>
-							<template #default>
-								<el-form-item label="知识归属" prop="attribution" :rules="[{ required: true, message: '请选择知识归属', trigger: 'change' }]">
-									<!--  是否是中心 -->
-									<el-select v-model="state.ruleForm.attribution" placeholder="请选择知识归属" class="w100" :disabled="!userInfos.isCenter">
-										<el-option label="中心预案库" value="中心预案库" />
-										<el-option label="部门预案库" value="部门预案库" />
-									</el-select>
-								</el-form-item>
-							</template>
-						</el-skeleton>
-					</el-col>
 					<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
 						<el-skeleton :loading="state.loading" animated>
 							<template #template>
@@ -29,14 +11,14 @@
 								</el-form-item>
 							</template>
 							<template #default>
-								<el-form-item label="预案分类" prop="knowledgeTypeId" :rules="[{ required: true, message: '请选择预案分类', trigger: 'change' }]">
+								<el-form-item label="预案分类" prop="PlanTypeID" :rules="[{ required: true, message: '请选择预案分类', trigger: 'change' }]">
 									<VTreeDrop
 										:data="state.typeData"
 										checkable
 										keyField="id"
 										titleField="name"
-										v-model="state.ruleForm.knowledgeTypeId"
-										@checked-change="getKnowledgeListData1"
+										v-model="state.ruleForm.PlanTypeID"
+										@checked-change="selectType"
 										:dropHeight="400"
 										dropPlaceholder="预案分类"
 										dropdownWidthFixed
@@ -104,44 +86,6 @@
 										<el-radio :value="true">是</el-radio>
 										<el-radio :value="false">否</el-radio>
 									</el-radio-group>
-									<span class="color-danger ml10" v-if="state.ruleForm.isPublic">(公开后将在12345官网进行展示)</span>
-								</el-form-item>
-							</template>
-						</el-skeleton>
-					</el-col>
-					<!--					<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
-						<el-skeleton :loading="state.loading" animated>
-							<template #template>
-								<el-form-item label="来源部门" prop="sourceOrganizeId" :rules="[{ required: true, message: '请选择来源部门', trigger: 'change' }]">
-									<el-skeleton-item variant="h1" />
-								</el-form-item>
-							</template>
-							<template #default>
-								<el-form-item label="来源部门" prop="sourceOrganizeId" :rules="[{ required: true, message: '请选择来源部门', trigger: 'change' }]">
-									<el-cascader
-										:options="orgsOptions"
-										filterable
-										:props="{ value: 'id', label: 'name', emitPath: false, checkStrictly: true }"
-										placeholder="请选择来源部门"
-										class="w100"
-										v-model="state.ruleForm.sourceOrganizeId"
-										ref="orgRef"
-									>
-									</el-cascader>
-								</el-form-item>
-							</template>
-						</el-skeleton>
-					</el-col>-->
-					<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
-						<el-skeleton :loading="state.loading" animated>
-							<template #template>
-								<el-form-item label="热点分类">
-									<el-skeleton-item variant="h1" />
-								</el-form-item>
-							</template>
-							<template #default>
-								<el-form-item label="热点分类" prop="hotspotId" :rules="[{ required: false, message: '请选择热点分类', trigger: 'change' }]">
-									<hot-spot-select v-model="state.ruleForm.hotspotId" v-model:externalArr="state.hotspotExternal" @change="chooseHotSpot" clearable />
 								</el-form-item>
 							</template>
 						</el-skeleton>
@@ -160,37 +104,6 @@
 							</template>
 						</el-skeleton>
 					</el-col>
-					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-						<el-skeleton :loading="state.loading" animated>
-							<template #template>
-								<el-form-item label="关键词">
-									<el-skeleton-item variant="h1" />
-								</el-form-item>
-							</template>
-							<template #default>
-								<el-form-item label="关键词" prop="keywordsName" :rules="[{ required: false, message: '关键词', trigger: 'change' }]">
-									<el-input v-model="state.ruleForm.keywordsName" readonly placeholder="关键词" max-length="200" clearable>
-									</el-input>
-								</el-form-item>
-							</template>
-						</el-skeleton>
-					</el-col>
-					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-						<el-skeleton :loading="state.loading" animated>
-							<template #template>
-								<el-form-item label="预案库模板">
-									<el-skeleton-item variant="h1" />
-								</el-form-item>
-							</template>
-							<template #default>
-								<el-form-item label="预案库模板" prop="template" :rules="[{ required: false, message: '请选择预案库模板', trigger: 'change' }]">
-									<el-select v-model="state.ruleForm.template" placeholder="请选择预案库模板" class="w100" @change="selectTemplate" clearable>
-										<el-option :label="item.label" :value="item.value" v-for="item in templateList" :key="item.id" />
-									</el-select>
-								</el-form-item>
-							</template>
-						</el-skeleton>
-					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-skeleton :loading="state.loading" animated>
 							<template #template>
@@ -204,9 +117,9 @@
 										v-model:get-html="state.ruleForm.content"
 										:disable="state.disable"
 										placeholder="请填写预案内容"
-										@blur="isRepeat('content')"
 										:defaultContent="defaultContent"
 										ref="editorRef"
+										@blur="isRepeat('content')"
 									/>
 								</el-form-item>
 							</template>
@@ -259,19 +172,15 @@ import { useUserInfo } from '@/stores/userInfo';
 import { Local } from '@/utils/storage';
 import other from '@/utils/other';
 import { throttle, transformFile } from '@/utils/tools';
-import { treeList } from '@/api/knowledge/type';
-import { KnowledgeAdd, knowledgeContent, KnowledgeInfo, knowledgeKeyword, KnowledgeUpdate } from '@/api/knowledge';
-import { templateList } from '@/views/knowledge/index/template';
+import { KnowledgeAdd, knowledgeContent, KnowledgeInfo, KnowledgeUpdate } from '@/api/knowledge';
 import { disabledDate } from '@/utils/constants';
-import { removeDuplicate } from '@/utils/arrayOperation';
-import { useThemeConfig } from '@/stores/themeConfig';
 import { VTreeDrop } from '@wsfe/vue-tree';
 import { planTreeList } from '@/api/plan/type';
+import { planRepeat } from '@/api/plan';
 // 引入组件
 const Editor = defineAsyncComponent(() => import('@/components/Editor/index.vue')); // 富文本编辑器
 const ProcessAudit = defineAsyncComponent(() => import('@/components/ProcessAudit/index.vue')); // 流程审批
 const AnnexList = defineAsyncComponent(() => import('@/components/AnnexList/index.vue')); // 附件组件
-const HotSpotSelect = defineAsyncComponent(() => import('@/components/Hotspot/index.vue')); // 选择热点
 const stores = useUserInfo(); // 用户信息
 const { userInfos } = storeToRefs(stores); // 用户信息
 
@@ -279,61 +188,28 @@ const { userInfos } = storeToRefs(stores); // 用户信息
 const state = reactive<any>({
 	dialogVisible: false,
 	ruleForm: {
-		attribution: userInfos.value.isCenter ? '中心预案库' : '部门预案库', // 预案归属
+		attribution: '中心预案库', // 预案归属
 		isPublic: true, // 是否公开
-		keywords: [], // 关键字
-		keywordsName: null, // 关键字名称
-		knowledgeTypeId: [], // 知识分类
-		hotspotId: null, // 热点分类
-		knowledges: [], // 关联知识
 		files: [], // 附件
-		template: null, // 知识库模板
-		content: '', // 知识内容
-		sourceOrganizeId: null, // 知识来源部门
-		title: null, // 知识标题
-		source: null, // 知识来源
+		content: '', // 内容
+		title: null, // 标题
 	},
-	typeData: [], // 知识分类
+	typeData: [], // 分类
 	loading: false,
-	hotspotExternal: [],
-	knowledgeOptions: [], //关联知识
 });
-const storesThemeConfig = useThemeConfig();
-const { themeConfig } = storeToRefs(storesThemeConfig);
 const ruleFormRef = ref<any>(); // 表单ref
-// 选择热点分类
-const chooseHotSpot = (val: any, node: any, externalArr: any) => {
-	if (val) {
-		state.ruleForm.hotspotSpliceName = val.hotSpotFullName; // 热点分类拼接名称
-		state.ruleForm.hotspotName = val.hotSpotName; // 热点分类名称
-		state.ruleForm.hotspotCode = val.provinceCode; // 热点分类code
-		state.ruleForm.hotspotExternal = externalArr.join(',') ?? ''; // 热点分类默认展开项
-	} else {
-		state.ruleForm.hotspotSpliceName = null;
-		state.ruleForm.hotspotName = null;
-		state.ruleForm.hotspotCode = null;
-		state.ruleForm.hotspotExternal = null;
-	}
-};
 const validatePassTitle = (rule: any, value: any, callback: any) => {
 	if (value === '' || value === null) {
-		callback(new Error('请填写知识标题'));
+		callback(new Error('请填写案例标题'));
 	} else if (Repeat.value) {
 		callback(new Error('有相似标题,请检查!'));
 	} else {
 		callback();
 	}
 };
-const validatePassSummary = (rule: any, value: any, callback: any) => {
-	if (Repeat.value) {
-		callback(new Error('有相似摘要,请检查!'));
-	} else {
-		callback();
-	}
-};
 const validatePassContent = (rule: any, value: any, callback: any) => {
 	if (value === '' || value === null) {
-		callback(new Error('请填写知识内容'));
+		callback(new Error('请填写案例内容'));
 	} else if (Repeat.value) {
 		callback(new Error('有相似内容,请检查!'));
 	} else {
@@ -342,10 +218,9 @@ const validatePassContent = (rule: any, value: any, callback: any) => {
 };
 // 校验标题/摘要/内容是否重复  根据输入标题检测出关键词填入
 const Repeat = ref<boolean>(false);
-const keyWordsNameArr = ref<any>([]);
 const isRepeat = (type: string) => {
 	if (state.ruleForm[type]) {
-		knowledgeContent({ [type]: state.ruleForm[type], id: state.ruleForm.id })
+		planRepeat({ [type]: state.ruleForm[type], id: state.ruleForm.id })
 			.then((res: any) => {
 				Repeat.value = res.result;
 				ruleFormRef.value.validateField(type);
@@ -354,15 +229,6 @@ const isRepeat = (type: string) => {
 				state.ruleForm[type] = '';
 			});
 	}
-	knowledgeKeyword({ title: state.ruleForm.title }).then((res) => {
-		if (res.result.length) {
-			const nameArr = res.result.map((item: any) => item.tag);
-			const ids = res.result.map((item: any) => item.id);
-			keyWordsNameArr.value = removeDuplicate([...keyWordsNameArr.value, ...nameArr]);
-			state.ruleForm.keywordsName = keyWordsNameArr.value.join(',');
-			state.ruleForm.keywords = removeDuplicate([...state.ruleForm.keywords, ...ids]);
-		}
-	});
 };
 // 默认配置
 const defaultContent = ref([
@@ -372,16 +238,12 @@ const defaultContent = ref([
 		lineHeight: '2',
 	},
 ]);
-const getKnowledgeListData1 = (value: any) => {
-	state.ruleForm.knowledgeType = value.map((item: any) => {
-		return { KnowledgeTypeName: item.name, KnowledgeTypeId: item.id, KnowledgeTypeSpliceName: item.spliceName };
+const selectType = (value: any) => {
+	state.ruleForm.planType = value.map((item: any) => {
+		return { planTypeName: item.name, PlanTypeID: item.id, planTypeSpliceName: item.spliceName };
 	});
-	state.ruleForm.knowledgeTypeId = value.map((item: any) => item.id);
-	ruleFormRef.value.validateField('knowledgeTypeId')
-};
-// 选择知识库模板
-const selectTemplate = (val: any) => {
-	state.ruleForm.content = state.ruleForm.content + val;
+	state.ruleForm.PlanTypeID = value.map((item: any) => item.id);
+	ruleFormRef.value.validateField('PlanTypeID');
 };
 // 提交审核
 const processAuditRef = ref<RefType>(); // 流程组件
@@ -463,9 +325,9 @@ const onPreview = () => {
 	}
 	Local.set('previewForm', state.ruleForm);
 	router.push({
-		name: 'knowledgePreview',
+		name: 'planPreview',
 		params: {
-			tagsViewName: '知识预览',
+			tagsViewName: '案例预览',
 			id: '0',
 		},
 	});
@@ -500,9 +362,9 @@ const onSaveOnly = throttle(async (formEl: FormInstance | undefined) => {
 const onCancel = () => {
 	state.loading = true;
 	mittBus.emit('onCurrentContextmenuClick', Object.assign({}, { contextMenuClickId: 1, ...route }));
-	mittBus.emit('clearCache', 'knowledgeManage');
+	mittBus.emit('clearCache', 'planManage');
 	router.push({
-		path: '/knowledge/index',
+		path: '/plan/index',
 	});
 	state.loading = false;
 };
@@ -511,25 +373,19 @@ const handleSuccess = () => {
 	ElMessage.success('操作成功');
 	// 关闭当前 tagsView
 	mittBus.emit('onCurrentContextmenuClick', Object.assign({}, { contextMenuClickId: 1, ...route }));
-	mittBus.emit('clearCache', 'knowledgeManage');
+	mittBus.emit('clearCache', 'planManage');
 	router.push({
-		path: '/knowledge/index',
+		path: '/plan/index',
 	});
 };
-const orgsOptions = ref<EmptyArrayType>([]); // 来源单位
-// 知识分类
-const getKnowledgeType = async () => {
+// 获取分类
+const getType = async () => {
 	state.loading = true;
 	try {
 		const [typeDataRes] = await Promise.all([
 			planTreeList({ IsEnable: true }),
-			// KnowledgeGetKnowledge(),
-			// getCanUseOrg(),
 		]);
 		state.typeData = typeDataRes.result ?? [];
-		// state.knowledgeOptions = knowledgeOptionsRes.result ?? [];
-		// orgsOptions.value = orgsOptionsRes.result ?? [];
-
 		state.loading = false;
 	} catch (error) {
 		console.log(error);
@@ -542,19 +398,11 @@ const getDetail = async () => {
 		const res: any = await KnowledgeInfo(route.params.id); //知识详情
 		state.ruleForm = res.result ?? {};
 		state.ruleForm.files = transformFile(state.ruleForm.files);
-		if (state.ruleForm.hotspotExternal) {
-			//热点分类默认展开
-			state.hotspotExternal = state.ruleForm.hotspotExternal.split(',');
-		}
-		state.ruleForm.knowledges = state.ruleForm.knowledges ?? [];
-		if (state.ruleForm.keywordsDto && state.ruleForm.keywordsDto.length) {
-			state.ruleForm.keywordsName = state.ruleForm.keywordsDto.map((item: any) => item.tag).join(',');
-		}
-		state.ruleForm.knowledgeTypeId = state.ruleForm.knowledgeType.map((item: any) => item.knowledgeTypeId);
+		state.ruleForm.PlanTypeID = state.ruleForm.planType.map((item: any) => item.PlanTypeID);
 	}
 };
 onMounted(async () => {
-	await getKnowledgeType();
+	await getType();
 	await nextTick();
 	await getDetail();
 });

+ 50 - 177
src/views/plan/index/index.vue

@@ -3,145 +3,34 @@
 		<div class="layout-padding-auto layout-padding-view pd20">
 			<splitpanes class="h100" :horizontal="horizontal">
 				<pane min-size="16" max-size="25" size="16">
-					<template v-if="userInfos.isCenter">
-						<el-tabs v-model="state.activeName" stretch @tab-change="resetNode">
-							<el-tab-pane label="预案分类" name="1" :disabled="state.tableLoading">
-								<el-input v-model="filterType" placeholder="请填写预案分类名称" class="input-with-select mb10" clearable @input="onQueryChangedType">
-								</el-input>
-							</el-tab-pane>
-							<el-tab-pane label="部门" name="0" :disabled="state.tableLoading">
-								<el-input v-model="filterOrg" placeholder="请填写部门名称" class="input-with-select mb10" clearable @input="onQueryChanged">
-								</el-input>
-							</el-tab-pane>
-							<el-tab-pane label="热点" name="2" :disabled="state.tableLoading">
-								<el-input v-model="filterHot" placeholder="请填写热点名称" class="input-with-select mb10" clearable @input="inputHotspot"> </el-input>
-							</el-tab-pane>
-						</el-tabs>
-						<el-scrollbar style="height: calc(100% - 100px);'" ref="scrollBarRef">
-							<el-skeleton :loading="state.orgLoading" animated :rows="10" v-if="state.activeName === '0'">
-								<template #default>
-									<el-auto-resizer>
-										<template #default="{ height, width }">
-											<el-tree-v2
-												:data="state.orgData"
-												highlight-current
-												:expand-on-click-node="false"
-												:props="{ children: 'children', label: 'name' }"
-												@node-click="handleNodeClick"
-												ref="orgRef"
-												:filter-method="filterNode"
-												:item-size="32"
-												empty-text="暂无组织数据"
-												:height="height"
-											>
-												<template #default="{ node }">
-													<text-tooltip :content="node.label+'('+node.data.knowledgeNum+')'" effect="dark" placement="top"></text-tooltip>
-												</template>
-											</el-tree-v2>
-										</template>
-									</el-auto-resizer>
-								</template>
-							</el-skeleton>
-							<el-skeleton :loading="state.typeLoading" animated :rows="10" v-if="state.activeName === '1'">
-								<template #default>
-									<el-auto-resizer>
-										<template #default="{ height, width }">
-											<el-tree-v2
-												:data="state.knowledgeOptions"
-												highlight-current
-												:expand-on-click-node="false"
-												:props="{ children: 'children', label: 'name' }"
-												@node-click="handleNodeClick"
-												ref="typeRef"
-												:filter-method="filterNodeType"
-												:item-size="32"
-												empty-text="暂无预案分类"
-												:height="height"
-												node-key="id"
-											>
-												<template #default="{ node }">
-													<text-tooltip :content="node.label+'('+node.data.knowledgeNum+')'" effect="dark" placement="top"></text-tooltip>
-												</template>
-											</el-tree-v2>
-										</template>
-									</el-auto-resizer>
-								</template>
-							</el-skeleton>
-							<el-skeleton :loading="state.hotspotLoading" animated :rows="10" v-if="state.activeName === '2'">
-								<template #default>
-									<el-tree
-										node-key="id"
-										:load="loadNode"
-										lazy
-										v-if="lazyShow"
-										:props="{
-											label: 'hotSpotFullName',
-											children: 'children',
-											isLeaf: 'hasChild',
-										}"
-										:filter-node-method="filterNodeHot"
-										@node-click="handleNodeClick"
-										highlight-current
-										check-strictly
-										:expand-on-click-node="false"
-										ref="hotRef"
-									>	<template #default="{ node }">
-										<text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
+					<el-input v-model="filterType" placeholder="请填写预案分类名称" class="input-with-select mb10" clearable @input="onQueryChangedType">
+					</el-input>
+					<el-scrollbar ref="scrollBarRef" noresiz style="height: calc(100% - 50px);'">
+						<el-skeleton :loading="state.typeLoading" animated :rows="10">
+							<template #default>
+								<el-auto-resizer>
+									<template #default="{ height, width }">
+										<el-tree-v2
+											:data="state.knowledgeOptions"
+											highlight-current
+											:expand-on-click-node="false"
+											:props="{ children: 'children', label: 'name' }"
+											@node-click="handleNodeClick"
+											ref="typeRef"
+											:filter-method="filterNodeType"
+											:item-size="36"
+											empty-text="暂无预案分类"
+											:height="height"
+										>
+											<template #default="{ node }">
+												<text-tooltip :content="node.label" effect="dark" placement="top"></text-tooltip>
+											</template>
+										</el-tree-v2>
 									</template>
-									</el-tree>
-									<el-tree
-										ref="hotRef"
-										:data="state.hotSpotData"
-										node-key="id"
-										v-else
-										default-expand-all
-										highlight-current
-										:props="{
-											label: 'hotSpotFullName',
-											children: 'children',
-										}"
-										:filter-node-method="filterNodeHot"
-										@node-click="handleNodeClick"
-										:expand-on-click-node="false"
-										check-strictly
-									>
-										<template #default="{ node }">
-											<text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
-										</template>
-									</el-tree>
-								</template>
-							</el-skeleton>
-						</el-scrollbar>
-					</template>
-					<template v-else>
-						<el-input v-model="filterType" placeholder="请填写预案分类名称" class="input-with-select mb10" clearable> </el-input>
-						<el-scrollbar ref="scrollBarRef" noresiz style="height: calc(100% - 50px);'">
-							<el-skeleton :loading="state.typeLoading" animated :rows="10">
-								<template #default>
-									<el-auto-resizer>
-										<template #default="{ height, width }">
-											<el-tree-v2
-												:data="state.knowledgeOptions"
-												highlight-current
-												:expand-on-click-node="false"
-												:props="{ children: 'children', label: 'name' }"
-												@node-click="handleNodeClick"
-												ref="typeRef"
-												:filter-method="filterNodeType"
-												:item-size="36"
-												empty-text="暂无预案分类"
-												:height="height"
-											>
-												<template #default="{ node }">
-													<text-tooltip :content="node.label+'('+node.data.knowledgeNum+')'" effect="dark" placement="top"></text-tooltip>
-												</template>
-											</el-tree-v2>
-										</template>
-									</el-auto-resizer>
-								</template>
-							</el-skeleton>
-						</el-scrollbar>
-					</template>
+								</el-auto-resizer>
+							</template>
+						</el-skeleton>
+					</el-scrollbar>
 				</pane>
 				<pane class="h100" style="display: flex; flex-direction: column; flex: 1">
 					<el-tabs v-model="state.queryParams.Status" @tab-change="handleClick" v-loading="state.loading">
@@ -212,7 +101,7 @@
 							:loading="state.tableLoading"
 							:data="state.tableData"
 							:column-config="{ resizable: true }"
-							:row-config="{ isCurrent: true, isHover: true, height: 30,useKey:true }"
+							:row-config="{ isCurrent: true, isHover: true, height: 30, useKey: true }"
 							ref="tableRef"
 							height="auto"
 							auto-resize
@@ -460,24 +349,24 @@ const state = reactive<any>({
 		Status: 3, //状态 默认已上架
 		OrgId: null, //组织机构
 		HotSpotTypeId: null, //热点分类
-		KnowledgeTypeId: null, //预案类型
+		PlanTypeID: null, //预案类型
 		Title: null, //标题
 		Summary: null, //摘要
 		ModuleCode: '',
 		NewDraftsStatus: -1,
 		Attribution: userInfos.value.isCenter ? '中心预案库' : '部门预案库',
-		sjTime:[], // 上架时间
-		StartOnShelfTime:null,
-		EndOnShelfTime:null,
-		xjTime:[], // 下架时间
-		StartOffShelfTime:null,
-		EndOffShelfTime:null,
-		cjTime:[], // 创建时间
-		CreationStartTime:null,
-		CreationEndTime:null,
-		gxTime:[], // 更新时间
-		StartUpdateTime:null,
-		EndUpdateTime:null,
+		sjTime: [], // 上架时间
+		StartOnShelfTime: null,
+		EndOnShelfTime: null,
+		xjTime: [], // 下架时间
+		StartOffShelfTime: null,
+		EndOffShelfTime: null,
+		cjTime: [], // 创建时间
+		CreationStartTime: null,
+		CreationEndTime: null,
+		gxTime: [], // 更新时间
+		StartUpdateTime: null,
+		EndUpdateTime: null,
 	},
 	activeName: '1', //tab切换 默认预案分类
 	tableData: [], //表格数据
@@ -488,8 +377,8 @@ const state = reactive<any>({
 	knowledgeOptions: [], //知识库类型数据
 	statusOptions: [], //状态数据
 	hotSpotData: [], //热点数据
-	hotspotLoading:false, // 热点loading
-	orgLoading:false, // 部门loading
+	hotspotLoading: false, // 热点loading
+	orgLoading: false, // 部门loading
 	typeLoading: false, // 知识类型loading
 });
 
@@ -538,10 +427,10 @@ const filterNodeHot = (value: string, data: any) => {
 	return data.hotSpotName.includes(value);
 };
 const lazyShow = ref(true);
-const inputHotspot = debounce((val:string)=>{
+const inputHotspot = debounce((val: string) => {
 	state.hotspotLoading = true;
 	if (val) {
-		knowledgeHotSpotSearch({name:val,Attribution:state.queryParams.Attribution})
+		knowledgeHotSpotSearch({ name: val, Attribution: state.queryParams.Attribution })
 			.then((res) => {
 				//获取后端搜索的数据
 				state.hotSpotData.length = 0;
@@ -555,12 +444,12 @@ const inputHotspot = debounce((val:string)=>{
 	} else if (val == '' || val == ' ' || val == null) {
 		state.hotspotLoading = false;
 	}
-},500)
+}, 500);
 // 热点分类懒加载
 const loadNode = async (node: any, resolve: any) => {
 	try {
 		if (node.isLeaf) return resolve([]);
-		const {result} = await knowledgeHotSpotList({ id: node.data.id ? node.data.id : null,Attribution:state.queryParams.Attribution });
+		const { result } = await knowledgeHotSpotList({ id: node.data.id ? node.data.id : null, Attribution: state.queryParams.Attribution });
 		resolve(result);
 	} catch (error) {
 		resolve([]);
@@ -593,7 +482,7 @@ const getOrgListApi = async () => {
 const getKnowledgeType = async () => {
 	state.typeLoading = true;
 	try {
-		const { result } = await treeList({ IsEnable: true,Attribution: state.queryParams.Attribution });
+		const { result } = await treeList({ IsEnable: true, Attribution: state.queryParams.Attribution });
 		state.knowledgeOptions = result ?? [];
 		state.typeLoading = false;
 	} catch (error) {
@@ -651,23 +540,7 @@ const queryList = () => {
 };
 // 点击节点
 const handleNodeClick = (data: any) => {
-	if (userInfos.value.isCenter) {
-		switch (state.activeName) {
-			case '0':
-				state.queryParams.CreateOrgId = data.id;
-				break;
-			case '1':
-				state.queryParams.KnowledgeTypeId = data.id;
-				break;
-			case '2':
-				state.queryParams.HotspotId = data.id;
-				break;
-			default:
-				break;
-		}
-	} else {
-		state.queryParams.KnowledgeTypeId = data.id;
-	}
+	state.queryParams.PlanTypeID = data.id;
 	queryList();
 };
 /** 重置按钮操作 */
@@ -683,7 +556,7 @@ const resetQuery = (formEl: FormInstance | undefined) => {
 // 重置选中的节点
 const resetNode = () => {
 	state.queryParams.CreateOrgId = null;
-	state.queryParams.KnowledgeTypeId = null;
+	state.queryParams.PlanTypeID = null;
 	state.queryParams.HotspotId = null;
 	state.queryParams.ModuleCode = '';
 	state.queryParams.NewDraftsStatus = -1;

+ 36 - 290
src/views/plan/retrieval/index.vue

@@ -1,150 +1,35 @@
 <template>
 	<div class="plan-retrieval-container layout-padding">
 		<el-card shadow="never" class="h100">
-			<el-tabs v-model="state.queryParams.Attribution" @tab-change="handleClick" v-if="userInfos.isCenter">
-				<el-tab-pane label="全部" name=" " :disabled="centerLoading"></el-tab-pane>
-				<el-tab-pane label="中心预案库" name="中心预案库" :disabled="centerLoading"></el-tab-pane>
-				<el-tab-pane label="部门预案库" name="部门预案库" :disabled="centerLoading"></el-tab-pane>
-			</el-tabs>
 			<splitpanes class="h100" Vertical>
 				<pane min-size="16" max-size="25" size="16" class="left-container">
-					<template v-if="userInfos.isCenter">
-						<el-tabs v-model="state.activeName" stretch @tab-change="resetNode">
-							<el-tab-pane label="预案分类" name="1" :disabled="centerLoading">
-								<el-input v-model="filterType" placeholder="请填写预案分类名称" class="input-with-select mb10" clearable @input="onQueryChangedType">
-								</el-input>
-							</el-tab-pane>
-							<el-tab-pane label="部门" name="0" :disabled="centerLoading">
-								<el-input v-model="filterOrg" placeholder="请填写部门名称" class="input-with-select mb10" clearable @input="onQueryChanged">
-								</el-input>
-							</el-tab-pane>
-							<el-tab-pane label="热点" name="2" :disabled="centerLoading">
-								<el-input v-model="filterHot" placeholder="请填写热点名称" class="input-with-select mb10" clearable @input="inputHotspot"> </el-input>
-							</el-tab-pane>
-						</el-tabs>
-						<el-scrollbar style="height: calc(100% - 160px);'" ref="scrollBarRef">
-							<el-skeleton :loading="state.orgLoading" animated :rows="10" v-if="state.activeName === '0'">
-								<template #default>
-									<el-auto-resizer>
-										<template #default="{ height, width }">
-											<el-tree-v2
-												:data="state.orgData"
-												highlight-current
-												:expand-on-click-node="false"
-												:props="{ children: 'children', label: 'name' }"
-												@node-click="handleNodeClick"
-												ref="orgRef"
-												:filter-method="filterNode"
-												:item-size="32"
-												empty-text="暂无组织数据"
-												:height="height"
-											>
-												<template #default="{ node }">
-													<text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
-												</template>
-											</el-tree-v2>
-										</template>
-									</el-auto-resizer>
-								</template>
-							</el-skeleton>
-							<el-skeleton :loading="state.typeLoading" animated :rows="10" v-if="state.activeName === '1'">
-								<template #default>
-									<el-auto-resizer>
-										<template #default="{ height, width }">
-											<el-tree-v2
-												:data="state.knowledgeOptions"
-												highlight-current
-												:expand-on-click-node="false"
-												:props="{ children: 'children', label: 'name' }"
-												@node-click="handleNodeClick"
-												ref="typeRef"
-												:filter-method="filterNodeType"
-												:item-size="32"
-												empty-text="暂无预案分类"
-												:height="height"
-											>
-												<template #default="{ node }">
-													<text-tooltip :content="node.label+'('+node.data.knowledgeNum+')'" effect="dark" placement="top"></text-tooltip>
-												</template>
-											</el-tree-v2>
-										</template>
-									</el-auto-resizer>
-								</template>
-							</el-skeleton>
-							<el-skeleton :loading="state.hotspotLoading" animated :rows="10" v-if="state.activeName === '2'">
-								<template #default>
-									<el-tree
-										node-key="id"
-										:load="loadNode"
-										lazy
-										v-if="lazyShow"
-										:props="{
-											label: 'hotSpotFullName',
-											children: 'children',
-											isLeaf: 'hasChild',
-										}"
-										:filter-node-method="filterNodeHot"
-										@node-click="handleNodeClick"
-										highlight-current
-										check-strictly
-										:expand-on-click-node="false"
-										ref="hotRef"
-									>	<template #default="{ node }">
-										<text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
-									</template>
-									</el-tree>
-									<el-tree
-										ref="hotRef"
-										:data="state.hotSpotData"
-										node-key="id"
-										v-else
-										default-expand-all
-										highlight-current
-										:props="{
-											label: 'hotSpotFullName',
-											children: 'children',
-										}"
-										:filter-node-method="filterNodeHot"
-										@node-click="handleNodeClick"
-										:expand-on-click-node="false"
-										check-strictly
-									>	<template #default="{ node }">
-										<text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
+					<el-input v-model="filterType" placeholder="请填写预案分类名称" class="input-with-select mb10" clearable @input="onQueryChangedType"> </el-input>
+					<el-scrollbar ref="scrollBarRef" style="height: calc(100% - 40px)">
+						<el-skeleton :loading="state.typeLoading" animated :rows="10">
+							<template #default>
+								<el-auto-resizer>
+									<template #default="{ height, width }">
+										<el-tree-v2
+											:data="state.knowledgeOptions"
+											highlight-current
+											:expand-on-click-node="false"
+											:props="{ children: 'children', label: 'name' }"
+											@node-click="handleNodeClick"
+											ref="typeRef"
+											:filter-method="filterNodeType"
+											:item-size="32"
+											empty-text="暂无预案分类"
+											:height="height"
+										>
+											<template #default="{ node }">
+												<text-tooltip :content="node.label" effect="dark" placement="top"></text-tooltip>
+											</template>
+										</el-tree-v2>
 									</template>
-									</el-tree>
-								</template>
-							</el-skeleton>
-						</el-scrollbar>
-					</template>
-					<template v-else>
-						<el-input v-model="filterType" placeholder="请填写预案分类名称" class="input-with-select mb10" clearable> </el-input>
-						<el-scrollbar ref="scrollBarRef" :style="userInfos.isCenter ? 'height: calc(100% - 90px);' : 'height: calc(100% - 50px)'">
-							<el-skeleton :loading="state.typeLoading" animated :rows="10">
-								<template #default>
-									<el-auto-resizer>
-										<template #default="{ height, width }">
-											<el-tree-v2
-												:data="state.knowledgeOptions"
-												highlight-current
-												:expand-on-click-node="false"
-												:props="{ children: 'children', label: 'name' }"
-												@node-click="handleNodeClick"
-												ref="typeRef"
-												:filter-method="filterNodeType"
-												:item-size="32"
-												empty-text="暂无预案分类"
-												:height="height"
-											>
-												<template #default="{ node }">
-													<text-tooltip :content="node.label+'('+node.data.knowledgeNum+')'" effect="dark" placement="top"></text-tooltip>
-												</template>
-											</el-tree-v2>
-										</template>
-									</el-auto-resizer>
-								</template>
-							</el-skeleton>
-						</el-scrollbar>
-					</template>
+								</el-auto-resizer>
+							</template>
+						</el-skeleton>
+					</el-scrollbar>
 				</pane>
 				<pane class="center-container">
 					<div class="input-box">
@@ -162,18 +47,10 @@
 								>
 								</el-input>
 								<el-button type="primary" class="btn" :loading="state.loading" @click="handleQuery"
-								><SvgIcon name="ele-Search" class="mr5" />搜索</el-button
+									><SvgIcon name="ele-Search" class="mr5" />搜索</el-button
 								>
 								<el-button @click="resetQuery" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置</el-button>
 							</div>
-							<div class="mt10" style="display: flex">
-								<div style="display: flex; align-items: flex-start; flex-wrap: wrap">
-									<div style="height: 18px; line-height: 18px">猜你想搜:</div>
-									<div class="keyword-box">
-										<span v-for="(v, i) in state.hotWordsList" :key="i" class="keyword-item" @click="keyWordSearch(v.keyWord)">{{ v.keyWord }}</span>
-									</div>
-								</div>
-							</div>
 						</div>
 					</div>
 					<div style="display: flex; margin: 10px 15px 0">
@@ -184,11 +61,7 @@
 							<el-radio value="3">创建时间</el-radio>
 						</el-radio-group>
 					</div>
-					<div
-						v-loading="centerLoading"
-						class="center-container-box"
-						:style="userInfos.isCenter ? 'height: calc(100% - 200px)' : 'height: calc(100% - 160px)'"
-					>
+					<div v-loading="centerLoading" class="center-container-box" style="height: calc(100% - 110px)">
 						<template v-if="state.retrievalList.length">
 							<el-scrollbar>
 								<div v-for="(v, i) in state.retrievalList" :key="i" class="retrieval-content-item" @click="onPreview(v)" title="查看详情">
@@ -230,7 +103,7 @@
 					</p>
 					<el-skeleton :loading="rightLoading" animated :rows="10">
 						<template #default>
-							<div class="top10 mt10" :style="userInfos.isCenter ? 'height: calc(100% - 160px);' : 'height: calc(100% - 100px)'">
+							<div class="top10 mt10" style="height: calc(100% - 90px)">
 								<template v-if="topList.length">
 									<el-scrollbar>
 										<div class="flex-center-between top10-items" v-for="(item, index) in topList" :key="item.id">
@@ -279,7 +152,7 @@ const state = reactive<any>({
 		// 查询条件
 		PageIndex: 1, // 当前页
 		PageSize: 10, // 每页条数
-		Attribution: userInfos.value.isCenter ? ' ' : '部门预案库',
+		Attribution: '中心预案库',
 		Keyword: null, // 关键词
 		RetrievalType: 0, // 检索类型
 		Sort: '1',
@@ -292,29 +165,11 @@ const state = reactive<any>({
 	retrievalList: [], // 检索列表
 	hotSpotData: [], // 热点数据
 	typeLoading: false, // 预案类型loading
-	hotspotLoading:false,
-	orgLoading:false,
+	hotspotLoading: false,
+	orgLoading: false,
 	hotWordsList: [], // 获取热词
 });
 const topList = ref<EmptyArrayType>([]); // 常用预案前10
-const handleClick = () => {
-	handleQuery();
-};
-// 部门查询
-const filterOrg = ref('');
-const orgRef = ref<RefType>();
-const onQueryChanged = (query: string) => {
-	if (query) {
-		orgRef.value!.filter(query);
-	} else {
-		orgRef.value!.filter(query);
-		orgRef.value?.setExpandedKeys([]);
-	}
-};
-const filterNode = (value: string, data: any) => {
-	if (!value) return true;
-	return data.name.includes(value);
-};
 // 预案分类查询
 const filterType = ref('');
 const typeRef = ref<RefType>();
@@ -330,65 +185,12 @@ const onQueryChangedType = (query: string) => {
 		typeRef.value?.setExpandedKeys([]);
 	}
 };
-// 热点查询
-const filterHot = ref('');
-const hotRef = ref<RefType>();
-watch(filterHot, (val) => {
-	if (val) {
-		lazyShow.value = false;
-	} else if (val == '' || val == ' ' || val == null) {
-		lazyShow.value = true; // 懒加载树显示
-	}
-});
-const filterNodeHot = (value: string, data: any) => {
-	if (!value) return true;
-	return data.hotSpotName.includes(value);
-};
-const inputHotspot = debounce((val:string)=>{
-	state.hotspotLoading = true;
-	if (val) {
-		knowledgeHotSpotSearch({name:val,Attribution:state.queryParams.Attribution})
-			.then((res) => {
-				//获取后端搜索的数据
-				state.hotSpotData.length = 0;
-				state.hotSpotData = res.result ?? [];
-				state.hotspotLoading = false;
-			})
-			.catch((e) => {
-				console.log(e);
-				state.hotspotLoading = false;
-			});
-	} else if (val == '' || val == ' ' || val == null) {
-		state.hotspotLoading = false;
-	}
-},500)
-// 热点分类懒加载
-const lazyShow = ref(true);
-const loadNode = async (node: any, resolve: any) => {
-	try {
-		if (node.isLeaf) return resolve([]);
-		const {result} = await knowledgeHotSpotList({ id: node.data.id ? node.data.id : null,Attribution:state.queryParams.Attribution });
-		resolve(result);
-	} catch (error) {
-		resolve([]);
-	}
-};
-// 获取所有组织结构 和基础数据
-const getOrgListApi = async () => {
-	state.orgLoading = true;
-	try {
-		const { result } = await knowledgeDepartmentList({ Attribution: state.queryParams.Attribution });
-		state.orgData = result ?? []; //部门
-		state.orgLoading = false;
-	} catch (error) {
-		state.orgLoading = false;
-	}
-};
+
 // 获取分类
 const getKnowledgeType = async () => {
 	state.typeLoading = true;
 	try {
-		const { result } = await planTreeList({ IsEnable: true,Attribution: state.queryParams.Attribution });
+		const { result } = await planTreeList({ IsEnable: true, Attribution: state.queryParams.Attribution });
 		state.knowledgeOptions = result ?? [];
 		state.typeLoading = false;
 	} catch (error) {
@@ -397,23 +199,7 @@ const getKnowledgeType = async () => {
 };
 // 点击节点
 const handleNodeClick = (data: any) => {
-	if (userInfos.value.isCenter) {
-		switch (state.activeName) {
-			case '0':
-				state.queryParams.CreateOrgId = data.id;
-				break;
-			case '1':
-				state.queryParams.KnowledgeTypeId = data.id;
-				break;
-			case '2':
-				state.queryParams.HotspotId = data.id;
-				break;
-			default:
-				break;
-		}
-	} else {
-		state.queryParams.KnowledgeTypeId = data.id;
-	}
+	state.queryParams.PlanTypeID = data.id;
 	handleQuery();
 };
 // 预览
@@ -477,51 +263,13 @@ const resetQuery = throttle(() => {
 	state.queryParams.Keyword = null;
 	state.queryParams.RetrievalType = 0;
 	state.queryParams.Sort = '1';
-	state.queryParams.Attribution = ' ';
-	state.activeName = '1';
-	state.queryParams.CreateOrgId = null;
-	state.queryParams.KnowledgeTypeId = null;
-	state.queryParams.HotspotId = null;
-	filterOrg.value = '';
+	state.queryParams.PlanTypeID = null;
 	filterType.value = '';
-	filterHot.value = '';
 	typeRef.value?.setCurrentKey(null);
-	orgRef.value?.setCurrentKey(null);
-	hotRef.value?.setCurrentKey(null);
-	orgRef.value?.filter();
-	orgRef.value?.setExpandedKeys([]);
 	typeRef.value?.filter();
 	typeRef.value?.setExpandedKeys([]);
-	hotRef.value?.filter();
 	queryList();
 }, 500);
-// 重置选中的节点
-const resetNode = () => {
-	state.queryParams.CreateOrgId = null;
-	state.queryParams.KnowledgeTypeId = null;
-	state.queryParams.HotspotId = null;
-	filterOrg.value = '';
-	filterType.value = '';
-	filterHot.value = '';
-	typeRef.value?.setCurrentKey(null);
-	orgRef.value?.setCurrentKey(null);
-	hotRef.value?.setCurrentKey(null);
-	queryList();
-};
-// 获取热词
-const getHotWords = async () => {
-	try {
-		const {result} = await getKnowledgeHotWordsList({ PageIndex: 1, PageSize: 10, IsEnable: true });
-		state.hotWordsList = result?.items ?? [];
-	} catch (error) {
-		console.log(error);
-	}
-};
-// 点击关键词检索
-const keyWordSearch = (word: string) => {
-	state.queryParams.Keyword = word;
-	handleQuery();
-};
 // 获取基础信息
 const knowledgeRetrievalType = ref<EmptyArrayType>([]);
 const getBaseData = async () => {
@@ -535,10 +283,8 @@ const getBaseData = async () => {
 onMounted(() => {
 	getBaseData();
 	getKnowledgeType();
-	getOrgListApi();
 	queryList();
 	querySearchNum();
-	getHotWords();
 });
 </script>