|
@@ -136,65 +136,66 @@
|
|
|
</el-scrollbar>
|
|
|
</template>
|
|
|
</pane>
|
|
|
- <pane class="h100">
|
|
|
+ <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">
|
|
|
<el-tab-pane :label="v.value" :name="v.key" v-for="(v, i) in state.statusOptions" :key="i" :disabled="state.tableLoading"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
- <ProTable
|
|
|
- ref="proTableRef"
|
|
|
- :columns="columns"
|
|
|
- :data="state.tableData"
|
|
|
- @updateTable="queryList"
|
|
|
+ <el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent>
|
|
|
+ <el-form-item label="审核类型" prop="ModuleCode" v-if="state.queryParams.Status === '1'">
|
|
|
+ <el-segmented
|
|
|
+ :options="state.tabAuditingNames"
|
|
|
+ v-model="state.queryParams.ModuleCode"
|
|
|
+ @change="handleQuery"
|
|
|
+ :disabled="state.tableLoading"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="草稿类型" prop="NewDraftsStatus" v-if="state.queryParams.Status === '8'">
|
|
|
+ <el-segmented
|
|
|
+ :options="state.tabNewDraftsNames"
|
|
|
+ v-model="state.queryParams.NewDraftsStatus"
|
|
|
+ @change="handleQuery"
|
|
|
+ :disabled="state.tableLoading"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="关键字" prop="Keyword">
|
|
|
+ <el-input
|
|
|
+ v-model="state.queryParams.Keyword"
|
|
|
+ placeholder="标题/创建人/创建部门/来源部门"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ class="keyword-input"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="是否公开" prop="IsPublic">
|
|
|
+ <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>
|
|
|
+ <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">
|
|
|
+ <SvgIcon name="ele-Refresh" class="mr5" />重置
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <vxe-toolbar
|
|
|
+ ref="toolbarRef"
|
|
|
:loading="state.tableLoading"
|
|
|
- :total="state.total"
|
|
|
- v-model:page-index="state.queryParams.PageIndex"
|
|
|
- v-model:page-size="state.queryParams.PageSize"
|
|
|
- v-if="['1'].includes(state.queryParams.Status)"
|
|
|
- :toolButton="['refresh', 'setting', 'exportCurrent', 'exportAll']"
|
|
|
- :exportMethod="knowledgeExport"
|
|
|
- :exportParams="requestParams"
|
|
|
+ custom
|
|
|
+ :refresh="{
|
|
|
+ queryMethod: handleQuery,
|
|
|
+ }"
|
|
|
+ :tools="[{ toolRender: { name: 'exportCurrent' } }, { toolRender: { name: 'exportAll' } }]"
|
|
|
>
|
|
|
- <template #table-search>
|
|
|
- <el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent>
|
|
|
- <el-form-item label="审核类型" prop="ModuleCode">
|
|
|
- <el-segmented
|
|
|
- :options="state.tabAuditingNames"
|
|
|
- v-model="state.queryParams.ModuleCode"
|
|
|
- @change="handleQuery"
|
|
|
- :disabled="state.tableLoading"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="关键字" prop="Keyword">
|
|
|
- <el-input
|
|
|
- v-model="state.queryParams.Keyword"
|
|
|
- placeholder="标题/创建人/创建部门/来源部门"
|
|
|
- clearable
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- class="keyword-input"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="是否公开" prop="IsPublic">
|
|
|
- <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>
|
|
|
- <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">
|
|
|
- <SvgIcon name="ele-Refresh" class="mr5" />重置
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </template>
|
|
|
- <template #tableHeader="scope">
|
|
|
+ <template #buttons>
|
|
|
<el-button type="primary" @click="onAddKnowledge" v-auth="'knowledge:index:add'" :loading="state.tableLoading">
|
|
|
<SvgIcon name="ele-Plus" class="mr5" />创建知识
|
|
|
</el-button>
|
|
|
- <el-dropdown v-auth="'knowledge:index:export:detail'" @command="onExportDetail" class="ml12 mr12" :disabled="!scope.isSelected">
|
|
|
- <el-button type="primary" :disabled="!scope.isSelected" :loading="state.tableLoading">
|
|
|
+ <el-dropdown v-auth="'knowledge:index:export:detail'" @command="onExportDetail" class="ml12 mr12" :disabled="isChecked">
|
|
|
+ <el-button type="primary" :disabled="isChecked" :loading="state.tableLoading">
|
|
|
导出知识详情<SvgIcon name="ele-ArrowDown" class="ml3" />
|
|
|
</el-button>
|
|
|
<template #dropdown>
|
|
@@ -209,197 +210,137 @@
|
|
|
v-if="state.queryParams.Status === '1'"
|
|
|
v-auth="'knowledge:index:audit:batch'"
|
|
|
:loading="state.loading"
|
|
|
- :disabled="!scope.isSelected"
|
|
|
+ :disabled="isChecked"
|
|
|
>
|
|
|
<SvgIcon name="ele-Edit" class="mr5" />批量审核
|
|
|
</el-button>
|
|
|
</template>
|
|
|
- <template #title="{ row }">
|
|
|
- <el-button link type="primary" @click="onPreview(row)">{{ row.title }}</el-button>
|
|
|
- </template>
|
|
|
- <template #isPublic="{ row }">
|
|
|
- <span>{{ row.isPublic ? '是' : '否' }}</span>
|
|
|
- </template>
|
|
|
- <template #operation="{ row }">
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="onEdit(row)"
|
|
|
- title="编辑"
|
|
|
- v-if="[0, 4, 5, 6].includes(row.newStatus) && row.status !== '1'"
|
|
|
- v-auth="'knowledge:index:edit'"
|
|
|
- >
|
|
|
- 编辑
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="danger"
|
|
|
- @click="onRowDel(row)"
|
|
|
- title="删除"
|
|
|
- v-if="[0, 2, 4, 5, 6].includes(row.newStatus) && row.status !== '1' && ['YiBin'].includes(themeConfig.appScope)"
|
|
|
- v-auth="'knowledge:index:delete'"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="offShelfFn(row)"
|
|
|
- title="下架"
|
|
|
- v-if="[3].includes(row.newStatus)"
|
|
|
- v-auth="'knowledge:index:undercarriage'"
|
|
|
- >
|
|
|
- 下架
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="groundingFn(row)"
|
|
|
- title="上架"
|
|
|
- v-if="[4].includes(row.newStatus)"
|
|
|
- v-auth="'knowledge:index:grounding'"
|
|
|
- >
|
|
|
- 上架
|
|
|
- </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>
|
|
|
- </ProTable>
|
|
|
- <ProTable
|
|
|
- ref="proTableRef"
|
|
|
- :columns="staticColumns"
|
|
|
- :data="state.tableData"
|
|
|
- @updateTable="queryList"
|
|
|
- :loading="state.tableLoading"
|
|
|
- :total="state.total"
|
|
|
- v-model:page-index="state.queryParams.PageIndex"
|
|
|
- v-model:page-size="state.queryParams.PageSize"
|
|
|
- v-else
|
|
|
- :toolButton="['refresh', 'setting', 'exportCurrent', 'exportAll']"
|
|
|
- :exportMethod="knowledgeExport"
|
|
|
- :exportParams="requestParams"
|
|
|
- >
|
|
|
- <template #table-search>
|
|
|
- <el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent>
|
|
|
- <el-form-item label="草稿类型" prop="NewDraftsStatus" v-if="state.queryParams.Status === '8'">
|
|
|
- <el-segmented
|
|
|
- :options="state.tabNewDraftsNames"
|
|
|
- v-model="state.queryParams.NewDraftsStatus"
|
|
|
- @change="handleQuery"
|
|
|
- :disabled="state.tableLoading"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="关键字" prop="Keyword">
|
|
|
- <el-input
|
|
|
- v-model="state.queryParams.Keyword"
|
|
|
- placeholder="标题/创建人/创建部门/来源部门"
|
|
|
- clearable
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- class="keyword-input"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="是否公开" prop="IsPublic">
|
|
|
- <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>
|
|
|
- <el-button type="primary" @click="handleQuery" :loading="state.tableLoading">
|
|
|
- <SvgIcon name="ele-Search" class="mr5" />查询
|
|
|
+ </vxe-toolbar>
|
|
|
+ <div style="overflow: hidden; width: 100%; height: 100%; flex: 1">
|
|
|
+ <vxe-table
|
|
|
+ border
|
|
|
+ :loading="state.tableLoading"
|
|
|
+ :data="state.tableData"
|
|
|
+ :column-config="{ resizable: true }"
|
|
|
+ :row-config="{ isCurrent: true, isHover: true, height: 30 }"
|
|
|
+ ref="tableRef"
|
|
|
+ height="auto"
|
|
|
+ auto-resize
|
|
|
+ show-overflow
|
|
|
+ :print-config="{}"
|
|
|
+ :scrollY="{ enabled: true, gt: 0 }"
|
|
|
+ id="knowledgeManage"
|
|
|
+ :custom-config="{ storage: true }"
|
|
|
+ showHeaderOverflow
|
|
|
+ :params="{ exportMethod: knowledgeExport, exportParams: requestParams }"
|
|
|
+ @checkbox-all="selectAllChangeEvent"
|
|
|
+ @checkbox-change="selectChangeEvent"
|
|
|
+ >
|
|
|
+ <vxe-column type="checkbox" width="50" align="center"></vxe-column>
|
|
|
+ <vxe-column field="workflow.moduleName" title="审核类型" width="120" v-if="state.queryParams.Status === '1'"></vxe-column>
|
|
|
+ <vxe-column field="title" title="标题" min-width="200">
|
|
|
+ <template #default="{row}">
|
|
|
+ <el-button link type="primary" @click="onPreview(row)">{{ row.title }}</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="knowledgeTypeText" title="知识分类" width="150"></vxe-column>
|
|
|
+ <vxe-column field="statusName" title="知识状态" width="110"></vxe-column>
|
|
|
+ <vxe-column field="attribution" title="知识归属" width="140"></vxe-column>
|
|
|
+ <vxe-column field="sourceOrganize.name" title="来源部门" width="140"></vxe-column>
|
|
|
+ <vxe-column field="hotspotName" title="热点" width="150"></vxe-column>
|
|
|
+ <vxe-column field="isPublic" title="是否公开" width="100">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ row.isPublic ? '是' : '否' }}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="pageView" title="阅读次数" width="100"></vxe-column>
|
|
|
+ <vxe-column field="onShelfTime" title="上架时间" width="160">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ formatDate(row.onShelfTime, 'YYYY-mm-dd HH:MM:SS') }}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="offShelfTime" title="下架时间" width="160">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ formatDate(row.offShelfTime, 'YYYY-mm-dd HH:MM:SS') }}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="creatorName" title="创建人" width="120"></vxe-column>
|
|
|
+ <vxe-column field="creatorOrgName" title="创建部门" width="150"></vxe-column>
|
|
|
+ <vxe-column field="creationTime" title="创建时间" width="160">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ formatDate(row.creationTime, 'YYYY-mm-dd HH:MM:SS') }}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="lastModificationTime" title="更新时间" width="160">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ formatDate(row.lastModificationTime, 'YYYY-mm-dd HH:MM:SS') }}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column title="操作" fixed="right" width="250" align="center">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="onEdit(row)"
|
|
|
+ title="编辑"
|
|
|
+ v-if="[0, 4, 5, 6].includes(row.newStatus) && row.status !== '1'"
|
|
|
+ v-auth="'knowledge:index:edit'"
|
|
|
+ >
|
|
|
+ 编辑
|
|
|
</el-button>
|
|
|
- <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.tableLoading">
|
|
|
- <SvgIcon name="ele-Refresh" class="mr5" />重置
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="danger"
|
|
|
+ @click="onRowDel(row)"
|
|
|
+ title="删除"
|
|
|
+ v-if="[0, 2, 4, 5, 6].includes(row.newStatus) && row.status !== '1' && ['YiBin'].includes(themeConfig.appScope)"
|
|
|
+ v-auth="'knowledge:index:delete'"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </template>
|
|
|
- <template #tableHeader="scope">
|
|
|
- <el-button type="primary" @click="onAddKnowledge" v-auth="'knowledge:index:add'" :loading="state.tableLoading">
|
|
|
- <SvgIcon name="ele-Plus" class="mr5" />创建知识
|
|
|
- </el-button>
|
|
|
- <el-dropdown v-auth="'knowledge:index:export:detail'" @command="onExportDetail" class="ml12 mr12" :disabled="!scope.isSelected">
|
|
|
- <el-button type="primary" :disabled="!scope.isSelected" :loading="state.tableLoading">
|
|
|
- 导出知识详情<SvgIcon name="ele-ArrowDown" class="ml3" />
|
|
|
- </el-button>
|
|
|
- <template #dropdown>
|
|
|
- <el-dropdown-menu>
|
|
|
- <el-dropdown-item :command="item.key" v-for="item in exportType" :key="item.key">{{ item.value }}</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="offShelfFn(row)"
|
|
|
+ title="下架"
|
|
|
+ v-if="[3].includes(row.newStatus)"
|
|
|
+ v-auth="'knowledge:index:undercarriage'"
|
|
|
+ >
|
|
|
+ 下架
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="groundingFn(row)"
|
|
|
+ title="上架"
|
|
|
+ v-if="[4].includes(row.newStatus)"
|
|
|
+ v-auth="'knowledge:index:grounding'"
|
|
|
+ >
|
|
|
+ 上架
|
|
|
+ </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>
|
|
|
- </el-dropdown>
|
|
|
- </template>
|
|
|
- <template #title="{ row }">
|
|
|
- <el-button link type="primary" @click="onPreview(row)">{{ row.title }}</el-button>
|
|
|
- </template>
|
|
|
- <template #isPublic="{ row }">
|
|
|
- <span>{{ row.isPublic ? '是' : '否' }}</span>
|
|
|
- </template>
|
|
|
- <template #operation="{ row }">
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="onEdit(row)"
|
|
|
- title="编辑"
|
|
|
- v-if="[0, 4, 5, 6].includes(row.newStatus) && row.status !== '1'"
|
|
|
- v-auth="'knowledge:index:edit'"
|
|
|
- >
|
|
|
- 编辑
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="danger"
|
|
|
- @click="onRowDel(row)"
|
|
|
- title="删除"
|
|
|
- v-if="[0, 2, 4, 5, 6].includes(row.newStatus) && row.status !== '1' && ['YiBin'].includes(themeConfig.appScope)"
|
|
|
- v-auth="'knowledge:index:delete'"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="offShelfFn(row)"
|
|
|
- title="下架"
|
|
|
- v-if="[3].includes(row.newStatus)"
|
|
|
- v-auth="'knowledge:index:undercarriage'"
|
|
|
- >
|
|
|
- 下架
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="groundingFn(row)"
|
|
|
- title="上架"
|
|
|
- v-if="[4].includes(row.newStatus)"
|
|
|
- v-auth="'knowledge:index:grounding'"
|
|
|
- >
|
|
|
- 上架
|
|
|
- </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>
|
|
|
- </ProTable>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+ </div>
|
|
|
+ <pagination
|
|
|
+ @pagination="queryList"
|
|
|
+ :total="state.total"
|
|
|
+ v-model:current-page="state.queryParams.PageIndex"
|
|
|
+ v-model:page-size="state.queryParams.PageSize"
|
|
|
+ :disabled="state.tableLoading"
|
|
|
+ />
|
|
|
</pane>
|
|
|
</splitpanes>
|
|
|
</div>
|
|
@@ -413,7 +354,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="tsx" setup name="knowledgeManage">
|
|
|
-import { ref, reactive, onMounted, watch, defineAsyncComponent } from 'vue';
|
|
|
+import { ref, reactive, onMounted, watch, defineAsyncComponent, computed } from 'vue';
|
|
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import type { FormInstance } from 'element-plus';
|
|
@@ -437,14 +378,15 @@ import { storeToRefs } from 'pinia';
|
|
|
import Other from '@/utils/other';
|
|
|
import { downloadFileByStream } from '@/utils/tools';
|
|
|
import { useThemeConfig } from '@/stores/themeConfig';
|
|
|
+import { VxeUI } from 'vxe-pc-ui';
|
|
|
|
|
|
// 引入组件
|
|
|
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 proTableRef = ref<RefType>(); // 表格ref
|
|
|
// 定义变量内容
|
|
|
const state = reactive<any>({
|
|
|
queryParams: {
|
|
@@ -591,100 +533,6 @@ const getKnowledgeType = async () => {
|
|
|
state.typeLoading = false;
|
|
|
}
|
|
|
};
|
|
|
-// 表格配置项
|
|
|
-const columns = ref<any[]>([
|
|
|
- { type: 'selection', minWidth: 40, align: 'center' },
|
|
|
- { prop: 'workflow.moduleName', label: '审核类型', width: 120 },
|
|
|
- { prop: 'title', label: '标题', minWidth: 200 },
|
|
|
- { prop: 'knowledgeTypeText', label: '知识分类', minWidth: 150 },
|
|
|
- { prop: 'statusName', label: '知识状态', minWidth: 100 },
|
|
|
- { prop: 'attribution', label: '知识归属', minWidth: 140 },
|
|
|
- { prop: 'sourceOrganize.name', label: '来源部门', minWidth: 140 },
|
|
|
- { prop: 'hotspotName', label: '热点', minWidth: 150 },
|
|
|
- { prop: 'isPublic', label: '是否公开' },
|
|
|
- { prop: 'pageView', label: '阅读次数' },
|
|
|
- {
|
|
|
- prop: 'onShelfTime',
|
|
|
- label: '上架时间',
|
|
|
- minWidth: 160,
|
|
|
- render: (scope) => {
|
|
|
- return <span>{formatDate(scope.row.onShelfTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'offShelfTime',
|
|
|
- label: '下架时间',
|
|
|
- minWidth: 170,
|
|
|
- render: (scope) => {
|
|
|
- return <span>{formatDate(scope.row.offShelfTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
- },
|
|
|
- },
|
|
|
- { prop: 'creatorName', label: '创建人', minWidth: 120 },
|
|
|
- { prop: 'creatorOrgName', label: '创建部门', minWidth: 140 },
|
|
|
- {
|
|
|
- prop: 'creationTime',
|
|
|
- label: '创建时间',
|
|
|
- minWidth: 170,
|
|
|
- render: (scope) => {
|
|
|
- return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'lastModificationTime',
|
|
|
- label: '更新时间',
|
|
|
- minWidth: 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 staticColumns = [
|
|
|
- { type: 'selection', minWidth: 40, align: 'center' },
|
|
|
- { prop: 'title', label: '标题', minWidth: 200 },
|
|
|
- { prop: 'knowledgeTypeText', label: '知识分类', minWidth: 150 },
|
|
|
- { prop: 'statusName', label: '知识状态', minWidth: 100 },
|
|
|
- { prop: 'attribution', label: '知识归属', minWidth: 140 },
|
|
|
- { prop: 'sourceOrganize.name', label: '来源部门', minWidth: 140 },
|
|
|
- { prop: 'hotspotName', label: '热点', minWidth: 150 },
|
|
|
- { prop: 'isPublic', label: '是否公开' },
|
|
|
- { prop: 'pageView', label: '阅读次数' },
|
|
|
- {
|
|
|
- prop: 'onShelfTime',
|
|
|
- label: '上架时间',
|
|
|
- minWidth: 160,
|
|
|
- render: (scope) => {
|
|
|
- return <span>{formatDate(scope.row.onShelfTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'offShelfTime',
|
|
|
- label: '下架时间',
|
|
|
- minWidth: 170,
|
|
|
- render: (scope) => {
|
|
|
- return <span>{formatDate(scope.row.offShelfTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
- },
|
|
|
- },
|
|
|
- { prop: 'creatorName', label: '创建人', minWidth: 120 },
|
|
|
- { prop: 'creatorOrgName', label: '创建部门', minWidth: 140 },
|
|
|
- {
|
|
|
- prop: 'creationTime',
|
|
|
- label: '创建时间',
|
|
|
- minWidth: 170,
|
|
|
- render: (scope) => {
|
|
|
- return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'lastModificationTime',
|
|
|
- label: '更新时间',
|
|
|
- minWidth: 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 requestParams = ref<EmptyObjectType>({});
|
|
|
const queryList = () => {
|
|
@@ -890,36 +738,65 @@ const onprogress = (row: any) => {
|
|
|
// 导出详情
|
|
|
const onExportDetail = (command: string | number | object) => {
|
|
|
state.loading = true;
|
|
|
- knowledgeDetailExport({ ids: proTableRef.value.selectedListIds, fileType: command })
|
|
|
+ const ids = checkTable.value.map((item: any) => item.id);
|
|
|
+ VxeUI.modal.message({
|
|
|
+ content: `导出中,请稍等`,
|
|
|
+ status: 'loading',
|
|
|
+ id: 'exportDetail',
|
|
|
+ duration: -1,
|
|
|
+ });
|
|
|
+ knowledgeDetailExport({ ids, fileType: command })
|
|
|
.then((res) => {
|
|
|
downloadFileByStream(res);
|
|
|
state.loading = false;
|
|
|
+ VxeUI.modal.close('exportDetail');
|
|
|
+ VxeUI.modal.message({
|
|
|
+ content: `导出成功`,
|
|
|
+ status: 'success',
|
|
|
+ });
|
|
|
})
|
|
|
.catch(() => {
|
|
|
state.loading = false;
|
|
|
+ VxeUI.modal.close('exportDetail');
|
|
|
+ VxeUI.modal.message({
|
|
|
+ content: `导出失败`,
|
|
|
+ status: 'error',
|
|
|
+ });
|
|
|
});
|
|
|
};
|
|
|
// 批量审核
|
|
|
const toEndRef = ref<RefType>();
|
|
|
const onAuditBatch = () => {
|
|
|
- toEndRef.value.openDialog(proTableRef.value.selectedListIds);
|
|
|
+ const ids = checkTable.value.map((item: any) => item.id);
|
|
|
+ toEndRef.value.openDialog(ids);
|
|
|
+};
|
|
|
+const tableRef = ref<RefType>();
|
|
|
+const checkTable = ref<EmptyArrayType>([]);
|
|
|
+const selectAllChangeEvent = ({ checked }) => {
|
|
|
+ if (tableRef.value) {
|
|
|
+ const records = tableRef.value.getCheckboxRecords();
|
|
|
+ checkTable.value = records;
|
|
|
+ console.log(checked ? '所有勾选事件' : '所有取消事件', records);
|
|
|
+ }
|
|
|
};
|
|
|
+
|
|
|
+const selectChangeEvent = ({ checked }) => {
|
|
|
+ if (tableRef.value) {
|
|
|
+ const records = tableRef.value.getCheckboxRecords();
|
|
|
+ checkTable.value = records;
|
|
|
+ console.log(checked ? '勾选事件' : '取消事件', records);
|
|
|
+ }
|
|
|
+};
|
|
|
+const isChecked = computed(() => {
|
|
|
+ return !Boolean(checkTable.value.length);
|
|
|
+});
|
|
|
+const toolbarRef = ref<RefType>();
|
|
|
onMounted(() => {
|
|
|
+ queryList();
|
|
|
+ if (tableRef.value && toolbarRef.value) {
|
|
|
+ tableRef.value.connect(toolbarRef.value);
|
|
|
+ }
|
|
|
getKnowledgeType();
|
|
|
getOrgListApi();
|
|
|
- queryList();
|
|
|
});
|
|
|
-</script>
|
|
|
-<style lang="scss" scoped>
|
|
|
-.knowledge-index-container {
|
|
|
- :deep(.pro-table-main) {
|
|
|
- height: calc(100% - 54px) !important;
|
|
|
- }
|
|
|
- :deep(.el-tree-node__content) {
|
|
|
- height: 32px;
|
|
|
- }
|
|
|
- :deep(.el-card__body) {
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|
|
|
+</script>
|