替换提示接口

This commit is contained in:
Iruka 2025-02-19 18:28:55 +08:00
parent a50dba0f2b
commit dad848b4c3
14 changed files with 52 additions and 42 deletions

View File

@ -1,5 +1,5 @@
<script>
// import '@/static/font/iconfont.js'
import plugins from "@/plugins";
import indexUtil from "@/utils/indexUtil/index.js"
import {
deviceControl,
@ -203,7 +203,7 @@
break;
default:
//
this.$toast(params.message)
plugins.modal.msg(params.message)
break;
}
},

View File

@ -67,6 +67,7 @@
getToken
} from '@/utils/auth'
import * as loginJS from '@/utils/login.js'
import plugins from "@/plugins";
import config from '@/config.js'
const appInfo = config.appInfo;
const showPop = ref(false);
@ -82,7 +83,7 @@
});
}).catch(error => {
reLogin.value = true;
proxy.$toast(error);
plugins.modal.msg(error)
})
}).catch(error => {
showPop.value = true;

View File

@ -79,6 +79,7 @@
<script>
import store from '@/store'
const user = store.state.user.user;
import plugins from "@/plugins";
import {
woSort
} from "@/utils/woSort"
@ -201,7 +202,7 @@
if (Object.keys(this.select.newV).length) {
this.$refs.inputDialog.open()
} else {
this.$toast("请选择出水口")
plugins.modal.msg("请选择出水口")
}
},
close() {
@ -210,7 +211,7 @@
confirm() {
if (!this.groupItem.groupName) {
this.$nextTick(() => {
this.$toast("请输入方案名称!")
plugins.modal.msg("请输入方案名称!")
})
return;
}
@ -269,7 +270,7 @@
uni.navigateBack();
});
} else {
that.$toast("请选择出水口")
plugins.modal.msg("请选择出水口")
}
},
},

View File

@ -68,6 +68,7 @@
</z-paging>
</template>
<script>
import plugins from "@/plugins";
import * as isApi from '@/api/irrigate/irrigateScenario.js'
export default {
@ -133,7 +134,7 @@
this.$showConfirm(`删除"${item.groupName}"?`).then(res => {
isApi.removeBatchControl(item.id).then(res => {
this.queryList();
this.$toast("删除成功")
plugins.modal.msg("删除成功")
});
}).catch(() => {});
},
@ -144,7 +145,7 @@
isApi.batchControlExec(isMemory, item.id).then(res => {
this.disabled = false;
if (res.data && res.data.length) {
this.$toast(`"${res.data.toString()}"以上阀门执行异常`)
plugins.modal.msg(`"${res.data.toString()}"以上阀门执行异常`)
}
uni.showModal({
title: '开阀完成',
@ -164,7 +165,7 @@
isApi.batchControlClose(item.id).then(res => {
this.disabled = false;
if (res.data && res.data.length) {
this.$toast(`"${res.data.toString()}"以上阀门执行异常`)
plugins.modal.msg(`"${res.data.toString()}"以上阀门执行异常`)
}
uni.showModal({
title: '关阀完成',
@ -183,7 +184,7 @@
this.disabled = true;
isApi.saveBatchControlAngle(item.id).then(res => {
this.disabled = false;
this.$toast("记忆成功");
plugins.modal.msg("记忆成功")
this.queryList();
});
}).catch(() => {});

View File

@ -80,6 +80,7 @@
<script>
import store from '@/store'
const user = store.state.user.user;
import plugins from "@/plugins";
import * as isApi from '@/api/irrigate/irrigateScenario.js'
import {
getLandUser
@ -152,7 +153,7 @@
ids: this.scenarioCheck,
shareUserIds: this.userCheck.join(',')
}).then(res => {
this.$toast("分享成功")
plugins.modal.msg("分享成功")
this.cancel();
});
},

View File

@ -663,7 +663,7 @@
sendTopoList(item) {
this.$showConfirm("下发列表").then(res => {
DevOpsApi.gvl(item.deviceCode).then(res => {
this.$toast(res.msg)
plugins.modal.msg(res.msg)
})
}).catch(() => {});
},
@ -678,7 +678,7 @@
getStationConfig(item) {
this.$showConfirm("获取配置").then(res => {
DevOpsApi.gsc(item.deviceCode).then(res => {
this.$toast(res.msg)
plugins.modal.msg(res.msg)
})
}).catch(() => {});
},
@ -700,7 +700,7 @@
upgradeStation(item) {
this.$showConfirm(`升级"${item.deviceCode}"到"${item.newVersionName}"版本?`).then(res => {
DevOpsApi.upgradeStation(item.deviceCode, item.newDeviceVersionId).then(res => {
this.$toast(res.msg)
plugins.modal.msg(res.msg)
})
}).catch(() => {});
},
@ -716,7 +716,7 @@
return;
}
// if (this.rolaFrequency.item.rolaFrequency == this.rolaFrequency.rolaFrequency) {
// this.$toast("")
// plugins.modal.msg("")
// return;
// }
let msg = `您确定要修改【${this.rolaFrequency.item.deviceCode }】的频段为【${this.rolaFrequency.new}】?`;
@ -726,7 +726,7 @@
oldFrequency: this.rolaFrequency.old,
newFrequency: this.rolaFrequency.new
}).then(res => {
this.$toast(res.msg)
plugins.modal.msg(res.msg)
})
}).catch(() => {
this.pop.rolaFrequency = true;
@ -746,7 +746,7 @@
upgradeValve4(item) {
this.$showConfirm(`升级"${item.deviceCode}"到"${item.newVersionName}"版本?`).then(res => {
DevOpsApi.upgradeValve4G(item.deviceCode, item.newDeviceVersionId).then(res => {
this.$toast(res.msg)
plugins.modal.msg(res.msg)
})
}).catch(() => {});
},

View File

@ -88,6 +88,7 @@
</custom-popup>
</template>
<script>
import plugins from "@/plugins";
import * as DevOpsApi from "@/api/dev-ops/index.js"
export default {
@ -190,7 +191,7 @@
sendList(item) {
this.$showConfirm("下发列表").then(res => {
DevOpsApi.gvl(item.deviceCode).then(res => {
this.$toast(res.msg)
plugins.modal.msg(res.msg)
})
}).catch(() => {});
},
@ -205,7 +206,7 @@
getConfig(item) {
this.$showConfirm("获取配置").then(res => {
DevOpsApi.gsc(item.deviceCode).then(res => {
this.$toast(res.msg)
plugins.modal.msg(res.msg)
})
}).catch(() => {});
},
@ -227,7 +228,7 @@
upgrade(item) {
this.$showConfirm("基站升级").then(res => {
DevOpsApi.stationUpgrade(item.deviceCode, item.newDeviceVersionId).then(res => {
this.$toast(res.msg)
plugins.modal.msg(res.msg)
})
}).catch(() => {});
},
@ -246,7 +247,7 @@
return;
}
// if (this.rolaFrequency.item.rolaFrequency == this.rolaFrequency.rolaFrequency) {
// this.$toast("")
// plugins.modal.msg("")
// return;
// }
let msg = `您确定要修改【${this.rolaFrequency.item.deviceCode }】的频段为【${this.rolaFrequency.new}】?`;
@ -256,7 +257,7 @@
oldFrequency: this.rolaFrequency.old,
newFrequency: this.rolaFrequency.new
}).then(res => {
this.$toast(res.msg)
plugins.modal.msg(res.msg)
})
}).catch(() => {
this.pop.rolaFrequency = true;

View File

@ -204,7 +204,7 @@
getConfig(item) {
this.$showConfirm("获取配置").then(res => {
DevOpsApi.gvc(item.device.deviceCode).then(res => {
this.$toast(res.msg)
plugins.modal.msg(res.msg)
})
}).catch(() => {});
},
@ -220,7 +220,7 @@
return;
}
// if (this.rolaFrequency.item.rolaFrequency == this.rolaFrequency.rolaFrequency) {
// this.$toast("")
// plugins.modal.msg("")
// return;
// }
let msg = `您确定要修改【${this.rolaFrequency.item.deviceCode}】的频段为【${this.rolaFrequency.new}】?`;
@ -231,7 +231,7 @@
oldFrequency: this.rolaFrequency.old,
newFrequency: this.rolaFrequency.new
}).then(res => {
this.$toast(res.msg)
plugins.modal.msg(res.msg)
})
}).catch(() => {
this.pop.rolaFrequency = true;

View File

@ -461,6 +461,7 @@
<custom-index-mp ref="mpRef" @topic="mpTopic" />
</template>
<script>
import plugins from "@/plugins";
import config from '@/config.js'
const appInfo = config.appInfo;
import store from "@/store"
@ -728,7 +729,7 @@
mapRanging() {
if (this.mapObj.ranging) {
this.mapObj.ranging = false;
this.$toast("测距已关闭")
plugins.modal.msg("测距已关闭")
return;
}
this.$showConfirm(`开启测距,开启后再次点击关闭。`).then(res => {
@ -766,7 +767,7 @@
console.error("this.pop.item:", this.pop.item);
this.openPopup();
} else {
this.$toast("未绑定设备!");
plugins.modal.msg("未绑定设备!");
}
break;
case 'sfj':
@ -815,7 +816,7 @@
`/pages/fourmonitor/spore?item=${encodeURIComponent(JSON.stringify(res.data))}`;
} else if (res.data.deviceTypeId === 9) {
if (!res.data.ezopenUrl1 || !res.data.ezopenUrl2) {
this.$toast("获取播放地址失败!")
plugins.modal.msg("获取播放地址失败!")
return;
}
url =

View File

@ -554,6 +554,7 @@
<script>
import store from "@/store"
import plugins from "@/plugins";
import * as imageAssets from '@/utils/indexUtil/imageAssets.js'
export default {
@ -663,7 +664,7 @@
if (ret.resp_code == 1000) {
const deviceCode = ret.resp_result;
// showModal.value = true
this.$toast(JSON.stringify(deviceCode))
plugins.modal.msg(JSON.stringify(deviceCode))
}
})
})
@ -679,7 +680,7 @@
this.refreshAllDisabled = false;
}, 60 * 1000)
this.ijs.refreshAll().then(res => {
this.$toast("一键刷新成功")
plugins.modal.msg("一键刷新成功")
})
},
//

View File

@ -103,6 +103,7 @@
</template>
<script>
import plugins from "@/plugins";
import useUserStore from '@/store/modules/user'
const permissions = useUserStore.state.permissions
import * as taskApi from '@/api/irrigate/task.js'
@ -197,7 +198,7 @@
delTask(item) {
this.$showConfirm(`删除"${item.taskName}"?`).then(() => {
taskApi.delTask(item.id).then(res => {
this.$toast("删除成功");
plugins.modal.msg("删除成功")
this.reload();
}).catch(err => {
this.$showConfirm(err, false).then(() => {
@ -237,14 +238,14 @@
if (disabled) {
this.$showConfirm(`禁用"${item.scenarioName}"?`).then(() => {
isApi.disabled(item.id).then(res => {
this.$toast("禁用成功");
plugins.modal.msg("禁用成功")
this.reload();
})
}).catch(() => {});
} else {
this.$showConfirm(`启用"${item.scenarioName}"?`).then(() => {
isApi.enable(item.id).then(res => {
this.$toast("启用成功");
plugins.modal.msg("启用成功")
this.reload();
})
}).catch(() => {});

View File

@ -164,6 +164,7 @@
<script>
import store from '@/store'
import plugins from "@/plugins";
const user = store.state.user.user;
import {
woSort
@ -333,7 +334,7 @@
//
groupPopClose() {
if (this.selectIndex) {
this.$toast("请选择操作的轮灌组")
plugins.modal.msg("请选择操作的轮灌组")
return;
}
this.groupPop = false;
@ -518,7 +519,7 @@
//
this.selectIndex = true;
this.$toast("删除成功,轮灌组重新排序")
plugins.modal.msg("删除成功,轮灌组重新排序")
}).catch(() => {
this.groupPop = true;
});
@ -548,7 +549,7 @@
}
})
if (title) {
this.$toast(`"${title}"未选择出水口`)
plugins.modal.msg(`"${title}"未选择出水口`)
return;
}
formData.groups.forEach((item, index) => {

View File

@ -65,6 +65,7 @@
</template>
<script>
import plugins from "@/plugins";
import * as taskApi from '@/api/irrigate/task.js'
export default {
@ -110,7 +111,7 @@
id: this.task.id,
status: status
}).then(res => {
this.$toast("删除成功");
plugins.modal.msg("删除成功")
this.loadData();
}).catch(err => {
this.$showConfirm(err, false).then(() => {

View File

@ -174,7 +174,7 @@
//
function forgotPassword() {
proxy.$toast("忘记密码,请联系售后人员");
plugins.modal.msg("忘记密码,请联系售后人员")
}
const codeBtnText = ref('获取验证码');
@ -187,7 +187,7 @@
}
//
if (!checkTelephone(loginForm.value.phone)) {
proxy.$toast("请输入正确手机号!");
plugins.modal.msg("请输入正确手机号!");
return
}
codeBtnDisabled.value = true;
@ -198,7 +198,7 @@
getCodePhone(loginForm.value.phone).then(res => {
uni.hideLoading()
if (res.smsResponse) {
proxy.$toast("短信已发送");
plugins.modal.msg("短信已发送");
loginForm.value.uuid = res.uuid
codeBtnTimer.value = 60
setCodeTimer();
@ -241,7 +241,7 @@
//
async function handleLogin() {
// if (!checkboxGroup.value.length) {
// proxy.$toast("");
// plugins.modal.msg("");
// return;
// }
let loginObj = Object.assign({}, loginForm.value);
@ -288,7 +288,7 @@
if (error === 'error409') {
forceLogin();
} else {
proxy.$toast(error);
plugins.modal.msg(error);
}
})
}