喀左大屏改造,追加监控轮播大屏组件
This commit is contained in:
@@ -46,6 +46,34 @@
|
||||
</ai-fold>
|
||||
<el-button type="text" icon="el-icon-plus" @click="options.charts.push({title:'新图表'})">添加图表</el-button>
|
||||
</template>
|
||||
<template v-else-if="options.type=='monitorCarousel'">
|
||||
<config-item label="监控列表">
|
||||
<el-button type="text" icon="el-icon-plus" @click="options.list.push({})"/>
|
||||
</config-item>
|
||||
<el-table size="mini" :data="options.list" border :row-style="{backgroundColor:'transparent'}">
|
||||
<el-table-column label="监控类型">
|
||||
<template v-slot="{row}">
|
||||
<ai-select size="mini" v-model="row.monitorType" :select-list="monitorTypes"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="监控地址">
|
||||
<template v-slot="{row}">
|
||||
<el-input v-if="['hik','dahua'].includes(row.monitorType)" size="mini" v-model="row.src" clearable/>
|
||||
<div v-else-if="['cmcc','slw'].includes(row.monitorType)">
|
||||
<el-input size="mini" v-model="row.api" clearable placeholder="请输入监控列表接口"/>
|
||||
<ai-select v-model="row.did" :instance="instance" @change="handleMonitor(row)" size="mini"
|
||||
:prop="{label:'name'}" :condition="e=>!!e.name&&!!e.id" class="mar-t8" :action="row.api"/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="60px" label="操作">
|
||||
<template v-slot="{row,i}">
|
||||
<el-button type="text" @click="$confirm('是否删除该监控?').then(()=>options.list.splice(i,1))">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
<div class="layout-config__group" v-else-if="['hik','dahua'].includes(options.monitorType)">
|
||||
<h2>基础设置</h2>
|
||||
<config-item label="视频地址">
|
||||
@@ -136,9 +164,12 @@ import 'brace/theme/monokai';
|
||||
import AiDialogBtn from "dui/packages/layout/AiDialogBtn.vue";
|
||||
import AiFold from "dui/packages/layout/AiFold.vue";
|
||||
import ChartPicker from "./chartPicker.vue";
|
||||
import {DvCompData} from "../config";
|
||||
import {DvCompData, monitorTypes} from "../config";
|
||||
import ConfigItem from "./configItem.vue";
|
||||
import DatasourcePicker from "./datasourcePicker.vue";
|
||||
import Template from "../../../../project/sass/apps/AppAskForm/components/Template.vue";
|
||||
import TableInputColumn from "../../../xbot/AppWorkOrderXbot/components/TableInputColumn.vue";
|
||||
import AiSelect from "dui/packages/basic/AiSelect.vue";
|
||||
|
||||
export default {
|
||||
name: 'dataConfig',
|
||||
@@ -160,7 +191,8 @@ export default {
|
||||
list: [],
|
||||
showMapEditor: false,
|
||||
form: {},
|
||||
datasource: {}
|
||||
datasource: {},
|
||||
monitorTypes
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -169,6 +201,9 @@ export default {
|
||||
isPlot: v => v.options.type == 'plot'
|
||||
},
|
||||
components: {
|
||||
AiSelect,
|
||||
TableInputColumn,
|
||||
Template,
|
||||
DatasourcePicker,
|
||||
ConfigItem,
|
||||
ChartPicker,
|
||||
@@ -183,6 +218,9 @@ export default {
|
||||
this.$emit("change", values)
|
||||
} else if (this.isTable) {
|
||||
this.json = JSON.stringify(this.options.tableConfig)
|
||||
} else if (this.options.type == "monitorCarousel") {
|
||||
const {list = []} = this.options
|
||||
this.$set(this.options, 'list', list)
|
||||
} else if (this.isPlot) {
|
||||
this.options.charts = this.options.charts.map(e => ({...e, ds: e}))
|
||||
}
|
||||
@@ -222,6 +260,13 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
handleMonitor(row) {
|
||||
this.instance.post(`/app/appzyvideoequipment/getWebSdkUrl?deviceId=${row.did}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$set(row, 'src', JSON.parse(res.data).url)
|
||||
}
|
||||
})
|
||||
},
|
||||
onChooseChange() {
|
||||
let arr = []
|
||||
if (this.options.dataX && this.options.dataY.length) {
|
||||
@@ -387,5 +432,31 @@ export default {
|
||||
text-align: right;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.el-table {
|
||||
background-color: transparent;
|
||||
|
||||
tr {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.el-table__cell {
|
||||
color: white;
|
||||
background-color: #1D2127 !important;
|
||||
|
||||
input:disabled {
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
color: white;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&:last-of-type {
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user