Browse Source

更改

wangqin
zhangzhang 1 year ago
parent
commit
66a55e52ac
  1. 82
      ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue
  2. 105
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue
  3. 155
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/emergencyAgencies/index.vue

82
ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue

@ -1,6 +1,10 @@
<template> <template>
<BorderRadiusImage class='Card' borderRadius="2px" <BorderRadiusImage
borderColor="linear-gradient(360deg, rgba(55, 231, 255, 0.3), rgba(55, 231, 255, 0))" borderWidth="2px"> class="Card"
borderRadius="2px"
borderColor="linear-gradient(360deg, rgba(55, 231, 255, 0.3), rgba(55, 231, 255, 0))"
borderWidth="2px"
>
<div class="info" :style="{ gap }"> <div class="info" :style="{ gap }">
<p v-for="(item, index) in keyMap" :key="index"> <p v-for="(item, index) in keyMap" :key="index">
<span>{{ item.label }}: </span> <span>{{ item.label }}: </span>
@ -26,15 +30,15 @@
</template> </template>
<script> <script>
import Button from '@screen/components/Buttons/Button.vue'; import Button from "@screen/components/Buttons/Button.vue";
import BorderRadiusImage from "@screen/components/BorderRadiusImage.vue"; import BorderRadiusImage from "@screen/components/BorderRadiusImage.vue";
import { get as pathGet } from "lodash"; import { get as pathGet } from "lodash";
export default { export default {
name: 'Card', name: "Card",
components: { components: {
Button, Button,
BorderRadiusImage BorderRadiusImage,
}, },
props: { props: {
cardData: { cardData: {
@ -44,70 +48,70 @@ export default {
location: "长清大学城收费站", location: "长清大学城收费站",
direction: "117.123456", direction: "117.123456",
direction2: "37.12234", direction2: "37.12234",
state: 1 state: 1,
}) }),
}, },
keyMap: { keyMap: {
type: Array, type: Array,
default: () => ([ default: () => [
{ {
key: "source", key: "source",
label: "机构名称" label: "机构名称",
}, },
{ {
key: "location", key: "location",
label: "机构地址" label: "机构地址",
}, },
{ {
key: "direction", key: "direction",
label: "经度" label: "经度",
}, },
{ {
key: "direction2", key: "direction2",
label: "纬度" label: "纬度",
}, },
{ {
key: "direction3", key: "direction3",
label: "救援外协单位" label: "救援外协单位",
} },
]) ],
}, },
buttonIcon: { buttonIcon: {
type: String, type: String,
default: "images/insert.svg" default: "images/insert.svg",
}, },
buttonText: { buttonText: {
type: String, type: String,
default: "修改" default: "修改",
}, },
gap: { gap: {
type: String, type: String,
default: "6px" default: "6px",
}, },
hasBtn: { hasBtn: {
type: Boolean, type: Boolean,
default: true default: true,
} },
}, },
data() { data() {
return { return {
stateMap: { stateMap: {
1: "confirmed", 1: "confirmed",
2: 'comfortable', 2: "comfortable",
3: 'congestion', 3: "congestion",
4: "normal" 4: "normal",
} },
} };
}, },
methods: { methods: {
getValue(key) { getValue(key) {
return pathGet(this.cardData, key) ?? '-' return pathGet(this.cardData, key) ?? "-";
} },
} },
} };
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.Card { .Card {
color: #fff; color: #fff;
display: flex; display: flex;
@ -127,22 +131,22 @@ export default {
// align-items: center; // align-items: center;
// justify-content: space-between; // justify-content: space-between;
>p { > p {
height: 21px; // height: 21px;
font-size: 14px; font-size: 14px;
// font-family: PingFang SC, PingFang SC; // font-family: PingFang SC, PingFang SC;
font-weight: 400; font-weight: 400;
line-height: 21px; line-height: 21px;
display: flex; display: flex;
&>:first-child { & > :first-child {
margin-right: 6px; margin-right: 6px;
flex: 1; flex: 1;
} }
&>:last-child { & > :last-child {
flex: 2; flex: 2;
color: #FFFFFF; color: #ffffff;
} }
} }
} }
@ -173,7 +177,13 @@ export default {
&::after { &::after {
content: ""; content: "";
position: absolute; position: absolute;
background: linear-gradient(-147deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 0%, #FFFFFF 46%, rgba(255, 255, 255, 0) 100%); background: linear-gradient(
-147deg,
#ffffff 0%,
rgba(255, 255, 255, 0) 0%,
#ffffff 46%,
rgba(255, 255, 255, 0) 100%
);
height: 1px; height: 1px;
width: 124%; width: 124%;
transform: rotate(45deg); transform: rotate(45deg);

105
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue

@ -8,6 +8,7 @@
<Descriptions :list="list" :data="data" style="gap: 18px" /> <Descriptions :list="list" :data="data" style="gap: 18px" />
</ElTabPane> </ElTabPane>
<ElTabPane label="设备参数" name="second">设备参数</ElTabPane> <ElTabPane label="设备参数" name="second">设备参数</ElTabPane>
<ElTabPane label="在线率统计" name="third">在线率统计</ElTabPane>
</ElTabs> </ElTabs>
<div class="bottom"> <div class="bottom">
@ -16,40 +17,46 @@
</div> </div>
<!-- <DeviceControlDialog v-model="deviceControlVisible" :deviceId="dialogData.iotDeviceId || '8697-1'" /> --> <!-- <DeviceControlDialog v-model="deviceControlVisible" :deviceId="dialogData.iotDeviceId || '8697-1'" /> -->
<DeviceControlDialog v-model="deviceControlVisible" :deviceId="dialogData.iotDeviceId" /> <DeviceControlDialog
v-model="deviceControlVisible"
:deviceId="dialogData.iotDeviceId"
/>
</Dialog> </Dialog>
</template> </template>
<script> <script>
import Dialog from "@screen/components/Dialog/index.vue"; import Dialog from "@screen/components/Dialog/index.vue";
import Button from "@screen/components/Buttons/Button.vue" import Button from "@screen/components/Buttons/Button.vue";
import Descriptions from '@screen/components/Descriptions.vue'; import Descriptions from "@screen/components/Descriptions.vue";
import DeviceControlDialog from "./components/DeviceControlDialog.vue" import DeviceControlDialog from "./components/DeviceControlDialog.vue";
import { getRoadInfoByStakeMark, getProduct } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js" import {
import Video from "@screen/components/Video" getRoadInfoByStakeMark,
getProduct,
} from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import Video from "@screen/components/Video";
import request from "@/utils/request"; import request from "@/utils/request";
import { dialogDelayVisible } from "./../mixin" import { dialogDelayVisible } from "./../mixin";
// //
export default { export default {
name: 'DrivingGuidance', name: "DrivingGuidance",
mixins: [dialogDelayVisible], mixins: [dialogDelayVisible],
provide() { provide() {
return { return {
requestURL: this.requestURL requestURL: this.requestURL,
} };
}, },
components: { components: {
Dialog, Dialog,
Button, Button,
Descriptions, Descriptions,
DeviceControlDialog, DeviceControlDialog,
Video Video,
}, },
data() { data() {
return { return {
activeName: 'first', activeName: "first",
deviceControlVisible: false, deviceControlVisible: false,
data: { data: {
deviceType: "行车诱导", deviceType: "行车诱导",
@ -61,77 +68,85 @@ export default {
}, },
list: [ list: [
{ {
label: '设备名称', label: "设备名称",
key: "deviceName", key: "deviceName",
}, },
{ {
label: '设备桩号', label: "设备桩号",
key: "stakeMark", key: "stakeMark",
}, },
{ {
label: '道路名称', label: "道路名称",
key: "roadName", key: "roadName",
}, },
{ {
label: '设备方向', label: "设备方向",
key: "direction", key: "direction",
enum: "CameraDirectionEnum" enum: "CameraDirectionEnum",
}, },
{ {
label: '设备状态', label: "设备状态",
key: "deviceState", key: "deviceState",
enum: "DeviceTypeEnum" enum: "DeviceTypeEnum",
}, },
{ {
label: '设备厂商', label: "设备厂商",
key: "brand", key: "brand",
}, },
{ {
label: '工作模式', label: "工作模式",
key: "workMode", key: "workMode",
}, },
{ {
label: '上行工作状态', label: "上行工作状态",
key: "onWorkStatus", key: "onWorkStatus",
}, },
{ {
label: '下行工作状态', label: "下行工作状态",
key: "inWorkStatus", key: "inWorkStatus",
}, },
] ],
} };
}, },
async created() { async created() {
console.log(333,this.dialogData,444) console.log(333, this.dialogData, 444);
this.data = { ...this.dialogData, roadName: null } this.data = { ...this.dialogData, roadName: null };
getProduct(this.dialogData.productId) getProduct(this.dialogData.productId)
.then(data => { .then((data) => {
this.dialogData.brand = data.brand; this.dialogData.brand = data.brand;
}) })
.catch((err) => { .catch((err) => {});
});
this.requestURL(52) this.requestURL(52)
.then((result) => { .then((result) => {
this.data.workMode = { "00": "手动控制", "01": "自动控制", "02": "万年历" }[result.mode]; this.data.workMode = {
this.data.onWorkStatus = result.onWorkStatus "00": "手动控制",
this.data.inWorkStatus = result.inWorkStatus "01": "自动控制",
"02": "万年历",
}[result.mode];
this.data.onWorkStatus = result.onWorkStatus;
this.data.inWorkStatus = result.inWorkStatus;
}) })
.catch((err) => { .catch((err) => {});
});
const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMark); const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMark);
console.log("%c [ roadInfo ]-103-「index.vue」", "font-size:15px; background:#36347c; color:#7a78c0;", roadInfo.roadName); console.log(
"%c [ roadInfo ]-103-「index.vue」",
"font-size:15px; background:#36347c; color:#7a78c0;",
roadInfo.roadName
);
if (roadInfo) this.data.roadName = roadInfo.roadName; if (roadInfo) this.data.roadName = roadInfo.roadName;
}, },
methods: { methods: {
requestURL(functionId = 52, options = {}) { requestURL(functionId = 52, options = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
request.post(`business/device/functions/${this.dialogData.iotDeviceId}/${functionId}`, options) request
.post(
`business/device/functions/${this.dialogData.iotDeviceId}/${functionId}`,
options
)
.then((result) => { .then((result) => {
if (result.code != 200) return reject(); if (result.code != 200) return reject();
resolve(result.data[0]); resolve(result.data[0]);
@ -139,13 +154,13 @@ export default {
.catch((err) => { .catch((err) => {
reject(); reject();
}); });
}) });
} },
} },
} };
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.DrivingGuidance { .DrivingGuidance {
width: 600px; width: 600px;
color: #fff; color: #fff;
@ -179,7 +194,7 @@ export default {
align-items: center; align-items: center;
justify-content: end; justify-content: end;
>div { > div {
font-size: 16px; font-size: 16px;
padding: 6px 12px; padding: 6px 12px;
} }

155
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/emergencyAgencies/index.vue

@ -1,5 +1,5 @@
<template> <template>
<div class='EmergencyAgencies'> <div class="EmergencyAgencies">
<div class="filter"> <div class="filter">
<div> <div>
<ButtonGradient @click.native="handleOpenDialogAddEdit()"> <ButtonGradient @click.native="handleOpenDialogAddEdit()">
@ -22,21 +22,39 @@
</ButtonGradient> </ButtonGradient>
</div> </div>
<InputSearch style="width: 402px;" :formList="searchFormList" :formConfigOptions="{ labelWidth: '90px' }" <InputSearch
@handleSearch="handleSearch" /> style="width: 402px"
:formList="searchFormList"
:formConfigOptions="{ labelWidth: '90px' }"
@handleSearch="handleSearch"
/>
</div> </div>
<div class='body'> <div class="body">
<!-- <ElEmpty v-if="!data.length && !isFirst" description="暂无数据" style="width: 100%;height: 100%;position: absolute;" /> --> <!-- <ElEmpty v-if="!data.length && !isFirst" description="暂无数据" style="width: 100%;height: 100%;position: absolute;" /> -->
<div v-if="!data.length && !isFirst" class="no-data" style="position: absolute">暂无数据</div> <div
v-if="!dataList.length && !isFirst"
class="no-data"
style="position: absolute"
>
暂无数据
</div>
<template v-else> <template v-else>
<Card v-for="(item, index) in data" :keyMap="keyMap" :cardData="item" :key="index"> <Card
v-for="(item, index) in dataList"
:keyMap="keyMap"
:cardData="item"
:key="index"
>
<template #button> <template #button>
<Button @click.native="() => handleOpenDialogAddEdit(item)"> <Button @click.native="() => handleOpenDialogAddEdit(item)">
修改 修改
</Button> </Button>
<Button style="background-color: #FF5F5F;" @click.native="handleDelete(item)"> <Button
style="background-color: #ff5f5f"
@click.native="handleDelete(item)"
>
删除 删除
</Button> </Button>
</template> </template>
@ -49,30 +67,30 @@
</template> </template>
<script> <script>
import Card from "@screen/components/Card1/index.vue" import Card from "@screen/components/Card1/index.vue";
import InputSearch from '@screen/components/InputSearch/index.vue'; import InputSearch from "@screen/components/InputSearch/index.vue";
import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue'; import ButtonGradient from "@screen/components/Buttons/ButtonGradient.vue";
import Button from '@screen/components/Buttons/Button.vue'; import Button from "@screen/components/Buttons/Button.vue";
import AddNEditDialog from "./components/AddNEditDialog.vue" import AddNEditDialog from "./components/AddNEditDialog.vue";
import { searchFormList } from "./data"; import { searchFormList } from "./data";
import request from "@/utils/request"; import request from "@/utils/request";
import { setLoading } from "@screen/utils/index.js" import { setLoading } from "@screen/utils/index.js";
import { delay, exportFile, confirm } from "@screen/utils/common"; import { delay, exportFile, confirm } from "@screen/utils/common";
import { Message } from "element-ui"; import { Message } from "element-ui";
let vehicleTypeList = []; // let vehicleTypeList = [];
// //
export default { export default {
name: 'EmergencyAgencies', name: "EmergencyAgencies",
inject: ['getPagination', 'setTotal', 'setCurrentPage'], inject: ["getPagination", "setTotal", "setCurrentPage"],
components: { components: {
Card, Card,
ButtonGradient, ButtonGradient,
InputSearch, InputSearch,
Button, Button,
AddNEditDialog AddNEditDialog,
}, },
data() { data() {
return { return {
@ -85,15 +103,15 @@ export default {
// direction: "117.123456", // direction: "117.123456",
// direction2: "37.12234", // direction2: "37.12234",
// })), // })),
data: [], dataList: [],
keyMap: [ keyMap: [
{ {
key: "dcOrganizations.organizationName", key: "dcOrganizations.organizationName",
label: "机构名称" label: "机构名称",
}, },
{ {
key: "dcOrganizations.organizationAddress", key: "dcOrganizations.organizationAddress",
label: "机构地址" label: "机构地址",
}, },
// { // {
// key: "coordinate.longitude", // key: "coordinate.longitude",
@ -105,24 +123,25 @@ export default {
// }, // },
{ {
key: "dcOrganizations.stakeMark", key: "dcOrganizations.stakeMark",
label: "桩号" label: "桩号",
}, },
// { // {
// key: "dcOrganizations.latitude", // key: "dcOrganizations.latitude",
// label: "" // label: ""
// }, // },
{ {
key: "car", key: "cars",
label: "驻点车辆", label: "驻点车辆",
value: "aaa"
}, },
{ {
key: "employeesNum", key: "employeesNum",
label: "驻点人员" label: "驻点人员",
} suffix: "人",
},
], ],
isFirst: true isFirst: true,
} vehicleTypeList: [],
};
}, },
created() { created() {
this.getData(); this.getData();
@ -130,24 +149,19 @@ export default {
}, },
methods: { methods: {
getVehicleTypeList() { getVehicleTypeList() {
if (vehicleTypeList.length) return; if (this.vehicleTypeList.length) return;
request({ request({
url: `/system/dict/data/type/sys_vehicle_type`, url: `/system/dict/data/type/sys_vehicle_type`,
method: "GET", method: "GET",
params: {} params: {},
}) })
.then(({ data, code }) => { .then(({ data, code }) => {
if (code != 200) return ;//Message.error(""); console.log("Success", data);
if (code != 200) return; //Message.error("");
// vehicleTypeList = this.formList[5].options.options = data.map(item => ({ this.vehicleTypeList = data;
// key: item.dictValue,
// label: item.dictLabel
// }))
}) })
.catch((err) => { .catch((err) => {});
});
}, },
async handleDelete(data) { async handleDelete(data) {
await confirm({ message: "是否要删除该机构?" }); await confirm({ message: "是否要删除该机构?" });
@ -155,11 +169,11 @@ export default {
request({ request({
url: `/business/organization/${data.dcOrganizations.id}`, url: `/business/organization/${data.dcOrganizations.id}`,
method: "DELETE", method: "DELETE",
data: {} data: {},
}) })
.then((result) => { .then((result) => {
if (result.code != 200) return Message.error(`删除失败!`); if (result.code != 200) return Message.error(`删除失败!`);
this.setCurrentPage(1) this.setCurrentPage(1);
Message.success(`删除成功!`); Message.success(`删除成功!`);
}) })
.catch((err) => { .catch((err) => {
@ -182,8 +196,8 @@ export default {
filename: "应急机构", filename: "应急机构",
data: { data: {
...this.searchData, ...this.searchData,
...this.getPagination() ...this.getPagination(),
} },
}); });
}, },
async getData() { async getData() {
@ -196,26 +210,47 @@ export default {
method: "get", method: "get",
params: { params: {
...this.searchData, ...this.searchData,
...this.getPagination() ...this.getPagination(),
} },
}).then(result => {
if (result.code != 200) return;
this.data = result.rows;
this.setTotal(result.total)
}).finally(() => {
closeLoading();
this.isFirst = false;
}) })
} .then((result) => {
} if (result.code != 200) return;
} this.dataList = result.rows;
let data = [];
this.vehicleTypeList.forEach((items) => {
this.dataList.forEach((item) => {
if (item.car.length > 0) {
for (var i = 0; i < item.car.length; i++) {
if (item.car[i].vehicleType == items.dictValue) {
// let data =
data.push(items.dictLabel + "*" + item.car[i].carNum);
// item.cars = items.dictLabel + "*" + item.car[i].carNum;
}
}
}
});
});
console.log(999, this.dataList);
console.log(999, data);
this.dataList.forEach((item) => {
if (item.car.length > 0) {
item.cars = data.join("、");
}
});
this.setTotal(result.total);
})
.finally(() => {
closeLoading();
this.isFirst = false;
});
},
},
};
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.EmergencyAgencies { .EmergencyAgencies {
.body { .body {
display: grid; display: grid;
grid-template-columns: repeat(5, 1fr); grid-template-columns: repeat(5, 1fr);
@ -227,15 +262,15 @@ export default {
.endSpecial { .endSpecial {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #00B3CC; color: #00b3cc;
line-height: 16px; line-height: 16px;
span:first-child { span:first-child {
color: rgba(0, 179, 204, 1)#000; color: rgba(0, 179, 204, 1) #000;
} }
span:last-child { span:last-child {
color: rgba(217, 0, 27, 1) color: rgba(217, 0, 27, 1);
} }
} }
} }

Loading…
Cancel
Save