Merge branch 'pet' into limingyu-20240428-气象监测地图

20240528Test
limingyu 2024-04-29 14:08:45 +08:00
commit a436221309
34 changed files with 6000 additions and 45 deletions

View File

@ -1241,7 +1241,7 @@ export default {
}
const entity = new Cesium.Entity({
id: 'trajectory',
polyline: { positions, width: 5.0, material: Cesium.Color.RED , clampToGround:true }
polyline: { positions, width: 5.0, material: Cesium.Color.RED, clampToGround: true }
})
const collection = new Cesium.CustomDataSource('trajectoryEntityCollection')
collection.entities.add(entity)

View File

@ -273,19 +273,21 @@ export default {
getPeopleList(e) {
return new Promise(resolve => {
this.material.departmentName = e.name
requestFN(
'/user/listAll',
{
DEPARTMENT_ID: e.id
}
).then((data) => {
this.dic.userList = data.userList
this.material.userInfo = ''
resolve(true)
}).catch((e) => {
console.log(e)
resolve(true)
})
if (e && e.id && e.id !== '') {
requestFN(
'/user/listAll',
{
DEPARTMENT_ID: e.id
}
).then((data) => {
this.dic.userList = data.userList
this.material.userInfo = ''
resolve(true)
}).catch((e) => {
console.log(e)
resolve(true)
})
}
})
},
chooseUser(e) {

View File

@ -210,7 +210,8 @@ export default {
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '0',
CORPINFO_ID: '0'
CORPINFO_ID: '0',
MIGRATION_FLAG: '1'
}
).then((data) => {
this.listLoading = false

View File

@ -210,7 +210,8 @@ export default {
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '1',
CORPINFO_ID: '0'
CORPINFO_ID: '0',
MIGRATION_FLAG: '1'
}
).then((data) => {
this.listLoading = false

View File

@ -210,7 +210,8 @@ export default {
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '2',
CORPINFO_ID: '0'
CORPINFO_ID: '0',
MIGRATION_FLAG: '1'
}
).then((data) => {
this.listLoading = false

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,38 @@
<template>
<div class="app-container">
<el-tabs type="border-card" @tab-click="changTab">
<el-tab-pane label="安全操作规程平台资源库">
<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 './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,562 @@
<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 type="expand">
<template slot-scope="props">
<div style="text-align: left;padding: 10px;">
<el-form label-position="left" inline>
<el-form-item label="标签">
<el-tag
v-for="tag in props.row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</el-form-item>
<el-form-item label="国民经济行业类型">
<div v-if="(props.row.SPECIFICATION_TYPES && props.row.SPECIFICATION_TYPES.length > 0) && ((!props.row.CATEGORY_LIST) || (!props.row.CATEGORY_LIST[0]) || (props.row.CATEGORY_LIST[0].CATEGORY_ID !== '691346658ed744a1bda2ed3a755f606c')) ">
<el-tag
v-for="tag in props.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>
</el-form-item>
</el-form>
</div>
</template>
</el-table-column>
<el-table-column
v-if="false"
: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 v-if="false" 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 v-if="false" 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="200px"/>
<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="handleExport(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.BUS_TEXT_LIBRARY_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',
LIBRARY_FLAG: '1'
}
).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,38 @@
<template>
<div class="app-container">
<el-tabs type="border-card" @tab-click="changTab">
<el-tab-pane label="安全生产管理制度平台资源库">
<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 './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,562 @@
<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
v-if="false"
:reserve-selection="true"
type="selection"
width="55"
align="center"
/>
<el-table-column type="expand">
<template slot-scope="props">
<div style="text-align: left;padding: 10px;">
<el-form label-position="left" inline>
<el-form-item label="标签">
<el-tag
v-for="tag in props.row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</el-form-item>
<el-form-item label="国民经济行业类型">
<div v-if="(props.row.SPECIFICATION_TYPES && props.row.SPECIFICATION_TYPES.length > 0) && ((!props.row.CATEGORY_LIST) || (!props.row.CATEGORY_LIST[0]) || (props.row.CATEGORY_LIST[0].CATEGORY_ID !== '691346658ed744a1bda2ed3a755f606c')) ">
<el-tag
v-for="tag in props.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>
</el-form-item>
</el-form>
</div>
</template>
</el-table-column>
<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 v-if="false" 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 v-if="false" 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="200px"/>
<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="handleExport(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.BUS_TEXT_LIBRARY_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',
LIBRARY_FLAG: '1'
}
).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,38 @@
<template>
<div class="app-container">
<el-tabs type="border-card" @tab-click="changTab">
<el-tab-pane label="安全生产责任制平台资源库">
<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 './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,562 @@
<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
v-if="false"
:reserve-selection="true"
type="selection"
width="55"
align="center"
/>
<el-table-column type="expand">
<template slot-scope="props">
<div style="text-align: left;padding: 10px;">
<el-form label-position="left" inline>
<el-form-item label="标签">
<el-tag
v-for="tag in props.row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</el-form-item>
<el-form-item label="国民经济行业类型">
<div v-if="(props.row.SPECIFICATION_TYPES && props.row.SPECIFICATION_TYPES.length > 0) && ((!props.row.CATEGORY_LIST) || (!props.row.CATEGORY_LIST[0]) || (props.row.CATEGORY_LIST[0].CATEGORY_ID !== '691346658ed744a1bda2ed3a755f606c')) ">
<el-tag
v-for="tag in props.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>
</el-form-item>
</el-form>
</div>
</template>
</el-table-column>
<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 v-if="false" 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 v-if="false" 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="200px"/>
<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="handleExport(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.BUS_TEXT_LIBRARY_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',
LIBRARY_FLAG: '1'
}
).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

@ -107,7 +107,8 @@
</el-table-column>
<el-table-column label="操作" align="center" width="200px">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-view" size="mini" @click="goView(row.CORPINFO_ID)"></el-button>
<el-button v-if="row.STATE !== '2'" type="primary" icon="el-icon-view" size="mini" @click="goView(row.CORPINFO_ID)"></el-button>
<el-button v-if="row.STATE === '2'" type="success" icon="el-icon-view" size="mini" @click="goView(row.CORPINFO_ID)"></el-button>
<el-button v-if="row.STATE === '1'" type="primary" icon="el-icon-s-check" size="mini" @click="handleAudit(row.CORPINFO_ID)"></el-button>
</template>
</el-table-column>

View File

@ -19,7 +19,7 @@
<span v-if="imgUrl != ''">
<div class="img-flex">
<viewer>
<img :src="imgUrl" width="40" height="40" style="object-fit: cover;">
<el-image :src="imgUrl" :preview-src-list="[imgUrl]" style="object-fit: cover; width: 40px; height: 40px" z-index="8000" />
</viewer>
</div>
</span>
@ -47,13 +47,13 @@
<span>
<div class="img-flex">
<viewer>
<img
<el-image
v-for="item in userCardIDPhotoFile"
:src="config.fileUrl + item.FILEPATH"
:key="item.IMGFILES_ID"
width="40"
height="40"
style="object-fit: cover;">
:preview-src-list="[config.fileUrl + item.FILEPATH]"
z-index="8000"
style="object-fit: cover; width: 40px; height: 40px"/>
</viewer>
</div>
</span>
@ -137,13 +137,13 @@
<td v-if="userDetailForm.ISPAY === '1'">
<span>
<viewer>
<img
<el-image
v-for="item in insuranceFileList"
:src="config.fileUrl + item.FILEPATH"
:key="item.IMGFILES_ID"
width="40"
height="40"
style="object-fit: cover;">
:preview-src-list="[config.fileUrl + item.FILEPATH]"
z-index="8000"
style="object-fit: cover; width: 40px; height: 40px"/>
</viewer>
</span>
</td>
@ -159,13 +159,13 @@
<td v-if="userDetailForm.IS_SIGN_LABOR === '1'" colspan="3">
<span>
<viewer>
<img
<el-image
v-for="item in contractFileList"
:src="config.fileUrl + item.FILEPATH"
:key="item.IMGFILES_ID"
width="40"
height="40"
style="object-fit: cover;">
:preview-src-list="[config.fileUrl + item.FILEPATH]"
z-index="8000"
style="object-fit: cover; width: 40px; height: 40px"/>
</viewer>
</span>
</td>
@ -178,13 +178,13 @@
<span>
<div class="img-flex">
<viewer>
<img
<el-image
v-for="item in photosOfLevel"
:src="config.fileUrl + item.FILEPATH"
:key="item.IMGFILES_ID"
width="40"
height="40"
style="object-fit: cover;">
:preview-src-list="[config.fileUrl + item.FILEPATH]"
z-index="8000"
style="object-fit: cover; width: 40px; height: 40px"/>
</viewer>
</div>
</span>
@ -268,17 +268,16 @@
<span>
<div class="img-flex">
<viewer>
<img
<el-image
:src="config.fileUrl + item.FILEPATH"
width="40"
height="40"
style="object-fit: cover;">
<img
:preview-src-list="[config.fileUrl + item.FILEPATH]"
z-index="8000"
style="object-fit: cover; width: 40px; height: 40px"/>
<el-image
v-if="item.FILEPATH_BACK"
:src="config.fileUrl + item.FILEPATH_BACK"
width="40"
height="40"
style="object-fit: cover;">
:preview-src-list="[config.fileUrl + item.FILEPATH_BACK]"
z-index="8000"
style="object-fit: cover; width: 40px; height: 40px"/>
</viewer>
</div>
</span>
@ -413,7 +412,7 @@
</el-scrollbar>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button @click="close"> </el-button>
</span>
</el-dialog>
</div>
@ -511,6 +510,19 @@ export default {
},
download(item) {
useDownloadFile(item)
},
close() {
this.visible = false
this.userDetailForm = {}
this.userCardIDPhotoFile = [] //
this.trainRecordList = []
this.photosOfLevel = [] //
this.specialUsersList = {}
this.insuranceFileList = [] //
this.contractFileList = []
this.socialPhotoFile = []
this.gongshangbaoxianFile = []
this.applyList = []
}
}
}