zhangchong 11 месяцев назад
Родитель
Сommit
c8b0c3f453
1 измененных файлов с 64 добавлено и 49 удалено
  1. 64 49
      src/views/knowledge/index/index.vue

+ 64 - 49
src/views/knowledge/index/index.vue

@@ -126,9 +126,16 @@
 								/>
 							</el-form-item>
 							<el-form-item label="是否公开" prop="IsPublic">
-								<el-select v-model="state.queryParams.IsPublic" placeholder="请选择是否公开" @change="handleQuery">
-									<el-option label="公开" :value="true" />
-									<el-option label="不公开" :value="false" />
+								<el-select v-model="state.queryParams.IsPublic" placeholder="请选择是否公开" @change="handleQuery" clearable>
+									<el-option label="是" :value="true" />
+									<el-option label="否" :value="false" />
+								</el-select>
+							</el-form-item>
+							<el-form-item label="审核类型" prop="ModuleCode" v-if="[1, 5].includes(state.queryParams.Status)">
+								<el-select v-model="state.queryParams.ModuleCode" placeholder="请选择审核类型" @change="handleQuery" clearable>
+									<el-option label="新增知识审批" value="KnowledgeAdd" />
+									<el-option label="知识更新" value="KnowledgeUpdate" />
+									<el-option label="知识删除" value="KnowledgeDelete" />
 								</el-select>
 							</el-form-item>
 							<el-form-item>
@@ -149,6 +156,7 @@
 							:total="state.total"
 							v-model:page-index="state.queryParams.PageIndex"
 							v-model:page-size="state.queryParams.PageSize"
+							:key="Math.random()"
 						>
 							<template #tableHeader="scope">
 								<el-button type="primary" @click="onOpenAddUser" v-auth="'knowledge:index:add'">
@@ -250,51 +258,7 @@ const AuditProgress = defineAsyncComponent(() => import('@/views/knowledge/compo
 
 const proTableRef = ref<RefType>(); // 表格ref
 // 表格配置项
-const columns = ref<any[]>([
-	{ prop: 'title', label: '标题', width: 300 },
-	{ prop: 'knowledgeType', label: '知识分类', width: 200 },
-	{ prop: 'statusName', label: '知识状态' },
-	{ prop: 'attribution', label: '知识归属', width: 120 },
-	{ prop: 'sourceOrganize.name', label: '来源部门', width: 120 },
-	{ prop: 'hotspotName', label: '热点', minWidth: 200 },
-	{ prop: 'isPublic', label: '是否公开' },
-	{ prop: 'pageView', label: '阅读次数' },
-	{
-		prop: 'onShelfTime',
-		label: '上架时间',
-		width: 170,
-		render: (scope) => {
-			return <span>{formatDate(scope.row.onShelfTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
-		},
-	},
-	{
-		prop: 'offShelfTime',
-		label: '下架时间',
-		width: 170,
-		render: (scope) => {
-			return <span>{formatDate(scope.row.offShelfTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
-		},
-	},
-	{ prop: 'creatorName', label: '创建人', width: 120 },
-	{ prop: 'creatorOrgName', label: '创建部门', width: 150 },
-	{
-		prop: 'creationTime',
-		label: '创建时间',
-		width: 170,
-		render: (scope) => {
-			return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
-		},
-	},
-	{
-		prop: 'lastModificationTime',
-		label: '更新时间',
-		width: 170,
-		render: (scope) => {
-			return <span>{formatDate(scope.row.lastModificationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
-		},
-	},
-	{ prop: 'operation', label: '操作', fixed: 'right', width: 250, align: 'center' },
-]);
+const columns = ref<any[]>([]);
 // 定义变量内容
 const state = reactive<any>({
 	queryParams: {
@@ -307,6 +271,7 @@ const state = reactive<any>({
 		KnowledgeTypeId: null, //知识类型
 		Title: null, //标题
 		Summary: null, //摘要
+    ModuleCode:null
 	},
 	activeName: '0', //tab切换
 	tableData: [], //表格数据
@@ -370,7 +335,7 @@ watch(filterHot, (val) => {
 		loading.value = true;
 		hotSpotSearch(val)
 			.then((res) => {
-				//获取后端搜索的数据 	//selectMacTree是我自己的后端接口,你们换成自己的
+				//获取后端搜索的数据
 				state.hotSpotData.length = 0;
 				state.hotSpotData = res.result ?? [];
 				hotRef.value!.filter(val);
@@ -420,6 +385,51 @@ const getKnowledgeType = async () => {
 		state.typeLoading = false;
 	}
 };
+const staticColumns = [
+	{ prop: 'title', label: '标题', width: 300 },
+	{ prop: 'knowledgeType', label: '知识分类', width: 200 },
+	{ prop: 'statusName', label: '知识状态' },
+	{ prop: 'attribution', label: '知识归属', width: 120 },
+	{ prop: 'sourceOrganize.name', label: '来源部门', width: 120 },
+	{ prop: 'hotspotName', label: '热点', minWidth: 200 },
+	{ prop: 'isPublic', label: '是否公开' },
+	{ prop: 'pageView', label: '阅读次数' },
+	{
+		prop: 'onShelfTime',
+		label: '上架时间',
+		width: 170,
+		render: (scope) => {
+			return <span>{formatDate(scope.row.onShelfTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
+		},
+	},
+	{
+		prop: 'offShelfTime',
+		label: '下架时间',
+		width: 170,
+		render: (scope) => {
+			return <span>{formatDate(scope.row.offShelfTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
+		},
+	},
+	{ prop: 'creatorName', label: '创建人', width: 120 },
+	{ prop: 'creatorOrgName', label: '创建部门', width: 150 },
+	{
+		prop: 'creationTime',
+		label: '创建时间',
+		width: 170,
+		render: (scope) => {
+			return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
+		},
+	},
+	{
+		prop: 'lastModificationTime',
+		label: '更新时间',
+		width: 170,
+		render: (scope) => {
+			return <span>{formatDate(scope.row.lastModificationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
+		},
+	},
+	{ prop: 'operation', label: '操作', fixed: 'right', width: 250, align: 'center' },
+];
 /** 获取知识列表 */
 const queryList = () => {
 	state.tableLoading = true;
@@ -427,6 +437,11 @@ const queryList = () => {
 		.then((response: any) => {
 			state.tableData = response?.result.items ?? [];
 			state.total = response?.result.total;
+			if ([1, 5].includes(state.queryParams.Status)) {
+				columns.value = [{ prop: 'workflow.moduleName', label: '审核类型', width: 120 }, ...staticColumns];
+			} else {
+				columns.value = staticColumns;
+			}
 			state.tableLoading = false;
 		})
 		.catch(() => {