Browse Source

发布渠道接口对接

wangqin
zhangzhang 7 months ago
parent
commit
2aa95d808e
  1. 16
      ruoyi-ui/src/api/perception/meteorologyCheck.js
  2. 61
      ruoyi-ui/src/api/service/PublishingChannelManagement.js
  3. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/index.vue
  4. 20
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/roadNetwork/index.vue
  5. 10
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherInfoQuery/components/weaterData/index.vue
  6. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherWarning/components/infoWarning/index.vue
  7. 189
      ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/AddNEditDialog.vue
  8. 182
      ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/Card.vue
  9. 82
      ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/data.js
  10. 66
      ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/index.vue

16
ruoyi-ui/src/api/perception/meteorologyCheck.js

@ -63,3 +63,19 @@ export function getListVisibility() {
method: "get",
});
}
// 路网交通状况
export function getTrafficConditions() {
return request({
url: "/business/weatherMonitoring/getTrafficConditions",
method: "get",
});
}
// 获取县城经纬度
export function getRegionList() {
return request({
url: "/business/region/list",
method: "get",
});
}

61
ruoyi-ui/src/api/service/PublishingChannelManagement.js

@ -0,0 +1,61 @@
import request from "@/utils/request";
// 发布渠道列表
export function getChannelsList(pageNum, pageSize, data) {
return request({
url: `/business/channels/list?pageNum=${pageNum}&pageSize=${pageSize}`,
method: "post",
data,
});
}
// 导出发布渠道列表
export function getChannelsExport() {
return request({
url: "/business/channels/export",
method: "post",
});
}
// 获取发布渠道详情
export function getChannels(id) {
return request({
url: "/business/channels/" + id,
method: "get",
});
}
// 新增发布渠道
export function addChannels(data) {
return request({
url: "/business/channels",
method: "post",
data,
});
}
// 修改发布渠道
export function editChannels(data) {
return request({
url: "/business/channels",
method: "put",
data,
});
}
// 删除发布渠道
export function delChannels(id) {
return request({
url: "/business/channels/" + id,
method: "delete",
});
}
// 发布渠道修改状态
export function updateEnabledChannels(data) {
return request({
url: "business/channels/updateEnabled",
method: "post",
data,
});
}

4
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/index.vue

@ -388,7 +388,7 @@ export default {
// xData.push(it.day.split("-")[2] + "");
xData.push(it.day + "日");
}
if (this.type == "date") {
if (this.type == "day") {
xData.push(it.time + "时");
}
if (this.type == "quarter") {
@ -515,7 +515,7 @@ export default {
});
//
getSectionMarkNumber({
type: qType,
type: this.type,
sectionId: this.selectId,
createTime: startTime,
direction: this.direction,

20
ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/roadNetwork/index.vue

@ -31,7 +31,10 @@
<script>
import WgtTitle from "../../../widgets/title";
import { getQueryTheNumberOfMeteorologicalWarning } from "@/api/perception/meteorologyCheck";
import {
getQueryTheNumberOfMeteorologicalWarning,
getTrafficConditions,
} from "@/api/perception/meteorologyCheck";
export default {
name: "MonthStatistics",
@ -54,7 +57,7 @@ export default {
{
text: "团雾路段里程",
type: "array",
value: ["0", "0"],
value: [],
class: ["处", "km"],
},
{
@ -66,7 +69,7 @@ export default {
{
text: "能见度检测器",
type: "arrayRed",
value: ["0", "5"],
value: [],
class: ["", ""],
},
],
@ -78,7 +81,16 @@ export default {
getWeatherNum() {
getQueryTheNumberOfMeteorologicalWarning().then((res) => {
this.dataList[3].value = res.data;
console.log("res", res);
});
getTrafficConditions().then((res) => {
this.trafficData = res.data;
this.dataList[0].value = res.data.normalMileage;
this.dataList[1].value = res.data.rainfallMileage;
this.dataList[2].value.push(
res.data.heavyFogNum,
res.data.heavyFogMileage
);
this.dataList[4].value.push(res.data.anomalies, res.data.deviceNum);
});
},
},

10
ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherInfoQuery/components/weaterData/index.vue

@ -53,14 +53,16 @@
<span class="label">下雨类型</span>
<span class="text">{{
data.rainfall == 0
? "无降"
? "无降"
: data.rainfall == 1
? "雨"
: data.rainfall == 2
? "雪"
: data.rainfall == 3
? "毛毛雨"
: "雨夹雪"
: data.rainfall == 4
? "雨夹雪"
: "-"
}}</span>
</div>
<div class="item">
@ -84,7 +86,9 @@
? "积雪"
: data.rainfall == "05"
? "冰水混合物"
: "泥泞"
: data.rainfall == "06"
? "泥泞"
: "-"
}}</span>
</div>
<div class="item">

1
ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/weatherWarning/components/infoWarning/index.vue

@ -36,7 +36,6 @@
<div class="left-row">
<div class="label">预警等级</div>
<div :class="item.severityColor">
{{ item.severityColor }}
{{
item.severity == "Cancel"
? "取消"

189
ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/AddNEditDialog.vue

@ -27,11 +27,10 @@
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 { getSelectOptionsStation } from "@screen/pages/control/event/businessDataManagement/utils.js";
import { Message } from "element-ui";
import * as PresetFormItems from "@screen/common/PresetFormItems.js";
import {
addChannels,
editChannels,
} from "@/api/service/PublishingChannelManagement.js";
export default {
name: "AddNEditDialog",
@ -48,57 +47,149 @@ export default {
visible: Boolean,
data: Object,
},
inject: ["setCurrentPage"],
data() {
return {
submitting: false,
formData: {},
formList: [
{
label: "信息级别:",
key: "level",
type: "RadioGroup",
isAlone: true,
label: "事件类型:",
key: "dataCategory",
type: "select",
required: true,
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
disabled: false,
options: [
{
key: "1",
label: "影响通行",
key: 1,
label: "交通事故",
},
{
key: "2",
label: "不影响通行",
key: 2,
label: "车辆故障",
},
{
key: 3,
label: "交通管制",
},
{
key: 4,
label: "交通拥堵",
},
{
key: 5,
label: "非法上路",
},
{
key: 6,
label: "路障清除",
},
{
key: 7,
label: "施工建设",
},
{
key: 8,
label: "服务区异常",
},
{
key: 9,
label: "设施设备隐患",
},
{
key: 10,
label: "异常天气",
},
{
key: 11,
label: "其他事件",
},
],
},
},
PresetFormItems.releaseChannel,
{
label: "审核方式:",
key: "process",
label: "发布渠道:",
key: "publishChannels",
type: "CheckboxGroup",
isAlon: true,
required: true,
default: [],
options: {
options: [
{ key: "1", label: "手机短信", width: "87px" },
{ key: "2", label: "微信公众号", width: "87px" },
{ key: "3", label: "微博", width: "87px" },
{ key: "4", label: "情报板", width: "87px" },
{ key: "5", label: "服务网站", width: "87px" },
{ key: "6", label: "微信小程序", width: "87px" },
],
},
},
{
label: "信息级别:",
key: "infoLevel",
type: "RadioGroup",
isAlone: true,
required: true,
default: 1,
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
{
key: "1",
label: "单人审核",
key: 1,
label: "影响通行",
},
{
key: "2",
label: "双人审核",
key: 2,
label: "不影响通行",
},
],
},
},
{
label: "启用日期:",
key: "startDate",
type: "DatePicker",
required: true,
},
// {
// label: ":",
// key: "auditMethod",
// type: "RadioGroup",
// default: 1,
// options: {
// activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
// options: [
// {
// key: 1,
// label: "",
// },
// {
// key: 2,
// label: "",
// },
// ],
// },
// },
// {
// label: ":",
// key: "enabled",
// type: "RadioGroup",
// default: "1",
// options: {
// activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
// options: [
// {
// key: "1",
// label: "",
// },
// {
// key: "2",
// label: "",
// },
// ],
// },
// },
// {
// label: ":",
// key: "enableDate",
// type: "DatePicker",
// required: true,
// },
],
};
},
@ -114,21 +205,49 @@ export default {
},
watch: {
modelVisible: {
immediate: true,
handler(bool) {
if (!bool) return;
handler() {
this.formData = {
...this.data,
};
if (this.data.id) {
this.formList[0].options.disabled = true;
}
this.getOptions();
},
immediate: true,
deep: true,
},
},
methods: {
getOptions() {},
handleSubmit() {},
handleSubmit() {
if (this.formData && this.formData.publishChannels) {
this.formData.publishChannels =
this.formData.publishChannels.toString();
}
this.$refs.FormConfigRef.validate().then((data) => {
this.submitting = true;
let params = {
...this.formData,
id: this.data.id,
};
if (this.data.id) {
editChannels(params).then((res) => {
this.modelVisible = false;
this.submitting = false;
this.$parent.handleSearch();
});
} else {
addChannels(this.formData).then((res) => {
this.modelVisible = false;
this.submitting = false;
this.$parent.handleSearch();
});
}
});
console.log("新增", this.formData);
},
},
};
</script>

182
ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/Card.vue

@ -1,23 +1,33 @@
<template>
<div class='Card'>
<div class="Card">
<div class="header">
<BackgroundClip class="left" clipPath="inset(0 0 0 0 round 24px)"
<BackgroundClip
class="left"
clipPath="inset(0 0 0 0 round 24px)"
borderColor="linear-gradient(90deg, rgba(251, 19, 19, 1), rgba(214, 0, 0, 0))"
bgColor="linear-gradient(270deg, rgba(243, 0, 0, 0) 0%, #6B0000 100%)">
bgColor="linear-gradient(270deg, rgba(243, 0, 0, 0) 0%, #6B0000 100%)"
>
<img src="@screen/images/TrafficAccidents.svg" />
交通事故
{{ typeText }}
</BackgroundClip>
<div class="right">
<Switcher />
<Switcher
:value="enabled"
@change="(val) => handleChangeSwitcher(val)"
/>
<!-- <ElSwitch active-color="#fff" inactive-color="#48B0CB" /> -->
</div>
</div>
<Descriptions :list="list" style="gap: 15px; flex: 1; margin-top: 9px;" column="1" />
<Descriptions
:list="list"
style="gap: 15px; flex: 1; margin-top: 9px"
column="1"
/>
<div class="footer">
<Button @click.native="() => handleOpenDialogAddEdit(item)">修改</Button>
<Button style="background-color: #FF5F5F;" @click.native="handleDelete(item)">
<Button @click.native="() => handleOpenDialogEdit()">修改</Button>
<Button style="background-color: #ff5f5f" @click.native="handleDelete()">
删除
</Button>
</div>
@ -25,53 +35,163 @@
</template>
<script>
import Button from '@screen/components/Buttons/Button.vue';
import BackgroundClip from '@screen/components/Decorations/BackgroundClip.vue';
import Descriptions from '@screen/components/Descriptions.vue';
import Switcher from './Switcher.vue';
import Button from "@screen/components/Buttons/Button.vue";
import BackgroundClip from "@screen/components/Decorations/BackgroundClip.vue";
import Descriptions from "@screen/components/Descriptions.vue";
import Switcher from "./Switcher.vue";
import {
delChannels,
updateEnabledChannels,
} from "@/api/service/PublishingChannelManagement.js";
export default {
name: 'Card',
name: "Card",
components: {
Button,
BackgroundClip,
Descriptions,
Switcher
Switcher,
},
props: {
data: {
type: Object,
default: () => ({}),
},
},
methods: {
handleOpenDialogEdit() {
this.$parent.handleOpenDialogAddEdit(this.data);
},
handleDelete(item) {
this.$confirm("确定要删除该任务么?", "操作确认", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delChannels(this.data.id).then((res) => {
this.$message.success("删除成功");
this.$parent.handleSearch();
});
})
.catch(() => {
// Message.error("");
});
// this.$emit("handleDelete", item);
},
initData() {
console.log("初始化数据", this.data);
},
handleChangeSwitcher(val) {
let data = {
id: this.data.id,
enabled: val ? 2 : 0,
};
updateEnabledChannels(data).then(() => {
this.$parent.handleSearch();
});
console.log(88888, val);
},
},
mounted() {
this.initData();
},
watch: {
data: {
handler(val) {
let publishChannels = val.publishChannels.toString().split(",");
let newPublishChannels = [];
publishChannels.forEach((item) => {
newPublishChannels.push(
item == 1
? "手机短信"
: item == 2
? "微信公众号"
: item == 3
? "微博"
: item == 4
? "情报板"
: item == 5
? "服务网站"
: "微信小程序"
);
});
this.list[0].text = val.infoLevel == "1" ? "影响交通" : "不影响交通";
this.list[1].text = newPublishChannels.toString();
// this.list[2].text = val.auditMethod == "1" ? "" : "";
this.list[2].text = val.enableDate;
this.enabled = val.enabled == "2" ? true : false;
this.typeText =
val.dataCategory == "1"
? "交通事故"
: val.dataCategory == "2"
? "车辆故障"
: val.dataCategory == "3"
? "交通管制"
: val.dataCategory == "4"
? "交通拥堵"
: val.dataCategory == "5"
? "非法上路"
: val.dataCategory == "6"
? "路障清除"
: val.dataCategory == "7"
? "施工建设"
: val.dataCategory == "8"
? "服务区异常"
: val.dataCategory == "9"
? "设施设备隐患"
: val.dataCategory == "10"
? "异常天气"
: val.dataCategory == "11"
? "其他事件"
: "-";
},
immediate: true,
deep: true,
},
},
data() {
return {
typeText: "",
enabled: false,
list: [
{
label: '信息级别',
text: '影响通行',
label: "信息级别",
text: "",
},
{
label: '发布渠道',
text: '情报板、微博',
label: "发布渠道",
text: "",
},
// {
// label: "",
// text: "",
// },
{
label: '审核方式',
text: '双人审核',
label: "启用日期",
text: "",
},
{
label: '启用日期',
text: '2023.12.22 13:00:00',
}
]
}
}
}
],
};
},
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.Card {
height: 226px;
background: #133242;
border-radius: 2px;
border: 1px solid;
padding: 15px 21px;
border-image: linear-gradient(360deg, rgba(55, 231, 255, .42), rgba(55, 231, 255, 0)) 1 1;
border-image: linear-gradient(
360deg,
rgba(55, 231, 255, 0.42),
rgba(55, 231, 255, 0)
)
1 1;
display: flex;
flex-direction: column;
justify-content: space-between;

82
ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/data.js

@ -4,7 +4,7 @@ import { merge, cloneDeep } from "lodash";
export const searchFormList = [
{
label: "启用日期:",
key: "daterange",
key: "date",
required: false,
type: "datePicker",
options: {
@ -13,11 +13,79 @@ export const searchFormList = [
valueFormat: "yyyy-MM-dd HH:mm:ss",
},
},
PresetFormItems.eventType,
PresetFormItems.releaseChannel,
{
label: "事件类型:",
key: "dataCategory",
type: "select",
options: {
options: [
{
key: "1",
label: "交通事故",
},
{
key: "2",
label: "车辆故障",
},
{
key: "3",
label: "交通管制",
},
{
key: "4",
label: "交通拥堵",
},
{
key: "5",
label: "非法上路",
},
{
key: "6",
label: "路障清除",
},
{
key: "7",
label: "施工建设",
},
{
key: "8",
label: "服务区异常",
},
{
key: "9",
label: "设施设备隐患",
},
{
key: "10",
label: "异常天气",
},
{
key: "11",
label: "其他事件",
},
],
},
},
{
label: "发布渠道:",
key: "publishChannels",
type: "CheckboxGroup",
isAlone: true,
default: [],
options: {
options: [
{ key: "1", label: "微博", width: "87px" },
{ key: "3", label: "微信小程序", width: "87px" },
{ key: "4", label: "服务网站", width: "87px" },
{ key: "5", label: "情报板", width: "87px" },
{ key: "6", label: "手机短信", width: "87px" },
{ key: "7", label: "微信公众号", width: "87px" },
],
},
},
{
label: "信息级别:",
key: "level",
key: "infoLevel",
type: "RadioGroup",
isAlone: true,
options: {
@ -36,18 +104,18 @@ export const searchFormList = [
},
{
label: "启用状态:",
key: "status",
key: "enabled",
type: "RadioGroup",
isAlone: true,
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
{
key: "1",
key: "2",
label: "启用",
},
{
key: "2",
key: "0",
label: "停用",
},
],

66
ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/index.vue

@ -9,7 +9,7 @@
</template>
新增
</ButtonGradient>
<ButtonGradient>
<ButtonGradient @click.native="onRefreshForm">
<template #prefix>
<img src="@screen/images/refresh.svg" />
</template>
@ -18,6 +18,7 @@
</div>
<InputSearch
ref="searchComp"
style="width: 480px"
:formList="searchFormList"
@handleSearch="handleSearch"
@ -26,12 +27,22 @@
<!-- 内容 -->
<div class="body">
<Card v-for="item in 8" :key="item" />
<Card v-for="item in channelsList" :key="item.id" :data="item" />
</div>
<!-- 分页 -->
<div class="footer">
<Pagination layout="total,prev, pager, next, jumper" :total="90" />
<Pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
width="'100%'"
:page-sizes="[10]"
:page-size="searchData.pageSize"
:current-page.sync="searchData.pageNum"
layout="total, sizes, prev, pager, next"
:total="total"
>
</Pagination>
</div>
<!-- 新增编辑弹窗 -->
@ -45,6 +56,10 @@ import InputSearch from "@screen/components/InputSearch/index.vue";
import Card from "./components/Card";
import ButtonGradient from "@screen/components/Buttons/ButtonGradient.vue";
import AddNEditDialog from "./components/AddNEditDialog.vue";
import {
getChannelsList,
getChannels,
} from "@/api/service/PublishingChannelManagement.js";
import { searchFormList } from "./data";
@ -63,18 +78,55 @@ export default {
data: [],
addNEditDialogVisible: false,
dialogData: null,
channelsList: [],
total: 0,
searchData: {
pageSize: 10,
pageNum: 1,
},
};
},
methods: {
handleOpenDialogAddEdit(data) {
console.log("data", data);
this.addNEditDialogVisible = true;
this.dialogData = data;
if (data) {
data.publishChannels = data.publishChannels.toString().split(",");
this.dialogData = data;
}
},
onRefreshForm() {
this.$refs.searchComp.handleResetForm();
},
handleSearch(data) {
// this.searchData = data;
// this.getData();
if (data && data.publishChannels) {
data.publishChannels = data.publishChannels.toString();
}
if (data && data.date) {
data.startDate = data.date[0];
data.endDate = data.date[1];
// data.date = "";
}
data = { ...this.searchData, ...data };
getChannelsList(
this.searchData.pageNum,
this.searchData.pageSize,
data
).then((res) => {
this.channelsList = res.rows;
this.total = res.rows.length;
});
},
handleCurrentChange(pageNum) {
searchData.pageNum = pageNum;
this.handleSearch();
},
handleSizeChange(size) {
searchData.pageSize = size;
this.handleSearch();
},
},
mounted() {
this.handleSearch();
},
};
</script>

Loading…
Cancel
Save