master
lion 1 year ago
parent 0c116feb86
commit fc7596ca5e

@ -19,21 +19,22 @@ export default {
return isExternal(this.to)
},
type() {
if (this.isExternal) {
return 'a'
}
// if (this.isExternal) {
// return 'a'
// }
return 'router-link'
}
},
methods: {
linkProps(to) {
if (this.isExternal) {
return {
href: to,
target: '_blank',
rel: 'noopener'
}
}
// if (this.isExternal) {
// return {
// href: to,
// target: '_blank',
// rel: 'noopener'
// }
// }
return {
to: to
}

@ -11,12 +11,29 @@
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
<template slot="title">
<app-link v-if="!item.path.includes('key')" :to="resolvePath(item.path)">
<el-menu-item :index="resolvePath(item.path)" class="sublink" :class="{'submenu-title-noDropdown':!isNest}">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
<!-- <el-menu-item :index="resolvePath(item.path)"
:class="{'submenu-title-noDropdown':!isNest,'sublink':item.path.includes('sub')}">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
</el-menu-item> -->
<item v-if="item.path.includes('key')" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
<!-- <app-link :to="resolvePath(item.path)">
<el-menu-item :index="resolvePath(item.path)" :class="{'submenu-title-noDropdown':!isNest,'sublink':!item.path.includes('menu')}">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title+123" />
</el-menu-item>
</app-link> -->
<app-link class="menuwrap" v-else-if="item.path.includes('menu')" :to="resolvePath(item.path)">
<el-menu-item :index="resolvePath(item.path)" :class="{'submenu-title-noDropdown':!isNest}">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
</el-menu-item>
</app-link>
<app-link v-else :to="resolvePath(item.path)">
<el-menu-item :index="resolvePath(item.path)" :class="{'submenu-title-noDropdown':!isNest,'sublink':!item.path.includes('menu')}">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
</el-menu-item>
</app-link>
<item v-else :icon="item.meta && item.meta.icon" :title="item.meta.title" />
<!-- <item v-else :icon="item.meta && item.meta.icon" :title="item.meta.title+456" /> -->
</template>
<sidebar-item v-for="(child,cindex) in item.children" :key="child.path" :is-nest="true" :item="child"
:base-path="resolvePath(child.path)" class="nest-menu submenu-item" />
@ -77,7 +94,6 @@
if (showingChildren.length === 1) {
return true
}
// Show parent if there are no child router to display
if (showingChildren.length === 0) {
this.onlyOneChild = {
@ -87,16 +103,20 @@
}
return true
}
console.log("this.onlyOneChild", this.onlyOneChild)
return false
},
resolvePath(routePath) {
if (isExternal(routePath)) {
resolvePath(routePath) {
if (isExternal(routePath)) {
console.log("path",routePath)
return routePath
}
if (isExternal(this.basePath)) {
if (isExternal(this.basePath)) {
console.log("basePath",this.basePath)
return this.basePath
}
}
console.log("resolve",path.resolve(this.basePath, routePath))
return path.resolve(this.basePath, routePath)
}
}
@ -108,7 +128,11 @@
} */
::v-deep .submenu-item .el-submenu__title {
padding: 0 !important;
}
}
::v-deep .menuwrap .el-menu-item {
padding: 0 !important;
}
::v-deep .submenu-item .sublink {
padding-left: 40px !important;

@ -7,7 +7,7 @@
<navbar />
</div>
<el-scrollbar :style="{height:'100%','padding':'50px 20px 0 20px'}">
<app-main />
<app-main :key="key"/>
</el-scrollbar>
</div>
</div>
@ -46,6 +46,10 @@
withoutAnimation: this.sidebar.withoutAnimation,
mobile: this.device === 'mobile'
}
},
key() {
return this.$route.path
}
},
methods: {

@ -75,8 +75,8 @@ import XySelectors from '@/components/XySelectors'
Vue.component('xy-selectors',XySelectors)
import draggable from 'vuedraggable';
Vue.component('draggable',draggable)
// import tinymce from '@/components/XyTinymce'
// Vue.component('my-tinymce',tinymce)
import tinymce from '@/components/XyTinymce'
Vue.component('my-tinymce',tinymce)
import myMap from "@/components/XyMap"
Vue.component('my-map',myMap)
import afTableColumn from 'af-table-column'

@ -60,11 +60,11 @@ export const constantRoutes = [{
hidden: true
},
{
path: '/record/index',
path: '/record/search',
component: Layout,
children: [{
path: '/record/index',
component: () => import('@/views/record/index'),
path: '/record/search',
component: () => import('@/views/record/search'),
name: '搜索',
meta: {
title: '搜索'

@ -125,7 +125,8 @@ export function generaMenu(routes, data) {
children: [{
path: "",
name: 'menu_' + item.id,
component: (item.url.includes('#')||item.path == '') ? Layout : loadView(item.url),
// component: (item.url.includes('#')||item.path == '') ? Layout : loadView(item.url),
component: Layout,
meta: {
title: item.name,
id: item.id,

@ -358,9 +358,27 @@ let base = {
}
});
return rootNodes;
}
},
findNodesById(nodes, targetId) {
let result = [];
// 遍历每个节点
nodes.forEach(node => {
// 如果当前节点的ID匹配添加到结果数组
if (node.id == targetId) {
result.push(node);
}
// 如果节点有子节点,递归查找
if (node.children && node.children.length > 0) {
const childNodes = this.findNodesById(node.children, targetId);
result = result.concat(childNodes);
}
});
return result;
}
}
export default base

@ -1,6 +1,6 @@
<template>
<div>
<xy-dialog ref="dialog" :width="40" :is-show.sync="isShow" :type="'form'" :title="type === 'add' ? '新增目录' : '编辑目录'"
<xy-dialog ref="dialog" :width="50" :is-show.sync="isShow" :type="'form'" :title="type === 'add' ? '新增目录' : '编辑目录'"
:form="form" :rules='rules' @submit="submit">
<template v-slot:pName>
<div class="xy-table-item">
@ -9,7 +9,7 @@
</div>
<div class="xy-table-item-content">
<el-input v-if="type==='add'" v-model="form.pName" disabled clearable style="width: 100%;"></el-input>
<div v-else style="height:150px;overflow: scroll;">
<div v-else style="height:150px;overflow: scroll;">
<el-tree v-if="isShow" :default-checked-keys="checkArr" :check-strictly="true" @check="getSelectedNodes"
:data="catalogList" show-checkbox default-expand-all node-key="id" ref="tree" highlight-current
:props="defaultProps">
@ -28,6 +28,20 @@
</div>
</div>
</template>
<template v-slot:auth_type>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>是否全域共享
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" v-model="form.auth_type" placeholder="请选择">
<el-option v-for="item in [{id:0,name:''},{id:1,name:''}]" :key="item.id" :label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
@ -46,7 +60,7 @@
<script>
import {
save,
show,
show,
index
} from "@/api/system/baseForm.js"
import {
@ -72,6 +86,7 @@
form: {
pName: '根目录',
name: '',
auth_type: 0,
sort: 0,
pid: 0,
},
@ -86,37 +101,37 @@
created() {
},
methods: {
async getCatalogList() {
const res = await index({
page_size: 999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
table_name: 'catalogs',
// is_auth: 1
})
if (res.data.length > 0) {
this.catalogList = this.base.buildTree(res.data)
this.catalogList.unshift({
id:0,
name:'根目录'
})
}
},
getSelectedNodes(data, node) {
console.log("data", data)
this.$refs.tree.setCheckedKeys([]); //
this.$refs.tree.setCheckedNodes([data]); //
this.form.pName = data.name
this.form.pid = data.id
this.$forceUpdate()
methods: {
async getCatalogList() {
const res = await index({
page_size: 999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
table_name: 'catalogs',
// is_auth: 1
})
if (res.data.length > 0) {
this.catalogList = this.base.buildTree(res.data)
this.catalogList.unshift({
id: 0,
name: '根目录'
})
}
},
getSelectedNodes(data, node) {
console.log("data", data)
this.$refs.tree.setCheckedKeys([]); //
this.$refs.tree.setCheckedNodes([data]); //
this.form.pName = data.name
this.form.pid = data.id
this.$forceUpdate()
},
//
setPid(pid, pName) {
console.log("pid", pid, pName)
this.form.pid = pid ? pid : 0
this.form.pName = pName ? pName : '根目录'
this.form.pName = pName ? pName : '根目录'
this.checkArr = pid ? [pid] : []
},
submit() {
@ -125,12 +140,12 @@
}
if (this.type == 'add' || this.type == "child") {
this.form.id = ''
}
if(this.type==='editor'){
if(this.form.pid===this.form.id){
this.$Message.warning("上级目录不能为自身")
return
}
}
if (this.type === 'editor') {
if (this.form.pid === this.form.id) {
this.$Message.warning("上级目录不能为自身")
return
}
}
console.log("this.form", this.form)
save({
@ -151,14 +166,15 @@
id: this.id,
table_name: this.table_name,
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.checkArr = res.pid ? [res.pid] : []
this.form = this.base.requestToForm(res, this.form)
this.checkArr = res.pid ? [res.pid] : [],
this.form.auth_type = res.auth_type ? res.auth_type : 0
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (newVal) {
this.getCatalogList()
if (this.type === 'editor') {
this.getDetail()
@ -168,11 +184,12 @@
}
} else {
this.id = ''
this.type = "add"
this.type = "add"
this.checkArr = []
this.form = {
pName: '根目录',
name: '',
auth_type: 0,
sort: 0,
pid: 0,
}
@ -187,6 +204,7 @@
<style scoped lang="scss">
::v-deep .pName,
::v-deep .name,
::v-deep .auth_type,
::v-deep .sort,
{
flex-basis: 100%;

@ -51,7 +51,24 @@
</div>
</div>
</div>
</div>
</div>
<div class="box box4" @click="toUrl">
<div class="boxtitle">
<span>当日到期提醒</span>
<i class="el-icon-warning statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">总数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to separator="" :start-val="0" :end-val="totaldata.dateTotal"
:duration="3000" />
</div>
</div>
</div>
</div>
</div>
</div>
</template>
@ -69,7 +86,8 @@
default: {
recordsTotal:0,
organizesTotal:0,
areasTotal:0
areasTotal:0,
dateTotal:0
}
}
},
@ -79,6 +97,12 @@
methods: {
handleRoute(type) {
this.$emit('handleRoute', type)
},
toUrl(){
if(this.totaldata.dateTotal>0){
this.$router.push('/record/index?dateTotal=1')
}
},
toCaculateper(f1, f2) {
return ((f1 / (f2 == 0 ? 1 : f2)) * 100).toFixed(2) + "%"
@ -121,7 +145,7 @@
.box {
position: relative;
width: 32%;
width: 24%;
// margin-left: 0.5%;
// margin-right: 0.5%;
margin-bottom: 10px;
@ -129,7 +153,8 @@
border-radius: 8px;
box-sizing: border-box;
opacity: 0.8;
padding: 1.25rem 0;
padding: 1.25rem 0;
cursor: pointer;
.boxcontentsubtitle {
color: #FFFFFF;

@ -24,7 +24,10 @@
import PanelGroup from './components/PanelGroup';
import {
home
} from "@/api/home"
} from "@/api/home"
import {
index
} from "@/api/system/baseForm.js"
export default {
components: {
myecharts,
@ -35,8 +38,10 @@
list: {
recordsTotal: 0,
organizesTotal: 0,
areasTotal: 0
},
areasTotal: 0,
dateTotal:0
},
nowDate:'',
overall_month_data: {},
overall_originze_data: {}
}
@ -46,19 +51,39 @@
},
created() {
this.listHome()
this.init()
this.init()
this.getList()
},
mounted() {
},
methods: {
methods: {
async getList() {
this.nowDate = this.$moment().format("YYYY-MM-DD")
console.log("this.nowDate",this.nowDate)
const res = await index({
page_size: 9999,
page: 1,
table_name: 'records',
is_auth: 1,
catalogs_id: '',
filter:[{
key:'end_date',
op:'range',
value:[this.nowDate,this.nowDate]
},{
key:'status',
op:'eq',
value:0
}]
})
this.list.dateTotal = res.total
},
async listHome() {
const res = await home()
this.list = {
recordsTotal: res?.recordsTotal,
organizesTotal: res?.organizesTotal,
areasTotal: res?.areasTotal
}
const res = await home()
this.list.recordsTotal = res?.recordsTotal
this.list.organizesTotal = res?.organizesTotal
this.list.areasTotal = res?.areasTotal
let xMonth = []
let dMonth = []
res.list.map(item => {

@ -12,10 +12,23 @@
</div>
</div>
</template>
<template v-slot:status>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>状态
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" v-model="form.status" placeholder="请选择">
<el-option v-for="item in statusList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:date>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>发布日期
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>开始日期
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.date" style="width:100%" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@ -24,13 +37,26 @@
</div>
</div>
</template>
<template v-slot:end_date>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>结束日期
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.end_date" style="width:100%" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:area_ids>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>所属区域
</div>
<div class="xy-table-item-content">
<el-select :disabled="stateObj.auth_type==1" style="width:100%" v-model="form.area_ids" multiple placeholder="请选择">
<el-select :disabled="stateObj.auth_type==1" style="width:100%" v-model="form.area_ids" multiple
placeholder="请选择">
<el-option v-for="item in areaList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@ -87,6 +113,13 @@
</div>
</div>
</template>
<template v-slot:footerContent>
<div>
<Button ghost type="primary" @click="isShow = false">取消</Button>
<Button type="primary" v-if="form.status<2" @click="clickSubmit"></Button>
<Button type="primary" v-else @click="clickSubmit('next')"></Button>
</div>
</template>
</xy-dialog>
</div>
@ -118,7 +151,18 @@
isShow: false,
id: '',
showTinymce: false,
is_next: false, //
catalogList: [],
statusList: [{
id: 0,
name: '正常'
}, {
id: 1,
name: '已到期'
}, {
id: 2,
name: '已延续'
}],
checkArr: [],
defaultProps: {
children: 'children',
@ -134,13 +178,16 @@
areaList: [],
form: {
title: '',
status: 0,
date: '',
end_date: '',
area_ids: [],
tag_ids: [],
catalog_id: '',
catalog_name: '',
files: [],
content: '',
link_id: ''
},
rules: {
title: [{
@ -151,6 +198,14 @@
required: true,
message: '请选择所属区域'
}],
date: [{
required: true,
message: '请输入标题'
}],
end_date: [{
required: true,
message: '请输入标题'
}],
// tag_ids: [{
// required: true,
// message: ''
@ -161,50 +216,16 @@
created() {
this.stateObj = state.state
this.uploadOther.token = getToken();
this.getCatalogList()
this.getAreaList()
this.getTagList()
},
methods: {
changeEditor(e) {
this.form.content = e
},
async getCatalogList() {
const res = await index({
page_size: 999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
table_name: 'catalogs',
// is_auth: 1
})
if (res.data.length > 0) {
this.catalogList = this.base.buildTree(res.data)
}
},
async getAreaList() {
const res = await index({
page_size: 999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
table_name: 'areas',
})
this.areaList = res.data
},
async getTagList() {
const res = await index({
page_size: 999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
table_name: 'record_tags',
is_auth: 1
})
this.tagList = res.data
},
setList(cat,area,tag){
this.catalogList = cat?cat:[]
this.areaList = area?area:[]
this.tagList = tag?tag:[]
},
getSelectedNodes(data, node) {
console.log("data", data)
this.$refs.tree.setCheckedKeys([]); //
@ -221,6 +242,9 @@
this.checkArr = []
this.form.catalog_id = ''
}
},
setLinkId(e){
this.form.link_id = e?e:''
},
handleRemove(file, fileList) {
this.filesList = fileList
@ -234,11 +258,14 @@
}
this.filesList = fileList
},
saveContent(e) {
this.form.content = e
clickSubmit(bol) {
if (bol === 'next') {
this.is_next = true
} else {
this.is_next = false
}
this.$refs.dialog.submit()
},
submit() {
if (this.id) {
@ -275,9 +302,14 @@
this.$message({
type: 'success',
message: '保存成功'
})
})
if(this.is_next){
this.$emit('refresh', this.is_next, this.id)
}else{
this.$emit('refresh')
}
this.isShow = false
this.$emit('refresh')
console.log("is_next", this.is_next)
})
},
@ -292,10 +324,11 @@
this.form = this.base.requestToForm(res, this.form)
console.log("form---", this.form)
this.checkArr = res.catalog_id ? [res.catalog_id] : [],
this.form.area_ids = res.area_ids ? res.area_ids : []
this.form.area_ids = res.area_ids ? res.area_ids : []
this.form.tag_ids = res.tag_ids ? res.tag_ids : []
this.form.files = res.files ? res.files : [],
this.form.content = res.content ? res.content : ''
this.form.status = res.status ? res.status : 0
this.form.content = res.content ? res.content : ''
if (res.files_details && res.files_details.length > 0) {
this.filesList = []
res.files_details.map(item => {
@ -316,8 +349,8 @@
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
} else {
this.form.area_ids = this.stateObj.area_id?[this.stateObj.area_id]:[]
} else {
this.form.area_ids = this.stateObj.area_id ? [this.stateObj.area_id] : []
this.showTinymce = true
}
@ -328,13 +361,16 @@
this.filesList = []
this.form = {
title: '',
status: 0,
date: '',
end_date: '',
area_ids: [],
tag_ids: [],
catalog_id: '',
catalog_name: '',
files: [],
content: '',
link_id: ''
}
this.$refs['dialog'].reset()
}
@ -347,6 +383,8 @@
<style scoped lang="scss">
::v-deep .title,
::v-deep .date,
::v-deep .status,
::v-deep .end_date,
::v-deep .catalog_id,
::v-deep .content,
::v-deep .files,

@ -0,0 +1,385 @@
<template>
<div>
<xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'form'" :title="'档案延续'" :form="form"
:rules='rules' @submit="submit">
<template v-slot:title>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>标题
</div>
<div class="xy-table-item-content">
<el-input placeholder="请输入标题" style="width:100%" v-model="form.title"></el-input>
</div>
</div>
</template>
<template v-slot:status>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>状态
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" v-model="form.status" placeholder="请选择">
<el-option v-for="item in statusList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:date>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>开始日期
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.date" style="width:100%" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:end_date>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>结束日期
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.end_date" style="width:100%" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:area_ids>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>所属区域
</div>
<div class="xy-table-item-content">
<el-select :disabled="stateObj.auth_type==1" style="width:100%" v-model="form.area_ids" multiple
placeholder="请选择">
<el-option v-for="item in areaList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:tag_ids>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>标签
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" v-model="form.tag_ids" multiple placeholder="请选择">
<el-option v-for="item in tagList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:catalog_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>所属目录
</div>
<div class="xy-table-item-content" style="height:150px;overflow: scroll;">
<el-tree v-if="isShow" :default-checked-keys="checkArr" :check-strictly="true" @check="getSelectedNodes"
:data="catalogList" show-checkbox default-expand-all node-key="id" ref="tree" highlight-current
:props="defaultProps">
</el-tree>
</div>
</div>
</template>
<template v-slot:files>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>附件
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' multiple :file-list="filesList" ref="pictureUpload"
:auto-upload="true" :data="uploadOther" :on-success="handlesuccess" :on-remove="handleRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>内容
</div>
<div class="xy-table-item-content">
<wangEditor :isShow="isShow" v-show="showTinymce" :value="form.content" @change="changeEditor"></wangEditor>
<!-- <my-tinymce v-if="showTinymce" @input="saveContent" :value="form.content"></my-tinymce> -->
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show,
index
} from "@/api/system/baseForm.js"
import wangEditor from '@/components/wangEditor';
import {
deepCopy,
isNull
} from "@/utils";
import {
getToken
} from '@/utils/auth'
import state from '@/store/modules/user.js'
export default {
components: {
wangEditor
},
data() {
return {
stateObj: {},
isShow: false,
id: '',
showTinymce: false,
catalogList: [],
statusList: [{
id: 0,
name: '正常'
}, {
id: 1,
name: '已到期'
}, {
id: 2,
name: '已延续'
}],
checkArr: [],
defaultProps: {
children: 'children',
label: 'name'
},
table_name: 'records',
uploadOther: {
token: ""
},
action: `${process.env.VUE_APP_UPLOAD_API}`,
filesList: [],
tagList: [],
areaList: [],
form: {
title: '',
status: 0,
date: '',
end_date: '',
area_ids: [],
tag_ids: [],
catalog_id: '',
catalog_name: '',
files: [],
content: '',
link_id: ''
},
rules: {
title: [{
required: true,
message: '请输入标题'
}],
area_ids: [{
required: true,
message: '请选择所属区域'
}],
date: [{
required: true,
message: '请输入标题'
}],
end_date: [{
required: true,
message: '请输入标题'
}],
// tag_ids: [{
// required: true,
// message: ''
// }],
}
}
},
created() {
this.stateObj = state.state
this.uploadOther.token = getToken();
},
methods: {
changeEditor(e) {
this.form.content = e
},
getSelectedNodes(data, node) {
console.log("data", data)
this.$refs.tree.setCheckedKeys([]); //
this.$refs.tree.setCheckedNodes([data]); //
this.form.catalog_name = data.name
this.form.catalog_id = data.id
this.$forceUpdate()
},
setCheck(e) {
if (e) {
this.checkArr = [e]
this.form.catalog_id = e
} else {
this.checkArr = []
this.form.catalog_id = ''
}
},
setLinkId(e){
if(e){
this.getDetail(e)
this.form.link_id = e
}
},
handleRemove(file, fileList) {
this.filesList = fileList
},
handlesuccess(response, file, fileList) {
console.log("response", response)
if (response && response.hasOwnProperty('errcode')) {
this.$Message.warning(response.errmsg || '')
this.filesList = []
return
}
this.filesList = fileList
},
submit() {
if (this.id) {
this.form.id = this.id
} else {
this.form.id = ''
}
if (this.base.isNull(this.form.catalog_id)) {
this.$Message.warning("请选择所属目录")
return
}
let _files = []
if (this.filesList.length > 0) {
for (var h of this.filesList) {
if (h.response) {
_files.push(h.response.id)
} else {
_files.push(h.id)
}
}
this.form.files = _files
} else {
this.form.files = []
}
console.log("this.form", this.form)
// return
save({
table_name: this.table_name,
...this.form
}).then(res => {
this.$message({
type: 'success',
message: '保存成功'
})
this.$emit('refresh')
this.isShow = false
})
},
getDetail(id) {
show({
id: id,
table_name: this.table_name,
json_data_fields: ['files']
}).then(res => {
console.log("res---", res)
this.form = this.base.requestToForm(res, this.form)
console.log("form---", this.form)
this.checkArr = res.catalog_id ? [res.catalog_id] : [],
this.form.area_ids = res.area_ids ? res.area_ids : []
this.form.tag_ids = res.tag_ids ? res.tag_ids : []
this.form.files = res.files ? res.files : [],
this.form.status = 0
this.form.content = res.content ? res.content : ''
this.form.link_id = id
if (res.files_details && res.files_details.length > 0) {
this.filesList = []
res.files_details.map(item => {
this.filesList.push({
name: item.original_name,
id: item.id,
url: item.url
})
})
}
this.showTinymce = true
console.log("this.form", this.form)
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
this.form.area_ids = this.stateObj.area_id ? [this.stateObj.area_id] : []
this.showTinymce = true
} else {
this.id = ''
this.showTinymce = false
this.checkArr = []
this.filesList = []
this.form = {
title: '',
status: 0,
date: '',
end_date: '',
area_ids: [],
tag_ids: [],
catalog_id: '',
catalog_name: '',
files: [],
content: '',
link_id: ''
}
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .title,
::v-deep .date,
::v-deep .status,
::v-deep .end_date,
::v-deep .catalog_id,
::v-deep .content,
::v-deep .files,
::v-deep .area_ids,
::v-deep .tag_ids {
flex-basis: 100%;
}
::v-deep .catalog_id .xy-table-item {
align-items: flex-start;
}
::v-deep .xy-table-item-content {
width: calc(100% - 140px);
}
::v-deep .el-checkbox__input .el-checkbox__inner {
border-radius: 50%;
}
</style>

@ -133,7 +133,11 @@
&-html {
line-height: 1.5;
font-size: 20px;
font-size: 20px;
::v-deep video{
display:block!important;
margin:0 auto!important;
}
}
}
</style>

@ -4,11 +4,42 @@
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content">
<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>
</div>
<div>
<el-select style="width:100%" 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>
<el-select style="width:100%" 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-option v-for="item in tagList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-date-picker style="width:250px" @change="changeStart" v-model="select.startRange" type="daterange"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
end-placeholder="">
</el-date-picker>
</div>
<div>
<el-date-picker style="width:250px" @change="changeEnd" v-model="select.endRange" type="daterange"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="结束日期"
end-placeholder="">
</el-date-picker>
</div>
<div>
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button>
</div>
@ -31,12 +62,20 @@
highlight-current :props="defaultProps">
</el-tree>
</div> -->
<div v-if="hasMenu" class="catalog_list">
<div v-for="item in catalogChildren" class='catalog_item' @click="toUrl(item)">
<div>
<i :class="item.children&&item.children.length>0?'el-icon-folder-opened':'el-icon-document-copy'"></i>
<div>{{item.name}}</div>
</div>
</div>
</div>
<div class="catalog_right">
<div class="catalog_right" v-else>
<xy-table @getHeight="initHeight" :list="list" :total="total" @pageIndexChange="pageIndexChange"
@pageSizeChange="pageSizeChange" :table-item="table_item">
<template v-slot:catalog_name>
<el-table-column align='left' label="所属目录" width="240" header-align="center">
<el-table-column align='left' label="所属目录" width="240" header-align="left">
<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">
@ -46,7 +85,7 @@
</el-table-column>
</template>
<template v-slot:area_name>
<el-table-column align='left' label="所属区域" width="240" header-align="center">
<el-table-column align='left' label="所属区域" width="240" header-align="left">
<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">
@ -56,7 +95,7 @@
</el-table-column>
</template>
<template v-slot:tag_name>
<el-table-column align='left' label="标签" width="240" header-align="center">
<el-table-column align='left' label="标签" width="240" header-align="left">
<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">
@ -65,6 +104,16 @@
</template>
</el-table-column>
</template>
<template v-slot:status>
<el-table-column align='center' label="状态" width="120" 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">
{{item.name}}</el-tag>
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='left' fixed="right" label="操作" width="240" header-align="center">
@ -72,10 +121,10 @@
<!-- <el-button type="primary" size="small" @click="editIndex('child',scope.row.id,scope.row.name)"></el-button> -->
<el-button type="primary" size="small" @click="showIndex('show',scope.row.id)"></el-button>
<!-- -->
<el-button v-if="stateObj.login_id===scope.row.admin_id || stateObj.is_admin"
type="primary" size="small" @click="editIndex('editor',scope.row.id)">编辑</el-button>
<el-popconfirm v-if="stateObj.login_id===scope.row.admin_id || stateObj.is_admin"
style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button v-if="stateObj.login_id===scope.row.admin_id || stateObj.is_admin" type="primary"
size="small" @click="editIndex('editor',scope.row.id)">编辑</el-button>
<el-popconfirm v-if="stateObj.login_id===scope.row.admin_id || stateObj.is_admin" style="margin:0 10px"
@confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
@ -86,13 +135,16 @@
</div>
<add-record ref="addRecord" @refresh="getList"></add-record>
<add-record ref="addRecord" @refresh="getRefresh"></add-record>
<addRecordLink ref="addRecordLink" @refresh="getList"></addRecordLink>
<show-record ref="showRecord"></show-record>
</div>
</template>
<script>
import addRecord from './components/addRecord.vue';
import addRecordLink from './components/addRecordLink.vue';
import showRecord from './components/showRecord.vue';
import {
index,
@ -102,6 +154,7 @@
export default {
components: {
addRecord,
addRecordLink,
showRecord
},
data() {
@ -111,8 +164,14 @@
table_name: 'records',
page: 1,
page_size: 10,
catalog_id: ''
catalog_id: '',
status: '',
area_id: '',
tag_id: '',
startRange: [],
endRange: []
},
hasMenu: false,
myHeight: 0,
stateObj: {},
total: 0,
@ -122,6 +181,25 @@
label: 'name'
},
catalogList: [],
catalogChildren: [], //
showChildren:[], //
lastChildren:[], //
areaList: [],
tagList: [],
nowDate: '',
statusList: [{
id: 0,
name: '正常',
type: ''
}, {
id: 1,
name: '已到期',
type: 'info'
}, {
id: 2,
name: '已延续',
type: 'success'
}],
table_item: [{
type: 'index',
width: 50,
@ -130,6 +208,8 @@
prop: 'title',
label: '标题',
align: 'left',
width: 360,
headerAlign: 'left'
},
{
prop: 'catalog_name',
@ -149,36 +229,84 @@
align: 'center',
width: 240
},
{
prop: 'status',
label: '状态',
align: 'center',
width: 120
},
{
prop: 'date',
label: '发布日期',
label: '开始日期',
align: 'center',
width: 120
},
{
prop: 'end_date',
label: '结束日期',
align: 'center',
width: 120
}
]
}
},
created() {
//
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.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.getList()
}
}
if (this.$route.query.searchTitle) {
this.select.title = this.$route.query.searchTitle
},
watch: {
'$route'(to, from) {
this.$router.go(0);
}
this.getList()
},
methods: {
initHeight(e) {
console.log("e", e)
this.myHeight = e + 37
},
async getCatalogList() {
toUrl(item) {
let path = ''
if (item.children && item.children.length > 0) {
// path = '/record/menu_' + item.id + '?time=' + new Date()
this.catalogChildren = item.children
} else {
path = '/record/index_' + item.id + '?time=' + new Date()
this.$router.push({
path: path
})
}
},
async getCatalogList(pid) {
const res = await index({
page_size: 999,
page: 1,
@ -189,8 +317,54 @@
})
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)
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,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
table_name: 'areas',
})
this.areaList = res.data
},
async getTagList() {
const res = await index({
page_size: 999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
table_name: 'record_tags',
is_auth: 1
})
this.tagList = res.data
},
getSelectedNodes(data, node, self) {
node.expanded = true
this.select.catalog_id = data.id
@ -209,6 +383,7 @@
// if(this.select.catalog_id){
// this.$refs.addRecord.setCatalogId(this.select.catalog_id)
// }
this.$refs.addRecord.setList(this.catalogList, this.areaList, this.tagList)
this.$refs.addRecord.type = type
this.$refs.addRecord.isShow = true
},
@ -230,9 +405,42 @@
resetSearch() {
this.select.page = 1
this.select.title = ''
this.select.area_id = []
this.select.tag_id = []
this.select.startRange = []
this.select.endRange = []
// this.select.catalog_id = ''
this.getList()
},
changeStart(e) {
if (e) {
this.select.startRange = e
} else {
this.select.startRange = []
}
},
changeEnd(e) {
if (e) {
this.select.endRange = e
} else {
this.select.endRange = ''
}
},
getRefresh(bol, id) {
if (bol) {
console.log('getRefresh', bol, id)
// if(this.select.catalog_id){
// this.$refs.addRecord.setCatalogId(this.select.catalog_id)
// }
this.$refs.addRecordLink.type = 'add'
this.$refs.addRecordLink.setLinkId(id)
this.$refs.addRecordLink.setList(this.catalogList, this.areaList, this.tagList)
this.$refs.addRecordLink.setCheck(this.select.catalog_id)
this.$refs.addRecordLink.isShow = true
}
this.getList()
},
async getList() {
const res = await index({
page_size: this.select.page_size,
@ -242,14 +450,25 @@
is_auth: 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 : '',
filter: [{
"key": "title",
"op": "like",
"value": this.select.title
}, {
key: 'catalog_id',
key: 'date',
op: 'range',
value: this.select.startRange ? this.select.startRange : []
}, {
key: 'end_date',
op: 'range',
value: this.select.endRange ? this.select.endRange : []
}, {
key: 'status',
op: 'eq',
value: this.select.catalog_id ? this.select.catalog_id : ''
value: this.select.status
}]
})
this.list = res.data
@ -289,6 +508,25 @@
}
.catalog {
&_list {
display: flex;
align-items: center;
}
&_item {
// width:150px;
text-align: center;
font-size: 18px;
margin: 20px;
cursor: pointer;
color: #b3241d;
i {
font-size: 40px;
margin-bottom: 10px;
}
}
// display: flex;
// // align-items: center;
// justify-content: space-between;

@ -0,0 +1,544 @@
<template>
<div>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<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>
</div>
<div>
<el-select style="width:100%" 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>
<el-select style="width:100%" 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-option v-for="item in tagList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-date-picker style="width:250px" @change="changeStart" v-model="select.startRange" type="daterange"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
end-placeholder="">
</el-date-picker>
</div>
<div>
<el-date-picker style="width:250px" @change="changeEnd" v-model="select.endRange" type="daterange"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="结束日期"
end-placeholder="">
</el-date-picker>
</div>
<div>
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="resetSearch"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="editIndex('add')"></el-button>
</div>
</div>
</div>
</lx-header>
</div>
</div>
<div class="catalog">
<!-- <div class="catalog_left" :style="{'height': myHeight+'px',overflow:'scroll'}">
<el-tree @node-click="getSelectedNodes" :data="catalogList" default-expand-all node-key="id" ref="tree"
highlight-current :props="defaultProps">
</el-tree>
</div> -->
<div v-if="hasMenu" class="catalog_list">
<div v-for="item in catalogChildren" class='catalog_item' @click="toUrl(item)">
<div>
<i :class="item.children&&item.children.length>0?'el-icon-folder-opened':'el-icon-document-copy'"></i>
<div>{{item.name}}</div>
</div>
</div>
</div>
<div class="catalog_right" v-else>
<xy-table @getHeight="initHeight" :list="list" :total="total" @pageIndexChange="pageIndexChange"
@pageSizeChange="pageSizeChange" :table-item="table_item">
<template v-slot:catalog_name>
<el-table-column align='left' label="所属目录" width="240" header-align="left">
<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">
{{item.name}}</el-tag>
</div>
</template>
</el-table-column>
</template>
<template v-slot:area_name>
<el-table-column align='left' label="所属区域" width="240" header-align="left">
<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">
{{item.name}}</el-tag>
</div>
</template>
</el-table-column>
</template>
<template v-slot:tag_name>
<el-table-column align='left' label="标签" width="240" header-align="left">
<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">
{{item.name}}</el-tag>
</div>
</template>
</el-table-column>
</template>
<template v-slot:status>
<el-table-column align='center' label="状态" width="120" 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">
{{item.name}}</el-tag>
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='left' fixed="right" label="操作" width="240" header-align="center">
<template slot-scope="scope">
<!-- <el-button type="primary" size="small" @click="editIndex('child',scope.row.id,scope.row.name)"></el-button> -->
<el-button type="primary" size="small" @click="showIndex('show',scope.row.id)"></el-button>
<!-- -->
<el-button v-if="stateObj.login_id===scope.row.admin_id || stateObj.is_admin" type="primary"
size="small" @click="editIndex('editor',scope.row.id)">编辑</el-button>
<el-popconfirm v-if="stateObj.login_id===scope.row.admin_id || stateObj.is_admin" style="margin:0 10px"
@confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</div>
<add-record ref="addRecord" @refresh="getRefresh"></add-record>
<addRecordLink ref="addRecordLink" @refresh="getList"></addRecordLink>
<show-record ref="showRecord"></show-record>
</div>
</template>
<script>
import addRecord from './components/addRecord.vue';
import addRecordLink from './components/addRecordLink.vue';
import showRecord from './components/showRecord.vue';
import {
index,
destroy
} from "@/api/system/baseForm.js"
import state from '@/store/modules/user.js'
export default {
components: {
addRecord,
addRecordLink,
showRecord
},
data() {
return {
select: {
title: '',
table_name: 'records',
page: 1,
page_size: 10,
catalog_id: '',
status: '',
area_id: '',
tag_id: '',
startRange: [],
endRange: []
},
hasMenu: false,
myHeight: 0,
stateObj: {},
total: 0,
list: [],
defaultProps: {
children: 'children',
label: 'name'
},
catalogList: [],
catalogChildren: [], //
showChildren:[], //
lastChildren:[], //
areaList: [],
tagList: [],
nowDate: '',
statusList: [{
id: 0,
name: '正常',
type: ''
}, {
id: 1,
name: '已到期',
type: 'info'
}, {
id: 2,
name: '已延续',
type: 'success'
}],
table_item: [{
type: 'index',
width: 50,
fixed: 'left'
}, {
prop: 'title',
label: '标题',
align: 'left',
width: 360,
headerAlign: 'left'
},
{
prop: 'catalog_name',
label: '所属目录',
align: 'center',
width: 240
},
{
prop: 'area_name',
label: '区域',
align: 'center',
width: 240
},
{
prop: 'tag_name',
label: '标签',
align: 'center',
width: 240
},
{
prop: 'status',
label: '状态',
align: 'center',
width: 120
},
{
prop: 'date',
label: '开始日期',
align: 'center',
width: 120
},
{
prop: 'end_date',
label: '结束日期',
align: 'center',
width: 120
}
]
}
},
created() {
//
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.getCatalogList()
if (this.$route.path) {
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.getList()
}
}
},
watch: {
'$route'(to, from) {
this.$router.go(0);
}
},
methods: {
initHeight(e) {
console.log("e", e)
this.myHeight = e + 37
},
toUrl(item) {
let path = ''
if (item.children && item.children.length > 0) {
// path = '/record/menu_' + item.id + '?time=' + new Date()
this.catalogChildren = item.children
} else {
path = '/record/index_' + item.id + '?time=' + new Date()
this.$router.push({
path: path
})
}
},
async getCatalogList(pid) {
const res = await index({
page_size: 999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
table_name: 'catalogs',
// is_auth: 1,
})
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)
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,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
table_name: 'areas',
})
this.areaList = res.data
},
async getTagList() {
const res = await index({
page_size: 999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
table_name: 'record_tags',
is_auth: 1
})
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) {
if (type == 'editor') {
this.$refs.addRecord.id = id
} else {
this.$refs.addRecord.setCheck(this.select.catalog_id)
}
// if(this.select.catalog_id){
// this.$refs.addRecord.setCatalogId(this.select.catalog_id)
// }
this.$refs.addRecord.setList(this.catalogList, this.areaList, this.tagList)
this.$refs.addRecord.type = type
this.$refs.addRecord.isShow = true
},
showIndex(type, id) {
this.$refs.showRecord.id = id
this.$refs.showRecord.type = type
this.$refs.showRecord.isShow = true
},
pageIndexChange(e) {
this.select.page = e
this.getList()
},
pageSizeChange(e) {
this.select.page_size = e
this.select.page = 1
this.getList()
},
resetSearch() {
this.select.page = 1
this.select.title = ''
this.select.area_id = []
this.select.tag_id = []
this.select.startRange = []
this.select.endRange = []
// this.select.catalog_id = ''
this.getList()
},
changeStart(e) {
if (e) {
this.select.startRange = e
} else {
this.select.startRange = []
}
},
changeEnd(e) {
if (e) {
this.select.endRange = e
} else {
this.select.endRange = ''
}
},
getRefresh(bol, id) {
if (bol) {
console.log('getRefresh', bol, id)
// if(this.select.catalog_id){
// this.$refs.addRecord.setCatalogId(this.select.catalog_id)
// }
this.$refs.addRecordLink.type = 'add'
this.$refs.addRecordLink.setLinkId(id)
this.$refs.addRecordLink.setList(this.catalogList, this.areaList, this.tagList)
this.$refs.addRecordLink.setCheck(this.select.catalog_id)
this.$refs.addRecordLink.isShow = true
}
this.getList()
},
async getList() {
const res = await index({
page_size: this.select.page_size,
page: this.select.page,
table_name: this.select.table_name,
json_data_fields: ['files', 'area_ids', 'tag_ids', 'catalog_id'],
is_auth: 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 : '',
filter: [{
"key": "title",
"op": "like",
"value": this.select.title
}, {
key: 'date',
op: 'range',
value: this.select.startRange ? this.select.startRange : []
}, {
key: 'end_date',
op: 'range',
value: this.select.endRange ? this.select.endRange : []
}, {
key: 'status',
op: 'eq',
value: this.select.status
}]
})
this.list = res.data
this.total = res.total
},
deleteList(id) {
var that = this;
destroy({
id: id,
table_name: this.select.table_name
}).then(response => {
this.$Message.success('操作成功');
this.getList()
}).catch(error => {
console.log(error)
reject(error)
})
},
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
&>div {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
}
}
}
.catalog {
&_list {
display: flex;
align-items: center;
}
&_item {
// width:150px;
text-align: center;
font-size: 18px;
margin: 20px;
cursor: pointer;
color: #b3241d;
i {
font-size: 40px;
margin-bottom: 10px;
}
}
// display: flex;
// // align-items: center;
// justify-content: space-between;
// &_left {
// width: 20%;
// background: #fff;
// padding: 10px;
// }
// &_right {
// width: 79%
// }
}
</style>
Loading…
Cancel
Save