调整目录结构使其能够被引用
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="locateDialog">
|
<section class="AiLocateDialog">
|
||||||
<ai-dialog :visible.sync="dialog" title="标绘" @closed="$emit('visible',false),selected={}"
|
<ai-dialog :visible.sync="dialog" title="标绘" @closed="$emit('visible',false),selected={}"
|
||||||
@opened="$nextTick(()=>initMap())"
|
@opened="$nextTick(()=>initMap())"
|
||||||
@onConfirm="handleConfirm">
|
@onConfirm="handleConfirm">
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "locateDialog",
|
name: "AiLocateDialog",
|
||||||
model: {
|
model: {
|
||||||
prop: "visible",
|
prop: "visible",
|
||||||
event: "visible",
|
event: "visible",
|
||||||
@@ -113,7 +113,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.locateDialog {
|
.AiLocateDialog {
|
||||||
::v-deep .el-dialog__body {
|
::v-deep .el-dialog__body {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 480px;
|
height: 480px;
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
<!-- <el-button type="text" @click="close(row.id)">停播</el-button> -->
|
<!-- <el-button type="text" @click="close(row.id)">停播</el-button> -->
|
||||||
<el-button type="text" @click="toTaskList(row.deviceId)">任务列表</el-button>
|
<el-button type="text" @click="toTaskList(row.deviceId)">任务列表</el-button>
|
||||||
<el-button type="text" @click="bind(row)" >绑定行政区划</el-button>
|
<el-button type="text" @click="bind(row)">绑定行政区划</el-button>
|
||||||
<!-- <el-button type="text" @click="locate=true">地图标绘</el-button>-->
|
<!-- <el-button type="text" @click="locate=true">地图标绘</el-button>-->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -37,17 +37,15 @@
|
|||||||
<el-button type="primary" @click="bindArea">确 定</el-button>
|
<el-button type="primary" @click="bindArea">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<locate-dialog v-model="locate" :ins="instance" @confirm="bindLocate"/>
|
<ai-locate-dialog v-model="locate" :ins="instance" @confirm="bindLocate"/>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
import LocateDialog from "../../AppMonitor/components/locateDialog";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'List',
|
name: 'List',
|
||||||
components: {LocateDialog},
|
|
||||||
props: {
|
props: {
|
||||||
dict: Object,
|
dict: Object,
|
||||||
instance: Function,
|
instance: Function,
|
||||||
@@ -98,7 +96,7 @@ export default {
|
|||||||
label: '是否绑定区划',
|
label: '是否绑定区划',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: (h, {row}) => {
|
render: (h, {row}) => {
|
||||||
return h('span', null, (row.areaId? '是': '否'))
|
return h('span', null, (row.areaId ? '是' : '否'))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -120,7 +118,7 @@ export default {
|
|||||||
...mapState(['user']),
|
...mapState(['user']),
|
||||||
},
|
},
|
||||||
|
|
||||||
created () {
|
created() {
|
||||||
this.dict.load('dlbDevStatus', 'yesOrNo').then(() => {
|
this.dict.load('dlbDevStatus', 'yesOrNo').then(() => {
|
||||||
this.getList()
|
this.getList()
|
||||||
})
|
})
|
||||||
@@ -196,7 +194,7 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
update () {
|
update() {
|
||||||
this.btnLoading = true
|
this.btnLoading = true
|
||||||
this.instance.post(`/app/appdlbquipment/sync`, null, {
|
this.instance.post(`/app/appdlbquipment/sync`, null, {
|
||||||
timeout: 1000000
|
timeout: 1000000
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<ai-search-bar>
|
<ai-search-bar>
|
||||||
<template #right>
|
<template #right>
|
||||||
<el-input prefix-icon="iconfont iconSearch" v-model="search.title" placeholder="设备名、MAC号" clearable
|
<el-input prefix-icon="iconfont iconSearch" v-model="search.title" placeholder="设备名、MAC号" clearable
|
||||||
@clear="page.current = 1,search.title = '', getTableData()"
|
@clear="page.current = 1,search.title = '', getTableData()"
|
||||||
v-throttle="() => {page.current = 1, getTableData()}" size="small"/>
|
v-throttle="() => {page.current = 1, getTableData()}" size="small"/>
|
||||||
</template>
|
</template>
|
||||||
</ai-search-bar>
|
</ai-search-bar>
|
||||||
@@ -26,18 +26,17 @@
|
|||||||
</ai-table>
|
</ai-table>
|
||||||
</template>
|
</template>
|
||||||
</ai-list>
|
</ai-list>
|
||||||
<locate-dialog v-model="locate" :ins="instance" @confirm="v=>handleLocate(detail,v)"/>
|
<ai-locate-dialog v-model="locate" :ins="instance" @confirm="v=>handleLocate(detail,v)"/>
|
||||||
<setting-dialog v-model="dialog" :ins="instance"/>
|
<setting-dialog v-model="dialog" :ins="instance"/>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import LocateDialog from "./components/locateDialog";
|
|
||||||
import SettingDialog from "./components/settingDialog";
|
import SettingDialog from "./components/settingDialog";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AppMonitorDevice",
|
name: "AppMonitorDevice",
|
||||||
components: {SettingDialog, LocateDialog},
|
components: {SettingDialog},
|
||||||
label: "监控设备管理",
|
label: "监控设备管理",
|
||||||
props: {
|
props: {
|
||||||
instance: Function,
|
instance: Function,
|
||||||
|
|||||||
@@ -25,169 +25,168 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</ai-dialog>
|
</ai-dialog>
|
||||||
<locate-dialog v-model="locate" :ins="instance" :latlng="latlng" @confirm="v=>handleLocate(selected,v)"/>
|
<ai-locate-dialog v-model="locate" :ins="instance" :latlng="latlng" @confirm="v=>handleLocate(selected,v)"/>
|
||||||
<ai-area custom-clicker :input-clicker="false" v-model="selected.areaId" :hideLevel="disabledLevel" :instance="instance" ref="BindArea"
|
<ai-area custom-clicker :input-clicker="false" v-model="selected.areaId" :hideLevel="disabledLevel" :instance="instance" ref="BindArea"
|
||||||
@change="handleSubmit(selected)"/>
|
@change="handleSubmit(selected)"/>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
import DeviceSlider from "./components/deviceSlider";
|
import DeviceSlider from "./components/deviceSlider";
|
||||||
import LocateDialog from "./components/locateDialog";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AppMonitorManage",
|
name: "AppMonitorManage",
|
||||||
components: {LocateDialog, DeviceSlider},
|
components: {DeviceSlider},
|
||||||
label: "监控实况",
|
label: "监控实况",
|
||||||
props: {
|
props: {
|
||||||
instance: Function,
|
instance: Function,
|
||||||
dict: Object,
|
dict: Object,
|
||||||
permissions: Function
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
splitOps() {
|
||||||
|
return [
|
||||||
|
{label: "单分屏", value: 1, per: "100%"},
|
||||||
|
{label: "四分屏", value: 4, per: "49%"},
|
||||||
|
{label: "九分屏", value: 9, per: "32%"}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
computed: {
|
currentSplitStyle() {
|
||||||
splitOps() {
|
let per = this.splitOps.find(e => e.value == this.splitScreen)?.per || "100%"
|
||||||
return [
|
return {width: per, height: per}
|
||||||
{label: "单分屏", value: 1, per: "100%"},
|
|
||||||
{label: "四分屏", value: 4, per: "49%"},
|
|
||||||
{label: "九分屏", value: 9, per: "32%"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
currentSplitStyle() {
|
|
||||||
let per = this.splitOps.find(e => e.value == this.splitScreen)?.per || "100%"
|
|
||||||
return {width: per, height: per}
|
|
||||||
},
|
|
||||||
...mapState(['user'])
|
|
||||||
},
|
},
|
||||||
|
...mapState(['user'])
|
||||||
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
slider: true,
|
slider: true,
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
splitScreen: 1,
|
splitScreen: 1,
|
||||||
monitors: [],
|
monitors: [],
|
||||||
dialog: false,
|
dialog: false,
|
||||||
locate: false,
|
locate: false,
|
||||||
selected: {
|
selected: {
|
||||||
areaId: ''
|
areaId: ''
|
||||||
},
|
},
|
||||||
latlng: null,
|
latlng: null,
|
||||||
disabledLevel: 0,
|
disabledLevel: 0,
|
||||||
rules: {
|
rules: {
|
||||||
name: [{required: true, message: "请填写 设备名称"}]
|
name: [{required: true, message: "请填写 设备名称"}]
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
|
||||||
created () {
|
created() {
|
||||||
this.selected.areaId = this.user.info.areaId
|
this.selected.areaId = this.user.info.areaId
|
||||||
this.disabledLevel = this.user.info.areaList.length
|
this.disabledLevel = this.user.info.areaList.length
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
handleFullscreen() {
|
handleFullscreen() {
|
||||||
this.fullscreen = !this.fullscreen
|
this.fullscreen = !this.fullscreen
|
||||||
this.$fullscreen(this.fullscreen)
|
this.$fullscreen(this.fullscreen)
|
||||||
},
|
},
|
||||||
handleSelectMonitor(monitor) {
|
handleSelectMonitor(monitor) {
|
||||||
let {id} = monitor,
|
let {id} = monitor,
|
||||||
index = this.monitors.findIndex(e => e.id == id)
|
index = this.monitors.findIndex(e => e.id == id)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
this.monitors.splice(index, 1)
|
this.monitors.splice(index, 1)
|
||||||
this.monitors.map((e, i) => {
|
this.monitors.map((e, i) => {
|
||||||
if (i > index) {
|
if (i > index) {
|
||||||
this.showMonitor(e, true)
|
this.showMonitor(e, true)
|
||||||
}
|
|
||||||
})
|
|
||||||
} else if (this.monitors.length >= this.splitScreen && this.splitScreen > 1) {
|
|
||||||
this.$message.warning("可分屏监控已满,请先取消其他的监控")
|
|
||||||
} else {
|
|
||||||
this.showMonitor(monitor)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
showMonitor(monitor, refresh = false) {
|
|
||||||
let {id: deviceId} = monitor
|
|
||||||
deviceId && this.instance.post("/app/appzyvideoequipment/getWebSdkUrl", null, {
|
|
||||||
params: {deviceId}
|
|
||||||
}).then(res => {
|
|
||||||
if (res?.data) {
|
|
||||||
let data = JSON.parse(res.data)
|
|
||||||
if (refresh) {
|
|
||||||
monitor.url = data.url
|
|
||||||
} else if (this.splitScreen == 1) {
|
|
||||||
this.monitors = [{...monitor, ...data}]
|
|
||||||
} else {
|
|
||||||
this.monitors.push({...monitor, ...data})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
} else if (this.monitors.length >= this.splitScreen && this.splitScreen > 1) {
|
||||||
renderTreeItem: function (h, {node, data}) {
|
this.$message.warning("可分屏监控已满,请先取消其他的监控")
|
||||||
let show = data.deviceStatus==1 ? 'show' : ''
|
} else {
|
||||||
if (node.isLeaf) {
|
this.showMonitor(monitor)
|
||||||
return (
|
}
|
||||||
<div class="flexRow">
|
},
|
||||||
<i class={['iconfont', 'iconshipinjiankong', show]}/>
|
showMonitor(monitor, refresh = false) {
|
||||||
<div>{node.label}</div>
|
let {id: deviceId} = monitor
|
||||||
<el-dropdown class="menuBtn" onCommand={e => this.handleSliderOption(e, data)}>
|
deviceId && this.instance.post("/app/appzyvideoequipment/getWebSdkUrl", null, {
|
||||||
<i class="iconfont iconMore"/>
|
params: {deviceId}
|
||||||
<el-dropdown-menu slot="dropdown">
|
}).then(res => {
|
||||||
<el-dropdown-item command="edit">修改名称</el-dropdown-item>
|
if (res?.data) {
|
||||||
<el-dropdown-item command="area">行政地区</el-dropdown-item>
|
let data = JSON.parse(res.data)
|
||||||
<el-dropdown-item command="locate">地图标绘</el-dropdown-item>
|
if (refresh) {
|
||||||
</el-dropdown-menu>
|
monitor.url = data.url
|
||||||
</el-dropdown>
|
} else if (this.splitScreen == 1) {
|
||||||
</div>
|
this.monitors = [{...monitor, ...data}]
|
||||||
)
|
} else {
|
||||||
} else return (
|
this.monitors.push({...monitor, ...data})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
renderTreeItem: function (h, {node, data}) {
|
||||||
|
let show = data.deviceStatus == 1 ? 'show' : ''
|
||||||
|
if (node.isLeaf) {
|
||||||
|
return (
|
||||||
<div class="flexRow">
|
<div class="flexRow">
|
||||||
|
<i class={['iconfont', 'iconshipinjiankong', show]}/>
|
||||||
<div>{node.label}</div>
|
<div>{node.label}</div>
|
||||||
{data.id != 'no_area' ? <div class="sta">
|
<el-dropdown class="menuBtn" onCommand={e => this.handleSliderOption(e, data)}>
|
||||||
<p>{data.online || 0}</p>/{data.sum || 0}
|
<i class="iconfont iconMore"/>
|
||||||
</div>
|
<el-dropdown-menu slot="dropdown">
|
||||||
: <div/>}
|
<el-dropdown-item command="edit">修改名称</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="area">行政地区</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="locate">地图标绘</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
},
|
} else return (
|
||||||
handleSliderOption(command, data) {
|
<div class="flexRow">
|
||||||
this.selected = JSON.parse(JSON.stringify({...data, command}))
|
<div>{node.label}</div>
|
||||||
if (command == "edit") {//修改名称
|
{data.id != 'no_area' ? <div class="sta">
|
||||||
this.dialog = true
|
<p>{data.online || 0}</p>/{data.sum || 0}
|
||||||
} else if (command == "area") {//绑定areaId
|
</div>
|
||||||
this.$refs.BindArea?.chooseArea()
|
: <div/>}
|
||||||
} else if (command == "locate") {//地图标绘
|
</div>
|
||||||
this.latlng = data.lat && data.lng ? {
|
)
|
||||||
lat: data.lat,
|
},
|
||||||
lng: data.lng
|
handleSliderOption(command, data) {
|
||||||
} : ''
|
this.selected = JSON.parse(JSON.stringify({...data, command}))
|
||||||
this.locate = true
|
if (command == "edit") {//修改名称
|
||||||
}
|
this.dialog = true
|
||||||
},
|
} else if (command == "area") {//绑定areaId
|
||||||
handleSubmit(row) {
|
this.$refs.BindArea?.chooseArea()
|
||||||
delete row.createTime
|
} else if (command == "locate") {//地图标绘
|
||||||
return this.instance.post("/app/appzyvideoequipment/addOrUpdate", {
|
this.latlng = data.lat && data.lng ? {
|
||||||
...row
|
lat: data.lat,
|
||||||
}).then(res => {
|
lng: data.lng
|
||||||
if (res?.code == 0) {
|
} : ''
|
||||||
this.$message.success("提交成功!")
|
this.locate = true
|
||||||
this.dialog = false
|
|
||||||
this.$refs.DeviceSlider?.getDevices()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleLocate(row, locate) {
|
|
||||||
if (locate) {
|
|
||||||
let {lat, lng} = locate.location
|
|
||||||
this.handleSubmit({...row, lat, lng}).then(() => {
|
|
||||||
this.locate = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
handleSubmit(row) {
|
||||||
this.monitors = []
|
delete row.createTime
|
||||||
|
return this.instance.post("/app/appzyvideoequipment/addOrUpdate", {
|
||||||
|
...row
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.dialog = false
|
||||||
|
this.$refs.DeviceSlider?.getDevices()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleLocate(row, locate) {
|
||||||
|
if (locate) {
|
||||||
|
let {lat, lng} = locate.location
|
||||||
|
this.handleSubmit({...row, lat, lng}).then(() => {
|
||||||
|
this.locate = false
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.monitors = []
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user