|
|
|
|
@ -100,10 +100,12 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="catalog_right" v-else>
|
|
|
|
|
<xy-table @getHeight="initHeight" @cell-dblclick="dbclick" :defaultExpandAll='false' :isPage="false" rowKey="id" :list="list"
|
|
|
|
|
:table-item="table_item">
|
|
|
|
|
<xy-table @getHeight="initHeight" @cell-dblclick="dbclick"
|
|
|
|
|
:total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
|
|
|
|
|
:defaultExpandAll='false' :isPage="true" rowKey="id"
|
|
|
|
|
:list="list" :table-item="table_item">
|
|
|
|
|
<template v-slot:catalog_name>
|
|
|
|
|
<el-table-column align='center' label="所属目录" width="240" header-align="center">
|
|
|
|
|
<el-table-column align='center' label="所属目录" min-width="120" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div v-if="scope.row.catalog_id_details && scope.row.catalog_id_details.length>0">
|
|
|
|
|
<el-tag style="margin-right:5px;margin-bottom:5px" v-for="item in scope.row.catalog_id_details">
|
|
|
|
|
@ -113,7 +115,7 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:area_name>
|
|
|
|
|
<el-table-column align='center' label="所属区域" width="240" header-align="center">
|
|
|
|
|
<el-table-column align='center' min-width="120" label="所属区域" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div v-if="scope.row.area_ids_details && scope.row.area_ids_details.length>0">
|
|
|
|
|
<el-tag style="margin-right:5px;margin-bottom:5px" v-for="item in scope.row.area_ids_details">
|
|
|
|
|
@ -123,7 +125,7 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:tag_name>
|
|
|
|
|
<el-table-column align='center' label="标签" width="240" header-align="center">
|
|
|
|
|
<el-table-column align='center' label="标签" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div v-if="scope.row.tag_ids_details && scope.row.tag_ids_details.length>0">
|
|
|
|
|
<el-tag style="margin-right:5px;margin-bottom:5px" v-for="item in scope.row.tag_ids_details">
|
|
|
|
|
@ -133,7 +135,7 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:status>
|
|
|
|
|
<el-table-column align='center' label="状态" width="120" header-align="center">
|
|
|
|
|
<el-table-column align='center' label="状态" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div v-for="item in statusList">
|
|
|
|
|
<el-tag :type="item.type" v-if="item.id===scope.row.status">
|
|
|
|
|
@ -142,7 +144,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- <template v-slot:link_id>
|
|
|
|
|
<template v-slot:link_id>
|
|
|
|
|
<el-table-column align='center' label="前续文档" width="120" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div style="color:#b3241d;cursor: pointer;text-decoration: underline;" v-if="scope.row.link_id"
|
|
|
|
|
@ -161,7 +163,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template> -->
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column align='center' fixed="right" label="操作" width="240" header-align="center">
|
|
|
|
|
@ -194,10 +196,10 @@
|
|
|
|
|
import {
|
|
|
|
|
index,
|
|
|
|
|
destroy
|
|
|
|
|
} from "@/api/system/baseForm.js"
|
|
|
|
|
import {
|
|
|
|
|
catalogTotal
|
|
|
|
|
} from "@/api/home/index.js"
|
|
|
|
|
} from "@/api/system/baseForm.js"
|
|
|
|
|
import {
|
|
|
|
|
catalogTotal
|
|
|
|
|
} from "@/api/home/index.js"
|
|
|
|
|
|
|
|
|
|
import state from '@/store/modules/user.js'
|
|
|
|
|
export default {
|
|
|
|
|
@ -299,11 +301,11 @@
|
|
|
|
|
name: '否'
|
|
|
|
|
}],
|
|
|
|
|
select: {
|
|
|
|
|
title: '',
|
|
|
|
|
keyword:'',
|
|
|
|
|
title: '',
|
|
|
|
|
keyword: '',
|
|
|
|
|
table_name: 'records',
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
catalog_id: '',
|
|
|
|
|
catalog_name: '',
|
|
|
|
|
status: '',
|
|
|
|
|
@ -331,7 +333,7 @@
|
|
|
|
|
tagList: [],
|
|
|
|
|
nowDate: '',
|
|
|
|
|
is_search: false,
|
|
|
|
|
|
|
|
|
|
is_top_search: false,
|
|
|
|
|
statusList: [{
|
|
|
|
|
id: 0,
|
|
|
|
|
name: '正常',
|
|
|
|
|
@ -357,57 +359,57 @@
|
|
|
|
|
prop: 'title',
|
|
|
|
|
label: '标题',
|
|
|
|
|
align: 'left',
|
|
|
|
|
width: 360,
|
|
|
|
|
// width: 360,
|
|
|
|
|
headerAlign: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'date',
|
|
|
|
|
label: '开始日期',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 120
|
|
|
|
|
// width: 120
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'end_date',
|
|
|
|
|
label: '结束日期',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 120
|
|
|
|
|
// width: 120
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'tag_name',
|
|
|
|
|
label: '标签',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 240
|
|
|
|
|
// width: 240
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'area_name',
|
|
|
|
|
label: '所属区域',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 240
|
|
|
|
|
// width: 240
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'status',
|
|
|
|
|
label: '状态',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 120
|
|
|
|
|
// width: 120
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'catalog_name',
|
|
|
|
|
label: '所属目录',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 240
|
|
|
|
|
// width: 240
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'link_id',
|
|
|
|
|
label: '来源文档',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 120
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'next_link_id',
|
|
|
|
|
label: '延续文档',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 120
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// prop: 'link_id',
|
|
|
|
|
// label: '来源文档',
|
|
|
|
|
// align: 'center',
|
|
|
|
|
// width: 120
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// prop: 'next_link_id',
|
|
|
|
|
// label: '延续文档',
|
|
|
|
|
// align: 'center',
|
|
|
|
|
// width: 120
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
@ -415,19 +417,23 @@
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
//
|
|
|
|
|
this.nowDate = this.$moment().add(1, 'months').format('YYYY-MM-DD')
|
|
|
|
|
this.nowDate = this.$moment().add(3, 'months').format('YYYY-MM-DD')
|
|
|
|
|
this.startDate = this.$moment('1900-01-01').format("YYYY-MM-DD")
|
|
|
|
|
this.stateObj = state.state
|
|
|
|
|
this.is_search = false
|
|
|
|
|
this.is_top_search = false
|
|
|
|
|
// 顶部搜索来的
|
|
|
|
|
if (this.$route.query.searchTitle) {
|
|
|
|
|
this.select.keyword = this.$route.query.searchTitle
|
|
|
|
|
this.select.keyword = this.$route.query.searchTitle
|
|
|
|
|
this.getCatalogList()
|
|
|
|
|
this.is_search = true
|
|
|
|
|
this.is_top_search = true
|
|
|
|
|
}
|
|
|
|
|
if (this.$route.query.dateTotal) {
|
|
|
|
|
this.select.endRange = [this.startDate, this.nowDate]
|
|
|
|
|
this.select.status = 0
|
|
|
|
|
this.is_search = true
|
|
|
|
|
this.is_search = true
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (this.$route.query.status1Total) {
|
|
|
|
|
this.select.status = 1
|
|
|
|
|
@ -497,11 +503,11 @@
|
|
|
|
|
this.showData = i.children;
|
|
|
|
|
this.menuName.push(i.name)
|
|
|
|
|
this.select.catalog_name = ' / ' + this.menuName.join(" / ")
|
|
|
|
|
console.log(this.historyList);
|
|
|
|
|
let totalId = []
|
|
|
|
|
this.showData.map(item=>{
|
|
|
|
|
totalId.push(item.id)
|
|
|
|
|
})
|
|
|
|
|
console.log(this.historyList);
|
|
|
|
|
let totalId = []
|
|
|
|
|
this.showData.map(item => {
|
|
|
|
|
totalId.push(item.id)
|
|
|
|
|
})
|
|
|
|
|
this.getCatalogTotal(totalId.join(','))
|
|
|
|
|
} else {
|
|
|
|
|
this.select.catalog_id = i.id
|
|
|
|
|
@ -525,7 +531,7 @@
|
|
|
|
|
this.menuName.splice(this.menuName.length - 1, 1)
|
|
|
|
|
this.select.catalog_name = ' / ' + this.menuName.join(" / ")
|
|
|
|
|
this.hasMenu = true
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getCatalogList(pid) {
|
|
|
|
|
const res = await index({
|
|
|
|
|
@ -542,44 +548,44 @@
|
|
|
|
|
let pList = this.base.findNodesById(this.catalogList, pid)
|
|
|
|
|
console.log("pList", pList)
|
|
|
|
|
this.catalogChildren = pList[0].children
|
|
|
|
|
this.showData = this.catalogChildren
|
|
|
|
|
let totalId = []
|
|
|
|
|
this.showData.map(item=>{
|
|
|
|
|
totalId.push(item.id)
|
|
|
|
|
})
|
|
|
|
|
this.showData = this.catalogChildren
|
|
|
|
|
let totalId = []
|
|
|
|
|
this.showData.map(item => {
|
|
|
|
|
totalId.push(item.id)
|
|
|
|
|
})
|
|
|
|
|
this.getCatalogTotal(totalId.join(','))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getCatalogTotal(ids){
|
|
|
|
|
const res = await catalogTotal({
|
|
|
|
|
ids:ids
|
|
|
|
|
})
|
|
|
|
|
let data = res.list
|
|
|
|
|
const updatedB = this.showData.map((item) => {
|
|
|
|
|
// 在数组 a 中查找匹配的 id
|
|
|
|
|
const matchedItem = data.find((aItem) => aItem.id == item.id);
|
|
|
|
|
|
|
|
|
|
// 如果找到匹配项,则将 records_total 和 sub_records_total 添加到当前项
|
|
|
|
|
if (matchedItem) {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
records_total: matchedItem.records_total,
|
|
|
|
|
sub_records_total: matchedItem.sub_records_total
|
|
|
|
|
};
|
|
|
|
|
}else{
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
records_total: 0,
|
|
|
|
|
sub_records_total: 0
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 如果没有找到匹配项,则返回原项
|
|
|
|
|
return item;
|
|
|
|
|
});
|
|
|
|
|
this.showData = updatedB
|
|
|
|
|
console.log("this.showData",this.showData)
|
|
|
|
|
},
|
|
|
|
|
async getCatalogTotal(ids) {
|
|
|
|
|
const res = await catalogTotal({
|
|
|
|
|
ids: ids
|
|
|
|
|
})
|
|
|
|
|
let data = res.list
|
|
|
|
|
const updatedB = this.showData.map((item) => {
|
|
|
|
|
// 在数组 a 中查找匹配的 id
|
|
|
|
|
const matchedItem = data.find((aItem) => aItem.id == item.id);
|
|
|
|
|
|
|
|
|
|
// 如果找到匹配项,则将 records_total 和 sub_records_total 添加到当前项
|
|
|
|
|
if (matchedItem) {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
records_total: matchedItem.records_total,
|
|
|
|
|
sub_records_total: matchedItem.sub_records_total
|
|
|
|
|
};
|
|
|
|
|
} else {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
records_total: 0,
|
|
|
|
|
sub_records_total: 0
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 如果没有找到匹配项,则返回原项
|
|
|
|
|
return item;
|
|
|
|
|
});
|
|
|
|
|
this.showData = updatedB
|
|
|
|
|
console.log("this.showData", this.showData)
|
|
|
|
|
},
|
|
|
|
|
async getAreaList() {
|
|
|
|
|
const res = await index({
|
|
|
|
|
@ -605,13 +611,13 @@
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
dbclick(row, column, cell, event){
|
|
|
|
|
console.log("row",row)
|
|
|
|
|
this.showIndex("show",row.row.id)
|
|
|
|
|
dbclick(row, column, cell, event) {
|
|
|
|
|
console.log("row", row)
|
|
|
|
|
this.showIndex("show", row.row.id)
|
|
|
|
|
},
|
|
|
|
|
editIndex(type, id,is_search) {
|
|
|
|
|
if(is_search){
|
|
|
|
|
this.$refs.addRecord.is_search = true
|
|
|
|
|
editIndex(type, id, is_search) {
|
|
|
|
|
if (is_search) {
|
|
|
|
|
this.$refs.addRecord.is_search = true
|
|
|
|
|
}
|
|
|
|
|
if (type == 'editor') {
|
|
|
|
|
this.$refs.addRecord.id = id
|
|
|
|
|
@ -661,6 +667,15 @@
|
|
|
|
|
} else {
|
|
|
|
|
this.select.endRange = ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
pageIndexChange(e) {
|
|
|
|
|
this.select.page = e
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
pageSizeChange(e) {
|
|
|
|
|
this.select.page_size = e
|
|
|
|
|
this.select.page = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
async getList() {
|
|
|
|
|
const res = await index({
|
|
|
|
|
@ -668,13 +683,13 @@
|
|
|
|
|
page: this.select.page,
|
|
|
|
|
table_name: this.select.table_name,
|
|
|
|
|
json_data_fields: ['files', 'area_ids', 'tag_ids', 'catalog_id'],
|
|
|
|
|
is_auth: 1,
|
|
|
|
|
is_auth: this.is_top_search?0:1,
|
|
|
|
|
sort_type: 'DESC',
|
|
|
|
|
sort_name: 'date',
|
|
|
|
|
catalogs_id: this.select.catalog_id ? this.select.catalog_id : '',
|
|
|
|
|
area_ids: this.select.area_id ? this.select.area_id : '',
|
|
|
|
|
tag_ids: this.select.tag_id ? this.select.tag_id : '',
|
|
|
|
|
keyword:this.select.keyword?this.select.keyword:'',
|
|
|
|
|
tag_ids: this.select.tag_id ? this.select.tag_id : '',
|
|
|
|
|
keyword: this.select.keyword ? this.select.keyword : '',
|
|
|
|
|
// records_status:this.select.records_status,
|
|
|
|
|
filter: [{
|
|
|
|
|
"key": "title",
|
|
|
|
|
@ -694,12 +709,13 @@
|
|
|
|
|
value: this.select.status
|
|
|
|
|
}]
|
|
|
|
|
})
|
|
|
|
|
// this.list = res.data
|
|
|
|
|
if (res.data.length > 0) {
|
|
|
|
|
this.list = this.base.buildTree(res.data, 'link_id')
|
|
|
|
|
} else {
|
|
|
|
|
this.list = []
|
|
|
|
|
}
|
|
|
|
|
this.list = res.data
|
|
|
|
|
this.total = res.total
|
|
|
|
|
// if (res.data.length > 0) {
|
|
|
|
|
// this.list = this.base.buildTree(res.data, 'link_id')
|
|
|
|
|
// } else {
|
|
|
|
|
// this.list = []
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
deleteList(id) {
|
|
|
|
|
var that = this;
|
|
|
|
|
|