|
|
|
|
@ -7,23 +7,35 @@
|
|
|
|
|
<div slot="content" v-if="!hasMenu">
|
|
|
|
|
<div class="searchwrap" style="display: flex;align-items: center;">
|
|
|
|
|
<div>
|
|
|
|
|
<el-input v-model="select.title" placeholder="请输入名称"></el-input>
|
|
|
|
|
<el-input style="width:200px" v-model="select.title" placeholder="请输入名称"></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-select style="width:100%" v-model="select.status" placeholder="请选择状态" clearable>
|
|
|
|
|
<el-select style="width:200px" v-model="select.status" placeholder="请选择状态" clearable>
|
|
|
|
|
<el-option v-for="item in statusList" :key="item.id" :label="item.name" :value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="is_search">
|
|
|
|
|
<el-select style="width:200px" clearable @clear="clearCatalog" v-model="select.catalog_name" placeholder="请选择目录">
|
|
|
|
|
<el-option value="">
|
|
|
|
|
<el-tree :default-checked-keys="checkArr" :check-strictly="true" @check="getSelectedNodes"
|
|
|
|
|
:data="catalogList" show-checkbox node-key="id" ref="tree" highlight-current
|
|
|
|
|
:props="defaultProps">
|
|
|
|
|
</el-tree>
|
|
|
|
|
</el-option>
|
|
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-select style="width:100%" v-model="select.area_id" clearable multiple collapse-tags
|
|
|
|
|
<el-select style="width:200px" v-model="select.area_id" clearable multiple collapse-tags
|
|
|
|
|
placeholder="请选择区域">
|
|
|
|
|
<el-option v-for="item in areaList" :key="item.id" :label="item.name" :value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<el-select style="width:100%" v-model="select.tag_id" multiple collapse-tags placeholder="请选择标签">
|
|
|
|
|
<el-select style="width:200px" v-model="select.tag_id" multiple collapse-tags placeholder="请选择标签">
|
|
|
|
|
<el-option v-for="item in tagList" :key="item.id" :label="item.name" :value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
@ -165,6 +177,7 @@
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
catalog_id: '',
|
|
|
|
|
catalog_name: '',
|
|
|
|
|
status: '',
|
|
|
|
|
area_id: '',
|
|
|
|
|
tag_id: '',
|
|
|
|
|
@ -181,12 +194,14 @@
|
|
|
|
|
label: 'name'
|
|
|
|
|
},
|
|
|
|
|
catalogList: [],
|
|
|
|
|
catalogChildren: [], // 存储所有数据
|
|
|
|
|
showChildren:[], // 目前显示
|
|
|
|
|
lastChildren:[], // 上一级
|
|
|
|
|
catalogChildren: [], // 存储所有数据
|
|
|
|
|
showChildren: [], // 目前显示
|
|
|
|
|
lastChildren: [], // 上一级
|
|
|
|
|
areaList: [],
|
|
|
|
|
tagList: [],
|
|
|
|
|
nowDate: '',
|
|
|
|
|
is_search: false,
|
|
|
|
|
checkArr: [],
|
|
|
|
|
statusList: [{
|
|
|
|
|
id: 0,
|
|
|
|
|
name: '正常',
|
|
|
|
|
@ -257,27 +272,28 @@
|
|
|
|
|
//
|
|
|
|
|
this.nowDate = this.$moment().format("YYYY-MM-DD")
|
|
|
|
|
this.stateObj = state.state
|
|
|
|
|
console.log("this.stateObj", this.stateObj)
|
|
|
|
|
if (this.$route.query.searchTitle) {
|
|
|
|
|
this.select.title = this.$route.query.searchTitle
|
|
|
|
|
}
|
|
|
|
|
if (this.$route.query.dateTotal) {
|
|
|
|
|
this.select.endRange = [this.nowDate, this.nowDate]
|
|
|
|
|
this.select.status = 0
|
|
|
|
|
this.is_search = false
|
|
|
|
|
if (this.$route.query.searchTitle) {
|
|
|
|
|
this.select.title = this.$route.query.searchTitle
|
|
|
|
|
this.is_search = true
|
|
|
|
|
}
|
|
|
|
|
if (this.$route.query.dateTotal) {
|
|
|
|
|
this.select.endRange = [this.nowDate, this.nowDate]
|
|
|
|
|
this.select.status = 0
|
|
|
|
|
this.is_search = true
|
|
|
|
|
}
|
|
|
|
|
// this.getCatalogList()
|
|
|
|
|
if (this.$route.path) {
|
|
|
|
|
let path = this.$route.path.split("_")
|
|
|
|
|
this.select.catalog_id = path[1]
|
|
|
|
|
let path = this.$route.path.split("_")
|
|
|
|
|
this.select.catalog_id = path[1]
|
|
|
|
|
console.log(this.$route.path.includes('menu'))
|
|
|
|
|
if (this.$route.path.includes('menu')) {
|
|
|
|
|
this.hasMenu = true
|
|
|
|
|
// this.getCatalogChildren(path[1])
|
|
|
|
|
this.getCatalogList(path[1])
|
|
|
|
|
} else {
|
|
|
|
|
this.getCatalogList()
|
|
|
|
|
this.getAreaList()
|
|
|
|
|
this.getTagList()
|
|
|
|
|
this.getTagList()
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -293,15 +309,29 @@
|
|
|
|
|
console.log("e", e)
|
|
|
|
|
this.myHeight = e + 37
|
|
|
|
|
},
|
|
|
|
|
getSelectedNodes(data, node) {
|
|
|
|
|
console.log("data", data)
|
|
|
|
|
this.$refs.tree.setCheckedKeys([]); // 删除所有选中节点
|
|
|
|
|
this.$refs.tree.setCheckedNodes([data]); // 选中已选中节点
|
|
|
|
|
this.select.catalog_id = data.id
|
|
|
|
|
this.select.catalog_name = data.name
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
},
|
|
|
|
|
clearCatalog(e){
|
|
|
|
|
this.select.catalog_id = ''
|
|
|
|
|
this.select.catalog_name = ''
|
|
|
|
|
this.checkArr = []
|
|
|
|
|
this.$refs.tree.setCheckedKeys([]);
|
|
|
|
|
},
|
|
|
|
|
toUrl(item) {
|
|
|
|
|
let path = ''
|
|
|
|
|
if (item.children && item.children.length > 0) {
|
|
|
|
|
// path = '/record/menu_' + item.id + '?time=' + new Date()
|
|
|
|
|
// path = '/record/menu_' + item.id + '?time=' + new Date()
|
|
|
|
|
this.catalogChildren = item.children
|
|
|
|
|
} else {
|
|
|
|
|
path = '/record/index_' + item.id
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: path
|
|
|
|
|
path = '/record/index_' + item.id
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: path
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -317,31 +347,13 @@
|
|
|
|
|
})
|
|
|
|
|
if (res.data.length > 0) {
|
|
|
|
|
this.catalogList = this.base.buildTree(res.data)
|
|
|
|
|
console.log("this.catalogList", this.catalogList)
|
|
|
|
|
if (pid) {
|
|
|
|
|
let pList = this.base.findNodesById(this.catalogList, pid)
|
|
|
|
|
console.log("pList",pList)
|
|
|
|
|
let pList = this.base.findNodesById(this.catalogList, pid)
|
|
|
|
|
console.log("pList", pList)
|
|
|
|
|
this.catalogChildren = pList[0].children
|
|
|
|
|
}
|
|
|
|
|
console.log("this.catalogChildren", this.catalogChildren)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getCatalogChildren(pid) {
|
|
|
|
|
const res = await index({
|
|
|
|
|
page_size: 999,
|
|
|
|
|
page: 1,
|
|
|
|
|
sort_type: 'ASC',
|
|
|
|
|
sort_name: 'sort',
|
|
|
|
|
table_name: 'catalogs',
|
|
|
|
|
filter: [{
|
|
|
|
|
key: 'pid',
|
|
|
|
|
op: 'eq',
|
|
|
|
|
value: pid
|
|
|
|
|
}]
|
|
|
|
|
// is_auth: 1,
|
|
|
|
|
})
|
|
|
|
|
this.catalogChildren = res.data
|
|
|
|
|
},
|
|
|
|
|
async getAreaList() {
|
|
|
|
|
const res = await index({
|
|
|
|
|
page_size: 999,
|
|
|
|
|
@ -365,13 +377,6 @@
|
|
|
|
|
this.tagList = res.data
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
getSelectedNodes(data, node, self) {
|
|
|
|
|
node.expanded = true
|
|
|
|
|
this.select.catalog_id = data.id
|
|
|
|
|
this.select.page = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
editIndex(type, id) {
|
|
|
|
|
@ -404,11 +409,19 @@
|
|
|
|
|
},
|
|
|
|
|
resetSearch() {
|
|
|
|
|
this.select.page = 1
|
|
|
|
|
this.select.title = ''
|
|
|
|
|
|
|
|
|
|
this.select.area_id = []
|
|
|
|
|
this.select.tag_id = []
|
|
|
|
|
this.select.startRange = []
|
|
|
|
|
this.select.endRange = []
|
|
|
|
|
this.select.endRange = []
|
|
|
|
|
if(this.is_search){
|
|
|
|
|
this.select.catalog_id = ''
|
|
|
|
|
this.select.catalog_name = ''
|
|
|
|
|
this.checkArr = []
|
|
|
|
|
this.$refs.tree.setCheckedKeys([]);
|
|
|
|
|
}else{
|
|
|
|
|
this.select.title = ''
|
|
|
|
|
}
|
|
|
|
|
// this.select.catalog_id = ''
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
@ -495,11 +508,13 @@
|
|
|
|
|
.searchwrap {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
|
|
&>div {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
|
|
|
|
span {
|
|
|
|
|
min-width: 70px;
|
|
|
|
|
@ -526,19 +541,8 @@
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// display: flex;
|
|
|
|
|
// // align-items: center;
|
|
|
|
|
// justify-content: space-between;
|
|
|
|
|
|
|
|
|
|
// &_left {
|
|
|
|
|
// width: 20%;
|
|
|
|
|
// background: #fff;
|
|
|
|
|
// padding: 10px;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// &_right {
|
|
|
|
|
// width: 79%
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
::v-deep .el-checkbox__input .el-checkbox__inner {
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|