添加短信查询功能

jcbranch
fanluyan 11 months ago
parent 6ef6ce58b9
commit c7025b1c05

@ -37,7 +37,10 @@ export default {
path: "/activity",
name: "活动列表",
},
{
path: "/msgAuth",
name: "短信授权",
},
// {
// path: "/deviceConfig",
// name: "",

@ -70,6 +70,15 @@ const routes = [
keepAlive: true,
},
},
{
path: "/msgAuth",
component: () => import("../views/msgAuth/index.vue"),
name: "msgAuth",
meta: {
title: "短信授权",
keepAlive: true,
},
},
{
path: "/deviceConfig",
component: () => import("../views/deviceConfig/index.vue"),

@ -216,8 +216,23 @@ export function msglistApi(data) {
url: "/xymanager/sms/list",
method: "get",
params: data,
// headers: {
// "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
// },
});
}
//查询授权
export function getAuthApi(data) {
return request({
url: "/xymanager/sms/getAuth",
method: "get",
params: data,
});
}
//提交授权
export function updateAuthApi(data) {
return request({
url: "/xymanager/sms/updateAuth",
method: "post",
data,
});
}

@ -0,0 +1,232 @@
<template>
<el-dialog
title="短信回复列表"
:visible.sync="msgisShow"
:close-on-click-modal="false"
width="1366px"
class="MsginfoDialog"
@close="handleclose"
>
<div class="msgTbale">
<div class="msgHead">
<el-descriptions :column="4" border size="small">
<el-descriptions-item label="装置编号">{{
termInfo.cmdid
}}</el-descriptions-item>
<el-descriptions-item label="iccid">{{
termInfo.iccid
}}</el-descriptions-item>
<el-descriptions-item label="运营商">{{
msgCompany
}}</el-descriptions-item>
<el-descriptions-item label="规约">{{
termInfo.protocolName
}}</el-descriptions-item>
</el-descriptions>
</div>
<div class="tableBox">
<!-- 大汉移动 -->
<el-table
v-if="msgtype == 1"
:data="msgListData"
style="width: 100%"
border
>
<el-table-column prop="phone" label="物联卡号码或手机号码">
</el-table-column>
<el-table-column prop="smsType" label="短信类型" width="80px">
<template slot-scope="scope">
<span v-if="scope.row.smsType == 1"></span>
<span v-if="scope.row.smsType == 2"></span>
</template>
</el-table-column>
<el-table-column prop="content" label="短信内容"> </el-table-column>
<el-table-column prop="submitState" label="提交状态" width="80px">
<template slot-scope="scope">
<span v-if="scope.row.submitState == 0"></span>
<span v-else>{{ cope.row.submitState }}</span>
</template>
</el-table-column>
<el-table-column prop="sendState" label="发送状态" width="120px">
<template slot-scope="scope">
<span v-if="scope.row.sendState == 2"></span>
<span v-else-if="scope.row.sendState == 0">发送成功</span>
<span v-else>{{ cope.row.sendState }}</span>
</template>
</el-table-column>
<el-table-column prop="submitTime" label="提交时间">
</el-table-column>
<el-table-column prop="receiveTime" label="接收/报告时间">
</el-table-column>
</el-table>
<!-- 公田移动rabchase -->
<el-table
v-if="msgtype == 2"
:data="msgListData.list"
style="width: 100%"
border
>
<el-table-column prop="iccid" label="ICCID"> </el-table-column>
<el-table-column prop="msisdn" label="MSISDN"> </el-table-column>
<el-table-column prop="tenantName" label="企业名称">
</el-table-column>
<el-table-column prop="msg" label="短信内容"> </el-table-column>
<el-table-column prop="createTime" label="接收时间">
</el-table-column>
</el-table>
<!-- 公田m2m10086 -->
<el-table
v-if="msgtype == 3"
:data="msgListData.records"
style="width: 100%"
border
>
<el-table-column prop="isSend" label="短信类型" width="80px">
<template slot-scope="scope">
<span v-if="scope.row.isSend == 0">->终端 </span>
<span v-if="scope.row.isSend == 1">->平台</span>
</template>
</el-table-column>
<el-table-column prop="sender" label="发送方"> </el-table-column>
<el-table-column prop="receive" label="接收方"> </el-table-column>
<el-table-column prop="smsContent" label="内容"> </el-table-column>
<el-table-column prop="smsSendStatus" label="状态" width="80px">
<template slot-scope="scope">
<span v-if="scope.row.smsSendStatus == '0'"></span>
<span v-if="scope.row.smsSendStatus == '1'"></span>
<span v-if="scope.row.smsSendStatus == '2'"></span>
</template>
</el-table-column>
<el-table-column prop="smsType" label="发送类型" width="80px">
<template slot-scope="scope">
<span v-if="scope.row.smsType == 1"></span>
<span v-else>{{ scope.row.smsType }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="提交时间">
</el-table-column>
<el-table-column prop="smsReportTime" label="实际接收时间">
<template slot-scope="scope">
<span v-if="scope.row.smsReportTime">{{
scope.row.smsReportTime
}}</span>
<span v-else>-</span>
</template>
</el-table-column>
</el-table>
<!-- 安徽 -->
<div class="anhui" v-if="msgtype == 4">
<iframe
:srcdoc="modifiedMsgListData"
style="width: 100%; height: 380px; border: none"
class="iframeBox"
></iframe>
<!-- <iframe
src="/wulw/message/history"
style="width: 100%; height: 500px; border: none"
></iframe> -->
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="msgisShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
export default {
props: ["msgListData", "msgCompany", "multipleSelection", "msgtype"],
components: {},
data() {
return {
msgisShow: false,
termInfo: "",
modifiedMsgListData: "", //css
};
},
mounted() {},
computed: {},
watch: {},
created() {},
methods: {
display() {
console.log(this.multipleSelection);
this.msgisShow = true;
this.termInfo = this.multipleSelection[0];
//
if (this.msgtype == 4) {
// DOM
const parser = new DOMParser();
// HTML
const doc = parser.parseFromString(this.msgListData, "text/html");
console.log(doc);
// <div>
const divToRemove = doc.getElementsByClassName("larry-personal");
while (divToRemove.length > 0) {
// elements[elements.length - 1]
//
divToRemove[divToRemove.length - 1].parentNode.removeChild(
divToRemove[divToRemove.length - 1]
);
}
// HTML
console.log(doc.documentElement.outerHTML);
//console.log(this.msgListData);
this.modifiedMsgListData = doc.documentElement.outerHTML
.replace(
/\/wulw\/static\/layui\/css\/layui\.css\?v=26/g,
"https://www.lwwlkj.com/wulw/static/layui/css/layui.css?v=26"
)
.replace(
/\/wulw\/static\/bootstrap\/css\/bootstrap\.css/g,
"https://www.lwwlkj.com/wulw/static/bootstrap/css/bootstrap.css"
)
.replace(
/\/wulw\/static\/css\/personal\.css\?v=26/g,
"https://www.lwwlkj.com/wulw/static/css/personal.css?v=26"
)
.replace(
/\/wulw\/static\/css\/global\.css\?v=26/g,
"https://www.lwwlkj.com/wulw/static/css/global.css?v=26"
);
console.log(this.modifiedMsgListData);
}
},
handleclose() {
this.msgisShow = false;
},
},
};
</script>
<style lang="less">
.MsginfoDialog {
.el-dialog__body {
padding: 12px;
.msgTbale {
.msgHead {
margin-bottom: 8px;
}
}
.tableBox {
.el-table__cell {
text-align: center;
.cell {
padding: 0px;
}
}
.anhui {
iframe {
background-color: #fcc;
.larry-personal {
display: none;
}
}
}
}
}
}
</style>

@ -1142,10 +1142,19 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="senMsgVisible = false"> </el-button>
<el-button type="primary" @click="handlemsgSend"></el-button>
<el-button type="primary" @click="handlemsgSend"></el-button>
<el-button type="primary" @click="handlemsgList"></el-button>
</div>
</el-dialog>
<!-- 短信接收记录 -->
<msgList
ref="msglistRef"
:msgtype="msgtype"
:msgListData="msgListData"
:msgCompany="msgCompany"
:multipleSelection="multipleSelection"
></msgList>
</div>
</template>
@ -1159,6 +1168,7 @@ import {
msglistApi,
} from "@/utils/api/index";
import rowMsgDialog from "./rowMsgDialog.vue";
import msgList from "./msglist.vue";
import htmlToExcel from "@/utils/htmlToExcel";
import { saveAs } from "file-saver";
import XLSX from "xlsx";
@ -1173,6 +1183,7 @@ export default {
],
components: {
rowMsgDialog,
msgList,
},
data() {
//ip
@ -1606,6 +1617,15 @@ export default {
value: "at-restart=mpmaster",
},
],
msgListData: [], //
msgCompany: "", //
msgtype: "", //
companyMap: {
1: "大汉移动",
2: "公田移动rabchase",
3: "公田m2m10086",
4: "安徽",
},
};
},
mounted() {
@ -2116,26 +2136,7 @@ export default {
},
handleSend(item) {
console.log(item);
let params = {
termIdList: this.idArray,
content: item.value,
};
sendMsgApi(params)
.then((res) => {
console.log(res);
if (res.code == 200) {
this.$refs.ywMultipleTable.clearSelection();
this.$message({
duration: 1500,
showClose: true,
message: "短信下发成功",
type: "success",
});
this.senMsgVisible = false;
}
})
.catch((err) => {});
this.sendForm.msginfo = item.value;
},
//
handlemsgSend() {
@ -2167,6 +2168,26 @@ export default {
.then((res) => {
console.log(res);
if (res.code == 200) {
if (res.data !== null) {
this.msgListData = res.data.data;
this.msgCompany = this.companyMap[res.data.type];
this.msgtype = res.data.type;
this.$refs.msglistRef.display();
} else {
this.$message({
duration: 1500,
showClose: true,
message: this.companyMap[res.data.type] + "暂无短信记录",
type: "warning",
});
}
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.msg,
type: "error",
});
}
})
.catch((err) => {});

@ -0,0 +1,168 @@
<template>
<div class="msgAuthBox">
<!-- {{ authInfo }} -->
<div class="authInfoBox" v-loading="authloading">
<div class="rabchaser textAreaBox">
<h4>公田rabchaser的Authorization</h4>
<el-input
type="textarea"
:rows="5"
placeholder="请输入内容"
v-model="rabchaser"
>
</el-input>
</div>
<div class="dahan textAreaBox">
<h4>大汉dahan的Cookie</h4>
<el-input
type="textarea"
:rows="5"
placeholder="请输入内容"
v-model="dahan"
>
</el-input>
</div>
<div class="m2m10086 textAreaBox">
<h4>公田m2m10086的Cookie</h4>
<el-input
type="textarea"
:rows="5"
placeholder="请输入内容"
v-model="m2m10086"
>
</el-input>
</div>
<div class="lwwlkj textAreaBox">
<h4>安徽lwwlkj的Cookie</h4>
<el-input
type="textarea"
:rows="5"
placeholder="请输入内容"
v-model="lwwlkj"
>
</el-input>
</div>
<div class="btngrop">
<el-button type="primary" class="authbtn" @click="refresh"
>刷新</el-button
>
<el-button type="primary" class="authbtn" @click="authGo"
>授权</el-button
>
</div>
</div>
</div>
</template>
<script>
import { getAuthApi, updateAuthApi } from "@/utils/api/index";
export default {
name: "msgauth",
components: {},
data() {
return {
authloading: true,
authInfo: "",
rabchaser: "",
dahan: "",
m2m10086: "",
lwwlkj: "",
};
},
computed: {},
watch: {},
mounted() {
this.getAuthfn();
},
methods: {
getAuthfn() {
this.authloading = true;
getAuthApi()
.then((res) => {
console.log(res);
if (res.code == 200) {
this.authloading = false;
this.authInfo = res.data;
this.rabchaser = res.data.rabchaser;
this.dahan = res.data.dahan;
this.m2m10086 = res.data.m2m10086;
this.lwwlkj = res.data.lwwlkj;
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.msg,
type: "error",
});
this.authloading = false;
}
})
.catch((err) => {});
},
//
authGo() {
this.authloading = true;
updateAuthApi({
rabchaser: this.rabchaser,
dahan: this.dahan,
m2m10086: this.m2m10086,
lwwlkj: this.lwwlkj,
})
.then((res) => {
console.log(res);
if (res.code == 200) {
this.authloading = false;
this.$message({
duration: 1500,
showClose: true,
message: "短信授权成功",
type: "success",
});
this.getAuthfn();
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.msg,
type: "error",
});
this.authloading = false;
}
})
.catch((err) => {});
},
//
refresh() {
this.getAuthfn();
},
},
};
</script>
<style lang="less">
.msgAuthBox {
height: calc(100% - 24px);
width: calc(100% - 24px);
padding: 12px;
.authInfoBox {
width: 100%;
display: flex;
flex-direction: column;
.textAreaBox {
display: flex;
margin-bottom: 16px;
justify-content: space-between;
h4 {
width: 100px;
}
}
.btngrop {
// display: flex;
margin-left: auto;
.authbtn {
width: 80px;
}
}
}
}
</style>

@ -260,8 +260,8 @@ export default {
const minutes = Math.floor(difference / 60000);
const seconds = Math.floor((difference % 60000) / 1000);
if (minutes == 0 && seconds == 0) {
this.getCmdList();
this.getEndList();
// this.getCmdList();
// this.getEndList();
return `命令已下发`;
} else {
return ` 预估剩余:${minutes} 分钟 ${seconds}`;

@ -21,7 +21,7 @@ module.exports = defineConfig({
"/api": {
//表示拦截以/api开头的请求路径
// target: "http://61.169.135.146:40101/", //
//target: "http://61.169.135.146:40080/", //dell
// target: "http://61.169.135.146:40080/", //dell
target: "http://61.169.135.146:40085/", //运维
//target: "http://192.168.50.197:8093/", //java本地后端
changOrigin: true, //是否开启跨域

Loading…
Cancel
Save