Merge branch 'pet' into liujun-2024-06-13-一公司人员定位新需求
commit
c56058b74d
|
@ -45,6 +45,7 @@
|
|||
<el-table-column prop="UNITS_PIC_NAME" label="相关方单位负责人" show-overflow-tooltip />
|
||||
<el-table-column prop="UNITS_PHONE" label="电话" show-overflow-tooltip />
|
||||
<el-table-column prop="CHECK_COUNT" label="安全环保检查次数" />
|
||||
<el-table-column prop="AI_COUNT" label="AI报警隐患数" />
|
||||
<el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="{row}">
|
||||
<el-button icon="el-icon-view" size="mini" @click="goDetail(row.OUTSOURCED_ID)">查看</el-button>
|
||||
|
|
|
@ -141,9 +141,16 @@
|
|||
|
||||
<el-dialog v-if="dialogVideoAll" :visible.sync="dialogVideoAll" :before-close="handleBack" title="视频" width="1200px">
|
||||
<!-- <iframe src="http://192.168.192.121:10800/?menu=no/#/screen" width="100%" height="500px" allowfullscreen allow="autoplay; fullscreen" style="position: relative;border:none"/>-->
|
||||
<div style="display: flex;flex-wrap: wrap;justify-content: space-between">
|
||||
<div v-for="(video,index) in videoList" :key="index" style="margin-bottom: 10px;width: 45%">
|
||||
<iframe v-if="video.GBSVIDEOURL" :src="video.GBSVIDEOURL" width="100%" height="380" allowfullscreen allow="autoplay; fullscreen;microphone" style="position: relative;border:none"/>
|
||||
<div style="display: flex;flex-wrap: wrap; gap:20px">
|
||||
<div v-for="(video,index) in videoList" :key="index" style="margin-bottom: 10px;width: 30%">
|
||||
<iframe
|
||||
v-if="video.GBSVIDEOURL"
|
||||
:src="video.GBSVIDEOURL"
|
||||
width="100%"
|
||||
height="250"
|
||||
allowfullscreen
|
||||
allow="autoplay; fullscreen;microphone"
|
||||
style="position: relative;border:none"/>
|
||||
<div v-if="video.HLSVIDEOURL" :id="'aLiVideoPlayer'+index" class="prism-player"/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -376,7 +383,7 @@ export default {
|
|||
// 五分钟关闭视频播放页面定时任务
|
||||
start() {
|
||||
console.log('定时器开启')
|
||||
this.timer = setInterval(this.closeVideoStart, (5 * 60 * 1000)) // 5分钟;
|
||||
// this.timer = setInterval(this.closeVideoStart, (5 * 60 * 1000)) // 5分钟;
|
||||
},
|
||||
over() {
|
||||
// 定时器手动关闭
|
||||
|
@ -411,7 +418,7 @@ export default {
|
|||
'id': 'aLiVideoPlayer',
|
||||
'source': res.data.url,
|
||||
'width': '100%',
|
||||
'height': '500px',
|
||||
'height': '380px',
|
||||
'autoplay': true,
|
||||
'isLive': true,
|
||||
'rePlay': false,
|
||||
|
@ -499,7 +506,7 @@ export default {
|
|||
'id': 'aLiVideoPlayer' + i,
|
||||
'source': this.videoList[i].HLSVIDEOURL.data.url,
|
||||
'width': '100%',
|
||||
'height': '500px',
|
||||
'height': '380px',
|
||||
'autoplay': true,
|
||||
'isLive': true,
|
||||
'rePlay': false,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -0,0 +1,512 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<el-form label-width="50px">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="名称:" >
|
||||
<el-input v-model="form.TEXT_NAME" placeholder="请输入" class="filter-item"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="false" :span="6">
|
||||
<el-form-item label="状态:">
|
||||
<el-select v-model="form.STATUS" placeholder="请选择" style="width: 100%;">
|
||||
<el-option label="正常" value="1"/>
|
||||
<el-option label="停用" value="0"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="分类:">
|
||||
<el-select v-model="form.TYPE" placeholder="请选择" style="width: 100%;">
|
||||
<el-option v-for="(item, index) in typeList" :key="index" :label="item.NAME" :value="item.DICTIONARIES_ID"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="false" :span="6">
|
||||
<el-form-item label="日期:">
|
||||
<el-date-picker v-model="form.DATE" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button v-waves v-if="false" 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="TYPE_NAME" label="分类"/>
|
||||
<el-table-column align="center" prop="TEXT_NAME" label="名称"/>
|
||||
<el-table-column align="center" prop="CODE_NAME" label="文号"/>
|
||||
<el-table-column align="center" prop="PUBLISHES" label="制定机关"/>
|
||||
<el-table-column align="center" prop="PUBLICATION_DATE" label="公布日期"/>
|
||||
<el-table-column align="center" prop="IMPLEMENTATION_DATE" label="施行日期"/>
|
||||
<el-table-column align="center" prop="REMARKS" label="备注"/>
|
||||
<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 align="center" prop="STATUS" label="状态" width="80px">
|
||||
<template slot-scope="{row}">
|
||||
{{ row.STATUS === '0' ? '停用' : '正常' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="390px">
|
||||
<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: '',
|
||||
DATE: '',
|
||||
TYPE: ''
|
||||
},
|
||||
label_name: '',
|
||||
|
||||
varList: [],
|
||||
pd: [],
|
||||
isEdit: false,
|
||||
isLook: false,
|
||||
title: '',
|
||||
typeList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getDic()
|
||||
},
|
||||
methods: {
|
||||
getRowKey(row) {
|
||||
return row.BLACKSPOT_ID
|
||||
},
|
||||
getQuery() {
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
this.getList()
|
||||
},
|
||||
addCondition() {
|
||||
this.$refs.condition.init()
|
||||
},
|
||||
getCondition(info) {
|
||||
this.form.CATEGORY_LIST = info.CATEGORY_LIST
|
||||
this.form.TYPES = info.TYPES
|
||||
this.form.SPECIFICATION_TYPES = info.SPECIFICATION_TYPES
|
||||
this.form.labels = info.LABELS
|
||||
},
|
||||
clearMessage() {
|
||||
this.label_name = ''
|
||||
this.form = {
|
||||
KEYWORDS: '',
|
||||
labels: [],
|
||||
CATEGORY_LIST: [],
|
||||
TYPES: [],
|
||||
SPECIFICATION_TYPES: [],
|
||||
STATUS: ''
|
||||
}
|
||||
this.$refs.condition.clear()
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/textLibrary/list?showCount=' + this.listQuery.limit + '¤tPage=' + 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,
|
||||
TYPE: this.form.TYPE,
|
||||
DATE: this.form.DATE,
|
||||
TEXT_NAME: this.form.TEXT_NAME,
|
||||
ASSOCIATION: '4',
|
||||
CORPINFO_ID: '0',
|
||||
MIGRATION_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
|
||||
})
|
||||
},
|
||||
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)
|
||||
})
|
||||
}
|
||||
},
|
||||
getDic() {
|
||||
requestFN(
|
||||
'dictionaries/getLevels', { DICTIONARIES_ID: '86ad14e9999b418aac2309744364e714' }
|
||||
).then((data) => {
|
||||
this.typeList = data.list
|
||||
}).catch((e) => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -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 + '¤tPage=' + 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: '4',
|
||||
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>
|
|
@ -0,0 +1,148 @@
|
|||
<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="TEXT_NAME">
|
||||
<el-input v-model="form.TEXT_NAME" disabled style="width: 70%"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" 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 v-if="false" 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="false" 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 v-if="false" 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 = []
|
||||
if (this.form.CATEGORY_LIST) {
|
||||
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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -0,0 +1,391 @@
|
|||
<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 TextEditing from '../../../util/textEditing.vue'
|
||||
|
||||
export default {
|
||||
components: { TextEditing, Pagination, editLabel, selectLabel, selectType, multipleChoice },
|
||||
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>
|
|
@ -0,0 +1,590 @@
|
|||
<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.KEYWORD" placeholder="请输入" class="filter-item"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="文件类型" label-width="200px">
|
||||
<el-select v-model="form.TYPE" placeholder="请选择" style="width: 100%;">
|
||||
<el-option v-for="(item, index) in typeList" :key="index" :label="item.NAME" :value="item.DICTIONARIES_ID"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="部门类型" label-width="200px">
|
||||
<el-select v-model="form.TYPE_TWO" placeholder="请选择" style="width: 100%;">
|
||||
<el-option v-for="(item, index) in typeTwoList" :key="index" :label="item.NAME" :value="item.DICTIONARIES_ID"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button v-waves v-if="false" 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" 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.TYPES"
|
||||
:key="tag.BUS_LIBRARY_LABELS_ID"
|
||||
:disable-transitions="false"
|
||||
type="warning"
|
||||
style="margin-right: 10px;margin-bottom: 10px">
|
||||
{{ tag.CATEGORY_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="TYPE_NAME" label="文件类型" />
|
||||
<el-table-column align="center" prop="TYPE_TWO_NAME" label="部门分类" />
|
||||
<el-table-column align="center" prop="UPLOAD_TIME" label="上传时间" />
|
||||
<el-table-column align="center" prop="UPLOAD_USER_NAME" label="上传人" />
|
||||
<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 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="12">
|
||||
<el-button v-show="!row.LOCKTOOL" type="primary" icon="el-icon-edit" size="mini" @click="handleExport(row)">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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-spe-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 updateLog from './updateLog.vue'
|
||||
import condition from './condition.vue'
|
||||
export default {
|
||||
components: { Pagination, editTextLibrary, textLibraryInfo, updateLog, condition },
|
||||
directives: { waves },
|
||||
data() {
|
||||
return {
|
||||
config: config,
|
||||
listLoading: true,
|
||||
add: false,
|
||||
del: false,
|
||||
edit: false,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
total: 0,
|
||||
form: {
|
||||
KEYWORD: '',
|
||||
TYPE: '',
|
||||
TYPE_TWO: '',
|
||||
labels: [],
|
||||
CATEGORY_LIST: [],
|
||||
TYPES: [],
|
||||
SPECIFICATION_TYPES: [],
|
||||
STATUS: ''
|
||||
},
|
||||
label_name: '',
|
||||
|
||||
varList: [],
|
||||
pd: [],
|
||||
isEdit: false,
|
||||
isLook: false,
|
||||
title: '',
|
||||
typeList: [],
|
||||
typeTwoList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getDic()
|
||||
},
|
||||
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: [],
|
||||
TYPE: '',
|
||||
TYPE_TWO: '',
|
||||
SPECIFICATION_TYPES: [],
|
||||
STATUS: ''
|
||||
}
|
||||
this.$refs.condition.clear()
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/textLibrary/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
||||
{
|
||||
KEYWORD: this.form.KEYWORD,
|
||||
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,
|
||||
TYPE: this.form.TYPE,
|
||||
TYPE_TWO: this.form.TYPE_TWO,
|
||||
ASSOCIATION: '0',
|
||||
MIGRATION_FLAG: '2',
|
||||
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
|
||||
})
|
||||
},
|
||||
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 + '¤tPage=' + 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)
|
||||
})
|
||||
}
|
||||
},
|
||||
getDic() {
|
||||
requestFN(
|
||||
'dictionaries/getLevels', { DICTIONARIES_ID: 'c1787df61ed24a3787897ae48bfd720a' }
|
||||
).then((data) => {
|
||||
this.typeList = data.list
|
||||
}).catch((e) => {
|
||||
this.loading = false
|
||||
})
|
||||
requestFN(
|
||||
'dictionaries/getLevels', { DICTIONARIES_ID: '72227a1259874470bb55760758b87c4d' }
|
||||
).then((data) => {
|
||||
this.typeTwoList = data.list
|
||||
}).catch((e) => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -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-spe-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 updateLog from './updateLog.vue'
|
||||
import UpdateLog from './updateLog.vue'
|
||||
import condition from './condition.vue'
|
||||
export default {
|
||||
components: { UpdateLog, Pagination, editTextLibrary, textLibraryInfo, 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 + '¤tPage=' + 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 === '2') {
|
||||
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>
|
|
@ -0,0 +1,145 @@
|
|||
<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 v-if="false" label="标准规范名称:" prop="FILE_NAME">
|
||||
<el-input v-model="form.REMARKS" disabled style="width: 70%"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" 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 v-if="false" 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="false" 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 v-if="false" 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 = []
|
||||
}).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>
|
|
@ -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>
|
|
@ -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>
|
Loading…
Reference in New Issue