Browse Source

新增事件

wangqin
zhoule 1 year ago
parent
commit
c73d156152
  1. 64
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js
  2. 484
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js
  3. 23
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue

64
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js

@ -1,5 +1,6 @@
import request from '@/utils/request'
import { Message } from "element-ui";
import moment from "moment";
export const source = {
label: "来源:",
@ -7,6 +8,7 @@ export const source = {
type: "RadioGroup",
isAlone: true,
required: true,
default: '1',
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -48,6 +50,7 @@ export const illegalTriggeringType = {
type: "RadioGroup",
isAlone: true,
required: true,
default: '5-1',
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -99,7 +102,7 @@ export const station = {
],
},
visible: (data) => {
if (data?.dcEventAccident?.locationType != 1) {
if (data.dcEventAccident && data.dcEventAccident.locationType != 1) {
return false;
}
return true;
@ -187,6 +190,7 @@ export const startTime = {
required: true,
isAlone: true,
type: "datePicker",
default: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
options: {
type: "datetime",
format: "yyyy-MM-dd HH:mm:ss",
@ -470,7 +474,7 @@ export const remark = {
autosize: { minRows: 6, maxRows: 6 },
showWordLimit: true,
},
required: true,
// required: true,
};
export const isInTunnel = {
@ -478,6 +482,7 @@ export const isInTunnel = {
key: "inTunnel",
// isAlone: true,
required: true,
default: '0',
type: "RadioGroup",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
@ -575,52 +580,15 @@ export const weatherSituation = {
key: "1-6",
label: "暴雨",
},
{
key: "2-1",
label: "小雪",
},
{
key: "2-2",
label: "中雪",
},
{
key: "2-3",
label: "大雪",
},
{
key: "2-4",
label: "暴雪",
},
{
key: "2-5",
label: "大暴雪",
},
{
key: "2-6",
label: "特大暴雪",
},
{
key: "3-1",
label: "轻雾",
},
{
key: "3-2",
label: "大雾",
},
{
key: "3-3",
label: "浓雾",
},
{
key: "3-4",
label: "强浓雾",
},
{
key: "3-5",
label: "团雾",
},
],
},
visible: (data) => {
if (data?.eventSubclass == '10-1' || data?.eventSubclass == '10-2' || data?.eventSubclass == '10-3') {
return true;
}
return false;
},
};
export const additionalNotes = {
@ -770,6 +738,7 @@ export const eventHappenTime = {
key: "occurrenceTime",
required: true,
type: "datePicker",
default: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
options: {
type: "datetime",
format: "yyyy-MM-dd HH:mm:ss",
@ -971,6 +940,7 @@ export const constructionMeasurement = {
type: "RadioGroup",
isAlone: true,
required: true,
default:'0',
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -1000,6 +970,7 @@ export const locationType = {
type: "RadioGroup",
isAlone: true,
required: true,
default: '1',
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -1021,6 +992,7 @@ export const specialConstruction = {
type: "RadioGroup",
isAlone: true,
required: true,
default: '1',
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [

484
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js

@ -532,41 +532,44 @@ export const tabConfigList = [
},
],
};
classify.options.options = ad[data.dcEventTrafficControl.controlType];
classify.options.options =
ad[data.dcEventTrafficControl.controlType];
if(data.dcEventTrafficControl) {
if (data.dcEventTrafficControl) {
data.dcEventTrafficControl.facilityId = null;
}
let facilityType = 1;
if (value == '3-2') {
if (value == "3-2") {
facilityType = 1;
} else if (value == '3-3') {
} else if (value == "3-3") {
facilityType = 3;
} else if (value == '3-4') {
} else if (value == "3-4") {
facilityType = 6;
}
if(value && value != '3-1'){
if (value && value != "3-1") {
//路网设施 1 收费站 2 桥梁 3 互通立交 4 枢纽立交 5 隧道 6 服务区
request({
url: `/business/facility/query?facilityType=${facilityType}`,
method: "get"
}).then((result) => {
method: "get",
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
let lwss = [];
result.data.forEach(it => lwss.push({ key: it.id, label: it.facilityName}))
result.data.forEach((it) =>
lwss.push({ key: it.id, label: it.facilityName })
);
formList.forEach((it) => {
if(it.key == "dcEventTrafficControl.facilityId"){
if (it.key == "dcEventTrafficControl.facilityId") {
it.options.options = lwss;
}
});
}).catch((err) => {
console.log('err',err)
Message.error("查询失败1", err);
})
.catch((err) => {
console.log("err", err);
Message.error("查询失败1", err);
});
}
},
},
},
@ -683,7 +686,8 @@ export const tabConfigList = [
{
key: "1",
label: "主线关闭",
},],
},
],
},
},
{
@ -1072,7 +1076,7 @@ export const tabConfigList = [
],
},
visible: (data) => {
if (data?.eventSubclass == '3-1') {
if (data?.eventSubclass == "3-1") {
return true;
}
return false;
@ -1614,6 +1618,7 @@ export const tabConfigList = [
type: "RadioGroup",
isAlone: true,
required: true,
default: "6-1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -1666,6 +1671,7 @@ export const tabConfigList = [
type: "RadioGroup",
isAlone: true,
required: true,
default: "1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -1739,6 +1745,7 @@ export const tabConfigList = [
type: "RadioGroup",
isAlone: true,
required: true,
default: "7-1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -1764,13 +1771,53 @@ export const tabConfigList = [
},
],
},
ons: {
input(value, ...args) {
const { data, formList } = args.slice(-1)[0];
if (data.dcEventConstruction) {
data.dcEventConstruction.facilityId = null;
}
let facilityType = 1;
if (value == "7-2" || value == "7-7") {
facilityType = 1;
} else if (value == "7-3" || value == "7-8") {
facilityType = 6;
} else if (value == "7-4" || value == "7-9") {
facilityType = 3;
}
if (value && (value != "7-1" && value != "7-6")) {
//路网设施 1 收费站 2 桥梁 3 互通立交 4 枢纽立交 5 隧道 6 服务区
request({
url: `/business/facility/query?facilityType=${facilityType}`,
method: "get",
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
let lwss = [];
result.data.forEach((it) =>
lwss.push({ key: it.id, label: it.facilityName })
);
formList.forEach((it) => {
if (it.key == "dcEventConstruction.facilityId") {
it.options.options = lwss;
}
});
})
.catch((err) => {
console.log("err", err);
Message.error("查询失败1", err);
});
}
},
},
},
{
label: "管制方式:",
key: "dcEventConstruction.controlMode",
type: "RadioGroup",
isAlone: true,
required: true,
default: "1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -1787,13 +1834,264 @@ export const tabConfigList = [
},
PresetFormItems.isInTunnel,
{
//地点类型
...PresetFormItems.locationType,
key: "dcEventConstruction.locationType",
visible: (data) => {
if (data.eventSubclass == "7-1" || data.eventSubclass == "7-6") {
return true;
}
return false;
},
},
{
label: "施工方式:",
key: "dcEventConstruction.constructionMethod",
type: "RadioGroup",
isAlone: false,
required: true,
default: "1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
{
key: "1",
label: "车道",
},
{
key: "2",
label: "其他",
},
],
},
visible: (data) => {
if (data.eventSubclass == "7-2" || data.eventSubclass == "7-7") {
return true;
}
return false;
},
},
{
label: "通行情况:",
key: "dcEventConstruction.trafficCondition",
type: "RadioGroup",
isAlone: true,
required: true,
default: "1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
{
key: "1",
label: "通行受限",
},
{
key: "2",
label: "车辆谨慎慢行",
},
{
key: "3",
label: "车辆正常通行",
},
],
},
visible: (data) => {
if (
data.eventSubclass == "7-2" ||
data.eventSubclass == "7-7" ||
data.eventSubclass == "7-4" ||
data.eventSubclass == "7-9"
) {
return true;
}
return false;
},
},
PresetFormItems.freeway,
PresetFormItems.direction,
PresetFormItems.station,
PresetFormItems.emptyLine,
{
...PresetFormItems.station,
visible: (data) => {
if (
(data.eventSubclass == "7-1" || data.eventSubclass == "7-6") &&
data?.dcEventConstruction.locationType == "1"
) {
return true;
}
return false;
},
},
{
...PresetFormItems.startEndStation,
visible: (data) => {
if (
(data.eventSubclass == "7-1" || data.eventSubclass == "7-6") &&
data?.dcEventConstruction.locationType == "2"
) {
return true;
}
return false;
},
},
// PresetFormItems.emptyLine,
{
...PresetFormItems.laneOccupancy,
required: true,
visible: (data) => {
if (data?.dcEventConstruction.controlMode == "2") {
return true;
}
return false;
},
},
{
label: "收费站:",
key: "dcEventConstruction.facilityId",
type: "select",
isAlone: false,
required: true,
options: {
options: [],
},
visible: (data) => {
if (data.eventSubclass == "7-2" || data.eventSubclass == "7-7") {
return true;
}
return false;
},
},
{
label: "出入口:",
key: "dcEventConstruction.exitsInlets",
type: "RadioGroup",
isAlone: false,
required: true,
default: "2",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
{
key: "1",
label: "出口",
},
{
key: "2",
label: "入口",
},
],
},
visible: (data) => {
if (data.eventSubclass == "7-2" || data.eventSubclass == "7-7") {
return true;
}
return false;
},
},
{
label: "服务区:",
key: "dcEventConstruction.facilityId",
type: "select",
isAlone: false,
required: true,
options: {
options: [],
},
visible: (data) => {
if (data.eventSubclass == "7-3" || data.eventSubclass == "7-8") {
return true;
}
return false;
},
},
{
label: "地点:",
key: "dcEventConstruction.location",
isAlone: false,
required: true,
options: {
placeholder: "服务区地点",
},
visible: (data) => {
if (data.eventSubclass == "7-3" || data.eventSubclass == "7-8") {
return true;
}
return false;
},
},
{
label: "立交桥:",
key: "dcEventConstruction.facilityId",
type: "select",
isAlone: false,
required: true,
options: {
options: [],
},
visible: (data) => {
if (data.eventSubclass == "7-4" || data.eventSubclass == "7-9") {
return true;
}
return false;
},
ons: {
change(value, ...args) {
const { formList } = args.slice(-1)[0];
//匝道
request({
url: `/system/ramp/listAll?facilityId=${value}`,
method: "get",
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
let zd = [];
result.rows.forEach((it) =>
zd.push({ key: it.id, label: it.rampName })
);
// console.log("zd", zd);
formList.forEach((it) => {
if (it.key == "dcEventConstruction.rampId") {
// console.log("it", it);
it.options.options = zd;
}
});
})
.catch((err) => {
console.log("err", err);
Message.error("查询失败3", err);
});
},
},
},
{
label: "匝道:",
key: "dcEventConstruction.rampId",
type: "select",
isAlone: false,
required: true,
options: {
options: [],
},
visible: (data) => {
if (data.eventSubclass == "7-4" || data.eventSubclass == "7-9") {
return true;
}
return false;
},
},
{
label: "地方道路名称:",
key: "dcEventConstruction.localRoadName",
isAlone: true,
required: true,
options: {},
visible: (data) => {
if (data.eventSubclass == "7-5" || data.eventSubclass == "7-10") {
return true;
}
return false;
},
},
{
label: "特殊地点描述:",
key: "dcEventConstruction.specialPlaceDescription",
@ -1810,9 +2108,27 @@ export const tabConfigList = [
...PresetFormItems.specialConstruction,
key: "dcEventConstruction.specialConstruction",
},
{
label: "专项施工名称:",
key: "dcEventConstruction.otherConstructionName",
isAlone: true,
options: {},
visible: (data) => {
if (data?.dcEventConstruction.specialConstruction == "4") {
return true;
}
return false;
},
},
{
...PresetFormItems.constructionMeasurement,
key: "dcEventConstruction.constructionMeasurement",
visible: (data) => {
if (data.eventSubclass == "7-1" || data.eventSubclass == "7-6") {
return true;
}
return false;
},
},
PresetFormItems.startTime,
PresetFormItems.expectedEndTime,
@ -1835,6 +2151,7 @@ export const tabConfigList = [
type: "RadioGroup",
isAlone: true,
required: true,
default: "8-1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -1859,7 +2176,7 @@ export const tabConfigList = [
label: "服务区:",
key: "dcEventServiceArea.facilityId",
type: "select",
isAlone: true,
isAlone: false,
required: true,
options: {
options: [
@ -1870,12 +2187,50 @@ export const tabConfigList = [
],
},
},
{
label: "停用设施:",
key: "dcEventServiceArea.disableFacility",
type: "select",
isAlone: false,
required: true,
options: {
options: [
{
value: "1",
label: "卫生间",
},
{
value: "2",
label: "餐厅",
},
{
value: "3",
label: "停车场",
},
{
value: "4",
label: "加油站",
},
{
value: "5",
label: "充电桩",
},
],
},
visible: (data) => {
if (data?.eventSubclass == "8-2") {
return true;
}
return false;
},
},
{
label: "出入口:",
key: "dcEventServiceArea.exitsInlets",
type: "RadioGroup",
isAlone: true,
required: true,
default: "2",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -1911,6 +2266,7 @@ export const tabConfigList = [
type: "RadioGroup",
isAlone: true,
required: true,
default: "9-1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -1979,6 +2335,7 @@ export const tabConfigList = [
type: "RadioGroup",
isAlone: true,
required: true,
default: "10-1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -2020,6 +2377,91 @@ export const tabConfigList = [
},
],
},
ons: {
input(value, ...args) {
const { formList } = args.slice(-1)[0];
const config = formList.find(
(it) => it.key == "dcEventAbnormalWeather.weatherSituation"
);
let ad = {
"10-1": [
{
key: "1-1",
label: "雨雾",
},
{
key: "1-2",
label: "雨雪",
},
{
key: "1-3",
label: "中雨",
},
{
key: "1-4",
label: "小雨",
},
{
key: "1-5",
label: "大雨",
},
{
key: "1-6",
label: "暴雨",
},
],
"10-2": [
{
key: "2-1",
label: "小雪",
},
{
key: "2-2",
label: "中雪",
},
{
key: "2-3",
label: "大雪",
},
{
key: "2-4",
label: "暴雪",
},
{
key: "2-5",
label: "大暴雪",
},
{
key: "2-6",
label: "特大暴雪",
},
],
"10-3": [
{
key: "3-1",
label: "轻雾",
},
{
key: "3-2",
label: "大雾",
},
{
key: "3-3",
label: "浓雾",
},
{
key: "3-4",
label: "强浓雾",
},
{
key: "3-5",
label: "团雾",
},
],
};
config.options.options = ad[value];
},
},
},
{
...PresetFormItems.weatherSituation,

23
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue

@ -120,7 +120,7 @@ export default {
// console.log('index',index)
this.index = index;
let formConfig = tabConfigList[index].formConfig;
console.log('formConfig', formConfig)
formConfig.list.forEach(it => {
if (it.key == 'direction') {
it.options.options = this.direction;
@ -128,7 +128,7 @@ export default {
if (it.key == 'roadId') {
it.options.options = this.roads;
}
if (index == 7 || it.key === 'dcEventServiceArea.facilityId') {
if (index == 7 && it.key == 'dcEventServiceArea.facilityId') {
it.options.options = this.lwss.filter(ss => ss.type == 6);
}
// if (index == 0 || index == 1 || index == 7) {
@ -148,21 +148,32 @@ export default {
if (this.index == 0 || this.index == 1) {
formData.lang = formData.lang.join(',')
} else {
formData.lang = ''
}
if (formData.endStakeMark) {
if (formData.endStakeMark && formData.endStakeMark[0] != null) {
let endStakeMark = formData.endStakeMark;
let strMark = (endStakeMark && endStakeMark.length > 0) ? ('K' + endStakeMark[0] + '+' + endStakeMark[1]) : '';
if (this.index == 3) {
formData.dcEventTrafficCongestion.endStakeMark = strMark;
}
if (this.index == 6) {
formData.dcEventConstruction.endStakeMark = strMark;
}
if (this.index == 9) {
formData.dcEventAbnormalWeather.endStakeMark = strMark;
}
formData.endStakeMark = '';
} else {
formData.endStakeMark = '';
}
// console.log('formData',formData)
// return;
let stakeMark = formData.stakeMark;
// console.log('formData', {
// ...formData,
// eventType: Number(this.index) + 1,
// stakeMark: (stakeMark && stakeMark[0] != null) ? ((stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[1]) : '') : '',
// })
// return;
request({
url: `/dc/system/event`,
@ -170,7 +181,7 @@ export default {
data: {
...formData,
eventType: Number(this.index) + 1,
stakeMark: stakeMark ? ((stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[1]) : '') : '',
stakeMark: (stakeMark && stakeMark[0] != null) ? ((stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[1]) : '') : '',
}
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);

Loading…
Cancel
Save