lion 1 year ago
parent 12f0a74ab2
commit 923f5d3614

@ -9,14 +9,18 @@
</div> </div>
<div class="dialogConcent" style="max-height: 65vh !important;min-height: 300px;overflow: scroll;"> <div class="dialogConcent" style="max-height: 65vh !important;min-height: 300px;overflow: scroll;">
<div v-if="typeName=='file'">
<iframe id="iframeWin" :src="url" frameborder="0" scrolling="auto" align="center" class="iframeWeb"> <iframe id="iframeWin" :src="url" frameborder="0" scrolling="auto" align="center" class="iframeWeb">
</iframe> </iframe>
</div> </div>
<div v-if="typeName=='video'" style="text-align: center;">
<video :src="url" controls></video>
</div>
</div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<div> <div>
<el-button size="small" @click="coloseDia"></el-button> <el-button size="small" @click="coloseDia"></el-button>
</div> </div>
<slot name="footerbtn"></slot> <slot name="footerbtn"></slot>
</div> </div>
@ -51,6 +55,7 @@
diaShow: this.isShow, diaShow: this.isShow,
isfullscreen:false, isfullscreen:false,
url:'', url:'',
typeName:'file',
baseUrl: `${process.env.VUE_APP_PREVIEW_API}?url=`, baseUrl: `${process.env.VUE_APP_PREVIEW_API}?url=`,
wheight: "", wheight: "",
form:{ form:{
@ -70,6 +75,7 @@
// this.url = "" // this.url = ""
this.diaShow = false this.diaShow = false
this.url = '' this.url = ''
this.typeName = 'file'
this.$emit('update:isShow', false) this.$emit('update:isShow', false)
} }
} }

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

@ -17,6 +17,13 @@ let base = {
isUrl(url) { isUrl(url) {
return this.checkUrl(url) return this.checkUrl(url)
}, },
containsVideoFormat(str) {
// 定义包含常见视频格式的正则表达式
const videoFormats = /\.(mp4|avi|mov|wmv|flv|mkv|webm|mpg|mpeg)$/i;
// 使用正则表达式的test方法来检查字符串
return videoFormats.test(str);
},
checkUrl(url) { checkUrl(url) {
// url= 协议://(ftp的登录信息)[IP|域名](:端口号)(/或?请求参数) // url= 协议://(ftp的登录信息)[IP|域名](:端口号)(/或?请求参数)
var strRegex = var strRegex =

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'form'" :title="'档案信息'" :form="form" <xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'form'" :title="$route.meta.title" :form="form"
:rules='rules' @submit="submit"> :rules='rules' @submit="submit">
<template v-slot:title> <template v-slot:title>
<div class="xy-table-item"> <div class="xy-table-item">
@ -76,7 +76,7 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:catalog_id> <template v-slot:catalog_id v-if="false">
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <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>所属目录

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'form'" :title="'档案延续'" :form="form" <xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'form'" :title="$route.meta.title+'--档案延续'" :form="form"
:rules='rules' @submit="submit"> :rules='rules' @submit="submit">
<template v-slot:title> <template v-slot:title>
<div class="xy-table-item"> <div class="xy-table-item">
@ -76,7 +76,7 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:catalog_id> <template v-slot:catalog_id v-if="false">
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <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>所属目录
@ -214,7 +214,11 @@
changeEditor(e) { changeEditor(e) {
this.form.content = e this.form.content = e
}, },
setList(cat,area,tag){
this.catalogList = cat?cat:[]
this.areaList = area?area:[]
this.tagList = tag?tag:[]
},
getSelectedNodes(data, node) { getSelectedNodes(data, node) {
console.log("data", data) console.log("data", data)
this.$refs.tree.setCheckedKeys([]); // this.$refs.tree.setCheckedKeys([]); //

@ -31,7 +31,7 @@
<div v-for="(item,index) in form.files_details"> <div v-for="(item,index) in form.files_details">
附件{{index+1}} 附件{{index+1}}
<a :href="item.url" target="_blank">{{item.original_name}}</a> <a :href="item.url" target="_blank">{{item.original_name}}</a>
<el-link target="_blank" style="margin:0 10px;" @click="toshowFile(item.view_url)" type="primary"> <el-link target="_blank" style="margin:0 10px;" @click="toshowFile(item)" type="primary">
预览 预览
</el-link> </el-link>
</div> </div>
@ -80,8 +80,15 @@
console.log("this.form", this.form) console.log("this.form", this.form)
}) })
}, },
toshowFile(url) { toshowFile(item) {
this.$refs.viewFile.url = url //
if(item.url && this.base.containsVideoFormat(item.url)){
this.$refs.viewFile.typeName = 'video'
this.$refs.viewFile.url = item.url
}else{
this.$refs.viewFile.typeName = 'file'
this.$refs.viewFile.url = item.view_url
}
this.$refs.viewFile.diaShow = true this.$refs.viewFile.diaShow = true
}, },
}, },

@ -7,23 +7,35 @@
<div slot="content" v-if="!hasMenu"> <div slot="content" v-if="!hasMenu">
<div class="searchwrap" style="display: flex;align-items: center;"> <div class="searchwrap" style="display: flex;align-items: center;">
<div> <div>
<el-input v-model="select.title" placeholder="请输入名称"></el-input> <el-input style="width:200px" v-model="select.title" placeholder="请输入名称"></el-input>
</div> </div>
<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 v-for="item in statusList" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</div> </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> <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="请选择区域"> placeholder="请选择区域">
<el-option v-for="item in areaList" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in areaList" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<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 v-for="item in tagList" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@ -165,6 +177,7 @@
page: 1, page: 1,
page_size: 10, page_size: 10,
catalog_id: '', catalog_id: '',
catalog_name: '',
status: '', status: '',
area_id: '', area_id: '',
tag_id: '', tag_id: '',
@ -182,11 +195,13 @@
}, },
catalogList: [], catalogList: [],
catalogChildren: [], // catalogChildren: [], //
showChildren:[], // showChildren: [], //
lastChildren:[], // lastChildren: [], //
areaList: [], areaList: [],
tagList: [], tagList: [],
nowDate: '', nowDate: '',
is_search: false,
checkArr: [],
statusList: [{ statusList: [{
id: 0, id: 0,
name: '正常', name: '正常',
@ -257,13 +272,15 @@
// //
this.nowDate = this.$moment().format("YYYY-MM-DD") this.nowDate = this.$moment().format("YYYY-MM-DD")
this.stateObj = state.state this.stateObj = state.state
console.log("this.stateObj", this.stateObj) this.is_search = false
if (this.$route.query.searchTitle) { if (this.$route.query.searchTitle) {
this.select.title = this.$route.query.searchTitle this.select.title = this.$route.query.searchTitle
this.is_search = true
} }
if (this.$route.query.dateTotal) { if (this.$route.query.dateTotal) {
this.select.endRange = [this.nowDate, this.nowDate] this.select.endRange = [this.nowDate, this.nowDate]
this.select.status = 0 this.select.status = 0
this.is_search = true
} }
// this.getCatalogList() // this.getCatalogList()
if (this.$route.path) { if (this.$route.path) {
@ -272,7 +289,6 @@
console.log(this.$route.path.includes('menu')) console.log(this.$route.path.includes('menu'))
if (this.$route.path.includes('menu')) { if (this.$route.path.includes('menu')) {
this.hasMenu = true this.hasMenu = true
// this.getCatalogChildren(path[1])
this.getCatalogList(path[1]) this.getCatalogList(path[1])
} else { } else {
this.getCatalogList() this.getCatalogList()
@ -293,6 +309,20 @@
console.log("e", e) console.log("e", e)
this.myHeight = e + 37 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) { toUrl(item) {
let path = '' let path = ''
if (item.children && item.children.length > 0) { if (item.children && item.children.length > 0) {
@ -317,31 +347,13 @@
}) })
if (res.data.length > 0) { if (res.data.length > 0) {
this.catalogList = this.base.buildTree(res.data) this.catalogList = this.base.buildTree(res.data)
console.log("this.catalogList", this.catalogList)
if (pid) { if (pid) {
let pList = this.base.findNodesById(this.catalogList, pid) let pList = this.base.findNodesById(this.catalogList, pid)
console.log("pList",pList) console.log("pList", pList)
this.catalogChildren = pList[0].children 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() { async getAreaList() {
const res = await index({ const res = await index({
page_size: 999, page_size: 999,
@ -365,13 +377,6 @@
this.tagList = res.data 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) { editIndex(type, id) {
@ -404,11 +409,19 @@
}, },
resetSearch() { resetSearch() {
this.select.page = 1 this.select.page = 1
this.select.title = ''
this.select.area_id = [] this.select.area_id = []
this.select.tag_id = [] this.select.tag_id = []
this.select.startRange = [] 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.select.catalog_id = ''
this.getList() this.getList()
}, },
@ -495,11 +508,13 @@
.searchwrap { .searchwrap {
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: wrap;
&>div { &>div {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 10px; margin-right: 10px;
margin-bottom: 10px;
span { span {
min-width: 70px; min-width: 70px;
@ -526,19 +541,8 @@
margin-bottom: 10px; margin-bottom: 10px;
} }
} }
}
// display: flex; ::v-deep .el-checkbox__input .el-checkbox__inner {
// // align-items: center; border-radius: 50%;
// justify-content: space-between;
// &_left {
// width: 20%;
// background: #fff;
// padding: 10px;
// }
// &_right {
// width: 79%
// }
} }
</style> </style>

@ -46,9 +46,6 @@
<div> <div>
<el-button type="primary" size="small" @click="resetSearch"></el-button> <el-button type="primary" size="small" @click="resetSearch"></el-button>
</div> </div>
<div>
<el-button type="primary" size="small" @click="editIndex('add')"></el-button>
</div>
</div> </div>
</div> </div>
@ -57,21 +54,7 @@
</div> </div>
<div class="catalog"> <div class="catalog">
<!-- <div class="catalog_left" :style="{'height': myHeight+'px',overflow:'scroll'}"> <div class="catalog_right">
<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" <xy-table @getHeight="initHeight" :list="list" :total="total" @pageIndexChange="pageIndexChange"
@pageSizeChange="pageSizeChange" :table-item="table_item"> @pageSizeChange="pageSizeChange" :table-item="table_item">
<template v-slot:catalog_name> <template v-slot:catalog_name>
@ -171,7 +154,6 @@
startRange: [], startRange: [],
endRange: [] endRange: []
}, },
hasMenu: false,
myHeight: 0, myHeight: 0,
stateObj: {}, stateObj: {},
total: 0, total: 0,
@ -181,9 +163,6 @@
label: 'name' label: 'name'
}, },
catalogList: [], catalogList: [],
catalogChildren: [], //
showChildren:[], //
lastChildren:[], //
areaList: [], areaList: [],
tagList: [], tagList: [],
nowDate: '', nowDate: '',
@ -265,47 +244,16 @@
this.select.endRange = [this.nowDate, this.nowDate] this.select.endRange = [this.nowDate, this.nowDate]
this.select.status = 0 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.getCatalogList()
this.getAreaList() this.getAreaList()
this.getTagList() this.getTagList()
this.getList() this.getList()
}
}
},
watch: {
'$route'(to, from) {
this.$router.go(0);
}
}, },
methods: { methods: {
initHeight(e) { initHeight(e) {
console.log("e", e) console.log("e", e)
this.myHeight = e + 37 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) { async getCatalogList(pid) {
const res = await index({ const res = await index({
page_size: 999, page_size: 999,
@ -317,30 +265,7 @@
}) })
if (res.data.length > 0) { if (res.data.length > 0) {
this.catalogList = this.base.buildTree(res.data) 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() { async getAreaList() {
const res = await index({ const res = await index({

Loading…
Cancel
Save