Compare commits
No commits in common. "4807b87f727b60bceddfd5528894091705b88258" and "186b35792b5fce001dd8d75d9987a3f363ad7758" have entirely different histories.
4807b87f72
...
186b35792b
|
@ -66,9 +66,6 @@
|
||||||
<el-form-item label="定位卡号" prop="CARDNO">
|
<el-form-item label="定位卡号" prop="CARDNO">
|
||||||
<el-input v-model="form.CARDNO" placeholder="这里输入定位卡号..."/>
|
<el-input v-model="form.CARDNO" placeholder="这里输入定位卡号..."/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="门口门禁卡号" prop="MKMJCARD">
|
|
||||||
<el-input v-model="form.MKMJCARD" placeholder="这里输入门口门禁卡号..."/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否为隐患确认人" prop="IS_HAZARDCONFIRMER">
|
<el-form-item label="是否为隐患确认人" prop="IS_HAZARDCONFIRMER">
|
||||||
<el-radio-group v-model="form.IS_HAZARDCONFIRMER">
|
<el-radio-group v-model="form.IS_HAZARDCONFIRMER">
|
||||||
<el-radio :label="0" value="0">否</el-radio>
|
<el-radio :label="0" value="0">否</el-radio>
|
||||||
|
@ -821,7 +818,6 @@ export default {
|
||||||
IS_HAZARDCONFIRMER: 0,
|
IS_HAZARDCONFIRMER: 0,
|
||||||
INFORPOST: '',
|
INFORPOST: '',
|
||||||
CARDNO: '',
|
CARDNO: '',
|
||||||
MKMJCARD: '',
|
|
||||||
INFORTITLE: '',
|
INFORTITLE: '',
|
||||||
INFORTITLEValue: '',
|
INFORTITLEValue: '',
|
||||||
infortitleType: 'select',
|
infortitleType: 'select',
|
||||||
|
|
|
@ -1,175 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<div class="level-title">
|
|
||||||
<h1>{{ this.$parent.AREA_ID == '' ? "新增" : "修改" }}</h1>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-form v-loading="dialogFormVisible" ref="form" :model="form" :rules="rules" label-width="150px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="区域名称:" prop="AREA_NAME">
|
|
||||||
<el-input v-model="form.AREA_NAME" placeholder="请输入内容"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="区域范围:">
|
|
||||||
<el-input v-model="form.AREA_RANGE" placeholder="区域范围"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="区域级别:" prop="AREA_LEAVE">
|
|
||||||
<el-select v-model="form.AREA_LEAVE" disabled style="width: 100%;">
|
|
||||||
<el-option v-for="item in leaveList" :key="item.ID" :label="item.NAME" :value="item.ID" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
<div class="ui-foot">
|
|
||||||
<el-button type="success" @click="confirm">保 存</el-button>
|
|
||||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
|
|
||||||
import { requestFN } from '@/utils/request'
|
|
||||||
import SelectTree from '@/components/SelectTree'
|
|
||||||
import waves from '@/directive/waves' // waves directive
|
|
||||||
export default {
|
|
||||||
|
|
||||||
components: { Pagination, SelectTree },
|
|
||||||
directives: { waves },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialogFormVisible: false,
|
|
||||||
dialogTableVisible: false,
|
|
||||||
PERSON_CHARGE: '',
|
|
||||||
DEPARTMENT_ID_OLD: '',
|
|
||||||
form: {
|
|
||||||
AREA_NAME: '',
|
|
||||||
AREA_RANGE: '',
|
|
||||||
AREA_LEAVE: '',
|
|
||||||
AREA_PARENT_ID: '',
|
|
||||||
AREA_ID: ''
|
|
||||||
},
|
|
||||||
riskForm: {},
|
|
||||||
KEYWORDS: '',
|
|
||||||
rules: {
|
|
||||||
AREA_NAME: [{ required: true, message: '区域名称不为空', trigger: 'blur' }],
|
|
||||||
AREA_LEAVE: [{ required: true, message: '区域级别不为空', trigger: 'blur' }]
|
|
||||||
},
|
|
||||||
formLabelWidth: '120px',
|
|
||||||
fullscreenLoading: false,
|
|
||||||
total: 0,
|
|
||||||
listQuery: {
|
|
||||||
page: 1,
|
|
||||||
limit: 20
|
|
||||||
},
|
|
||||||
multipleSelection: [],
|
|
||||||
accidentList: [],
|
|
||||||
leaveList: [
|
|
||||||
{ ID: '1', NAME: '一级' },
|
|
||||||
{ ID: '2', NAME: '二级' },
|
|
||||||
{ ID: '3', NAME: '三级' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
},
|
|
||||||
async created() {
|
|
||||||
this.AREA_ID = this.$parent.AREA_ID
|
|
||||||
this.form.AREA_LEAVE = this.$parent.AREA_LEAVE
|
|
||||||
this.form.AREA_PARENT_ID = this.$parent.AREA_PARENT_ID
|
|
||||||
if (this.AREA_ID) {
|
|
||||||
this.getDataByID()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
confirm() {
|
|
||||||
this.$refs.form.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.$parent.AREA_ID == '') {
|
|
||||||
this.handleAdd()
|
|
||||||
} else {
|
|
||||||
if (valid) {
|
|
||||||
this.listLoading = true
|
|
||||||
requestFN(
|
|
||||||
'/mkmjArea/edit',
|
|
||||||
this.form
|
|
||||||
).then((data) => {
|
|
||||||
if (data.code != 0) {
|
|
||||||
this.$message.warning(data.msg)
|
|
||||||
} else {
|
|
||||||
this.$message.success(data.msg)
|
|
||||||
this.listLoading = false
|
|
||||||
this.dialogFormEdit = false
|
|
||||||
if (this.form.AREA_LEAVE === '1') {
|
|
||||||
this.$parent.activeName = 'List'
|
|
||||||
} else if (this.form.AREA_LEAVE === '2') {
|
|
||||||
this.$parent.activeName = 'ListTwo'
|
|
||||||
} else if (this.form.AREA_LEAVE === '3') {
|
|
||||||
this.$parent.activeName = 'ListThree'
|
|
||||||
}
|
|
||||||
this.$parent.$refs.list.getList()
|
|
||||||
}
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleAdd() {
|
|
||||||
requestFN(
|
|
||||||
'/mkmjArea/add',
|
|
||||||
this.form
|
|
||||||
).then((data) => {
|
|
||||||
if (this.form.AREA_LEAVE === '1') {
|
|
||||||
this.$parent.activeName = 'List'
|
|
||||||
} else if (this.form.AREA_LEAVE === '2') {
|
|
||||||
this.$parent.activeName = 'ListTwo'
|
|
||||||
} else if (this.form.AREA_LEAVE === '3') {
|
|
||||||
this.$parent.activeName = 'ListThree'
|
|
||||||
}
|
|
||||||
this.$parent.$refs.list.getList()
|
|
||||||
}).catch((e) => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getDataByID() {
|
|
||||||
this.listLoading = true
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
requestFN(
|
|
||||||
'/mkmjArea/goEdit',
|
|
||||||
{ AREA_ID: this.AREA_ID }
|
|
||||||
).then((data) => {
|
|
||||||
this.form = data.pd
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
}).catch((e) => {
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 返回列表
|
|
||||||
goBack() {
|
|
||||||
if (this.form.AREA_LEAVE === '1') {
|
|
||||||
this.$parent.activeName = 'List'
|
|
||||||
} else if (this.form.AREA_LEAVE === '2') {
|
|
||||||
this.$parent.activeName = 'ListTwo'
|
|
||||||
} else if (this.form.AREA_LEAVE === '3') {
|
|
||||||
this.$parent.activeName = 'ListThree'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
|
@ -1,233 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<div class="level-title">
|
|
||||||
<h1>{{ this.$parent.AREA_GATE_ID == '' ? "新增" : "修改" }}</h1>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-form v-loading="dialogFormVisible" ref="form" :model="form" :rules="rules" label-width="150px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="闸机名称:" prop="GATE_NAME">
|
|
||||||
<el-input v-model="form.GATE_NAME" placeholder="闸机名称"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="闸机标识:">
|
|
||||||
<el-input v-model="form.GATE_NUMBER" placeholder="闸机标识"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="闸机类别:" prop="GATE_CATEGORY">
|
|
||||||
<el-select v-model="form.GATE_CATEGORY" style="width: 100%;">
|
|
||||||
<el-option v-for="item in categoryList" :key="item.ID" :label="item.NAME" :value="item.ID" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="闸机类型:" prop="GATE_TYPE">
|
|
||||||
<el-select v-model="form.GATE_TYPE" style="width: 100%;">
|
|
||||||
<el-option v-for="item in leaveList" :key="item.ID" :label="item.NAME" :value="item.ID" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="闸机型号:">
|
|
||||||
<el-input v-model="form.GATE_MODEL" placeholder="闸机型号"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="闸机位置:">
|
|
||||||
<el-input v-model="form.GATE_POSITION" placeholder="闸机位置"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="是否相邻区域:" prop="IS_ADJACENT">
|
|
||||||
<el-select v-model="form.IS_ADJACENT" style="width: 100%;">
|
|
||||||
<el-option v-for="item in IsAdjacentList" :key="item.ID" :label="item.NAME" :value="item.ID" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item v-if="form.IS_ADJACENT=='1'" label="相邻区域:" prop="ADJACENT_AREA_ID">
|
|
||||||
<el-select v-model="form.ADJACENT_AREA_ID" style="width: 100%;">
|
|
||||||
<el-option v-for="item in AreaList" :key="item.AREA_ID" :label="item.AREA_NAME" :value="item.AREA_ID" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
<div class="ui-foot">
|
|
||||||
<el-button type="success" @click="confirm">保 存</el-button>
|
|
||||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
|
|
||||||
import { requestFN } from '@/utils/request'
|
|
||||||
import SelectTree from '@/components/SelectTree'
|
|
||||||
import waves from '@/directive/waves' // waves directive
|
|
||||||
export default {
|
|
||||||
|
|
||||||
components: { Pagination, SelectTree },
|
|
||||||
directives: { waves },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialogFormVisible: false,
|
|
||||||
dialogTableVisible: false,
|
|
||||||
PERSON_CHARGE: '',
|
|
||||||
DEPARTMENT_ID_OLD: '',
|
|
||||||
AREA_GATE_ID: '',
|
|
||||||
form: {
|
|
||||||
GATE_NAME: '',
|
|
||||||
GATE_NUMBER: '',
|
|
||||||
GATE_TYPE: '',
|
|
||||||
GATE_CATEGORY: '',
|
|
||||||
GATE_MODEL: '',
|
|
||||||
GATE_POSITION: '',
|
|
||||||
IS_ADJACENT: '',
|
|
||||||
ADJACENT_AREA_ID: '',
|
|
||||||
AREA_ID: '',
|
|
||||||
AREA_GATE_ID: ''
|
|
||||||
},
|
|
||||||
riskForm: {},
|
|
||||||
KEYWORDS: '',
|
|
||||||
rules: {
|
|
||||||
GATE_NAME: [{ required: true, message: '闸机名称不为空', trigger: 'blur' }],
|
|
||||||
GATE_TYPE: [{ required: true, message: '闸机类型不为空', trigger: 'blur' }],
|
|
||||||
GATE_CATEGORY: [{ required: true, message: '闸机类别不为空', trigger: 'blur' }],
|
|
||||||
IS_ADJACENT: [{ required: true, message: '是否相邻区域不为空', trigger: 'blur' }],
|
|
||||||
ADJACENT_AREA_ID: [{ required: true, message: '相邻区域不为空', trigger: 'blur' }]
|
|
||||||
},
|
|
||||||
formLabelWidth: '120px',
|
|
||||||
fullscreenLoading: false,
|
|
||||||
total: 0,
|
|
||||||
listQuery: {
|
|
||||||
page: 1,
|
|
||||||
limit: 20
|
|
||||||
},
|
|
||||||
AreaList: [],
|
|
||||||
multipleSelection: [],
|
|
||||||
accidentList: [],
|
|
||||||
categoryList: [
|
|
||||||
{ ID: '1', NAME: '人员' },
|
|
||||||
{ ID: '2', NAME: '车辆' }
|
|
||||||
],
|
|
||||||
leaveList: [
|
|
||||||
{ ID: '1', NAME: '入' },
|
|
||||||
{ ID: '2', NAME: '出' }
|
|
||||||
],
|
|
||||||
IsAdjacentList: [
|
|
||||||
{ ID: '0', NAME: '否' },
|
|
||||||
{ ID: '1', NAME: '是' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
},
|
|
||||||
async created() {
|
|
||||||
this.form.AREA_ID = this.$parent.AREA_ID
|
|
||||||
this.form.AREA_PARENT_ID = this.$parent.AREA_PARENT_ID
|
|
||||||
this.AREA_GATE_ID = this.$parent.AREA_GATE_ID
|
|
||||||
if (this.AREA_GATE_ID) {
|
|
||||||
this.getDataByID()
|
|
||||||
}
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 获取列表
|
|
||||||
getList() {
|
|
||||||
this.AreaList = []
|
|
||||||
requestFN(
|
|
||||||
'/mkmjArea/list?showCount=100¤tPage=1',
|
|
||||||
{
|
|
||||||
AREA_PARENT_ID: this.form.AREA_PARENT_ID
|
|
||||||
}
|
|
||||||
).then((data) => {
|
|
||||||
for (var i = 0; i < data.varList.length; i++) {
|
|
||||||
var item = data.varList[i]
|
|
||||||
if (item.AREA_ID != this.form.AREA_ID) {
|
|
||||||
this.AreaList.push(item)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).catch((e) => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
confirm() {
|
|
||||||
this.$refs.form.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (!this.AREA_GATE_ID) {
|
|
||||||
this.handleAdd()
|
|
||||||
} else {
|
|
||||||
if (valid) {
|
|
||||||
this.listLoading = true
|
|
||||||
requestFN(
|
|
||||||
'/mkmjAreaGate/edit',
|
|
||||||
this.form
|
|
||||||
).then((data) => {
|
|
||||||
if (data.code != 0) {
|
|
||||||
this.$message.warning(data.msg)
|
|
||||||
} else {
|
|
||||||
this.$message.success(data.msg)
|
|
||||||
this.listLoading = false
|
|
||||||
this.dialogFormEdit = false
|
|
||||||
this.$parent.activeName = 'ListGate'
|
|
||||||
this.$parent.$refs.list.getList()
|
|
||||||
}
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleAdd() {
|
|
||||||
requestFN(
|
|
||||||
'/mkmjAreaGate/add',
|
|
||||||
this.form
|
|
||||||
).then((data) => {
|
|
||||||
this.$parent.AREA_GATE_ID = ''
|
|
||||||
this.$parent.activeName = 'ListGate'
|
|
||||||
this.$parent.$refs.list.getList()
|
|
||||||
}).catch((e) => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getDataByID() {
|
|
||||||
this.listLoading = true
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
requestFN(
|
|
||||||
'/mkmjAreaGate/goEdit',
|
|
||||||
{ AREA_GATE_ID: this.AREA_GATE_ID }
|
|
||||||
).then((data) => {
|
|
||||||
this.form = data.pd
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
}).catch((e) => {
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 返回列表
|
|
||||||
goBack() {
|
|
||||||
this.$parent.activeName = 'ListGate'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
|
@ -1,394 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<div class="rightCont">
|
|
||||||
<el-form label-width="50px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-form-item label="区域名称/编码" label-width="110px">
|
|
||||||
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4"/>
|
|
||||||
<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-row>
|
|
||||||
</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 :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
|
|
||||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
|
||||||
<el-table-column prop="GATE_NAME" label="闸机名称"/>
|
|
||||||
<el-table-column prop="GATE_NUMBER" label="闸机标识"/>
|
|
||||||
<el-table-column label="闸机类别">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<span v-if="row.GATE_CATEGORY === '1'" >人员</span>
|
|
||||||
<span v-if="row.GATE_CATEGORY === '2'" >车辆</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<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 prop="GATE_MODEL" label="闸机型号"/>
|
|
||||||
<el-table-column prop="GATE_POSITION" label="闸机位置"/>
|
|
||||||
<el-table-column prop="ADJACENT_AREA_NAME" label="相邻区域名称"/>
|
|
||||||
<el-table-column label="是否定位">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<span v-if="row.LATITUDE && row.LONGITUDE">已定位</span>
|
|
||||||
<span v-else>未定位</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="VIDEOCOUNT" label="摄像头数量"/>
|
|
||||||
<el-table-column label="操作" width="400">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<el-button
|
|
||||||
v-show="edit"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
@click="handleEdit(row.AREA_GATE_ID)">编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button type="info" icon="el-icon-location-information" size="mini" @click="handleMap(row)">定位</el-button>
|
|
||||||
<el-button type="success" icon="el-icon-location-information" size="mini" @click="handleVideo(row)">摄像头</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="row.VIDEOCOUNT==0"
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
@click="handleDelete(row)">删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div class="page-btn-group">
|
|
||||||
<div>
|
|
||||||
<el-button 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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ui-foot">
|
|
||||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
|
||||||
</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>
|
|
||||||
|
|
||||||
</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'
|
|
||||||
import TiandiMap from '../../../../components/TianMap/TiandiMap'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
|
|
||||||
components: { Pagination, SelectTree, TiandiMap },
|
|
||||||
|
|
||||||
directives: { waves },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
map: null,
|
|
||||||
marker: null,
|
|
||||||
BMap: '',
|
|
||||||
clientHeight: 500,
|
|
||||||
inputLocation: '',
|
|
||||||
msg: 'add',
|
|
||||||
config: config,
|
|
||||||
dialogFormMap: false,
|
|
||||||
AREA_ID: '',
|
|
||||||
AREA_LEAVE: '',
|
|
||||||
addBtnType: true,
|
|
||||||
listLoading: true,
|
|
||||||
add: false,
|
|
||||||
del: false,
|
|
||||||
edit: false,
|
|
||||||
listQuery: {
|
|
||||||
page: 1,
|
|
||||||
limit: 20
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
AREA_GATE_ID: '',
|
|
||||||
LATITUDE: '',
|
|
||||||
LONGITUDE: ''
|
|
||||||
},
|
|
||||||
ls: [],
|
|
||||||
dates: [],
|
|
||||||
total: 0,
|
|
||||||
KEYWORDS: '',
|
|
||||||
// 树形菜单
|
|
||||||
filterText: '',
|
|
||||||
varList: [],
|
|
||||||
pd: [],
|
|
||||||
defaultProps: {
|
|
||||||
value: 'id',
|
|
||||||
children: 'nodes',
|
|
||||||
label: 'name'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
filterText(val) {
|
|
||||||
this.$refs.tree.filter(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.AREA_LEAVE = this.$parent.AREA_LEAVE
|
|
||||||
this.AREA_ID = this.$parent.AREA_ID
|
|
||||||
this.getList()
|
|
||||||
this.hasButton()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 初始化天地图对象
|
|
||||||
*/
|
|
||||||
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)
|
|
||||||
},
|
|
||||||
filterNode(value, data) {
|
|
||||||
if (!value) return true
|
|
||||||
return data.name.indexOf(value) !== -1
|
|
||||||
},
|
|
||||||
getRowKey(row) {
|
|
||||||
return row.AREA_GATE_ID
|
|
||||||
},
|
|
||||||
selectable(row, index) {
|
|
||||||
return row.ITEMCOUNT == 0
|
|
||||||
},
|
|
||||||
// 添加
|
|
||||||
handleAdd() {
|
|
||||||
this.$parent.activeName = 'EditGate'
|
|
||||||
this.$parent.AREA_ID = this.AREA_ID
|
|
||||||
this.$parent.AREA_GATE_ID = ''
|
|
||||||
},
|
|
||||||
handleVideo(row) {
|
|
||||||
this.$parent.activeName = 'VideoList'
|
|
||||||
this.$parent.AREA_GATE_ID = row.AREA_GATE_ID
|
|
||||||
console.log(this.$parent.AREA_GATE_ID)
|
|
||||||
},
|
|
||||||
// 搜索
|
|
||||||
getQuery() {
|
|
||||||
// this.$refs.multipleTable.clearSelection()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
// 获取列表
|
|
||||||
getList(pid) {
|
|
||||||
this.listLoading = true
|
|
||||||
this.varList = []
|
|
||||||
this.HIDDENREGION_ID = pid
|
|
||||||
requestFN(
|
|
||||||
'/mkmjAreaGate/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
|
||||||
{
|
|
||||||
KEYWORDS: this.KEYWORDS,
|
|
||||||
AREA_ID: this.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.KEYWORDS = ''
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
handleEdit(AREA_GATE_ID) {
|
|
||||||
this.$parent.AREA_GATE_ID = AREA_GATE_ID
|
|
||||||
this.$parent.activeName = 'EditGate'
|
|
||||||
},
|
|
||||||
handleMap(row) {
|
|
||||||
this.dialogFormMap = true
|
|
||||||
this.form = {
|
|
||||||
AREA_GATE_ID: row.AREA_GATE_ID,
|
|
||||||
LATITUDE: row.LATITUDE,
|
|
||||||
LONGITUDE: row.LONGITUDE
|
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (!this.map) this.initMap(this.form.LONGITUDE, this.form.LATITUDE, 16)
|
|
||||||
else this.initCenter(this.form.LONGITUDE, this.form.LATITUDE, 16)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleDelete(row) {
|
|
||||||
this.$confirm('确定要删除[' + row.GATE_NAME + ']吗?', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
this.listLoading = true
|
|
||||||
requestFN(
|
|
||||||
'/mkmjAreaGate/delete',
|
|
||||||
{
|
|
||||||
AREA_GATE_ID: row.AREA_GATE_ID
|
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
this.$message({
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
this.listLoading = false
|
|
||||||
this.varList = []
|
|
||||||
this.listQuery.page = 1
|
|
||||||
this.getList()
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
setPosition() {
|
|
||||||
this.dialogFormMap = false
|
|
||||||
this.listLoading = true
|
|
||||||
requestFN(
|
|
||||||
'/mkmjAreaGate/savePosition',
|
|
||||||
{
|
|
||||||
LATITUDE: this.form.LATITUDE,
|
|
||||||
LONGITUDE: this.form.LONGITUDE,
|
|
||||||
AREA_GATE_ID: this.form.AREA_GATE_ID
|
|
||||||
}
|
|
||||||
).then((data) => {
|
|
||||||
this.listLoading = false
|
|
||||||
this.dialogForm = false
|
|
||||||
this.getList()
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
hasButton: function() {
|
|
||||||
var keys = 'mkmjArea:add,mkmjArea:del,mkmjArea:edit,toExcel'
|
|
||||||
requestFN(
|
|
||||||
'/head/hasButton',
|
|
||||||
{
|
|
||||||
keys: keys
|
|
||||||
}
|
|
||||||
).then((data) => {
|
|
||||||
this.add = data.mkmjAreafhadminadd // 新增权限
|
|
||||||
this.del = data.mkmjAreafhadmindel // 删除权限
|
|
||||||
this.edit = data.mkmjAreafhadminedit // 修改权限
|
|
||||||
this.toExcel = data.toExcel // 导出到excel权限
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 返回列表
|
|
||||||
goBack() {
|
|
||||||
if (this.AREA_LEAVE === '1') {
|
|
||||||
this.$parent.activeName = 'List'
|
|
||||||
} else if (this.AREA_LEAVE === '2') {
|
|
||||||
this.$parent.activeName = 'ListTwo'
|
|
||||||
} else if (this.AREA_LEAVE === '3') {
|
|
||||||
this.$parent.activeName = 'ListThree'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
#map{
|
|
||||||
width: 1000px;
|
|
||||||
height: 500px;
|
|
||||||
}
|
|
||||||
.returnBtn {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-container {
|
|
||||||
display: flex; /**/
|
|
||||||
align-items: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rightCont {
|
|
||||||
width: 100%
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,198 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<div class="rightCont">
|
|
||||||
<el-form label-width="50px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-form-item label="区域名称/编码" label-width="110px">
|
|
||||||
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4"/>
|
|
||||||
<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-row>
|
|
||||||
</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 :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
|
|
||||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
|
||||||
<el-table-column prop="NAME" label="人员姓名"/>
|
|
||||||
<el-table-column prop="GATE_NAME" label="闸机名称"/>
|
|
||||||
<el-table-column prop="GATE_TYPE" label="闸机类型">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<span v-if="row.GATE_TYPE === '1'" class="color-red">进</span>
|
|
||||||
<span v-if="row.GATE_TYPE === '2'" class="color-green">出</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="LOG_TIME" label="时间"/>
|
|
||||||
<el-table-column prop="STATE" label="状态">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<span v-if="row.STATE === '0'" class="color-red">人员进</span>
|
|
||||||
<span v-if="row.STATE === '1'" class="color-green">人员出</span>
|
|
||||||
<span v-if="row.STATE === '2'" class="color-green">车辆进</span>
|
|
||||||
<span v-if="row.STATE === '3'" class="color-green">车辆出</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div class="page-btn-group">
|
|
||||||
<div>
|
|
||||||
<!--<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
|
||||||
<el-button type="danger" icon="el-icon-plus" @click="handelDelete">批量删除</el-button>-->
|
|
||||||
</div>
|
|
||||||
<pagination
|
|
||||||
:total="total"
|
|
||||||
:page.sync="listQuery.page"
|
|
||||||
:limit.sync="listQuery.limit"
|
|
||||||
@pagination="getList(HIDDENREGION_ID)"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ui-foot">
|
|
||||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
|
||||||
</div>
|
|
||||||
</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 {
|
|
||||||
AREA_ID: '',
|
|
||||||
AREA_LEAVE: '',
|
|
||||||
addBtnType: true,
|
|
||||||
listLoading: true,
|
|
||||||
add: false,
|
|
||||||
del: false,
|
|
||||||
edit: false,
|
|
||||||
listQuery: {
|
|
||||||
page: 1,
|
|
||||||
limit: 20
|
|
||||||
},
|
|
||||||
ls: [],
|
|
||||||
dates: [],
|
|
||||||
total: 0,
|
|
||||||
KEYWORDS: '',
|
|
||||||
filterText: '',
|
|
||||||
varList: [],
|
|
||||||
pd: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
filterText(val) {
|
|
||||||
console.log(val)
|
|
||||||
this.$refs.tree.filter(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.AREA_LEAVE = this.$parent.AREA_LEAVE
|
|
||||||
this.AREA_ID = this.$parent.AREA_ID
|
|
||||||
this.getList()
|
|
||||||
this.hasButton()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getRowKey(row) {
|
|
||||||
return row.FIRE_REGION_ID
|
|
||||||
},
|
|
||||||
selectable(row, index) {
|
|
||||||
return row.ITEMCOUNT == 0
|
|
||||||
},
|
|
||||||
// 搜索
|
|
||||||
getQuery() {
|
|
||||||
// this.$refs.multipleTable.clearSelection()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
// 获取列表
|
|
||||||
getList(pid) {
|
|
||||||
this.listLoading = true
|
|
||||||
this.varList = []
|
|
||||||
this.HIDDENREGION_ID = pid
|
|
||||||
requestFN(
|
|
||||||
'/mkmjGateLog/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
|
||||||
{
|
|
||||||
KEYWORDS: this.KEYWORDS,
|
|
||||||
AREA_ID: this.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.KEYWORDS = ''
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
|
|
||||||
hasButton: function() {
|
|
||||||
var keys = 'mkmjArea:add,mkmjArea:del,mkmjArea:edit,toExcel'
|
|
||||||
requestFN(
|
|
||||||
'/head/hasButton',
|
|
||||||
{
|
|
||||||
keys: keys
|
|
||||||
}
|
|
||||||
).then((data) => {
|
|
||||||
this.add = data.mkmjAreafhadminadd // 新增权限
|
|
||||||
this.del = data.mkmjAreafhadmindel // 删除权限
|
|
||||||
this.edit = data.mkmjAreafhadminedit // 修改权限
|
|
||||||
this.toExcel = data.toExcel // 导出到excel权限
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 返回列表
|
|
||||||
goBack() {
|
|
||||||
if (this.AREA_LEAVE === '1') {
|
|
||||||
this.$parent.activeName = 'List'
|
|
||||||
} else if (this.AREA_LEAVE === '2') {
|
|
||||||
this.$parent.activeName = 'ListTwo'
|
|
||||||
} else if (this.AREA_LEAVE === '3') {
|
|
||||||
this.$parent.activeName = 'ListThree'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.returnBtn {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-container {
|
|
||||||
display: flex; /**/
|
|
||||||
align-items: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rightCont {
|
|
||||||
width: 100%
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,277 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<div class="rightCont">
|
|
||||||
<el-form label-width="50px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-form-item label="区域名称/编码" label-width="110px">
|
|
||||||
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4"/>
|
|
||||||
<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-row>
|
|
||||||
</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 :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
|
|
||||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
|
||||||
<el-table-column label="区域名称">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<span>
|
|
||||||
<a style="color: #1e9fff;text-decoration:underline" @click="clickChild(row)">{{ row.AREA_NAME }}</a>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="AREA_RANGE" label="区域范围"/>
|
|
||||||
<el-table-column label="区域级别">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<span v-if="row.AREA_LEAVE === '1'" >一级</span>
|
|
||||||
<span v-if="row.AREA_LEAVE === '2'" >二级</span>
|
|
||||||
<span v-if="row.AREA_LEAVE === '3'" >三级</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="CHILDCOUNT" label="下级区域数"/>
|
|
||||||
<el-table-column prop="GATECOUNT" label="区域下闸机数"/>
|
|
||||||
<el-table-column label="操作" width="400">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
icon="el-icon-circle-close"
|
|
||||||
size="mini"
|
|
||||||
@click="handleClose(row)">进出记录
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-show="edit"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
@click="handleEdit(row.AREA_ID)">编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="edit && row.CHILDCOUNT == 0"
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
@click="handleDelete(row)">删除
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
icon="el-icon-circle-check"
|
|
||||||
size="mini"
|
|
||||||
@click="handleOpen(row)">闸机
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div class="page-btn-group">
|
|
||||||
<div>
|
|
||||||
<el-button 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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</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 {
|
|
||||||
AREA_ID: '',
|
|
||||||
AREA_LEAVE: '1',
|
|
||||||
AREA_PARENT_ID: '0',
|
|
||||||
addBtnType: true,
|
|
||||||
listLoading: true,
|
|
||||||
add: false,
|
|
||||||
del: false,
|
|
||||||
edit: false,
|
|
||||||
listQuery: {
|
|
||||||
page: 1,
|
|
||||||
limit: 20
|
|
||||||
},
|
|
||||||
ls: [],
|
|
||||||
dates: [],
|
|
||||||
total: 0,
|
|
||||||
KEYWORDS: '',
|
|
||||||
// 树形菜单
|
|
||||||
filterText: '',
|
|
||||||
varList: [],
|
|
||||||
pd: [],
|
|
||||||
defaultProps: {
|
|
||||||
value: 'id',
|
|
||||||
children: 'nodes',
|
|
||||||
label: 'name'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
filterText(val) {
|
|
||||||
console.log(val)
|
|
||||||
this.$refs.tree.filter(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList()
|
|
||||||
this.hasButton()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
filterNode(value, data) {
|
|
||||||
if (!value) return true
|
|
||||||
return data.name.indexOf(value) !== -1
|
|
||||||
},
|
|
||||||
getRowKey(row) {
|
|
||||||
return row.AREA_ID
|
|
||||||
},
|
|
||||||
selectable(row, index) {
|
|
||||||
return row.ITEMCOUNT == 0
|
|
||||||
},
|
|
||||||
// 添加
|
|
||||||
handleAdd() {
|
|
||||||
this.$parent.activeName = 'Edit'
|
|
||||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
|
||||||
this.$parent.AREA_PARENT_ID = this.AREA_PARENT_ID
|
|
||||||
this.$parent.AREA_ID = this.AREA_ID
|
|
||||||
},
|
|
||||||
// 搜索
|
|
||||||
getQuery() {
|
|
||||||
// this.$refs.multipleTable.clearSelection()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
// 获取列表
|
|
||||||
getList(pid) {
|
|
||||||
this.listLoading = true
|
|
||||||
this.varList = []
|
|
||||||
this.HIDDENREGION_ID = pid
|
|
||||||
requestFN(
|
|
||||||
'/mkmjArea/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
|
||||||
{
|
|
||||||
KEYWORDS: this.KEYWORDS,
|
|
||||||
AREA_LEAVE: this.AREA_LEAVE,
|
|
||||||
AREA_PARENT_ID: this.AREA_PARENT_ID
|
|
||||||
}
|
|
||||||
).then((data) => {
|
|
||||||
this.listLoading = false
|
|
||||||
this.varList = data.varList
|
|
||||||
this.total = data.page.totalResult
|
|
||||||
this.hasButton()
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
}, goKeyReset() {
|
|
||||||
this.KEYWORDS = ''
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
handleEdit(AREA_ID) {
|
|
||||||
this.$parent.AREA_ID = AREA_ID
|
|
||||||
this.$parent.activeName = 'Edit'
|
|
||||||
},
|
|
||||||
handleOpen(row) {
|
|
||||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
|
||||||
this.$parent.AREA_ID = row.AREA_ID
|
|
||||||
this.$parent.activeName = 'ListGate'
|
|
||||||
},
|
|
||||||
handleClose(row) {
|
|
||||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
|
||||||
this.$parent.AREA_ID = row.AREA_ID
|
|
||||||
this.$parent.activeName = 'ListLog'
|
|
||||||
},
|
|
||||||
clickChild(row) {
|
|
||||||
this.$parent.AREA_PARENT_ID = row.AREA_ID
|
|
||||||
this.$parent.AREA_OLD_ID = row.AREA_ID
|
|
||||||
this.$parent.activeName = 'ListTwo'
|
|
||||||
},
|
|
||||||
handleDelete(row) {
|
|
||||||
this.$confirm('确定要删除[' + row.AREA_NAME + ']吗?', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
this.listLoading = true
|
|
||||||
requestFN(
|
|
||||||
'/mkmjArea/delete',
|
|
||||||
{
|
|
||||||
AREA_ID: row.AREA_ID
|
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
this.$message({
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
this.listLoading = false
|
|
||||||
this.varList = []
|
|
||||||
this.listQuery.page = 1
|
|
||||||
this.getList()
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
hasButton: function() {
|
|
||||||
var keys = 'mkmjArea:add,mkmjArea:del,mkmjArea:edit,toExcel'
|
|
||||||
requestFN(
|
|
||||||
'/head/hasButton',
|
|
||||||
{
|
|
||||||
keys: keys
|
|
||||||
}
|
|
||||||
).then((data) => {
|
|
||||||
this.add = data.mkmjAreafhadminadd // 新增权限
|
|
||||||
this.del = data.mkmjAreafhadmindel // 删除权限
|
|
||||||
this.edit = data.mkmjAreafhadminedit // 修改权限
|
|
||||||
this.toExcel = data.toExcel // 导出到excel权限
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.returnBtn {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-container {
|
|
||||||
display: flex; /**/
|
|
||||||
align-items: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rightCont {
|
|
||||||
width: 100%
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,275 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<div class="rightCont">
|
|
||||||
<el-form label-width="50px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-form-item label="区域名称/编码" label-width="110px">
|
|
||||||
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4"/>
|
|
||||||
<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-row>
|
|
||||||
</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 :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
|
|
||||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
|
||||||
<el-table-column prop="AREA_NAME" label="区域名称" />
|
|
||||||
<el-table-column prop="AREA_RANGE" label="区域范围"/>
|
|
||||||
<el-table-column label="区域级别">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<span v-if="row.AREA_LEAVE === '1'" >一级</span>
|
|
||||||
<span v-if="row.AREA_LEAVE === '2'" >二级</span>
|
|
||||||
<span v-if="row.AREA_LEAVE === '3'" >三级</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="CHILDCOUNT" label="下级区域数"/>
|
|
||||||
<el-table-column prop="GATECOUNT" label="区域下闸机数"/>
|
|
||||||
<el-table-column label="操作" width="400">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
icon="el-icon-circle-close"
|
|
||||||
size="mini"
|
|
||||||
@click="handleClose(row)">进出记录
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-show="edit"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
@click="handleEdit(row.AREA_ID)">编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="edit && row.CHILDCOUNT == 0"
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
@click="handleDelete(row)">删除
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
icon="el-icon-circle-check"
|
|
||||||
size="mini"
|
|
||||||
@click="handleOpen(row)">闸机
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div class="page-btn-group">
|
|
||||||
<div>
|
|
||||||
<el-button 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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ui-foot">
|
|
||||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
|
||||||
</div>
|
|
||||||
</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 {
|
|
||||||
AREA_ID: '',
|
|
||||||
AREA_LEAVE: '3',
|
|
||||||
AREA_PARENT_ID: '',
|
|
||||||
addBtnType: true,
|
|
||||||
listLoading: true,
|
|
||||||
add: false,
|
|
||||||
del: false,
|
|
||||||
edit: false,
|
|
||||||
listQuery: {
|
|
||||||
page: 1,
|
|
||||||
limit: 20
|
|
||||||
},
|
|
||||||
ls: [],
|
|
||||||
dates: [],
|
|
||||||
total: 0,
|
|
||||||
KEYWORDS: '',
|
|
||||||
// 树形菜单
|
|
||||||
filterText: '',
|
|
||||||
varList: [],
|
|
||||||
pd: [],
|
|
||||||
defaultProps: {
|
|
||||||
value: 'id',
|
|
||||||
children: 'nodes',
|
|
||||||
label: 'name'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
filterText(val) {
|
|
||||||
console.log(val)
|
|
||||||
this.$refs.tree.filter(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.AREA_PARENT_ID = this.$parent.AREA_PARENT_ID
|
|
||||||
this.getList()
|
|
||||||
this.hasButton()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
filterNode(value, data) {
|
|
||||||
if (!value) return true
|
|
||||||
return data.name.indexOf(value) !== -1
|
|
||||||
},
|
|
||||||
getRowKey(row) {
|
|
||||||
return row.AREA_ID
|
|
||||||
},
|
|
||||||
selectable(row, index) {
|
|
||||||
return row.ITEMCOUNT == 0
|
|
||||||
},
|
|
||||||
// 添加
|
|
||||||
handleAdd() {
|
|
||||||
this.$parent.activeName = 'Edit'
|
|
||||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
|
||||||
this.$parent.AREA_PARENT_ID = this.AREA_PARENT_ID
|
|
||||||
this.$parent.AREA_ID = this.AREA_ID
|
|
||||||
},
|
|
||||||
// 搜索
|
|
||||||
getQuery() {
|
|
||||||
// this.$refs.multipleTable.clearSelection()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
// 获取列表
|
|
||||||
getList(pid) {
|
|
||||||
this.listLoading = true
|
|
||||||
this.varList = []
|
|
||||||
this.HIDDENREGION_ID = pid
|
|
||||||
requestFN(
|
|
||||||
'/mkmjArea/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
|
||||||
{
|
|
||||||
KEYWORDS: this.KEYWORDS,
|
|
||||||
AREA_LEAVE: this.AREA_LEAVE,
|
|
||||||
AREA_PARENT_ID: this.AREA_PARENT_ID
|
|
||||||
}
|
|
||||||
).then((data) => {
|
|
||||||
this.listLoading = false
|
|
||||||
this.varList = data.varList
|
|
||||||
this.total = data.page.totalResult
|
|
||||||
this.hasButton()
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
}, goKeyReset() {
|
|
||||||
this.KEYWORDS = ''
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
handleEdit(AREA_ID) {
|
|
||||||
this.$parent.AREA_ID = AREA_ID
|
|
||||||
this.$parent.activeName = 'Edit'
|
|
||||||
},
|
|
||||||
handleClose(row) {
|
|
||||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
|
||||||
this.$parent.AREA_ID = row.AREA_ID
|
|
||||||
this.$parent.activeName = 'ListLog'
|
|
||||||
},
|
|
||||||
handleOpen(row) {
|
|
||||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
|
||||||
this.$parent.AREA_ID = row.AREA_ID
|
|
||||||
this.$parent.activeName = 'ListGate'
|
|
||||||
},
|
|
||||||
handleDelete(row) {
|
|
||||||
this.$confirm('确定要删除[' + row.AREA_NAME + ']吗?', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
this.listLoading = true
|
|
||||||
requestFN(
|
|
||||||
'/mkmjArea/delete',
|
|
||||||
{
|
|
||||||
AREA_ID: row.AREA_ID
|
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
this.$message({
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
this.listLoading = false
|
|
||||||
this.varList = []
|
|
||||||
this.listQuery.page = 1
|
|
||||||
this.getList()
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
hasButton: function() {
|
|
||||||
var keys = 'mkmjArea:add,mkmjArea:del,mkmjArea:edit,toExcel'
|
|
||||||
requestFN(
|
|
||||||
'/head/hasButton',
|
|
||||||
{
|
|
||||||
keys: keys
|
|
||||||
}
|
|
||||||
).then((data) => {
|
|
||||||
this.add = data.mkmjAreafhadminadd // 新增权限
|
|
||||||
this.del = data.mkmjAreafhadmindel // 删除权限
|
|
||||||
this.edit = data.mkmjAreafhadminedit // 修改权限
|
|
||||||
this.toExcel = data.toExcel // 导出到excel权限
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 返回列表
|
|
||||||
goBack() {
|
|
||||||
this.$parent.AREA_LEAVE = '2'
|
|
||||||
this.$parent.AREA_PARENT_ID = this.$parent.AREA_OLD_ID
|
|
||||||
this.$parent.activeName = 'ListTwo'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.returnBtn {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-container {
|
|
||||||
display: flex; /**/
|
|
||||||
align-items: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rightCont {
|
|
||||||
width: 100%
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,285 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<div class="rightCont">
|
|
||||||
<el-form label-width="50px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-form-item label="区域名称/编码" label-width="110px">
|
|
||||||
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4"/>
|
|
||||||
<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-row>
|
|
||||||
</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 :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
|
|
||||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
|
||||||
<el-table-column label="区域名称">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<span>
|
|
||||||
<a style="color: #1e9fff;text-decoration:underline" @click="clickChild(row)">{{ row.AREA_NAME }}</a>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="AREA_RANGE" label="区域范围"/>
|
|
||||||
<el-table-column label="区域级别">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<span v-if="row.AREA_LEAVE === '1'" >一级</span>
|
|
||||||
<span v-if="row.AREA_LEAVE === '2'" >二级</span>
|
|
||||||
<span v-if="row.AREA_LEAVE === '3'" >三级</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="CHILDCOUNT" label="下级区域数"/>
|
|
||||||
<el-table-column prop="GATECOUNT" label="区域下闸机数"/>
|
|
||||||
<el-table-column label="操作" width="400">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
icon="el-icon-circle-close"
|
|
||||||
size="mini"
|
|
||||||
@click="handleClose(row)">进出记录
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-show="edit"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
@click="handleEdit(row.AREA_ID)">编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="edit && row.CHILDCOUNT == 0"
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
@click="handleDelete(row)">删除
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
icon="el-icon-circle-check"
|
|
||||||
size="mini"
|
|
||||||
@click="handleOpen(row)">闸机
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div class="page-btn-group">
|
|
||||||
<div>
|
|
||||||
<el-button 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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ui-foot">
|
|
||||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
|
||||||
</div>
|
|
||||||
</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 {
|
|
||||||
AREA_ID: '',
|
|
||||||
AREA_LEAVE: '2',
|
|
||||||
AREA_PARENT_ID: '',
|
|
||||||
addBtnType: true,
|
|
||||||
listLoading: true,
|
|
||||||
add: false,
|
|
||||||
del: false,
|
|
||||||
edit: false,
|
|
||||||
listQuery: {
|
|
||||||
page: 1,
|
|
||||||
limit: 20
|
|
||||||
},
|
|
||||||
ls: [],
|
|
||||||
dates: [],
|
|
||||||
total: 0,
|
|
||||||
KEYWORDS: '',
|
|
||||||
// 树形菜单
|
|
||||||
filterText: '',
|
|
||||||
varList: [],
|
|
||||||
pd: [],
|
|
||||||
defaultProps: {
|
|
||||||
value: 'id',
|
|
||||||
children: 'nodes',
|
|
||||||
label: 'name'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
filterText(val) {
|
|
||||||
console.log(val)
|
|
||||||
this.$refs.tree.filter(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.AREA_PARENT_ID = this.$parent.AREA_PARENT_ID
|
|
||||||
this.getList()
|
|
||||||
this.hasButton()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
filterNode(value, data) {
|
|
||||||
if (!value) return true
|
|
||||||
return data.name.indexOf(value) !== -1
|
|
||||||
},
|
|
||||||
getRowKey(row) {
|
|
||||||
return row.AREA_ID
|
|
||||||
},
|
|
||||||
selectable(row, index) {
|
|
||||||
return row.ITEMCOUNT == 0
|
|
||||||
},
|
|
||||||
// 添加
|
|
||||||
handleAdd() {
|
|
||||||
this.$parent.activeName = 'Edit'
|
|
||||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
|
||||||
this.$parent.AREA_PARENT_ID = this.AREA_PARENT_ID
|
|
||||||
this.$parent.AREA_ID = this.AREA_ID
|
|
||||||
},
|
|
||||||
handleClose(row) {
|
|
||||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
|
||||||
this.$parent.AREA_ID = row.AREA_ID
|
|
||||||
this.$parent.activeName = 'ListLog'
|
|
||||||
},
|
|
||||||
clickChild(row) {
|
|
||||||
this.$parent.AREA_PARENT_ID = row.AREA_ID
|
|
||||||
this.$parent.activeName = 'ListThree'
|
|
||||||
},
|
|
||||||
// 搜索
|
|
||||||
getQuery() {
|
|
||||||
// this.$refs.multipleTable.clearSelection()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
// 获取列表
|
|
||||||
getList(pid) {
|
|
||||||
this.listLoading = true
|
|
||||||
this.varList = []
|
|
||||||
this.HIDDENREGION_ID = pid
|
|
||||||
requestFN(
|
|
||||||
'/mkmjArea/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
|
||||||
{
|
|
||||||
KEYWORDS: this.KEYWORDS,
|
|
||||||
AREA_LEAVE: this.AREA_LEAVE,
|
|
||||||
AREA_PARENT_ID: this.AREA_PARENT_ID
|
|
||||||
}
|
|
||||||
).then((data) => {
|
|
||||||
this.listLoading = false
|
|
||||||
this.varList = data.varList
|
|
||||||
this.total = data.page.totalResult
|
|
||||||
this.hasButton()
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
}, goKeyReset() {
|
|
||||||
this.KEYWORDS = ''
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
handleEdit(AREA_ID) {
|
|
||||||
this.$parent.AREA_ID = AREA_ID
|
|
||||||
this.$parent.activeName = 'Edit'
|
|
||||||
},
|
|
||||||
handleOpen(row) {
|
|
||||||
this.$parent.AREA_LEAVE = this.AREA_LEAVE
|
|
||||||
this.$parent.AREA_ID = row.AREA_ID
|
|
||||||
this.$parent.activeName = 'ListGate'
|
|
||||||
},
|
|
||||||
handleDelete(row) {
|
|
||||||
this.$confirm('确定要删除[' + row.AREA_NAME + ']吗?', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
this.listLoading = true
|
|
||||||
requestFN(
|
|
||||||
'/mkmjArea/delete',
|
|
||||||
{
|
|
||||||
AREA_ID: row.AREA_ID
|
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
this.$message({
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
this.listLoading = false
|
|
||||||
this.varList = []
|
|
||||||
this.listQuery.page = 1
|
|
||||||
this.getList()
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
hasButton: function() {
|
|
||||||
var keys = 'mkmjArea:add,mkmjArea:del,mkmjArea:edit,toExcel'
|
|
||||||
requestFN(
|
|
||||||
'/head/hasButton',
|
|
||||||
{
|
|
||||||
keys: keys
|
|
||||||
}
|
|
||||||
).then((data) => {
|
|
||||||
this.add = data.mkmjAreafhadminadd // 新增权限
|
|
||||||
this.del = data.mkmjAreafhadmindel // 删除权限
|
|
||||||
this.edit = data.mkmjAreafhadminedit // 修改权限
|
|
||||||
this.toExcel = data.toExcel // 导出到excel权限
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 返回列表
|
|
||||||
goBack() {
|
|
||||||
this.$parent.AREA_LEAVE = '1'
|
|
||||||
this.$parent.AREA_PARENT_ID = '0'
|
|
||||||
this.$parent.activeName = 'List'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.returnBtn {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-container {
|
|
||||||
display: flex; /**/
|
|
||||||
align-items: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rightCont {
|
|
||||||
width: 100%
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,579 +0,0 @@
|
||||||
<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="KEYWORDS" placeholder="搜索关键字" />
|
|
||||||
</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="NAME" label="视频名称" />
|
|
||||||
<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 label="操作" align="left" width="500">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<el-button :disabled="STATE == 2" 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="del" :disabled="STATE == 2" type="danger" icon="el-icon-delete" plain @click="handleDelete(row.VIDEOMANAGER_ID)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div class="page-btn-group" style="margin-bottom: 50px;">
|
|
||||||
<div>
|
|
||||||
<el-button v-show="add" :disabled="STATE == 2" 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>
|
|
||||||
<div class="ui-foot">
|
|
||||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
|
||||||
</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-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="form.VIDEO_TYPE===0" label="视频监控信息" prop="VIDEO_RESOURCES_ID">
|
|
||||||
<el-button type="success" icon="el-icon-caret-right" size="mini" @click="selectBobileVideo()">选择</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item v-if="form.VIDEO_TYPE===1" 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===0" 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" 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" 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="dialogVideoAll" :visible.sync="dialogVideoAll" :before-close="handleBack" title="视频" width="1200px">
|
|
||||||
<!-- <iframe src="http://192.168.192.121:10800/?menu=no/#/screen" width="100%" height="500px" allowfullscreen allow="autoplay; fullscreen" style="position: relative;border:none"/>-->
|
|
||||||
<div style="display: flex;flex-wrap: wrap;justify-content: space-between">
|
|
||||||
<div v-for="(video,index) in videoList" :key="index" style="margin-bottom: 10px;width: 45%">
|
|
||||||
<iframe v-if="video.GBSVIDEOURL" :src="video.GBSVIDEOURL" width="100%" height="380" allowfullscreen allow="autoplay; fullscreen;microphone" style="position: relative;border:none"/>
|
|
||||||
<div 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"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
|
|
||||||
import { requestFN } from '@/utils/request'
|
|
||||||
import waves from '@/directive/waves'
|
|
||||||
import Platformvideo from '../../../keyprojects/videomanager/components/platformvideo'
|
|
||||||
import TiandiMap from '../../../../components/TianMap/TiandiMap'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: { Platformvideo, Pagination, TiandiMap },
|
|
||||||
directives: { waves },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
map: null,
|
|
||||||
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,
|
|
||||||
KEYWORDS: '',
|
|
||||||
STATE: this.$parent.STATE,
|
|
||||||
dates: [],
|
|
||||||
videoList: [],
|
|
||||||
videoResourcesList: [],
|
|
||||||
varList: [],
|
|
||||||
LATITUDE: '',
|
|
||||||
LONGITUDE: '',
|
|
||||||
disabledForm: true,
|
|
||||||
form: {
|
|
||||||
AREA_GATE_ID: '',
|
|
||||||
VIDEO_RESOURCES_ID: '',
|
|
||||||
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,
|
|
||||||
timer: '',
|
|
||||||
dialogVideoHLS: false,
|
|
||||||
dialogVideoAll: false,
|
|
||||||
VIDEOURL: '',
|
|
||||||
player: {},
|
|
||||||
playerList: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.form.AREA_GATE_ID = this.$parent.AREA_GATE_ID
|
|
||||||
this.getList()
|
|
||||||
this.getVideoResourcesSelect()
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
this.map && this.map.removeEventListener('click', this.MapClick)
|
|
||||||
console.log('定时器关闭')
|
|
||||||
clearInterval(this.timer)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
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
|
|
||||||
var AREA_GATE_ID = this.form.AREA_GATE_ID
|
|
||||||
this.form = {
|
|
||||||
AREA_GATE_ID: AREA_GATE_ID,
|
|
||||||
GATE_VIDEO_ID: row.GATE_VIDEO_ID,
|
|
||||||
LATITUDE: row.LATITUDE,
|
|
||||||
LONGITUDE: row.LONGITUDE
|
|
||||||
}
|
|
||||||
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.VIDEOMANAGER_ID
|
|
||||||
},
|
|
||||||
// 搜索
|
|
||||||
getQuery() {
|
|
||||||
this.$refs.multipleTable.clearSelection()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
// 五分钟关闭视频播放页面定时任务
|
|
||||||
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.dialogVideoAll = false
|
|
||||||
this.over()
|
|
||||||
},
|
|
||||||
// 播放
|
|
||||||
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
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
setPosition() {
|
|
||||||
this.dialogFormMap = false
|
|
||||||
this.listLoading = true
|
|
||||||
console.log(132)
|
|
||||||
requestFN(
|
|
||||||
'/mkmjGateVideo/savePosition',
|
|
||||||
{
|
|
||||||
LATITUDE: this.form.LATITUDE,
|
|
||||||
LONGITUDE: this.form.LONGITUDE,
|
|
||||||
GATE_VIDEO_ID: this.form.GATE_VIDEO_ID
|
|
||||||
}
|
|
||||||
).then((data) => {
|
|
||||||
this.listLoading = false
|
|
||||||
this.dialogForm = false
|
|
||||||
this.getList()
|
|
||||||
}).catch((e) => {
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 获取列表
|
|
||||||
getList() {
|
|
||||||
this.listLoading = true
|
|
||||||
requestFN(
|
|
||||||
'/mkmjGateVideo/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
|
||||||
{
|
|
||||||
KEYWORDS: this.KEYWORDS,
|
|
||||||
AREA_GATE_ID: this.form.AREA_GATE_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
|
|
||||||
},
|
|
||||||
selectBobileVideo() {
|
|
||||||
this.$refs.bobileCamer.init(this.$parent.UNITS_ID)
|
|
||||||
},
|
|
||||||
selectVideo(row) {
|
|
||||||
this.$refs.platformvideo.init()
|
|
||||||
},
|
|
||||||
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)
|
|
||||||
},
|
|
||||||
// 保存
|
|
||||||
upload() {
|
|
||||||
this.$refs.form.validate(valid => {
|
|
||||||
console.log(this.form)
|
|
||||||
if (valid) {
|
|
||||||
this.listLoading = true
|
|
||||||
requestFN(
|
|
||||||
'/mkmjGateVideo/add',
|
|
||||||
{
|
|
||||||
PLATFORMVIDEOMANAGEMENT_ID: this.form.PLATFORMVIDEOMANAGEMENT_ID,
|
|
||||||
LONGITUDE: this.form.LONGITUDE,
|
|
||||||
LATITUDE: this.form.LATITUDE,
|
|
||||||
AREA_GATE_ID: this.form.AREA_GATE_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.VIDEOMANAGER_ID)
|
|
||||||
requestFN(
|
|
||||||
'/mkmjGateVideo/delete',
|
|
||||||
{
|
|
||||||
GATE_VIDEO_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(() => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 判断按钮权限,用于是否显示按钮
|
|
||||||
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.KEYWORDS = ''
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
changeType(e) {
|
|
||||||
if (e === 1) {
|
|
||||||
this.form.VIDEO_TYPE = 1
|
|
||||||
} else {
|
|
||||||
this.form.VIDEO_TYPE = 0
|
|
||||||
}
|
|
||||||
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() {
|
|
||||||
if (this.dialogVideo) this.dialogVideo = 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() {
|
|
||||||
var AREA_GATE_ID = this.form.AREA_GATE_ID
|
|
||||||
this.form = {
|
|
||||||
VIDEO_TYPE: 1,
|
|
||||||
CODE: '',
|
|
||||||
AREA_GATE_ID: AREA_GATE_ID,
|
|
||||||
VIDEO_RESOURCES_ID: '',
|
|
||||||
PLATFORMVIDEOMANAGEMENT_ID: '',
|
|
||||||
LATITUDE: '',
|
|
||||||
LONGITUDE: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
goBack() {
|
|
||||||
this.$parent.activeName = 'ListGate'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
.hide .el-upload--picture-card {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#map{
|
|
||||||
width: 1000px;
|
|
||||||
height: 500px;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,53 +0,0 @@
|
||||||
<template>
|
|
||||||
<!-- <component :is="activeName" />-->
|
|
||||||
<div>
|
|
||||||
<List v-if="activeName=='List'" ref="list" />
|
|
||||||
<ListTwo v-if="activeName=='ListTwo'" />
|
|
||||||
<ListThree v-if="activeName=='ListThree'" />
|
|
||||||
<ListGate v-if="activeName=='ListGate'" />
|
|
||||||
<Edit v-if="activeName=='Edit'" />
|
|
||||||
<EditGate v-if="activeName=='EditGate'" />
|
|
||||||
<ListLog v-if="activeName=='ListLog'" />
|
|
||||||
<VideoList v-if="activeName=='VideoList'" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import List from './components/listOne'
|
|
||||||
import ListTwo from './components/listTwo'
|
|
||||||
import ListThree from './components/listThree'
|
|
||||||
import ListGate from './components/listGate'
|
|
||||||
import Edit from './components/edit'
|
|
||||||
import EditGate from './components/editGate'
|
|
||||||
import ListLog from './components/listLog'
|
|
||||||
import VideoList from './components/videoList'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
VideoList: VideoList,
|
|
||||||
List: List,
|
|
||||||
Edit: Edit,
|
|
||||||
ListTwo: ListTwo,
|
|
||||||
ListThree: ListThree,
|
|
||||||
ListGate: ListGate,
|
|
||||||
EditGate: EditGate,
|
|
||||||
ListLog: ListLog
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
activeName: 'List'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
activeName(val) {
|
|
||||||
if (val == 'List') {
|
|
||||||
this.$refs.list.getList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
</style>
|
|
||||||
|
|
Loading…
Reference in New Issue