Browse Source

完成公众服务功能

wangqin
王钦 6 months ago
parent
commit
add1accc41
  1. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/CrowdnessIndicatorRankings/index.vue
  2. 212
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/index.vue
  3. 3
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/index.vue
  4. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue
  5. 74
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/data.js
  6. 15
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/images/delete.svg
  7. 7
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/images/export.svg
  8. 22
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/images/refresh.svg
  9. 262
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/index.vue
  10. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/index.vue

1
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/CrowdnessIndicatorRankings/index.vue

@ -287,6 +287,7 @@ export default {
}
const self = this;
setTimeout(() => {
console.log(self.detailData,'---------------')
// map
const { AMap, mapIns } = self.$refs.AMapContainerRef.getMapInstance();
const { longitude, dimension, eventName } = self.detailData;

212
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/index.vue

@ -1,29 +1,15 @@
<template>
<Card class="DeviceControl" title="设备管控">
<Card class='DeviceControl' title="设备管控">
<div class="container">
<el-row v-for="(item, index) in tableData" :key="index" class="rowBlock">
<ScopeTable
:tableInfo="item"
:index="index"
@onAdd="onAdd"
@onDel="onDel"
></ScopeTable>
<ScopeTable :tableInfo="item" :index="index" @onAdd="onAdd" @onDel="onDel"></ScopeTable>
</el-row>
</div>
<div class="foot">
<ButtonGradient
class="special-button"
style="background: rgb(229, 68, 73)"
@click.native="handleSubmit(1)"
>
<ButtonGradient class="special-button" style="background: rgb(229, 68, 73);" @click.native="handleSubmit(1)">
一键控制
</ButtonGradient>
<ButtonGradient
class="special-button"
style="background: rgb(250, 152, 56)"
@click.native="handleSubmit(2)"
>
<ButtonGradient class="special-button" style="background: rgb(250, 152, 56);" @click.native="handleSubmit(2)">
一键恢复
</ButtonGradient>
</div>
@ -31,32 +17,166 @@
</template>
<script>
import Card from "@screen/components/Card2/Card.vue";
import { merge } from "lodash";
import { provideMixin } from "./../../mixin";
import Card from "@screen/components/Card2/Card.vue";;
import ButtonGradient from "@screen/components/Buttons/ButtonGradient.vue";
import ScopeTable from "./components/ScopeTable.vue";
import { provideMixin } from "./../../mixin"
import { defaultTableInfo } from "./data";
import { Message } from 'element-ui'
import request from "@/utils/request";
export default {
name: "DeviceControl",
name: 'DeviceControl',
mixins: [provideMixin],
components: {
Card,
ScopeTable,
ButtonGradient
},
inject: ["provideData"],
data() {
return {
data: null,
};
planId: '',
tableData: []
}
},
watch: {
data() {},
},
mounted() {},
methods: {},
mounted() {
},
methods: {
detailChange(eventId) {
this.initData(this.detailData);
},
initData(eventInfo) {
console.log('eventInfo', eventInfo)
request({
url: `business/plans/list/event/type`,
method: "post",
data: { ...eventInfo }
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
let data = result.data;
if (data.length == 0) {
this.tableData = [{ ...defaultTableInfo }];
return Message.warning('该事件暂无处置预案')
};
let dcExecuteAction = data[0].dcExecuteAction || [];
this.planId = data[0].id;
let dcArr = [];
dcExecuteAction.forEach((it) => {
let action = { ...it };
if (it.executeConfig) {
let executeConfig = JSON.parse(it.executeConfig);
let execute = this.mapKeys(executeConfig, 'zx_');
action = { ...action, ...execute };
}
if (it.recoverConfig) {
let recoverConfig = JSON.parse(it.recoverConfig);
let recover = this.mapKeys(recoverConfig, 'hf_');
action = { ...action, ...recover };
}
if (it.deviceList) {
action.devList = it.deviceList
.split(",")
.map((str) => str);
}
dcArr.push(action);
});
this.tableData = dcArr.length == 0 ? [{ ...defaultTableInfo }] : dcArr;
console.log("tableData", this.tableData);
})
.catch((err) => {
console.log(err);
Message.error("查询事件预案列表失败", err);
});
},
mapKeys(obj, prefix) {
return Object.keys(obj).reduce((result, key) => {
result[`${prefix}${key}`] = obj[key];
return result;
}, {});
},
onAdd() {
this.tableData.push({ ...defaultTableInfo })
},
onDel(index) {
if (this.tableData.length <= 1) {
return Message.warning('最后一项不可删除!');
}
this.tableData.splice(index, 1)
},
handleSubmit(value = 1) {
let dcArr = [];
this.tableData.forEach(item => {
let dcData = {
deviceType: item.deviceType,
searchRule: item.searchRule,
number: item.number
}
if (item.devList && item.devList.length > 0) {
dcData.deviceList = item.devList.join(",");
}
let zxData = {}, hfData = {};
Object.keys(item).forEach(key => {
if (/^zx_/.test(key)) {
let keyName = key.substring(3);
zxData[keyName] = item[key];
}
if (/^hf_/.test(key)) {
let keyName = key.substring(3);
hfData[keyName] = item[key];
}
})
if (item.deviceType == 12) {
zxData = this.formatData(zxData);
hfData = this.formatData(hfData);
}
dcData.executeConfig = JSON.stringify(zxData);
dcData.recoverConfig = JSON.stringify(hfData);
dcArr.push(dcData);
})
let reqData = {
operationType: value, //1- 2-
dcEmergencyPlans: {
id: this.planId,
dcExecuteAction: dcArr
},
dcEvent: {
id: this.detailData.id,
eventType: this.detailData.eventType,
stakeMark: this.detailData.stakeMark,
direction: this.detailData.direction == "菏泽方向" ? '1': '3',
},
};
console.log("reqData", reqData);
// return;
request({
url: "/business/plans/event/confirm",
method: "post",
data: reqData,
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
Message.success("提交成功");
})
.catch(() => {
Message.error("提交失败");
})
},
},
}
</script>
<style lang="scss" scoped>
<style lang='scss' scoped>
.DeviceControl {
::v-deep {
.content {
@ -64,5 +184,37 @@ export default {
flex-direction: column;
}
}
.container {
height: 500px;
overflow-y: auto;
.rowBlock {
background-color: #296887;
padding: 5px 10px;
margin-bottom: 10px;
}
}
.foot {
display: flex;
justify-content: space-evenly;
margin-top: 10px;
.special-button {
width: 100px;
.icon {
background-repeat: no-repeat;
background-size: 100% 100%;
width: 20px;
height: 20px;
transition: all 0.3s linear;
}
}
}
}
</style>

3
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/index.vue

@ -80,8 +80,7 @@ export default {
})
.then((result) => {
if (result.code != 200) return;
result.data.longitude = "116.829275";
result.data.dimension = "36.583156";
this.provideData.detail = result.data;
console.log("这里是事件详情", this.provideData.detail);
if (

2
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue

@ -202,7 +202,7 @@ export default {
},
onDelete() {
if (this.formData.id) {
this.$confirm("确定误报吗?", "提示", {
this.$confirm("确定误报吗1?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",

74
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/data.js

@ -0,0 +1,74 @@
// 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";
export const searchFormList = [
{
label: "发布渠道:",
key: "publishChannels",
type: "select",
options: {
clearable: true,
options: [
{
key: "1",
label: "手机短信",
},
{
key: "2",
label: "微信公众号",
},
{
key: "3",
label: "微博",
},
{
key: "4",
label: "情报板",
},
{
key: "5",
label: "服务网站",
},
{
key: "6",
label: "微信小程序",
},
{
key: "7",
label: "语音广播",
},
],
},
},
{
label: "时间范围:",
key: "daterange",
required: false,
type: "datePicker",
options: {
type: "daterange",
format: "yyyy-MM-dd HH:mm:ss",
valueFormat: "yyyy-MM-dd HH:mm:ss",
},
},
// PresetFormItems.directionCreater("RadioGroup"),
{
label: "发布状态:",
key: "publishStatus",
type: "RadioGroup",
default: null,
options: {
options: [
{
key: '1',
label: "成功",
},
{
key: '2',
label: "失败",
},
],
},
},
];

15
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/images/delete.svg

@ -0,0 +1,15 @@
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 1142814330">
<rect id="Rectangle 3530" width="46" height="46" rx="5" fill="url(#paint0_linear_253_681)"/>
<g id="Group 1142814329">
<path id="Rectangle 3531" d="M28.2638 16.9155C28.7117 16.4652 29.4398 16.4632 29.8901 16.911C30.3405 17.3589 30.3425 18.087 29.8947 18.5373L18.542 29.9534C18.0942 30.4038 17.366 30.4058 16.9157 29.958C16.4653 29.5101 16.4633 28.782 16.9111 28.3316L28.2638 16.9155Z" fill="white"/>
<path id="Rectangle 3532" d="M18.5419 16.9155C18.094 16.4652 17.3659 16.4632 16.9155 16.911C16.4652 17.3589 16.4631 18.087 16.911 18.5373L28.2637 29.9534C28.7115 30.4038 29.4396 30.4058 29.89 29.958C30.3403 29.5101 30.3424 28.782 29.8945 28.3316L18.5419 16.9155Z" fill="white"/>
</g>
</g>
<defs>
<linearGradient id="paint0_linear_253_681" x1="22.1738" y1="8.77862" x2="22.1738" y2="44.9466" gradientUnits="userSpaceOnUse">
<stop stop-color="#005C79"/>
<stop offset="1" stop-color="#009BCC"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

7
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/images/export.svg

@ -0,0 +1,7 @@
<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#229;&#175;&#188;&#229;&#135;&#186;">
<path id="Rectangle 1282" d="M1 6V9C1 10.1046 1.89543 11 3 11H10C11.1046 11 12 10.1046 12 9V6" stroke="white" stroke-linecap="round"/>
<path id="Rectangle 1304" d="M4.00018 3.54291L6.54306 1.00003L9.08187 3.54293" stroke="white" stroke-linecap="round"/>
<path id="Line 513" d="M6.54102 8L6.54102 2" stroke="white" stroke-linecap="round"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 493 B

22
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/images/refresh.svg

@ -0,0 +1,22 @@
<svg width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 1142814398">
<g id="Group 1142814396">
<path id="Rectangle 1304" d="M1.0437 2.41495L4.5636 2.01738L4.91112 6.00562" stroke="white" stroke-linecap="round"/>
<g id="Ellipse 835">
<mask id="path-2-inside-1_290_77" fill="white">
<path d="M4.29579 2.52494C4.09359 2.27296 3.71712 2.25216 3.51748 2.50144C2.86315 3.31847 2.39514 4.30903 2.15904 5.38649C1.87758 6.67096 1.93836 8.02122 2.3337 9.26652C2.72904 10.5118 3.44118 11.5962 4.38007 12.3826C5.16561 13.0406 6.08036 13.4652 7.0411 13.6229C7.35243 13.674 7.61901 13.4293 7.63212 13.1145C7.64523 12.7997 7.39954 12.5346 7.08935 12.4765C6.32757 12.3339 5.60349 11.9884 4.97813 11.4646C4.19938 10.8124 3.6087 9.91289 3.28078 8.87998C2.95287 7.84706 2.90245 6.72709 3.13591 5.66169C3.33404 4.75752 3.72906 3.92712 4.28182 3.24492C4.4503 3.03698 4.46523 2.7361 4.29579 2.52494Z"/>
</mask>
<path d="M4.29579 2.52494C4.09359 2.27296 3.71712 2.25216 3.51748 2.50144C2.86315 3.31847 2.39514 4.30903 2.15904 5.38649C1.87758 6.67096 1.93836 8.02122 2.3337 9.26652C2.72904 10.5118 3.44118 11.5962 4.38007 12.3826C5.16561 13.0406 6.08036 13.4652 7.0411 13.6229C7.35243 13.674 7.61901 13.4293 7.63212 13.1145C7.64523 12.7997 7.39954 12.5346 7.08935 12.4765C6.32757 12.3339 5.60349 11.9884 4.97813 11.4646C4.19938 10.8124 3.6087 9.91289 3.28078 8.87998C2.95287 7.84706 2.90245 6.72709 3.13591 5.66169C3.33404 4.75752 3.72906 3.92712 4.28182 3.24492C4.4503 3.03698 4.46523 2.7361 4.29579 2.52494Z" stroke="white" stroke-width="2" mask="url(#path-2-inside-1_290_77)"/>
</g>
</g>
<g id="Group 1142814397">
<path id="Rectangle 1304_2" d="M15.0437 11.585L11.5238 11.9826L11.1763 7.99438" stroke="white" stroke-linecap="round"/>
<g id="Ellipse 835_2">
<mask id="path-4-inside-2_290_77" fill="white">
<path d="M11.7916 11.4751C11.9938 11.727 12.3703 11.7478 12.5699 11.4986C13.2242 10.6815 13.6923 9.69097 13.9284 8.61351C14.2098 7.32904 14.149 5.97878 13.7537 4.73348C13.3584 3.48817 12.6462 2.40376 11.7073 1.61737C10.9218 0.95942 10.007 0.534814 9.0463 0.377109C8.73497 0.326006 8.46839 0.570722 8.45528 0.885536C8.44218 1.20035 8.68786 1.46544 8.99805 1.5235C9.75983 1.6661 10.4839 2.01159 11.1093 2.53538C11.888 3.18765 12.4787 4.08711 12.8066 5.12002C13.1345 6.15294 13.1849 7.27291 12.9515 8.33831C12.7534 9.24248 12.3583 10.0729 11.8056 10.7551C11.6371 10.963 11.6222 11.2639 11.7916 11.4751Z"/>
</mask>
<path d="M11.7916 11.4751C11.9938 11.727 12.3703 11.7478 12.5699 11.4986C13.2242 10.6815 13.6923 9.69097 13.9284 8.61351C14.2098 7.32904 14.149 5.97878 13.7537 4.73348C13.3584 3.48817 12.6462 2.40376 11.7073 1.61737C10.9218 0.95942 10.007 0.534814 9.0463 0.377109C8.73497 0.326006 8.46839 0.570722 8.45528 0.885536C8.44218 1.20035 8.68786 1.46544 8.99805 1.5235C9.75983 1.6661 10.4839 2.01159 11.1093 2.53538C11.888 3.18765 12.4787 4.08711 12.8066 5.12002C13.1345 6.15294 13.1849 7.27291 12.9515 8.33831C12.7534 9.24248 12.3583 10.0729 11.8056 10.7551C11.6371 10.963 11.6222 11.2639 11.7916 11.4751Z" stroke="white" stroke-width="2" mask="url(#path-4-inside-2_290_77)"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

262
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/index.vue

@ -0,0 +1,262 @@
<template>
<div class='board_record'>
<!-- 搜索栏 -->
<div class="filter">
<div>
<ButtonGradient @click="onExport">
<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>
<!-- 内容 -->
<Table :data="tableData" height="100%" style="width:500">
<el-table-column label="序号" type="index" :index="indexMethod" width="100" align="center"
header-align="center" />
<ElTableColumn label="发布渠道" prop="publishChannels" width="120" align="center" header-align="center">
<template slot-scope="scope">
{{ enum_channels[scope.row.publishChannels-1] }}
</template>
</ElTableColumn>
<ElTableColumn label="发布时间" prop="publishTime" align="center" width="200" header-align="center" />
<ElTableColumn label="位置/设备" prop="position" align="center" width="200" header-align="center" />
<ElTableColumn label="发布内容" prop="contentDetails" align="center" header-align="center" />
<ElTableColumn label="发布人" prop="publisher" width="120" align="center" header-align="center" />
<ElTableColumn label="操作" prop="status" width="100" align="center" header-align="center">
<template slot-scope="scope">
<i class="el-icon-delete" style="font-size: 12px; color:#ff0000;" @click="onDelete(scope.row.id)"></i>
</template>
</ElTableColumn>
</Table>
<!-- 分页 -->
<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>
</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} from '@screen/utils/enum.js';
import InputSearch from "@screen/components/InputSearch/index.vue";
import { searchFormList } from "./data";
import moment from "moment";
import { Loading } from 'element-ui';
export default {
name: 'boardRecord',
components: {
ButtonGradient,
Pagination,
Table,
BoardRecordPreview,
InputSearch
},
data() {
return {
DirectionTypes,
moment,
enum_channels: [
'手机短信',
'微信公众号',
'微博',
'情报板',
'服务网站',
'微信小程序',
'语音广播'
],
tableData: [],
searchFormList,
isShowPhrases: false,
isShowDisposal: false,
total: 20,
eventType: 1,
searchData: {
pageSize: 20,
pageNum: 1
},
phrasesData: [],
process: []
}
},
created() {
this.initData();
},
methods: {
onRefreshForm(){
this.searchData.pageNum = 1;
this.$refs.searchComp.handleResetForm();
},
onDelete(id){
const self = this;
this.$confirm("是否删除?"+id, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
request({
url: `/business/manage/`+id,
method: "DELETE",
data: {},
}).then((result) => {
console.log(result)
if (result.code != 200) return self.$message.error(result?.msg);
self.$message.success('删除成功');
self.initData();
});
})
},
onExport(){
const self = this;
this.$confirm("是否确认导出共计查询内容?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
let loadingInstance = Loading.service({
fullscreen: true,
background: "#00000052",
text: "文件正在下载...",
});
request({
url: `/business/manage/export`,
method: "post",
data: self.searchData,
responseType: 'blob',
}).then((res) => {
console.log(res)
const url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "事件信息列表.xlsx");
document.body.appendChild(link);
link.click();
URL.revokeObjectURL(link.href); // URL
document.body.removeChild(link);
link = null;
loadingInstance.close();
})
.catch((err) => {
self.$message.error(err);
loadingInstance.close();
});
})
},
handleSearch(data) {
let daterange = data.daterange;
let _searchData = {
pageSize: 20,
pageNum: 1
}
if(daterange && daterange.length > 0){
_searchData.startTime = daterange[0];
_searchData.endTime = daterange[1];
}
if(data.publishChannels){
_searchData.publishChannels = data.publishChannels
}
if(data.publishStatus){
_searchData.publishStatus = data.publishStatus
}
this.searchData = _searchData;
this.initData();
},
indexMethod(index) {
return this.searchData.pageSize*(this.searchData.pageNum-1) + index + 1;
},
formatterDirection(row, column) {
return DirectionTypes[row.direction];
},
initData() {
request({
url: `/business/manage/statisticsList`,
method: "post",
data: this.searchData,
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
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>
.board_record {
padding: 0 14px 14px;
width:100%;
height: 100%;
display: flex;
flex-direction: column;
.filter {
height: 60px;
display: flex;
justify-content: space-between;
align-items: center;
>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>

6
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/index.vue

@ -15,7 +15,9 @@
<PostTrendsDay class="unit" />
</div>
</el-tab-pane>
<el-tab-pane label="公众服务统计查询" name="second" class="con_tab"> </el-tab-pane>
<el-tab-pane label="公众服务统计查询" name="second" class="con_tab">
<Record />
</el-tab-pane>
</el-tabs>
</div>
@ -29,10 +31,12 @@ import AuditAnalytics from "./components/auditAnalytics";
import PostTrendsDay from "./components/postTrendsDay";
import PostTrendsMonth from "./components/postTrendsMonth";
import NucleusThrough from "./components/nucleusThrough";
import Record from "./components/record";
export default {
name: "publicService",
components: {
Record,
TopComponent,
ChannelAnalytics,
EventTypeAnalysis,

Loading…
Cancel
Save