37 changed files with 1570 additions and 297 deletions
@ -0,0 +1,262 @@ |
|||
<template> |
|||
<Dialog v-model="modelVisible" title="设备操作" width="600px"> |
|||
<div class="DeviceControlDialog"> |
|||
<div style="height: 500px;overflow-y:auto;"> |
|||
<Form |
|||
column="2" |
|||
v-if="formList && formList.length" |
|||
class="form" |
|||
ref="FormConfigRef" |
|||
label-width='150px' |
|||
:formList="formList" |
|||
:value="formData" |
|||
/> |
|||
</div> |
|||
</div> |
|||
<template #footer> |
|||
<Button @click.native="handleSubmit"> 发送 </Button> |
|||
</template> |
|||
</Dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import Button from "@screen/components/Buttons/Button.vue"; |
|||
import Dialog from "@screen/components/Dialog/index.vue"; |
|||
import request from "@/utils/request"; |
|||
|
|||
import { Message } from 'element-ui' |
|||
import Form from "@screen/components/FormConfig"; |
|||
export default { |
|||
name: "DeviceControlDialog", |
|||
components: { |
|||
Dialog, |
|||
Form, |
|||
Button |
|||
}, |
|||
model: { |
|||
prop: "visible", |
|||
event: "update:value", |
|||
}, |
|||
props: { |
|||
|
|||
rebind: { |
|||
type: Function, |
|||
default: null |
|||
}, |
|||
|
|||
visible: Boolean, |
|||
dialogData: { |
|||
type: Object, |
|||
default: () => ({}), |
|||
}, |
|||
}, |
|||
computed: { |
|||
modelVisible: { |
|||
get() { |
|||
return this.visible; |
|||
}, |
|||
set(val) { |
|||
this.$emit("update:value", val); |
|||
}, |
|||
}, |
|||
}, |
|||
data(){ |
|||
return { |
|||
enum_color:[ |
|||
{label:"红色",value:"1"}, |
|||
{label:"黄色",value:"2"}, |
|||
{label:"绿色",value:"3"}, |
|||
], |
|||
enum_normalTextSetting:[ |
|||
{label:"常态文字持续显示",value:"0"}, |
|||
{label:"触发显示常态文字",value:"1"}, |
|||
], |
|||
enum_wordCycle:[ |
|||
{label:"1:1常亮",value:"1"}, |
|||
{label:"1:2",value:"2"}, |
|||
{label:"1:3",value:"3"}, |
|||
{label:"1:4",value:"4"}, |
|||
{label:"2:4",value:"5"}, |
|||
{label:"3:4",value:"6"}, |
|||
{label:"4:5",value:"7"} |
|||
], |
|||
enum_wordFlicker:[ |
|||
{label:"20次/min",value:"1"}, |
|||
{label:"30次/min",value:"2"}, |
|||
{label:"60次/min",value:"3"}, |
|||
{label:"120次/min",value:"4"}, |
|||
{label:"45次/min",value:"5"}, |
|||
], |
|||
formList:[], |
|||
formData: {}, |
|||
list: [ |
|||
"activeDevice", |
|||
"screenLuminance", |
|||
"volume", |
|||
"colour", |
|||
"wordFlickerFrequency", |
|||
"wordDutyCycle", |
|||
"normalTextContent", |
|||
"triggerTextContent", |
|||
"triggerTextDuration", |
|||
"normalTextSetting", |
|||
"vehicleDetectionSensitivity", |
|||
"averageData", |
|||
"timeQuantum", |
|||
"firstTimePeriodStartTTime", |
|||
"firstTimePeriodEndTime", |
|||
"firstTimePeriodRedAndBlueFlash", |
|||
"firstTimePeriodScreenSwitch", |
|||
"firstTimePeriodWhetherToReport", |
|||
"firstTimePeriodHornSwitch", |
|||
"secondTimePeriodStartTTime", |
|||
"secondTimePeriodEndTime", |
|||
"secondTimePeriodRedAndBlueFlash", |
|||
"secondTimePeriodScreenSwitch", |
|||
"secondTimePeriodWhetherToReport", |
|||
"secondTimePeriodHornSwitch", |
|||
"thirdlyTimePeriodStartTTime", |
|||
"thirdlyTimePeriodEndTime", |
|||
"thirdlyTimePeriodRedAndBlueFlash", |
|||
"thirdlyTimePeriodScreenSwitch", |
|||
"thirdlyTimePeriodWhetherToReport", |
|||
"thirdlyTimePeriodHornSwitch" |
|||
] |
|||
} |
|||
}, |
|||
methods:{ |
|||
handleSubmit(){ |
|||
const self = this; |
|||
this.$refs.FormConfigRef.validate().then((data) => { |
|||
|
|||
data.numberOfDevices = this.dialogData.iotDeviceId.substr(this.dialogData.iotDeviceId.lastIndexOf('-')+1) |
|||
request({ |
|||
url: `/business/device/functions/${self.dialogData.iotDeviceId}/0b`, |
|||
method: "POST", |
|||
data: data |
|||
}) |
|||
.then(result => { |
|||
if (result.code != 200) { |
|||
Message.error("操作失败"); |
|||
self.rebind() |
|||
self.modelVisible = false |
|||
return; |
|||
}; |
|||
Message.success("操作成功"); |
|||
}) |
|||
.catch(() => { |
|||
Message.error("操作失败"); |
|||
}) |
|||
}) |
|||
} |
|||
}, |
|||
async created() { |
|||
request({ |
|||
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId}`, |
|||
method: "get", |
|||
}).then(result => { |
|||
if (result.code != 200) return Message.error("操作失败"); |
|||
|
|||
let pv = ""; |
|||
result.data.forEach(x=>{ |
|||
pv += `${x.propertyName},${x.type},${x.property}.` |
|||
}) |
|||
|
|||
let _formList = []; |
|||
this.list.forEach(e => { |
|||
const p = _.find(result.data,{property:e}) |
|||
if(p) { |
|||
if(p.type === 'string' || p.type === 'long'){ |
|||
_formList.push( { |
|||
label: p.propertyName+':', |
|||
key: p.property, |
|||
}) |
|||
} else if(p.type === 'enum' ){ |
|||
if(p.property.indexOf('PeriodHornSwitch') !== -1 || |
|||
p.property.indexOf('PeriodRedAndBlueFlash') !== -1 || |
|||
p.property.indexOf('PeriodWhetherToReport') !== -1 || |
|||
p.property.indexOf('TimePeriodScreenSwitch') !== -1 ){ // 号角开关 | 红蓝爆闪灯 |
|||
_formList.push({ |
|||
label: p.propertyName+':', |
|||
key: p.property, |
|||
type: "RadioGroup", |
|||
options: { |
|||
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)", |
|||
options: [ |
|||
{ |
|||
key: "0", |
|||
label: "关闭", |
|||
}, |
|||
{ |
|||
key: "1", |
|||
label: "开启", |
|||
}, |
|||
], |
|||
}, |
|||
}) |
|||
} else if(p.property === 'wordFlickerFrequency'){ |
|||
_formList.push({ |
|||
label: p.propertyName+':', |
|||
key: p.property, |
|||
type: "select", |
|||
default: null, |
|||
options: { |
|||
options: this.enum_wordFlicker |
|||
} |
|||
}) |
|||
}else if(p.property==="colour"){ |
|||
_formList.push({ |
|||
label: p.propertyName+':', |
|||
key: p.property, |
|||
type: "select", |
|||
default: null, |
|||
options: { |
|||
options: this.enum_color |
|||
} |
|||
}) |
|||
}else if(p.property==="wordDutyCycle"){ |
|||
_formList.push({ |
|||
label: p.propertyName+':', |
|||
key: p.property, |
|||
type: "select", |
|||
default: null, |
|||
options: { |
|||
options: this.enum_wordCycle |
|||
} |
|||
}) |
|||
}else if(p.property==="normalTextSetting"){ |
|||
_formList.push({ |
|||
label: p.propertyName+':', |
|||
key: p.property, |
|||
type: "select", |
|||
default: null, |
|||
options: { |
|||
options: this.enum_normalTextSetting |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
this.formData[p.property] = p.value |
|||
} |
|||
}) |
|||
this.formList = _formList; |
|||
}) |
|||
} |
|||
|
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.DeviceControlDialog { |
|||
width: 550px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
gap: 15px; |
|||
min-height: 360px; |
|||
|
|||
.tips { |
|||
font-size: 12px; |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,126 @@ |
|||
<template> |
|||
<div class='DeviceParams'> |
|||
<div class="no-data" v-if="!devicesList.length" v-loading="secondLoading">暂无设备参数</div> |
|||
<Descriptions :list="devicesList" :data="devicesData" style="gap: 18px;" column="6"> |
|||
<template v-for="item in devicesList.slice(0, -1)" #[`content-${getSlotKey(item.key)}`]="{ data }"> |
|||
<span>{{ data.text }}</span> |
|||
</template> |
|||
</Descriptions> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Descriptions from '@screen/components/Descriptions.vue'; |
|||
import Switcher from '@screen/pages/service/PublishingChannelManagement/components/Switcher.vue'; |
|||
import request from "@/utils/request"; |
|||
import { Message } from 'element-ui'; |
|||
import { confirm } from "@screen/utils/common"; |
|||
import { devicesFormList } from '../data.js'; |
|||
|
|||
export default { |
|||
name: 'DeviceParams', |
|||
components: { |
|||
Descriptions, |
|||
Switcher |
|||
}, |
|||
props: { |
|||
dialogData: { |
|||
type: Object, |
|||
default: () => ({}) |
|||
}, |
|||
disabled: Boolean |
|||
}, |
|||
data() { |
|||
return { |
|||
secondLoading: true, |
|||
devicesList: [], |
|||
devicesData: {}, |
|||
activeOption: { |
|||
active: { |
|||
text: "开" |
|||
}, |
|||
unActive: { |
|||
text: "关" |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
async created() { |
|||
this.bind(); |
|||
}, |
|||
methods: { |
|||
bind(){ |
|||
this.devicesList = []; |
|||
let devs = []; |
|||
request({ |
|||
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId}`, |
|||
method: "get", |
|||
}).then(result => { |
|||
if (result.code != 200) return Message.error("操作失败"); |
|||
result.data.forEach(item => { |
|||
if (item.propertyName) { |
|||
devs.push({ |
|||
label: item.propertyName, |
|||
key: item.property, |
|||
gridColumn: 3, |
|||
}); |
|||
this.devicesData[item.property] = item.formatValue; |
|||
} |
|||
}); |
|||
this.devicesList = devs; |
|||
}) |
|||
}, |
|||
async handleSwitcherChange(value, data) { |
|||
let str = data.state ? "关闭" : "开启"; |
|||
let deviceName = ""; |
|||
if (data.key.includes("fan")) { |
|||
str += "风扇?"; |
|||
deviceName = "fan_out_en"; |
|||
} else { |
|||
str += "该支路?" |
|||
deviceName = data.key.match(/^[a-z]+_out|[0-9]+/g).join("_") + "_en"; //dc_out_2_en ac_out_2_en; |
|||
} |
|||
data.state = value; |
|||
const isContinue = await confirm({ message: `${str}` }) |
|||
.catch(() => { |
|||
console.log(data.state, value, 333) |
|||
data.state = !value; |
|||
}); |
|||
|
|||
if (!isContinue) return; |
|||
|
|||
// https://www.yuque.com/dayuanzhong-ovjwn/gkht0m/ww776d5kzs72ilzh?singleDoc= |
|||
request({ |
|||
url: `/business/device/functions/${this.dialogData.iotDeviceId}/${102}`, |
|||
method: "POST", |
|||
data: { |
|||
deviceName, |
|||
// 开关:1=打开,0=关闭 |
|||
value: value ? 1 : 0 |
|||
} |
|||
}) |
|||
.then(result => { |
|||
if (result.code != 200) { |
|||
Message.error("操作失败"); |
|||
data.state = !value; |
|||
return; |
|||
}; |
|||
Message.success("操作成功"); |
|||
}) |
|||
.catch(() => { |
|||
data.state = !value; |
|||
Message.error("操作失败"); |
|||
}) |
|||
}, |
|||
getSlotKey(key) { |
|||
return key.includes('electricity') || key.includes('fan') ? key : '' |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang='scss' scoped> |
|||
.DeviceParams { |
|||
height: 100%; |
|||
} |
|||
</style> |
@ -0,0 +1,44 @@ |
|||
export const devicesFormList = [ |
|||
{ |
|||
label: "设备内温度过高", |
|||
key: `theInternalTemperatureOfTheDeviceOverheats`, |
|||
// text: "-",
|
|||
gridColumn: 2, |
|||
}, |
|||
{ |
|||
label: "阵列电压", |
|||
key: `arrayVoltage`, |
|||
// text: "-",
|
|||
gridColumn: 2, |
|||
}, |
|||
{ |
|||
label: "阵列电流", |
|||
key: `arrayCurrent`, |
|||
// text: "-",
|
|||
gridColumn: 2, |
|||
}, |
|||
{ |
|||
label: "发电功率L", |
|||
key: `generatingPowerL`, |
|||
text: "-", |
|||
gridColumn: 2, |
|||
}, |
|||
{ |
|||
label: "发电功率H", |
|||
key: `generatingPowerH`, |
|||
text: "-", |
|||
gridColumn: 2, |
|||
}, |
|||
{ |
|||
label: "负载电压", |
|||
key: `loadVoltage`, |
|||
text: "-", |
|||
gridColumn: 2, |
|||
}, |
|||
{ |
|||
label: "负载电流", |
|||
key: `loadCurrent`, |
|||
text: "-", |
|||
gridColumn: 2, |
|||
}, |
|||
]; |
@ -0,0 +1,188 @@ |
|||
<template> |
|||
<Dialog v-model="obverseVisible" title="合流区预警" width="550px"> |
|||
<Video class="video-stream" :pileNum="dialogData.stakeMark" /> |
|||
|
|||
<div class="confluencearea"> |
|||
<ElTabs v-model="activeName" class="tabs"> |
|||
<ElTabPane label="基本信息" name="first"> |
|||
<Descriptions :list="list" :data="data" style="gap: 18px" /> |
|||
</ElTabPane> |
|||
<ElTabPane label="设备参数" name="second"> |
|||
<DeviceParams ref="refParam" disabled :dialogData="dialogData" /> |
|||
</ElTabPane> |
|||
<ElTabPane label="在线率统计" name="third"> |
|||
<LineChart v-if="activeName === 'third'" :productId="dialogData.id" style="height: 180px" /> |
|||
</ElTabPane> |
|||
</ElTabs> |
|||
</div> |
|||
<template #footer> |
|||
<Button v-if="activeName != 'first' && data.deviceState == '1'" @click.native="deviceControlVisible = true"> |
|||
设备操作 |
|||
</Button> |
|||
</template> |
|||
|
|||
<DeviceControlDialog :rebind="rebind" v-model="deviceControlVisible" :dialogData="dialogData" /> |
|||
</Dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import Dialog from "@screen/components/Dialog/index.vue"; |
|||
import Button from "@screen/components/Buttons/Button.vue"; |
|||
import Descriptions from "@screen/components/Descriptions.vue"; |
|||
import Video from "@screen/components/Video"; |
|||
import LineChart from "../../LineChart/index.vue"; |
|||
import DeviceParams from "./components/DeviceParams.vue"; |
|||
import DeviceControlDialog from "./components/DeviceControlDialog.vue"; |
|||
import request from "@/utils/request"; |
|||
|
|||
import { |
|||
getRoadInfoByStakeMark, |
|||
getProduct, |
|||
} from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; |
|||
import { dialogDelayVisible } from "./../mixin"; |
|||
import { resolve } from "@antv/x6/lib/registry/node-anchor/util"; |
|||
|
|||
// 太阳能板 |
|||
export default { |
|||
name: "ConfluenceArea", |
|||
mixins: [dialogDelayVisible], |
|||
components: { |
|||
Dialog, |
|||
|
|||
Descriptions, |
|||
LineChart, |
|||
Video, |
|||
Button, |
|||
DeviceParams, |
|||
DeviceControlDialog |
|||
}, |
|||
data() { |
|||
return { |
|||
refParam:null, |
|||
activeName: "first", |
|||
releaseVisible: false, |
|||
deviceControlVisible: false, |
|||
data: { |
|||
deviceName: "LH24", |
|||
roadName: "G35济泽高速", |
|||
stakeMark: "k094+079", |
|||
direction: "1", |
|||
organizationName: "山东高速济南发展公司", |
|||
brand: "XXX厂家", |
|||
deviceState: "0", |
|||
}, |
|||
list: [ |
|||
{ |
|||
label: "设备名称", |
|||
key: "deviceName", |
|||
}, |
|||
{ |
|||
label: "设备桩号", |
|||
key: "stakeMark", |
|||
}, |
|||
{ |
|||
label: "道路名称", |
|||
key: "roadName", |
|||
}, |
|||
{ |
|||
label: "设备方向", |
|||
key: "direction", |
|||
enum: "CameraDirectionEnum", |
|||
}, |
|||
{ |
|||
label: "设备状态", |
|||
key: "deviceState", |
|||
enum: "DeviceTypeEnum", |
|||
// visible: false, |
|||
}, |
|||
{ |
|||
label: "设备厂商", |
|||
key: "manufacturer", |
|||
}, |
|||
], |
|||
}; |
|||
}, |
|||
async created() { |
|||
this.data = { |
|||
...this.dialogData, |
|||
roadName: null, |
|||
}; |
|||
//厂商 |
|||
getProduct(this.dialogData.productId).then((data) => { |
|||
this.dialogData.brand = data.brand; |
|||
}); |
|||
|
|||
const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMark); |
|||
if (roadInfo) this.data.roadName = roadInfo.roadName; |
|||
}, |
|||
methods: { |
|||
rebind(){ |
|||
this.$refs.refParam.bind() |
|||
}, |
|||
async getDeviceInfo() { |
|||
return request({ |
|||
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || "10.0.36.143-1883" |
|||
}/3`, |
|||
method: "get", |
|||
params: {}, |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
div.switcher { |
|||
font-size: 12px; |
|||
padding: 2px; |
|||
} |
|||
</style> |
|||
<style lang="scss" scoped> |
|||
.confluencearea { |
|||
width: 508px; |
|||
// height: 248px; |
|||
color: #fff; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
::v-deep { |
|||
.el-tabs__content { |
|||
overflow-y: auto; |
|||
max-height: 220px; |
|||
} |
|||
} |
|||
|
|||
.camera-video { |
|||
flex: 1.5; |
|||
} |
|||
|
|||
.tabs { |
|||
flex: 1; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
::v-deep { |
|||
.el-tabs__content { |
|||
flex: 1; |
|||
|
|||
.el-tab-pane { |
|||
height: 100%; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.bottom { |
|||
margin-top: 12px; |
|||
display: flex; |
|||
gap: 9px; |
|||
align-items: center; |
|||
justify-content: end; |
|||
|
|||
>div { |
|||
font-size: 16px; |
|||
padding: 6px 12px; |
|||
} |
|||
} |
|||
} |
|||
</style>../mixin../mixin../mixin |
@ -0,0 +1,28 @@ |
|||
// import * as PresetFormItems from "@screen/pages/control/event/event/FormEvent/PresetFormItems.js";
|
|||
import * as PresetFormItems from "@screen/common/PresetFormItems.js"; |
|||
// import { merge, cloneDeep } from "lodash";
|
|||
|
|||
import {directionOptions} from '@screen/utils/enum.js'; |
|||
export const searchFormList = [ |
|||
|
|||
{ |
|||
label: "设备名称:", |
|||
key: "deviceName", |
|||
type: "input", |
|||
default: "" |
|||
}, |
|||
{ |
|||
label: "物联编号:", |
|||
key: "iotDeviceId", |
|||
type: "input", |
|||
default: "" |
|||
}, { |
|||
label: "设备方向:", |
|||
key: "direction", |
|||
type: "select", |
|||
options: { |
|||
options: directionOptions, |
|||
}, |
|||
}, |
|||
|
|||
]; |
After Width: | Height: | Size: 3.1 KiB |
@ -1,33 +1,468 @@ |
|||
<template> |
|||
<div class='developing'> |
|||
<p>功能开发中...</p> |
|||
<div class='board_record'> |
|||
<!-- 搜索栏 --> |
|||
<div class="filter"> |
|||
<div> |
|||
<ButtonGradient @click.native="handleExport"> |
|||
<template #prefix> |
|||
<img src="@screen/images/export.svg" /> |
|||
</template> |
|||
导出 |
|||
</ButtonGradient> |
|||
<ButtonGradient @click="onRefreshForm" class="refresh-btn"> |
|||
<template #prefix> |
|||
<img src="./images/refresh.svg" /> |
|||
</template> |
|||
刷新 |
|||
</ButtonGradient> |
|||
</div> |
|||
|
|||
<InputSearch ref="searchComp" style="width: 480px" :formList="searchFormList" |
|||
:formConfigOptions="{ dFormData: { eventState: '0' } }" @handleSearch="handleSearch" /> |
|||
|
|||
</div> |
|||
<!-- 内容 --> |
|||
<div class="body"> |
|||
<Table :data="tableData" height="100%"> |
|||
<el-table-column label="序号" type="index" :index="indexMethod" width="120" align="center" |
|||
header-align="center" /> |
|||
<ElTableColumn label="设备名称" prop="deviceName" align="center" header-align="center" /> |
|||
<ElTableColumn label="物联编号" prop="iotDeviceId" width="120" align="center" header-align="center" /> |
|||
<ElTableColumn label="设备桩号" prop="stakeMark" width="120" align="center" header-align="center" /> |
|||
<ElTableColumn label="设备方向" prop="direction" width="240" align="center" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
{{ DirectionTypes[scope.row.direction] }} |
|||
</template> |
|||
</ElTableColumn> |
|||
<ElTableColumn label="IP地址" prop="deviceIp" width="120" align="center" header-align="center" /> |
|||
<ElTableColumn label="安装位置" prop="installationSite" align="center" header-align="center" /> |
|||
<ElTableColumn label="使用状态" prop="useState" width="120" align="center" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-switch |
|||
:value="scope.row.useState===1" |
|||
size="mini" |
|||
active-color="#13ce66" |
|||
inactive-color="#ff4949"> |
|||
</el-switch> |
|||
</template> |
|||
</ElTableColumn> |
|||
<ElTableColumn label="设备状态" prop="deviceState" width="120" align="center" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-tag type="success" size="mini" effect="dark" v-if="scope.row.deviceState === '1'">在线</el-tag> |
|||
<el-tag type="danger" size="mini" effect="dark" v-else>异常</el-tag> |
|||
</template> |
|||
</ElTableColumn> |
|||
<ElTableColumn label="设备图片" prop="deviceImg" align="center" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
<img :src="scope.row.deviceImg" style="width: 30px;height: 30px;" /> |
|||
</template> |
|||
</ElTableColumn> |
|||
<el-table-column |
|||
label="操作" |
|||
align="center" |
|||
class-name="small-padding fixed-width" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
type="text" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['device:protocol:edit']" |
|||
>修改 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</Table> |
|||
</div> |
|||
|
|||
<!-- 分页 --> |
|||
<div class="footer"> |
|||
<Pagination @current-change="initData" @size-change="onSizeChange" width="'100%'" |
|||
:page-sizes="[10, 20, 30, 40, 50]" :page-size="searchData.pageSize" :current-page.sync="searchData.pageNum" |
|||
layout="total, sizes, prev, pager, next" :total="total"> |
|||
</Pagination> |
|||
</div> |
|||
|
|||
<!-- 添加或修改控制码对话框 --> |
|||
<Dialog title="设备修改" v-model="modelVisible" width="1000px" append-to-body> |
|||
<Form |
|||
column="3" |
|||
class="form" |
|||
ref="FormConfigRef" |
|||
:formList="formList" |
|||
:value="formData" |
|||
/> |
|||
|
|||
<template #footer> |
|||
<Button |
|||
style="background-color: rgba(0, 179, 204, 0.3)" |
|||
@click.native="(modelVisible = false), (submitting = false)" |
|||
> |
|||
取消 |
|||
</Button> |
|||
<Button @click.native="handleSubmit" :loading="submitting"> 确定 </Button> |
|||
</template> |
|||
</Dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue'; |
|||
import Pagination from '@screen/components/Pagination.vue'; |
|||
import Table from '@screen/components/Table.vue'; |
|||
import request from "@/utils/request"; |
|||
import BoardRecordPreview from '@screen/components/infoBoard/BoardRecordPreview.vue' |
|||
import {DirectionTypes,deviceTypeOptions,directionOptions} from '@screen/utils/enum.js'; |
|||
import InputSearch from "@screen/components/InputSearch/index.vue"; |
|||
import { searchFormList } from "./data"; |
|||
import moment from "moment"; |
|||
import { delay, exportFile, confirm } from "@screen/utils/common"; |
|||
import { Message } from "element-ui"; |
|||
import Button from "@screen/components/Buttons/Button.vue"; |
|||
import Form from "@screen/components/FormConfig"; |
|||
import Dialog from "@screen/components/Dialog/index.vue"; |
|||
|
|||
export default { |
|||
name: 'InDevelopment', |
|||
name: 'boardRecord', |
|||
components: { |
|||
ButtonGradient, |
|||
Pagination, |
|||
Table, |
|||
Button, |
|||
Form, |
|||
Dialog, |
|||
BoardRecordPreview, |
|||
InputSearch |
|||
}, |
|||
data() { |
|||
return { |
|||
DirectionTypes, |
|||
tableData: [], |
|||
searchFormList, |
|||
total: 20, |
|||
searchData: { |
|||
pageSize: 20, |
|||
pageNum: 1, |
|||
dcDeviceType: "2" |
|||
}, |
|||
// 表单参数 |
|||
modelVisible:false, |
|||
submitting: false, |
|||
formList: [ |
|||
{ |
|||
required: true, |
|||
label: "设备名称:", |
|||
key: "deviceName", |
|||
type: "input" |
|||
}, { |
|||
label: "物联编号:", |
|||
key: "iotDeviceId", |
|||
type: "input", |
|||
options: { |
|||
disabled:true |
|||
}, |
|||
}, { |
|||
label: "所属单位:", |
|||
key: "deptName", |
|||
type: "select", |
|||
options: { |
|||
options: [], |
|||
}, |
|||
}, { |
|||
label: "产品型号:", |
|||
key: "deviceType", |
|||
type: "select", |
|||
options: { |
|||
disabled:true, |
|||
options: deviceTypeOptions, |
|||
}, |
|||
},{ |
|||
required: true, |
|||
label: "设备桩号:", |
|||
key: "stakeMark", |
|||
type: "input", |
|||
options: { |
|||
disabled:true |
|||
}, |
|||
}, { |
|||
label: "范围桩号:", |
|||
key: "stakeMarkRange", |
|||
type: "input", |
|||
options: { |
|||
disabled:true |
|||
}, |
|||
}, { |
|||
label: "设备方向:", |
|||
key: "direction", |
|||
type: "select", |
|||
options: { |
|||
disabled:true, |
|||
options: directionOptions, |
|||
}, |
|||
},{ |
|||
label: "网段:", |
|||
key: "networkSegment", |
|||
type: "input", |
|||
options: { |
|||
disabled:true |
|||
}, |
|||
}, { |
|||
label: "安装位置:", |
|||
key: "installationSite", |
|||
type: "input" |
|||
}, { |
|||
label: "安装日期:", |
|||
key: "installationDate", |
|||
type: "datePicker", |
|||
options: { |
|||
type: "datetime", |
|||
format: "yyyy-MM-dd", |
|||
valueFormat: "yyyy-MM-dd", |
|||
}, |
|||
}, { |
|||
label: "生产日期:", |
|||
key: "productionDate", |
|||
type: "datePicker", |
|||
options: { |
|||
type: "datetime", |
|||
format: "yyyy-MM-dd", |
|||
valueFormat: "yyyy-MM-dd", |
|||
}, |
|||
}, { |
|||
label: "使用年限:", |
|||
key: "durableYears", |
|||
type: "input" |
|||
},{ |
|||
label: "使用状态:", |
|||
key: "useState", |
|||
type: "RadioGroup", |
|||
options: { |
|||
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)", |
|||
options: [ |
|||
{ |
|||
key: 1, |
|||
label: "在用", |
|||
}, |
|||
{ |
|||
key: 0, |
|||
label: "停用", |
|||
}, |
|||
], |
|||
}, |
|||
},{ |
|||
label: "设备状态:", |
|||
key: "deviceState", |
|||
type: "RadioGroup", |
|||
options: { |
|||
disabled:true, |
|||
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)", |
|||
options: [ |
|||
{ |
|||
key: '1', |
|||
label: "正常", |
|||
}, |
|||
{ |
|||
key: '0', |
|||
label: "异常", |
|||
}, |
|||
], |
|||
}, |
|||
}, { |
|||
label: "IP地址:", |
|||
key: "deviceIp", |
|||
type: "input", |
|||
options:{ |
|||
disabled:true |
|||
} |
|||
},{ |
|||
label: "其他配置:", |
|||
key: "otherConfig", |
|||
type: "input", |
|||
isAlone: true, // 单独一行 |
|||
options: { |
|||
disabled:true, |
|||
type: "textarea", |
|||
autosize: true, |
|||
maxlength: 60, |
|||
autosize: { minRows: 6, maxRows: 6 }, |
|||
showWordLimit: true, |
|||
} |
|||
},{ |
|||
label: "备注:", |
|||
key: "remark", |
|||
type: "input", |
|||
isAlone: true, // 单独一行 |
|||
options: { |
|||
type: "textarea", |
|||
autosize: true, |
|||
maxlength: 60, |
|||
autosize: { minRows: 6, maxRows: 6 }, |
|||
showWordLimit: true, |
|||
}, |
|||
} |
|||
|
|||
], |
|||
formData:{} |
|||
} |
|||
}, |
|||
created() { |
|||
this.initData(); |
|||
}, |
|||
mounted() { |
|||
mounted(){ |
|||
this.getOptions(); |
|||
}, |
|||
methods: { |
|||
onRefreshForm(){ |
|||
this.searchData.pageNum = 1; |
|||
this.$refs.searchComp.handleResetForm(); |
|||
}, |
|||
handleSearch(data) { |
|||
this.searchData = { |
|||
...this.searchData, |
|||
...data |
|||
}; |
|||
this.initData(); |
|||
}, |
|||
indexMethod(index) { |
|||
return this.searchData.pageSize*(this.searchData.pageNum-1) + index + 1; |
|||
}, |
|||
// |
|||
getOptions(){ |
|||
request({ |
|||
url: `/system/dept/list`, |
|||
method: "get" |
|||
}).then((result) => { |
|||
if (result.code != 200) return Message.error(result?.msg); |
|||
let _options = []; |
|||
result.data.forEach(e=>{ |
|||
_options.push({label:e.deptName,value:e.deptId}) |
|||
}) |
|||
this.formList[2].options.options = _options; |
|||
|
|||
}); |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
console.log(row,'-------------------') |
|||
this.formData = row; |
|||
this.modelVisible = true; |
|||
}, |
|||
/** 提交按钮 */ |
|||
handleSubmit() { |
|||
this.$refs.FormConfigRef.validate().then((data) => { |
|||
this.submitting = true; |
|||
if (this.formData) { |
|||
data.id = this.formData.id |
|||
} |
|||
request({ |
|||
url: `/business/device`, |
|||
method: "PUT", |
|||
data, |
|||
}) |
|||
.then((result) => { |
|||
if (result.code != 200) return Message.error(`提交失败!`); |
|||
|
|||
Message.success(`提交成功!`); |
|||
|
|||
this.modelVisible = false; |
|||
this.searchData.pageNum = 1; |
|||
this.initData(); |
|||
}) |
|||
.catch((err) => { |
|||
Message.error(`提交失败!`); |
|||
}) |
|||
.finally(() => { |
|||
this.submitting = false; |
|||
}); |
|||
}); |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
exportFile({ |
|||
url: "/business/device/export", |
|||
filename: "设备列表", |
|||
data: this.getSearchData(), |
|||
}); |
|||
}, |
|||
getSearchData() { |
|||
let params = { |
|||
groupName: this.searchData?.word, |
|||
pageSize: this.pageSize, |
|||
pageNum: this.currentPage, |
|||
}; |
|||
// params = { |
|||
// pageSize: 1000000, |
|||
// pageNum: 1 |
|||
// }; |
|||
return params; |
|||
}, |
|||
initData() { |
|||
request({ |
|||
url: `/business/device/list`, |
|||
method: "get", |
|||
params: this.searchData, |
|||
}).then((result) => { |
|||
if (result.code != 200) return Message.error(result?.msg); |
|||
result.rows.forEach(e=>{ |
|||
e.deviceType = parseInt(e.deviceType) |
|||
}) |
|||
this.tableData = result.rows; |
|||
this.total = result.total; |
|||
}); |
|||
}, |
|||
onSizeChange(pageSize) { |
|||
this.tableData = []; |
|||
this.searchData.pageSize = pageSize; |
|||
this.searchData.pageNum = 1; |
|||
this.initData(); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang='scss' scoped> |
|||
.developing { |
|||
width: 100%; |
|||
.board_record { |
|||
padding: 0 14px 14px; |
|||
width:100%; |
|||
height: 100%; |
|||
position: relative; |
|||
z-index: 6; |
|||
color: white; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
flex-direction: column; |
|||
|
|||
.filter { |
|||
height: 60px; |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
|
|||
p { |
|||
font-size: 24px; |
|||
>div { |
|||
display: flex; |
|||
gap: 6px; |
|||
} |
|||
} |
|||
|
|||
.body { |
|||
flex: 1; |
|||
height: 0; |
|||
} |
|||
|
|||
.footer { |
|||
margin-top: 15px; |
|||
height: 36px; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
} |
|||
|
|||
.board_shower{ |
|||
margin: 4px; |
|||
} |
|||
::v-deep .el-carousel__indicators--horizontal{ |
|||
line-height: 0; height: 16px; |
|||
.el-carousel__indicator--horizontal{ |
|||
padding: 7px 4px; |
|||
} |
|||
} |
|||
::v-deep .el-table__cell div.cell { |
|||
padding: 0 10px !important; |
|||
} |
|||
} |
|||
</style> |
|||
|
Loading…
Reference in new issue