Merge branch 'dev' into 2024.2.5-limingyu-bug回档

pull/11/head
limingyu 2024-03-28 08:55:51 +08:00
commit ef95c37933
58 changed files with 10098 additions and 71 deletions

View File

@ -0,0 +1,73 @@
<template>
<div>
<el-upload
ref="uploadFile"
:auto-upload="false"
:file-list="fileList"
:on-change="onChange"
:limit="limit"
:on-exceed="handleExceed"
:accept="accept"
action="#">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<div slot="tip" class="el-upload__tip">{{ '文件大小不超过'+fileSize +'MB' }}</div>
</el-upload>
</div>
</template>
<script>
export default {
name: 'UploadImg',
props: {
fileList: {
type: Array,
default() {
return []
}
},
limit: {
type: Number,
default: 1
},
fileSize: {
type: Number,
default: 200
},
accept: {
type: String,
default: ''
}
},
data() {
return {
dialogImageUrl: '',
dialogVisible: false,
disabled: false
}
},
methods: {
handleRemove(file) {
this.fileList.splice(this.fileList.findIndex(item => item.uid === file.uid), 1)
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
onChange(file, fileList) {
this.file = file
this.file_name = file.name
const isLt2M = file.size / 1024 / 1024 < this.fileSize
if (!isLt2M) {
this.$message.error('上传文件大小不能超过 ' + this.fileSize + 'MB!')
this.$refs.uploadFile.clearFiles()
return false
}
this.$emit('update:fileList', fileList)
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 ${this.limit} 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,262 @@
<template>
<el-dialog
v-loading="loading"
v-if="dialogVisible"
:append-to-body="appendToBody"
:visible.sync="dialogVisible"
:fullscreen="fullscreen"
title="编辑">
<el-input v-model="filterText" placeholder="输入关键字进行过滤"/>
<div style="margin-top: 10px">
<el-tree
ref="tree"
:data="data"
:props="defaultProps"
:filter-node-method="filterNode"
:expand-on-click-node="false"
node-key="id"
default-expand-all
draggable>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span>{{ node.label }}</span>
<span>
<el-button type="text" size="mini" @click="() => append(data)">添加下一级</el-button>
<el-button
:disabled="node.disabled === '1'"
type="text"
size="mini"
@click="() => edit(data)">编辑</el-button>
<el-button
:disabled="node.disabled === '1'"
type="text"
size="mini"
@click="() => remove(node, data)">删除</el-button>
</span>
</span>
</el-tree>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="addLabel"></el-button>
<el-button v-if="!fullscreen" @click="implementFullscreen(true)"> </el-button>
<el-button v-if="fullscreen" @click="implementFullscreen(false)"></el-button>
<el-button type="primary" @click="saveTree"> </el-button>
</div>
<edit-son-label ref="editSonLabel" append-to-body @getResult="getResult"/>
</el-dialog>
</template>
<style>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.el-divider--vertical {
height: 100%;
}
</style>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import uploadFile from '../../../components/UploadFile'
import { requestFN } from '@/utils/request'
import editSonLabel from './editSonLabel'
let id = 1000
export default {
components: { uploadFile, Pagination, editSonLabel },
directives: { waves },
props: {
appendToBody: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: false,
loading: false,
data: [],
defaultProps: {
children: 'children',
label: 'NAME'
},
filterText: '',
primogenitor: '',
newPrimogenitor: '',
options: [],
addFlag: false,
listQuery: {
page: 1,
limit: 10
},
fullscreen: false,
deleteIds: '',
TYPE: '',
v: ''
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
methods: {
init(e) {
this.dialogVisible = true
this.TYPE = e.TYPE
this.choosePrimogenitor()
},
goBack() {
this.dialogVisible = false
this.clear()
},
filterNode(value, data) {
if (!value) return true
return data.NAME.indexOf(value) !== -1
},
append(data) {
const newChild = { BUS_LABEL_FACTORY_ID: id++, label: 'test', children: [] }
if (!data.children) {
this.$set(data, 'children', [])
}
data.children.push(newChild)
},
edit(data) {
this.$refs.editSonLabel.init(data)
},
remove(node, data) {
this.$confirm('确定要删除节点吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const parent = node.parent
const children = parent.data.children || parent.data
const index = children.findIndex(d => d.BUS_LABEL_FACTORY_ID === data.BUS_LABEL_FACTORY_ID)
this.deleteIds = this.deleteIds + ',' + data.BUS_LABEL_FACTORY_ID
children.splice(index, 1)
}).catch(() => {
this.$message({
type: 'info',
message: '取消删除'
})
})
},
getResult(e) {
if (e && e.root && e.root === '1') {
const newChild = { BUS_LABEL_FACTORY_ID: id++, IS_ANCESTORS_FLAG: '1', label: 'test', children: [], NAME: e.NAME }
this.data.push(newChild)
}
this.data = this.analysis(JSON.parse(JSON.stringify(this.data)), e)
},
analysis(arr, e) {
const index = arr.findIndex(item => item.BUS_LABEL_FACTORY_ID === e.BUS_LABEL_FACTORY_ID)
if (index === -1) {
for (const arrKey in arr) {
(arr[arrKey].children && arr[arrKey].children.length > 0) && this.analysis(arr[arrKey].children, e)
}
}
return arr
},
renderContent(h, { node, data, store }) {
return (
<span class='custom-tree-node'>
<span>{node.label}</span>
<span>
<el-button size='mini' type='text' on-click={() => this.append(data)}>添加下一级</el-button>
<el-button size='mini' type='text' on-click={() => this.remove(node, data)}>删除</el-button>
</span>
</span>)
},
openMeter() {
this.addFlag = true
},
save() {
this.addFlag = false
this.loading = true
requestFN(
'/labelFactory/addAncestors',
{
NAME: this.newPrimogenitor,
TYPE: this.TYPE
}
).then((data) => {
if (data.code !== '0') {
this.$message.error(data.errorMessage)
} else {
this.$message.success('保存成功')
}
this.loading = false
}).catch((e) => {
this.loading = false
})
},
saveTree() {
this.sort(this.data)
if (this.data === null || this.data.length <= 0) {
this.$message.error('不能删除根节点或保存项目为空')
return
}
this.loading = true
requestFN(
'/labelFactory/saveTree',
{
tree: JSON.stringify(this.data),
TYPE: this.TYPE
}
).then((data) => {
this.loading = false
this.dialogVisible = false
this.$message.success('保存成功')
this.clear()
}).catch((e) => {
this.loading = false
this.$message.error(e)
})
},
sort(arr) {
for (const arrKey in arr) {
arr[arrKey].SORT = arrKey
if (arr[arrKey].children && arr[arrKey].children.length > 0) this.sort(arr[arrKey].children)
}
},
clear() {
this.addFlag = false
this.options = []
this.primogenitor = ''
this.newPrimogenitor = ''
this.data = []
this.filterText = ''
},
choosePrimogenitor() {
requestFN(
'/labelFactory/tree',
{
IS_ANCESTORS_FLAG: '1'
}
).then((data) => {
this.loading = false
this.data = data.tree
}).catch((e) => {
this.loading = false
})
},
implementFullscreen(e) {
this.fullscreen = e
},
addLabel() {
this.$refs.editSonLabel.init({ root: '1' })
}
}
}
</script>

View File

@ -0,0 +1,68 @@
<template>
<el-dialog
v-loading="loading"
v-if="dialogVisible"
:append-to-body="appendToBody"
:visible.sync="dialogVisible"
title="编辑">
<el-input v-model="name" placeholder="请输入内容"/>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<style>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import uploadFile from '../../../components/UploadFile'
export default {
components: { uploadFile, Pagination },
directives: { waves },
props: {
appendToBody: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: false,
loading: false,
name: '',
e: {}
}
},
methods: {
init(e) {
this.e = e
if (e) {
this.name = e.NAME
}
this.dialogVisible = true
},
goBack() {
this.dialogVisible = false
},
save() {
this.e.NAME = this.name
this.$emit('getResult', this.e)
this.dialogVisible = false
}
}
}
</script>

View File

@ -0,0 +1,212 @@
<template>
<el-dialog
v-loading="loading"
v-if="dialogVisible"
:append-to-body="appendToBody"
:visible.sync="dialogVisible"
:fullscreen = "fullscreen"
:title="title"
width="70%">
<el-input v-model="filterText" style="padding-bottom: 10px" placeholder="输入关键字进行过滤"/>
<div class="information">
<el-scrollbar style="height: 500px;margin-bottom: 10px">
<el-tree
ref="tree"
:data="data"
:props="defaultProps"
:filter-node-method="filterNode"
:expand-on-click-node="false"
:lazy="lazy"
:load="getCategory"
:check-strictly="checkStrictly"
show-checkbox
node-key="id"
/>
</el-scrollbar>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button v-if="false" type="primary" @click="clearInfo"></el-button>
<el-button v-if="!fullscreen" @click="implementFullscreen(true)"> </el-button>
<el-button v-if="fullscreen" @click="implementFullscreen(false)">退</el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
<edit-son-label ref="editSonLabel" append-to-body @getResult="getResult"/>
</el-dialog>
</template>
<style scoped>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.el-divider--vertical{
height: 100%;
}
.information >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
</style>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import uploadFile from '../../../components/UploadFile'
import { requestFN } from '@/utils/request'
import editSonLabel from './editSonLabel'
export default {
components: { uploadFile, Pagination, editSonLabel },
directives: { waves },
props: {
appendToBody: {
type: Boolean,
default: false
},
limit: {
type: Number,
default: 0
},
title: {
type: String,
default: '选择'
},
lazy: {
type: Boolean,
default: false
},
checkStrictly: {
type: Boolean,
default: true
}
},
data() {
return {
dialogVisible: false,
loading: false,
data: [],
defaultProps: {
children: 'children',
label: 'NAME'
},
filterText: '',
primogenitor: '',
label: '',
newPrimogenitor: '',
A_options: [],
B_options: [],
addFlag: false,
listQuery: {
page: 1,
limit: 10
},
fullscreen: false,
labelList: [],
type: ''
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
methods: {
init(e) {
this.dialogVisible = true
if (e.labels && e.labels.length > 0) {
this.data = e.labels
} else {
requestFN(
'/labelFactory/tree',
{
IS_ANCESTORS_FLAG: '1'
}
).then((data) => {
this.loading = false
this.data = data.tree
}).catch((e) => {
this.loading = false
})
}
},
goBack() {
this.dialogVisible = false
this.clear()
},
filterNode(value, data) {
if (!value) return true
return data.NAME.indexOf(value) !== -1
},
getResult(e) {
this.analysis(this.data, e)
this.$forceUpdate()
},
analysis(arr, e) {
const index = arr.findIndex(item => item.BUS_LABEL_FACTORY_ID === e.BUS_LABEL_FACTORY_ID)
if (index !== -1) {
this.$set(arr[index], 'aa', e.NAME)
} else {
for (const arrKey in arr) {
(arr[arrKey].children && arr[arrKey].children.length > 0) && this.analysis(arr[arrKey].children, e)
}
}
},
save() {
const list = this.$refs.tree.getCheckedNodes()
if (this.limit !== 0) {
if (list.length > this.limit) {
this.$message.error('只能选择' + this.limit + '个参数')
return
}
}
this.$emit('getResult', { chooseList: this.$refs.tree.getCheckedNodes(), e: this.$refs.tree.getCheckedNodes(false, true), TYPE: this.type })
this.dialogVisible = false
this.clear()
},
implementFullscreen(e) {
this.fullscreen = e
},
clearInfo(row) {
this.$refs.table.setCurrentRow(row)
this.label = ''
this.primogenitor = ''
requestFN(
'/labelFactory/getAncestors'
).then((data) => {
this.loading = false
this.labelList = data.list
}).catch((e) => {
this.loading = false
})
},
clear() {
this.label = ''
this.A_options = []
this.labelList = []
this.data = []
},
getCategory(node, resolve) {
console.log(node)
if (node.level === 0) {
return resolve(node.data)
}
if (node.level >= 1) {
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: node.data.DICTIONARIES_ID }
).then((data) => {
return resolve(data.list)
}).catch((e) => {
console.log(e)
})
}
return resolve([])
}
}
}
</script>

View File

@ -6,7 +6,13 @@
</div>
<div class="outside-shadow">
<div class="inside-shadow">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" autocomplete="on" label-position="left">
<el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login-form"
autocomplete="on"
label-position="left">
<div class="title-container">
<h3 class="title">企业用户登录</h3>
@ -14,37 +20,60 @@
<el-form-item prop="username">
<span class="svg-container">
<svg-icon icon-class="user" />
<svg-icon icon-class="user"/>
</span>
<el-input ref="username" v-model="loginForm.username" placeholder="用户名" type="text" tabindex="1" autocomplete="on" />
<el-input
ref="username"
v-model="loginForm.username"
placeholder="用户名"
type="text"
tabindex="1"
autocomplete="on"/>
</el-form-item>
<el-tooltip v-model="capsTooltip" content="Caps lock is On" placement="right" manual>
<el-form-item prop="password">
<span class="svg-container">
<svg-icon icon-class="password" />
<svg-icon icon-class="password"/>
</span>
<el-input ref="password" :key="passwordType" v-model="loginForm.password" :type="passwordType" auto-complete="off" placeholder="密码" tabindex="2" autocomplete="on" @keyup.native="checkCapslock" @blur="capsTooltip = false" />
<el-input
ref="password"
:key="passwordType"
v-model="loginForm.password"
:type="passwordType"
auto-complete="off"
placeholder="密码"
tabindex="2"
autocomplete="on"
@keyup.native="checkCapslock"
@blur="capsTooltip = false"/>
</el-form-item>
</el-tooltip>
<div v-show="loginCount >= 3">
<el-form-item>
<span class="svg-container">
<svg-icon icon-class="s-code" />
<svg-icon icon-class="s-code"/>
</span>
<el-input v-model="code" placeholder="验证码" type="text" tabindex="3" autocomplete="on" />
<el-input v-model="code" placeholder="验证码" type="text" tabindex="3" autocomplete="on"/>
</el-form-item>
<div class="login-code" style="display: flex;margin-top: -15px;margin-bottom: 10px;" @click="refreshCode">
<!--验证码组件-->
<s-identify :identify-code="identifyCode" />
<s-identify :identify-code="identifyCode"/>
<el-button type="text" style="margin-left: 50px" @click="refreshCode"></el-button>
</div>
</div>
<validation ref="validation" />
<el-button :loading="loading" :disabled="flag" type="primary" size="medium" style="width:100%;margin:30px 0;" @click.native.prevent="handleLogin">登录</el-button>
<validation ref="validation"/>
<el-button
:loading="loading"
:disabled="flag"
type="primary"
size="medium"
style="width:100%;margin:30px 0;"
@click.native.prevent="handleLogin">登录
</el-button>
<div v-if="false" style="margin-top: -25px; margin-bottom: 30px; color: red">{{ failMsg }}</div>
<div style="position:relative">
<div class="tips">
@ -57,14 +86,14 @@
</div>
<el-dialog :visible.sync="dialogFormQrcode" title="秦港-双基双控APP下载" width="340px">
<el-form ref="form" label-width="110px" style="width: 300px;">
<vue-qr :text="qrcodeStr" :margin="0" :size="300" color-dark="#000" color-light="#fff" />
<vue-qr :text="qrcodeStr" :margin="0" :size="300" color-dark="#000" color-light="#fff"/>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormQrcode = false"> </el-button>
</div>
</el-dialog>
<div class="login-foot">
秦皇岛港股份有限公司 版权所有 BETA1.0 Copy right 2013-2022 技术支持河北秦安 Version 1.0.18
秦皇岛港股份有限公司 版权所有 BETA1.0 Copy right 2013-2022 技术支持河北秦安 Version 1.0.18
</div>
</div>
</template>
@ -79,6 +108,7 @@ import validation from './components/validation'
import vueQr from 'vue-qr'
// eslint-disable-next-line no-unused-vars
import axios from 'axios'
export default {
name: 'Login',
components: { vueQr, validation, SIdentify },
@ -251,6 +281,7 @@ export default {
this.$router.push({ path: '/index' })
this.loading = false
this.flag = false
this.getWorkTask(data.USER_ID)
} else {
if (data.msg) {
this.$message.error(data.msg)
@ -283,6 +314,24 @@ export default {
}
})
},
getWorkTask(id) {
requestFN(
'/xgf/user/getWorkTask', { USER_ID: id }
).then((data) => {
if (data.list && data.list.length > 0) {
setTimeout(() => {
console.log(data)
console.log('???????--sparrow')
this.$notify.info({
title: '消息',
message: '您有【' + data.list.length + '】条相关方人员数据待审核'
})
}, 3000)
}
}).catch((e) => {
console.log(e)
})
},
getOtherQuery(query) {
return Object.keys(query).reduce((acc, cur) => {
if (cur !== 'redirect') {
@ -335,12 +384,14 @@ export default {
color: #fff;
}
}
/* reset element-ui css */
.login-container .el-input {
display: inline-block;
height: 42px;
width: 85%;
}
.login-container .el-input input {
background: transparent;
border: 0px;
@ -351,10 +402,12 @@ export default {
line-height: 42px;
/* caret-color: #fff; */
}
.login-container .el-input input:-webkit-autofill {
box-shadow: 0 0 0px 1000px #fff inset !important;
-webkit-text-fill-color: #000 !important;
}
.login-container .el-form-item {
border: 1px solid #aad5ff;
/* background: rgba(0, 0, 0, 0.1); */
@ -363,17 +416,19 @@ export default {
}
</style>
<style >
<style>
.login-logo {
position: absolute;
top: 50px;
left: 50px;
pointer-events: none;
}
.login-logo img {
width: 836px;
height: 93px;
}
.login-container {
height: 100vh;
width: 100%;
@ -384,6 +439,7 @@ export default {
background-repeat: no-repeat;
background-size: 100% 100%;
}
.login-foot {
font-size: 14px;
color: rgba(255, 255, 255, 0.5);
@ -394,26 +450,29 @@ export default {
transform: translateX(-50%);
z-index: 99;
}
.outside-shadow{
.outside-shadow {
position: absolute;
right: 10%;
top: 24%;
width: 460px;
height: 400px;
border-radius: 10px;
background-color: rgba(255,255,255,0.3);
background-color: rgba(255, 255, 255, 0.3);
z-index: 97;
}
.inside-shadow{
.inside-shadow {
position: absolute;
top: -22.5px;
left: 15px;
width: 430px;
height: 445px;
border-radius: 10px;
background-color: rgba(255,255,255,0.5);
background-color: rgba(255, 255, 255, 0.5);
z-index: 98;
}
.login-container .login-form {
position: absolute;
width: 400px;
@ -428,15 +487,18 @@ export default {
left: 15px;
z-index: 99;
}
.login-name {
position: absolute;
right: 9.5%;
top: 15%;
}
.login-name img {
width: 422px;
height: 53px;
}
.login-container .tips {
font-size: 14px;
color: #464646;
@ -452,15 +514,18 @@ export default {
width: 30px;
display: inline-block;
}
.login-container .title-container {
position: relative;
}
.login-container .title-container .title {
font-size: 20px;
color: #000;
font-weight: normal;
font-family: "微软雅黑", "宋体", "Arial Narrow", Helvetica, sans-serif;
}
.login-container .show-pwd {
position: absolute;
right: 10px;
@ -470,11 +535,13 @@ export default {
cursor: pointer;
user-select: none;
}
.login-container .thirdparty-button {
position: absolute;
right: 0;
bottom: 6px;
}
@media only screen and (max-width: 470px) {
.login-container .thirdparty-button {
display: none;

View File

@ -1051,7 +1051,7 @@ export default {
password: '58d06a44d56c4445b4c019492f86ee8d'
},
subscription: {
topic: '1698584148364034050/UwbBQ/+/prop',
topic: '1698584148364034050/+/+/prop',
qos: 0
},
@ -1997,47 +1997,48 @@ export default {
},
mqttMessage(CORP_INFO_ID) {
this.client.on('message', (topic, message) => {
// console.info(message)
// if(this.intOne === 0){
// this.receiveNews = this.receiveNews.concat(message)
// console.log(`Received message ${message} from topic ${topic}`)
const item = JSON.parse(message)
//
const index = this.onePerLocArr.findIndex(item1 => {
return item1.id.toString() === item.deviceCode.toString()
})
const x = item.properties[2].value
const y = item.properties[3].value
const pointColor = this.isPointxyWithinTheArea(this.pointBox, x, y)
if (index !== -1) {
this.onePerLocArr[index].x = x
this.onePerLocArr[index].y = y
this.onePerLocArr[index].icon_type = 'img4_0' + pointColor
ry_drag.getPosition(this.onePerLocArr[index])
} else {
// const id = '4_0_' +item.deviceCode
const perLoc = {
id: item.deviceCode,
// name: item.realName,
x: x,
y: y,
icon_type: 'img4_0' + pointColor,
// infoname: item.realName,
data_id: item.deviceCode,
point_type: '标记点peoplePositionOne',
label: '人员定位',
corpInfoId: CORP_INFO_ID
}
this.onePerLocArr.push(perLoc)
ry_drag.addEntity(perLoc)
this.mqttPoint[this.subscription.topic.substring(0, this.subscription.topic.lastIndexOf('+')) + item.deviceCode] = item.deviceCode
// created by liu jun mqtt
let peopleList = JSON.parse(message)
if (!Array.isArray(peopleList)) {
peopleList = [peopleList]
}
for (let i = 0; i < peopleList.length; i++) {
const item = peopleList[i]
//
if (item.properties.length < 3 || item.properties[2].identifier !== 'X' || item.properties[3].identifier !== 'Y') {
continue
}
//
const index = this.onePerLocArr.findIndex(item1 => {
return item1.id.toString() === item.deviceCode.toString()
})
const x = item.properties[2].value
const y = item.properties[3].value
const pointColor = this.isPointxyWithinTheArea(this.pointBox, x, y)
if (index !== -1) {
this.onePerLocArr[index].x = x
this.onePerLocArr[index].y = y
this.onePerLocArr[index].icon_type = 'img4_0' + pointColor
ry_drag.getPosition(this.onePerLocArr[index])
} else {
// const id = '4_0_' +item.deviceCode
const perLoc = {
id: item.deviceCode,
// name: item.realName,
x: x,
y: y,
icon_type: 'img4_0' + pointColor,
// infoname: item.realName,
data_id: item.deviceCode,
point_type: '标记点peoplePositionOne',
label: '人员定位',
corpInfoId: CORP_INFO_ID
}
this.onePerLocArr.push(perLoc)
ry_drag.addEntity(perLoc)
this.mqttPoint[this.subscription.topic.substring(0, this.subscription.topic.lastIndexOf('+')) + item.deviceCode] = item.deviceCode
}
}
// this.intOne++
// } else if(this.intOne < 5){
// this.intOne++
// } else {
// this.intOne = 0
// }
})
},
clearMqttPoint(prefix) {

View File

@ -0,0 +1,204 @@
<template>
<el-drawer
v-if="visible"
ref="drawer"
:visible.sync="visible"
:before-close="close"
title="搜索条件"
size="50%">
<div style="margin-left: 30px">
<el-form ref="form" label-width="150px">
<el-form-item label="国民经济行业分类:" prop="CATEGORY_LIST">
<multiple-choice :dynamic-tags.sync="form.CATEGORY_LIST" :labels="categoryList" :row-key="key.categoryKey" :row-name="key.categoryName" lazy title="选择"/>
</el-form-item>
<el-form-item label="预案类别:" prop="TYPES">
<multiple-choice :dynamic-tags.sync="form.TYPES" :labels="typeList" :row-key="key.typeKey" :row-name="key.typeName" title="选择"/>
</el-form-item>
<el-form-item label="预案类型:" prop="SPECIFICATION_TYPES">
<multiple-choice :dynamic-tags.sync="form.SPECIFICATION_TYPES" :labels="industryTypeList" :row-key="key.specificationTypeKey" :row-name="key.specificationTypeName" title="选择"/>
</el-form-item>
<el-form-item label="预案属性:" prop="ATTRIBUTE_LIST">
<multiple-choice :dynamic-tags.sync="form.ATTRIBUTE_LIST" :labels="industryTypeList" :row-key="key.attributeList" :row-name="key.attributeName" title="选择"/>
</el-form-item>
<el-form-item label="标签:" prop="LABELS">
<multiple-choice :dynamic-tags.sync="form.LABELS" :row-key="key.labelsKey" :row-name="key.labelsName" title="选择"/>
</el-form-item>
<el-form-item v-if="haveCorpFlag" label="企业:">
<el-select
v-model="form.CORPINFO_ID"
:remote-method="searchCorp"
:loading="selectLoading"
filterable
remote
reserve-keyword
placeholder="请输入关键词">
<el-option
v-for="item in corp_list"
:key="item.CORPINFO_ID"
:label="item.CORP_NAME"
:value="item.CORPINFO_ID"/>
</el-select>
</el-form-item>
</el-form>
<div>
<el-button @click="closePanel"> </el-button>
<el-button :loading="loading" type="primary" @click="submit">{{ loading ? ' ...' : ' ' }}</el-button>
</div>
</div>
</el-drawer>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import waves from '@/directive/waves' // waves directive
import { videoPlayer } from 'vue-video-player'
import 'video.js/dist/video-js.css'
import multipleChoice from '../../../util/multipleChoice.vue'
import { requestFN } from '@/utils/request'
export default {
components: { multipleChoice, Pagination, videoPlayer },
directives: { waves },
props: {
haveCorpFlag: {
type: Boolean,
default: false
}
},
data() {
return {
visible: false,
loading: false,
key: {
typeKey: 'DICTIONARIES_ID',
typeName: 'NAME',
specificationTypeKey: 'DICTIONARIES_ID',
specificationTypeName: 'NAME',
categoryKey: 'DICTIONARIES_ID',
categoryName: 'NAME',
labelsKey: 'BUS_LABEL_FACTORY_ID',
labelsName: 'NAME',
attributeKey: 'DICTIONARIES_ID',
attributeName: 'NAME'
},
typeList: [],
industryTypeList: [],
categoryList: [],
form: {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: [''],
ATTRIBUTE_LIST: [''],
CORPINFO_ID: ''
},
corp_list: [],
selectLoading: false
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getDic()
},
methods: {
init(tags) {
this.visible = true
},
close(done) {
this.$confirm('确认关闭?')
.then(_ => {
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: [''],
TTRIBUTE_LIST: ['']
}
done()
})
.catch(e => {})
},
closePanel() {
this.visible = false
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: [''],
ATTRIBUTE_LIST: ['']
}
},
submit() {
this.$emit('getResult', this.form)
this.visible = false
},
getDic() {
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '6f1a24ee886f4b4885b030216b3c0e05' }
).then((data) => {
this.typeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'dc6884c3a9664b1597e61a0f75c8e709' }
).then((data) => {
this.industryTypeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'f2598ba72e864eadabf0ca4b664d26b9' }
).then((data) => {
this.categoryList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '56640b5df1f14b25a93b55ca4bbb8c5e' }
).then((data) => {
this.attributeList = data.list
}).catch((e) => {
this.loading = false
})
},
clear() {
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: [''],
TTRIBUTE_LIST: [''],
CORPINFO_ID: ''
}
},
searchCorp(query) {
if (query !== '') {
this.selectLoading = true
requestFN(
'corpinfo/list', { KEYWORDS: query }
).then((data) => {
this.corp_list = data.varList
this.selectLoading = false
}).catch((e) => {
console.log(e)
this.selectLoading = false
})
}
}
}
}
</script>
<style scoped>
.information >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
</style>

View File

@ -0,0 +1,40 @@
<template>
<div class="app-container">
<el-tabs v-model="vectory" type="border-card" @tab-click="changTab">
<el-tab-pane label="企业端数据" name="listEm">
<ListEm v-if="vectory === 'listEm'"/>
</el-tab-pane>
<el-tab-pane label="运营端数据" name="list">
<list v-if="vectory === 'list'"/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import waves from '@/directive/waves'
import List from '../../emergencyPlanManagement/components/list.vue'
import ListEm from './listEm.vue'
export default {
components: { List, Pagination, ListEm },
directives: { waves },
data() {
return {
vectory: 'listEm'
}
},
created() {
},
methods: {
changTab(title) {
if (title.label === '运营端数据') { this.vectory = 'list' }
if (title.label === '企业端数据') { this.vectory = 'listEm' }
}
}
}
</script>

View File

@ -0,0 +1,371 @@
<template>
<el-dialog v-loading="loading" v-if="dialogVisible" :visible.sync="dialogVisible" :title="title">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item label="应急预案名称:" prop="REMARKS">
<el-input v-model="form.REMARKS" style="width: 600px"/>
</el-form-item>
<el-form-item v-if="false" label="预案类别:" prop="TYPES">
<multiple-choice :dynamic-tags.sync="form.TYPES" :labels="typeList" :row-key="key.typeKey" :row-name="key.typeName"/>
</el-form-item>
<el-form-item v-if="false" label="国民经济行业分类:" prop="CATEGORY_LIST" width="300px">
<multiple-choice :dynamic-tags.sync="form.CATEGORY_LIST" :labels="categoryList" :row-key="key.categoryKey" :row-name="key.categoryName" lazy/>
</el-form-item>
<el-form-item label="预案类型:" prop="SPECIFICATION_TYPES">
<multiple-choice :dynamic-tags.sync="form.SPECIFICATION_TYPES" :labels="industryTypeList" :row-key="key.specificationTypeKey" :row-name="key.specificationTypeName"/>
</el-form-item>
<el-form-item label="预案属性:" prop="ATTRIBUTE_LIST">
<multiple-choice :dynamic-tags.sync="form.ATTRIBUTE_LIST" :labels="attributeList" :row-key="key.attributeKey" :row-name="key.attributeName"/>
</el-form-item>
<el-form-item v-if="false" label="状态:" prop="STATUS">
<el-select v-model="form.STATUS" placeholder="请选择" style="width: 100%;">
<el-option label="停用" value="0"/>
<el-option label="启用" value="1"/>
</el-select>
</el-form-item>
<el-form-item v-if="!isEdit" label="文件:" prop="FILE">
<upload-file :file-list.sync="form.FILE" :limit="1" :file-size="200" append-to-body accept=".pdf"/>
</el-form-item>
<el-form-item label="标签:" prop="labels">
<multiple-choice :dynamic-tags.sync="form.labels" :row-key="key.labelsKey" :row-name="key.labelsName" can-add/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
<edit-label ref="editLabel" append-to-body/>
<select-label ref="selectLabel" append-to-body @getResult="getChooseTage"/>
<select-type ref="selectType" :limit="1" append-to-body @getResult="getType"/>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { upload } from '@/utils/upload'
import { requestFN } from '@/utils/request'
import editLabel from '../../../Label/components/editLabel.vue'
import selectLabel from '../../../Label/components/selectLable.vue'
import selectType from '../../../util/selectType.vue'
import multipleChoice from '../../../util/multipleChoice.vue'
import UploadFile from '../../../../components/UploadFile/index.vue'
import TextEditing from '../../../util/textEditing.vue'
export default {
components: { TextEditing, Pagination, editLabel, selectLabel, selectType, multipleChoice, UploadFile },
directives: { waves },
props: {
title: {
type: String,
default: ''
}
},
data() {
return {
dialogVisible: false,
form: {
REMARKS: '',
FILE: [],
labels: [''],
TYPE: '',
TYPES: [''],
types: [],
SPECIFICATION_TYPES: [''],
specification_types: [],
CATEGORY_LIST: [''],
category_list: [],
STATUS: '',
ASSOCIATION: '3',
ATTRIBUTE_LIST: [''],
attribute_list: []
},
key: {
typeKey: 'DICTIONARIES_ID',
typeName: 'NAME',
specificationTypeKey: 'DICTIONARIES_ID',
specificationTypeName: 'NAME',
categoryKey: 'DICTIONARIES_ID',
categoryName: 'NAME',
labelsKey: 'BUS_LABEL_FACTORY_ID',
labelsName: 'NAME',
attributeKey: 'DICTIONARIES_ID',
attributeName: 'NAME'
},
rules: {
REMARKS: [{ required: true, message: '请输安全操作规程', trigger: 'change' }],
STATUS: [{ required: true, message: '请选择状态', trigger: 'change' }],
FILE: [{ required: true, message: '请选择文件', trigger: 'blur' }],
TYPES: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('预案类别必选'))
}
return callback()
},
trigger: 'blur'
}],
SPECIFICATION_TYPES: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('预案类型必选'))
}
return callback()
},
trigger: 'blur'
}],
CATEGORY_LIST: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('国民经济行业分类必选'))
}
return callback()
},
trigger: 'blur'
}],
ATTRIBUTE_LIST: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('预案属性必选'))
}
return callback()
},
trigger: 'blur'
}]
},
loading: false,
e: {},
isEdit: false,
typeList: [],
industryTypeList: [],
categoryList: [],
attributeList: [],
remoteControl: {
keyOne: true
},
textDisabled: false
}
},
methods: {
init(e) {
this.dialogVisible = true
this.e = e ? e.e : {}
this.isEdit = e ? e.isEdit : false
this.getDic()
if (e) {
this.loading = true
requestFN(
'/textLibrary/goEdit',
{ BUS_TEXT_LIBRARY_ID: this.e.BUS_TEXT_LIBRARY_ID }
).then((data) => {
this.loading = false
this.form = data.data
this.form.FILE = []
this.form.types = []
this.form.specification_types = []
this.form.category_list = []
this.form.attribute_list = []
if (!this.form.TYPES || this.form.TYPES.length === 0) this.form.TYPES = ['']
if (!this.form.SPECIFICATION_TYPES || this.form.SPECIFICATION_TYPES.length === 0) this.form.SPECIFICATION_TYPES = ['']
if (!this.form.CATEGORY_LIST || this.form.CATEGORY_LIST.length === 0) this.form.CATEGORY_LIST = ['']
if (!this.form.labels || this.form.labels.length === 0) this.form.labels = ['']
if (!this.form.ATTRIBUTE_LIST || this.form.ATTRIBUTE_LIST === 0) this.form.ATTRIBUTE_LIST = ['']
}).catch((e) => {
this.$message.error(e)
this.loading = false
})
} else {
this.isEdit = false
}
},
save() {
if (this.checkForm()) {
return
}
this.$refs.form.validate((valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '上传中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const formData = new FormData()
Object.keys(this.form).map(key => {
formData.append(key, this.form[key])
})
if (!this.isEdit) {
if (!this.form.FILE || this.form.FILE.length <= 0) {
this.$message.error('请上传文件')
loading.close()
return
}
}
for (let i = 0; i < this.form.FILE.length; i++) {
if (this.form.FILE[i].raw) {
formData.append('FILE', this.form.FILE[i].raw)
}
}
formData.append('labels', JSON.stringify(this.form.labels))
if (this.form.TYPES) {
for (let i = 0; i < this.form.TYPES.length; i++) {
if (this.form.TYPES[i]) {
this.form.types.push({
CATEGORY: 'TYPES',
CATEGORY_ID: this.form.TYPES[i].DICTIONARIES_ID,
CATEGORY_NAME: this.form.TYPES[i].NAME
})
}
}
formData.append('TYPES', JSON.stringify(this.form.types))
}
for (let i = 0; i < this.form.SPECIFICATION_TYPES.length; i++) {
if (this.form.SPECIFICATION_TYPES[i]) {
this.form.specification_types.push({
CATEGORY: 'SPECIFICATION_TYPES',
CATEGORY_ID: this.form.SPECIFICATION_TYPES[i].DICTIONARIES_ID,
CATEGORY_NAME: this.form.SPECIFICATION_TYPES[i].NAME
})
}
}
formData.append('SPECIFICATION_TYPES', JSON.stringify(this.form.specification_types))
if (this.form.CATEGORY_LIST) {
for (let i = 0; i < this.form.CATEGORY_LIST.length; i++) {
if (this.form.CATEGORY_LIST[i]) {
this.form.category_list.push({
CATEGORY: 'CATEGORY_LIST',
CATEGORY_ID: this.form.CATEGORY_LIST[i].DICTIONARIES_ID,
CATEGORY_NAME: this.form.CATEGORY_LIST[i].NAME
})
}
}
formData.append('CATEGORY_LIST', JSON.stringify(this.form.category_list))
}
for (let i = 0; i < this.form.ATTRIBUTE_LIST.length; i++) {
if (this.form.ATTRIBUTE_LIST[i]) {
this.form.attribute_list.push({
CATEGORY: 'ATTRIBUTE_LIST',
CATEGORY_ID: this.form.ATTRIBUTE_LIST[i].DICTIONARIES_ID,
CATEGORY_NAME: this.form.ATTRIBUTE_LIST[i].NAME
})
}
}
formData.append('ATTRIBUTE_LIST', JSON.stringify(this.form.attribute_list))
upload(
'/textLibrary/init',
formData
).then((data) => {
loading.close()
this.dialogVisible = false
this.$emit('logical-end', { result: 'OK' })
this.$message.success('保存成功')
}).catch((e) => {
loading.close()
console.log(e)
})
this.clear()
} else {
return false
}
})
},
checkForm() {
if (this.form.labels.length > 15) {
this.$message.error('关联标签数不能超过15个')
return true
}
},
goBack() {
this.dialogVisible = false
this.clear()
this.$emit('goBack', this.e)
},
getChooseTage(e) {
if (e.TYPE === '0') {
const list = e.e
for (const listKey in list) {
const index = this.form.labels.findIndex(item => {
item.BUS_LABEL_FACTORY_ID === list[listKey].BUS_LABEL_FACTORY_ID
})
if (index < 0) {
const label = JSON.parse(JSON.stringify(list[listKey]))
label.label = label.NAME
label.value = JSON.stringify(list[listKey])
const index = this.form.labels.findIndex(item => item.value === label.value)
if (index < 0) {
this.form.labels.push(label)
}
}
}
} else {
if (e.e.length > 1) {
this.$message.error('只能选择一个类型')
return
}
this.form.TYPE_NAME = e.e[0].NAME
this.form.TYPE = e.e[0].BUS_LABEL_FACTORY_ID
this.$forceUpdate()
}
},
getType(e) {
this.form.TYPE = e.info[0].DICTIONARIES_ID
this.form.TYPE_NAME = e.info[0].NAME
},
clear() {
this.isEdit = false
this.form = {
REMARKS: '',
FILE: [],
labels: [''],
TYPE: '',
TYPES: [''],
SPECIFICATION_TYPES: [''],
STATUS: '',
ASSOCIATION: '3',
types: [],
specification_types: []
}
},
getDic() {
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '6f1a24ee886f4b4885b030216b3c0e05' }
).then((data) => {
this.typeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'dc6884c3a9664b1597e61a0f75c8e709' }
).then((data) => {
this.industryTypeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'f2598ba72e864eadabf0ca4b664d26b9' }
).then((data) => {
this.categoryList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '56640b5df1f14b25a93b55ca4bbb8c5e' }
).then((data) => {
this.attributeList = data.list
}).catch((e) => {
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,494 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form label-width="120px">
<el-row>
<el-col :span="6">
<el-form-item label="应急预案名称:">
<el-input v-model="form.KEYWORDS" placeholder="请输入" class="filter-item"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="addCondition">
添加其他搜索条件
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="clearMessage">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:row-key="getRowKey"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
:row-class-name="tableRowClassName"
tooltip-effect="dark"
border
fit
highlight-current-row>
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="REMARKS" label="应急预案名称" />
<el-table-column prop="TYPES" align="center" label="预案类别" width="100px">
<template slot-scope="{row}">
<el-tag
v-for="tag in row.TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="CATEGORY_LIST" label="国民经济行业分类" width="300px">
<template slot-scope="{row}">
<el-tag
v-for="tag in row.CATEGORY_LIST"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="SPECIFICATION_TYPES" label="预案类型" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.SPECIFICATION_TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="ATTRIBUTE_LIST" label="预案属性" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.ATTRIBUTE_LIST"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column v-if="false" prop="LABEL" label="标签" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="UPLOAD_TIME" width="90px" align="center" label="上传时间" />
<el-table-column :show-overflow-tooltip="true" prop="UPLOAD_USER_NAME" align="center" label="上传人" width="100"/>
<el-table-column label="操作" align="center" width="300px">
<template slot-scope="{row}">
<el-row>
<el-col :span="14">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleCopy(row)"></el-button>
</el-col>
<el-col :span="10">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="getInformation(row)"></el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<edit-text-library ref="editTextLibrary" :title="title" @logical-end="saveClose"/>
<text-library-info ref="textLibraryInfo"/>
<update-file ref="updateFile"/>
<update-log ref="updateLog"/>
<condition ref="condition" @getResult="getCondition"/>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import editTextLibrary from './editTextLibrary.vue'
import textLibraryInfo from './textLibraryInfo.vue'
import updateFile from './updateFile.vue'
import updateLog from './updateLog.vue'
import UpdateLog from './updateLog.vue'
import condition from './condition.vue'
export default {
components: { UpdateLog, Pagination, editTextLibrary, textLibraryInfo, updateFile, updateLog, condition },
directives: { waves },
data() {
return {
config: config,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
total: 0,
form: {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
ATTRIBUTE_LIST: [],
STATUS: ''
},
label_name: '',
varList: [],
pd: [],
isEdit: false,
isLook: false,
title: ''
}
},
created() {
this.getList()
},
methods: {
getRowKey(row) {
return row.BLACKSPOT_ID
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
addCondition() {
this.$refs.condition.init()
},
getCondition(info) {
console.log(info)
this.form.CATEGORY_LIST = info.CATEGORY_LIST
this.form.TYPES = info.TYPES
this.form.SPECIFICATION_TYPES = info.SPECIFICATION_TYPES
this.form.labels = info.LABELS
this.form.ATTRIBUTE_LIST = info.ATTRIBUTE_LIST
},
clearMessage() {
this.label_name = ''
this.form = {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
}
this.$refs.condition.clear()
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/textLibrary/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.form.KEYWORDS,
CATEGORY_LIST: JSON.stringify(this.form.CATEGORY_LIST),
TYPES: JSON.stringify(this.form.TYPES),
SPECIFICATION_TYPES: JSON.stringify(this.form.SPECIFICATION_TYPES),
ATTRIBUTE_LIST: JSON.stringify(this.form.ATTRIBUTE_LIST),
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '3',
CORPINFO_ID: '0'
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.title = '新增'
this.$refs.editTextLibrary.init()
},
handleEdit(e) {
this.title = '编辑'
this.$refs.editTextLibrary.init({ e: e, isEdit: true })
},
getInformation(e) {
this.$refs.textLibraryInfo.init({ e: e })
},
handleDelete(e) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/delete',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
if (data.code === '0') {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
} else {
this.listLoading = false
this.$message.error(data.errorMessage)
}
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleLock(e, flag) {
this.$confirm(flag === '1' ? '确定要锁定吗?' : '确定要解锁吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/lock',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isLock: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleTop(e, flag) {
this.$confirm(flag === '1' ? '确定要置顶吗?' : '确定要取消置顶吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/top',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isTop: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleExport(e) {
this.$confirm('确定要导出文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
window.open(config.fileUrl + e.PATH)
}).catch((e) => {
console.log(e)
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const _ids = _selectData.filter((item, index) => {
return item.LOCKTOOL
})
if (_ids.length > 0) {
this.$message.error('选中的数据有锁定数据,请重新选择')
return
}
const ids = _selectData.map((item, index) => {
return item.BUS_TEXT_LIBRARY_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'textlibrary:add,textlibrary:del,textlibrary:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.textlibraryfhadminadd //
this.del = data.textlibraryfhadmindel //
this.edit = data.textlibraryfhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
if (row.ISTOPTIME) {
return 'warning-row'
}
},
saveClose(e) {
this.getList()
},
openUpdateFile(row) {
this.$refs.updateFile.init(row)
},
openUpdateLog(row) {
this.$refs.updateLog.init(row)
},
setStatus(row, status) {
this.listLoading = true
this.$confirm('是否更改状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/textLibrary/setStatus',
{
BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID,
STATUS: status
}
).then((data) => {
this.listLoading = false
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
this.listLoading = false
})
},
handleCopy(row) {
this.$confirm('确定要将此条数据添加到本地吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.copyInfo(row)
}).catch((e) => {
console.log(e)
this.$message({
type: 'info',
message: '已取消添加'
})
})
},
copyInfo(row) {
requestFN(
'/textLibrary/copyToOperate?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID }
).then((data) => {
if (data.code === '0') {
this.$message.success('添加成功')
} else {
this.$message.success('添加失败')
}
}).catch((e) => {
this.$message.success('添加失败')
})
}
}
}
</script>

View File

@ -0,0 +1,499 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form label-width="120px">
<el-row>
<el-col :span="6">
<el-form-item label="应急预案名称:">
<el-input v-model="form.KEYWORDS" placeholder="请输入" class="filter-item"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="addCondition">
添加其他搜索条件
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="clearMessage">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:row-key="getRowKey"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
:row-class-name="tableRowClassName"
tooltip-effect="dark"
border
fit
highlight-current-row>
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="REMARKS" label="应急预案名称" />
<el-table-column prop="TYPES" align="center" label="预案类别" width="100px">
<template slot-scope="{row}">
<el-tag
v-for="tag in row.TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="CATEGORY_LIST" label="国民经济行业分类" width="250px">
<template slot-scope="{row}">
<el-tag
v-for="tag in row.CATEGORY_LIST"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="SPECIFICATION_TYPES" label="预案类型" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.SPECIFICATION_TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="ATTRIBUTE_LIST" label="预案属性" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.ATTRIBUTE_LIST"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column v-if="false" prop="LABEL" label="标签" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="UPLOAD_TIME" width="90px" align="center" label="上传时间" />
<el-table-column :show-overflow-tooltip="true" prop="UPLOAD_USER_NAME" align="center" label="上传人" width="100"/>
<el-table-column label="操作" align="center" width="300px">
<template slot-scope="{row}">
<el-row style="margin-bottom: 10px">
<el-col :span="24" style="padding-bottom: 10px">
<el-button v-show="del" type="info" icon="el-icon-view" size="mini" @click="getInformation(row)"></el-button>
<el-button v-show="del" type="warning" icon="el-icon-printer" size="mini" @click="handleExport(row)"></el-button>
</el-col>
<el-col>
<el-button v-if="del && row.CORPINFO_ID !== '0'" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row)"></el-button>
<el-button v-show="edit && !row.LOCKTOOL" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<edit-text-library ref="editTextLibrary" :title="title" @logical-end="saveClose"/>
<text-library-info ref="textLibraryInfo"/>
<update-file ref="updateFile"/>
<update-log ref="updateLog"/>
<condition ref="condition" have-corp-flag @getResult="getCondition"/>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import editTextLibrary from './editTextLibrary.vue'
import textLibraryInfo from './textLibraryInfo.vue'
import updateFile from './updateFile.vue'
import updateLog from './updateLog.vue'
import UpdateLog from './updateLog.vue'
import condition from './condition.vue'
export default {
components: { UpdateLog, Pagination, editTextLibrary, textLibraryInfo, updateFile, updateLog, condition },
directives: { waves },
data() {
return {
config: config,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
total: 0,
form: {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
ATTRIBUTE_LIST: [],
STATUS: '',
CORP_INFO_ID: ''
},
label_name: '',
varList: [],
pd: [],
isEdit: false,
isLook: false,
title: ''
}
},
created() {
this.getList()
},
methods: {
getRowKey(row) {
return row.BLACKSPOT_ID
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
addCondition() {
this.$refs.condition.init()
},
getCondition(info) {
this.form.CATEGORY_LIST = info.CATEGORY_LIST
this.form.TYPES = info.TYPES
this.form.SPECIFICATION_TYPES = info.SPECIFICATION_TYPES
this.form.labels = info.LABELS
this.form.ATTRIBUTE_LIST = info.ATTRIBUTE_LIST
this.form.CORP_INFO_ID = info.CORPINFO_ID
},
clearMessage() {
this.label_name = ''
this.form = {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
}
this.$refs.condition.clear()
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/textLibrary/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.form.KEYWORDS,
CATEGORY_LIST: JSON.stringify(this.form.CATEGORY_LIST),
TYPES: JSON.stringify(this.form.TYPES),
SPECIFICATION_TYPES: JSON.stringify(this.form.SPECIFICATION_TYPES),
ATTRIBUTE_LIST: JSON.stringify(this.form.ATTRIBUTE_LIST),
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '3',
ENTERPRISE_SIDE: '0'
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.title = '新增'
this.$refs.editTextLibrary.init()
},
handleEdit(e) {
this.title = '编辑'
this.$refs.editTextLibrary.init({ e: e, isEdit: true })
},
getInformation(e) {
this.$refs.textLibraryInfo.init({ e: e })
},
handleDelete(e) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/delete',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
if (data.code === '0') {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
} else {
this.listLoading = false
this.$message.error(data.errorMessage)
}
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleLock(e, flag) {
this.$confirm(flag === '1' ? '确定要锁定吗?' : '确定要解锁吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/lock',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isLock: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleTop(e, flag) {
this.$confirm(flag === '1' ? '确定要置顶吗?' : '确定要取消置顶吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/top',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isTop: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleExport(e) {
this.$confirm('确定要导出文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
window.open(config.fileUrl + e.PATH)
}).catch((e) => {
console.log(e)
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const _ids = _selectData.filter((item, index) => {
return item.LOCKTOOL
})
if (_ids.length > 0) {
this.$message.error('选中的数据有锁定数据,请重新选择')
return
}
const ids = _selectData.map((item, index) => {
return item.BUS_TEXT_LIBRARY_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'textlibrary:add,textlibrary:del,textlibrary:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.textlibraryfhadminadd //
this.del = data.textlibraryfhadmindel //
this.edit = data.textlibraryfhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
if (row.ISTOPTIME) {
return 'warning-row'
}
},
saveClose(e) {
this.getList()
},
openUpdateFile(row) {
this.$refs.updateFile.init(row)
},
openUpdateLog(row) {
this.$refs.updateLog.init(row)
},
setStatus(row, status) {
this.listLoading = true
this.$confirm('是否更改状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/textLibrary/setStatus',
{
BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID,
STATUS: status
}
).then((data) => {
this.listLoading = false
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
this.listLoading = false
})
},
handleCopy(row) {
this.$confirm('确定要将此条数据添加到运营端数据库', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.copyInfo(row)
}).catch((e) => {
console.log(e)
this.$message({
type: 'info',
message: '已取消添加'
})
})
},
copyInfo(row) {
requestFN(
'/textLibrary/copyToOperate?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID }
).then((data) => {
if (data.code === '0') {
this.$message.success('添加成功')
} else {
this.$message.success('添加失败')
}
}).catch((e) => {
this.$message.success('添加失败')
})
}
}
}
</script>

View File

@ -0,0 +1,119 @@
<template>
<el-dialog v-loading="loading" v-if="dialogVisible" :visible.sync="dialogVisible" title="详情">
<el-form ref="form" :model="form" label-width="150px">
<el-form-item label="应急预案名称:" prop="FILE_NAME">
<el-input v-model="form.REMARKS" disabled style="width: 70%"/>
</el-form-item>
<el-form-item label="预案类别:" prop="FILE_NAME">
<el-tag
v-for="tag in form.TYPES"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item label="国民经济行业分类:" prop="FILE_NAME">
<el-tag
v-for="tag in form.CATEGORY_LIST"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item label="预案类型:" prop="FILE_NAME">
<el-tag
v-for="tag in form.SPECIFICATION_TYPES"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item label="预案属性:" prop="ATTRIBUTE_LIST">
<el-tag
v-for="tag in form.ATTRIBUTE_LIST"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item label="状态:" prop="STATUS">
<el-select v-model="form.STATUS" disabled placeholder="请选择" style="width: 100%;">
<el-option label="停用" value="0"/>
<el-option label="启用" value="1"/>
</el-select>
</el-form-item>
<el-form-item label="上传时间:" prop="FILE_NAME">
<el-input v-model="form.UPLOAD_TIME" disabled style="width: 70%"/>
</el-form-item>
<el-form-item label="上传人:" prop="FILE_NAME">
<el-input v-model="form.UPLOAD_USER_NAME" disabled style="width: 70%"/>
</el-form-item>
<el-form-item prop="tags" label="标签">
<el-tag
v-for="tag in form.labels"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.NAME }}
</el-tag>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { requestFN } from '@/utils/request'
import multipleChoice from '../../../util/multipleChoice.vue'
export default {
components: { multipleChoice, Pagination },
directives: { waves },
data() {
return {
dialogVisible: false,
form: {
FILE_NAME: '',
FILE: [],
TYPE: '',
labels: [],
UPLOAD_TIME: '',
UPLOAD_USER_NAME: ''
},
loading: false
}
},
methods: {
init(e) {
this.dialogVisible = true
this.loading = true
this.e = e.e
requestFN(
'/textLibrary/goEdit',
{
BUS_TEXT_LIBRARY_ID: this.e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
this.loading = false
this.form = data.data
this.form.FILE = []
}).catch((e) => {
this.$message.error(e)
this.loading = false
})
},
goBack() {
this.dialogVisible = false
this.$emit('goBack', this.e)
}
}
}
</script>

View File

@ -0,0 +1,77 @@
<template>
<el-dialog v-loading="loading" v-if="visible" :visible.sync="visible" title="替换">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item label="文件:" prop="FILE">
<upload-file :file-list.sync="form.FILE" :limit="1" :file-size="200" append-to-body accept=".pdf"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { upload } from '@/utils/upload'
import uploadFile from '../../../../components/UploadFile/index.vue'
export default {
components: { Pagination, uploadFile },
directives: { waves },
data() {
return {
visible: false,
form: {
FILE: [],
BUS_TEXT_LIBRARY_ID: ''
},
rules: {
FILE: [{ required: true, message: '请选择文件', trigger: 'blur' }]
},
loading: false
}
},
methods: {
init(e) {
this.visible = true
this.form.BUS_TEXT_LIBRARY_ID = e.BUS_TEXT_LIBRARY_ID
},
goBack() {
this.form = {
FILE: [],
BUS_TEXT_LIBRARY_ID: ''
}
this.visible = false
},
save() {
const loading = this.$loading({
lock: true,
text: '上传中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const formData = new FormData()
for (let i = 0; i < this.form.FILE.length; i++) {
if (this.form.FILE[i].raw) {
formData.append('FILE', this.form.FILE[i].raw)
}
}
formData.append('BUS_TEXT_LIBRARY_ID', this.form.BUS_TEXT_LIBRARY_ID)
upload(
'/textLibrary/updateFile',
formData
).then((data) => {
loading.close()
this.visible = false
this.$emit('logical-end', { result: 'OK' })
}).catch((e) => {
loading.close()
console.log(e)
})
}
}
}
</script>

View File

@ -0,0 +1,55 @@
<template>
<el-dialog v-loading="loading" v-if="visible" :visible.sync="visible" title="替换">
<el-table :data="list">
<el-table-column prop="CREATE_TIME" label="日期"/>
<el-table-column prop="CREATOR_NAME" label="姓名"/>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { requestFN } from '@/utils/request'
export default {
components: { Pagination },
directives: { waves },
data() {
return {
visible: false,
list: [],
loading: false,
id: ''
}
},
methods: {
init(e) {
this.visible = true
this.id = e.BUS_TEXT_LIBRARY_ID
this.getList()
},
goBack() {
this.list = []
this.visible = false
},
getList() {
this.loading = true
requestFN(
'/textLibrary/getUpdateLog',
{
BUS_TEXT_LIBRARY_ID: this.id
}
).then((data) => {
this.loading = false
this.list = data.list
}).catch((e) => {
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,19 @@
<template>
<div>
<List v-show="activeName==='List'" ref="list" />
<Dashboard v-if="activeName==='Dashboard'" ref="Dashboard"/>
</div>
</template>
<script>
import List from './components/list.vue'
import Dashboard from '../emergencyPlanManagement/components/dashboard.vue'
export default {
components: { Dashboard, List },
data() {
return {
activeName: 'Dashboard'
}
}
}
</script>

View File

@ -0,0 +1,188 @@
<template>
<el-drawer
v-if="visible"
ref="drawer"
:visible.sync="visible"
:before-close="close"
title="搜索条件"
size="50%">
<div style="margin-left: 30px">
<el-form ref="form" label-width="200px">
<el-form-item label="规程属性:" prop="CATEGORY_LIST">
<multiple-choice :dynamic-tags.sync="form.CATEGORY_LIST" :labels="categoryList" :row-key="key.categoryKey" :row-name="key.categoryName" title="选择"/>
</el-form-item>
<el-form-item label="类型:" prop="TYPES">
<multiple-choice :dynamic-tags.sync="form.TYPES" :labels="typeList" :row-key="key.typeKey" :row-name="key.typeName" title="选择"/>
</el-form-item>
<el-form-item label="国民经济行业类型:" prop="SPECIFICATION_TYPES">
<multiple-choice :dynamic-tags.sync="form.SPECIFICATION_TYPES" :labels="industryTypeList" :row-key="key.specificationTypeKey" :row-name="key.specificationTypeName" lazy title="选择"/>
</el-form-item>
<el-form-item label="标签:" prop="LABELS">
<multiple-choice :dynamic-tags.sync="form.LABELS" :row-key="key.labelsKey" :row-name="key.labelsName" title="选择"/>
</el-form-item>
<el-form-item v-if="false" label="企业:">
<el-select
v-model="form.CORPINFO_ID"
:remote-method="searchCorp"
:loading="selectLoading"
filterable
remote
reserve-keyword
placeholder="请输入关键词">
<el-option
v-for="item in corp_list"
:key="item.CORPINFO_ID"
:label="item.CORP_NAME"
:value="item.CORPINFO_ID"/>
</el-select>
</el-form-item>
</el-form>
<div>
<el-button @click="closePanel"> </el-button>
<el-button :loading="loading" type="primary" @click="submit">{{ loading ? ' ...' : ' ' }}</el-button>
</div>
</div>
</el-drawer>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import waves from '@/directive/waves' // waves directive
import { videoPlayer } from 'vue-video-player'
import 'video.js/dist/video-js.css'
import multipleChoice from '../../../util/multipleChoice.vue'
import { requestFN } from '@/utils/request'
export default {
components: { multipleChoice, Pagination, videoPlayer },
directives: { waves },
props: {
haveCorpFlag: {
type: Boolean,
default: false
}
},
data() {
return {
visible: false,
loading: false,
key: {
typeKey: 'DICTIONARIES_ID',
typeName: 'NAME',
specificationTypeKey: 'DICTIONARIES_ID',
specificationTypeName: 'NAME',
categoryKey: 'DICTIONARIES_ID',
categoryName: 'NAME',
labelsKey: 'BUS_LABEL_FACTORY_ID',
labelsName: 'NAME'
},
typeList: [],
industryTypeList: [],
categoryList: [],
form: {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: [''],
CORPINFO_ID: ''
},
corp_list: [],
selectLoading: false
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getDic()
},
methods: {
init(tags) {
this.visible = true
},
close(done) {
this.$confirm('确认关闭?')
.then(_ => {
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: ['']
}
done()
})
.catch(e => {})
},
closePanel() {
this.visible = false
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: ['']
}
},
submit() {
this.$emit('getResult', this.form)
this.visible = false
},
getDic() {
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'ca4e4a7597f8485d8be323bd6876c40b' }
).then((data) => {
this.typeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'f2598ba72e864eadabf0ca4b664d26b9' }
).then((data) => {
this.industryTypeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '99543742b79b473480617191f7ac256e' }
).then((data) => {
this.categoryList = data.list
}).catch((e) => {
this.loading = false
})
},
clear() {
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: [''],
TTRIBUTE_LIST: [''],
CORPINFO_ID: ''
}
},
searchCorp(query) {
if (query !== '') {
this.selectLoading = true
requestFN(
'corpinfo/list', { KEYWORDS: query }
).then((data) => {
this.corp_list = data.varList
this.selectLoading = false
}).catch((e) => {
console.log(e)
this.selectLoading = false
})
}
}
}
}
</script>
<style scoped>
.information >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<div class="app-container">
<el-tabs type="border-card" @tab-click="changTab">
<el-tab-pane label="安全操作规程">
<ListEm v-if="vectory === 'listEm'"/>
</el-tab-pane>
<el-tab-pane label="安全操作规程平台资源库">
<list v-if="vectory === 'list'"/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import waves from '@/directive/waves'
import List from '../../safetyOperationRegulations/components/list.vue'
import ListEm from './listEm.vue'
export default {
components: { List, Pagination, ListEm },
directives: { waves },
data() {
return {
vectory: 'listEm'
}
},
created() {
},
methods: {
changTab(title) {
console.log(title.label)
if (title.label === '安全操作规程平台资源库') { this.vectory = 'list' }
if (title.label === '安全操作规程') { this.vectory = 'listEm' }
}
}
}
</script>

View File

@ -0,0 +1,392 @@
<template>
<el-dialog v-loading="loading" v-if="dialogVisible" :visible.sync="dialogVisible" :title="title" destroy-on-close @close="clear" >
<el-form ref="form" :model="form" :rules="rules" label-width="180px">
<el-form-item v-if="false" label="规程属性:" prop="CATEGORY_LIST">
<multiple-choice :dynamic-tags.sync="form.CATEGORY_LIST" :labels="categoryList" :row-key="key.categoryKey" :row-name="key.categoryName" :limit="1" @getChooseOne="getChooseOne"/>
</el-form-item>
<el-form-item label="安全操作规程名称:" prop="REMARKS">
<el-input v-model="form.REMARKS" style="width: 100%"/>
</el-form-item>
<el-form-item label="类型:" prop="TYPES">
<multiple-choice :dynamic-tags.sync="form.TYPES" :labels="typeList" :row-key="key.typeKey" :row-name="key.typeName"/>
</el-form-item>
<el-form-item v-if="false" label="国民经济行业类型:" prop="SPECIFICATION_TYPES">
<multiple-choice :dynamic-tags.sync="form.SPECIFICATION_TYPES" :labels="industryTypeList" :row-key="key.specificationTypeKey" :row-name="key.specificationTypeName" lazy/>
</el-form-item>
<el-form-item v-if="false" label="状态:" prop="STATUS">
<el-select v-model="form.STATUS" placeholder="请选择" style="width: 100%;">
<el-option label="停用" value="0"/>
<el-option label="启用" value="1"/>
</el-select>
</el-form-item>
<el-form-item v-if="!isEdit" label="文件:" prop="FILE">
<upload-file :file-list.sync="form.FILE" :limit="1" :file-size="200" append-to-body accept=".pdf"/>
</el-form-item>
<el-form-item v-if="!isEdit" label="添加文件内容:">
<el-button size="small" type="primary" @click="openTextEdit()"></el-button>
</el-form-item>
<el-form-item v-if="isEdit" label="添加文件内容:">
<el-button size="small" type="primary" @click="openTextEdit({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID},true)"></el-button>
<el-button size="small" type="primary" @click="openTextEdit({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID},false)"></el-button>
<el-button size="small" type="primary" @click="exportWord({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID})">word</el-button>
</el-form-item>
<el-form-item label="标签:" prop="labels">
<multiple-choice :dynamic-tags.sync="form.labels" :row-key="key.labelsKey" :row-name="key.labelsName" can-add/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
<edit-label ref="editLabel" append-to-body/>
<select-label ref="selectLabel" append-to-body @getResult="getChooseTage"/>
<select-type ref="selectType" :limit="1" append-to-body @getResult="getType"/>
<text-editing ref="textEditing" :disabled="textDisabled" append-to-body title="文本编辑器" @getResult="getText"/>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { upload } from '@/utils/upload'
import { requestFN } from '@/utils/request'
import editLabel from '../../../Label/components/editLabel.vue'
import selectLabel from '../../../Label/components/selectLable.vue'
import selectType from '../../../util/selectType.vue'
import multipleChoice from '../../../util/multipleChoice.vue'
import UploadFile from '../../../../components/UploadFile/index.vue'
import TextEditing from '../../../util/textEditing.vue'
export default {
components: { TextEditing, Pagination, editLabel, selectLabel, selectType, multipleChoice, UploadFile },
directives: { waves },
props: {
title: {
type: String,
default: ''
}
},
data() {
return {
dialogVisible: false,
form: {
REMARKS: '',
FILE: [],
labels: [''],
TYPE: '',
TYPES: [''],
SPECIFICATION_TYPES: [''],
CATEGORY_LIST: [''],
STATUS: '',
ASSOCIATION: '0',
types: [],
specification_types: [],
category_list: [],
TEXT_INFO: ''
},
key: {
typeKey: 'DICTIONARIES_ID',
typeName: 'NAME',
specificationTypeKey: 'DICTIONARIES_ID',
specificationTypeName: 'NAME',
categoryKey: 'DICTIONARIES_ID',
categoryName: 'NAME',
labelsKey: 'BUS_LABEL_FACTORY_ID',
labelsName: 'NAME'
},
rules: {
REMARKS: [{ required: true, message: '请输安全操作规程', trigger: 'change' }],
STATUS: [{ required: true, message: '请选择状态', trigger: 'change' }],
FILE: [{ required: true, message: '请选择文件', trigger: 'blur' }],
TYPES: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('类型必选'))
}
return callback()
},
trigger: 'blur'
}],
SPECIFICATION_TYPES: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('操作规程行业类型必选'))
}
return callback()
},
trigger: 'blur'
}],
CATEGORY_LIST: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('规程属性必选'))
}
return callback()
},
trigger: 'blur'
}]
},
loading: false,
e: {},
isEdit: false,
typeList: [],
industryTypeList: [],
categoryList: [],
remoteControl: {
keyOne: true
},
textDisabled: false
}
},
methods: {
init(e) {
this.dialogVisible = true
this.e = e ? e.e : {}
this.isEdit = e ? e.isEdit : false
this.getDic()
if (e) {
this.loading = true
requestFN(
'/textLibrary/goEdit',
{ BUS_TEXT_LIBRARY_ID: this.e.BUS_TEXT_LIBRARY_ID }
).then((data) => {
this.loading = false
this.form = data.data
this.form.FILE = []
this.form.types = []
this.form.specification_types = []
this.form.category_list = []
if (!this.form.TYPES || this.form.TYPES.length === 0) this.form.TYPES = ['']
if (!this.form.SPECIFICATION_TYPES || this.form.SPECIFICATION_TYPES.length === 0) this.form.SPECIFICATION_TYPES = ['']
if (!this.form.CATEGORY_LIST || this.form.CATEGORY_LIST.length === 0) this.form.CATEGORY_LIST = ['']
if (!this.form.labels || this.form.labels.length === 0) this.form.labels = ['']
this.remoteControl.keyOne = !(this.form.CATEGORY_LIST[0].CATEGORY_ID === '8051d985a2bc406a83ea9360b64182b2')
}).catch((e) => {
this.$message.error(e)
this.loading = false
})
} else {
this.isEdit = false
}
},
save() {
if (this.checkForm()) {
return
}
this.$refs.form.validate((valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '上传中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const formData = new FormData()
if (this.form.TEXT_INFO) this.form.TEXT_INFO = this.form.TEXT_INFO.replaceAll('<img', '<img style="max-width:100%"')
Object.keys(this.form).map(key => {
formData.append(key, this.form[key])
})
if (!this.isEdit) {
if (!this.form.FILE || this.form.FILE.length <= 0) {
this.$message.error('请上传文件')
loading.close()
return
}
}
for (let i = 0; i < this.form.FILE.length; i++) {
if (this.form.FILE[i].raw) {
formData.append('FILE', this.form.FILE[i].raw)
}
}
formData.append('labels', JSON.stringify(this.form.labels))
for (let i = 0; i < this.form.TYPES.length; i++) {
if (this.form.TYPES[i]) {
this.form.types.push({
CATEGORY: 'TYPES',
CATEGORY_ID: this.form.TYPES[i].DICTIONARIES_ID,
CATEGORY_NAME: this.form.TYPES[i].NAME
})
}
}
formData.append('TYPES', JSON.stringify(this.form.types))
for (let i = 0; i < this.form.SPECIFICATION_TYPES.length; i++) {
if (this.form.SPECIFICATION_TYPES[i]) {
this.form.specification_types.push({
CATEGORY: 'SPECIFICATION_TYPES',
CATEGORY_ID: this.form.SPECIFICATION_TYPES[i].DICTIONARIES_ID,
CATEGORY_NAME: this.form.SPECIFICATION_TYPES[i].NAME
})
}
}
formData.append('SPECIFICATION_TYPES', JSON.stringify(this.form.specification_types))
if (!this.form.category_list) this.form.category_list = []
this.form.category_list.push({
CATEGORY: 'CATEGORY_LIST',
CATEGORY_ID: '31c2e389f2284ac48d54e85d56528092',
CATEGORY_NAME: '行业专属类'
})
formData.append('CATEGORY_LIST', JSON.stringify(this.form.category_list))
upload(
'/textLibrary/init',
formData
).then((data) => {
loading.close()
this.dialogVisible = false
this.$emit('logical-end', { result: 'OK' })
this.$message.success('保存成功')
}).catch((e) => {
loading.close()
console.log(e)
})
this.clear()
} else {
return false
}
})
},
checkForm() {
if (this.form.labels.length > 15) {
this.$message.error('关联标签数不能超过15个')
return true
}
},
goBack() {
this.dialogVisible = false
this.clear()
this.$emit('goBack', this.e)
},
getChooseTage(e) {
if (e.TYPE === '0') {
const list = e.e
for (const listKey in list) {
const index = this.form.labels.findIndex(item => {
item.BUS_LABEL_FACTORY_ID === list[listKey].BUS_LABEL_FACTORY_ID
})
if (index < 0) {
const label = JSON.parse(JSON.stringify(list[listKey]))
label.label = label.NAME
label.value = JSON.stringify(list[listKey])
const index = this.form.labels.findIndex(item => item.value === label.value)
if (index < 0) {
this.form.labels.push(label)
}
}
}
} else {
if (e.e.length > 1) {
this.$message.error('只能选择一个类型')
return
}
this.form.TYPE_NAME = e.e[0].NAME
this.form.TYPE = e.e[0].BUS_LABEL_FACTORY_ID
this.$forceUpdate()
}
},
getType(e) {
this.form.TYPE = e.info[0].DICTIONARIES_ID
this.form.TYPE_NAME = e.info[0].NAME
},
clear() {
this.dialogVisible = false
console.log('clear')
this.isEdit = false
this.form = {
REMARKS: '',
FILE: [],
labels: [''],
TYPE: '',
TYPES: [''],
SPECIFICATION_TYPES: [''],
STATUS: '',
ASSOCIATION: '0',
types: [],
specification_types: []
}
},
getDic() {
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'ca4e4a7597f8485d8be323bd6876c40b' }
).then((data) => {
this.typeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'f2598ba72e864eadabf0ca4b664d26b9' }
).then((data) => {
this.industryTypeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '99543742b79b473480617191f7ac256e' }
).then((data) => {
this.categoryList = data.list
}).catch((e) => {
this.loading = false
})
},
getChooseOne(e) {
this.remoteControl.keyOne = !(e && e.info && e.info.DICTIONARIES_ID && e.info.DICTIONARIES_ID === '8051d985a2bc406a83ea9360b64182b2')
},
openTextEdit(id, textDisabled) {
if (!id) {
this.textDisabled = false
this.$refs.textEditing.init({ text: this.form.TEXT_INFO })
} else {
this.textDisabled = textDisabled
this.loading = true
requestFN('textLibrary/getTextInfo', id)
.then((data) => {
if (data.info && data.info.TEXT_INFO && data.info.TEXT_INFO !== '') {
this.$refs.textEditing.init({ text: data.info.TEXT_INFO })
} else {
if (((!this.form.TEXT_INFO) || this.form.TEXT_INFO === '') && this.textDisabled) {
this.$message.error('此数据未维护文件内容')
} else {
this.$refs.textEditing.init({ text: this.form.TEXT_INFO })
}
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
},
getText(e) {
this.form.TEXT_INFO = e.text
},
exportWord(info) {
this.loading = true
requestFN('textLibrary/getTextInfo', info)
.then((data) => {
if (data.info) {
if ((!data.info) || data.info.TEXT_INFO === '') {
this.$message.error('没有文件导出')
} else {
this.$message.success('导出成功')
window.open(config.httpurl + '/textLibrary/exportWord?BUS_TEXT_LIBRARY_ID=' + info.BUS_TEXT_LIBRARY_ID)
}
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,527 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form label-width="50px">
<el-row>
<el-col :span="6">
<el-form-item label="安全操作规程名称:" label-width="150px">
<el-input v-model="form.KEYWORDS" placeholder="请输入" class="filter-item"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="addCondition">
添加其他搜索条件
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="clearMessage">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:row-key="getRowKey"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
:row-class-name="tableRowClassName"
tooltip-effect="dark"
border
fit
highlight-current-row
@cell-mouse-enter="enterSelectionRows"
@cell-mouse-leave="leaveSelectionRows">
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column align="center" prop="REMARKS" label="安全操作规程名称" />
<el-table-column align="center" prop="TYPES" label="类型" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="LABEL" align="center" label="标签" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="SPECIFICATION_TYPES" label="国民经济行业类型" width="300px">
<template slot-scope="{row}">
<div v-if="(row.SPECIFICATION_TYPES && row.SPECIFICATION_TYPES.length > 0) && ((!row.CATEGORY_LIST) || (!row.CATEGORY_LIST[0]) || (row.CATEGORY_LIST[0].CATEGORY_ID !== '8051d985a2bc406a83ea9360b64182b2')) ">
<el-tag
v-for="tag in row.SPECIFICATION_TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</div>
<div v-else>
<el-tag type="warning">通用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="UPLOAD_TIME" label="上传时间" width="90px"/>
<el-table-column v-if="false" :show-overflow-tooltip="true" align="center" prop="UPLOAD_USER_NAME" width="100px" label="数据来源" >
<template slot-scope="{row}">
{{ '资源库数据' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200px">
<template slot-scope="{row}">
<el-row>
<el-col :span="14">
<el-button v-show="!row.LOCKTOOL" type="primary" icon="el-icon-edit" size="mini" @click="handleCopy(row)"></el-button>
</el-col>
<el-col :span="10">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="getInformation(row)"></el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<edit-text-library ref="editTextLibrary" :title="title" @logical-end="saveClose"/>
<text-library-info ref="textLibraryInfo"/>
<update-file ref="updateFile"/>
<update-log ref="updateLog"/>
<condition ref="condition" @getResult="getCondition"/>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import editTextLibrary from './editTextLibrary.vue'
import textLibraryInfo from './textLibraryInfo.vue'
import updateFile from './updateFile.vue'
import updateLog from './updateLog.vue'
import UpdateLog from './updateLog.vue'
import condition from './condition.vue'
export default {
components: { UpdateLog, Pagination, editTextLibrary, textLibraryInfo, updateFile, updateLog, condition },
directives: { waves },
data() {
return {
config: config,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
total: 0,
form: {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
},
label_name: '',
varList: [],
pd: [],
isEdit: false,
isLook: false,
title: ''
}
},
created() {
this.getList()
},
methods: {
getRowKey(row) {
return row.BLACKSPOT_ID
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
addCondition() {
this.$refs.condition.init()
},
getCondition(info) {
this.form.CATEGORY_LIST = info.CATEGORY_LIST
this.form.TYPES = info.TYPES
this.form.SPECIFICATION_TYPES = info.SPECIFICATION_TYPES
this.form.labels = info.LABELS
},
clearMessage() {
this.label_name = ''
this.form = {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
}
this.$refs.condition.clear()
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/textLibrary/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.form.KEYWORDS,
CATEGORY_LIST: JSON.stringify(this.form.CATEGORY_LIST),
TYPES: JSON.stringify(this.form.TYPES),
SPECIFICATION_TYPES: JSON.stringify(this.form.SPECIFICATION_TYPES),
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '0',
CORPINFO_ID: '0'
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.title = '新增'
this.$refs.editTextLibrary.init()
},
handleEdit(e) {
this.title = '编辑'
this.$refs.editTextLibrary.init({ e: e, isEdit: true })
},
getInformation(e) {
this.$refs.textLibraryInfo.init({ e: e })
},
handleDelete(e) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/delete',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
if (data.code === '0') {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
} else {
this.listLoading = false
this.$message.error(data.errorMessage)
}
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleLock(e, flag) {
this.$confirm(flag === '1' ? '确定要锁定吗?' : '确定要解锁吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/lock',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isLock: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleTop(e, flag) {
this.$confirm(flag === '1' ? '确定要置顶吗?' : '确定要取消置顶吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/top',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isTop: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleExport(e) {
this.$confirm('确定要导出文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (e.MIGRATION_FLAG === '1') {
window.open(config.fileUrl + e.PATH)
} else {
window.open(e.PATH)
}
}).catch((e) => {
console.log(e)
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const _ids = _selectData.filter((item, index) => {
return item.LOCKTOOL
})
if (_ids.length > 0) {
this.$message.error('选中的数据有锁定数据,请重新选择')
return
}
const ids = _selectData.map((item, index) => {
return item.BUS_TEXT_LIBRARY_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'textlibraryOne:add,textlibraryOne:del,textlibraryOne:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.textlibraryOnefhadminadd //
this.del = data.textlibraryOnefhadmindel //
this.edit = data.textlibraryOnefhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
if (row.ISTOPTIME) {
return 'warning-row'
}
},
saveClose(e) {
this.getList()
},
openUpdateFile(row) {
this.$refs.updateFile.init(row)
},
openUpdateLog(row) {
this.$refs.updateLog.init(row)
},
setStatus(row, status) {
this.listLoading = true
this.$confirm('是否更改状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/textLibrary/setStatus',
{
BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID,
STATUS: status
}
).then((data) => {
this.listLoading = false
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
this.listLoading = false
})
},
handleCopy(row) {
this.$confirm('确定要将此条数据添加到本地', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.copyInfo(row)
}).catch((e) => {
console.log(e)
this.$message({
type: 'info',
message: '已取消添加'
})
})
},
copyInfo(row) {
requestFN(
'/textLibrary/copyToOperate?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID }
).then((data) => {
if (data.code === '0') {
this.$message.success('添加成功')
} else {
this.$message.success('添加失败')
}
}).catch((e) => {
this.$message.success('添加失败')
})
},
enterSelectionRows(row, column, cell, event) {
console.log(row, 'row')
if (row.ISTOPTIME) {
this.createTips(event, row, '数据已置顶')
}
},
leaveSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.removeTips(row)
}
},
createTips(el, row, value) {
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDom = document.createElement('div')
tooltipDom.style.cssText = `
display: inline-block;
max-width: 400px;
max-height: 400px;
position: absolute;
top: ${el.clientY + 5}px;
left: ${el.clientX}px;
padding:5px 10px;
overflow: auto;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #595959;
background: #fff;
border-radius: 5px;
z-index: 19999;
box-shadow: 0 4px 12px 1px #ccc;
`
tooltipDom.innerHTML = value
tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`)
// body
document.body.appendChild(tooltipDom)
},
removeTips(row) {
console.log(row, 'row')
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`)
if (tooltipDomLeave.length) {
tooltipDomLeave.forEach(dom => {
document.body.removeChild(dom)
})
}
}
}
}
</script>

View File

@ -0,0 +1,504 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form label-width="50px">
<el-row>
<el-col :span="6">
<el-form-item label="安全操作规程名称:" label-width="150px">
<el-input v-model="form.KEYWORDS" placeholder="请输入" class="filter-item"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="addCondition">
添加其他搜索条件
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="clearMessage">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:row-key="getRowKey"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
:row-class-name="tableRowClassName"
tooltip-effect="dark"
border
fit
highlight-current-row
@cell-mouse-enter="enterSelectionRows"
@cell-mouse-leave="leaveSelectionRows">
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"
/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column align="center" prop="REMARKS" label="安全操作规程名称" />
<el-table-column align="center" prop="TYPES" label="类型" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="LABEL" align="center" label="标签" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="SPECIFICATION_TYPES" label="国民经济行业类型" width="300px">
<template slot-scope="{row}">
<div v-if="row.SPECIFICATION_TYPES && row.SPECIFICATION_TYPES.length > 0">
<el-tag
v-for="tag in row.SPECIFICATION_TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</div>
<div v-else>
<el-tag type="warning">通用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="UPLOAD_TIME" label="上传时间" width="90px"/>
<el-table-column v-if="false" :show-overflow-tooltip="true" align="center" prop="UPLOAD_USER_NAME" width="100px" label="数据来源" >
<template slot-scope="{row}">
{{ !row.CORP_NAME === '' ? '资源库数据' : row.CORP_NAME }}
</template>
</el-table-column> <el-table-column label="" align="center" width="200px">
<template slot-scope="{row}">
<el-row>
<el-col :span="24" style="padding-bottom: 10px">
<el-button type="info" icon="el-icon-view" size="mini" @click="getInformation(row)"></el-button>
<el-button type="warning" icon="el-icon-printer" size="mini" @click="handleExport(row)"></el-button>
</el-col>
<el-col :span="24">
<el-button v-if="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button v-if="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row)"></el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-if="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<edit-text-library ref="editTextLibrary" :title="title" @logical-end="saveClose"/>
<text-library-info ref="textLibraryInfo"/>
<update-file ref="updateFile"/>
<update-log ref="updateLog"/>
<condition ref="condition" have-corp-flag @getResult="getCondition"/>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import editTextLibrary from './editTextLibrary.vue'
import textLibraryInfo from './textLibraryInfo.vue'
import updateFile from './updateFile.vue'
import updateLog from './updateLog.vue'
import UpdateLog from './updateLog.vue'
import condition from './condition.vue'
export default {
components: { UpdateLog, Pagination, editTextLibrary, textLibraryInfo, updateFile, updateLog, condition },
directives: { waves },
data() {
return {
config: config,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
total: 0,
form: {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
},
label_name: '',
varList: [],
pd: [],
isEdit: false,
isLook: false,
title: ''
}
},
created() {
this.getList()
},
methods: {
getRowKey(row) {
return row.BLACKSPOT_ID
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
addCondition() {
this.$refs.condition.init()
},
getCondition(info) {
this.form.CATEGORY_LIST = info.CATEGORY_LIST
this.form.TYPES = info.TYPES
this.form.SPECIFICATION_TYPES = info.SPECIFICATION_TYPES
this.form.labels = info.LABELS
this.form.CORPINFO_ID = info.CORPINFO_ID
},
clearMessage() {
this.label_name = ''
this.form = {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
}
this.$refs.condition.clear()
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/textLibrary/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.form.KEYWORDS,
CATEGORY_LIST: JSON.stringify(this.form.CATEGORY_LIST),
TYPES: JSON.stringify(this.form.TYPES),
SPECIFICATION_TYPES: JSON.stringify(this.form.SPECIFICATION_TYPES),
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '0',
ENTERPRISE_SIDE: '0',
CORPINFO_ID: this.form.CORPINFO_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.title = '新增'
this.$refs.editTextLibrary.init()
},
handleEdit(e) {
this.title = '编辑'
this.$refs.editTextLibrary.init({ e: e, isEdit: true })
},
getInformation(e) {
this.$refs.textLibraryInfo.init({ e: e })
},
handleDelete(e) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/delete',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
if (data.code === '0') {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
} else {
this.listLoading = false
this.$message.error(data.errorMessage)
}
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleLock(e, flag) {
this.$confirm(flag === '1' ? '确定要锁定吗?' : '确定要解锁吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/lock',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isLock: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleTop(e, flag) {
this.$confirm(flag === '1' ? '确定要置顶吗?' : '确定要取消置顶吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/top',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isTop: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleExport(e) {
this.$confirm('确定要导出文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (e.MIGRATION_FLAG === '1') {
window.open(config.fileUrl + e.PATH)
} else {
window.open(e.PATH)
}
}).catch((e) => {
console.log(e)
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const _ids = _selectData.filter((item, index) => {
return item.LOCKTOOL
})
if (_ids.length > 0) {
this.$message.error('选中的数据有锁定数据,请重新选择')
return
}
const ids = _selectData.map((item, index) => {
return item.BUS_TEXT_LIBRARY_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'textlibraryOne:add,textlibraryOne:del,textlibraryOne:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.textlibraryOnefhadminadd //
this.del = data.textlibraryOnefhadmindel //
this.edit = data.textlibraryOnefhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
if (row.ISTOPTIME) {
return 'warning-row'
}
},
saveClose(e) {
this.getList()
},
openUpdateFile(row) {
this.$refs.updateFile.init(row)
},
openUpdateLog(row) {
this.$refs.updateLog.init(row)
},
setStatus(row, status) {
this.listLoading = true
this.$confirm('是否更改状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/textLibrary/setStatus',
{
BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID,
STATUS: status
}
).then((data) => {
this.listLoading = false
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
this.listLoading = false
})
},
enterSelectionRows(row, column, cell, event) {
console.log('row', row)
if (row.ISTOPTIME) {
this.createTips(event, row, '数据已置顶')
}
},
leaveSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.removeTips(row)
}
},
createTips(el, row, value) {
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDom = document.createElement('div')
tooltipDom.style.cssText = `
display: inline-block;
max-width: 400px;
max-height: 400px;
position: absolute;
top: ${el.clientY + 5}px;
left: ${el.clientX}px;
padding:5px 10px;
overflow: auto;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #595959;
background: #fff;
border-radius: 5px;
z-index: 19999;
box-shadow: 0 4px 12px 1px #ccc;
`
tooltipDom.innerHTML = value
tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`)
// body
document.body.appendChild(tooltipDom)
},
removeTips(row) {
console.log(row, 'row')
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`)
if (tooltipDomLeave.length) {
tooltipDomLeave.forEach(dom => {
document.body.removeChild(dom)
})
}
}
}
}
</script>

View File

@ -0,0 +1,146 @@
<template>
<el-dialog v-loading="loading" v-if="dialogVisible" :visible.sync="dialogVisible" title="详情">
<el-form ref="form" :model="form" label-width="180px">
<el-form-item label="安全操作规程名称:" prop="FILE_NAME">
<el-input v-model="form.REMARKS" disabled style="width: 70%"/>
</el-form-item>
<el-form-item label="规程属性:" prop="FILE_NAME">
<el-tag
v-for="tag in form.CATEGORY_LIST"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item label="类型:" prop="FILE_NAME">
<el-tag
v-for="tag in form.TYPES"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item v-if="remoteControl.keyOne" label="国民经济行业类型:" prop="FILE_NAME">
<el-tag v-for="tag in form.SPECIFICATION_TYPES" :key="tag.value" :disable-transitions="false" style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item label="上传时间:" prop="FILE_NAME">
<el-input v-model="form.UPLOAD_TIME" disabled style="width: 70%"/>
</el-form-item>
<el-form-item label="上传人:" prop="FILE_NAME">
<el-input v-model="form.UPLOAD_USER_NAME" disabled style="width: 70%"/>
</el-form-item>
<el-form-item prop="tags" label="标签:">
<el-tag
v-for="tag in form.labels"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.NAME }}
</el-tag>
</el-form-item>
<el-form-item label="文件详情:">
<el-button size="small" type="primary" @click="openTextEdit({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID})"></el-button>
<el-button size="small" type="primary" @click="exportWord(form)">word</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
</div>
<text-editing ref="textEditing" :disabled="true" append-to-body title="文本编辑器"/>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { requestFN } from '@/utils/request'
import TextEditing from '../../../util/textEditing.vue'
export default {
components: { TextEditing, Pagination },
directives: { waves },
data() {
return {
config: config,
dialogVisible: false,
form: {
BUS_TEXT_LIBRARY_ID: '',
FILE_NAME: '',
FILE: [],
TYPE: '',
labels: [],
UPLOAD_TIME: '',
UPLOAD_USER_NAME: ''
},
loading: false,
remoteControl: {
keyOne: true
}
}
},
methods: {
init(e) {
this.dialogVisible = true
this.loading = true
this.e = e.e
requestFN(
'/textLibrary/goEdit',
{
BUS_TEXT_LIBRARY_ID: this.e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
this.loading = false
this.form = data.data
this.form.FILE = []
this.remoteControl.keyOne = !(this.form.CATEGORY_LIST[0].CATEGORY_ID === '8051d985a2bc406a83ea9360b64182b2')
}).catch((e) => {
this.$message.error(e)
this.loading = false
})
},
goBack() {
this.dialogVisible = false
this.$emit('goBack', this.e)
},
openTextEdit(id) {
this.loading = true
requestFN('textLibrary/getTextInfo', id)
.then((data) => {
if (data.info && data.info.TEXT_INFO && data.info.TEXT_INFO !== '') {
this.$refs.textEditing.init({ text: data.info.TEXT_INFO })
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
},
exportWord(info) {
this.loading = true
requestFN('textLibrary/getTextInfo', info)
.then((data) => {
if (data.info) {
if ((!data.info) || data.info.TEXT_INFO === '') {
this.$message.error('没有文件导出')
} else {
this.$message.success('导出成功')
window.open(config.httpurl + '/textLibrary/exportWord?BUS_TEXT_LIBRARY_ID=' + info.BUS_TEXT_LIBRARY_ID)
}
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,77 @@
<template>
<el-dialog v-loading="loading" v-if="visible" :visible.sync="visible" title="替换">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item label="文件:" prop="FILE">
<upload-file :file-list.sync="form.FILE" :limit="1" :file-size="200" append-to-body accept=".pdf"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { upload } from '@/utils/upload'
import uploadFile from '../../../../components/UploadFile/index.vue'
export default {
components: { Pagination, uploadFile },
directives: { waves },
data() {
return {
visible: false,
form: {
FILE: [],
BUS_TEXT_LIBRARY_ID: ''
},
rules: {
FILE: [{ required: true, message: '请选择文件', trigger: 'blur' }]
},
loading: false
}
},
methods: {
init(e) {
this.visible = true
this.form.BUS_TEXT_LIBRARY_ID = e.BUS_TEXT_LIBRARY_ID
},
goBack() {
this.form = {
FILE: [],
BUS_TEXT_LIBRARY_ID: ''
}
this.visible = false
},
save() {
const loading = this.$loading({
lock: true,
text: '上传中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const formData = new FormData()
for (let i = 0; i < this.form.FILE.length; i++) {
if (this.form.FILE[i].raw) {
formData.append('FILE', this.form.FILE[i].raw)
}
}
formData.append('BUS_TEXT_LIBRARY_ID', this.form.BUS_TEXT_LIBRARY_ID)
upload(
'/textLibrary/updateFile',
formData
).then((data) => {
loading.close()
this.visible = false
this.$emit('logical-end', { result: 'OK' })
}).catch((e) => {
loading.close()
console.log(e)
})
}
}
}
</script>

View File

@ -0,0 +1,55 @@
<template>
<el-dialog v-loading="loading" v-if="visible" :visible.sync="visible" title="替换">
<el-table :data="list">
<el-table-column prop="CREATE_TIME" label="日期"/>
<el-table-column prop="CREATOR_NAME" label="姓名"/>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { requestFN } from '@/utils/request'
export default {
components: { Pagination },
directives: { waves },
data() {
return {
visible: false,
list: [],
loading: false,
id: ''
}
},
methods: {
init(e) {
this.visible = true
this.id = e.BUS_TEXT_LIBRARY_ID
this.getList()
},
goBack() {
this.list = []
this.visible = false
},
getList() {
this.loading = true
requestFN(
'/textLibrary/getUpdateLog',
{
BUS_TEXT_LIBRARY_ID: this.id
}
).then((data) => {
this.loading = false
this.list = data.list
}).catch((e) => {
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,19 @@
<template>
<div>
<List v-if="activeName==='List'" ref="list" />
<Dashboard v-if="activeName==='Dashboard'" ref="Dashboard"/>
</div>
</template>
<script>
import List from './components/list.vue'
import Dashboard from './components/dashboard.vue'
export default {
components: { List, Dashboard },
data() {
return {
activeName: 'Dashboard'
}
}
}
</script>

View File

@ -0,0 +1,188 @@
<template>
<el-drawer
v-if="visible"
ref="drawer"
:visible.sync="visible"
:before-close="close"
title="搜索条件"
size="50%">
<div style="margin-left: 30px">
<el-form ref="form" label-width="200px">
<el-form-item label="规程属性:" prop="CATEGORY_LIST">
<multiple-choice :dynamic-tags.sync="form.CATEGORY_LIST" :labels="categoryList" :row-key="key.categoryKey" :row-name="key.categoryName" title="选择"/>
</el-form-item>
<el-form-item label="类型:" prop="TYPES">
<multiple-choice :dynamic-tags.sync="form.TYPES" :labels="typeList" :row-key="key.typeKey" :row-name="key.typeName" title="选择"/>
</el-form-item>
<el-form-item label="国民经济行业类型:" prop="SPECIFICATION_TYPES">
<multiple-choice :dynamic-tags.sync="form.SPECIFICATION_TYPES" :labels="industryTypeList" :row-key="key.specificationTypeKey" :row-name="key.specificationTypeName" lazy title="选择"/>
</el-form-item>
<el-form-item label="标签:" prop="LABELS">
<multiple-choice :dynamic-tags.sync="form.LABELS" :row-key="key.labelsKey" :row-name="key.labelsName" title="选择"/>
</el-form-item>
<el-form-item v-if="false" label="企业:">
<el-select
v-model="form.CORPINFO_ID"
:remote-method="searchCorp"
:loading="selectLoading"
filterable
remote
reserve-keyword
placeholder="请输入关键词">
<el-option
v-for="item in corp_list"
:key="item.CORPINFO_ID"
:label="item.CORP_NAME"
:value="item.CORPINFO_ID"/>
</el-select>
</el-form-item>
</el-form>
<div>
<el-button @click="closePanel"> </el-button>
<el-button :loading="loading" type="primary" @click="submit">{{ loading ? ' ...' : ' ' }}</el-button>
</div>
</div>
</el-drawer>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import waves from '@/directive/waves' // waves directive
import { videoPlayer } from 'vue-video-player'
import 'video.js/dist/video-js.css'
import multipleChoice from '../../../util/multipleChoice.vue'
import { requestFN } from '@/utils/request'
export default {
components: { multipleChoice, Pagination, videoPlayer },
directives: { waves },
props: {
haveCorpFlag: {
type: Boolean,
default: false
}
},
data() {
return {
visible: false,
loading: false,
key: {
typeKey: 'DICTIONARIES_ID',
typeName: 'NAME',
specificationTypeKey: 'DICTIONARIES_ID',
specificationTypeName: 'NAME',
categoryKey: 'DICTIONARIES_ID',
categoryName: 'NAME',
labelsKey: 'BUS_LABEL_FACTORY_ID',
labelsName: 'NAME'
},
typeList: [],
industryTypeList: [],
categoryList: [],
form: {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: [''],
CORPINFO_ID: ''
},
corp_list: [],
selectLoading: false
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getDic()
},
methods: {
init(tags) {
this.visible = true
},
close(done) {
this.$confirm('确认关闭?')
.then(_ => {
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: ['']
}
done()
})
.catch(e => {})
},
closePanel() {
this.visible = false
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: ['']
}
},
submit() {
this.$emit('getResult', this.form)
this.visible = false
},
getDic() {
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '675ed73a7d7d42a488491f6e0e9c8fd5' }
).then((data) => {
this.typeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'f2598ba72e864eadabf0ca4b664d26b9' }
).then((data) => {
this.industryTypeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'c35e6f7ea1b844e7946b2f78e1cc3907' }
).then((data) => {
this.categoryList = data.list
}).catch((e) => {
this.loading = false
})
},
clear() {
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: [''],
TTRIBUTE_LIST: [''],
CORPINFO_ID: ''
}
},
searchCorp(query) {
if (query !== '') {
this.selectLoading = true
requestFN(
'corpinfo/list', { KEYWORDS: query }
).then((data) => {
this.corp_list = data.varList
this.selectLoading = false
}).catch((e) => {
console.log(e)
this.selectLoading = false
})
}
}
}
}
</script>
<style scoped>
.information >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<div class="app-container">
<el-tabs type="border-card" @tab-click="changTab">
<el-tab-pane label="安全生产管理制度">
<ListEm v-if="vectory === 'listEm'"/>
</el-tab-pane>
<el-tab-pane label="安全生产管理制度平台资源库">
<list v-if="vectory === 'list'"/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import waves from '@/directive/waves'
import List from '../../safetyProductionManagementSystem/components/list.vue'
import ListEm from './listEm.vue'
export default {
components: { List, Pagination, ListEm },
directives: { waves },
data() {
return {
vectory: 'listEm'
}
},
created() {
},
methods: {
changTab(title) {
console.log(title.label)
if (title.label === '安全生产管理制度平台资源库') { this.vectory = 'list' }
if (title.label === '安全生产管理制度') { this.vectory = 'listEm' }
}
}
}
</script>

View File

@ -0,0 +1,390 @@
<template>
<el-dialog v-loading="loading" v-if="dialogVisible" :visible.sync="dialogVisible" :title="title" destroy-on-close @close="clear">
<el-form ref="form" :model="form" :rules="rules" label-width="180px">
<el-form-item v-if="false" label="规程属性:" prop="CATEGORY_LIST">
<multiple-choice :dynamic-tags.sync="form.CATEGORY_LIST" :labels="categoryList" :row-key="key.categoryKey" :row-name="key.categoryName" :limit="1" @getChooseOne="getChooseOne"/>
</el-form-item>
<el-form-item label="安全管理制度名称:" prop="REMARKS">
<el-input v-model="form.REMARKS" style="width: 100%"/>
</el-form-item>
<el-form-item label="类型:" prop="TYPES">
<multiple-choice :dynamic-tags.sync="form.TYPES" :labels="typeList" :row-key="key.typeKey" :row-name="key.typeName"/>
</el-form-item>
<el-form-item v-if="false" label="国民经济行业类型:" prop="SPECIFICATION_TYPES">
<multiple-choice :dynamic-tags.sync="form.SPECIFICATION_TYPES" :labels="industryTypeList" :row-key="key.specificationTypeKey" :row-name="key.specificationTypeName" lazy/>
</el-form-item>
<el-form-item v-if="false" label="状态:" prop="STATUS">
<el-select v-model="form.STATUS" placeholder="请选择" style="width: 100%;">
<el-option label="停用" value="0"/>
<el-option label="启用" value="1"/>
</el-select>
</el-form-item>
<el-form-item v-if="!isEdit" label="文件:" prop="FILE">
<upload-file :file-list.sync="form.FILE" :limit="1" :file-size="200" append-to-body accept=".pdf"/>
</el-form-item>
<el-form-item v-if="!isEdit" label="添加文件内容:">
<el-button size="small" type="primary" @click="openTextEdit()"></el-button>
</el-form-item>
<el-form-item v-if="isEdit" label="添加文件内容:">
<el-button size="small" type="primary" @click="openTextEdit({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID},true)"></el-button>
<el-button size="small" type="primary" @click="openTextEdit({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID},false)"></el-button>
<el-button size="small" type="primary" @click="exportWord({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID})">word</el-button>
</el-form-item>
<el-form-item label="标签:" prop="labels">
<multiple-choice :dynamic-tags.sync="form.labels" :row-key="key.labelsKey" :row-name="key.labelsName" can-add/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
<edit-label ref="editLabel" append-to-body/>
<select-label ref="selectLabel" append-to-body @getResult="getChooseTage"/>
<select-type ref="selectType" :limit="1" append-to-body @getResult="getType"/>
<text-editing ref="textEditing" :disabled="textDisabled" append-to-body title="文本编辑器" @getResult="getText"/>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { upload } from '@/utils/upload'
import { requestFN } from '@/utils/request'
import editLabel from '../../../Label/components/editLabel.vue'
import selectLabel from '../../../Label/components/selectLable.vue'
import selectType from '../../../util/selectType.vue'
import multipleChoice from '../../../util/multipleChoice.vue'
import UploadFile from '../../../../components/UploadFile/index.vue'
import TextEditing from '../../../util/textEditing.vue'
export default {
components: { TextEditing, Pagination, editLabel, selectLabel, selectType, multipleChoice, UploadFile },
directives: { waves },
props: {
title: {
type: String,
default: ''
}
},
data() {
return {
dialogVisible: false,
form: {
REMARKS: '',
FILE: [],
labels: [''],
TYPE: '',
TYPES: [''],
SPECIFICATION_TYPES: [''],
CATEGORY_LIST: [''],
STATUS: '',
ASSOCIATION: '1',
types: [],
specification_types: [],
category_list: [],
TEXT_INFO: ''
},
key: {
typeKey: 'DICTIONARIES_ID',
typeName: 'NAME',
specificationTypeKey: 'DICTIONARIES_ID',
specificationTypeName: 'NAME',
categoryKey: 'DICTIONARIES_ID',
categoryName: 'NAME',
labelsKey: 'BUS_LABEL_FACTORY_ID',
labelsName: 'NAME'
},
rules: {
REMARKS: [{ required: true, message: '请输安全操作规程', trigger: 'change' }],
STATUS: [{ required: true, message: '请选择状态', trigger: 'change' }],
FILE: [{ required: true, message: '请选择文件', trigger: 'blur' }],
TYPES: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('类型必选'))
}
return callback()
},
trigger: 'blur'
}],
SPECIFICATION_TYPES: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('操作规程行业类型必选'))
}
return callback()
},
trigger: 'blur'
}],
CATEGORY_LIST: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('规程属性必选'))
}
return callback()
},
trigger: 'blur'
}]
},
loading: false,
e: {},
isEdit: false,
typeList: [],
industryTypeList: [],
categoryList: [],
remoteControl: {
keyOne: true
},
textDisabled: false
}
},
methods: {
init(e) {
this.dialogVisible = true
this.e = e ? e.e : {}
this.isEdit = e ? e.isEdit : false
this.getDic()
if (e) {
this.loading = true
requestFN(
'/textLibrary/goEdit',
{ BUS_TEXT_LIBRARY_ID: this.e.BUS_TEXT_LIBRARY_ID }
).then((data) => {
this.loading = false
this.form = data.data
this.form.FILE = []
this.form.types = []
this.form.specification_types = []
this.form.category_list = []
if (!this.form.TYPES || this.form.TYPES.length === 0) this.form.TYPES = ['']
if (!this.form.SPECIFICATION_TYPES || this.form.SPECIFICATION_TYPES.length === 0) this.form.SPECIFICATION_TYPES = ['']
if (!this.form.CATEGORY_LIST || this.form.CATEGORY_LIST.length === 0) this.form.CATEGORY_LIST = ['']
if (!this.form.labels || this.form.labels.length === 0) this.form.labels = ['']
this.remoteControl.keyOne = !(this.form.CATEGORY_LIST[0].CATEGORY_ID === '691346658ed744a1bda2ed3a755f606c')
}).catch((e) => {
this.$message.error(e)
this.loading = false
})
} else {
this.isEdit = false
}
},
save() {
if (this.checkForm()) {
return
}
this.$refs.form.validate((valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '上传中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const formData = new FormData()
if (this.form.TEXT_INFO) this.form.TEXT_INFO = this.form.TEXT_INFO.replaceAll('<img', '<img style="max-width:100%"')
Object.keys(this.form).map(key => {
formData.append(key, this.form[key])
})
if (!this.isEdit) {
if (!this.form.FILE || this.form.FILE.length <= 0) {
this.$message.error('请上传文件')
loading.close()
return
}
}
for (let i = 0; i < this.form.FILE.length; i++) {
if (this.form.FILE[i].raw) {
formData.append('FILE', this.form.FILE[i].raw)
}
}
formData.append('labels', JSON.stringify(this.form.labels))
for (let i = 0; i < this.form.TYPES.length; i++) {
if (this.form.TYPES[i]) {
this.form.types.push({
CATEGORY: 'TYPES',
CATEGORY_ID: this.form.TYPES[i].DICTIONARIES_ID,
CATEGORY_NAME: this.form.TYPES[i].NAME
})
}
}
formData.append('TYPES', JSON.stringify(this.form.types))
for (let i = 0; i < this.form.SPECIFICATION_TYPES.length; i++) {
if (this.form.SPECIFICATION_TYPES[i]) {
this.form.specification_types.push({
CATEGORY: 'SPECIFICATION_TYPES',
CATEGORY_ID: this.form.SPECIFICATION_TYPES[i].DICTIONARIES_ID,
CATEGORY_NAME: this.form.SPECIFICATION_TYPES[i].NAME
})
}
}
formData.append('SPECIFICATION_TYPES', JSON.stringify(this.form.specification_types))
if (!this.form.category_list) this.form.category_list = []
this.form.category_list.push({
CATEGORY: 'CATEGORY_LIST',
CATEGORY_ID: '0ac08f29beec46bd93956afec058e189',
CATEGORY_NAME: '行业专属类'
})
formData.append('CATEGORY_LIST', JSON.stringify(this.form.category_list))
upload(
'/textLibrary/init',
formData
).then((data) => {
loading.close()
this.dialogVisible = false
this.$emit('logical-end', { result: 'OK' })
this.$message.success('保存成功')
}).catch((e) => {
loading.close()
console.log(e)
})
this.clear()
} else {
return false
}
})
},
checkForm() {
if (this.form.labels.length > 15) {
this.$message.error('关联标签数不能超过15个')
return true
}
},
goBack() {
this.dialogVisible = false
this.clear()
this.$emit('goBack', this.e)
},
getChooseTage(e) {
if (e.TYPE === '0') {
const list = e.e
for (const listKey in list) {
const index = this.form.labels.findIndex(item => {
item.BUS_LABEL_FACTORY_ID === list[listKey].BUS_LABEL_FACTORY_ID
})
if (index < 0) {
const label = JSON.parse(JSON.stringify(list[listKey]))
label.label = label.NAME
label.value = JSON.stringify(list[listKey])
const index = this.form.labels.findIndex(item => item.value === label.value)
if (index < 0) {
this.form.labels.push(label)
}
}
}
} else {
if (e.e.length > 1) {
this.$message.error('只能选择一个类型')
return
}
this.form.TYPE_NAME = e.e[0].NAME
this.form.TYPE = e.e[0].BUS_LABEL_FACTORY_ID
this.$forceUpdate()
}
},
getType(e) {
this.form.TYPE = e.info[0].DICTIONARIES_ID
this.form.TYPE_NAME = e.info[0].NAME
},
clear() {
this.isEdit = false
this.form = {
REMARKS: '',
FILE: [],
labels: [''],
TYPE: '',
TYPES: [''],
SPECIFICATION_TYPES: [''],
STATUS: '',
ASSOCIATION: '1',
types: [],
specification_types: []
}
},
getDic() {
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '675ed73a7d7d42a488491f6e0e9c8fd5' }
).then((data) => {
this.typeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'f2598ba72e864eadabf0ca4b664d26b9' }
).then((data) => {
this.industryTypeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'c35e6f7ea1b844e7946b2f78e1cc3907' }
).then((data) => {
this.categoryList = data.list
}).catch((e) => {
this.loading = false
})
},
getChooseOne(e) {
this.remoteControl.keyOne = !(e && e.info && e.info.DICTIONARIES_ID && e.info.DICTIONARIES_ID === '691346658ed744a1bda2ed3a755f606c')
},
openTextEdit(id, textDisabled) {
if (!id) {
this.textDisabled = false
this.$refs.textEditing.init({ text: this.form.TEXT_INFO })
} else {
this.textDisabled = textDisabled
this.loading = true
requestFN('textLibrary/getTextInfo', id)
.then((data) => {
if (data.info && data.info.TEXT_INFO && data.info.TEXT_INFO !== '') {
this.$refs.textEditing.init({ text: data.info.TEXT_INFO })
} else {
if (((!this.form.TEXT_INFO) || this.form.TEXT_INFO === '') && this.textDisabled) {
this.$message.error('此数据未维护文件内容')
} else {
this.$refs.textEditing.init({ text: this.form.TEXT_INFO })
}
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
},
getText(e) {
this.form.TEXT_INFO = e.text
},
exportWord(info) {
this.loading = true
requestFN('textLibrary/getTextInfo', info)
.then((data) => {
if (data.info) {
if ((!data.info) || data.info.TEXT_INFO === '') {
this.$message.error('没有文件导出')
} else {
this.$message.success('导出成功')
window.open(config.httpurl + '/textLibrary/exportWord?BUS_TEXT_LIBRARY_ID=' + info.BUS_TEXT_LIBRARY_ID)
}
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,526 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form label-width="50px">
<el-row>
<el-col :span="6">
<el-form-item label="安全生产管理制度名称:" label-width="200px">
<el-input v-model="form.KEYWORDS" placeholder="请输入" class="filter-item"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="addCondition">
添加其他搜索条件
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="clearMessage">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:row-key="getRowKey"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
:row-class-name="tableRowClassName"
tooltip-effect="dark"
border
fit
highlight-current-row
@cell-mouse-enter="enterSelectionRows"
@cell-mouse-leave="leaveSelectionRows">
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"
/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column align="center" prop="REMARKS" label="安全生产管理制度名称" />
<el-table-column align="center" prop="TYPES" label="类型" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="LABEL" align="center" label="标签" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="SPECIFICATION_TYPES" label="国民经济行业类型" width="300px">
<template slot-scope="{row}">
<div v-if="(row.SPECIFICATION_TYPES && row.SPECIFICATION_TYPES.length > 0) && ((!row.CATEGORY_LIST) || (!row.CATEGORY_LIST[0]) || (row.CATEGORY_LIST[0].CATEGORY_ID !== '691346658ed744a1bda2ed3a755f606c')) ">
<el-tag
v-for="tag in row.SPECIFICATION_TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</div>
<div v-else>
<el-tag type="warning">通用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="UPLOAD_TIME" label="上传时间" width="90px"/>
<el-table-column v-if="false" :show-overflow-tooltip="true" align="center" prop="UPLOAD_USER_NAME" width="100px" label="数据来源" >
<template slot-scope="{row}">
{{ '资源库数据' }}
</template>
</el-table-column> <el-table-column label="" align="center" width="200px">
<template slot-scope="{row}">
<el-row>
<el-col :span="14">
<el-button v-show="!row.LOCKTOOL" type="primary" icon="el-icon-edit" size="mini" @click="handleCopy(row)"></el-button>
</el-col>
<el-col :span="10">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="getInformation(row)"></el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<edit-text-library ref="editTextLibrary" :title="title" @logical-end="saveClose"/>
<text-library-info ref="textLibraryInfo"/>
<update-file ref="updateFile"/>
<update-log ref="updateLog"/>
<condition ref="condition" @getResult="getCondition"/>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import editTextLibrary from './editTextLibrary.vue'
import textLibraryInfo from './textLibraryInfo.vue'
import updateFile from './updateFile.vue'
import updateLog from './updateLog.vue'
import UpdateLog from './updateLog.vue'
import condition from './condition.vue'
export default {
components: { UpdateLog, Pagination, editTextLibrary, textLibraryInfo, updateFile, updateLog, condition },
directives: { waves },
data() {
return {
config: config,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
total: 0,
form: {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
},
label_name: '',
varList: [],
pd: [],
isEdit: false,
isLook: false,
title: ''
}
},
created() {
this.getList()
},
methods: {
getRowKey(row) {
return row.BLACKSPOT_ID
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
addCondition() {
this.$refs.condition.init()
},
getCondition(info) {
this.form.CATEGORY_LIST = info.CATEGORY_LIST
this.form.TYPES = info.TYPES
this.form.SPECIFICATION_TYPES = info.SPECIFICATION_TYPES
this.form.labels = info.LABELS
},
clearMessage() {
this.label_name = ''
this.form = {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
}
this.$refs.condition.clear()
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/textLibrary/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.form.KEYWORDS,
CATEGORY_LIST: JSON.stringify(this.form.CATEGORY_LIST),
TYPES: JSON.stringify(this.form.TYPES),
SPECIFICATION_TYPES: JSON.stringify(this.form.SPECIFICATION_TYPES),
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '1',
CORPINFO_ID: '0'
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.title = '新增'
this.$refs.editTextLibrary.init()
},
handleEdit(e) {
this.title = '编辑'
this.$refs.editTextLibrary.init({ e: e, isEdit: true })
},
getInformation(e) {
this.$refs.textLibraryInfo.init({ e: e })
},
handleDelete(e) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/delete',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
if (data.code === '0') {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
} else {
this.listLoading = false
this.$message.error(data.errorMessage)
}
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleLock(e, flag) {
this.$confirm(flag === '1' ? '确定要锁定吗?' : '确定要解锁吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/lock',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isLock: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleTop(e, flag) {
this.$confirm(flag === '1' ? '确定要置顶吗?' : '确定要取消置顶吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/top',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isTop: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleExport(e) {
this.$confirm('确定要导出文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (e.MIGRATION_FLAG === '1') {
window.open(config.fileUrl + e.PATH)
} else {
window.open(e.PATH)
}
}).catch((e) => {
console.log(e)
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const _ids = _selectData.filter((item, index) => {
return item.LOCKTOOL
})
if (_ids.length > 0) {
this.$message.error('选中的数据有锁定数据,请重新选择')
return
}
const ids = _selectData.map((item, index) => {
return item.BUS_TEXT_LIBRARY_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'textlibraryTwo:add,textlibraryTwo:del,textlibraryTwo:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.textlibraryTwofhadminadd //
this.del = data.textlibraryTwofhadmindel //
this.edit = data.textlibraryTwofhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
if (row.ISTOPTIME) {
return 'warning-row'
}
},
saveClose(e) {
this.getList()
},
openUpdateFile(row) {
this.$refs.updateFile.init(row)
},
openUpdateLog(row) {
this.$refs.updateLog.init(row)
},
setStatus(row, status) {
this.listLoading = true
this.$confirm('是否更改状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/textLibrary/setStatus',
{
BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID,
STATUS: status
}
).then((data) => {
this.listLoading = false
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
this.listLoading = false
})
},
handleCopy(row) {
this.$confirm('确定要将此条数据添加到本地', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.copyInfo(row)
}).catch((e) => {
console.log(e)
this.$message({
type: 'info',
message: '已取消添加'
})
})
},
copyInfo(row) {
requestFN(
'/textLibrary/copyToOperate?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID }
).then((data) => {
if (data.code === '0') {
this.$message.success('添加成功')
} else {
this.$message.success('添加失败')
}
}).catch((e) => {
this.$message.success('添加失败')
})
},
enterSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.createTips(event, row, '数据已置顶')
}
},
leaveSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.removeTips(row)
}
},
createTips(el, row, value) {
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDom = document.createElement('div')
tooltipDom.style.cssText = `
display: inline-block;
max-width: 400px;
max-height: 400px;
position: absolute;
top: ${el.clientY + 5}px;
left: ${el.clientX}px;
padding:5px 10px;
overflow: auto;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #595959;
background: #fff;
border-radius: 5px;
z-index: 19999;
box-shadow: 0 4px 12px 1px #ccc;
`
tooltipDom.innerHTML = value
tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`)
// body
document.body.appendChild(tooltipDom)
},
removeTips(row) {
console.log(row, 'row')
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`)
if (tooltipDomLeave.length) {
tooltipDomLeave.forEach(dom => {
document.body.removeChild(dom)
})
}
}
}
}
</script>

View File

@ -0,0 +1,503 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form label-width="50px">
<el-row>
<el-col :span="6">
<el-form-item label="安全生产管理制度名称:" label-width="200px">
<el-input v-model="form.KEYWORDS" placeholder="请输入" class="filter-item"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="addCondition">
添加其他搜索条件
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="clearMessage">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:row-key="getRowKey"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
:row-class-name="tableRowClassName"
tooltip-effect="dark"
border
fit
highlight-current-row
@cell-mouse-enter="enterSelectionRows"
@cell-mouse-leave="leaveSelectionRows">
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"
/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column align="center" prop="REMARKS" label="安全生产管理制度名称" />
<el-table-column align="center" prop="TYPES" label="类型" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="LABEL" align="center" label="标签" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="SPECIFICATION_TYPES" label="国民经济行业类型" width="300px">
<template slot-scope="{row}">
<div v-if="row.SPECIFICATION_TYPES && row.SPECIFICATION_TYPES.length > 0">
<el-tag
v-for="tag in row.SPECIFICATION_TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</div>
<div v-else>
<el-tag type="warning">通用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="UPLOAD_TIME" label="上传时间" width="90px"/>
<el-table-column v-if="false" :show-overflow-tooltip="true" align="center" prop="UPLOAD_USER_NAME" width="100px" label="数据来源" >
<template slot-scope="{row}">
{{ !row.CORP_NAME ? '资源库数据' : row.CORP_NAME }}
</template>
</el-table-column> <el-table-column label="" align="center" width="200px">
<template slot-scope="{row}">
<el-row>
<el-col :span="24" style="padding-bottom: 10px">
<el-button type="info" icon="el-icon-view" size="mini" @click="getInformation(row)"></el-button>
<el-button type="warning" icon="el-icon-printer" size="mini" @click="handleExport(row)"></el-button>
</el-col>
<el-col :span="24">
<el-button v-if="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button v-if="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row)"></el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-if="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<edit-text-library ref="editTextLibrary" :title="title" @logical-end="saveClose"/>
<text-library-info ref="textLibraryInfo"/>
<update-file ref="updateFile"/>
<update-log ref="updateLog"/>
<condition ref="condition" have-corp-flag @getResult="getCondition"/>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import editTextLibrary from './editTextLibrary.vue'
import textLibraryInfo from './textLibraryInfo.vue'
import updateFile from './updateFile.vue'
import updateLog from './updateLog.vue'
import UpdateLog from './updateLog.vue'
import condition from './condition.vue'
export default {
components: { UpdateLog, Pagination, editTextLibrary, textLibraryInfo, updateFile, updateLog, condition },
directives: { waves },
data() {
return {
config: config,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
total: 0,
form: {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
},
label_name: '',
varList: [],
pd: [],
isEdit: false,
isLook: false,
title: ''
}
},
created() {
this.getList()
},
methods: {
getRowKey(row) {
return row.BLACKSPOT_ID
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
addCondition() {
this.$refs.condition.init()
},
getCondition(info) {
this.form.CATEGORY_LIST = info.CATEGORY_LIST
this.form.TYPES = info.TYPES
this.form.SPECIFICATION_TYPES = info.SPECIFICATION_TYPES
this.form.labels = info.LABELS
this.form.CORPINFO_ID = info.CORPINFO_ID
},
clearMessage() {
this.label_name = ''
this.form = {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
}
this.$refs.condition.clear()
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/textLibrary/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.form.KEYWORDS,
CATEGORY_LIST: JSON.stringify(this.form.CATEGORY_LIST),
TYPES: JSON.stringify(this.form.TYPES),
SPECIFICATION_TYPES: JSON.stringify(this.form.SPECIFICATION_TYPES),
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '1',
ENTERPRISE_SIDE: '0',
CORPINFO_ID: this.form.CORPINFO_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.title = '新增'
this.$refs.editTextLibrary.init()
},
handleEdit(e) {
this.title = '编辑'
this.$refs.editTextLibrary.init({ e: e, isEdit: true })
},
getInformation(e) {
this.$refs.textLibraryInfo.init({ e: e })
},
handleDelete(e) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/delete',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
if (data.code === '0') {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
} else {
this.listLoading = false
this.$message.error(data.errorMessage)
}
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleLock(e, flag) {
this.$confirm(flag === '1' ? '确定要锁定吗?' : '确定要解锁吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/lock',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isLock: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleTop(e, flag) {
this.$confirm(flag === '1' ? '确定要置顶吗?' : '确定要取消置顶吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/top',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isTop: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleExport(e) {
this.$confirm('确定要导出文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (e.MIGRATION_FLAG === '1') {
window.open(config.fileUrl + e.PATH)
} else {
window.open(e.PATH)
}
}).catch((e) => {
console.log(e)
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const _ids = _selectData.filter((item, index) => {
return item.LOCKTOOL
})
if (_ids.length > 0) {
this.$message.error('选中的数据有锁定数据,请重新选择')
return
}
const ids = _selectData.map((item, index) => {
return item.BUS_TEXT_LIBRARY_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'textlibraryTwo:add,textlibraryTwo:del,textlibraryTwo:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.textlibraryTwofhadminadd //
this.del = data.textlibraryTwofhadmindel //
this.edit = data.textlibraryTwofhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
if (row.ISTOPTIME) {
return 'warning-row'
}
},
saveClose(e) {
this.getList()
},
openUpdateFile(row) {
this.$refs.updateFile.init(row)
},
openUpdateLog(row) {
this.$refs.updateLog.init(row)
},
setStatus(row, status) {
this.listLoading = true
this.$confirm('是否更改状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/textLibrary/setStatus',
{
BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID,
STATUS: status
}
).then((data) => {
this.listLoading = false
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
this.listLoading = false
})
},
enterSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.createTips(event, row, '数据已置顶')
}
},
leaveSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.removeTips(row)
}
},
createTips(el, row, value) {
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDom = document.createElement('div')
tooltipDom.style.cssText = `
display: inline-block;
max-width: 400px;
max-height: 400px;
position: absolute;
top: ${el.clientY + 5}px;
left: ${el.clientX}px;
padding:5px 10px;
overflow: auto;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #595959;
background: #fff;
border-radius: 5px;
z-index: 19999;
box-shadow: 0 4px 12px 1px #ccc;
`
tooltipDom.innerHTML = value
tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`)
// body
document.body.appendChild(tooltipDom)
},
removeTips(row) {
console.log(row, 'row')
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`)
if (tooltipDomLeave.length) {
tooltipDomLeave.forEach(dom => {
document.body.removeChild(dom)
})
}
}
}
}
</script>

View File

@ -0,0 +1,146 @@
<template>
<el-dialog v-loading="loading" v-if="dialogVisible" :visible.sync="dialogVisible" title="详情">
<el-form ref="form" :model="form" label-width="180px">
<el-form-item label="安全管理制度名称:" prop="FILE_NAME">
<el-input v-model="form.REMARKS" disabled style="width: 70%"/>
</el-form-item>
<el-form-item label="规程属性:" prop="FILE_NAME">
<el-tag
v-for="tag in form.CATEGORY_LIST"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item label="类型:" prop="FILE_NAME">
<el-tag
v-for="tag in form.TYPES"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item v-if="remoteControl.keyOne" label="国民经济行业类型:" prop="FILE_NAME">
<el-tag v-for="tag in form.SPECIFICATION_TYPES" :key="tag.value" :disable-transitions="false" style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item label="上传时间:" prop="FILE_NAME">
<el-input v-model="form.UPLOAD_TIME" disabled style="width: 70%"/>
</el-form-item>
<el-form-item label="上传人:" prop="FILE_NAME">
<el-input v-model="form.UPLOAD_USER_NAME" disabled style="width: 70%"/>
</el-form-item>
<el-form-item prop="tags" label="标签:">
<el-tag
v-for="tag in form.labels"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.NAME }}
</el-tag>
</el-form-item>
<el-form-item label="文件详情:">
<el-button size="small" type="primary" @click="openTextEdit({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID})"></el-button>
<el-button size="small" type="primary" @click="exportWord({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID})">word</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
</div>
<text-editing ref="textEditing" :disabled="true" append-to-body title="文本编辑器"/>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { requestFN } from '@/utils/request'
import TextEditing from '../../../util/textEditing.vue'
export default {
components: { TextEditing, Pagination },
directives: { waves },
data() {
return {
config: config,
dialogVisible: false,
form: {
BUS_TEXT_LIBRARY_ID: '',
FILE_NAME: '',
FILE: [],
TYPE: '',
labels: [],
UPLOAD_TIME: '',
UPLOAD_USER_NAME: ''
},
loading: false,
remoteControl: {
keyOne: true
}
}
},
methods: {
init(e) {
this.dialogVisible = true
this.loading = true
this.e = e.e
requestFN(
'/textLibrary/goEdit',
{
BUS_TEXT_LIBRARY_ID: this.e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
this.loading = false
this.form = data.data
this.form.FILE = []
this.remoteControl.keyOne = !(this.form.CATEGORY_LIST[0].CATEGORY_ID === '691346658ed744a1bda2ed3a755f606c')
}).catch((e) => {
this.$message.error(e)
this.loading = false
})
},
goBack() {
this.dialogVisible = false
this.$emit('goBack', this.e)
},
openTextEdit(id) {
this.loading = true
requestFN('textLibrary/getTextInfo', id)
.then((data) => {
if (data.info && data.info.TEXT_INFO && data.info.TEXT_INFO !== '') {
this.$refs.textEditing.init({ text: data.info.TEXT_INFO })
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
},
exportWord(info) {
this.loading = true
requestFN('textLibrary/getTextInfo', info)
.then((data) => {
if (data.info) {
if ((!data.info) || data.info.TEXT_INFO === '') {
this.$message.error('没有文件导出')
} else {
this.$message.success('导出成功')
window.open(config.httpurl + '/textLibrary/exportWord?BUS_TEXT_LIBRARY_ID=' + info.BUS_TEXT_LIBRARY_ID)
}
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,77 @@
<template>
<el-dialog v-loading="loading" v-if="visible" :visible.sync="visible" title="替换">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item label="文件:" prop="FILE">
<upload-file :file-list.sync="form.FILE" :limit="1" :file-size="200" append-to-body accept=".pdf"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { upload } from '@/utils/upload'
import uploadFile from '../../../../components/UploadFile/index.vue'
export default {
components: { Pagination, uploadFile },
directives: { waves },
data() {
return {
visible: false,
form: {
FILE: [],
BUS_TEXT_LIBRARY_ID: ''
},
rules: {
FILE: [{ required: true, message: '请选择文件', trigger: 'blur' }]
},
loading: false
}
},
methods: {
init(e) {
this.visible = true
this.form.BUS_TEXT_LIBRARY_ID = e.BUS_TEXT_LIBRARY_ID
},
goBack() {
this.form = {
FILE: [],
BUS_TEXT_LIBRARY_ID: ''
}
this.visible = false
},
save() {
const loading = this.$loading({
lock: true,
text: '上传中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const formData = new FormData()
for (let i = 0; i < this.form.FILE.length; i++) {
if (this.form.FILE[i].raw) {
formData.append('FILE', this.form.FILE[i].raw)
}
}
formData.append('BUS_TEXT_LIBRARY_ID', this.form.BUS_TEXT_LIBRARY_ID)
upload(
'/textLibrary/updateFile',
formData
).then((data) => {
loading.close()
this.visible = false
this.$emit('logical-end', { result: 'OK' })
}).catch((e) => {
loading.close()
console.log(e)
})
}
}
}
</script>

View File

@ -0,0 +1,55 @@
<template>
<el-dialog v-loading="loading" v-if="visible" :visible.sync="visible" title="替换">
<el-table :data="list">
<el-table-column prop="CREATE_TIME" label="日期"/>
<el-table-column prop="CREATOR_NAME" label="姓名"/>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { requestFN } from '@/utils/request'
export default {
components: { Pagination },
directives: { waves },
data() {
return {
visible: false,
list: [],
loading: false,
id: ''
}
},
methods: {
init(e) {
this.visible = true
this.id = e.BUS_TEXT_LIBRARY_ID
this.getList()
},
goBack() {
this.list = []
this.visible = false
},
getList() {
this.loading = true
requestFN(
'/textLibrary/getUpdateLog',
{
BUS_TEXT_LIBRARY_ID: this.id
}
).then((data) => {
this.loading = false
this.list = data.list
}).catch((e) => {
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,19 @@
<template>
<div>
<List v-if="activeName==='List'" ref="list" />
<Dashboard v-if="activeName==='Dashboard'" ref="Dashboard"/>
</div>
</template>
<script>
import List from './components/list.vue'
import Dashboard from './components/dashboard.vue'
export default {
components: { List, Dashboard },
data() {
return {
activeName: 'Dashboard'
}
}
}
</script>

View File

@ -0,0 +1,188 @@
<template>
<el-drawer
v-if="visible"
ref="drawer"
:visible.sync="visible"
:before-close="close"
title="搜索条件"
size="50%">
<div style="margin-left: 30px">
<el-form ref="form" label-width="200px">
<el-form-item label="规程属性:" prop="CATEGORY_LIST">
<multiple-choice :dynamic-tags.sync="form.CATEGORY_LIST" :labels="categoryList" :row-key="key.categoryKey" :row-name="key.categoryName" title="选择"/>
</el-form-item>
<el-form-item label="类型:" prop="TYPES">
<multiple-choice :dynamic-tags.sync="form.TYPES" :labels="typeList" :row-key="key.typeKey" :row-name="key.typeName" title="选择"/>
</el-form-item>
<el-form-item label="国民经济行业类型:" prop="SPECIFICATION_TYPES">
<multiple-choice :dynamic-tags.sync="form.SPECIFICATION_TYPES" :labels="industryTypeList" :row-key="key.specificationTypeKey" :row-name="key.specificationTypeName" lazy title="选择"/>
</el-form-item>
<el-form-item label="标签:" prop="LABELS">
<multiple-choice :dynamic-tags.sync="form.LABELS" :row-key="key.labelsKey" :row-name="key.labelsName" title="选择"/>
</el-form-item>
<el-form-item v-if="false" label="企业:">
<el-select
v-model="form.CORPINFO_ID"
:remote-method="searchCorp"
:loading="selectLoading"
filterable
remote
reserve-keyword
placeholder="请输入关键词">
<el-option
v-for="item in corp_list"
:key="item.CORPINFO_ID"
:label="item.CORP_NAME"
:value="item.CORPINFO_ID"/>
</el-select>
</el-form-item>
</el-form>
<div>
<el-button @click="closePanel"> </el-button>
<el-button :loading="loading" type="primary" @click="submit">{{ loading ? ' ...' : ' ' }}</el-button>
</div>
</div>
</el-drawer>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import waves from '@/directive/waves' // waves directive
import { videoPlayer } from 'vue-video-player'
import 'video.js/dist/video-js.css'
import multipleChoice from '../../../util/multipleChoice.vue'
import { requestFN } from '@/utils/request'
export default {
components: { multipleChoice, Pagination, videoPlayer },
directives: { waves },
props: {
haveCorpFlag: {
type: Boolean,
default: false
}
},
data() {
return {
visible: false,
loading: false,
key: {
typeKey: 'DICTIONARIES_ID',
typeName: 'NAME',
specificationTypeKey: 'DICTIONARIES_ID',
specificationTypeName: 'NAME',
categoryKey: 'DICTIONARIES_ID',
categoryName: 'NAME',
labelsKey: 'BUS_LABEL_FACTORY_ID',
labelsName: 'NAME'
},
typeList: [],
industryTypeList: [],
categoryList: [],
form: {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: [''],
CORPINFO_ID: ''
},
corp_list: [],
selectLoading: false
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getDic()
},
methods: {
init(tags) {
this.visible = true
},
close(done) {
this.$confirm('确认关闭?')
.then(_ => {
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: ['']
}
done()
})
.catch(e => {})
},
closePanel() {
this.visible = false
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: ['']
}
},
submit() {
this.$emit('getResult', this.form)
this.visible = false
},
getDic() {
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '5a7c94b2b9514285b433759edd848b4a' }
).then((data) => {
this.typeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'f2598ba72e864eadabf0ca4b664d26b9' }
).then((data) => {
this.industryTypeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '84254cb5b2ae40eb9f451509b2d370ae' }
).then((data) => {
this.categoryList = data.list
}).catch((e) => {
this.loading = false
})
},
clear() {
this.form = {
CATEGORY_LIST: [''],
TYPES: [''],
SPECIFICATION_TYPES: [''],
LABELS: [''],
TTRIBUTE_LIST: [''],
CORPINFO_ID: ''
}
},
searchCorp(query) {
if (query !== '') {
this.selectLoading = true
requestFN(
'corpinfo/list', { KEYWORDS: query }
).then((data) => {
this.corp_list = data.varList
this.selectLoading = false
}).catch((e) => {
console.log(e)
this.selectLoading = false
})
}
}
}
}
</script>
<style scoped>
.information >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<div class="app-container">
<el-tabs type="border-card" @tab-click="changTab">
<el-tab-pane label="安全生产责任制">
<ListEm v-if="vectory === 'listEm'"/>
</el-tab-pane>
<el-tab-pane label="安全生产责任制平台资源库">
<list v-if="vectory === 'list'"/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import waves from '@/directive/waves'
import List from '../../safetyProductionResponsibilitySystem/components/list.vue'
import ListEm from './listEm.vue'
export default {
components: { List, Pagination, ListEm },
directives: { waves },
data() {
return {
vectory: 'listEm'
}
},
created() {
},
methods: {
changTab(title) {
console.log(title.label)
if (title.label === '安全生产责任制平台资源库') { this.vectory = 'list' }
if (title.label === '安全生产责任制') { this.vectory = 'listEm' }
}
}
}
</script>

View File

@ -0,0 +1,390 @@
<template>
<el-dialog v-loading="loading" v-if="dialogVisible" :visible.sync="dialogVisible" :title="title" destroy-on-close @close="clear">
<el-form ref="form" :model="form" :rules="rules" label-width="180px">
<el-form-item v-if="false" label="规程属性:" prop="CATEGORY_LIST">
<multiple-choice :dynamic-tags.sync="form.CATEGORY_LIST" :labels="categoryList" :row-key="key.categoryKey" :row-name="key.categoryName" :limit="1" @getChooseOne="getChooseOne"/>
</el-form-item>
<el-form-item label="安全生产责任制名称:" prop="REMARKS">
<el-input v-model="form.REMARKS" style="width: 100%"/>
</el-form-item>
<el-form-item label="类型:" prop="TYPES">
<multiple-choice :dynamic-tags.sync="form.TYPES" :labels="typeList" :row-key="key.typeKey" :row-name="key.typeName"/>
</el-form-item>
<el-form-item v-if="false" label="国民经济行业类型:" prop="SPECIFICATION_TYPES">
<multiple-choice :dynamic-tags.sync="form.SPECIFICATION_TYPES" :labels="industryTypeList" :row-key="key.specificationTypeKey" :row-name="key.specificationTypeName" lazy/>
</el-form-item>
<el-form-item v-if="false" label="状态:" prop="STATUS">
<el-select v-model="form.STATUS" placeholder="请选择" style="width: 100%;">
<el-option label="停用" value="0"/>
<el-option label="启用" value="1"/>
</el-select>
</el-form-item>
<el-form-item v-if="!isEdit" label="文件:" prop="FILE">
<upload-file :file-list.sync="form.FILE" :limit="1" :file-size="200" append-to-body accept=".pdf"/>
</el-form-item>
<el-form-item v-if="!isEdit" label="添加文件内容:">
<el-button size="small" type="primary" @click="openTextEdit()"></el-button>
</el-form-item>
<el-form-item v-if="isEdit" label="添加文件内容:">
<el-button size="small" type="primary" @click="openTextEdit({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID},true)"></el-button>
<el-button size="small" type="primary" @click="openTextEdit({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID},false)"></el-button>
<el-button size="small" type="primary" @click="exportWord(form)">word</el-button>
</el-form-item>
<el-form-item label="标签:" prop="labels">
<multiple-choice :dynamic-tags.sync="form.labels" :row-key="key.labelsKey" :row-name="key.labelsName" can-add/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
<edit-label ref="editLabel" append-to-body/>
<select-label ref="selectLabel" append-to-body @getResult="getChooseTage"/>
<select-type ref="selectType" :limit="1" append-to-body @getResult="getType"/>
<text-editing ref="textEditing" :disabled="textDisabled" append-to-body title="文本编辑器" @getResult="getText"/>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { upload } from '@/utils/upload'
import { requestFN } from '@/utils/request'
import editLabel from '../../../Label/components/editLabel.vue'
import selectLabel from '../../../Label/components/selectLable.vue'
import selectType from '../../../util/selectType.vue'
import multipleChoice from '../../../util/multipleChoice.vue'
import UploadFile from '../../../../components/UploadFile/index.vue'
import TextEditing from '../../../util/textEditing.vue'
export default {
components: { TextEditing, Pagination, editLabel, selectLabel, selectType, multipleChoice, UploadFile },
directives: { waves },
props: {
title: {
type: String,
default: ''
}
},
data() {
return {
dialogVisible: false,
form: {
REMARKS: '',
FILE: [],
labels: [''],
TYPE: '',
TYPES: [''],
SPECIFICATION_TYPES: [''],
CATEGORY_LIST: [''],
STATUS: '',
ASSOCIATION: '2',
types: [],
specification_types: [],
category_list: [],
TEXT_INFO: ''
},
key: {
typeKey: 'DICTIONARIES_ID',
typeName: 'NAME',
specificationTypeKey: 'DICTIONARIES_ID',
specificationTypeName: 'NAME',
categoryKey: 'DICTIONARIES_ID',
categoryName: 'NAME',
labelsKey: 'BUS_LABEL_FACTORY_ID',
labelsName: 'NAME'
},
rules: {
REMARKS: [{ required: true, message: '请输安全操作规程', trigger: 'change' }],
STATUS: [{ required: true, message: '请选择状态', trigger: 'change' }],
FILE: [{ required: true, message: '请选择文件', trigger: 'blur' }],
TYPES: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('类型必选'))
}
return callback()
},
trigger: 'blur'
}],
SPECIFICATION_TYPES: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('操作规程行业类型必选'))
}
return callback()
},
trigger: 'blur'
}],
CATEGORY_LIST: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('规程属性必选'))
}
return callback()
},
trigger: 'blur'
}]
},
loading: false,
e: {},
isEdit: false,
typeList: [],
industryTypeList: [],
categoryList: [],
remoteControl: {
keyOne: true
},
textDisabled: false
}
},
methods: {
init(e) {
this.dialogVisible = true
this.e = e ? e.e : {}
this.isEdit = e ? e.isEdit : false
this.getDic()
if (e) {
this.loading = true
requestFN(
'/textLibrary/goEdit',
{ BUS_TEXT_LIBRARY_ID: this.e.BUS_TEXT_LIBRARY_ID }
).then((data) => {
this.loading = false
this.form = data.data
this.form.FILE = []
this.form.types = []
this.form.specification_types = []
this.form.category_list = []
if (!this.form.TYPES || this.form.TYPES.length === 0) this.form.TYPES = ['']
if (!this.form.SPECIFICATION_TYPES || this.form.SPECIFICATION_TYPES.length === 0) this.form.SPECIFICATION_TYPES = ['']
if (!this.form.CATEGORY_LIST || this.form.CATEGORY_LIST.length === 0) this.form.CATEGORY_LIST = ['']
if (!this.form.labels || this.form.labels.length === 0) this.form.labels = ['']
this.remoteControl.keyOne = !(this.form.CATEGORY_LIST[0].CATEGORY_ID === '7158f688d0f34054a28a9275139298df')
}).catch((e) => {
this.$message.error(e)
this.loading = false
})
} else {
this.isEdit = false
}
},
save() {
if (this.checkForm()) {
return
}
this.$refs.form.validate((valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '上传中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const formData = new FormData()
if (this.form.TEXT_INFO) this.form.TEXT_INFO = this.form.TEXT_INFO.replaceAll('<img', '<img style="max-width:100%"')
Object.keys(this.form).map(key => {
formData.append(key, this.form[key])
})
if (!this.isEdit) {
if (!this.form.FILE || this.form.FILE.length <= 0) {
this.$message.error('请上传文件')
loading.close()
return
}
}
for (let i = 0; i < this.form.FILE.length; i++) {
if (this.form.FILE[i].raw) {
formData.append('FILE', this.form.FILE[i].raw)
}
}
formData.append('labels', JSON.stringify(this.form.labels))
for (let i = 0; i < this.form.TYPES.length; i++) {
if (this.form.TYPES[i]) {
this.form.types.push({
CATEGORY: 'TYPES',
CATEGORY_ID: this.form.TYPES[i].DICTIONARIES_ID,
CATEGORY_NAME: this.form.TYPES[i].NAME
})
}
}
formData.append('TYPES', JSON.stringify(this.form.types))
for (let i = 0; i < this.form.SPECIFICATION_TYPES.length; i++) {
if (this.form.SPECIFICATION_TYPES[i]) {
this.form.specification_types.push({
CATEGORY: 'SPECIFICATION_TYPES',
CATEGORY_ID: this.form.SPECIFICATION_TYPES[i].DICTIONARIES_ID,
CATEGORY_NAME: this.form.SPECIFICATION_TYPES[i].NAME
})
}
}
formData.append('SPECIFICATION_TYPES', JSON.stringify(this.form.specification_types))
if (!this.form.category_list) this.form.category_list = []
this.form.category_list.push({
CATEGORY: 'CATEGORY_LIST',
CATEGORY_ID: '7158f688d0f34054a28a9275139298df',
CATEGORY_NAME: '行业专属类'
})
formData.append('CATEGORY_LIST', JSON.stringify(this.form.category_list))
upload(
'/textLibrary/init',
formData
).then((data) => {
loading.close()
this.dialogVisible = false
this.$emit('logical-end', { result: 'OK' })
this.$message.success('保存成功')
}).catch((e) => {
loading.close()
console.log(e)
})
this.clear()
} else {
return false
}
})
},
checkForm() {
if (this.form.labels.length > 15) {
this.$message.error('关联标签数不能超过15个')
return true
}
},
goBack() {
this.dialogVisible = false
this.clear()
this.$emit('goBack', this.e)
},
getChooseTage(e) {
if (e.TYPE === '0') {
const list = e.e
for (const listKey in list) {
const index = this.form.labels.findIndex(item => {
item.BUS_LABEL_FACTORY_ID === list[listKey].BUS_LABEL_FACTORY_ID
})
if (index < 0) {
const label = JSON.parse(JSON.stringify(list[listKey]))
label.label = label.NAME
label.value = JSON.stringify(list[listKey])
const index = this.form.labels.findIndex(item => item.value === label.value)
if (index < 0) {
this.form.labels.push(label)
}
}
}
} else {
if (e.e.length > 1) {
this.$message.error('只能选择一个类型')
return
}
this.form.TYPE_NAME = e.e[0].NAME
this.form.TYPE = e.e[0].BUS_LABEL_FACTORY_ID
this.$forceUpdate()
}
},
getType(e) {
this.form.TYPE = e.info[0].DICTIONARIES_ID
this.form.TYPE_NAME = e.info[0].NAME
},
clear() {
this.isEdit = false
this.form = {
REMARKS: '',
FILE: [],
labels: [''],
TYPE: '',
TYPES: [''],
SPECIFICATION_TYPES: [''],
STATUS: '',
ASSOCIATION: '2',
types: [],
specification_types: []
}
},
getDic() {
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '5a7c94b2b9514285b433759edd848b4a' }
).then((data) => {
this.typeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'f2598ba72e864eadabf0ca4b664d26b9' }
).then((data) => {
this.industryTypeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '84254cb5b2ae40eb9f451509b2d370ae' }
).then((data) => {
this.categoryList = data.list
}).catch((e) => {
this.loading = false
})
},
getChooseOne(e) {
this.remoteControl.keyOne = !(e && e.info && e.info.DICTIONARIES_ID && e.info.DICTIONARIES_ID === '7158f688d0f34054a28a9275139298df')
},
openTextEdit(id, textDisabled) {
if (!id) {
this.textDisabled = false
this.$refs.textEditing.init({ text: this.form.TEXT_INFO })
} else {
this.textDisabled = textDisabled
this.loading = true
requestFN('textLibrary/getTextInfo', id)
.then((data) => {
if (data.info && data.info.TEXT_INFO && data.info.TEXT_INFO !== '') {
this.$refs.textEditing.init({ text: data.info.TEXT_INFO })
} else {
if (((!this.form.TEXT_INFO) || this.form.TEXT_INFO === '') && this.textDisabled) {
this.$message.error('此数据未维护文件内容')
} else {
this.$refs.textEditing.init({ text: this.form.TEXT_INFO })
}
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
},
getText(e) {
this.form.TEXT_INFO = e.text
},
exportWord(info) {
this.loading = true
requestFN('textLibrary/getTextInfo', info)
.then((data) => {
if (data.info) {
if ((!data.info) || data.info.TEXT_INFO === '') {
this.$message.error('没有文件导出')
} else {
this.$message.success('导出成功')
window.open(config.httpurl + '/textLibrary/exportWord?BUS_TEXT_LIBRARY_ID=' + info.BUS_TEXT_LIBRARY_ID)
}
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,526 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form label-width="50px">
<el-row>
<el-col :span="6">
<el-form-item label="安全生产责任制名称:" label-width="150px">
<el-input v-model="form.KEYWORDS" placeholder="请输入" class="filter-item"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="addCondition">
添加其他搜索条件
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="clearMessage">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:row-key="getRowKey"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
:row-class-name="tableRowClassName"
tooltip-effect="dark"
border
fit
highlight-current-row
@cell-mouse-enter="enterSelectionRows"
@cell-mouse-leave="leaveSelectionRows">
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"
/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column align="center" prop="REMARKS" label="安全生产责任制名称" />
<el-table-column align="center" prop="TYPES" label="类型" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="LABEL" label="标签" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="SPECIFICATION_TYPES" label="国民经济行业类型" width="300px">
<template slot-scope="{row}">
<div v-if="(row.SPECIFICATION_TYPES && row.SPECIFICATION_TYPES.length > 0) && ((!row.CATEGORY_LIST) || (!row.CATEGORY_LIST[0]) || (row.CATEGORY_LIST[0].CATEGORY_ID !== '7158f688d0f34054a28a9275139298df'))">
<el-tag
v-for="tag in row.SPECIFICATION_TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</div>
<div v-else>
<el-tag type="warning">通用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="UPLOAD_TIME" label="上传时间" width="90px"/>
<el-table-column v-if="false" :show-overflow-tooltip="true" align="center" prop="UPLOAD_USER_NAME" width="100px" label="数据来源" >
<template slot-scope="{row}">
{{ !row.CORP_NAME ? '资源库数据' : row.CORP_NAME }}
</template>
</el-table-column> <el-table-column label="" align="center" width="200px">
<template slot-scope="{row}">
<el-row>
<el-col :span="14">
<el-button v-show="!row.LOCKTOOL" type="primary" icon="el-icon-edit" size="mini" @click="handleCopy(row)"></el-button>
</el-col>
<el-col :span="10">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="getInformation(row)"></el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<edit-text-library ref="editTextLibrary" :title="title" @logical-end="saveClose"/>
<text-library-info ref="textLibraryInfo"/>
<update-file ref="updateFile"/>
<update-log ref="updateLog"/>
<condition ref="condition" @getResult="getCondition"/>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import editTextLibrary from './editTextLibrary.vue'
import textLibraryInfo from './textLibraryInfo.vue'
import updateFile from './updateFile.vue'
import updateLog from './updateLog.vue'
import UpdateLog from './updateLog.vue'
import condition from './condition.vue'
export default {
components: { UpdateLog, Pagination, editTextLibrary, textLibraryInfo, updateFile, updateLog, condition },
directives: { waves },
data() {
return {
config: config,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
total: 0,
form: {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
},
label_name: '',
varList: [],
pd: [],
isEdit: false,
isLook: false,
title: ''
}
},
created() {
this.getList()
},
methods: {
getRowKey(row) {
return row.BLACKSPOT_ID
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
addCondition() {
this.$refs.condition.init()
},
getCondition(info) {
this.form.CATEGORY_LIST = info.CATEGORY_LIST
this.form.TYPES = info.TYPES
this.form.SPECIFICATION_TYPES = info.SPECIFICATION_TYPES
this.form.labels = info.LABELS
},
clearMessage() {
this.label_name = ''
this.form = {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
}
this.$refs.condition.clear()
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/textLibrary/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.form.KEYWORDS,
CATEGORY_LIST: JSON.stringify(this.form.CATEGORY_LIST),
TYPES: JSON.stringify(this.form.TYPES),
SPECIFICATION_TYPES: JSON.stringify(this.form.SPECIFICATION_TYPES),
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '2',
CORPINFO_ID: '0'
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.title = '新增'
this.$refs.editTextLibrary.init()
},
handleEdit(e) {
this.title = '编辑'
this.$refs.editTextLibrary.init({ e: e, isEdit: true })
},
getInformation(e) {
this.$refs.textLibraryInfo.init({ e: e })
},
handleDelete(e) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/delete',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
if (data.code === '0') {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
} else {
this.listLoading = false
this.$message.error(data.errorMessage)
}
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleLock(e, flag) {
this.$confirm(flag === '1' ? '确定要锁定吗?' : '确定要解锁吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/lock',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isLock: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleTop(e, flag) {
this.$confirm(flag === '1' ? '确定要置顶吗?' : '确定要取消置顶吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/top',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isTop: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleExport(e) {
this.$confirm('确定要导出文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (e.MIGRATION_FLAG === '1') {
window.open(config.fileUrl + e.PATH)
} else {
window.open(e.PATH)
}
}).catch((e) => {
console.log(e)
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const _ids = _selectData.filter((item, index) => {
return item.LOCKTOOL
})
if (_ids.length > 0) {
this.$message.error('选中的数据有锁定数据,请重新选择')
return
}
const ids = _selectData.map((item, index) => {
return item.BUS_TEXT_LIBRARY_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'textlibraryThree:add,textlibraryThree:del,textlibraryThree:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.textlibraryThreefhadminadd //
this.del = data.textlibraryThreefhadmindel //
this.edit = data.textlibraryThreefhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
if (row.ISTOPTIME) {
return 'warning-row'
}
},
saveClose(e) {
this.getList()
},
openUpdateFile(row) {
this.$refs.updateFile.init(row)
},
openUpdateLog(row) {
this.$refs.updateLog.init(row)
},
setStatus(row, status) {
this.listLoading = true
this.$confirm('是否更改状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/textLibrary/setStatus',
{
BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID,
STATUS: status
}
).then((data) => {
this.listLoading = false
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
this.listLoading = false
})
},
handleCopy(row) {
this.$confirm('确定要将此条数据添加到本地', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.copyInfo(row)
}).catch((e) => {
console.log(e)
this.$message({
type: 'info',
message: '已取消添加'
})
})
},
copyInfo(row) {
requestFN(
'/textLibrary/copyToOperate?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID }
).then((data) => {
if (data.code === '0') {
this.$message.success('添加成功')
} else {
this.$message.success('添加失败')
}
}).catch((e) => {
this.$message.success('添加失败')
})
},
enterSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.createTips(event, row, '数据已置顶')
}
},
leaveSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.removeTips(row)
}
},
createTips(el, row, value) {
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDom = document.createElement('div')
tooltipDom.style.cssText = `
display: inline-block;
max-width: 400px;
max-height: 400px;
position: absolute;
top: ${el.clientY + 5}px;
left: ${el.clientX}px;
padding:5px 10px;
overflow: auto;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #595959;
background: #fff;
border-radius: 5px;
z-index: 19999;
box-shadow: 0 4px 12px 1px #ccc;
`
tooltipDom.innerHTML = value
tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`)
// body
document.body.appendChild(tooltipDom)
},
removeTips(row) {
console.log(row, 'row')
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`)
if (tooltipDomLeave.length) {
tooltipDomLeave.forEach(dom => {
document.body.removeChild(dom)
})
}
}
}
}
</script>

View File

@ -0,0 +1,503 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form label-width="50px">
<el-row>
<el-col :span="6">
<el-form-item label="安全生产责任制名称:" label-width="150px">
<el-input v-model="form.KEYWORDS" placeholder="请输入" class="filter-item"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="addCondition">
添加其他搜索条件
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="clearMessage">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:row-key="getRowKey"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
:row-class-name="tableRowClassName"
tooltip-effect="dark"
border
fit
highlight-current-row
@cell-mouse-enter="enterSelectionRows"
@cell-mouse-leave="leaveSelectionRows">
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"
/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column align="center" prop="REMARKS" label="安全生产管理制度名称" />
<el-table-column align="center" prop="TYPES" label="类型" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="LABEL" align="center" label="标签" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="SPECIFICATION_TYPES" label="国民经济行业类型" width="300px">
<template slot-scope="{row}">
<div v-if="row.SPECIFICATION_TYPES && row.SPECIFICATION_TYPES.length > 0">
<el-tag
v-for="tag in row.SPECIFICATION_TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</div>
<div v-else>
<el-tag type="warning">通用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="UPLOAD_TIME" label="上传时间" width="90px"/>
<el-table-column v-if="false" :show-overflow-tooltip="true" align="center" prop="UPLOAD_USER_NAME" width="100px" label="数据来源" >
<template slot-scope="{row}">
{{ !row.CORP_NAME ? '资源库数据' : row.CORP_NAME }}
</template>
</el-table-column> <el-table-column label="" align="center" width="200px">
<template slot-scope="{row}">
<el-row>
<el-col :span="24" style="padding-bottom: 10px">
<el-button type="info" icon="el-icon-view" size="mini" @click="getInformation(row)"></el-button>
<el-button type="warning" icon="el-icon-printer" size="mini" @click="handleExport(row)"></el-button>
</el-col>
<el-col :span="24">
<el-button v-if="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button v-if="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row)"></el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-if="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<edit-text-library ref="editTextLibrary" :title="title" @logical-end="saveClose"/>
<text-library-info ref="textLibraryInfo"/>
<update-file ref="updateFile"/>
<update-log ref="updateLog"/>
<condition ref="condition" have-corp-flag @getResult="getCondition"/>
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import editTextLibrary from './editTextLibrary.vue'
import textLibraryInfo from './textLibraryInfo.vue'
import updateFile from './updateFile.vue'
import updateLog from './updateLog.vue'
import UpdateLog from './updateLog.vue'
import condition from './condition.vue'
export default {
components: { UpdateLog, Pagination, editTextLibrary, textLibraryInfo, updateFile, updateLog, condition },
directives: { waves },
data() {
return {
config: config,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
total: 0,
form: {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
},
label_name: '',
varList: [],
pd: [],
isEdit: false,
isLook: false,
title: ''
}
},
created() {
this.getList()
},
methods: {
getRowKey(row) {
return row.BLACKSPOT_ID
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
addCondition() {
this.$refs.condition.init()
},
getCondition(info) {
this.form.CATEGORY_LIST = info.CATEGORY_LIST
this.form.TYPES = info.TYPES
this.form.SPECIFICATION_TYPES = info.SPECIFICATION_TYPES
this.form.labels = info.LABELS
this.form.CORPINFO_ID = info.CORPINFO_ID
},
clearMessage() {
this.label_name = ''
this.form = {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
}
this.$refs.condition.clear()
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/textLibrary/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.form.KEYWORDS,
CATEGORY_LIST: JSON.stringify(this.form.CATEGORY_LIST),
TYPES: JSON.stringify(this.form.TYPES),
SPECIFICATION_TYPES: JSON.stringify(this.form.SPECIFICATION_TYPES),
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '2',
ENTERPRISE_SIDE: '0',
CORPINFO_ID: this.form.CORPINFO_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.title = '新增'
this.$refs.editTextLibrary.init()
},
handleEdit(e) {
this.title = '编辑'
this.$refs.editTextLibrary.init({ e: e, isEdit: true })
},
getInformation(e) {
this.$refs.textLibraryInfo.init({ e: e })
},
handleDelete(e) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/delete',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
if (data.code === '0') {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
} else {
this.listLoading = false
this.$message.error(data.errorMessage)
}
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleLock(e, flag) {
this.$confirm(flag === '1' ? '确定要锁定吗?' : '确定要解锁吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/lock',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isLock: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleTop(e, flag) {
this.$confirm(flag === '1' ? '确定要置顶吗?' : '确定要取消置顶吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/top',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isTop: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleExport(e) {
this.$confirm('确定要导出文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (e.MIGRATION_FLAG === '1') {
window.open(config.fileUrl + e.PATH)
} else {
window.open(e.PATH)
}
}).catch((e) => {
console.log(e)
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const _ids = _selectData.filter((item, index) => {
return item.LOCKTOOL
})
if (_ids.length > 0) {
this.$message.error('选中的数据有锁定数据,请重新选择')
return
}
const ids = _selectData.map((item, index) => {
return item.BUS_TEXT_LIBRARY_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'textlibraryThree:add,textlibraryThree:del,textlibraryThree:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.textlibraryThreefhadminadd //
this.del = data.textlibraryThreefhadmindel //
this.edit = data.textlibraryThreefhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
if (row.ISTOPTIME) {
return 'warning-row'
}
},
saveClose(e) {
this.getList()
},
openUpdateFile(row) {
this.$refs.updateFile.init(row)
},
openUpdateLog(row) {
this.$refs.updateLog.init(row)
},
setStatus(row, status) {
this.listLoading = true
this.$confirm('是否更改状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/textLibrary/setStatus',
{
BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID,
STATUS: status
}
).then((data) => {
this.listLoading = false
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
this.listLoading = false
})
},
enterSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.createTips(event, row, '数据已置顶')
}
},
leaveSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.removeTips(row)
}
},
createTips(el, row, value) {
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDom = document.createElement('div')
tooltipDom.style.cssText = `
display: inline-block;
max-width: 400px;
max-height: 400px;
position: absolute;
top: ${el.clientY + 5}px;
left: ${el.clientX}px;
padding:5px 10px;
overflow: auto;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #595959;
background: #fff;
border-radius: 5px;
z-index: 19999;
box-shadow: 0 4px 12px 1px #ccc;
`
tooltipDom.innerHTML = value
tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`)
// body
document.body.appendChild(tooltipDom)
},
removeTips(row) {
console.log(row, 'row')
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`)
if (tooltipDomLeave.length) {
tooltipDomLeave.forEach(dom => {
document.body.removeChild(dom)
})
}
}
}
}
</script>

View File

@ -0,0 +1,146 @@
<template>
<el-dialog v-loading="loading" v-if="dialogVisible" :visible.sync="dialogVisible" title="详情">
<el-form ref="form" :model="form" label-width="180px">
<el-form-item label="安全生产责任制名称:" prop="FILE_NAME">
<el-input v-model="form.REMARKS" disabled style="width: 70%"/>
</el-form-item>
<el-form-item label="规程属性:" prop="FILE_NAME">
<el-tag
v-for="tag in form.CATEGORY_LIST"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item label="类型:" prop="FILE_NAME">
<el-tag
v-for="tag in form.TYPES"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item v-if="remoteControl.keyOne" label="国民经济行业类型:" prop="FILE_NAME">
<el-tag v-for="tag in form.SPECIFICATION_TYPES" :key="tag.value" :disable-transitions="false" style="margin-right: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</el-form-item>
<el-form-item label="上传时间:" prop="FILE_NAME">
<el-input v-model="form.UPLOAD_TIME" disabled style="width: 70%"/>
</el-form-item>
<el-form-item label="上传人:" prop="FILE_NAME">
<el-input v-model="form.UPLOAD_USER_NAME" disabled style="width: 70%"/>
</el-form-item>
<el-form-item prop="tags" label="标签:">
<el-tag
v-for="tag in form.labels"
:key="tag.value"
:disable-transitions="false"
style="margin-right: 10px">
{{ tag.NAME }}
</el-tag>
</el-form-item>
<el-form-item label="文件详情:">
<el-button size="small" type="primary" @click="openTextEdit({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID})"></el-button>
<el-button size="small" type="primary" @click="exportWord({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID})">word</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
</div>
<text-editing ref="textEditing" :disabled="true" append-to-body title="文本编辑器"/>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { requestFN } from '@/utils/request'
import TextEditing from '../../../util/textEditing.vue'
export default {
components: { TextEditing, Pagination },
directives: { waves },
data() {
return {
config: config,
dialogVisible: false,
form: {
BUS_TEXT_LIBRARY_ID: '',
FILE_NAME: '',
FILE: [],
TYPE: '',
labels: [],
UPLOAD_TIME: '',
UPLOAD_USER_NAME: ''
},
loading: false,
remoteControl: {
keyOne: true
}
}
},
methods: {
init(e) {
this.dialogVisible = true
this.loading = true
this.e = e.e
requestFN(
'/textLibrary/goEdit',
{
BUS_TEXT_LIBRARY_ID: this.e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
this.loading = false
this.form = data.data
this.form.FILE = []
this.remoteControl.keyOne = !(this.form.CATEGORY_LIST[0].CATEGORY_ID === '7158f688d0f34054a28a9275139298df')
}).catch((e) => {
this.$message.error(e)
this.loading = false
})
},
goBack() {
this.dialogVisible = false
this.$emit('goBack', this.e)
},
openTextEdit(id) {
this.loading = true
requestFN('textLibrary/getTextInfo', id)
.then((data) => {
if (data.info && data.info.TEXT_INFO && data.info.TEXT_INFO !== '') {
this.$refs.textEditing.init({ text: data.info.TEXT_INFO })
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
},
exportWord(info) {
this.loading = true
requestFN('textLibrary/getTextInfo', info)
.then((data) => {
if (data.info) {
if ((!data.info) || data.info.TEXT_INFO === '') {
this.$message.error('没有文件导出')
} else {
this.$message.success('导出成功')
window.open(config.httpurl + '/textLibrary/exportWord?BUS_TEXT_LIBRARY_ID=' + info.BUS_TEXT_LIBRARY_ID)
}
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,77 @@
<template>
<el-dialog v-loading="loading" v-if="visible" :visible.sync="visible" title="替换">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item label="文件:" prop="FILE">
<upload-file :file-list.sync="form.FILE" :limit="1" :file-size="200" append-to-body accept=".pdf"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { upload } from '@/utils/upload'
import uploadFile from '../../../../components/UploadFile/index.vue'
export default {
components: { Pagination, uploadFile },
directives: { waves },
data() {
return {
visible: false,
form: {
FILE: [],
BUS_TEXT_LIBRARY_ID: ''
},
rules: {
FILE: [{ required: true, message: '请选择文件', trigger: 'blur' }]
},
loading: false
}
},
methods: {
init(e) {
this.visible = true
this.form.BUS_TEXT_LIBRARY_ID = e.BUS_TEXT_LIBRARY_ID
},
goBack() {
this.form = {
FILE: [],
BUS_TEXT_LIBRARY_ID: ''
}
this.visible = false
},
save() {
const loading = this.$loading({
lock: true,
text: '上传中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const formData = new FormData()
for (let i = 0; i < this.form.FILE.length; i++) {
if (this.form.FILE[i].raw) {
formData.append('FILE', this.form.FILE[i].raw)
}
}
formData.append('BUS_TEXT_LIBRARY_ID', this.form.BUS_TEXT_LIBRARY_ID)
upload(
'/textLibrary/updateFile',
formData
).then((data) => {
loading.close()
this.visible = false
this.$emit('logical-end', { result: 'OK' })
}).catch((e) => {
loading.close()
console.log(e)
})
}
}
}
</script>

View File

@ -0,0 +1,55 @@
<template>
<el-dialog v-loading="loading" v-if="visible" :visible.sync="visible" title="替换">
<el-table :data="list">
<el-table-column prop="CREATE_TIME" label="日期"/>
<el-table-column prop="CREATOR_NAME" label="姓名"/>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { requestFN } from '@/utils/request'
export default {
components: { Pagination },
directives: { waves },
data() {
return {
visible: false,
list: [],
loading: false,
id: ''
}
},
methods: {
init(e) {
this.visible = true
this.id = e.BUS_TEXT_LIBRARY_ID
this.getList()
},
goBack() {
this.list = []
this.visible = false
},
getList() {
this.loading = true
requestFN(
'/textLibrary/getUpdateLog',
{
BUS_TEXT_LIBRARY_ID: this.id
}
).then((data) => {
this.loading = false
this.list = data.list
}).catch((e) => {
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,19 @@
<template>
<div>
<List v-if="activeName==='List'" ref="list" />
<Dashboard v-if="activeName==='Dashboard'" ref="Dashboard"/>
</div>
</template>
<script>
import List from './components/list.vue'
import Dashboard from './components/dashboard.vue'
export default {
components: { List, Dashboard },
data() {
return {
activeName: 'Dashboard'
}
}
}
</script>

View File

@ -0,0 +1,108 @@
<template>
<div>
<el-row>
<el-button type="primary" @click="openTagePanel"></el-button>
<el-button v-if="false" type="primary" @click="creatTage"></el-button>
</el-row>
<template v-for="tag in dynamicTags">
<el-tag
v-if="tag[rowKey]"
:key="tag[rowKey]"
:disable-transitions="false"
closable
style="margin-right: 10px"
@close="tagHandleClose(tag)">
{{ tag[rowName] }}
</el-tag>
</template>
<select-label ref="selectLabel" :lazy="lazy" :load-node="loadNode" append-to-body @getResult="getChooseTage"/>
<edit-label ref="editLabel" append-to-body/>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import waves from '@/directive/waves'
import selectLabel from '../Label/components/selectLable.vue'
import editLabel from '../Label/components/editLabel.vue'
export default {
components: { selectLabel, Pagination, editLabel },
directives: { waves },
props: {
canAdd: {
type: Boolean,
default: false
},
// bug => '',
dynamicTags: {
type: Array,
default: () => ([])
},
labels: {
type: Array,
default: () => ([])
},
lazy: {
type: Boolean,
default: false
},
loadNode: {
type: Function,
default: function() {}
},
rowKey: {
type: String,
default: ''
},
rowName: {
type: String,
default: ''
}
},
data() {
return {
uuid: ''
}
},
methods: {
openTagePanel() {
if (this.labels.length > 0) {
this.$refs.selectLabel.init({ labels: this.labels })
} else {
this.$refs.selectLabel.init({})
}
},
getChooseTage(e) {
const list = e.e
const labelList = []
for (const listKey in list) {
const index = labelList.findIndex(item => { item[this.rowKey] === list[listKey][this.rowKey] })
if (index < 0) {
const label = JSON.parse(JSON.stringify(list[listKey]))
label.label = label.NAME
label.value = JSON.stringify(list[listKey])
const index = labelList.findIndex(item => item.value === label.value)
if (index < 0) {
labelList.push(label)
}
}
}
this.$emit('update:dynamicTags', labelList)
},
creatTage() {
this.$refs.editLabel.init({ TYPE: '0' })
},
tagHandleClose(tag) {
this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1)
if (this.dynamicTags.length === 0) this.dynamicTags.push('')
}
}
}
</script>
<style scoped>
.information >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
</style>

View File

@ -0,0 +1,140 @@
<template>
<el-dialog
v-loading = "loading"
v-if="visible"
:visible.sync="visible"
:before-close="handleClose"
:title="title"
:append-to-body="appendToBody"
width="60%">
<el-input v-model="filterText" placeholder="输入关键字进行过滤"/>
<el-scrollbar class="information" style="height: 500px; margin-top: 10px">
<el-tree
ref="tree"
:data="tree"
:props="defaultProp"
:filter-node-method="filterNode"
:expand-on-click-node="false"
check-strictly
default-expand-all
check-on-click-node
show-checkbox
@node-click="handleNodeClick"/>
</el-scrollbar>
<span slot="footer" class="dialog-footer">
<el-button @click="closeWindow"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</span>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
props: {
title: {
type: String,
default: ''
},
appendToBody: {
type: Boolean,
default: false
},
limit: {
type: Number,
default: 1
}
},
data() {
return {
visible: false,
defaultProp: {
value: 'id',
children: 'nodes',
label: 'name'
},
tree: [],
filterText: '',
heirloom: {},
treeClickCount: 0,
loading: false
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
methods: {
init(e) {
this.heirloom = e
this.visible = true
this.getTree()
},
handleClose() {
this.visible = false
},
getTree() {
this.loading = true
requestFN(
'/department/listTree'
).then((data) => {
this.loading = false
this.tree = JSON.parse(data.zTreeNodes)
if (this.tree[0]) {
this.tree[0].disabled = false
}
}).catch((e) => {
this.loading = false
this.$message.error(e)
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
closeWindow() {
this.visible = false
},
clear() {
this.tree = []
},
save() {
const list = this.$refs.tree.getCheckedNodes()
if (list.length > this.limit) {
this.$message.error('应该选择' + this.limit + '个,但是现在选择了' + list.length + '个')
return
}
this.$emit('getResult', { info: this.$refs.tree.getCheckedNodes(), e: this.$refs.tree.getCheckedNodes(), root: this.root })
this.visible = false
},
//
handleNodeClick(data, node) {
this.treeClickCount++
if (this.treeClickCount >= 2) {
return
}
this.timer = window.setTimeout(() => {
if (this.treeClickCount === 1) {
this.treeClickCount = 0
} else if (this.treeClickCount > 1) {
this.treeClickCount = 0
this.$emit('getResult', { info: [data], e: [data], heirloom: this.heirloom })
this.visible = false
}
}, 300)
}
}
}
</script>
<style scoped>
.information >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
</style>

View File

@ -0,0 +1,113 @@
<template>
<el-dialog
v-loading = "loading"
v-if="dialogVisible"
:visible.sync="dialogVisible"
:before-close="handleClose"
:title="title"
:append-to-body="appendToBody"
width="60%">
<el-input v-if="false" v-model="filterText" placeholder="输入关键字进行过滤"/>
<el-scrollbar class="information" style="height: 500px; margin-top: 10px">
<el-table
ref="table"
:data="data"
border
style="width: 100%">
<el-table-column type="selection" width="55"/>
<el-table-column prop="NAME" label="适合岗位"/>
</el-table>
</el-scrollbar>
<span slot="footer" class="dialog-footer">
<el-button @click="closeWindow"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</span>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
props: {
title: {
type: String,
default: ''
},
appendToBody: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: false,
loading: false,
e: {},
root: {},
data: [],
filterText: ''
}
},
watch: {
filterText(val) {
this.data = this.data.filter(data => !val || data.name.includes(val))
}
},
methods: {
init(e) {
console.log(e)
this.dialogVisible = true
this.e = e.e
this.root = e.root
this.getData()
},
handleClose() {
this.dialogVisible = false
},
getData() {
this.loading = true
let id = null
if (this.e.departmentInfo) {
id = this.e.departmentInfo.id
} else {
id = this.e.DICTIONARIES_ID
}
requestFN(
'/post/getInfo',
{ id: JSON.stringify([{ id: id }]) }
).then((data) => {
this.loading = false
this.data = data.postList
}).catch((e) => {
this.loading = false
this.$message.error(e)
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
closeWindow() {
this.dialogVisible = false
},
clear() {
this.tree = []
},
save() {
this.$emit('getResult', { info: this.$refs.table.selection, e: this.$refs.table.selection, root: this.root, post_flag: true })
this.dialogVisible = false
}
}
}
</script>
<style scoped>
.information >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
</style>

View File

@ -0,0 +1,114 @@
<template>
<el-dialog
v-loading = "loading"
v-if="dialogVisible"
:visible.sync="dialogVisible"
:before-close="handleClose"
:title="title"
:append-to-body="appendToBody"
width="60%">
<el-input v-show="false" v-model="filterText" placeholder="输入关键字进行过滤"/>
<el-scrollbar class="information" style="height: 500px; margin-top: 10px">
<el-table
ref="table"
:data="data"
border
style="width: 100%">
<el-table-column type="selection" width="55"/>
<el-table-column prop="role_NAME" label="角色名称"/>
</el-table>
</el-scrollbar>
<span slot="footer" class="dialog-footer">
<el-button @click="closeWindow"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</span>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
props: {
title: {
type: String,
default: ''
},
appendToBody: {
type: Boolean,
default: false
},
limit: {
type: Number,
default: 1
}
},
data() {
return {
dialogVisible: false,
loading: false,
e: {},
root: {},
data: [],
filterText: ''
}
},
watch: {
filterText(val) {
this.data = this.data.filter(data => !val || data.name.includes(val))
}
},
methods: {
init(e) {
this.dialogVisible = true
this.e = e.e
this.root = e.root
this.getData()
},
handleClose() {
this.dialogVisible = false
},
getData() {
this.loading = true
requestFN(
'/role/listRegularEmployees'
).then((data) => {
this.loading = false
this.data = data.roleList
}).catch((e) => {
this.loading = false
this.$message.error(e)
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
closeWindow() {
this.dialogVisible = false
},
clear() {
this.tree = []
},
save() {
const list = this.$refs.table.selection
if (list.length > this.limit) {
this.$message.error('应该选择' + this.limit + '个,但是现在选择了' + list.length + '个')
return
}
this.$emit('getResult', { info: this.$refs.table.selection, e: this.$refs.table.selection, root: this.root, post_flag: true })
this.dialogVisible = false
}
}
}
</script>
<style scoped>
.information >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
</style>

View File

@ -0,0 +1,238 @@
<template>
<el-dialog v-if="visible" :title = "title" :visible.sync="visible" width="80%" append-to-body>
<el-container>
<el-aside width="300px" style="background-color:#fff; height: 500px">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
style="margin:10px 0"/>
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
default-expand-all
class="filter-tree"
@node-click="handleNodeClick"/>
</el-aside>
<el-main style="height: 500px">
<el-form label-width="50px">
<el-row>
<el-col :span="6">
<el-form-item label="姓名">
<el-input v-model="searchForm.KEYWORDS" placeholder="请输入关键字"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="所属岗位" label-width="80px">
<el-select v-model="searchForm.POST_ID" placeholder="请选择" class="filter-item" style="width: 100%;">
<el-option v-for="item in translate.postList" :key="item.POST_ID" :label="item.NAME" :value="item.POST_ID" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="职务">
<el-select v-model="searchForm.POSITION" placeholder="请选择" style="width: 100%;" @change="$forceUpdate()">
<el-option v-for="item in translate.positionList" :key="item.dictionaries_ID" :label="item.name" :value="item.dictionaries_ID" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table v-loading="listLoading" ref="multipleTable" :data="list" :row-key="getRowKey" :header-cell-style="{'font-weight': 'bold','color': '#000'}" height="350px" tooltip-effect="dark" border fit highlight-current-row>
<el-table-column :reserve-selection="true" type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="USERNAME" label="用户名" />
<el-table-column prop="NAME" label="姓名" />
<el-table-column prop="DEPARTMENT_NAME" label="部门" />
<el-table-column prop="POST_NAME" label="岗位" />
<el-table-column prop="POSITIVETIME" label="转正时间" />
<el-table-column prop="ROLE_NAME" label="角色" width="150"/>
<el-table-column prop="POSITIONNAME" label="职务" width="150"/>
</el-table>
<div class="page-btn-group">
<el-row :gutter="20">
<el-col :span="22">
<el-button icon="el-icon-share" type="primary" @click="confirm"></el-button>
<el-button icon="el-icon-help" type="info" @click="handleClose"></el-button>
</el-col>
<el-col :span="2">
<pagination :total="page.total" :page.sync="page.page" :limit.sync="page.limit" @pagination="getList" />
</el-col>
</el-row>
</div>
</el-main>
</el-container>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
props: {
title: {
type: String,
default: ''
},
limit: {
type: Number,
default: 1
}
},
data() {
return {
visible: false,
heirloom: {},
page: {
total: 0,
page: 0,
limit: 10
},
filterText: '',
treeLoading: false,
treeData: [],
defaultProps: {
children: 'nodes',
label: 'name'
},
listLoading: false,
list: [],
searchForm: {
KEYWORDS: '',
POST_ID: '',
POSITION: '',
DEPARTMENT_ID: '',
STATE: '1'
},
translate: {
postList: [],
positionList: []
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
methods: {
init(e) {
this.visible = true
this.warmUp()
this.getList()
this.heirloom = e
},
getList(DEPARTMENT_ID) {
this.listLoading = true
if (DEPARTMENT_ID) {
this.searchForm.DEPARTMENT_ID = DEPARTMENT_ID
}
requestFN(
'/employee/list?showCount=' + this.page.limit + '&currentPage=' + this.page.page,
this.searchForm
).then((data) => {
this.listLoading = false
this.list = data.userList
this.page.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
},
getDic(e) {
this.treeLoading = true
requestFN(
'/magicMirror/getInfo', e
).then((data) => {
if (data.code !== '0') {
this.$message.error('系统异常,请联系管理员')
this.visible = false
}
if (data.departmentList) { this.treeData = JSON.parse(data.departmentList) }
if (data.postList) this.translate.postList = data.postList
if (data.positionList) this.translate.positionList = data.positionList
this.treeLoading = false
}).catch((e) => {
this.treeLoading = false
})
},
getPostList() {
this.getDic({
postType: '1',
positionType: '1',
DEPARTMENT_ID: this.searchForm.DEPARTMENT_ID
})
},
warmUp() {
this.getDic({
departmentType: '1'
})
},
getRowKey(row) {
return row.USER_ID
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(node, data, value) {
this.searchForm.DEPARTMENT_ID = node.id
this.getList(node.id)
this.getPostList()
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
goKeyReset() {
this.searchForm = {
KEYWORDS: '',
POST_ID: '',
POSITION: '',
DEPARTMENT_ID: '',
STATE: '1'
}
this.translate.postList = []
this.translate.positionList = []
this.getList()
},
confirm() {
const chooseList = this.$refs.multipleTable.selection
if (this.limit < chooseList.length) {
this.$message.error('系统规定只能选择' + this.limit + '条数据,现在选择' + chooseList.length + '条数据')
return
}
this.$emit('getResult', { heirloom: this.heirloom, list: chooseList })
this.handleClose()
},
handleClose() {
this.searchForm = {
KEYWORDS: '',
POST_ID: '',
POSITION: '',
DEPARTMENT_ID: '',
STATE: '1'
}
this.visible = false
this.$refs.multipleTable.clearSelection()
}
}
}
</script>

View File

@ -0,0 +1,222 @@
<template>
<el-drawer
v-if="vectory"
ref="drawer"
:visible.sync="CoursewareDrawer"
:before-close="CoursewareDrawerClose"
title="课件类型选择"
size="50%">
<div style="margin-left: 30px">
<el-form ref="form" :model="form" class="edit_form" style="height: 500px;margin-bottom: 50px" label-position="top">
<el-row :gutter ="20">
<el-col :span="10">
<el-form-item label="课程大类选择">
<el-select v-model="CoursewareDrawerForm.grandType" placeholder="请选择" style="width: 300px;" @change="getDicListByPID(CoursewareDrawerForm.grandType)">
<el-option
v-for="item in coursewareType"
:key="item.value"
:label="item.label"
:value="item"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="14">
<div style="width: 400px" class="information">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
style="margin-bottom: 10px"/>
<el-form-item label="课程大类明细">
<el-scrollbar style="height: 400px;margin-bottom: 10px">
<el-tree
v-loading="treeLoading"
ref="tree"
:data="dicListMap"
:props="treeProps"
:filter-node-method="filterNode"
:check-strictly="true"
:highlight-current="true"
show-checkbox
class="type_tree"
node-key="id"
@node-click="handleNodeClick"/>
</el-scrollbar>
<el-button type="primary" @click="addTage"></el-button>
</el-form-item>
</div>
</el-col>
</el-row>
</el-form>
<el-divider/>
<div>
<el-tag
v-for="tag in dynamicTags"
:key="tag.value"
:disable-transitions="false"
closable
style="margin-left: 10px;margin-bottom: 10px"
@close="tagHandleClose(tag)">
{{ tag.label }}
</el-tag>
</div>
<el-divider/>
<div>
<el-button @click="CoursewareDrawer = false"> </el-button>
<el-button :loading="CoursewareDrawerLoading" type="primary" @click="submit">{{ CoursewareDrawerLoading ? ' ...' : ' ' }}</el-button>
</div>
</div>
</el-drawer>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import { videoPlayer } from 'vue-video-player'
import 'video.js/dist/video-js.css'
export default {
components: { Pagination, videoPlayer },
directives: { waves },
data() {
return {
form: {},
CoursewareDrawer: false,
CoursewareDrawerLoading: false,
CoursewareDrawerForm: {
grandType: {},
fatherType: {},
sonType: {},
grandsonType: {}
},
dynamicTags: [],
tagModelList: [],
coursewareType: [],
tagLoading: false,
dicListMap: [],
treeLoading: false,
treeProps: {
children: 'nodes',
label: 'name'
},
filterText: '',
vectory: false
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
// this.getCoursewareType()
},
methods: {
init(tags) {
this.vectory = true
this.CoursewareDrawer = true
this.dynamicTags = tags
},
getCoursewareType() {
this.treeLoading = true
requestFN(
'/videocourseware/coursewareType',
{}
).then((data) => {
this.coursewareType = []
for (var vector in data.list) {
this.coursewareType.push({
label: data.list[vector].name,
value: data.list[vector].dictionaries_ID
})
}
this.treeLoading = false
}).catch((e) => {
this.treeLoading = false
})
},
CoursewareDrawerClose(done) {
done()
},
tagHandleClose(tag) {
this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1)
},
addTage() {
var choose = this.$refs.tree.getCheckedNodes()
if (!this.dynamicTags) this.dynamicTags = []
for (var x in choose) {
var vector = { label: choose[x].name, value: choose[x].id }
if (vector.label !== '') {
var constents = false
for (const y in this.dynamicTags) {
if (this.dynamicTags[y].value == vector.value) {
constents = true
}
}
if (!constents) this.dynamicTags.push(vector)
}
}
},
getTags(query) {
this.tagLoading = true
requestFN(
'/labelFactory/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: query
}
).then((data) => {
this.tagLoading = false
this.tagModelList = data.varList
}).catch((e) => {
this.tagLoading = false
})
},
submit() {
if ((!this.dynamicTags) || this.dynamicTags.length <= 0) {
this.$message.warning('未选择课件类型')
return
}
var type = ''
for (var x in this.dynamicTags) {
if (x == '0') {
type = this.dynamicTags[x].label
} else if (x < '4') {
type += ',' + this.dynamicTags[x].label
}
}
type += '...'
this.$emit('getMessage', type, this.dynamicTags)
this.CoursewareDrawer = false
this.vectory = false
},
getDicListByPID(pId) {
requestFN(
'/dictionaries/listAllDictToParId',
{
parentId: pId.value
}
).then((data) => {
this.dicListMap = JSON.parse(data.zTreeNodes)
console.log(this.dicListMap)
}).catch((e) => {
})
},
handleNodeClick(node, data, value) {
if (data.isLeaf) { //
this.INDUSTRY3 = node.INDUSTRYTYPE_ID
this.INDUSTRY3_NAME = node.NAME
}
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
}
}
}
</script>
<style scoped>
.information >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
</style>

View File

@ -0,0 +1,517 @@
<template>
<el-dialog v-if="visible" :title = "title" :visible.sync="visible" width="80%" append-to-body>
<el-container>
<el-aside width="300px" style="background-color:#fff">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
style="margin:10px 0"/>
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
@node-click="handleNodeClick"/>
</el-aside>
<el-main>
<el-form label-width="50px">
<el-row>
<el-col :span="6">
<el-form-item label="姓名">
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="所属部门" label-width="80px">
<SelectTree ref="deptTree" :clearable="false" :options="treeData" :props="defaultProps" v-model="DEPARTMENT_ID" placeholder="请选择部门" style="width: 100%;" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="所属岗位" label-width="80px">
<el-select v-model="POST_ID" placeholder="请选择" class="filter-item" style="width: 100%;">
<el-option v-for="item in postList" :key="item.POST_ID" :label="item.NAME" :value="item.POST_ID" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="职务">
<el-select v-model="POSITION" placeholder="请选择" style="width: 100%;" @change="$forceUpdate()">
<el-option v-for="item in positionList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="22">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table v-loading="listLoading" ref="multipleTable" :data="varList" :row-key="getRowKey" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row>
<el-table-column :reserve-selection="true" type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="USERNAME" label="用户名" />
<el-table-column prop="NAME" label="姓名" />
<el-table-column prop="DEPARTMENT_NAME" label="部门" />
<el-table-column prop="POST_NAME" label="岗位" />
<el-table-column prop="POSITIVETIME" label="转正时间" />
<el-table-column prop="ROLE_NAME" label="角色" width="150"/>
<el-table-column prop="POSITIONNAME" label="职务" width="150"/>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" @click = "confirm"> </el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</el-main>
</el-container>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
props: {
title: {
type: String,
default: ''
},
limit: {
type: Number,
default: 1
}
},
data() {
return {
visible: false,
listLoading: true,
treeLoading: false,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
filterText: '',
total: 0,
KEYWORDS: '',
STATE: '',
POSITION: '',
positionList: [],
DEPARTMENT_ID: '',
POST_ID: '',
varList: [],
defaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
},
pd: [],
treeData: [],
form: {
USER_ID: '',
ROLE_ID: '',
DEPARTMENT_ID: '',
POST_ID: '',
USERNAME: '',
NAME: '',
EMAIL: '',
DEPARTURETIME: '',
LEAVINGREASON: '',
LEARNERCATEGORY: '',
LEARNERCATEGORYSTATUS: 'select',
SORT: '',
DEPARTUREDESCR: '',
PASSWORD: '666666',
USERAVATARPREFIX: '',
USERAVATARURL: '',
USERAVATARURL_CONVERT: '',
ISSTUDENT: false,
NATION: '', //
SEX: '', //
POLITICAL_OUTLOOK: '', //
DATE_OF_BIRTH: '', //
DEGREE_OF_EDUCATION: '', //
POST: '', //
TYPE_OF_WORK: '', //
ENTRY_DATE: '', //
WORKING_DATE: '', //
INCUMBENCY: '', //
CERTIFICATE_INFORMATION: '', //
TITLE: '', //
DUTIESValue: '',
DUTIES: '',
letPostType: 'select',
letTitleValue: '',
letTitleId: '',
letTitleType: 'select',
letTypeOfWorkValue: '',
letTypeOfWorkId: '',
letTypeOfWorkType: 'select',
USER_ID_CARD: ''
},
config: config,
roleList: [],
postList: [],
USER_ID: ''
}
},
watch: {
'DEPARTMENT_ID': {
handler(newVal, oldVal) {
this.POST_ID = ''
this.getPostList()
},
immediate: false
},
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getList()
this.getRoleList()
this.hasButton()
this.getPosition()
this.getDeparture()
this.getDict()
},
methods: {
init() {
this.visible = true
},
getPosition() {
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: '09e36ac01e9540f8bc84eab1c1a78754' }
).then((data) => {
this.positionList = data.list
}).catch((e) => {
this.listLoading = false
})
},
getDeparture() {
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: '3fac317a218445bba624636bed4cf9f0' }
).then((data) => {
this.leavingList = data.list
}).catch((e) => {
this.listLoading = false
})
},
getRowKey(row) {
return row.USER_ID
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(node, data, value) {
this.form.DEPARTMENT_ID = node.id
this.getList(node.id)
},
getRoleList() {
requestFN(
'/user/goAddUser',
{}
).then((data) => {
this.roleList = data.roleList
}).catch((e) => {
})
},
getPostList() {
if (this.DEPARTMENT_ID != null && this.DEPARTMENT_ID !== '') {
requestFN(
'/post/listAll',
{ DEPARTMENT_ID: this.DEPARTMENT_ID }
).then((data) => {
this.postList = data.postList
}).catch((e) => {
})
}
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
goKeyReset() {
this.KEYWORDS = ''
this.$refs.deptTree.clearHandle()
this.POST_ID = ''
this.postList = []
this.POSITION = ''
// this.STATE = ''
this.getList()
},
getList(DEPARTMENT_ID) {
this.listLoading = true
if (DEPARTMENT_ID) {
this.DEPARTMENT_ID = DEPARTMENT_ID
}
requestFN(
'/employee/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
DEPARTMENT_ID: this.DEPARTMENT_ID,
POSITION: this.POSITION,
STATE: '1'
}
).then((data) => {
this.listLoading = false
this.varList = data.userList
this.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
},
getDict: function() {
requestFN(
'/department/listTree',
{}
).then((data) => {
this.treeData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
this.listLoading = false
})
},
hasButton() {
var keys = 'user:add,user:del,user:edit'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.userfhadminadd
this.del = data.userfhadmindel
this.edit = data.userfhadminedit
}).catch((e) => {
this.listLoading = false
})
},
confirm() {
this.$emit('getResult', { info: this.$refs.multipleTable.selection })
this.handleClose()
},
handleClose() {
this.visible = false
}
}
}
</script>
<style lang="scss" scoped>
.el-dialog__body{
padding: 0;
background: red;
}
.mark_up{
margin-bottom:20px;
margin-left: 110px;
}
.icons-container {
margin: 0;
overflow: hidden;
.grid {
position: relative;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.icon-item {
margin-bottom: 10px;
height: 70px;
text-align: center;
width: 100px;
float: left;
font-size: 24px;
color: #24292e;
cursor: pointer;
span {
display: block;
font-size: 14px;
margin-top: 10px;
}
}
.disabled {
pointer-events: none;
}
}
.filter-btn-group{
position: relative;
}
.filter-flot{
position: absolute;
right: 0;
top: 0;
}
.uploader{
width: 570px;
display: flex;
align-items: center;
}
.el-form-item__content{
line-height: 1;
}
.uo-flex{
display: flex
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
border: 1px dashed #d9d9d9;
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>
<style lang="sass" scoped>
.el-row
margin-bottom: 16px
&:last-child
margin-bottom: 0
.form-group
display: flex
align-items: center
margin-right: 20px
.form-label
padding: 9px 15px
font-size: 14px
width: 240px
font-weight: 400
line-height: 20px
text-align: right
margin-bottom: 0
.star
color: red
padding-right: 4px
.input-block
flex: 1
min-height: 36px
position: relative
.disContent
padding: 0 20px
display: flex
align-items: center
flex-wrap: wrap
.img-div
position: relative
margin: auto 10px 10px 10px
width: 20px
height: 20px
border-radius: 4px
&>img
width: 2%
height: 3%
.disContent-hide
position: absolute
width: 100%
height: 100%
border-radius: 4px
background-color: rgba(48, 48, 48, 0.59)
display: none
top: 0
left: 0
.Delete
position: absolute
bottom: 14px
right: 10px
font-size: 16px
color: white
cursor: pointer
.editCss
.Delete
font-size: 16px
right: 90px
.yuLan
position: absolute
bottom: 23px
right: 50px
font-size: 16px
color: white
cursor: pointer
.yuLanImg
position: absolute
bottom: 0
right: 0
width: 100%
height: 100%
opacity: 0
.img-div:hover .disContent-hide
display: block
.pitchCss
border: 1px solid #202e78
transition: all linear 0.1s
width: 116px
height: 116px
</style>
<style lang="sass" scoped>
.table-qrcode
text-align: center
padding-top: 20px
width: 100%
.filter-container
position: relative
.filter-flot
position: absolute
right: 0
top: 0
.uploader
width: 570px
display: flex
align-items: center
.el-form-item__content
line-height: 1
</style>
<style lang="scss" scoped>
>>> .el-dialog__body {
padding: 30px 20px 10px 40px;
}
</style>

View File

@ -0,0 +1,111 @@
<template>
<el-dialog
v-loading = "loading"
v-if="visible"
:visible.sync="visible"
:before-close="handleClose"
:title="title"
:append-to-body="appendToBody"
width="60%">
<quill-editor v-if="!disabled" ref="myQuillEditor" v-model="text" :height="300" :options="editorOption" />
<div v-else class="ql-editor">
<div v-html="text"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="closeWindow"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</span>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { quillEditor } from 'vue-quill-editor'
import waves from '@/directive/waves' // waves directive
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
export default {
components: { Pagination, quillEditor },
directives: { waves },
props: {
title: {
type: String,
default: ''
},
appendToBody: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
visible: false,
loading: false,
text: '',
//
editorOption: {
modules: {
toolbar: [
[
'bold', 'italic', 'underline', 'strike',
'blockquote', 'code-block',
{ header: 1 }, { header: 2 },
{ list: 'ordered' }, { list: 'bullet' },
{ script: 'sub' }, { script: 'super' },
{ indent: '-1' }, { indent: '+1' },
{ direction: 'rtl' },
{ color: [] }, { background: [] },
{ align: [] },
{ size: ['12', '14', '16', '18', '20', '22', '24', '28', '32', '36'] },
{ header: [1, 2, 3, 4, 5, 6] },
'clean'
]
]
},
placeholder: '请输入正文'
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
methods: {
init(e) {
this.visible = true
this.text = e.text
},
handleClose() {
this.visible = false
this.text = ''
},
closeWindow() {
this.visible = false
this.text = ''
},
save() {
this.$emit('getResult', { text: this.text })
this.visible = false
this.text = ''
}
}
}
</script>
<style scoped>
.information >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
</style>
<style>
.ql-container{
height: 300px;
}
</style>

View File

@ -32,8 +32,11 @@
:options="treeData"
:disabled="true"
:normalizer="normalizer"
:flat="true"
:default-expand-level="0"
v-model="dataForm.MAIN_DEPARTMENT"
placeholder="请选择部门"
multiple
no-options-text="暂无数据"
no-children-text="暂无数据"
style="width: 100%;"
@ -351,7 +354,7 @@ export default {
return {
COMPANY_AREA: '',
dataForm: {
MAIN_DEPARTMENT: '',
MAIN_DEPARTMENT: null,
businessLicenseDate: [],
SUPERVISE_CORPINFO_DEPT_NAME: '',
COMPETENT_DEPT_NAME: '',
@ -632,6 +635,11 @@ export default {
{}
).then((data) => {
this.treeData = JSON.parse(data.zTreeNodes)
this.treeData.push({
id: '0',
name: '无',
nodes: []
})
resolve()
}).catch((e) => {
reject()
@ -681,6 +689,13 @@ export default {
this.dataForm.businessLicenseDate.push(this.dataForm.LICENSE_START)
this.dataForm.businessLicenseDate.push(this.dataForm.LICENSE_END)
//
if (this.dataForm.MAIN_DEPARTMENT.indexOf(']') < 0) {
this.dataForm.MAIN_DEPARTMENT = [this.dataForm.MAIN_DEPARTMENT]
} else {
this.dataForm.MAIN_DEPARTMENT = JSON.parse(this.dataForm.MAIN_DEPARTMENT)
}
resolve()
}).catch((e) => {
this.$message({

View File

@ -24,10 +24,10 @@
审批状态{{ item.PASS_FLAG === '1' ? '同意' : '不同意' }}
</el-col>
<el-col>
审批人归属公司{{ item.APPROVER_CORPINFO_NAME }}
{{ (!item.APPROVER_NAME ? '被审批人归属公司:':'审批人归属公司:') + item.APPROVER_CORPINFO_NAME }}
</el-col>
<el-col>
审批时间{{ item.APPROVER_TIME }}
{{ (!item.APPROVER_NAME ? '发起申请时间:':'审批时间:') + item.APPROVER_TIME }}
</el-col>
<el-col v-if="item.APPROVER_OPINION">
审批意见{{ item.APPROVER_OPINION }}

View File

@ -42,8 +42,8 @@
<el-table-column label="操作" align="center" width="450">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleShow(row)"></el-button>
<el-button v-if="false" type="primary" icon="el-icon-edit" size="mini" @click="handleFlowShow(row)"></el-button>
<el-button v-if="false" type="primary" icon="el-icon-edit" size="mini" @click="handleFlowStepShow(row)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleFlowShow(row)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleFlowStepShow(row)"></el-button>
<el-button v-if="row.power_flag === '1'" type="primary" icon="el-icon-s-claim" size="mini" @click="approve([row])"></el-button>
<el-button v-if="false" type="success" icon="el-icon-edit" size="mini" @click="getUserInfo(row)"></el-button>
</template>

View File

@ -173,7 +173,8 @@ export default {
} else {
this.isShow = false
}
} else {
}
if (this.info.FLOWS_TYPE === '1') {
this.isShow = true
if (this.info.FLOWS_STEP === 2 || this.info.FLOWS_STEP === 3) {
await this.getDepartmentTree()
@ -186,6 +187,15 @@ export default {
this.corpFlag = true
}
}
if (this.info.FLOWS_TYPE === '2') {
if (this.info.FLOWS_STEP === 1) {
this.isShow = true
await this.getDepartmentTree()
this.corpFlag = false
} else {
this.isShow = false
}
}
this.loading = false
},
getMenu() {
@ -216,7 +226,7 @@ export default {
formData.append('chengNuoShu', this.form.APPOINT_ANNEX[i].raw)
}
}
upload('/xgf/user/approvePlus', formData)
upload('/xgf/user/approveMax', formData)
.then((data) => {
this.$message.success('推送成功')
this.visible = false

View File

@ -47,7 +47,7 @@ export default {
},
sendMessage(row) {
requestFN(
'/xgf/user/approve',
'/xgf/user/approveMax',
{
list: this.heirloom,
STATUS: this.value,

View File

@ -44,8 +44,8 @@
<el-table-column label="操作" align="center" width="350">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleShow(row)"></el-button>
<el-button v-if="false" type="primary" icon="el-icon-edit" size="mini" @click="handleShowStep(row)"></el-button>
<el-button v-if="false" type="primary" icon="el-icon-edit" size="mini" @click="handleShowFlow(row)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleShowStep(row)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleShowFlow(row)"></el-button>
<el-button v-if="false" type="primary" icon="el-icon-s-claim" size="mini" @click="approve([row])"></el-button>
<el-button v-if="false" type="success" icon="el-icon-edit" size="mini" @click="getUserInfo(row)"></el-button>
</template>

View File

@ -53,6 +53,7 @@
:normalizer="normalizer"
v-model="form.MAIN_DEPARTMENT"
placeholder="请选择部门"
multiple
no-options-text="暂无数据"
no-children-text="暂无数据"
style="width: 100%;"
@ -418,6 +419,11 @@ export default {
).then((data) => {
const treeData = this.listTransTree(JSON.parse(data.zTreeNodes), 'id', 'pId', 'nodes')
this.treeData = this.removeEmptyChildren(treeData)
this.treeData.push({
id: '0',
name: '无',
nodes: []
})
}).catch((e) => {
})
},
@ -429,6 +435,12 @@ export default {
submitForm() {
this.$refs.form.validate(valid => {
if (valid) {
if (this.form.MAIN_DEPARTMENT.indexOf('0') > -1 && this.form.MAIN_DEPARTMENT.length > 1) {
this.listLoading = false
this.submitButtonLoading = false
this.$message.error('主管部门选无时不能选择其他部门')
return
}
this.listLoading = true
this.submitButtonLoading = true
if (this.form.POSSESSION && this.form.POSSESSION.length > 0) {
@ -446,6 +458,7 @@ export default {
this.form.MANAGER_DEPARTMENT_ID = this.form.MANAGER_DEPARTMENT_ID.join(',')
}
this.form.CORP_TYPE = JSON.stringify(this.form.CORP_TYPE)
this.form.MAIN_DEPARTMENT = JSON.stringify(this.form.MAIN_DEPARTMENT)
requestFN(
'/relevantunits/saveCorpInfo',
this.form

View File

@ -50,9 +50,13 @@
<el-form-item label="股份主管部门" prop="MAIN_DEPARTMENT">
<Treeselect
:options="treeData"
:normalizer="normalizer"
:normalizer="normalizergfjg"
:flat="true"
:default-expand-level="0"
:props="defaultProps"
v-model="form.MAIN_DEPARTMENT"
placeholder="请选择部门"
multiple
no-options-text="暂无数据"
no-children-text="暂无数据"
style="width: 100%;"
@ -252,6 +256,10 @@ export default {
})
}
var hasSocialCode = (rule, value, callback) => {
if (value === null || value === '') {
callback(new Error('统一社会信用代码为空'))
return
}
requestFN(
'/relevantunits/hasSocialCode',
{
@ -348,7 +356,7 @@ export default {
COMPETENT_DEPT_ID: null,
MANAGER_DEPARTMENT_ID: null,
SUPERVISE_CORPINFO_ID: '',
MAIN_DEPARTMENT: '',
MAIN_DEPARTMENT: null,
RELEVANT_UNIT_NAME: '',
SOCIAL_CODE: '',
LOCAL: '',
@ -479,6 +487,11 @@ export default {
} else {
this.form.CORP_TYPE = [this.form.CORP_TYPE]
}
if (this.form.MAIN_DEPARTMENT.indexOf('[') > -1) {
this.form.MAIN_DEPARTMENT = JSON.parse(this.form.MAIN_DEPARTMENT)
} else {
this.form.MAIN_DEPARTMENT = [this.form.MAIN_DEPARTMENT]
}
var sz = this.form.SELECT_FORM
var cdi = this.form.COMPETENT_DEPT_ID
var mdi = this.form.MANAGER_DEPARTMENT_ID
@ -526,6 +539,12 @@ export default {
).then((data) => {
const treeData = this.listTransTree(JSON.parse(data.zTreeNodes), 'id', 'pId', 'nodes')
this.treeData = this.removeEmptyChildren(treeData)
this.treeData.push({
id: '0',
name: '无',
nodes: []
})
console.log(this.treeData)
}).catch((e) => {
})
resolve()
@ -541,6 +560,12 @@ export default {
if (valid) {
this.listLoading = true
this.buttonLoading = true
if (this.form.MAIN_DEPARTMENT.indexOf('0') > -1 && this.form.MAIN_DEPARTMENT.length > 1) {
this.listLoading = false
this.submitButtonLoading = false
this.$message.error('主管部门选无时不能选择其他部门')
return
}
if (this.form.POSSESSION && this.form.POSSESSION.length > 0) {
this.form.PROVINCE = this.form.POSSESSION[0] || ''
this.form.CITY = this.form.POSSESSION[1] || ''
@ -554,8 +579,9 @@ export default {
if (this.form.COMPETENT_DEPT_ID) {
this.form.COMPETENT_DEPT_ID = this.form.COMPETENT_DEPT_ID.join(',')
}
this.form.MAIN_DEPARTMENT = JSON.stringify(this.form.MAIN_DEPARTMENT)
if (this.form.MANAGER_DEPARTMENT_ID) {
this.form.MANAGER_DEPARTMENT_ID = this.form.MANAGER_DEPARTMENT_ID.join(',')
this.form.MANAGER_DEPARTMENT_ID = JSON.stringify(this.form.MANAGER_DEPARTMENT_ID)
}
this.form.CORP_TYPE = JSON.stringify(this.form.CORP_TYPE)
requestFN(