lion 9 months ago
parent bb4e672eec
commit d208ea23a7

@ -12,7 +12,7 @@
<div class="btnwrap">
<el-checkbox @change="changeAll" v-model="allChecked"></el-checkbox>
<el-button type="primary" size="small" @click="downloadBtn" :loading="btnloading">
{{ btnloading ? '下载中...' : '批量下载' }}
{{ btnloading ? '下载中...' : '下载' }}
</el-button>
</div>

@ -2,13 +2,21 @@
<el-dialog class="common-dialog" :fullscreen='isfullscreen' :title="title" :modal="false" top="2vh"
:visible.sync="diaShow" @close="coloseDia" :width="width">
<div slot="title">
<span class="el-dialog__title">{{title}}</span>
<slot name="searchtype"></slot>
:visible.sync="diaShow" @close="coloseDia" :show-close="false" :width="width">
<div slot="title" class="header-title">
<div>
<span class="el-dialog__title">{{title}}</span>
<slot name="searchtype"></slot>
</div>
<div>
<a class="ivu-modal-screen" @click="isfullscreen = !isfullscreen">
<i :class="isfullscreen?'el-icon-aim':'el-icon-full-screen'"></i></a>
<a @click='coloseDia'><i class="el-icon-close"></i></a>
</div>
</div>
<div class="dialogConcent" :style="{height:wheight+'px'}">
<div class="dialogConcent">
<div v-if="typeName=='file'" style="height:100%;overflow: scroll;">
<vue-office-docx v-if="urlType==='docx'" :src="url" @rendered="renderingCompleted"></vue-office-docx>
<vue-office-pdf v-else-if="urlType==='pdf'" :src="url" @rendered="renderingCompleted"></vue-office-pdf>
@ -129,7 +137,8 @@
coloseDia() {
this.url = ""
this.diaShow = false
this.typeName = 'file'
this.typeName = 'file'
this.isfullscreen = false
this.$emit('update:isShow', false)
}
}
@ -151,5 +160,14 @@
display: block;
height: 100vh;
width: 100%;
}
.header-title{
display: flex;
align-items: center;
justify-content: space-between;
i{
font-size: 18px;
margin-left:10px;
}
}
</style>

@ -22,7 +22,7 @@
</el-option>
</el-select>
</div>
<div>
<div v-if="stateObj.is_admin">
<el-select style="width:100%" @change="changeArea" v-model="monthSelect.area_id" placeholder="请选择区域">
<el-option v-for="item in list_areas" :key="item.id" :label="item.name" :value="item.id">
</el-option>
@ -49,7 +49,7 @@
placeholder="选择年">
</el-date-picker>
</div>
<div>
<div v-if="stateObj.is_admin">
<el-select style="width:100%" @change="getYearChart" v-model="yearSelect.area_id" placeholder="请选择区域">
<el-option v-for="item in all_areas" :key="item.id" :label="item.name" :value="item.id">
</el-option>
@ -115,7 +115,8 @@
} from "@/api/home"
import {
index
} from "@/api/system/baseForm.js"
} from "@/api/system/baseForm.js"
import state from '@/store/modules/user.js'
export default {
components: {
myecharts,
@ -129,7 +130,8 @@
// areasTotal: 0,
status1Total: 0,
dateTotal: 0
},
},
stateObj: {},
nowDate: '',
//
list_areas: [],
@ -160,7 +162,8 @@
},
created() {
this.monthSelect.year = this.$moment(new Date).format("YYYY")
this.yearSelect.year = this.$moment(new Date).format("YYYY")
this.yearSelect.year = this.$moment(new Date).format("YYYY")
this.stateObj = state.state
this.init()
this.getRecords()
this.getMonthList()
@ -215,9 +218,13 @@
//
changeBussiness(e) {
this.list_business.map(item => {
if (e === item.id) {
this.list_areas = item.area_ids_details
this.monthSelect.area_id = this.list_areas[0].id
if (e === item.id) {
//
if(this.stateObj.is_admin){
this.list_areas = item.area_ids_details
this.monthSelect.area_id = this.list_areas[0].id
}
this.list_type = item.id_business_types_business_id_relation.filter(item => {
return item.area_id == this.monthSelect.area_id
})
@ -248,19 +255,33 @@
page: 1,
table_name: 'businesses',
json_data_fields: ['area_ids'],
})
this.list_business = res.data.reverse()
//
if (res.data.length > 0) {
this.monthSelect.business_id = res.data[0].id
this.list_areas = res.data[0].area_ids_details
this.monthSelect.area_id = this.list_areas[0].id
this.list_type = res.data[0].id_business_types_business_id_relation.filter(item => {
return item.area_id == this.monthSelect.area_id
})
this.monthSelect.business_type_id = this.list_type[0].id
}
})
//
//
//
if(!this.stateObj.is_admin){
this.list_business = res.data.filter(item => {
return item.area_ids.includes(this.stateObj.area_id)
})
this.monthSelect.business_id = this.list_business[0].id
this.monthSelect.area_id = this.stateObj.area_id
this.list_type = this.list_business[0].id_business_types_business_id_relation.filter(item => {
return item.area_id == this.monthSelect.area_id
})
this.monthSelect.business_type_id = this.list_type[0].id
}else{
this.list_business = res.data.reverse()
this.monthSelect.business_id = res.data[0].id
this.list_areas = res.data[0].area_ids_details
this.monthSelect.area_id = this.list_areas[0].id
this.list_type = res.data[0].id_business_types_business_id_relation.filter(item => {
return item.area_id == this.monthSelect.area_id
})
this.monthSelect.business_type_id = this.list_type[0].id
}
},
async getFillChart() {
@ -338,7 +359,8 @@
async getYearList() {
await this.getAreas()
await this.getYearChart()
},
},
async getAreas() {
const res = await index({
page_size: 999,
@ -347,8 +369,13 @@
sort_type: 'ASC',
sort_name: 'sort',
})
this.all_areas = res.data
this.yearSelect.area_id = this.all_areas[0].id
this.all_areas = res.data
//
if(!this.stateObj.is_admin){
this.yearSelect.area_id = this.stateObj.area_id
}else{
this.yearSelect.area_id = this.all_areas[0].id
}
},
async getYearChart() {
const res = await yearChart({

@ -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;

@ -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({

@ -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({

Loading…
Cancel
Save