diff --git a/src/utils/api/index.js b/src/utils/api/index.js
index faee4ad..57e7640 100644
--- a/src/utils/api/index.js
+++ b/src/utils/api/index.js
@@ -201,3 +201,12 @@ export function upgradeDeleteApi(data) {
},
});
}
+
+//send发送短信
+export function sendMsgApi(data) {
+ return request({
+ url: "/xymanager/sms/send",
+ method: "post",
+ data,
+ });
+}
diff --git a/src/views/homePage/components/tableMain.vue b/src/views/homePage/components/tableMain.vue
index 6d3d112..c4b4b5c 100644
--- a/src/views/homePage/components/tableMain.vue
+++ b/src/views/homePage/components/tableMain.vue
@@ -16,6 +16,9 @@
下发命令
+
+ 发送短信
+
@@ -1082,6 +1085,34 @@
确 定
+
+
+
+
+
+
+
+ -
+ {{ item.name }}{{ item.value }}
+
+
+
+
+
@@ -1091,6 +1122,7 @@ import {
getCmdActionApi,
upgradeListApi,
updCommentApi,
+ sendMsgApi,
} from "@/utils/api/index";
import rowMsgDialog from "./rowMsgDialog.vue";
import htmlToExcel from "@/utils/htmlToExcel";
@@ -1518,6 +1550,28 @@ export default {
},
],
},
+ senMsgVisible: false,
+ sendForm: {
+ msginfo: "",
+ },
+ sendOption: [
+ {
+ name: "重启系统1:",
+ value: "yw-at-stw21=1",
+ },
+ {
+ name: "重启系统2:",
+ value: "at-stw21=1",
+ },
+ {
+ name: "重启MpApp:",
+ value: "at-restart=mpapp",
+ },
+ {
+ name: "重启MpMaster格式:",
+ value: "at-restart=mpmaster",
+ },
+ ],
};
},
mounted() {
@@ -1541,6 +1595,7 @@ export default {
// 数据发生变化时的处理逻辑
console.log("数据已更新:", newVal);
this.getNumber();
+ // this.$refs.ywMultipleTable.clearSelection();
this.$nextTick(() => {
this.startCountdown(); // 确保在 DOM 更新后执行
});
@@ -1551,6 +1606,8 @@ export default {
},
created() {
this.getCmdOptionsFun();
+ // this.multipleSelection = [];
+ // this.idArray = [];
},
methods: {
//获取命令列表
@@ -1559,7 +1616,6 @@ export default {
.then((res) => {
console.log(res);
this.operateOptions = res.data;
- //this.operateOptions = this.operateOptions.concat(res.data);
})
.catch((err) => {});
},
@@ -2005,12 +2061,72 @@ export default {
return;
case 15:
console.log("推送大文件");
-
this.configVisible = true;
this.getconfigList();
return;
}
},
+ //下发短信
+ sendMsg() {
+ if (this.multipleSelection.length == 1) {
+ console.log(this.multipleSelection);
+
+ this.senMsgVisible = true;
+ } else {
+ this.$message({
+ duration: 1500,
+ showClose: true,
+ message: "只能选中一个设备",
+ type: "warning",
+ });
+ return;
+ }
+ },
+ handleSend(item) {
+ console.log(item);
+ let params = {
+ termId: this.multipleSelection[0].id,
+ 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: item.name + "下发成功",
+ type: "success",
+ });
+
+ this.senMsgVisible = false;
+ }
+ })
+ .catch((err) => {});
+ },
+ //自定义输入
+ handlemsgSend() {
+ let params = {
+ termId: this.multipleSelection[0].id,
+ content: this.sendForm.msginfo,
+ };
+ 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) => {});
+ },
//执行操作
changeIssue(params) {
cmdSendApi(params)
@@ -2890,6 +3006,19 @@ export default {
}
}
}
+ .senMsgDialog {
+ ul {
+ li {
+ list-style: none;
+ font-size: 13px;
+ line-height: 22px;
+ cursor: pointer;
+ &:hover {
+ background-color: #b9e2dd;
+ }
+ }
+ }
+ }
}
.contenBoxMsg {
p {
diff --git a/vue.config.js b/vue.config.js
index dee3a84..6dd67f0 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -20,7 +20,7 @@ module.exports = defineConfig({
proxy: {
"/api": {
//表示拦截以/api开头的请求路径
- //target: "http://61.169.135.146:40101/", //
+ // target: "http://61.169.135.146:40101/", //
target: "http://61.169.135.146:40085/", //dell
changOrigin: true, //是否开启跨域
pathRewrite: {