|
@@ -21,7 +21,7 @@
|
|
|
<el-skeleton :loading="state.orgLoading" animated :rows="10" v-if="state.activeName === '0'">
|
|
|
<template #default>
|
|
|
<el-auto-resizer>
|
|
|
- <template #default="{ height, width }">
|
|
|
+ <template #default="{ height }">
|
|
|
<el-tree-v2
|
|
|
:data="state.orgData"
|
|
|
highlight-current
|
|
@@ -35,7 +35,7 @@
|
|
|
:height="height"
|
|
|
>
|
|
|
<template #default="{ node }">
|
|
|
- <text-tooltip :content="node.label+'('+node.data.knowledgeNum+')'" effect="dark" placement="top"></text-tooltip>
|
|
|
+ <text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
|
|
|
</template>
|
|
|
</el-tree-v2>
|
|
|
</template>
|
|
@@ -45,7 +45,7 @@
|
|
|
<el-skeleton :loading="state.typeLoading" animated :rows="10" v-if="state.activeName === '1'">
|
|
|
<template #default>
|
|
|
<el-auto-resizer>
|
|
|
- <template #default="{ height, width }">
|
|
|
+ <template #default="{ height }">
|
|
|
<el-tree-v2
|
|
|
:data="state.knowledgeOptions"
|
|
|
highlight-current
|
|
@@ -60,7 +60,7 @@
|
|
|
node-key="id"
|
|
|
>
|
|
|
<template #default="{ node }">
|
|
|
- <text-tooltip :content="node.label+'('+node.data.knowledgeNum+')'" effect="dark" placement="top"></text-tooltip>
|
|
|
+ <text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
|
|
|
</template>
|
|
|
</el-tree-v2>
|
|
|
</template>
|
|
@@ -77,7 +77,7 @@
|
|
|
:props="{
|
|
|
label: 'hotSpotFullName',
|
|
|
children: 'children',
|
|
|
- isLeaf: 'hasChild',
|
|
|
+ isLeaf: 'hasChild'
|
|
|
}"
|
|
|
:filter-node-method="filterNodeHot"
|
|
|
@node-click="handleNodeClick"
|
|
@@ -85,9 +85,10 @@
|
|
|
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>
|
|
|
+ >
|
|
|
+ <template #default="{ node }">
|
|
|
+ <text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
|
|
|
+ </template>
|
|
|
</el-tree>
|
|
|
<el-tree
|
|
|
ref="hotRef"
|
|
@@ -98,7 +99,7 @@
|
|
|
highlight-current
|
|
|
:props="{
|
|
|
label: 'hotSpotFullName',
|
|
|
- children: 'children',
|
|
|
+ children: 'children'
|
|
|
}"
|
|
|
:filter-node-method="filterNodeHot"
|
|
|
@node-click="handleNodeClick"
|
|
@@ -119,7 +120,7 @@
|
|
|
<el-skeleton :loading="state.typeLoading" animated :rows="10">
|
|
|
<template #default>
|
|
|
<el-auto-resizer>
|
|
|
- <template #default="{ height, width }">
|
|
|
+ <template #default="{ height }">
|
|
|
<el-tree-v2
|
|
|
:data="state.knowledgeOptions"
|
|
|
highlight-current
|
|
@@ -133,7 +134,7 @@
|
|
|
:height="height"
|
|
|
>
|
|
|
<template #default="{ node }">
|
|
|
- <text-tooltip :content="node.label+'('+node.data.knowledgeNum+')'" effect="dark" placement="top"></text-tooltip>
|
|
|
+ <text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
|
|
|
</template>
|
|
|
</el-tree-v2>
|
|
|
</template>
|
|
@@ -181,7 +182,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="handleQuery" :loading="state.tableLoading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
|
|
|
-<!-- <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.tableLoading">
|
|
|
+ <!-- <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.tableLoading">
|
|
|
<SvgIcon name="ele-Refresh" class="mr5" />重置
|
|
|
</el-button>-->
|
|
|
<el-button @click="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
|
|
@@ -210,15 +211,14 @@
|
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
|
</el-dropdown>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="onAuditBatch"
|
|
|
- v-if="state.queryParams.Status === 1"
|
|
|
- v-auth="'knowledge:index:audit:batch'"
|
|
|
- :loading="state.loading"
|
|
|
- :disabled="isChecked"
|
|
|
- >
|
|
|
- <SvgIcon name="ele-Edit" class="mr5" />批量审核
|
|
|
+ <el-button type="primary" @click="onOpen" v-auth="'knowledge:index:open:batch'" :loading="state.loading" :disabled="isChecked">
|
|
|
+ 批量公开
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" @click="onPrivate" v-auth="'knowledge:index:private:batch'" :loading="state.loading" :disabled="isChecked">
|
|
|
+ 批量不公开
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" @click="onImport" v-auth="'knowledge:index:import'" :loading="state.tableLoading">
|
|
|
+ <SvgIcon name="ele-Upload" class="mr5" />知识导入
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</vxe-toolbar>
|
|
@@ -228,7 +228,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
|
|
@@ -299,7 +299,7 @@
|
|
|
type="danger"
|
|
|
@click="onRowDel(row)"
|
|
|
title="删除"
|
|
|
- v-if="[0, 2, 4, 5, 6].includes(row.newStatus) && row.status !== 1 && ['YiBin'].includes(themeConfig.appScope)"
|
|
|
+ v-if="[0, 2, 4, 5, 6].includes(row.newStatus) && row.status !== 1"
|
|
|
v-auth="'knowledge:index:delete'"
|
|
|
>
|
|
|
删除
|
|
@@ -324,20 +324,6 @@
|
|
|
>
|
|
|
上架
|
|
|
</el-button>
|
|
|
- <el-button link type="primary" @click="onprogress(row)" title="查看审核记录" v-if="[5].includes(row.newStatus)">
|
|
|
- 审核记录
|
|
|
- </el-button>
|
|
|
- <!-- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="onAudit(row)"
|
|
|
- title="审批"
|
|
|
- v-if="[1, 2].includes(row.status) && row.isCanHandle"
|
|
|
- v-auth="'business:order:handle'"
|
|
|
- >
|
|
|
- 审批
|
|
|
- </el-button>-->
|
|
|
- <el-button link type="primary" @click="onPreview(row)" title="查看"> 查看 </el-button>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
</vxe-table>
|
|
@@ -417,12 +403,10 @@
|
|
|
<el-button @click="resetQuery(drawerRuleFormRef)" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
|
|
|
</template>
|
|
|
</el-drawer>
|
|
|
- <!-- 流程审批 -->
|
|
|
- <process-audit ref="processAuditRef" @orderProcessSuccess="queryList" />
|
|
|
- <!-- 审核记录 -->
|
|
|
- <audit-progress ref="auditProgressRef" />
|
|
|
- <!-- 批量审批 -->
|
|
|
- <to-end ref="toEndRef" @updateList="queryList" />
|
|
|
+ <!-- 知识导入 -->
|
|
|
+ <knowledge-import ref="knowledgeImportRef" @updateList="queryList" />
|
|
|
+ <!-- 删除或者更新提交审核 -->
|
|
|
+ <edit-submit-audit ref="editSubmitAuditRef" @updateList="handleQuery" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -434,39 +418,33 @@ import type { FormInstance } from 'element-plus';
|
|
|
import { formatDate } from '@/utils/formatTime';
|
|
|
import {
|
|
|
KnowledgePaged,
|
|
|
- KnowledgeOffShelf,
|
|
|
KnowledgeOnTheShelf,
|
|
|
baseData,
|
|
|
- KnowledgeDel,
|
|
|
knowledgeExport,
|
|
|
knowledgeDetailExport,
|
|
|
+ knowledgeDraftUpdatePublic,
|
|
|
+ KnowledgeOffShelfNew,
|
|
|
} from '@/api/knowledge';
|
|
|
-import { getOrgListByUser } from '@/api/system/organize';
|
|
|
import { knowledgeDepartmentList, knowledgeHotSpotList, knowledgeHotSpotSearch, treeList } from '@/api/knowledge/type';
|
|
|
-import { hotSpotSearch, hotSpotType } from '@/api/business/order';
|
|
|
import { Splitpanes, Pane } from 'splitpanes';
|
|
|
import 'splitpanes/dist/splitpanes.css';
|
|
|
import { useUserInfo } from '@/stores/userInfo';
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
import Other from '@/utils/other';
|
|
|
-import { debounce, downloadFileByStream, throttle } from '@/utils/tools';
|
|
|
-import { useThemeConfig } from '@/stores/themeConfig';
|
|
|
+import { debounce, downloadFileByStream } from '@/utils/tools';
|
|
|
import { VxeUI } from 'vxe-pc-ui';
|
|
|
import { defaultTimeStartEnd, shortcuts } from '@/utils/constants';
|
|
|
|
|
|
// 引入组件
|
|
|
-const ProcessAudit = defineAsyncComponent(() => import('@/components/ProcessAudit/index.vue')); // 流程审批
|
|
|
-const AuditProgress = defineAsyncComponent(() => import('@/views/knowledge/components/Audit-progress.vue')); // 编写规范
|
|
|
const TextTooltip = defineAsyncComponent(() => import('@/components/TextTooltip/index.vue'));
|
|
|
-const ToEnd = defineAsyncComponent(() => import('@/views/knowledge/index/components/To-end.vue')); // 批量审批
|
|
|
const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
|
|
|
+const KnowledgeImport = defineAsyncComponent(() => import('@/views/knowledge/index/components/knowledge-import.vue')); // 知识导入
|
|
|
+const EditSubmitAudit = defineAsyncComponent(() => import('@/views/plan/index/components/Edit-submit-audit.vue')); // 删除或者更新 提交审核
|
|
|
|
|
|
const router = useRouter(); //路由
|
|
|
const horizontal = ref(false);
|
|
|
const storesUserInfo = useUserInfo();
|
|
|
const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
|
|
|
-const storesThemeConfig = useThemeConfig();
|
|
|
-const { themeConfig } = storeToRefs(storesThemeConfig);
|
|
|
|
|
|
// 定义变量内容
|
|
|
const state = reactive<any>({
|
|
@@ -483,18 +461,18 @@ const state = reactive<any>({
|
|
|
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: [], //表格数据
|
|
@@ -505,8 +483,8 @@ const state = reactive<any>({
|
|
|
knowledgeOptions: [], //知识库类型数据
|
|
|
statusOptions: [], //状态数据
|
|
|
hotSpotData: [], //热点数据
|
|
|
- hotspotLoading:false, // 热点loading
|
|
|
- orgLoading:false, // 部门loading
|
|
|
+ hotspotLoading: false, // 热点loading
|
|
|
+ orgLoading: false, // 部门loading
|
|
|
typeLoading: false, // 知识类型loading
|
|
|
});
|
|
|
|
|
@@ -555,10 +533,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;
|
|
@@ -572,12 +550,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([]);
|
|
@@ -610,7 +588,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) {
|
|
@@ -746,36 +724,9 @@ const onPreview = (row: any) => {
|
|
|
},
|
|
|
});
|
|
|
};
|
|
|
-// 审批
|
|
|
-const processAuditRef = ref<RefType>(); //审核记录ref
|
|
|
-const onAudit = (row: any) => {
|
|
|
- const params = {
|
|
|
- id: row.workflowId,
|
|
|
- processType: '工单办理',
|
|
|
- orderDetail: {},
|
|
|
- extra: {
|
|
|
- dialogTitle: '知识审批',
|
|
|
- inputPlaceholder: '办理意见',
|
|
|
- annexName: '知识附件',
|
|
|
- },
|
|
|
- };
|
|
|
- processAuditRef.value.openDialog(params);
|
|
|
-};
|
|
|
// 下架
|
|
|
const offShelfFn = (row: any) => {
|
|
|
- // 如果有流程id,说明是审批中的知识
|
|
|
- const params = {
|
|
|
- id: row.workflowId,
|
|
|
- processType: '知识下架',
|
|
|
- extra: {
|
|
|
- dialogTitle: '知识下架',
|
|
|
- inputPlaceholder: '下架原因',
|
|
|
- annexName: '知识附件',
|
|
|
- },
|
|
|
- orderDetail: row,
|
|
|
- };
|
|
|
- processAuditRef.value.openDialog(params);
|
|
|
- /* ElMessageBox.confirm(`是否确定要下架【${row.title}】?知识下架后,将不会被检索到!`, '提示', {
|
|
|
+ ElMessageBox.confirm(`是否确定要下架【${row.title}】?知识下架后,将不会被检索到!`, '提示', {
|
|
|
confirmButtonText: '确认',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
@@ -783,12 +734,12 @@ const offShelfFn = (row: any) => {
|
|
|
cancelButtonClass: 'default-button',
|
|
|
})
|
|
|
.then(() => {
|
|
|
- KnowledgeOffShelf(row.id).then(() => {
|
|
|
+ KnowledgeOffShelfNew(row.id).then(() => {
|
|
|
ElMessage.success('操作成功');
|
|
|
handleQuery();
|
|
|
});
|
|
|
})
|
|
|
- .catch(() => {});*/
|
|
|
+ .catch(() => {});
|
|
|
};
|
|
|
// 上架
|
|
|
const groundingFn = (row: any) => {
|
|
@@ -808,54 +759,9 @@ const groundingFn = (row: any) => {
|
|
|
.catch(() => {});
|
|
|
};
|
|
|
// 删除知识
|
|
|
+const editSubmitAuditRef = ref<RefType>();
|
|
|
const onRowDel = (row: any) => {
|
|
|
- // 如果有流程id,说明是审批中的知识
|
|
|
- const params = {
|
|
|
- id: row.workflowId,
|
|
|
- processType: '删除知识',
|
|
|
- extra: {
|
|
|
- dialogTitle: '删除知识',
|
|
|
- inputPlaceholder: '删除原因',
|
|
|
- annexName: '知识附件',
|
|
|
- },
|
|
|
- orderDetail: row,
|
|
|
- };
|
|
|
- processAuditRef.value.openDialog(params);
|
|
|
- /* if (row.workflowId) {
|
|
|
- // 如果有流程id,说明是审批中的知识
|
|
|
- const params = {
|
|
|
- id: row.workflowId,
|
|
|
- processType: '删除知识',
|
|
|
- extra: {
|
|
|
- dialogTitle: '删除知识',
|
|
|
- inputPlaceholder: '删除原因',
|
|
|
- annexName: '知识附件',
|
|
|
- },
|
|
|
- orderDetail: row,
|
|
|
- };
|
|
|
- processAuditRef.value.openDialog(params);
|
|
|
- } else {
|
|
|
- // 否则直接删除
|
|
|
- ElMessageBox.confirm(`是否确定要删除【${row.title}】?`, '提示', {
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- draggable: true,
|
|
|
- cancelButtonClass: 'default-button',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- KnowledgeDel({ data: row }).then(() => {
|
|
|
- ElMessage.success('操作成功');
|
|
|
- handleQuery();
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- }*/
|
|
|
-};
|
|
|
-// 查看审核记录
|
|
|
-const auditProgressRef = ref<RefType>(); //审核记录ref
|
|
|
-const onprogress = (row: any) => {
|
|
|
- auditProgressRef.value.openDialog(row.id);
|
|
|
+ editSubmitAuditRef.value.openDialog(row, 'delete');
|
|
|
};
|
|
|
// 导出详情
|
|
|
const onExportDetail = (command: string | number | object) => {
|
|
@@ -886,11 +792,46 @@ const onExportDetail = (command: string | number | object) => {
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
-// 批量审核
|
|
|
-const toEndRef = ref<RefType>();
|
|
|
-const onAuditBatch = () => {
|
|
|
+// 批量公开
|
|
|
+const onOpen = () => {
|
|
|
const ids = checkTable.value.map((item: any) => item.id);
|
|
|
- toEndRef.value.openDialog(ids);
|
|
|
+ ElMessageBox.confirm(`是否确定要批量公开知识?`, '提示', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ draggable: true,
|
|
|
+ cancelButtonClass: 'default-button',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ knowledgeDraftUpdatePublic({ knowledgeIds: ids, isPublic: true }).then(() => {
|
|
|
+ ElMessage.success('操作成功');
|
|
|
+ handleQuery();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+};
|
|
|
+// 批量不公开
|
|
|
+const onPrivate = () => {
|
|
|
+ const ids = checkTable.value.map((item: any) => item.id);
|
|
|
+ ElMessageBox.confirm(`是否确定要批量不公开知识?`, '提示', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ draggable: true,
|
|
|
+ cancelButtonClass: 'default-button',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ knowledgeDraftUpdatePublic({ knowledgeIds: ids, isPublic: false }).then(() => {
|
|
|
+ ElMessage.success('操作成功');
|
|
|
+ handleQuery();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+};
|
|
|
+// 知识导入
|
|
|
+const knowledgeImportRef = ref<RefType>();
|
|
|
+const onImport = () => {
|
|
|
+ knowledgeImportRef.value.openDialog();
|
|
|
};
|
|
|
const tableRef = ref<RefType>();
|
|
|
const checkTable = ref<EmptyArrayType>([]);
|