@@ -142,7 +144,7 @@
-
+
@@ -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;
diff --git a/src/views/report/filldata.vue b/src/views/report/filldata.vue
index 88cddc0..8983643 100644
--- a/src/views/report/filldata.vue
+++ b/src/views/report/filldata.vue
@@ -221,9 +221,18 @@
const res = await index({
page_size: 999,
page: 1,
- table_name: 'businesses',
- })
- this.list_bus = res.data
+ table_name: 'businesses',
+
+ })
+ // 不能看到所有
+ if(!this.stateObj.is_admin){
+ this.list_bus = res.data.filter(item => {
+ return item.area_ids.includes(this.stateObj.area_id)
+ })
+ }else{
+ this.list_bus = res.data
+ }
+
},
async getAreaList() {
const res = await index({
diff --git a/src/views/report/yeardata.vue b/src/views/report/yeardata.vue
index 150da37..3db7eb0 100644
--- a/src/views/report/yeardata.vue
+++ b/src/views/report/yeardata.vue
@@ -182,8 +182,15 @@
page_size: 999,
page: 1,
table_name: 'businesses',
- })
- this.list_bus = res.data
+ })
+ // 不能看到所有
+ if(!this.stateObj.is_admin){
+ this.list_bus = res.data.filter(item => {
+ return item.area_ids.includes(this.stateObj.area_id)
+ })
+ }else{
+ this.list_bus = res.data
+ }
},
async getAreaList() {
const res = await index({