Merge remote-tracking branch 'origin/pet' into dev

2024-07-22新BI页面
liujun 2024-06-18 19:41:19 +08:00
commit e9aa750a3d
38 changed files with 7350 additions and 28 deletions

View File

@ -108,6 +108,10 @@
<el-form-item label="摄像头编号" prop="CODE">
<el-input :disabled="true" v-model="addForm.info.CODE" placeholder="这里输入摄像头编号..." />
</el-form-item>
<el-form-item label="摄像头ID" prop="CAMERAID">
<el-input :disabled="false" v-model="addForm.info.CAMERAID" placeholder="这里输入摄像头ID..." />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="back"> </el-button>
@ -192,6 +196,7 @@ export default {
GATEVIDEO_ID: '',
VIDEONAME: '', //
CODE: '', //
CAMERAID: '',
PLATFORMVIDEOMANAGEMENT_ID: '',
LATITUDE: '',
LONGITUDE: ''
@ -199,7 +204,8 @@ export default {
zoom: 10,
rules: {
VIDEONAME: [{ required: true, message: '视频名称不能为空', trigger: 'blur' }],
CODE: [{ required: true, message: '摄像头编号不能为空', trigger: 'blur' }]
CODE: [{ required: true, message: '摄像头编号不能为空', trigger: 'blur' }],
CAMERAID: [{ required: true, message: '摄像头ID不能为空', trigger: 'blur' }]
},
dialogVideo: false,
dialogVideoHLS: false,
@ -216,10 +222,12 @@ export default {
dialogVisible: false,
rules: {
VIDEO_NAME: [{ required: true, message: '不可为空', trigger: 'blur' }],
CODE: [{ required: true, message: '不可为空', trigger: 'blur' }]
CODE: [{ required: true, message: '不可为空', trigger: 'blur' }],
CAMERAID: [{ required: true, message: '不可为空', trigger: 'blur' }]
},
info: {
AIBOX_ID: this.$parent.AIBOX_ID,
CAMERAID:'',
VIDEO_TYPE: 0,
VIDEO_NAME: '', //
VIDEO_URL: '',
@ -566,6 +574,7 @@ export default {
this.addForm.info.VIDEO_NAME = row.VIDEO_NAME
this.addForm.info.VIDEO_URL = row.VIDEO_URL
this.addForm.info.CODE = row.CODE
this.addForm.info.CAMERAID = row.CAMERAID
this.addForm.info.VIDEO_TYPE = parseInt(row.VIDEO_TYPE)
this.addForm.dialogType = 'edit'
this.addForm.dialogVisible = true
@ -623,6 +632,7 @@ export default {
VIDEO_TYPE: '',
VIDEO_NAME: '',
VIDEO_URL: '',
CAMERAID:'',
CODE: '',
LATITUDE: '',
LONGITUDE: '',

View File

@ -0,0 +1,800 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form label-width="100px">
<el-row>
<el-col :span="5">
<el-form-item label="关键字搜索">
<el-input v-model="VIDEONAME" placeholder="搜索关键字" />
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="视频类型">
<el-select v-model="VIDEO_TYPE">
<el-option label="移动" value="1"/>
<el-option label="平台" value="2"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="VIDEONAME" label="视频名称" >
<template slot-scope="{row}">
<span v-if="row.VIDEONAME">{{row.VIDEONAME}}</span>
<span v-else>{{row.NAME}}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="CODE" label="视频编码" />-->
<el-table-column prop="VIDEOURL" label="播放地址" >
<template slot-scope="{row}">
<span v-if="row.VIDEOURL">{{row.VIDEOURL}}</span>
<span v-else>{{row.REGIONPATH}}</span>
</template>
</el-table-column>
<el-table-column prop="POSITION" label="状态" width="100">
<template slot-scope="{row}">
<span v-if="row.LATITUDE && row.LONGITUDE"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column prop="ONLINE_STATUS" label="是否在线" width="100">
<template slot-scope="{row}">
<span v-if="row.ONLINE_STATUS">{{ row.ONLINE_STATUS }}</span>
<span v-else>/</span>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="500">
<template slot-scope="{row}">
<el-button type="success" icon="el-icon-caret-right" size="mini" @click="showVideo(row)"></el-button>
<el-button type="info" icon="el-icon-location-information" size="mini" @click="handleMap(row)"></el-button>
<el-button v-show="!row.PLATFORMVIDEOMANAGEMENT_ID" type="warning" icon="el-icon-caret-right" size="mini" @click="showVideoBack(row.VIDEOURL)"></el-button>
<el-button v-show="row.PLATFORMVIDEOMANAGEMENT_ID" type="warning" size="mini" @click="getRTSP(row)">rtsp</el-button>
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" plain @click="handleDelete(row.GATE_VIDEO_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group" style="margin-bottom: 50px;">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button type="success" icon="el-icon-caret-right" @click="showAll"></el-button>
<el-button icon="el-icon-arrow-left" @click="goBack"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog :visible.sync="dialogFormMap" title="定位" width="1050px" class="dy-dialog">
<div id="map" />
<div slot="footer" class="dialog-footer">
<span>经度</span>
<el-input v-model="form.LONGITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<span>纬度</span>
<el-input v-model="form.LATITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<el-button @click="dialogFormMap = false"> </el-button>
<el-button type="primary" @click="setPosition"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogForm" :title="msg==='add'?'新增':'编辑'" width="600px">
<el-form ref="form" :model="form" :rules="rules" label-width="110px" style="width: 500px;">
<el-form-item label="视频类型">
<el-radio-group v-model="form.VIDEO_TYPE" @change="changeType($event)">
<el-radio :label="1">移动摄像头</el-radio>
<el-radio :label="2">固定摄像头</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.VIDEO_TYPE===1" label="视频监控信息" prop="VIDEO_RESOURCES_ID">
<el-button type="success" icon="el-icon-caret-right" size="mini" @click="selectBobileVideo()"></el-button>
<!-- <el-select v-model="form.VIDEO_RESOURCES_ID" filterable placeholder="输入可筛选" @change="changeRid($event)">-->
<!-- <el-option-->
<!-- v-for="item in videoResourcesList"-->
<!-- :key="item.VIDEO_RESOURCES_ID"-->
<!-- :label="item.VIDEONAME"-->
<!-- :value="item.VIDEO_RESOURCES_ID"/>-->
<!-- </el-select>-->
</el-form-item>
<el-form-item v-if="form.VIDEO_TYPE===2" label="视频选择">
<el-button type="success" icon="el-icon-caret-right" size="mini" @click="selectVideo()"></el-button>
</el-form-item>
<el-form-item label="视频名称" prop="VIDEONAME">
<el-input :disabled="true" v-model="form.VIDEONAME" placeholder="这里输入视频名称..." />
</el-form-item>
<el-form-item v-if="form.VIDEO_TYPE===1" label="播放地址" prop="VIDEOURL">
<el-input :disabled="true" v-model="form.VIDEOURL" placeholder="这里输入播放地址..." />
</el-form-item>
<el-form-item label="摄像头编号" prop="CODE">
<el-input :disabled="true" v-model="form.CODE" placeholder="这里输入摄像头编号..." />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="back"> </el-button>
<el-button type="primary" @click="upload"> </el-button>
</div>
</el-dialog>
<el-dialog v-if="dialogVideo" :visible.sync="dialogVideo" :show-close="false" title="视频" width="600px">
<iframe :src="VIDEOURL" width="100%" height="380" allowfullscreen allow="autoplay; fullscreen;microphone" style="position: relative;border:none"/>
<div slot="footer" class="dialog-footer">
<el-button @click="back"> </el-button>
</div>
</el-dialog>
<el-dialog v-if="dialogVideoHLS" :visible.sync="dialogVideoHLS" :before-close="handleBack" :show-close="false" title="视频" width="600px">
<div id="aLiVideoPlayer" class="prism-player"/>
<div slot="footer" class="dialog-footer">
<el-button @click="back"> </el-button>
</div>
</el-dialog>
<el-dialog v-if="dialogVideoBack" :visible.sync="dialogVideoBack" :show-close="false" title="视频回放" width="800px">
<iframe :src="VIDEOURL" width="100%" height="620" allowfullscreen allow="autoplay; fullscreen;microphone" style="position: relative;border:none"/>
<div slot="footer" class="dialog-footer">
<el-button @click="back"> </el-button>
</div>
</el-dialog>
<el-dialog v-if="dialogVideoAll" :visible.sync="dialogVideoAll" :before-close="handleBack" :show-close="false" 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 v-if="video.HLSVIDEOURL" :id="'aLiVideoPlayer'+index" class="prism-player"/>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="back"> </el-button>
</div>
</el-dialog>
<platformvideo ref="platformvideo" @handleSelected="handleSelected"/>
<BobileCamer ref="bobileCamer" @bobilehandleSelected="bobilehandleSelected"/>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import Platformvideo from '@/views/keyprojects/videomanager/components/platformvideo.vue'
import BobileCamer from '@/views/keyprojects/videomanager/components/bobileCamer.vue'
export default {
components: { Platformvideo, Pagination, BobileCamer },
directives: { waves },
data() {
return {
map: null,
timer: '',
marker: null,
BMap: '',
clientHeight: 500,
inputLocation: '',
msg: 'add',
config: config,
listLoading: true,
dialogForm: false,
dialogImageUrl: '',
dialogVisible: false,
dialogSelect: false,
add: true,
del: true,
edit: true,
dialogFormMap: false,
listQuery: {
page: 1,
limit: 20
},
total: 0,
VIDEONAME: '',
VIDEO_TYPE: '',
dates: [],
videoList: [],
videoResourcesList: [],
varList: [],
LATITUDE: '',
LONGITUDE: '',
disabledForm: true,
form: {
VIDEO_RESOURCE_ID: '',
VIDEO_RESOURCES_ID: '',
VIDEO_TYPE: 0,
VIDEONAME: '', //
VIDEOURL: '',
CODE: '',
PLATFORMVIDEOMANAGEMENT_ID: '',
LATITUDE: '',
LONGITUDE: ''
},
zoom: 10,
rules: {
VIDEONAME: [{ required: true, message: '视频名称不能为空', trigger: 'blur' }],
VIDEOURL: [{ required: true, message: '播放地址不能为空', trigger: 'blur' }],
VIDEO_RESOURCES_ID: [{ required: true, message: '不能为空', trigger: 'change' }],
CODE: [{ required: true, message: '摄像头编号不能为空', trigger: 'blur' }]
},
dialogVideo: false,
dialogVideoHLS: false,
dialogVideoBack: false,
dialogVideoAll: false,
VIDEOURL: '',
player: {},
playerList: []
}
},
created() {
this.getList()
this.getVideoResourcesSelect()
},
beforeDestroy() {
this.map && this.map.removeEventListener('click', this.MapClick)
console.log('定时器关闭')
clearInterval(this.timer)
},
methods: {
//
start() {
console.log('定时器开启')
this.timer = setInterval(this.closeVideoStart, (5 * 60 * 1000)) // 5;
},
over() {
//
console.log('定时器自动关闭')
clearInterval(this.timer)
},
closeVideoStart() {
this.dialogVideo = false
this.dialogVideoHLS = false
this.dialogVideoBack = false
this.dialogVideoAll = false
this.over()
},
getVideoResourcesSelect() {
requestFN(
'/videoResources/listAll', {
UNITS_ID: this.$parent.UNITS_ID
}
).then((res) => {
this.videoResourcesList = res.varList
})
},
/**
* 初始化天地图对象
*/
initTDT() {
return new Promise((resolve, reject) => {
if (window.T) {
console.log('天地图初始化成功...')
resolve(window.T)
reject('error')
}
}).then(T => {
window.T = T
})
},
/**
* 初始化地图
* @param {*} lng 经度
* @param {*} lat 纬度
* @param {*} zoom 缩放比例(1~18)
*/
initMap(lng, lat, zoom) {
this.initTDT().then((T) => {
const imageURL = 'http://t0.tianditu.gov.cn/img_w/wmts?' + 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles' + '&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e8a16137fd226a62a23cc7ba5c9c78ce'
//
this.lay = new window.T.TileLayer(imageURL, { minZoom: 1, maxZoom: 18 })
//
this.map = new window.T.Map('map')
this.initCenter(lng, lat, zoom)
})
},
initCenter(lng, lat, zoom) {
//
if (!this.form.LONGITUDE && !this.form.LATITUDE) {
this.map.centerAndZoom(new window.T.LngLat(119.58, 39.94), zoom)
this.marker && this.map.removeOverLay(this.marker)
} else {
this.map.centerAndZoom(new window.T.LngLat(lng, lat), zoom)
this.marker && this.map.removeOverLay(this.marker)
this.form.LONGITUDE = lng
this.form.LATITUDE = lat
this.marker = new window.T.Marker(new window.T.LngLat(lng, lat))
//
this.map.addOverLay(this.marker)
}
//
this.map.setMapType(window.TMAP_HYBRID_MAP)
//
this.map.enableScrollWheelZoom()
//
this.map.enableInertia()
//
this.map.addEventListener('click', this.MapClick)
},
MapClick(event) {
this.marker && this.map.removeOverLay(this.marker)
this.form.LONGITUDE = event.lnglat.getLng()
this.form.LATITUDE = event.lnglat.getLat()
this.marker = new window.T.Marker(new window.T.LngLat(event.lnglat.getLng(), event.lnglat.getLat()))
//
this.map.addOverLay(this.marker)
},
handleMap(row) {
this.dialogFormMap = true
this.GATE_VIDEO_ID = row.GATE_VIDEO_ID
this.form = {
...this.form,
LATITUDE: row.LATITUDE,
LONGITUDE: row.LONGITUDE,
GATE_VIDEO_ID: row.GATE_VIDEO_ID
}
this.$nextTick(() => {
if (!this.map) this.initMap(this.form.LONGITUDE, this.form.LATITUDE, 16)
else this.initCenter(this.form.LONGITUDE, this.form.LATITUDE, 16)
})
},
getRowKey(row) {
return row.VIDEO_RESOURCE_ID
},
//
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
//
showVideo(row) {
// this.$message.warning('')
// this.start()
if (!row.PLATFORMVIDEOMANAGEMENT_ID) {
this.VIDEOURL = row.VIDEOURL
this.dialogVideo = true
} else {
requestFN(
'/platformvideomanagement/getHlsPath',
{
INDEXCODE: row.INDEXCODE
}
).then((res) => {
this.dialogVideoHLS = true
this.$nextTick(() => {
// eslint-disable-next-line no-undef
this.player = new Aliplayer({
'id': 'aLiVideoPlayer',
'source': res.data.url,
'width': '100%',
'height': '500px',
'autoplay': true,
'isLive': true,
'rePlay': false,
'playsinline': true,
'preload': true,
'controlBarVisibility': 'hover',
'useH5Prism': true
}, function(player) {
console.log('The player is created')
})
})
}).catch((e) => {
this.listLoading = false
this.over()
})
}
},
setPosition() {
this.dialogFormMap = false
this.listLoading = true
console.log(132)
requestFN(
'mkmjGateVideo/getVideo',
{
GATE_VIDEO_ID: this.GATE_VIDEO_ID
}
).then((data) => {
requestFN(
'/mkmjGateVideo/edit',
{
...data.pd,
LATITUDE: this.form.LATITUDE,
LONGITUDE: this.form.LONGITUDE,
GATE_VIDEO_ID: this.GATE_VIDEO_ID
}
).then(() => {
this.listLoading = false
this.dialogForm = false
this.getList()
}).catch(() => {
this.listLoading = false
})
}).catch(() => {
this.listLoading = false
})
},
getRTSP(row) {
requestFN(
'/platformvideomanagement/getRtspPath',
{
INDEXCODE: row.INDEXCODE
}
).then((res) => {
this.notify(res.data.url)
}).catch((e) => {
this.listLoading = false
})
},
//
showVideoBack(path) {
this.VIDEOURL = path.replace('play.html', 'playback.html')
this.dialogVideoBack = true
},
showAll() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要播放的视频...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.VIDEO_RESOURCE_ID
}).join(',')
this.videoList = []
this.listLoading = true
requestFN(
'/videomanager/goAllVideo',
{
DATA_IDS: ids
}
).then((data) => {
this.videoList = data.videoList
this.listLoading = false
this.dialogVideoAll = true
this.playerList = []
this.$nextTick(() => {
for (let i = 0; i < this.videoList.length; i++) {
if (!this.videoList[i].HLSVIDEOURL) continue
console.log(this.videoList[i].HLSVIDEOURL.data.url)
// eslint-disable-next-line no-undef
const player = new Aliplayer({
'id': 'aLiVideoPlayer' + i,
'source': this.videoList[i].HLSVIDEOURL.data.url,
'width': '100%',
'height': '500px',
'autoplay': true,
'isLive': true,
'rePlay': false,
'playsinline': true,
'preload': true,
'controlBarVisibility': 'hover',
'useH5Prism': true
}, function(player) {
console.log('The player is created')
})
this.playerList.push(player)
console.log(this.playerList)
}
})
}).catch((e) => {
this.listLoading = false
})
},
//
getList() {
this.listLoading = true
requestFN(
'/mkmjGateVideo/page?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
VIDEONAME: this.VIDEONAME,
VIDEO_TYPE: this.VIDEO_TYPE,
AREA_ID: this.$parent.CAMERA_TYPE === 'area' ? this.$parent.CAMERA_ID : '',
AREA_GATE_ID: this.$parent.CAMERA_TYPE === 'equipment' ? this.$parent.CAMERA_ID : ''
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
// this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
//
handleAdd() {
this.msg = 'add'
this.resetForm()
this.dialogForm = true
},
//
handleEdit(row) {
this.msg = 'edit'
this.getData(row)
this.form.GATE_VIDEO_ID = row.GATE_VIDEO_ID
this.dialogForm = true
},
selectVideo(row) {
this.$refs.platformvideo.init()
},
selectBobileVideo() {
this.$refs.bobileCamer.init(this.$parent.UNITS_ID)
},
bobilehandleSelected(row) {
this.$set(this.form, 'VIDEOURL', row.VIDEOURL)
this.$set(this.form, 'VIDEONAME', row.VIDEONAME)
this.$set(this.form, 'CODE', row.CODE)
this.$set(this.form, 'VIDEO_RESOURCES_ID', row.VIDEO_RESOURCES_ID)
},
handleSelected(row) {
this.$set(this.form, 'VIDEONAME', row.NAME)
this.$set(this.form, 'CODE', row.INDEXCODE)
this.$set(this.form, 'LATITUDE', row.LATITUDE)
this.$set(this.form, 'LONGITUDE', row.LONGITUDE)
this.$set(this.form, 'PLATFORMVIDEOMANAGEMENT_ID', row.PLATFORMVIDEOMANAGEMENT_ID)
},
//
getData(row) {
this.listLoading = true
requestFN(
'mkmjGateVideo/getVideo',
{
GATE_VIDEO_ID: row.GATE_VIDEO_ID,
}
).then((data) => {
Object.assign(this.form, data.pd)
if (this.form.PLATFORMVIDEOMANAGEMENT_ID) {
this.form.VIDEO_TYPE = 2
} else {
if (this.form.VIDEO_RESOURCES_ID) {
this.form.VIDEO_TYPE = 1
} else {
this.form.VIDEO_TYPE = 2
}
}
this.VIDEOURL = data.pd.VIDEOURL + '&aspect=600x380'
this.listLoading = false
}).catch((e) => {
this.listLoading = false
})
},
goBack() {
this.$parent.CAMERA_ID = ''
this.$parent.activeName = this.$parent.CAMERA_TYPE === 'area' ? 'List' : 'Equipment'
},
//
upload() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/mkmjGateVideo/' + this.msg,
{
VIDEO_RESOURCE_ID: this.form.VIDEO_TYPE === 1 ? this.form.VIDEO_RESOURCES_ID : this.form.PLATFORMVIDEOMANAGEMENT_ID,
VIDEONAME: this.form.VIDEONAME,
VIDEOURL: this.form.VIDEO_TYPE === 1 ? this.form.VIDEOURL : '',
CODE: this.form.CODE,
LONGITUDE: this.form.LONGITUDE,
LATITUDE: this.form.LATITUDE,
VIDEO_TYPE: this.form.VIDEO_TYPE,
AREA_ID: this.$parent.CAMERA_TYPE === 'area' ? this.$parent.CAMERA_ID : '',
AREA_GATE_ID: this.$parent.CAMERA_TYPE === 'equipment' ? this.$parent.CAMERA_ID : '',
DEVICE_TYPE: this.$parent.CAMERA_TYPE === 'area' ? 1 : 2,
GATE_VIDEO_ID: this.form.GATE_VIDEO_ID
}
).then((data) => {
this.listLoading = false
this.dialogForm = false
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
console.log(this.GATE_VIDEO_ID)
requestFN(
'/mkmjGateVideo/removeByIds',
{
GATE_VIDEO_IDS: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.GATE_VIDEO_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/videomanager/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
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 = 'videomanager:add,videomanager:del,videomanager:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.videomanagerfhadminadd //
this.del = data.videomanagerfhadmindel //
this.edit = data.videomanagerfhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
goKeyReset() {
this.VIDEONAME = ''
this.VIDEO_TYPE = ''
this.getList()
},
changeType(e) {
if (e === 1) {
this.form.VIDEO_TYPE = 1
} else {
this.form.VIDEO_TYPE = 2
}
this.form.VIDEO_RESOURCES_ID = ''
this.form.VIDEONAME = ''
this.form.VIDEOURL = ''
this.form.CODE = ''
},
changeRid(e) {
console.log(e)
this.disabledForm = true
requestFN(
'/videoResources/findById',
{
VIDEO_RESOURCES_ID: e
}
).then((data) => {
this.form.VIDEOURL = data.pd.VIDEOURL
this.form.VIDEONAME = data.pd.VIDEONAME
this.form.CODE = data.pd.CODE
}).catch((e) => {
})
},
back() {
console.log('手动关闭定时器')
clearInterval(this.timer)
if (this.dialogVideo) this.dialogVideo = false
if (this.dialogVideoBack) this.dialogVideoBack = false
if (this.dialogVideoAll) {
this.dialogVideoAll = false
for (let i = 0; i < this.playerList.length; i++) {
this.playerList[i].dispose()
}
}
if (this.dialogForm) this.dialogForm = false
if (this.dialogVideoHLS) {
this.dialogVideoHLS = false
this.player.dispose()
}
},
handleBack() {
if (this.dialogVideoAll) {
for (let i = 0; i < this.playerList.length; i++) {
this.playerList[i].dispose()
}
this.dialogVideoAll = false
}
if (this.dialogVideoHLS) {
this.player.dispose()
this.dialogVideoHLS = false
}
},
resetForm() {
this.form = {
VIDEO_RESOURCE_ID: '',
VIDEO_TYPE: 0,
VIDEONAME: '', //
VIDEOURL: '',
CODE: '',
PLATFORMVIDEOMANAGEMENT_ID: ''
}
}
}
}
</script>
<style>
.hide .el-upload--picture-card {
display: none;
}
#map{
width: 1000px;
height: 500px;
}
</style>

View File

@ -0,0 +1,428 @@
<template>
<div class="app-container">
<div class="rightCont">
<el-form label-width="50px">
<el-col :span="5">
<el-form-item label="通道名称:" label-width="110px">
<el-input v-model="searchForm.KEYWORDS" style="width:206px" placeholder="请输入内容"/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="通道状态" label-width="110px">
<el-select v-model="searchForm.PASSAGE_STATUS" placeholder="请选择">
<el-option v-for="(item,index) in passageStatusList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="通道类型" label-width="110px">
<el-select v-model="searchForm.PASSAGE_TYPE" placeholder="请选择">
<el-option v-for="(item,index) in passageTypeList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-form>
<div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
style="width: 100%">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="PASSAGE_NAME" label="通道名称"/>
<el-table-column label="通道类型">
<template slot-scope="{row}">
<span v-if="row.PASSAGE_TYPE==1"></span>
<span v-if="row.PASSAGE_TYPE==2"></span>
<span v-if="row.PASSAGE_TYPE==3"></span>
</template>
</el-table-column>
<el-table-column prop="DEVICE_COUNT" label="设备数"/>
<el-table-column label="操作" align="center" width="350px">
<template slot-scope="{row}">
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="handleAddOrEdit(row.PASSAGE_ID,'edit')"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="handleDelete(row.PASSAGE_ID,row.PASSAGE_NAME)"
>
删除
</el-button>
<el-button
type="success"
icon="el-icon-plus"
size="mini"
@click="handleAddEquipment(row.PASSAGE_ID)"
>
添加设备
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleAddOrEdit('','add')"></el-button>
<el-button icon="el-icon-arrow-left" @click="goBack"></el-button>
</div>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList"/>
</div>
</div>
</div>
<el-dialog :visible.sync="addDialog.visible" :title="addDialog.type === 'add' ? '新增' : '修改'">
<el-form ref="addFormRef" :model="addDialog.form" :rules="addDialog.rules" label-width="100px">
<el-row>
<el-col :span="24">
<el-form-item label="通道名称" prop="PASSAGE_NAME">
<el-input v-model="addDialog.form.PASSAGE_NAME" placeholder="请输入口门名称"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="通道类型" prop="PASSAGE_TYPE">
<el-select v-model="addDialog.form.PASSAGE_TYPE" placeholder="请选择" style="width: 100%">
<el-option v-for="(item,index) in passageTypeList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态" prop="PASSAGE_STATUS">
<el-select v-model="addDialog.form.PASSAGE_STATUS" placeholder="请选择" style="width: 100%">
<el-option v-for="(item,index) in passageStatusList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="经纬度" prop="LONGITUDE">
<div style="display: flex">
<el-input :value="addDialog.form.LONGITUDE + '---' + addDialog.form.LATITUDE" placeholder="请选择" disabled style="flex: 1"/>
<el-button style="margin-left: 10px" type="primary" @click="handleMap"></el-button>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button @click="addDialog.visible = false">关闭</el-button>
<el-button type="primary" @click="handleAddOrEditSubmit"></el-button>
</template>
</el-dialog>
<el-dialog :visible.sync="mapDialog.visible" title="定位" width="1050px">
<div id="map"/>
<template #footer>
<span>经度</span>
<el-input v-model="mapDialog.LONGITUDE" style="width: 200px" placeholder="请输入内容" disabled/>
<span>纬度</span>
<el-input v-model="mapDialog.LATITUDE" style="width: 200px" placeholder="请输入内容" disabled/>
<el-button @click="mapDialog.visible = false"> </el-button>
<el-button type="primary" @click="setPosition"> </el-button>
</template>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
varList: [],
listLoading: true,
add: false,
del: false,
edit: false,
searchForm: {
KEYWORDS: '',
PASSAGE_TYPE: '',
PASSAGE_STATUS: ''
},
total: 0,
listQuery: {
page: 1,
limit: 20
},
passageStatusList: [
{ value: '0', label: '停用' },
{ value: '1', label: '正常' },
{ value: '2', label: '暂时关闭' }
],
passageTypeList: [
{ value: '1', label: '人行通道' },
{ value: '2', label: '车型通道' },
{ value: '3', label: '综合通道' }
],
addDialog: {
visible: false,
type: '',
form: {
PASSAGE_NAME: '',
PASSAGE_TYPE: '',
PASSAGE_STATUS: '',
CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID,
LONGITUDE: '',
LATITUDE: ''
},
rules: {
PASSAGE_NAME: [
{ required: true, message: '请输入通道名称', trigger: 'blur' }
],
PASSAGE_TYPE: [
{ required: true, message: '请选择通道类型', trigger: 'change' }
],
PASSAGE_STATUS: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
}
},
mapDialog: {
visible: false,
LONGITUDE: '',
LATITUDE: ''
},
lay: null,
map: null,
marker: null
}
},
created() {
this.getList()
// this.hasButton()
this.getDict()
},
methods: {
getRowKey(row) {
return row.GATE_MACHINE_ID
},
//
getQuery() {
this.getList()
},
//
getList() {
this.listLoading = true
this.varList = []
requestFN(
'/mkmjPassage/page?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ ...this.searchForm, AREA_ID: this.$parent.AREA_ID }
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
// this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
goKeyReset() {
this.searchForm.KEYWORDS = ''
this.searchForm.PASSAGE_TYPE = ''
this.searchForm.PASSAGE_STATUS = ''
this.getList()
},
getDict() {
// requestFN(
// 'dictionaries/getLevels',
// {
// DICTIONARIES_ID: '1c73fa2717f2835165104aee234caefe'
// }
// ).then((data) => {
// this.areaRegionList = data.list
// })
// .catch((e) => {
// this.listLoading = false
// })
},
hasButton: function() {
var keys = 'fireresources:add,fireresources:del,fireresources:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.fireresourcesfhadminadd //
this.del = data.fireresourcesfhadmindel //
this.edit = data.fireresourcesfhadminedit //
this.toExcel = data.toExcel // excel
}).catch((e) => {
this.listLoading = false
})
},
handleDelete(id, name) {
this.$confirm('确定要删除名称为[' + name + ']的通道吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/mkmjPassage/removeByIds',
{
PASSAGE_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
async handleAddOrEdit(PASSAGE_ID, type) {
this.addDialog.visible = true
this.addDialog.type = type
await this.$nextTick()
this.$refs.addFormRef.resetFields()
if (type === 'edit') {
requestFN(
'/mkmjPassage/getPassage',
{ PASSAGE_ID }
).then((data) => {
this.addDialog.form = data.pd
}).catch((e) => {
})
}
},
handleMap() {
this.mapDialog.visible = true
this.$nextTick(() => {
if (!this.map) this.initMap(this.mapDialog.LONGITUDE, this.mapDialog.LATITUDE, 16)
else this.initCenter(this.mapDialog.LONGITUDE, this.mapDialog.LATITUDE, 16)
})
},
initTDT() {
return new Promise((resolve, reject) => {
if (window.T) {
resolve(window.T)
reject('error')
}
}).then(T => {
window.T = T
})
},
/**
* 初始化地图
* @param {*} lng 经度
* @param {*} lat 纬度
* @param {*} zoom 缩放比例(1~18)
*/
initMap(lng, lat, zoom) {
this.initTDT().then((T) => {
const imageURL = 'http://t0.tianditu.gov.cn/img_w/wmts?' + 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles' + '&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e8a16137fd226a62a23cc7ba5c9c78ce'
//
this.lay = new window.T.TileLayer(imageURL, { minZoom: 1, maxZoom: 18 })
//
this.map = new window.T.Map('map')
this.initCenter(lng, lat, zoom)
})
},
initCenter(lng, lat, zoom) {
//
if (!this.mapDialog.LONGITUDE && !this.mapDialog.LATITUDE) {
this.map.centerAndZoom(new window.T.LngLat(119.58, 39.94), zoom)
console.log(123)
} else {
this.map.centerAndZoom(new window.T.LngLat(lng, lat), zoom)
this.marker && this.map.removeOverLay(this.marker)
this.mapDialog.LONGITUDE = lng
this.mapDialog.LATITUDE = lat
this.marker = new window.T.Marker(new window.T.LngLat(lng, lat))
//
this.map.addOverLay(this.marker)
}
//
this.map.setMapType(window.TMAP_HYBRID_MAP)
//
this.map.enableScrollWheelZoom()
//
this.map.enableInertia()
//
this.map.addEventListener('click', this.MapClick)
},
MapClick(event) {
this.marker && this.map.removeOverLay(this.marker)
this.mapDialog.LONGITUDE = event.lnglat.getLng()
this.mapDialog.LATITUDE = event.lnglat.getLat()
this.marker = new window.T.Marker(new window.T.LngLat(event.lnglat.getLng(), event.lnglat.getLat()))
//
this.map.addOverLay(this.marker)
},
setPosition() {
this.addDialog.form.LATITUDE = this.mapDialog.LATITUDE
this.addDialog.form.LONGITUDE = this.mapDialog.LONGITUDE
this.mapDialog.visible = false
},
handleAddOrEditSubmit() {
this.$refs.addFormRef.validate((valid) => {
if (valid) {
requestFN(
'/mkmjPassage/' + this.addDialog.type,
{ ...this.addDialog.form, AREA_ID: this.$parent.AREA_ID }
).then((data) => {
this.addDialog.visible = false
this.$message.success('操作成功')
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
this.$message.warning('请填写完整信息')
}
})
},
handleAddEquipment(PASSAGE_ID) {
this.$parent.activeName = 'Equipment'
this.$parent.PASSAGE_ID = PASSAGE_ID
},
goBack() {
this.$parent.activeName = 'List'
this.$parent.AREA_ID = ''
}
}
}
</script>
<style scoped>
#map {
width: 1000px;
height: 500px;
}
</style>

View File

@ -0,0 +1,476 @@
<template>
<div class="app-container">
<div class="rightCont">
<el-form label-width="50px">
<el-col :span="5">
<el-form-item label="闸机名称:" label-width="110px">
<el-input v-model="searchForm.KEYWORDS" style="width:206px" placeholder="请输入内容"/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="通道状态" label-width="110px">
<el-select v-model="searchForm.GATE_STATUS" placeholder="请选择">
<el-option v-for="(item,index) in gateStatusList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="闸机类型" label-width="110px">
<el-select v-model="searchForm.GATE_TYPE" placeholder="请选择">
<el-option v-for="(item,index) in gateTypeList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="闸机类别" label-width="110px">
<el-select v-model="searchForm.GATE_CATEGORY" placeholder="请选择">
<el-option v-for="(item,index) in gateCategoryList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-form>
<div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
style="width: 100%">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="GATE_NAME" label="闸机名称"/>
<el-table-column label="闸机类型">
<template slot-scope="{row}">
<span v-if="row.GATE_TYPE==1"></span>
<span v-if="row.GATE_TYPE==2"></span>
</template>
</el-table-column>
<el-table-column label="闸机类别">
<template slot-scope="{row}">
<span v-if="row.GATE_CATEGORY==0"></span>
<span v-if="row.GATE_CATEGORY==1"></span>
<span v-if="row.GATE_CATEGORY==2"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="350px">
<template slot-scope="{row}">
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="handleAddOrEdit(row.AREA_GATE_ID,'edit')"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="handleDelete(row.AREA_GATE_ID,row.GATE_NAME)"
>
删除
</el-button>
<el-button
type="warning"
icon="el-icon-plus"
size="mini"
@click="handleAddCamera(row.AREA_GATE_ID)"
>
添加摄像头
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleAddOrEdit('','add')"></el-button>
<el-button icon="el-icon-arrow-left" @click="goBack"></el-button>
</div>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList"/>
</div>
</div>
</div>
<el-dialog :visible.sync="addDialog.visible" :title="addDialog.type === 'add' ? '新增' : '修改'">
<el-form ref="addFormRef" :model="addDialog.form" :rules="addDialog.rules" label-width="100px">
<el-row>
<el-col :span="24">
<el-form-item label="闸机名称" prop="GATE_NAME">
<el-input v-model="addDialog.form.GATE_NAME" placeholder="请输入口门名称"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="闸机类型" prop="GATE_TYPE">
<el-select v-model="addDialog.form.GATE_TYPE" placeholder="请选择" style="width: 100%">
<el-option v-for="(item,index) in gateTypeList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态" prop="GATE_STATUS">
<el-select v-model="addDialog.form.GATE_STATUS" placeholder="请选择" style="width: 100%">
<el-option v-for="(item,index) in gateStatusList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="闸机类别" prop="GATE_CATEGORY">
<el-select v-model="addDialog.form.GATE_CATEGORY" placeholder="请选择" style="width: 100%">
<el-option v-for="(item,index) in gateCategoryList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="闸机型号" prop="GATE_MODEL">
<el-input v-model="addDialog.form.GATE_MODEL" placeholder="请输入口门名称"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="闸机位置" prop="GATE_POSITION">
<el-input v-model="addDialog.form.GATE_POSITION" placeholder="请输入口门名称"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="经纬度" prop="LONGITUDE">
<div style="display: flex">
<el-input :value="addDialog.form.LONGITUDE + '---' + addDialog.form.LATITUDE" placeholder="请选择" disabled style="flex: 1"/>
<el-button style="margin-left: 10px" type="primary" @click="handleMap"></el-button>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button @click="addDialog.visible = false">关闭</el-button>
<el-button type="primary" @click="handleAddOrEditSubmit"></el-button>
</template>
</el-dialog>
<el-dialog :visible.sync="mapDialog.visible" title="定位" width="1050px">
<div id="map"/>
<template #footer>
<span>经度</span>
<el-input v-model="mapDialog.LONGITUDE" style="width: 200px" placeholder="请输入内容" disabled/>
<span>纬度</span>
<el-input v-model="mapDialog.LATITUDE" style="width: 200px" placeholder="请输入内容" disabled/>
<el-button @click="mapDialog.visible = false"> </el-button>
<el-button type="primary" @click="setPosition"> </el-button>
</template>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
varList: [],
listLoading: true,
add: false,
del: false,
edit: false,
searchForm: {
KEYWORDS: '',
GATE_TYPE: '',
GATE_STATUS: '',
GATE_CATEGORY: ''
},
total: 0,
listQuery: {
page: 1,
limit: 20
},
gateStatusList: [
{ value: 0, label: '停用' },
{ value: 1, label: '正常' },
{ value: 2, label: '暂时关闭' }
],
gateTypeList: [
{ value: '1', label: '入' },
{ value: '2', label: '出' }
],
gateCategoryList: [
{ value: '0', label: '人行口门' },
{ value: '1', label: '车行口门' },
{ value: '2', label: '综合口门' }
],
addDialog: {
visible: false,
type: '',
form: {
GATE_NAME: '',
GATE_TYPE: '',
GATE_STATUS: '',
GATE_CATEGORY: '',
GATE_MODEL: '',
GATE_POSITION: '',
CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID,
LONGITUDE: '',
LATITUDE: ''
},
rules: {
GATE_NAME: [
{ required: true, message: '请输入闸机名称', trigger: 'blur' }
],
GATE_TYPE: [
{ required: true, message: '请选择闸机类型', trigger: 'change' }
],
GATE_STATUS: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
GATE_CATEGORY: [
{ required: true, message: '请选择闸机类别', trigger: 'change' }
],
GATE_MODEL: [
{ required: true, message: '请输入闸机型号', trigger: 'blur' }
],
GATE_POSITION: [
{ required: true, message: '请输入闸机位置', trigger: 'blur' }
],
}
},
mapDialog: {
visible: false,
LONGITUDE: '',
LATITUDE: ''
},
lay: null,
map: null,
marker: null
}
},
created() {
this.getList()
// this.hasButton()
this.getDict()
},
methods: {
getRowKey(row) {
return row.GATE_MACHINE_ID
},
//
getQuery() {
this.getList()
},
//
getList() {
this.listLoading = true
this.varList = []
requestFN(
'/mkmjAreaGate/page?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ ...this.searchForm, PASSAGE_ID: this.$parent.PASSAGE_ID }
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
// this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
goKeyReset() {
this.searchForm.KEYWORDS = ''
this.searchForm.GATE_TYPE = ''
this.searchForm.GATE_CATEGORY = ''
this.searchForm.GATE_STATUS = ''
this.getList()
},
getDict() {
// requestFN(
// 'dictionaries/getLevels',
// {
// DICTIONARIES_ID: '1c73fa2717f2835165104aee234caefe'
// }
// ).then((data) => {
// this.areaRegionList = data.list
// })
// .catch((e) => {
// this.listLoading = false
// })
},
hasButton: function() {
var keys = 'fireresources:add,fireresources:del,fireresources:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.fireresourcesfhadminadd //
this.del = data.fireresourcesfhadmindel //
this.edit = data.fireresourcesfhadminedit //
this.toExcel = data.toExcel // excel
}).catch((e) => {
this.listLoading = false
})
},
handleDelete(id, name) {
this.$confirm('确定要删除名称为[' + name + ']的闸机吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/mkmjAreaGate/removeByIds',
{
AREA_GATE_IDS: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
async handleAddOrEdit(AREA_GATE_ID, type) {
this.addDialog.visible = true
this.addDialog.type = type
await this.$nextTick()
this.$refs.addFormRef.resetFields()
if (type === 'edit') {
requestFN(
'/mkmjAreaGate/getGate',
{ AREA_GATE_ID }
).then((data) => {
this.addDialog.form = data.pd
}).catch((e) => {
})
}
},
handleMap() {
this.mapDialog.visible = true
this.$nextTick(() => {
if (!this.map) this.initMap(this.mapDialog.LONGITUDE, this.mapDialog.LATITUDE, 16)
else this.initCenter(this.mapDialog.LONGITUDE, this.mapDialog.LATITUDE, 16)
})
},
initTDT() {
return new Promise((resolve, reject) => {
if (window.T) {
resolve(window.T)
reject('error')
}
}).then(T => {
window.T = T
})
},
/**
* 初始化地图
* @param {*} lng 经度
* @param {*} lat 纬度
* @param {*} zoom 缩放比例(1~18)
*/
initMap(lng, lat, zoom) {
this.initTDT().then((T) => {
const imageURL = 'http://t0.tianditu.gov.cn/img_w/wmts?' + 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles' + '&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e8a16137fd226a62a23cc7ba5c9c78ce'
//
this.lay = new window.T.TileLayer(imageURL, { minZoom: 1, maxZoom: 18 })
//
this.map = new window.T.Map('map')
this.initCenter(lng, lat, zoom)
})
},
initCenter(lng, lat, zoom) {
//
if (!this.mapDialog.LONGITUDE && !this.mapDialog.LATITUDE) {
this.map.centerAndZoom(new window.T.LngLat(119.58, 39.94), zoom)
console.log(123)
} else {
this.map.centerAndZoom(new window.T.LngLat(lng, lat), zoom)
this.marker && this.map.removeOverLay(this.marker)
this.mapDialog.LONGITUDE = lng
this.mapDialog.LATITUDE = lat
this.marker = new window.T.Marker(new window.T.LngLat(lng, lat))
//
this.map.addOverLay(this.marker)
}
//
this.map.setMapType(window.TMAP_HYBRID_MAP)
//
this.map.enableScrollWheelZoom()
//
this.map.enableInertia()
//
this.map.addEventListener('click', this.MapClick)
},
MapClick(event) {
this.marker && this.map.removeOverLay(this.marker)
this.mapDialog.LONGITUDE = event.lnglat.getLng()
this.mapDialog.LATITUDE = event.lnglat.getLat()
this.marker = new window.T.Marker(new window.T.LngLat(event.lnglat.getLng(), event.lnglat.getLat()))
//
this.map.addOverLay(this.marker)
},
setPosition() {
this.addDialog.form.LATITUDE = this.mapDialog.LATITUDE
this.addDialog.form.LONGITUDE = this.mapDialog.LONGITUDE
this.mapDialog.visible = false
},
handleAddOrEditSubmit() {
this.$refs.addFormRef.validate((valid) => {
if (valid) {
requestFN(
'/mkmjAreaGate/' + this.addDialog.type,
{ ...this.addDialog.form, PASSAGE_ID: this.$parent.PASSAGE_ID }
).then((data) => {
this.addDialog.visible = false
this.$message.success('操作成功')
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
this.$message.warning('请填写完整信息')
}
})
},
handleAddCamera(AREA_GATE_ID) {
this.$parent.activeName = 'Camera'
this.$parent.CAMERA_ID = AREA_GATE_ID
this.$parent.CAMERA_TYPE = 'equipment'
},
goBack() {
this.$parent.activeName = 'Channel'
this.$parent.PASSAGE_ID = ''
}
}
}
</script>
<style scoped>
#map {
width: 1000px;
height: 500px;
}
</style>

View File

@ -0,0 +1,473 @@
<template>
<div class="app-container">
<div class="rightCont">
<el-form label-width="50px">
<el-col :span="5">
<el-form-item label="口门名称:" label-width="110px">
<el-input v-model="searchForm.KEYWORDS" style="width:206px" placeholder="请输入内容"/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="口门状态" label-width="110px">
<el-select v-model="searchForm.AREA_STATUS" placeholder="请选择">
<el-option v-for="(item,index) in areaStatusList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="口门类型" label-width="110px">
<el-select v-model="searchForm.AREA_TYPE" placeholder="请选择">
<el-option v-for="(item,index) in areaTypeList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="所属区域" label-width="110px">
<el-select v-model="searchForm.BIANMA" placeholder="请选择">
<el-option v-for="(item,index) in areaRegionList" :key="index" :label="item.NAME" :value="item.BIANMA"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-form>
<div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
style="width: 100%">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="AREA_REGION" label="所属区域"/>
<el-table-column prop="AREA_NAME" label="口门名称"/>
<el-table-column label="口门类型">
<template slot-scope="{row}">
<span v-if="row.AREA_TYPE==1"></span>
<span v-if="row.AREA_TYPE==2"></span>
<span v-if="row.AREA_TYPE==3"></span>
</template>
</el-table-column>
<el-table-column label="地理位置">
<template slot-scope="{row}">
{{ row.LONGITUDE }}--{{ row.LATITUDE }}
</template>
</el-table-column>
<el-table-column prop="VIDEO_COUNT" label="视频个数"/>
<el-table-column label="操作" align="center" width="450px">
<template slot-scope="{row}">
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="handleAddOrEdit(row.AREA_ID,'edit')"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="handleDelete(row.AREA_ID,row.AREA_NAME)"
>
删除
</el-button>
<el-button
type="success"
icon="el-icon-plus"
size="mini"
@click="handleAddChannel(row.AREA_ID)"
>
添加通道
</el-button>
<el-button
type="warning"
icon="el-icon-plus"
size="mini"
@click="handleAddCamera(row.AREA_ID)"
>
添加摄像头
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleAddOrEdit('','add')"></el-button>
</div>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList"/>
</div>
</div>
</div>
<el-dialog :visible.sync="addDialog.visible" :title="addDialog.type === 'add' ? '新增' : '修改'">
<el-form ref="addFormRef" :model="addDialog.form" :rules="addDialog.rules" label-width="100px">
<el-row>
<el-col :span="24">
<el-form-item label="口门名称" prop="AREA_NAME">
<el-input v-model="addDialog.form.AREA_NAME" placeholder="请输入口门名称"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="口门类型" prop="AREA_TYPE">
<el-select v-model="addDialog.form.AREA_TYPE" placeholder="请选择" style="width: 100%">
<el-option v-for="(item,index) in areaTypeList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="所属区域" prop="AREA_PARENT_ID">
<el-select v-model="addDialog.form.AREA_PARENT_ID" placeholder="请选择" style="width: 100%">
<el-option v-for="(item,index) in areaRegionList" :key="index" :label="item.NAME" :value="item.BIANMA"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="口门位置" prop="AREA_RANGE">
<el-input v-model="addDialog.form.AREA_RANGE" placeholder="请输入口门位置"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态" prop="AREA_STATUS">
<el-select v-model="addDialog.form.AREA_STATUS" placeholder="请选择" style="width: 100%">
<el-option v-for="(item,index) in areaStatusList" :key="index" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="经纬度" prop="LONGITUDE">
<div style="display: flex">
<el-input :value="addDialog.form.LONGITUDE + '---' + addDialog.form.LATITUDE" placeholder="请选择" disabled style="flex: 1"/>
<el-button style="margin-left: 10px" type="primary" @click="handleMap"></el-button>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button @click="addDialog.visible = false">关闭</el-button>
<el-button type="primary" @click="handleAddOrEditSubmit"></el-button>
</template>
</el-dialog>
<el-dialog :visible.sync="mapDialog.visible" title="定位" width="1050px">
<div id="map"/>
<template #footer>
<span>经度</span>
<el-input v-model="mapDialog.LONGITUDE" style="width: 200px" placeholder="请输入内容" disabled/>
<span>纬度</span>
<el-input v-model="mapDialog.LATITUDE" style="width: 200px" placeholder="请输入内容" disabled/>
<el-button @click="mapDialog.visible = false"> </el-button>
<el-button type="primary" @click="setPosition"> </el-button>
</template>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
varList: [],
listLoading: true,
add: false,
del: false,
edit: false,
searchForm: {
KEYWORDS: '',
AREA_TYPE: '',
AREA_STATUS: '',
BIANMA: ''
},
total: 0,
listQuery: {
page: 1,
limit: 20
},
areaRegionList: [],
areaStatusList: [
{ value: '0', label: '停用' },
{ value: '1', label: '正常' },
{ value: '2', label: '暂时关闭' }
],
areaTypeList: [
{ value: '1', label: '人行口门' },
{ value: '2', label: '车型口门' },
{ value: '3', label: '综合口门' }
],
addDialog: {
visible: false,
type: '',
form: {
AREA_NAME: '',
AREA_RANGE: '',
AREA_LEVEL: '1',
AREA_PARENT_ID: '',
AREA_TYPE: '',
AREA_STATUS: '',
CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID,
LONGITUDE: '',
LATITUDE: ''
},
rules: {
AREA_NAME: [
{ required: true, message: '请输入口门名称', trigger: 'blur' }
],
AREA_TYPE: [
{ required: true, message: '请选择口门类型', trigger: 'change' }
],
AREA_PARENT_ID: [
{ required: true, message: '请选择所属区域', trigger: 'change' }
],
AREA_RANGE: [
{ required: true, message: '请输入口门位置', trigger: 'blur' }
],
AREA_STATUS: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
}
},
mapDialog: {
visible: false,
LONGITUDE: '',
LATITUDE: ''
},
lay: null,
map: null,
marker: null
}
},
created() {
this.getList()
// this.hasButton()
this.getDict()
},
methods: {
getRowKey(row) {
return row.GATE_MACHINE_ID
},
//
getQuery() {
this.getList()
},
//
getList() {
this.listLoading = true
this.varList = []
requestFN(
'/mkmjArea/page?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ ...this.searchForm }
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
// this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
goKeyReset() {
this.searchForm.KEYWORDS = ''
this.searchForm.AREA_TYPE = ''
this.searchForm.AREA_STATUS = ''
this.searchForm.BIANMA = ''
this.getList()
},
getDict() {
requestFN(
'dictionaries/getLevels',
{
DICTIONARIES_ID: '1c73fa2717f2835165104aee234caefe'
}
).then((data) => {
this.areaRegionList = data.list
})
.catch((e) => {
this.listLoading = false
})
},
hasButton: function() {
var keys = 'fireresources:add,fireresources:del,fireresources:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.fireresourcesfhadminadd //
this.del = data.fireresourcesfhadmindel //
this.edit = data.fireresourcesfhadminedit //
this.toExcel = data.toExcel // excel
}).catch((e) => {
this.listLoading = false
})
},
handleDelete(id, name) {
this.$confirm('确定要删除名称为[' + name + ']的口门吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/mkmjArea/removeByIds',
{
AREA_IDS: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
async handleAddOrEdit(AREA_ID, type) {
this.addDialog.visible = true
this.addDialog.type = type
await this.$nextTick()
this.$refs.addFormRef.resetFields()
if (type === 'edit') {
requestFN(
'/mkmjArea/getArea',
{ AREA_ID }
).then((data) => {
this.addDialog.form = data.pd
}).catch((e) => {
})
}
},
handleMap() {
this.mapDialog.visible = true
this.$nextTick(() => {
if (!this.map) this.initMap(this.mapDialog.LONGITUDE, this.mapDialog.LATITUDE, 16)
else this.initCenter(this.mapDialog.LONGITUDE, this.mapDialog.LATITUDE, 16)
})
},
initTDT() {
return new Promise((resolve, reject) => {
if (window.T) {
resolve(window.T)
reject('error')
}
}).then(T => {
window.T = T
})
},
/**
* 初始化地图
* @param {*} lng 经度
* @param {*} lat 纬度
* @param {*} zoom 缩放比例(1~18)
*/
initMap(lng, lat, zoom) {
this.initTDT().then((T) => {
const imageURL = 'http://t0.tianditu.gov.cn/img_w/wmts?' + 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles' + '&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e8a16137fd226a62a23cc7ba5c9c78ce'
//
this.lay = new window.T.TileLayer(imageURL, { minZoom: 1, maxZoom: 18 })
//
this.map = new window.T.Map('map')
this.initCenter(lng, lat, zoom)
})
},
initCenter(lng, lat, zoom) {
//
if (!this.mapDialog.LONGITUDE && !this.mapDialog.LATITUDE) {
this.map.centerAndZoom(new window.T.LngLat(119.58, 39.94), zoom)
console.log(123)
} else {
this.map.centerAndZoom(new window.T.LngLat(lng, lat), zoom)
this.marker && this.map.removeOverLay(this.marker)
this.mapDialog.LONGITUDE = lng
this.mapDialog.LATITUDE = lat
this.marker = new window.T.Marker(new window.T.LngLat(lng, lat))
//
this.map.addOverLay(this.marker)
}
//
this.map.setMapType(window.TMAP_HYBRID_MAP)
//
this.map.enableScrollWheelZoom()
//
this.map.enableInertia()
//
this.map.addEventListener('click', this.MapClick)
},
MapClick(event) {
this.marker && this.map.removeOverLay(this.marker)
this.mapDialog.LONGITUDE = event.lnglat.getLng()
this.mapDialog.LATITUDE = event.lnglat.getLat()
this.marker = new window.T.Marker(new window.T.LngLat(event.lnglat.getLng(), event.lnglat.getLat()))
//
this.map.addOverLay(this.marker)
},
setPosition() {
this.addDialog.form.LATITUDE = this.mapDialog.LATITUDE
this.addDialog.form.LONGITUDE = this.mapDialog.LONGITUDE
this.mapDialog.visible = false
},
handleAddOrEditSubmit() {
this.$refs.addFormRef.validate((valid) => {
if (valid) {
requestFN(
'/mkmjArea/' + this.addDialog.type,
{ ...this.addDialog.form }
).then((data) => {
this.addDialog.visible = false
this.$message.success('操作成功')
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
this.$message.warning('请填写完整信息')
}
})
},
handleAddChannel(AREA_ID) {
this.$parent.activeName = 'Channel'
this.$parent.AREA_ID = AREA_ID
},
handleAddCamera(AREA_ID) {
this.$parent.activeName = 'Camera'
this.$parent.CAMERA_ID = AREA_ID
this.$parent.CAMERA_TYPE = 'area'
}
}
}
</script>
<style scoped>
#map {
width: 1000px;
height: 500px;
}
</style>

View File

@ -0,0 +1,33 @@
<template>
<div>
<component :is="activeName" />
</div>
</template>
<script>
import List from './components/list.vue'
import Channel from './components/channel.vue'
import Equipment from './components/equipment.vue'
import Camera from './components/camera.vue'
export default {
components: {
List: List,
Channel: Channel,
Equipment: Equipment,
Camera: Camera
},
data() {
return {
activeName: 'List',
AREA_ID: '',
PASSAGE_ID: '',
CAMERA_TYPE: '',
CAMERA_ID: ''
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,159 @@
<template>
<div class="app-container">
<div class="rightCont">
<div>
<span @click="people" style="margin: 10px;">车行口门记录</span>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
:cell-style="getPlateColor"
style="width: 100%">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="vehicle_plate_number" label="车牌号" width="100px" align="center"/>
<el-table-column prop="vehicle_category_name" label="车辆类型" width="150px" align="center"/>
<el-table-column prop="vehicle_contact_name" label="车辆联系人" width="150ox" align="center"/>
<el-table-column prop="vehicle_contact_phone_number" label="联系人手机号" width="120px" align="center"/>
<el-table-column prop="vehicle_arrival_barrier" label="入港闸口" align="center"/>
<el-table-column prop="vehicle_arrival_time" label="入港时间" align="center"/>
<el-table-column prop="vehicle_departure_barrier" label="离港闸口" align="center"/>
<el-table-column prop="vehicle_departure_time" label="离港时间" align="center"/>
<el-table-column prop="vehicle_arrival_status" label="车辆在港状态" width="100px" align="center"/>
<el-table-column prop="vehicle_filing_info_recording_org" label="车辆备案单位" align="center"/>
<el-table-column prop="vehicle_filing_method" label="车辆备案方式" width="100px" align="center"/>
</el-table>
<div class="page-btn-group">
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList"/>
</div>
</div>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
varList: [],
pd: [],
}
},
mounted() {
this.getList()
this.getDict()
},
methods: {
getPlateColor(row , column , rowIndex , columnIndex){
if(row.column.label == '车牌号'){
switch(row.row.vehicle_plate_color){
case '蓝牌':
return 'background-color: blue;color: white'
break
case '黄牌':
return 'background-color: yellow;color: black'
break
case '新能源':
return 'background-color: green;color: white'
break
case '白牌':
return 'background-color: gray;color: black'
break
case '黑牌':
return 'background-color: black;color: white'
break
case '其他':
return 'background-color: white;color: black'
break
default:
return 'background-color: white;color: black'
}
}
},
getRowKey(row) {
return row.id_sequence
},
getQuery() {
this.getList()
},
//
getList() {
this.listLoading = true
this.varList = []
requestFN(
'/mkmjGateLog/page?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
people(){
this.$parent.activeName = 'peopleRecordList'
},
getDict() {
requestFN(
'/corpinfo/getSelectByCorpInfo',
{
}
).then((data) => {
this.corpList = JSON.parse(data.corpInfoJson)
}).catch((e) => {
})
requestFN(
'dictionaries/getLevels',
{
DICTIONARIES_ID: '6bba977985f6427e9d0b52afe8884d1a'
}
).then((data) => {
this.typeData = data.list
})
.catch((e) => {
this.listLoading = false
})
},
}
}
</script>
<style scoped>
.returnBtn {
float: right;
}
.app-container {
display: flex; /**/
align-items: baseline;
}
.rightCont {
width: 100%
}
</style>

View File

@ -0,0 +1,132 @@
<template>
<div class="app-container">
<div class="rightCont">
<div>
<span @click="car" style="margin: 10px;" >人行口门记录</span>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
style="width: 100%">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="departmentName" label="公司" align="center"/>
<el-table-column prop="personName" label="人员" width="100px" align="center"/>
<el-table-column prop="sex" label="性别" width="50px" align="center"/>
<el-table-column prop="inOrOut" label="类型" width="50px" align="center"/>
<el-table-column prop="regionName" label="区域名称" width="80px" align="center"/>
<el-table-column prop="channelName" label="通道名称" align="center"/>
<el-table-column prop="personType" label="身份类别" width="150px" align="center"/>
<el-table-column prop="cardNumber" label="卡号" width="100px" align="center"/>
<el-table-column prop="personCode" label="用户编号" width="100px" align="center"/>
<el-table-column prop="openType" label="验证方式" width="150px" align="center"/>
<el-table-column prop="reportTime" label="上报时间" align="center"/>
</el-table>
<div class="page-btn-group">
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList"/>
</div>
</div>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
varList: [],
pd: [],
}
},
mounted() {
this.getList()
this.getDict()
},
methods: {
getRowKey(row) {
return row.id_sequence
},
getQuery() {
this.getList()
},
//
getList() {
this.listLoading = true
this.varList = []
requestFN(
'/mkmjGateLog/peoplePage?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
car(){
this.$parent.activeName = 'carRecordList'
},
getDict() {
requestFN(
'/corpinfo/getSelectByCorpInfo',
{
}
).then((data) => {
this.corpList = JSON.parse(data.corpInfoJson)
}).catch((e) => {
})
requestFN(
'dictionaries/getLevels',
{
DICTIONARIES_ID: '6bba977985f6427e9d0b52afe8884d1a'
}
).then((data) => {
this.typeData = data.list
})
.catch((e) => {
this.listLoading = false
})
},
}
}
</script>
<style scoped>
.returnBtn {
float: right;
}
.app-container {
display: flex; /**/
align-items: baseline;
}
.rightCont {
width: 100%
}
</style>

View File

@ -0,0 +1,26 @@
<template>
<div>
<carRecordList v-show="activeName=='carRecordList'" ref="carRecordList" />
<peopleRecordList v-if="activeName=='peopleRecordList'" ref="peopleRecordList" />
</div>
</template>
<script>
import carRecordList from './components/carRecordList.vue'
import peopleRecordList from './components/peopleRecordList.vue'
export default {
components: {
carRecordList: carRecordList,
peopleRecordList:peopleRecordList
},
data() {
return {
activeName: 'carRecordList',
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,149 @@
<template>
<div class="app-container">
<div class="rightCont">
<div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
:cell-style="getPlateColor"
style="width: 100%">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="AREA_NAME" label="口门名称" align="center">
<template slot-scope="{row}">
<span @click="goPassage(row)" style="color:blue; text-decoration-line: underline;">{{ row.AREA_NAME }}</span>
</template>
</el-table-column>
<el-table-column prop="AREA_REGION" label="所属区域" align="center"/>
<el-table-column label="口门类型" align="center">
<template slot-scope="{row}">
<span v-if="row.AREA_TYPE==1"></span>
<span v-if="row.AREA_TYPE==2"></span>
<span v-if="row.AREA_TYPE==3"></span>
</template>
</el-table-column>
<el-table-column prop="CAR_IN" label="进入车辆" align="center"/>
<el-table-column prop="CAR_OUT" label="外出车辆" align="center"/>
<el-table-column prop="PEOPLE_IN" label="进入人员" align="center"/>
<el-table-column prop="PEOPLE_OUT" label="离开人员" align="center"/>
<el-table-column prop="" label="总计" align="center">
<template slot-scope="{row}">
{{ parseInt(row.CAR_IN) + parseInt(row.CAR_OUT) + parseInt(row.PEOPLE_IN) + parseInt(row.PEOPLE_OUT) }}
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList"/>
</div>
</div>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import { emit } from 'node-notifier';
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
varList: [],
pd: [],
}
},
created() {
this.getList()
this.getDict()
},
activated(){
this.getList()
},
methods: {
goPassage(row){
this.$parent.AREA_ID = row.AREA_ID
this.$parent.AREA_REGION = row.AREA_REGION
this.$parent.activeName = 'passageStatistics'
},
getRowKey(row) {
return row.id_sequence
},
getQuery() {
this.getList()
},
//
getList() {
this.listLoading = true
this.varList = []
requestFN(
'/mkmjGateStatistics/page?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
getDict() {
requestFN(
'/corpinfo/getSelectByCorpInfo',
{
}
).then((data) => {
this.corpList = JSON.parse(data.corpInfoJson)
}).catch((e) => {
})
requestFN(
'dictionaries/getLevels',
{
DICTIONARIES_ID: '6bba977985f6427e9d0b52afe8884d1a'
}
).then((data) => {
this.typeData = data.list
})
.catch((e) => {
this.listLoading = false
})
},
}
}
</script>
<style scoped>
.returnBtn {
float: right;
}
.app-container {
display: flex; /**/
align-items: baseline;
}
.rightCont {
width: 100%
}
</style>

View File

@ -0,0 +1,159 @@
<template>
<div class="app-container">
<div class="rightCont">
<div>
<el-page-header content="进出情况分析管理" @back="goBack"/>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
:cell-style="getPlateColor"
style="width: 100%">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="PASSAGE_NAME" label="通道名称" align="center"/>
<el-table-column prop="AREA_REGION" label="所属区域" align="center">
<template>
<span>{{this.$parent.AREA_REGION}}</span>
</template>
</el-table-column>
<el-table-column prop="PASSAGE_TYPE" label="通道类型" align="center">
<template slot-scope="{row}">
<span v-if="row.PASSAGE_TYPE==1"></span>
<span v-if="row.PASSAGE_TYPE==2"></span>
<span v-if="row.PASSAGE_TYPE==3"></span>
</template>
</el-table-column>
<el-table-column prop="CAR_IN" label="进入车辆" align="center"/>
<el-table-column prop="CAR_OUT" label="外出车辆" align="center"/>
<el-table-column prop="PEOPLE_IN" label="进入人员" align="center"/>
<el-table-column prop="PEOPLE_OUT" label="离开人员" align="center"/>
<el-table-column prop="" label="总计" align="center">
<template slot-scope="{row}">
{{ parseInt(row.CAR_IN) + parseInt(row.CAR_OUT) + parseInt(row.PEOPLE_IN) + parseInt(row.PEOPLE_OUT) }}
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList"/>
</div>
</div>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
AREA_ID: '',
AREA_REGION:'',
varList: [],
pd: [],
}
},
created() {
this.AREA_ID = this.$parent.AREA_ID
this.AREA_REGION = this.$parent.AREA_REGION
this.getList()
this.getDict()
},
methods: {
active(){
this.AREA_ID = this.$parent.AREA_ID
this.AREA_REGION = this.$parent.AREA_REGION
this.getList()
this.getDict()
},
goBack(){
this.$parent.AREA_ID = ''
this.$parent.AREA_REGION = ''
this.$parent.activeName = 'areaStatistics'
},
getRowKey(row) {
return row.id_sequence
},
getQuery() {
this.getList()
},
//
getList() {
this.listLoading = true
this.varList = []
requestFN(
'/mkmjGateStatistics/page?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page + '&AREA_ID=' + this.$parent.AREA_ID,
{
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
people(){
this.$parent.activeName = 'peopleRecordList'
},
getDict() {
requestFN(
'/corpinfo/getSelectByCorpInfo',
{
}
).then((data) => {
this.corpList = JSON.parse(data.corpInfoJson)
}).catch((e) => {
})
requestFN(
'dictionaries/getLevels',
{
DICTIONARIES_ID: '6bba977985f6427e9d0b52afe8884d1a'
}
).then((data) => {
this.typeData = data.list
})
.catch((e) => {
this.listLoading = false
})
},
}
}
</script>
<style scoped>
.returnBtn {
float: right;
}
.app-container {
display: flex; /**/
align-items: baseline;
}
.rightCont {
width: 100%
}
</style>

View File

@ -0,0 +1,35 @@
<template>
<div>
<areaStatistics v-show="activeName=='areaStatistics'" ref="areaStatistics" />
<passageStatistics v-show="activeName=='passageStatistics'" ref="passageStatistics" :AREA_ID="AREA_ID" :AREA_REGION="AREA_REGION"/>
</div>
</template>
<script>
import areaStatistics from './components/areaStatistics.vue'
import passageStatistics from './components/passageStatistics.vue'
export default {
watch: {
activeName(newVal, oldVal) {
if (newVal === 'passageStatistics') {
this.$refs.passageStatistics.active()
}
}
},
components: {
areaStatistics: areaStatistics,
passageStatistics: passageStatistics,
},
data() {
return {
activeName: 'areaStatistics',
AREA_ID:'',
AREA_REGION:''
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,12 @@
<script>
export default {
}
</script>
<template>
<router-view/>
</template>
<style scoped>
</style>

View File

@ -47,9 +47,10 @@
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="400">
<el-table-column label="操作" align="left" width="500px">
<template slot-scope="{row}">
<el-button v-show="!row.PLATFORMVIDEOMANAGEMENT_ID" type="success" icon="el-icon-edit" size="mini" @click="handleIn(row)"></el-button>
<el-button v-show="row.PLATFORMVIDEOMANAGEMENT_ID" type="warning" size="mini" style="margin: 0;" @click="getOutsourced(row)"></el-button>
<el-button type="success" icon="el-icon-caret-right" size="mini" @click="showVideo(row)"></el-button>
<el-button type="warning" size="mini" @click="getRTSP(row)">rtsp</el-button>
<el-button type="info" icon="el-icon-location-information" size="mini" @click="handleMap(row)"></el-button>
@ -89,6 +90,49 @@
<el-button type="primary" @click="setPosition"> </el-button>
</div>
</el-dialog>
<!-- 反查重点工程 -->
<el-dialog
:visible.sync="outsourcedListVisible"
:title="'绑定列表'"
width="80%">
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="outsourcedList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="OUTSOURCED_NAME" label="重点工程名称" show-overflow-tooltip />
<el-table-column prop="STATE" label="状态" width="100" >
<template slot-scope="{row}">
<span v-if="row.STATE == 0"></span>
<span v-if="row.STATE == 1"></span>
<span v-if="row.STATE == 2"></span>
<span v-if="row.STATE == -1"></span>
<span v-if="row.STATE == -2"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="400">
<template slot-scope="{row}">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="untie(row.VIDEOMANAGER_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="outsourcedListVisible = false"> </el-button>
</div>
</el-dialog>
<!-- 反查重点工程END -->
</div>
</template>
<script>
@ -110,6 +154,9 @@ export default {
page: 1,
limit: 20
},
outsourcedListVisible: false,//
controlRowTemp: null,// row
outsourcedList: [],//
total: 0,
KEYWORDS: '',
tempList: [],
@ -430,7 +477,53 @@ export default {
handleBack() {
this.player.dispose()
this.dialogVideoHLS = false
}
},
//
async getOutsourced (row){
this.listLoading = true
this.outsourcedListVisible = true
this.controlRowTemp = row
this.outsourcedList = []
requestFN(
`/videoResources/getRelevanceOutsourced?VIDEO_ID=${row.PLATFORMVIDEOMANAGEMENT_ID}`,
{
}
).then((data) => {
this.listLoading = false
this.outsourcedList = data.varList
}).catch((e) => {
this.listLoading = false
})
},
async untie(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
console.log(this.VIDEOMANAGER_ID)
requestFN(
'/videomanager/delete',
{
VIDEOMANAGER_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.getOutsourced(this.controlRowTemp)
this.listLoading = false
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
}
}
</script>

View File

@ -85,9 +85,15 @@
</el-table-column>
<el-table-column prop="CORP_NAME" label="创建人单位"/>
<el-table-column prop="CREATOR_NAME" label="创建人"/>
<el-table-column label="操作" width="300px">
<el-table-column label="操作" width="400px">
<template slot-scope="{row}">
<el-button type="success" icon="el-icon-caret-right" size="mini" @click="showVideo(row)"></el-button>
<el-button
v-show="row.ITEM_COUNT != 0"
type="success"
size="mini"
@click="getOutsourced(row)">查询绑定
</el-button>
<el-button
type="primary"
icon="el-icon-edit"
@ -194,6 +200,49 @@
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
<!-- 反查重点工程 -->
<el-dialog
:visible.sync="outsourcedListVisible"
:title="'绑定列表'"
width="80%">
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="outsourcedList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="OUTSOURCED_NAME" label="重点工程名称" show-overflow-tooltip />
<el-table-column prop="STATE" label="状态" width="100" >
<template slot-scope="{row}">
<span v-if="row.STATE == 0"></span>
<span v-if="row.STATE == 1"></span>
<span v-if="row.STATE == 2"></span>
<span v-if="row.STATE == -1"></span>
<span v-if="row.STATE == -2"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="400">
<template slot-scope="{row}">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="untie(row.VIDEOMANAGER_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="outsourcedListVisible = false"> </el-button>
</div>
</el-dialog>
<!-- 反查重点工程END -->
<el-drawer
:visible.sync="visible"
title="重点工程"
@ -245,6 +294,9 @@ export default {
dialogVideoHLS: false,
dialogVideoBack: false,
dialogVideoAll: false,
outsourcedListVisible: false,//
controlRowTemp: null,// row
outsourcedList: [],//
corpinfoAllList: [],
VIDEOURL: '',
player: {},
@ -667,7 +719,52 @@ export default {
this.form.UNITS_ID = ''
this.form.ONLINE_STATUS = ''
this.getList()
}
},
//
async getOutsourced (row){
this.listLoading = true
this.outsourcedListVisible = true
this.controlRowTemp = row
this.outsourcedList = []
requestFN(
`/videoResources/getRelevanceOutsourced?VIDEO_ID=${row.VIDEO_RESOURCES_ID}`,
{
}
).then((data) => {
this.listLoading = false
this.outsourcedList = data.varList
}).catch((e) => {
this.listLoading = false
})
},
async untie(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
console.log(this.VIDEOMANAGER_ID)
requestFN(
'/videomanager/delete',
{
VIDEOMANAGER_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.getOutsourced(this.controlRowTemp)
this.listLoading = false
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
}
}
</script>

View File

@ -11,7 +11,7 @@
<xf-point v-if="type === 'point'" :id="id" :type="type" :gangkou="gangkou"/>
<xf-control v-if="type === 'xfbf01' || type ==='xfkzs01' || type ==='xfjyd01' || type ==='xfsy01'" :id="id" :type="type" :gangkou="gangkou"/>
<alarm-device v-if="type === 'alarm'" :id="id" :type="type" :gangkou="gangkou"/>
<mk-gate-machine v-if="type === 'CAR'||type ==='PERSON' || type ==='CAMERA'" :id="id" :type="type" :gangkou="gangkou" :corp-id="corpInfoId"/>
<mk-gate-machine v-if="type === 'CAR'||type ==='PERSON' || type ==='CAMERA'" :id="id" :type="type" :gangkou="gangkou" :corp-id="corpInfoId" :GATE_VIDEO_ID="GATE_VIDEO_ID"/>
<mk-gate-machine-cfd v-if="type === 'CAR00004'||type ==='PERSON00004' " :id="id" :type="type" :gangkou="gangkou" :infoname="infoname"/>
<mk-gate-machine-cmt v-if="type === 'CAR00005'||type ==='PERSON00005' " :id="id" :type="type" :gangkou="gangkou" :infoname="infoname"/>
<zhong_da_info v-if="type === 'majordangersource'" :id="id" :type="type" :gangkou="gangkou"/>
@ -48,7 +48,7 @@
<breakgroundCfdD v-if="type === 'BREAKGROUND' && corpInfoId === '635917e77af8461691d5da5507b56347'" :id="id" :type="type"/>
<hoistingCfdD v-if="type === 'HOISTING' && corpInfoId === '635917e77af8461691d5da5507b56347'" :id="id" :type="type"/>
<peoplePositionCfdD v-if="type === 'peoplePosition'" :id="id" :type="type" :infoname="infoname"/>
<peoplePositionCzks v-if="type === 'peoplePositionCzks'" :id="id" :type="type" />
<peoplePositionCzks v-if="type === 'peoplePositionCzks'" :id="id" :type="type" :ry-dept-name="RyDeptName" :ry-post-name="RyPostName" :ry-real-name="RyRealName" :person-type-name="personTypeName" />
<peoplePositionCmt v-if="type === 'peoplePositionCmt'" :id="id" :type="type" :infoname="infoname"/>
<carPositionCfdD v-if="type === 'carPosition'" :id="id" :type="type" :infoname="infoname"/>
<!--曹妃甸东 八项作业 曹实业详细页面 end-->
@ -193,7 +193,31 @@ export default {
name: {
type: String,
default: ''
}
},
personPhoto: {
type: String,
default: ''
},
RyDeptName: {
type: String,
default: ''
},
RyPostName: {
type: String,
default: ''
},
RyRealName: {
type: String,
default: ''
},
personTypeName: {
type: String,
default: ''
},
GATE_VIDEO_ID: {
type: String,
default: ''
},
},
methods: {
closeDialog() {

View File

@ -1,5 +1,5 @@
<template>
<div class="app-container print-work">
<div class="app-container print-work" v-if="corpId == '035958e685cf4850bc40151c5e0617a6' ">
<div v-if= "type !== 'CAMERA'" class="level-title">
<h1>区域名称{{ info.GATE_AREA_NAME }}</h1>
</div>
@ -30,7 +30,7 @@
<td>状态</td>
</tr>
<tr v-for="(item,index) in recordAllList" :key="index">
<td>{{ item.CARDTYPE }}</td>
<td>{{ item.CARDTYPE }}</td>
<td>{{ item.USERNAME }}</td>
<td>{{ item.TIME }}</td>
<td>
@ -55,6 +55,80 @@
<video-play v-if="type === 'CAMERA' && info.GATEVIDEO_ID" :id="info.GATEVIDEO_ID" :type="type" :gangkou="gangkou"/>
</div>
</div>
<div class="app-container print-work" v-else>
<div v-if= "type !== 'CAMERA'" class="level-title">
<h1>区域名称{{ info.GATE_AREA_NAME }}</h1>
</div>
<table v-for="(item,index) in varList" :key="index" v-if= "type !== 'CAMERA'" class="table-ui">
<tr>
<td class="bbg-transparent">闸机名称</td>
<td colspan="5">{{ item.GATE_NAME }}</td>
</tr>
<tr>
<td class="bbg-transparent">今日进</td>
<td width="80px">{{ item.CAR_IN}}</td>
<td class="bbg-transparent">今日出</td>
<td width="80px">{{ item.CAR_OUT}}</td>
<td class="bbg-transparent">当前滞留</td>
<td width="80px">{{ item.CAR_IN - item.CAR_OUT}}</td>
</tr>
</table>
<table class="table-ui">
<tr v-if="carRecordAllList != null && carRecordAllList.length > 0">
<td colspan="6">
<table class="table-ui">
<tr>
<td class="bbg-transparent">车牌</td>
<td class="bbg-transparent">时间</td>
<td class="bbg-transparent">闸机</td>
<td class="bbg-transparent">状态</td>
</tr>
<tr v-for="(item,index) in carRecordAllList" :key="index">
<td>{{ item.LICENSE_PLATE }}</td>
<td>{{ item.TIME }}</td>
<td>{{ item.COMING_REASON }}</td>
<td>{{ item.STATE == '0' ? '进港': '出港' }}</td>
</tr>
</table>
</td>
</tr>
<tr v-if="recordAllList != null && recordAllList.length > 0">
<td colspan="6">
<table class="table-ui">
<tr>
<td>卡号</td>
<td>人员姓名</td>
<td>刷卡时间</td>
<td>闸机</td>
<td>状态</td>
</tr>
<tr v-for="(item,index) in recordAllList" :key="index">
<td>{{ item.CARDTYPE }}</td>
<td>{{ item.USERNAME }}</td>
<td>{{ item.TIME }}</td>
<td>{{ item.EQUIPMENTNAME }}</td>
<td>
<span v-if="item.STATE == '0'"></span>
<span v-if="item.STATE == '1'"></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div v-if= "type == 'CAMERA'" class="level-title">
<h1>摄像头名称{{ info.VIDEONAME }}</h1>
</div>
<table v-if= "type == 'CAMERA'" class="table-ui">
<tr>
<td class="bbg-transparent">编码</td>
<td >{{ info.CODE }}</td>
</tr>
</table>
<div class="video">
<video-play v-if="type === 'CAMERA' && info.GATEVIDEO_ID" :id="info.GATEVIDEO_ID" :type="type" :gangkou="gangkou"/>
</div>
</div>
</template>
<script>
@ -85,13 +159,21 @@ export default {
default() {
return ''
}
},
GATE_VIDEO_ID: {
type: String,
default() {
return ''
}
}
},
data() {
return {
config: config,
info: {},
recordAllList: []
recordAllList: [],
varList:[],
carRecordAllList:[]
}
},
@ -112,6 +194,7 @@ export default {
'/map/getGatesInAndOutNumById',
{
GATE_AREA_ID: this.id,
GATE_VIDEO_ID: this.GATE_VIDEO_ID,
TYPE: this.type,
GANGKOU: this.gangkou,
CORPINFO_ID: this.corpId
@ -124,12 +207,11 @@ export default {
this.info.CAR_OUT = 0
this.info.PERSON_IN = 0
this.info.PERSON_OUT = 0
this.varList = data.pd.varList
for (let i = 0; i < data.pd.varList.length; i++) {
if (data.pd.varList[i].TYPE == 'CAR_IN') {
this.info.CAR_IN = data.pd.varList[i].COUNT
}
if (data.pd.varList[i].TYPE == 'CAR_OUT') {
this.info.CAR_OUT = data.pd.varList[i].COUNT
if (this.type == 'CAR') {
this.info.CAR_IN = data.pd.varList[i].CAR_IN
this.info.CAR_OUT = data.pd.varList[i].CAR_OUT
}
if (data.pd.varList[i].TYPE == 'PERSON_IN') {
this.info.PERSON_IN = data.pd.varList[i].COUNT
@ -149,12 +231,14 @@ export default {
'/map/getGatesInAndOutListById?showCount=10000&currentPage=1',
{
GATE_AREA_ID: this.id,
GATE_VIDEO_ID: this.GATE_VIDEO_ID,
TYPE: this.type,
GANGKOU: this.gangkou,
CORPINFO_ID: this.corpId
}
).then((data) => {
this.recordAllList = data.recordAllList
this.carRecordAllList = data.carRecordAllList
this.$forceUpdate()
}).catch((e) => {
})

View File

@ -9,19 +9,19 @@
<td><img :src="'http://172.16.130.86/gateway-service/fileStatic/'+personPhoto" alt="" width="50" height="50">
</td>
<td class="bbg-transparent">姓名</td>
<td>{{ info ? info.NAME : '' }}</td>
<td >{{ info?info.NAME:RyRealName }}</td>
</tr>
<tr>
<td class="bbg-transparent">部门</td>
<td>{{ info ? info.DEPARTMENT_NAME : '' }}</td>
<td >{{ info?info.DEPARTMENT_NAME:RyDeptName }}</td>
<td class="bbg-transparent">岗位</td>
<td>{{ info ? info.POST_NAME : '' }}</td>
<td >{{ info?info.POST_NAME:RyPostName }}</td>
</tr>
<tr>
<td class="bbg-transparent">人员类型</td>
<td>{{ info ? info.PERSON_TYPE : '' }}</td>
<td >{{ info?info.PERSON_TYPE:personTypeName }}</td>
<td class="bbg-transparent">是否为隐患确认人</td>
<td>{{ info.IS_HAZARDCONFIRMER == 0 ? '否' : '是' }}</td>
<td >{{ info?info.IS_HAZARDCONFIRMER == 1 ?'是':'否' :'否' }}</td>
</tr>
</table>
</div>
@ -49,6 +49,30 @@ export default {
default() {
return ''
}
},
RyDeptName: {
type: String,
default() {
return ''
}
},
RyPostName: {
type: String,
default() {
return ''
}
},
RyRealName: {
type: String,
default() {
return ''
}
},
personTypeName: {
type: String,
default() {
return ''
}
}
},
data() {

View File

@ -239,6 +239,12 @@
:gangkou="gangkouActive"
:infoname="dialog.infoname"
:name="dialog.name"
:GATE_VIDEO_ID="dialog.GATE_VIDEO_ID"
:person-photo="dialog.personPhoto"
:ry-dept-name="dialog.RyDeptName"
:ry-post-name="dialog.RyPostName"
:ry-real-name="dialog.RyRealName"
:person-type-name="dialog.personTypeName"
/>
</div>
</template>
@ -460,11 +466,11 @@ export default {
eliminateAuthorization: [],
list: [
{
label: '车辆',
label: '口门',
dialog_width: '600px',
check: false,
img: require('../../assets/map/gangkou_index/buttom/ico2.png'),
checkImg: require('../../assets/map/gangkou_index/buttom/ico2_on.png'),
img: require('../../assets/map/gangkou_index/buttom/ico1.png'),
checkImg: require('../../assets/map/gangkou_index/buttom/ico1_on.png'),
type: 'CAR',
containAuthorization: [],
eliminateAuthorization: []
@ -864,7 +870,13 @@ export default {
id: '',
corpInfoId: '',
width: '',
infoname: ''
infoname: '',
personPhoto: '',
RyDeptName: '',
RyPostName: '',
RyRealName: '',
personTypeName: '',
GATE_VIDEO_ID:''
},
/* 曹妃甸使用参数开始*/
//
@ -1372,6 +1384,13 @@ export default {
}
const point_type = pick.id._monitoItems.data.point_type
const point_id = pick.id._monitoItems.data.id
if (point_type == '标记点CAMERA'){
const { GATE_VIDEO_ID } = pick.id._monitoItems.data
alert(GATE_VIDEO_ID)
alert(pick.id._monitoItems.data)
console.log(pick.id._monitoItems.data)
this.dialog.GATE_VIDEO_ID = GATE_VIDEO_ID
}
if (point_type === '报警') {
viewer.dataSources.remove(this.myEntityCollection[pick.id._monitoItems.data.id])
delete this.poinEntity[pick.id._monitoItems.data.id]
@ -1381,7 +1400,7 @@ export default {
this.bubble(id)
}
if (this.gangkouActive === '00002' && point_type === 'peoplePositionCzks') {
const { label, point_type, id, corpInfoId, name, infoname } = pick.id._monitoItems.data
const { label, point_type, id, corpInfoId, name, infoname, personPhoto, RyDeptName, RyPostName, RyRealName, personTypeName } = pick.id._monitoItems.data
this.dialog.visible = true
this.dialog.title = label
this.dialog.type = point_type
@ -1389,6 +1408,11 @@ export default {
this.dialog.name = name
this.dialog.infoname = infoname
this.dialog.corpInfoId = corpInfoId
this.dialog.personPhoto = personPhoto
this.dialog.RyDeptName = RyDeptName
this.dialog.RyPostName = RyPostName
this.dialog.RyRealName = RyRealName
this.dialog.personTypeName = personTypeName
}
if (this.gangkouActive === '00004' && point_type.indexOf('标记点') !== -1 && (point_id.substring(0, 1) === '0' || point_id.substring(0, 1) === '3' || point_id.substring(0, 3) === '1_2' || point_id.substring(0, 3) === '2_8')) {
// if (this.gangkouActive === '00004' && point_type.indexOf('') !== -1 && point_id.substring(0, 1) === '0' || point_id.substring(0, 1) === '5') {
@ -2542,9 +2566,14 @@ export default {
icon_type: 'img4_0_1',
infoname: item.realName,
personPhoto: item.personPhoto,
RyDeptName: item.deptName,
RyPostName: item.postName,
RyRealName: item.realName,
personTypeName: item.personTypeName,
data_id: item.cardId + '',
point_type: 'peoplePositionCzks',
label: item.realName
label: item.realName,
}
czksPerLoc.push(perLoc)
ry_drag.addEntity(perLoc)

View File

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

View File

@ -0,0 +1,41 @@
<template>
<div class="app-container">
<el-tabs v-model="vectory" type="border-card" @tab-click="changTab">
<el-tab-pane label="法律法规数据库" name="list">
<list v-if="vectory === 'list'"/>
</el-tab-pane>
<el-tab-pane v-if="false" label="企业端数据" name="listEm">
<ListEm v-if="vectory === 'listEm'"/>
</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: 'list'
}
},
created() {
},
methods: {
changTab(title) {
console.log(title.label)
if (title.label === '运营端数据') { this.vectory = 'list' }
if (title.label === '企业端数据') { this.vectory = 'listEm' }
}
}
}
</script>

View File

@ -0,0 +1,415 @@
<template>
<el-dialog v-loading="loading" v-if="dialogVisible" :visible.sync="dialogVisible" :before-close="goBack" :title="title">
<el-form ref="form" :model="form" :rules="rules" label-width="180px">
<el-form-item label="分类:" prop="TYPE_INFO">
<el-select v-model="form.TYPE_INFO" 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-form-item label="名称:" prop="TEXT_NAME">
<el-input v-model="form.TEXT_NAME" style="width: 100%"/>
</el-form-item>
<el-form-item label="文号:" prop="CODE_NAME">
<el-input v-model="form.CODE_NAME" style="width: 100%"/>
</el-form-item>
<el-form-item label="制定机关:" prop="PUBLISHES">
<el-input v-model="form.PUBLISHES" style="width: 100%"/>
</el-form-item>
<el-form-item label="公布日期:" prop="PUBLICATION_DATE">
<el-date-picker v-model="form.PUBLICATION_DATE" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%"/>
</el-form-item>
<el-form-item label="施行日期:" prop="IMPLEMENTATION_DATE">
<el-date-picker v-model="form.IMPLEMENTATION_DATE" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%"/>
</el-form-item>
<el-form-item label="备注:" prop="REMARKS">
<el-input v-model="form.REMARKS" style="width: 100%"/>
</el-form-item>
<el-form-item v-if="remoteControl.keyOne && false" label="国民经济行业类型:" prop="SPECIFICATION_TYPES">
<multiple-choice
:dynamic-tags.sync="form.SPECIFICATION_TYPES"
:labels="industryTypeList"
:row-key="key.specificationTypeKey"
:row-name="key.specificationTypeName"
:check-strictly="false"
lazy/>
</el-form-item>
<el-form-item 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="false" label="添加文件内容:">
<el-button size="small" type="primary" @click="openTextEdit()"></el-button>
</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},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 v-if="false" 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/upload-file/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 {
config: config,
dialogVisible: false,
form: {
REMARKS: '',
FILE: [],
labels: [''],
TYPE: '',
TYPES: [''],
SPECIFICATION_TYPES: [''],
CATEGORY_LIST: [''],
STATUS: '',
ASSOCIATION: '4',
types: [],
specification_types: [],
category_list: [],
TEXT_INFO: '',
TEXT_NAME: '',
CODE_NAME: '',
PUBLISHES: '',
PUBLICATION_DATE: '',
IMPLEMENTATION_DATE: '',
typeInfo: '',
TYPE_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: {
CODE_NAME: [{ required: true, message: '请输入文号', trigger: 'change' }],
TYPE_INFO: [{ required: true, message: '请选择类型', trigger: 'change' }],
PUBLISHES: [{ required: true, message: '请输入制定机关', trigger: 'change' }],
TEXT_NAME: [{ required: true, message: '请输入名称', trigger: 'change' }],
PUBLICATION_DATE: [{ required: true, message: '请选择公布日期', trigger: 'change' }],
IMPLEMENTATION_DATE: [{ required: true, message: '请选择施行日期', trigger: 'change' }],
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')
this.form.TYPE_INFO = this.form.TYPE
this.$set(this.form, 'TYPE_INFO', this.form.TYPE)
}).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))
formData.append('TYPE', this.form.TYPE_INFO)
const type = this.typeList[this.typeList.findIndex(item => item.DICTIONARIES_ID === this.form.TYPE_INFO)]
formData.append('TYPE_NAME', type.NAME)
upload(
'/textLibrary/init',
formData
).then((data) => {
loading.close()
this.dialogVisible = false
this.$emit('logical-end', { result: 'OK' })
this.$message.success('保存成功')
this.clear()
}).catch((e) => {
loading.close()
console.log(e)
})
this.clear()
} else {
return false
}
})
},
checkForm() {
console.log(this.form.labels.length, 'this.form.labels.length')
console.log(this.form.labels, 'this.form.labels')
if (this.form.labels.length > 15) {
this.$message.error('关联标签数不能超过15个')
return true
}
},
goBack() {
this.dialogVisible = false
this.clear()
this.$emit('goBack', this.e)
},
getChooseTage(e) {
if (e.TYPE === '0') {
const list = e.e
for (const listKey in list) {
const index = this.form.labels.findIndex(item => {
item.BUS_LABEL_FACTORY_ID === list[listKey].BUS_LABEL_FACTORY_ID
})
if (index < 0) {
const label = JSON.parse(JSON.stringify(list[listKey]))
label.label = label.NAME
label.value = JSON.stringify(list[listKey])
const index = this.form.labels.findIndex(item => item.value === label.value)
if (index < 0) {
this.form.labels.push(label)
}
}
}
} else {
if (e.e.length > 1) {
this.$message.error('只能选择一个类型')
return
}
this.form.TYPE_NAME = e.e[0].NAME
this.form.TYPE = e.e[0].BUS_LABEL_FACTORY_ID
this.$forceUpdate()
}
},
getType(e) {
this.form.TYPE = e.info[0].DICTIONARIES_ID
this.form.TYPE_NAME = e.info[0].NAME
},
clear() {
this.isEdit = false
this.form = {
REMARKS: '',
FILE: [],
labels: [''],
TYPE: '',
TYPES: [''],
SPECIFICATION_TYPES: [''],
CATEGORY_LIST: [''],
STATUS: '',
ASSOCIATION: '0',
types: [],
specification_types: [],
category_list: [],
TEXT_INFO: ''
}
},
getDic() {
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '86ad14e9999b418aac2309744364e714' }
).then((data) => {
this.typeList = data.list
}).catch((e) => {
this.loading = false
})
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '86ad14e9999b418aac2309744364e714' }
).then((data) => {
this.industryTypeList = data.list
}).catch((e) => {
this.loading = false
})
//
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: '99543742b79b473480617191f7ac256e' }
).then((data) => {
this.categoryList = data.list
}).catch((e) => {
this.loading = false
})
},
getChooseOne(e) {
this.remoteControl.keyOne = !(e && e.info && e.info.DICTIONARIES_ID && e.info.DICTIONARIES_ID === '8051d985a2bc406a83ea9360b64182b2')
},
openTextEdit(id, textDisabled) {
if (!id) {
this.textDisabled = false
this.$refs.textEditing.init({ text: this.form.TEXT_INFO })
} else {
this.textDisabled = textDisabled
this.loading = true
requestFN('textLibrary/getTextInfo', id)
.then((data) => {
if (data.info && data.info.TEXT_INFO && data.info.TEXT_INFO !== '') {
this.$refs.textEditing.init({ text: data.info.TEXT_INFO })
} else {
if (((!this.form.TEXT_INFO) || this.form.TEXT_INFO === '') && this.textDisabled) {
this.$message.error('此数据未维护文件内容')
} else {
this.$refs.textEditing.init({ text: this.form.TEXT_INFO })
}
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
},
getText(e) {
this.form.TEXT_INFO = e.text
},
exportWord(info) {
this.loading = true
requestFN('textLibrary/getTextInfo', info)
.then((data) => {
if (data.info) {
if ((!data.info) || data.info.TEXT_INFO === '') {
this.$message.error('没有文件导出')
} else {
this.$message.success('导出成功')
window.open(config.httpurl + '/textLibrary/exportWord?BUS_TEXT_LIBRARY_ID=' + info.BUS_TEXT_LIBRARY_ID)
}
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
}
}
</script>

View File

@ -0,0 +1,587 @@
<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_NAME" 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 style="margin-bottom: 10px">
<el-col :span="24">
<el-button
v-show="!row.LOCKTOOL && edit"
type="primary"
icon="el-icon-edit"
size="mini"
@click="handleEdit(row)">编辑
</el-button>
<el-button
v-show="!row.LOCKTOOL && del"
type="danger"
icon="el-icon-delete"
size="mini"
@click="handleDelete(row)">删除
</el-button>
<el-button
v-if="!row.LOCKTOOL && edit"
type="success"
icon="el-icon-lock"
size="mini"
@click="handleLock(row,'1')">锁定
</el-button>
<el-button
v-if="row.LOCKTOOL && edit"
type="info"
icon="el-icon-unlock"
size="mini"
@click="handleLock(row,'0')">解锁
</el-button>
</el-col>
</el-row>
<el-row style="margin-bottom: 10px">
<el-col :span="24">
<el-button type="info" icon="el-icon-view" size="mini" @click="getInformation(row)"></el-button>
<el-button
v-if="!row.ISTOPTIME && edit"
type="success"
icon="el-icon-edit-outline"
size="mini"
@click="handleTop(row,'1')">置顶
</el-button>
<el-button
v-if="row.ISTOPTIME && edit"
type="warning"
icon="el-icon-edit-outline"
size="mini"
@click="handleTop(row,'2')">取消置顶
</el-button>
<el-button type="warning" icon="el-icon-printer" size="mini" @click="handleExport(row)"></el-button>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-button
v-show="!row.LOCKTOOL && edit"
type="primary"
icon="el-icon-view"
size="mini"
@click="openUpdateFile(row)">替换
</el-button>
<el-button type="primary" icon="el-icon-printer" size="mini" @click="openUpdateLog(row)">
替换记录
</el-button>
<el-button
v-if="row.STATUS === '0' && edit"
type="success"
icon="el-icon-edit-outline"
size="mini"
@click="setStatus(row,'1')">启用
</el-button>
<el-button
v-if="row.STATUS === '1' && edit"
type="warning"
icon="el-icon-edit-outline"
size="mini"
@click="setStatus(row,'0')">停用
</el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="false" type="danger" icon="el-icon-delete" plain @click="batchDel"></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" @logical-end="getList"/>
<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_NAME: ''
},
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 + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.form.KEYWORDS,
CATEGORY_LIST: JSON.stringify(this.form.CATEGORY_LIST),
TYPES: JSON.stringify(this.form.TYPES),
SPECIFICATION_TYPES: JSON.stringify(this.form.SPECIFICATION_TYPES),
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
TYPE: this.form.TYPE_NAME,
DATE: this.form.DATE,
TEXT_NAME: this.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>

View File

@ -0,0 +1,539 @@
<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="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="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 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="REMARKS" label="安全操作规程名称" />
<el-table-column v-if="false" 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 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">
<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 align="center" prop="STATUS" label="状态" width="80px">
<template slot-scope="{row}">
{{ row.STATUS === '0'?'停用':'正常' }}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" width="100px" prop="UPLOAD_USER_NAME" label="数据来源" >
<template slot-scope="{row}">
{{ !row.CORP_NAME ? '自建' : row.CORP_NAME }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250px">
<template slot-scope="{row}">
<el-row>
<el-col :span="14">
<el-button v-show="!row.LOCKTOOL" type="primary" icon="el-icon-edit" size="mini" @click="handleCopy(row)"></el-button>
</el-col>
<el-col :span="10">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="getInformation(row)"></el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<edit-text-library ref="editTextLibrary" @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
}
},
created() {
this.getList()
},
methods: {
getRowKey(row) {
return row.BLACKSPOT_ID
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
addCondition() {
this.$refs.condition.init()
},
getCondition(info) {
this.form.CATEGORY_LIST = info.CATEGORY_LIST
this.form.TYPES = info.TYPES
this.form.SPECIFICATION_TYPES = info.SPECIFICATION_TYPES
this.form.labels = info.LABELS
this.form.CORPINFO_ID = info.CORPINFO_ID
},
clearMessage() {
this.label_name = ''
this.form = {
KEYWORDS: '',
labels: [],
CATEGORY_LIST: [],
TYPES: [],
SPECIFICATION_TYPES: [],
STATUS: ''
}
this.$refs.condition.clear()
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/textLibrary/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.form.KEYWORDS,
CATEGORY_LIST: JSON.stringify(this.form.CATEGORY_LIST),
TYPES: JSON.stringify(this.form.TYPES),
SPECIFICATION_TYPES: JSON.stringify(this.form.SPECIFICATION_TYPES),
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '0',
ENTERPRISE_SIDE: '0',
CORPINFO_ID: this.form.CORPINFO_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.$refs.editTextLibrary.init()
},
handleEdit(e) {
this.$refs.editTextLibrary.init({ e: e, isEdit: true })
},
getInformation(e) {
this.$refs.textLibraryInfo.init({ e: e })
},
handleDelete(e) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/delete',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
if (data.code === '0') {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
} else {
this.listLoading = false
this.$message.error(data.errorMessage)
}
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleLock(e, flag) {
this.$confirm(flag === '1' ? '确定要锁定吗?' : '确定要解锁吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/lock',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isLock: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleTop(e, flag) {
this.$confirm(flag === '1' ? '确定要置顶吗?' : '确定要取消置顶吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/top',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isTop: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleExport(e) {
this.$confirm('确定要导出文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (e.MIGRATION_FLAG === '1') {
window.open(config.fileUrl + e.PATH)
} else {
window.open(e.PATH)
}
}).catch((e) => {
console.log(e)
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const _ids = _selectData.filter((item, index) => {
return item.LOCKTOOL
})
if (_ids.length > 0) {
this.$message.error('选中的数据有锁定数据,请重新选择')
return
}
const ids = _selectData.map((item, index) => {
return item.BUS_TEXT_LIBRARY_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'textlibraryOne:add,textlibraryOne:del,textlibraryOne:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.textlibraryOnefhadminadd //
this.del = data.textlibraryOnefhadmindel //
this.edit = data.textlibraryOnefhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
if (row.ISTOPTIME) {
return 'warning-row'
}
},
saveClose(e) {
this.getList()
},
openUpdateFile(row) {
this.$refs.updateFile.init(row)
},
openUpdateLog(row) {
this.$refs.updateLog.init(row)
},
setStatus(row, status) {
this.listLoading = true
this.$confirm('是否更改状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/textLibrary/setStatus',
{
BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID,
STATUS: status
}
).then((data) => {
this.listLoading = false
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
this.listLoading = false
})
},
handleCopy(row) {
this.$confirm('确定要将此条数据添加到运营端数据库', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.copyInfo(row)
}).catch((e) => {
console.log(e)
this.$message({
type: 'info',
message: '已取消添加'
})
})
},
copyInfo(row) {
requestFN(
'/textLibrary/copyToOperate?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID }
).then((data) => {
if (data.code === '0') {
this.$message.success('添加成功')
} else {
this.$message.success('添加失败')
}
}).catch((e) => {
this.$message.success('添加失败')
})
},
enterSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.createTips(event, row, '数据已置顶')
}
},
leaveSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.removeTips(row)
}
},
createTips(el, row, value) {
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDom = document.createElement('div')
tooltipDom.style.cssText = `
display: inline-block;
max-width: 400px;
max-height: 400px;
position: absolute;
top: ${el.clientY + 5}px;
left: ${el.clientX}px;
padding:5px 10px;
overflow: auto;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #595959;
background: #fff;
border-radius: 5px;
z-index: 19999;
box-shadow: 0 4px 12px 1px #ccc;
`
tooltipDom.innerHTML = value
tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`)
// body
document.body.appendChild(tooltipDom)
},
removeTips(row) {
console.log(row, 'row')
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`)
if (tooltipDomLeave.length) {
tooltipDomLeave.forEach(dom => {
document.body.removeChild(dom)
})
}
}
}
}
</script>

View File

@ -0,0 +1,149 @@
<template>
<el-dialog v-loading="loading" v-if="dialogVisible" :visible.sync="dialogVisible" title="详情">
<el-form ref="form" :model="form" label-width="180px">
<el-form-item label="法律法规名称:" prop="FILE_NAME">
<el-input v-model="form.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({BUS_TEXT_LIBRARY_ID:form.BUS_TEXT_LIBRARY_ID})">word</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
</div>
<text-editing ref="textEditing" :disabled="true" append-to-body title="文本编辑器"/>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { requestFN } from '@/utils/request'
import TextEditing from '../../../util/textEditing.vue'
export default {
components: { TextEditing, Pagination },
directives: { waves },
data() {
return {
config: config,
dialogVisible: false,
form: {
BUS_TEXT_LIBRARY_ID: '',
FILE_NAME: '',
FILE: [],
TYPE: '',
labels: [],
UPLOAD_TIME: '',
UPLOAD_USER_NAME: ''
},
loading: false,
remoteControl: {
keyOne: true
}
}
},
methods: {
init(e) {
this.dialogVisible = true
this.loading = true
this.e = e.e
requestFN(
'/textLibrary/goEdit',
{
BUS_TEXT_LIBRARY_ID: this.e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
this.loading = false
this.form = data.data
this.form.FILE = []
}).catch((e) => {
this.$message.error(e)
this.loading = false
})
},
goBack() {
this.dialogVisible = false
this.$emit('goBack', this.e)
},
openTextEdit(id) {
this.loading = true
requestFN('textLibrary/getTextInfo', id)
.then((data) => {
if (data.info && data.info.TEXT_INFO && data.info.TEXT_INFO !== '') {
this.$refs.textEditing.init({ text: data.info.TEXT_INFO })
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
},
exportWord(info) {
this.loading = true
requestFN('textLibrary/getTextInfo', info)
.then((data) => {
if (data.info) {
if ((!data.info) || data.info.TEXT_INFO === '') {
this.$message.error('没有文件导出')
} else {
this.$message.success('导出成功')
window.open(config.httpurl + '/textLibrary/exportWord?BUS_TEXT_LIBRARY_ID=' + info.BUS_TEXT_LIBRARY_ID)
}
} else {
this.$message.error('此数据未维护文件内容')
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
}
}
</script>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,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'
import UpdateSpeFile from './updateSpeFile.vue'
export default {
components: { UpdateSpeFile, 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 + '&currentPage=' + 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'
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.title = '新增'
this.$refs.editTextLibrary.init()
},
handleEdit(e) {
this.title = '编辑'
this.$refs.editTextLibrary.init({ e: e, isEdit: true })
},
getInformation(e) {
this.$refs.textLibraryInfo.init({ e: e })
},
handleDelete(e) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/delete',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
if (data.code === '0') {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
} else {
this.listLoading = false
this.$message.error(data.errorMessage)
}
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleLock(e, flag) {
this.$confirm(flag === '1' ? '确定要锁定吗?' : '确定要解锁吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/lock',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isLock: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleTop(e, flag) {
this.$confirm(flag === '1' ? '确定要置顶吗?' : '确定要取消置顶吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/top',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isTop: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleExport(e) {
this.$confirm('确定要导出文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (e.MIGRATION_FLAG === '1') {
window.open(config.fileUrl + e.PATH)
} else {
window.open(e.PATH)
}
}).catch((e) => {
console.log(e)
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const _ids = _selectData.filter((item, index) => {
return item.LOCKTOOL
})
if (_ids.length > 0) {
this.$message.error('选中的数据有锁定数据,请重新选择')
return
}
const ids = _selectData.map((item, index) => {
return item.BUS_TEXT_LIBRARY_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'textlibraryOne:add,textlibraryOne:del,textlibraryOne:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.textlibraryOnefhadminadd //
this.del = data.textlibraryOnefhadmindel //
this.edit = data.textlibraryOnefhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
if (row.ISTOPTIME) {
return 'warning-row'
}
},
saveClose(e) {
this.getList()
},
openUpdateFile(row) {
this.$refs.updateFile.init(row)
},
openUpdateLog(row) {
this.$refs.updateLog.init(row)
},
setStatus(row, status) {
this.listLoading = true
this.$confirm('是否更改状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/textLibrary/setStatus',
{
BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID,
STATUS: status
}
).then((data) => {
this.listLoading = false
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
this.listLoading = false
})
},
handleCopy(row) {
this.$confirm('确定要将此条数据添加到本地', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.copyInfo(row)
}).catch((e) => {
console.log(e)
this.$message({
type: 'info',
message: '已取消添加'
})
})
},
copyInfo(row) {
requestFN(
'/textLibrary/copyToOperate?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ BUS_TEXT_LIBRARY_ID: row.BUS_TEXT_LIBRARY_ID }
).then((data) => {
if (data.code === '0') {
this.$message.success('添加成功')
} else {
this.$message.success('添加失败')
}
}).catch((e) => {
this.$message.success('添加失败')
})
},
enterSelectionRows(row, column, cell, event) {
console.log(row, 'row')
if (row.ISTOPTIME) {
this.createTips(event, row, '数据已置顶')
}
},
leaveSelectionRows(row, column, cell, event) {
if (row.ISTOPTIME) {
this.removeTips(row)
}
},
createTips(el, row, value) {
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDom = document.createElement('div')
tooltipDom.style.cssText = `
display: inline-block;
max-width: 400px;
max-height: 400px;
position: absolute;
top: ${el.clientY + 5}px;
left: ${el.clientX}px;
padding:5px 10px;
overflow: auto;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #595959;
background: #fff;
border-radius: 5px;
z-index: 19999;
box-shadow: 0 4px 12px 1px #ccc;
`
tooltipDom.innerHTML = value
tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`)
// body
document.body.appendChild(tooltipDom)
},
removeTips(row) {
console.log(row, 'row')
const { BUS_TEXT_LIBRARY_ID } = row
const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`)
if (tooltipDomLeave.length) {
tooltipDomLeave.forEach(dom => {
document.body.removeChild(dom)
})
}
},
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>

View File

@ -0,0 +1,504 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form label-width="50px">
<el-row>
<el-col :span="6">
<el-form-item label="标准规范库:" label-width="150px">
<el-input v-model="form.KEYWORDS" placeholder="请输入" class="filter-item"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="addCondition">
添加其他搜索条件
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-magic-stick" @click="clearMessage">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:row-key="getRowKey"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
:row-class-name="tableRowClassName"
tooltip-effect="dark"
border
fit
highlight-current-row
@cell-mouse-enter="enterSelectionRows"
@cell-mouse-leave="leaveSelectionRows">
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"
/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column align="center" prop="REMARKS" label="安全操作规程名称" />
<el-table-column align="center" prop="TYPES" label="类型" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="LABEL" align="center" label="标签" >
<template slot-scope="{row}">
<el-tag
v-for="tag in row.labels"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.NAME }}
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="SPECIFICATION_TYPES" label="国民经济行业类型" width="300px">
<template slot-scope="{row}">
<div v-if="row.SPECIFICATION_TYPES && row.SPECIFICATION_TYPES.length > 0">
<el-tag
v-for="tag in row.SPECIFICATION_TYPES"
:key="tag.BUS_LIBRARY_LABELS_ID"
:disable-transitions="false"
type="warning"
style="margin-right: 10px;margin-bottom: 10px">
{{ tag.CATEGORY_NAME }}
</el-tag>
</div>
<div v-else>
<el-tag type="warning">通用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="UPLOAD_TIME" label="上传时间" width="90px"/>
<el-table-column v-if="false" :show-overflow-tooltip="true" align="center" prop="UPLOAD_USER_NAME" width="100px" label="数据来源" >
<template slot-scope="{row}">
{{ !row.CORP_NAME === '' ? '资源库数据' : row.CORP_NAME }}
</template>
</el-table-column> <el-table-column label="" align="center" width="200px">
<template slot-scope="{row}">
<el-row>
<el-col :span="24" style="padding-bottom: 10px">
<el-button type="info" icon="el-icon-view" size="mini" @click="getInformation(row)"></el-button>
<el-button type="warning" icon="el-icon-printer" size="mini" @click="handleExport(row)"></el-button>
</el-col>
<el-col :span="24">
<el-button v-if="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button v-if="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row)"></el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-if="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<edit-text-library ref="editTextLibrary" :title="title" @logical-end="saveClose"/>
<text-library-info ref="textLibraryInfo"/>
<update-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'
import UpdateSpeFile from './updateSpeFile.vue'
export default {
components: { UpdateSpeFile, 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 + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.form.KEYWORDS,
CATEGORY_LIST: JSON.stringify(this.form.CATEGORY_LIST),
TYPES: JSON.stringify(this.form.TYPES),
SPECIFICATION_TYPES: JSON.stringify(this.form.SPECIFICATION_TYPES),
labels: JSON.stringify(this.form.labels),
STATUS: this.form.STATUS,
ASSOCIATION: '0',
ENTERPRISE_SIDE: '0',
CORPINFO_ID: this.form.CORPINFO_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.title = '新增'
this.$refs.editTextLibrary.init()
},
handleEdit(e) {
this.title = '编辑'
this.$refs.editTextLibrary.init({ e: e, isEdit: true })
},
getInformation(e) {
this.$refs.textLibraryInfo.init({ e: e })
},
handleDelete(e) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/delete',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID
}
).then((data) => {
if (data.code === '0') {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
} else {
this.listLoading = false
this.$message.error(data.errorMessage)
}
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleLock(e, flag) {
this.$confirm(flag === '1' ? '确定要锁定吗?' : '确定要解锁吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/lock',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isLock: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleTop(e, flag) {
this.$confirm(flag === '1' ? '确定要置顶吗?' : '确定要取消置顶吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/textLibrary/top',
{
BUS_TEXT_LIBRARY_ID: e.BUS_TEXT_LIBRARY_ID,
isTop: flag
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch((e) => {
console.log(e)
})
},
handleExport(e) {
this.$confirm('确定要导出文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (e.MIGRATION_FLAG === '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>

View File

@ -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>

View File

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

View File

@ -0,0 +1,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/upload-file/index.vue'
export default {
components: { Pagination, uploadFile },
directives: { waves },
data() {
return {
visible: false,
form: {
FILE: [],
BUS_TEXT_LIBRARY_ID: ''
},
rules: {
FILE: [{ required: true, message: '请选择文件', trigger: 'blur' }]
},
loading: false
}
},
methods: {
init(e) {
this.visible = true
this.form.BUS_TEXT_LIBRARY_ID = e.BUS_TEXT_LIBRARY_ID
},
goBack() {
this.form = {
FILE: [],
BUS_TEXT_LIBRARY_ID: ''
}
this.visible = false
},
save() {
const loading = this.$loading({
lock: true,
text: '上传中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const formData = new FormData()
for (let i = 0; i < this.form.FILE.length; i++) {
if (this.form.FILE[i].raw) {
formData.append('FILE', this.form.FILE[i].raw)
}
}
formData.append('BUS_TEXT_LIBRARY_ID', this.form.BUS_TEXT_LIBRARY_ID)
upload(
'/textLibrary/updateFile',
formData
).then((data) => {
loading.close()
this.visible = false
this.$emit('logical-end', { result: 'OK' })
}).catch((e) => {
loading.close()
console.log(e)
})
}
}
}
</script>

View File

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

View File

@ -103,6 +103,7 @@ export default {
this.$emit('getChooseOne', { info: labelList[0] })
}
this.$emit('update:dynamicTags', labelList)
this.$forceUpdate()
},
creatTage() {
this.$refs.editLabel.init({ TYPE: '0' })