28 changed files with 4386 additions and 921 deletions
@ -0,0 +1,178 @@ |
|||||
|
<template> |
||||
|
<div class="body"> |
||||
|
<div class="right" :style="{ width: isMultiControl ? '100%' : undefined }"> |
||||
|
<div class="top-content"> |
||||
|
<Video v-if="!isMultiControl" class="item-video" :pileNum="pileNum" /> |
||||
|
|
||||
|
<label style="width: 99px;">发布内容: </label> |
||||
|
<ElInput type="textarea" v-model="releaseMessage" :autosize="{ minRows: 3, maxRows: 3 }" :maxlength="150" |
||||
|
showWordLimit placeholder="请输入发布内容" /> |
||||
|
</div> |
||||
|
|
||||
|
<!-- <div class="footer"> |
||||
|
<Button @click.native="handleSubmit" :loading="submitting"> |
||||
|
确定 |
||||
|
</Button> |
||||
|
|
||||
|
<Button style="background-color: rgba(0, 179, 204, 0.3)" @click.native="cancelClick"> |
||||
|
取消 |
||||
|
</Button> |
||||
|
</div> --> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import Dialog from "@screen/components/Dialog/index.vue"; |
||||
|
import Button from "@screen/components/Buttons/Button.vue"; |
||||
|
import Video from "@screen/components/Video"; |
||||
|
import CheckboxGroup from "@screen/components/FormConfig/components/ElCheckboxGroup.vue"; |
||||
|
|
||||
|
import request from "@/utils/request"; |
||||
|
import { batchFunctions } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; |
||||
|
import { multiResultShow } from "@screen/utils/common"; |
||||
|
|
||||
|
import { Message } from "element-ui"; |
||||
|
|
||||
|
export default { |
||||
|
name: "BroadcastReleases", |
||||
|
components: { |
||||
|
Dialog, |
||||
|
Button, |
||||
|
Video, |
||||
|
CheckboxGroup, |
||||
|
}, |
||||
|
model: { |
||||
|
prop: "visible", |
||||
|
event: "update:value", |
||||
|
}, |
||||
|
props: { |
||||
|
visible: Boolean, |
||||
|
pileNum: String, |
||||
|
otherConfig: String, |
||||
|
isMultiControl: Boolean, |
||||
|
selectItems: { |
||||
|
type: Array, |
||||
|
default: () => [] |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
submitting: false, |
||||
|
checkList: [], |
||||
|
releaseMessage: null, |
||||
|
// musicList: [], |
||||
|
}; |
||||
|
}, |
||||
|
computed: { |
||||
|
modelVisible: { |
||||
|
get() { |
||||
|
return this.visible; |
||||
|
}, |
||||
|
set(val) { |
||||
|
this.$emit("update:value", val); |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
created() { |
||||
|
// getDeviceList(5).then((data) => { |
||||
|
// if (Array.isArray(data)) |
||||
|
// this.musicList = data.map((item) => ({ |
||||
|
// ...item, |
||||
|
// disabled: item.deviceState != 1, |
||||
|
// })); |
||||
|
// }); |
||||
|
}, |
||||
|
methods: { |
||||
|
cancelClick() { |
||||
|
this.$emit("update:activeIcon", null); |
||||
|
this.$emit("update:submitting", false); |
||||
|
// this.submitting = false; |
||||
|
}, |
||||
|
handleSubmit() { |
||||
|
const selectItems = this.selectItems.map(item => JSON.parse(item)); |
||||
|
const checkList = selectItems.map(item => JSON.parse(item.otherConfig)); |
||||
|
if (!this.releaseMessage?.trim()) |
||||
|
return Message.error("发布内容不能为空!"); |
||||
|
if (!selectItems.length) |
||||
|
return Message.error("请至少选择一个设备!"); |
||||
|
|
||||
|
// this.submitting = true; |
||||
|
this.$emit("update:submitting", true); |
||||
|
|
||||
|
batchFunctions( |
||||
|
{ |
||||
|
"devices": selectItems, |
||||
|
"functions": [ |
||||
|
{ |
||||
|
"functionId": "1",//随便 不为空即可 |
||||
|
"params": { |
||||
|
name: "task-3", |
||||
|
outVol: "6", |
||||
|
priority: "1", |
||||
|
text: this.releaseMessage.trim(), |
||||
|
repeatTimes: "3", |
||||
|
termList: checkList, |
||||
|
functionType: "startPaTts", |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
] |
||||
|
}) |
||||
|
.then((data) => { |
||||
|
multiResultShow(data.data, item => item.result.retCode == 0, "广播设置"); |
||||
|
}) |
||||
|
.finally(() => { |
||||
|
// this.submitting = false; |
||||
|
this.$emit("update:submitting", false); |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.body { |
||||
|
display: flex; |
||||
|
gap: 9px; |
||||
|
height: 100%; |
||||
|
padding-right: 9px; |
||||
|
margin-top: 15px; |
||||
|
|
||||
|
.right { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: space-between; |
||||
|
|
||||
|
.top-content { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
// gap: 9px; |
||||
|
align-items: center; |
||||
|
|
||||
|
.item-video { |
||||
|
width: 545px; |
||||
|
} |
||||
|
|
||||
|
label { |
||||
|
font-size: 15px; |
||||
|
font-family: PingFang SC, PingFang SC; |
||||
|
font-weight: 400; |
||||
|
color: #3de8ff; |
||||
|
line-height: 19px; |
||||
|
vertical-align: middle; |
||||
|
text-align: right; |
||||
|
padding-right: 12px; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.footer { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: flex-end; |
||||
|
gap: 9px; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,421 @@ |
|||||
|
<template> |
||||
|
<div :style="{ |
||||
|
'max-height': isMultiControl ? '250px' : undefined, 'overflow-y': isMultiControl ? 'auto' : undefined, |
||||
|
'margin-left': isMultiControl ? '14px' : undefined |
||||
|
}"> |
||||
|
<ElTabs v-model="activeName" class="tabs" @tab-click="tabClick"> |
||||
|
<ElTabPane label="一般模式" name="first"> |
||||
|
<Form v-model="formData" class="form" ref="FormConfigRef" :formList="formList1" column="1" labelWidth="120px" /> |
||||
|
</ElTabPane> |
||||
|
<ElTabPane label="自定义模式" name="second"> |
||||
|
<!-- <div style="display: flex; margin: 20px 0"> |
||||
|
<p style="width: 115px">工作时长(分):</p> |
||||
|
<el-input-number v-model="onWorkStatus2" :min="0" :max="999" label="工作时长(s分):"></el-input-number> |
||||
|
</div> --> |
||||
|
<Table :data="tableData"> |
||||
|
<ElTableColumn prop="ds" label="段数"></ElTableColumn> |
||||
|
|
||||
|
<ElTableColumn prop="time" width="120" label="时间(毫秒)"> |
||||
|
<template slot-scope="scope"> |
||||
|
<div style="display: flex"> |
||||
|
<el-input-number style="width: 120px" v-model="scope.row.time" :min="0"></el-input-number> |
||||
|
</div> |
||||
|
</template> |
||||
|
</ElTableColumn> |
||||
|
|
||||
|
<ElTableColumn prop="A" label="线路A"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch active-value="1" inactive-value="0" v-model="scope.row.A" active-color="#13ce66" |
||||
|
inactive-color="#C9C9C9"> |
||||
|
</el-switch> |
||||
|
</template> |
||||
|
</ElTableColumn> |
||||
|
<ElTableColumn prop="B" label="线路B"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch active-value="1" inactive-value="0" v-model="scope.row.B" active-color="#13ce66" |
||||
|
inactive-color="#C9C9C9"> |
||||
|
</el-switch> |
||||
|
</template> |
||||
|
</ElTableColumn> |
||||
|
<ElTableColumn prop="C" label="线路C"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch active-value="1" inactive-value="0" v-model="scope.row.C" active-color="#13ce66" |
||||
|
inactive-color="#C9C9C9"> |
||||
|
</el-switch> |
||||
|
</template> |
||||
|
</ElTableColumn> |
||||
|
<ElTableColumn prop="D" label="线路D"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch active-value="1" inactive-value="0" v-model="scope.row.D" active-color="#13ce66" |
||||
|
inactive-color="#C9C9C9"> |
||||
|
</el-switch> |
||||
|
</template> |
||||
|
</ElTableColumn> |
||||
|
<ElTableColumn prop="E" label="线路E"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch active-value="1" inactive-value="0" v-model="scope.row.E" active-color="#13ce66" |
||||
|
inactive-color="#C9C9C9"> |
||||
|
</el-switch> |
||||
|
</template> |
||||
|
</ElTableColumn> |
||||
|
<ElTableColumn prop="F" label="线路F"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch active-value="1" inactive-value="0" v-model="scope.row.F" active-color="#13ce66" |
||||
|
inactive-color="#C9C9C9"> |
||||
|
</el-switch> |
||||
|
</template> |
||||
|
</ElTableColumn> |
||||
|
<ElTableColumn prop="G" label="线路G"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch active-value="1" inactive-value="0" v-model="scope.row.G" active-color="#13ce66" |
||||
|
inactive-color="#C9C9C9"> |
||||
|
</el-switch> |
||||
|
</template> |
||||
|
</ElTableColumn> |
||||
|
<ElTableColumn prop="H" label="线路H"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch active-value="1" inactive-value="0" v-model="scope.row.H" active-color="#13ce66" |
||||
|
inactive-color="#C9C9C9"> |
||||
|
</el-switch> |
||||
|
</template> |
||||
|
</ElTableColumn> |
||||
|
</Table> |
||||
|
</ElTabPane> |
||||
|
</ElTabs> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import Table from "@screen/components/Table.vue"; |
||||
|
import Dialog from "@screen/components/Dialog/index.vue"; |
||||
|
import Button from "@screen/components/Buttons/Button.vue"; |
||||
|
import Form from "@screen/components/FormConfig"; |
||||
|
import request from "@/utils/request"; |
||||
|
import { Message } from "element-ui"; |
||||
|
import { batchFunctions } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; |
||||
|
import { multiResultShow } from "@screen/utils/common"; |
||||
|
export default { |
||||
|
name: "DeviceControlDialog", |
||||
|
components: { |
||||
|
Dialog, |
||||
|
Button, |
||||
|
Form, |
||||
|
Table, |
||||
|
}, |
||||
|
model: { |
||||
|
prop: "visible", |
||||
|
event: "update:value", |
||||
|
}, |
||||
|
props: { |
||||
|
visible: Boolean, |
||||
|
deviceId: String, |
||||
|
productId: String, |
||||
|
isMultiControl: Boolean, |
||||
|
selectItems: { |
||||
|
type: Array, |
||||
|
default: () => [] |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
submitting: false, |
||||
|
activeName: "first", |
||||
|
onWorkStatus2: 0, |
||||
|
formData: {}, |
||||
|
duan: [ |
||||
|
"A", |
||||
|
"B", |
||||
|
"C", |
||||
|
"D", |
||||
|
"E", |
||||
|
"F", |
||||
|
"G", |
||||
|
"H", |
||||
|
"I", |
||||
|
"J", |
||||
|
"K", |
||||
|
"L", |
||||
|
"M", |
||||
|
"N", |
||||
|
"O", |
||||
|
"P", |
||||
|
"Q", |
||||
|
"R", |
||||
|
"S", |
||||
|
"T", |
||||
|
], |
||||
|
tableData: [ |
||||
|
// { |
||||
|
// ds: 'A', |
||||
|
// time: 0, |
||||
|
// A: false, |
||||
|
// B: false, |
||||
|
// C: false, |
||||
|
// D: false, |
||||
|
// E: false, |
||||
|
// F: false, |
||||
|
// G: false, |
||||
|
// H: false, |
||||
|
// } |
||||
|
], |
||||
|
formList1: [ |
||||
|
{ |
||||
|
label: "工作模式:", |
||||
|
key: "controlType", |
||||
|
type: "select", |
||||
|
default: "1", |
||||
|
options: { |
||||
|
options: [ |
||||
|
{ |
||||
|
value: "0", |
||||
|
label: "激光关闭", |
||||
|
}, |
||||
|
{ |
||||
|
value: "1", |
||||
|
label: "常亮模式", |
||||
|
}, |
||||
|
{ |
||||
|
value: "2", |
||||
|
label: "间隔100ms闪烁模式", |
||||
|
}, |
||||
|
{ |
||||
|
value: "3", |
||||
|
label: "间隔200ms闪烁模式", |
||||
|
}, |
||||
|
{ |
||||
|
value: "4", |
||||
|
label: "间隔500ms闪烁模式", |
||||
|
}, |
||||
|
{ |
||||
|
value: "5", |
||||
|
label: "2次闪烁模式", |
||||
|
}, |
||||
|
{ |
||||
|
value: "6", |
||||
|
label: "SOS模式", |
||||
|
}, |
||||
|
{ |
||||
|
value: "7", |
||||
|
label: "自定义模式", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: "工作时长(分):", |
||||
|
key: "onWorkStatus", |
||||
|
required: true, |
||||
|
default: 0, |
||||
|
type: "inputNumber", |
||||
|
options: { |
||||
|
min: 0, |
||||
|
max: 999, |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
formList2: [ |
||||
|
{ |
||||
|
label: "工作模式:", |
||||
|
key: "controlType", |
||||
|
type: "RadioGroup", |
||||
|
default: "00", |
||||
|
options: { |
||||
|
type: "circle", |
||||
|
options: [ |
||||
|
{ |
||||
|
key: "00", |
||||
|
label: "常量", |
||||
|
}, |
||||
|
{ |
||||
|
key: "01", |
||||
|
label: "闪烁", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: "线路选择:", |
||||
|
key: "onWorkStatus2", |
||||
|
required: true, |
||||
|
type: "select", |
||||
|
options: { |
||||
|
placeholder: "请选择", |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: "工作时长:", |
||||
|
key: "onWorkStatus", |
||||
|
required: true, |
||||
|
type: "select", |
||||
|
options: { |
||||
|
placeholder: "请选择", |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
rules: { |
||||
|
onWorkStatus: [ |
||||
|
{ required: true, message: "工作时长不能为空", trigger: "blur" }, |
||||
|
], |
||||
|
}, |
||||
|
}; |
||||
|
}, |
||||
|
mounted() { |
||||
|
if (!this.isMultiControl) |
||||
|
this.initData(); |
||||
|
}, |
||||
|
methods: { |
||||
|
async initData() { |
||||
|
//查询模式 |
||||
|
let result = await this.requestURL("ASKMD"); |
||||
|
// if (result.data == 7) { |
||||
|
// this.activeName = "second"; |
||||
|
// this.tabClick(); |
||||
|
// } else { |
||||
|
this.formData.controlType = result.data + "" || "1"; |
||||
|
//查询时间 |
||||
|
let resultTime = await this.requestURL("ASKTM"); |
||||
|
this.formData.onWorkStatus = resultTime.data || 0; |
||||
|
this.activeName = "first"; |
||||
|
// } |
||||
|
}, |
||||
|
async requestURL(functionId, options = {}) { |
||||
|
let result = await request({ |
||||
|
url: `/business/device/functions/${this.deviceId}/${functionId}`, |
||||
|
method: "post", |
||||
|
data: options, |
||||
|
}); |
||||
|
if (result.code != 200) return Message.error(result?.msg); |
||||
|
//模式设定:SETMD;模式查询:ASKMD;时间设定:SETTM;时间查询:ASKTM;自定义设置:SETDF;自定义查询:ASKDF |
||||
|
return result; |
||||
|
}, |
||||
|
async tabClick() { |
||||
|
if (this.activeName == "second") { |
||||
|
if (this.isMultiControl) |
||||
|
this.tableData = this.duan.map(item => { |
||||
|
return { |
||||
|
ds: item, |
||||
|
time: 0, |
||||
|
A: false, |
||||
|
B: false, |
||||
|
C: false, |
||||
|
D: false, |
||||
|
E: false, |
||||
|
F: false, |
||||
|
G: false, |
||||
|
H: false, |
||||
|
} |
||||
|
}); |
||||
|
else { |
||||
|
// 查询自定义模式 |
||||
|
let result = await request({ |
||||
|
url: `/business/device/properties/latest/${this.deviceId}`, |
||||
|
method: "get", |
||||
|
}); |
||||
|
if (result.code != 200) return Message.error(result?.msg); |
||||
|
|
||||
|
this.tableData = []; |
||||
|
let tData = []; |
||||
|
result.data.forEach((item) => { |
||||
|
if (item.property == "TM") { |
||||
|
this.onWorkStatus2 = item.value; |
||||
|
} else if (item.property == "MD") { |
||||
|
} else { |
||||
|
let data = JSON.parse(item.formatValue || {}); |
||||
|
|
||||
|
tData.push({ ...data, ds: item.property }); |
||||
|
} |
||||
|
}); |
||||
|
tData.sort((a, b) => a.ds.toUpperCase().localeCompare(b.ds.toUpperCase())); |
||||
|
this.tableData = tData; |
||||
|
} |
||||
|
} else { |
||||
|
if (!this.isMultiControl) { |
||||
|
//查询时间 |
||||
|
let resultTime = await this.requestURL("ASKTM"); |
||||
|
this.formData.onWorkStatus = resultTime.data || 0; |
||||
|
this.activeName = "first"; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
async handleSubmit() { |
||||
|
if (this.isMultiControl && !this.selectItems.length) { |
||||
|
return Message.error("请至少选择一个设备!"); |
||||
|
} |
||||
|
const selectItems = this.selectItems.map(item => JSON.parse(item)); |
||||
|
let devices; |
||||
|
if (this.isMultiControl) devices = selectItems; |
||||
|
else devices = [{ |
||||
|
iotDeviceId: this.deviceId, |
||||
|
id: this.productId, |
||||
|
deviceType: 10 |
||||
|
}] |
||||
|
if (this.activeName == "first") { |
||||
|
//一般模式 |
||||
|
this.$refs.FormConfigRef.validate().then(async (formData) => { |
||||
|
//设定模式 |
||||
|
// await this.requestURL("SETMD", { SET: formData.controlType }); |
||||
|
//设定时长 |
||||
|
// let res = await this.requestURL("SETTM", { |
||||
|
// SET: formData.onWorkStatus, |
||||
|
// }); |
||||
|
let res = await batchFunctions({ |
||||
|
devices: devices, |
||||
|
functions: [ |
||||
|
{ "functionId": "SETMD", "params": { SET: formData.controlType } },//设定模式 |
||||
|
{ |
||||
|
"functionId": "SETTM", "params": { //设定时长 |
||||
|
SET: formData.onWorkStatus, |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
}); |
||||
|
if (res.code == 200) { |
||||
|
Message.success("设置成功!"); |
||||
|
this.$emit("update:value", false); |
||||
|
} |
||||
|
}); |
||||
|
} else if (this.activeName == "second") { |
||||
|
//自定义模式 |
||||
|
let rData = []; |
||||
|
|
||||
|
this.tableData.forEach((it, index) => { |
||||
|
rData.push({ |
||||
|
functionId: "SETDF", |
||||
|
params: { |
||||
|
order: 7, |
||||
|
time: it.time, |
||||
|
numberOfSegments: it.ds || this.duan[index], |
||||
|
A: Number(it.A), |
||||
|
B: Number(it.B), |
||||
|
C: Number(it.C), |
||||
|
D: Number(it.D), |
||||
|
E: Number(it.E), |
||||
|
F: Number(it.F), |
||||
|
G: Number(it.G), |
||||
|
H: Number(it.H), |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
//设定自定义模式 |
||||
|
let res = await batchFunctions({ |
||||
|
devices: devices, |
||||
|
functions: rData |
||||
|
}); |
||||
|
if (res.code == 200) { |
||||
|
Message.success("设置成功!"); |
||||
|
this.$emit("update:value", false); |
||||
|
} |
||||
|
//设定时长 |
||||
|
// let res = await this.requestURL("SETTM", { SET: this.onWorkStatus2 }); |
||||
|
// if (res.code == 200) { |
||||
|
// Message.success("设置成功!"); |
||||
|
// this.$emit("update:value", false); |
||||
|
// } |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped></style> |
||||
@ -0,0 +1,356 @@ |
|||||
|
<template> |
||||
|
<Dialog v-model="modelVisible" title="收费站管制统计" style="width: 100%"> |
||||
|
</Dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import Dialog from "@screen/components/Dialog/index"; |
||||
|
import InputSearch from "@screen/components/InputSearch/index.vue"; |
||||
|
import Table from "@screen/components/Table.vue"; |
||||
|
import { selectTollStation } from "@/api/event/governanceAnalysis"; |
||||
|
import request from "@/utils/request"; |
||||
|
export default { |
||||
|
name: "StatsDetail", |
||||
|
components: { |
||||
|
Dialog, |
||||
|
InputSearch, |
||||
|
Table, |
||||
|
}, |
||||
|
model: { |
||||
|
prop: "visible", |
||||
|
event: "update:value", |
||||
|
}, |
||||
|
props: { |
||||
|
visible: Boolean, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
num: 0, |
||||
|
tableData: [], |
||||
|
weatherNum: [], |
||||
|
startTime: "", |
||||
|
endTime: "", |
||||
|
pickerOptions: { |
||||
|
disabledDate(time) { |
||||
|
return time.getTime() > Date.now(); |
||||
|
}, |
||||
|
}, |
||||
|
searchType: 1, |
||||
|
controlType: 1, |
||||
|
facilityIds: [], |
||||
|
facilityTableData: [], |
||||
|
searchFormList: [ |
||||
|
{ |
||||
|
label: "查询条件:", |
||||
|
key: "searchType", |
||||
|
required: true, |
||||
|
isAlone: true, |
||||
|
type: "RadioGroup", |
||||
|
default: 1, |
||||
|
options: { |
||||
|
type: "circle", |
||||
|
options: [ |
||||
|
{ |
||||
|
key: 1, |
||||
|
label: "站点", |
||||
|
}, |
||||
|
{ |
||||
|
key: 2, |
||||
|
label: "原因", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: "事件类型:", |
||||
|
key: "controlType", |
||||
|
required: true, |
||||
|
isAlone: true, |
||||
|
type: "RadioGroup", |
||||
|
visible: (data) => { |
||||
|
if (data.searchType == 2) { |
||||
|
return true; |
||||
|
} |
||||
|
}, |
||||
|
default: 1, |
||||
|
options: { |
||||
|
type: "circle", |
||||
|
options: [ |
||||
|
{ |
||||
|
key: 1, |
||||
|
label: "收费站封闭", |
||||
|
}, |
||||
|
{ |
||||
|
key: 2, |
||||
|
label: "收费站限行", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: "选择站点:", |
||||
|
key: "facilityId", |
||||
|
required: true, |
||||
|
type: "Select", |
||||
|
options: { |
||||
|
multiple: true, |
||||
|
options: [], |
||||
|
}, |
||||
|
default: [], |
||||
|
visible: (data) => { |
||||
|
if (data.searchType == 1) { |
||||
|
return true; |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: "日期:", |
||||
|
key: "date", |
||||
|
required: true, |
||||
|
type: "datePicker", |
||||
|
default: "", |
||||
|
options: { |
||||
|
pickerOptions: { |
||||
|
disabledDate(time) { |
||||
|
return time.getTime() > Date.now(); |
||||
|
}, |
||||
|
}, |
||||
|
valueFormat: "yyyy-MM-dd", |
||||
|
type: "daterange", |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
queryParams: {}, |
||||
|
}; |
||||
|
}, |
||||
|
computed: { |
||||
|
modelVisible: { |
||||
|
get() { |
||||
|
return this.visible; |
||||
|
}, |
||||
|
set(val) { |
||||
|
this.$emit("update:value", val); |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
getFacilityList() { |
||||
|
Promise.allSettled([ |
||||
|
// 查询收费站 |
||||
|
request({ |
||||
|
url: `/business/facility/query`, |
||||
|
method: "get", |
||||
|
}), |
||||
|
]).then((res) => { |
||||
|
if (res[0].status === "fulfilled" && res[0].value.code == 200) { |
||||
|
// this.searchFormList[2].options.options = res[0].value.data.map( |
||||
|
// (item) => ({ |
||||
|
// key: item.id, |
||||
|
// label: item.facilityName, |
||||
|
// }) |
||||
|
// ); |
||||
|
let dataList = []; |
||||
|
res[0].value.data.forEach((item) => { |
||||
|
if (item.facilityType == 1) { |
||||
|
dataList.push({ |
||||
|
key: item.id, |
||||
|
label: item.facilityName, |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
this.searchFormList[2].options.options = dataList; |
||||
|
this.facilityIds = res[0].value.data.map((item) => item.id); |
||||
|
this.searchFormList[2].default = dataList.map((item) => item.key); |
||||
|
console.log(56, this.searchFormList[2].default); |
||||
|
let currentMonth = moment().format("YYYY-MM"); |
||||
|
let currentDate = moment().format("YYYY-MM-DD"); |
||||
|
this.queryParams = { |
||||
|
searchType: 1, |
||||
|
facilityId: this.facilityIds, |
||||
|
date: [currentMonth + "-01", currentDate], |
||||
|
}; |
||||
|
this.searchFormList[3].default = [currentMonth + "-01", currentDate]; |
||||
|
this.getSelectTollStation(this.queryParams); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
// handleResetForm(data) { |
||||
|
// this.getSelectTollStation(data); |
||||
|
// }, |
||||
|
handleSearch(data, value) { |
||||
|
console.log(888, data, value); |
||||
|
if (value == "reset") { |
||||
|
data = this.queryParams; |
||||
|
} |
||||
|
this.getSelectTollStation(data); |
||||
|
}, |
||||
|
arraySpanMethod({ row, column, rowIndex, columnIndex }) { |
||||
|
if (this.searchType == 2) { |
||||
|
if (!row.causeTypeName) { |
||||
|
if (columnIndex === 0) { |
||||
|
return [1, 2]; |
||||
|
} else if (columnIndex === 1) { |
||||
|
return [0, 0]; |
||||
|
} |
||||
|
} |
||||
|
if (row.controlCauseName === "恶劣天气") { |
||||
|
if (columnIndex === 0) { |
||||
|
console.log(this.weatherNum.length); |
||||
|
if (rowIndex === 0) { |
||||
|
return [this.weatherNum.length, 1]; |
||||
|
} else if (rowIndex <= this.weatherNum.length) { |
||||
|
return [0, 0]; |
||||
|
} |
||||
|
// if (rowIndex === 2) { |
||||
|
// return [7, 1]; |
||||
|
// } |
||||
|
// else if (rowIndex === 3) { |
||||
|
// return [0, 0]; |
||||
|
// } else if (rowIndex === 4) { |
||||
|
// return [0, 0]; |
||||
|
// } |
||||
|
// else if (rowIndex === 5) { |
||||
|
// return [0, 0]; |
||||
|
// } |
||||
|
// else if (rowIndex === 6) { |
||||
|
// return [0, 0]; |
||||
|
// } |
||||
|
// else if (rowIndex === 7) { |
||||
|
// return [0, 0]; |
||||
|
// } |
||||
|
// else if (rowIndex === 8) { |
||||
|
// return [0, 0]; |
||||
|
// } |
||||
|
} |
||||
|
// this.weatherNum = 0 |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
getSelectTollStation(data) { |
||||
|
let startTime = ""; |
||||
|
let endTime = ""; |
||||
|
if (data) { |
||||
|
startTime = data.date[0] + " 00:00:00"; |
||||
|
endTime = data.date[1] + " 23:59:59"; |
||||
|
} else { |
||||
|
startTime = new Date("2024-01-01 11:12:21"); |
||||
|
startTime = new Date("2024-01-26 11:12:36"); |
||||
|
} |
||||
|
|
||||
|
var formData = new FormData(); |
||||
|
this.searchType = data.searchType; |
||||
|
this.controlType = data.controlType; |
||||
|
if (data.searchType == 1) { |
||||
|
formData.append("facilityId", data.facilityId); |
||||
|
} else { |
||||
|
formData.append("controlType", data.controlType); |
||||
|
} |
||||
|
formData.append("searchType", data.searchType); |
||||
|
formData.append("startTime", startTime); |
||||
|
formData.append("endTime", endTime); |
||||
|
let weatherData = []; |
||||
|
let otherData = []; |
||||
|
selectTollStation(formData).then((res) => { |
||||
|
if (data.searchType == 2) { |
||||
|
this.weatherNum = []; |
||||
|
res.data.forEach((item) => { |
||||
|
if (item.causeTypeName) { |
||||
|
this.weatherNum.push(item.causeTypeName); |
||||
|
weatherData.push(item); |
||||
|
} else { |
||||
|
otherData.push(item); |
||||
|
} |
||||
|
}); |
||||
|
this.tableData = weatherData.concat(otherData); |
||||
|
} else { |
||||
|
res.data.forEach((item) => { |
||||
|
item.total = |
||||
|
item.facilityClose + |
||||
|
item.facilityRestriction + |
||||
|
item.facilityInterval; |
||||
|
}); |
||||
|
this.facilityTableData = res.data; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.getFacilityList(); |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.dialog { |
||||
|
min-height: 800px; |
||||
|
} |
||||
|
|
||||
|
.search { |
||||
|
display: flex; |
||||
|
flex-direction: row-reverse; |
||||
|
} |
||||
|
|
||||
|
::v-deep .is-scrolling-none { |
||||
|
background: #0b6581; |
||||
|
} |
||||
|
|
||||
|
::v-deep .el-table__empty-text { |
||||
|
color: #3ae0f8; |
||||
|
} |
||||
|
|
||||
|
.StatsDetail { |
||||
|
// height: 770px; |
||||
|
margin: 20px 0; |
||||
|
width: 100%; |
||||
|
display: flex; |
||||
|
gap: 5px; |
||||
|
} |
||||
|
|
||||
|
.el-table { |
||||
|
border: 1px solid #07aec6; |
||||
|
background: #0b6581; |
||||
|
} |
||||
|
|
||||
|
::v-deep .el-table .el-table__header-wrapper th, |
||||
|
.el-table .el-table__fixed-header-wrapper th { |
||||
|
background: #0b6581; |
||||
|
border: 1px solid #07aec6; |
||||
|
} |
||||
|
|
||||
|
::v-deep .el-table th.el-table__cell > .cell { |
||||
|
color: #3de8ff; |
||||
|
} |
||||
|
|
||||
|
::v-deep .el-table thead.is-group th.el-table__cell { |
||||
|
background: #0b6581; |
||||
|
border: 1px solid #07aec6; |
||||
|
} |
||||
|
|
||||
|
// ::v-deep .el-table th.el-table__cell.is-leaf, |
||||
|
::v-deep .el-table td.el-table__cell { |
||||
|
border: 1px solid #07aec6; |
||||
|
background: #1b586d; |
||||
|
color: #fff; |
||||
|
} |
||||
|
|
||||
|
::v-deep .el-table tr { |
||||
|
border: 1px solid #07aec6; |
||||
|
background-color: #0b6581; |
||||
|
} |
||||
|
|
||||
|
::v-deep |
||||
|
.el-table--enable-row-hover |
||||
|
.el-table__body |
||||
|
tr:hover |
||||
|
> td.el-table__cell { |
||||
|
background: #1b586d; |
||||
|
border: 1px solid #07aec6; |
||||
|
} |
||||
|
|
||||
|
::v-deep .el-table::before, |
||||
|
.el-table--group::after, |
||||
|
.el-table--border::after { |
||||
|
background: none; |
||||
|
} |
||||
|
</style> |
||||
File diff suppressed because it is too large
Loading…
Reference in new issue