|
@@ -0,0 +1,354 @@
|
|
|
+<template>
|
|
|
+ <div class="knowledge-box">
|
|
|
+ <header>
|
|
|
+ <div class="left-filter">
|
|
|
+ <el-button type="primary" @click="$router.push({path:'/knowledgeEdit'})">添加事件</el-button>
|
|
|
+ <el-dropdown
|
|
|
+ split-button
|
|
|
+ type="primary"
|
|
|
+ @click="isImportExcelDia=true"
|
|
|
+ >
|
|
|
+ Excel导入
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item command="file">文件导入</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ <el-button type="primary" plain @click="isOpenClassifyDia=true">分类管理</el-button>
|
|
|
+ <el-button type="primary" plain @click="handleGoTagSet">标签管理</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="right-filter">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ trigger="click"
|
|
|
+ :visible-arrow="false"
|
|
|
+ popper-class="report-select-popover"
|
|
|
+ width="350"
|
|
|
+ style="display: inline-block;"
|
|
|
+ >
|
|
|
+ <div class="select-wrap">
|
|
|
+ <div class="select-top">
|
|
|
+ <h4>筛选条件</h4>
|
|
|
+ <span><i class="el-icon-delete"/>清空所选条件</span>
|
|
|
+ </div>
|
|
|
+ <div class="select-item">
|
|
|
+ <el-cascader
|
|
|
+ :options="classifyOptions"
|
|
|
+ v-model="filterForm.classifys"
|
|
|
+ :props="{
|
|
|
+ value: 'Id',
|
|
|
+ label: 'ClassifyName',
|
|
|
+ children: 'Child'
|
|
|
+ }"
|
|
|
+ clearable
|
|
|
+ placeholder="请选择分类"
|
|
|
+ style="width:100%;"
|
|
|
+ @change="filterChange"
|
|
|
+ ></el-cascader>
|
|
|
+ </div>
|
|
|
+ <div class="select-item">
|
|
|
+ <el-select
|
|
|
+ v-model="filterForm.source"
|
|
|
+ placeholder="请选择来源"
|
|
|
+ size="medium"
|
|
|
+ clearable
|
|
|
+ style="width:100%;"
|
|
|
+ @change="filterChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in sourcesOptions"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="select-item">
|
|
|
+ <el-select
|
|
|
+ v-model="filterForm.tags"
|
|
|
+ placeholder="请选择标签"
|
|
|
+ size="medium"
|
|
|
+ clearable
|
|
|
+ style="width:100%;"
|
|
|
+ multiple
|
|
|
+ @change="filterChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in tagsOptions"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="select-item">
|
|
|
+ <el-cascader
|
|
|
+ @change="filterChange"
|
|
|
+ :options="usersOptions"
|
|
|
+ v-model="filterForm.users"
|
|
|
+ clearable
|
|
|
+ placeholder="请选择添加人"
|
|
|
+ style="width:100%;"
|
|
|
+ ></el-cascader>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="select-btn" slot="reference">
|
|
|
+ <img src="~@/assets/icons/filter.svg">
|
|
|
+ <span>筛选条件</span>
|
|
|
+ <span class="select-num">+{{selectNum}}</span>
|
|
|
+ </div>
|
|
|
+ </el-popover>
|
|
|
+
|
|
|
+ <el-input
|
|
|
+ @input="filterChange"
|
|
|
+ placeholder="名称"
|
|
|
+ v-model="filterForm.keyWord"
|
|
|
+ clearable
|
|
|
+ style="width:300px"
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </header>
|
|
|
+
|
|
|
+ <div class="main">
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ style="box-shadow: 0px 3px 6px rgba(155, 170, 219, 0.2);margin-top: 20px"
|
|
|
+ border
|
|
|
+ ref="table"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ v-for="item in tableColums"
|
|
|
+ :key="item.key"
|
|
|
+ :label="item.label"
|
|
|
+ :width="item.widthsty"
|
|
|
+ :min-width="item.minwidthsty"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span v-if="item.key==='Title'" class="editsty" @click="lookDetailHandle(row,'look')">{{row[item.key]}}</span>
|
|
|
+ <span v-else>{{row[item.key]}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('Table.column_operations')"
|
|
|
+ align="center"
|
|
|
+ v-if="!isRise"
|
|
|
+ >
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <div>
|
|
|
+ <span class="editsty" @click="lookDetailHandle(row,'edit')" v-if="checkBtnAuth('edit')">{{$t('Table.edit_btn')}}</span>
|
|
|
+
|
|
|
+ <span class="deletesty" @click="handleDelItem(row)" v-if="checkBtnAuth('del')">{{$t('Table.delete_btn')}}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <div class="nodata" slot="empty">
|
|
|
+ <tableNoData :text="$t('Table.prompt_slogan')" size="mini"/>
|
|
|
+ </div>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <div style="height:35px;margin: 20px 0;">
|
|
|
+ <m-page
|
|
|
+ :page_no="pageNo"
|
|
|
+ :pageSize="pageSize"
|
|
|
+ :total="total"
|
|
|
+ @handleCurrentChange="pageChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 分类管理弹窗 -->
|
|
|
+ <classifyDia
|
|
|
+ :show.sync="isOpenClassifyDia"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 导入excel弹窗 -->
|
|
|
+ <importExcelDia
|
|
|
+ :show.sync="isImportExcelDia"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { eventInterface,policyInterface,pointInterface,knowInterface } from '@/api/modules/knowledge';
|
|
|
+import classifyDia from './components/classifyDia.vue'
|
|
|
+import importExcelDia from './components/importExcelDia.vue';
|
|
|
+import mPage from '@/components/mPage.vue'
|
|
|
+export default {
|
|
|
+ components: { mPage,classifyDia,importExcelDia },
|
|
|
+ computed: {
|
|
|
+ api() {
|
|
|
+ const apiMap = {
|
|
|
+ '/knowledge_event': eventInterface,
|
|
|
+ '/knowledge_policy': policyInterface,
|
|
|
+ '/knowledge_viewpoint': pointInterface,
|
|
|
+ '/knowledge_know': knowInterface,
|
|
|
+ }
|
|
|
+
|
|
|
+ return apiMap[this.$route.path] && apiMap[this.$route.path]
|
|
|
+ },
|
|
|
+ tableColums() {
|
|
|
+ return [
|
|
|
+ { label: '开始时间',key: 'Createtime' },
|
|
|
+ { label: '标题',key: 'Title',minwidthsty:'150px' },
|
|
|
+ { label: '来源',key: 'Source' },
|
|
|
+ { label: '分类',key: 'ClassifyName' },
|
|
|
+ { label: '标签',key: 'Tag' },
|
|
|
+ { label: '添加人',key: 'Creator' },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ filterForm: {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize:15,
|
|
|
+ classsifys: [],
|
|
|
+ source: '',
|
|
|
+ tags: [],
|
|
|
+ users: [],
|
|
|
+ keyWord:"",
|
|
|
+ },
|
|
|
+ classifyOptions:[],
|
|
|
+ sourcesOptions:[],
|
|
|
+ tagsOptions:[],
|
|
|
+ usersOptions:[],
|
|
|
+ total: 0,
|
|
|
+ tableData: [
|
|
|
+ {Title: 'dwdw',Source:'wind',ClassifyName:'分类1、分类2',Createtime:'2024/9/25',Tag:'多空',Creator:'DW'},
|
|
|
+ {Title: 'dwdw',Source:'wind',ClassifyName:'分类1、分类2',Createtime:'2024/9/25',Tag:'多空',Creator:'DW'},
|
|
|
+ {Title: 'dwdw',Source:'wind',ClassifyName:'分类1、分类2',Createtime:'2024/9/25',Tag:'多空',Creator:'DW'},
|
|
|
+ {Title: 'dwdw',Source:'wind',ClassifyName:'分类1、分类2',Createtime:'2024/9/25',Tag:'多空',Creator:'DW'},
|
|
|
+ ],
|
|
|
+
|
|
|
+ //分类弹窗
|
|
|
+ isOpenClassifyDia: false,
|
|
|
+
|
|
|
+ //excel导入弹窗
|
|
|
+ isImportExcelDia: false,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ async getTableData() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ filterChange() {
|
|
|
+ this.filterForm.pageNo = 1;
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
+
|
|
|
+ pageChange(page) {
|
|
|
+ this.filterForm.pageNo = page;
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
+
|
|
|
+ lookDetailHandle(item,type) {
|
|
|
+ const { href } = this.$router.resolve({
|
|
|
+ path: type==='look'?'/knowledgeDetail':'/knowledgeEdit',
|
|
|
+ query: {
|
|
|
+ id: item.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ window.open(href,'_blank')
|
|
|
+ },
|
|
|
+
|
|
|
+ handleDelItem(item) {
|
|
|
+ this.$confirm(
|
|
|
+ '确定删除该事件吗?',
|
|
|
+ '提示',
|
|
|
+ {
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handleGoTagSet() {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/knowledge_tag',
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ checkBtnAuth(key) {
|
|
|
+ const authMap = {
|
|
|
+ '/knowledge_event': 'event',
|
|
|
+ '/knowledge_policy': 'policy',
|
|
|
+ '/knowledge_viewpoint': 'viewpoint',
|
|
|
+ '/knowledge_know': 'know',
|
|
|
+ }
|
|
|
+
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ },
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style scoped lang='scss'>
|
|
|
+*{ box-sizing: border-box; }
|
|
|
+.knowledge-box {
|
|
|
+ padding: 20px;
|
|
|
+ background: #fff;
|
|
|
+ border: 1px solid #C8CDD9;
|
|
|
+ border-radius: 4px;
|
|
|
+ min-height: calc(100vh - 120px);
|
|
|
+
|
|
|
+ header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ >div {
|
|
|
+ display: flex;
|
|
|
+ gap: 10px;
|
|
|
+ }
|
|
|
+ .select-btn{
|
|
|
+ cursor: pointer;
|
|
|
+ width:130px;
|
|
|
+ height: 36px;
|
|
|
+ text-align: center;
|
|
|
+ background-color: #ECF2FE;
|
|
|
+ border-radius: 4px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ line-height:36px;
|
|
|
+ img,span{
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+ .select-num{
|
|
|
+ width:20px;
|
|
|
+ height:20px;
|
|
|
+ line-height: 20px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color:#0052D9;
|
|
|
+ color:white;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.select-wrap{
|
|
|
+ padding:8px;
|
|
|
+ margin:0 20px;
|
|
|
+ .select-top {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ >span { color: #999;}
|
|
|
+ }
|
|
|
+ .select-item{
|
|
|
+ margin-top:20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang="scss">
|
|
|
+.knowledge-box {
|
|
|
+ .el-table td{
|
|
|
+ padding: 6px 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|