From 8304fc43850daba13cfbec989e554d720ab62ca4 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期三, 20 九月 2023 08:15:50 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
---
springboot-vue3/src/main/java/com/example/springboot/controller/UserController.java | 2
CanadaMes-ui/src/views/Electrical/Action.vue | 33 ++++++++++++++++
CanadaMes-ui/src/views/Electrical/Parameter.vue | 28 +++++++++++++
CanadaMes-ui/src/lang/locales/en-US.json | 3 +
CanadaMes-ui/src/lang/locales/zh-CN.json | 3 +
5 files changed, 64 insertions(+), 5 deletions(-)
diff --git a/CanadaMes-ui/src/lang/locales/en-US.json b/CanadaMes-ui/src/lang/locales/en-US.json
index 2dfc7f6..467713e 100644
--- a/CanadaMes-ui/src/lang/locales/en-US.json
+++ b/CanadaMes-ui/src/lang/locales/en-US.json
@@ -278,6 +278,7 @@
"No":"No",
"Please enter the password":"Please enter the password",
"Password error":"Password error",
- "DataBase Connection failed":"DataBase Connection failed"
+ "DataBase Connection failed":"DataBase Connection failed",
+ "Distribute parameters":"Distribute parameters"
}
\ No newline at end of file
diff --git a/CanadaMes-ui/src/lang/locales/zh-CN.json b/CanadaMes-ui/src/lang/locales/zh-CN.json
index b465c9a..865e5ec 100644
--- a/CanadaMes-ui/src/lang/locales/zh-CN.json
+++ b/CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -282,6 +282,7 @@
"Please enter the password":"璇疯緭鍏ュ瘑鐮�",
"Password error":"瀵嗙爜閿欒",
- "DataBase Connection failed":"鏁版嵁搴撹繛鎺ュけ璐�"
+ "DataBase Connection failed":"鏁版嵁搴撹繛鎺ュけ璐�",
+ "Distribute parameters":"涓嬪彂鍙傛暟"
}
\ No newline at end of file
diff --git a/CanadaMes-ui/src/views/Electrical/Action.vue b/CanadaMes-ui/src/views/Electrical/Action.vue
index db3b8da..1560ce5 100644
--- a/CanadaMes-ui/src/views/Electrical/Action.vue
+++ b/CanadaMes-ui/src/views/Electrical/Action.vue
@@ -17,7 +17,7 @@
<div class="kuai_div" v-for="(item, index) in record.xyData" :key="index">
<el-input v-model="item.name" style="width: 240px;" class="in_mc" readonly></el-input>
- <el-switch v-model="item.value" active-value="1" inactive-value="0" @change="send()"></el-switch>
+ <el-switch v-model="item.value" active-value="1" inactive-value="0" @change="send()"></el-switch>
</div>
</el-form>
@@ -27,6 +27,7 @@
<script >
import LanguageMixin from '../../lang/LanguageMixin'
+import { SelectPassword } from "../../api/home";
let socket;
export default {
name: "Action",
@@ -34,6 +35,7 @@
data () {
return {
activeButton: '',
+
record: {
params: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
canshu: [
@@ -107,7 +109,9 @@
}
},
created () {
+
this.init();
+
},
methods: {
setActiveButton(buttonName) {
@@ -166,9 +170,36 @@
},
send () {
+
+
+ SelectPassword().then(res => {
+ this.password = res.data.password;
+});
+ this.$prompt(this.$t('Are you sure to perform this operation?'), this.$t('prompt'), {
+ inputType: 'password',
+ inputPlaceholder: this.$t('Please enter the password'),
+ confirmButtonText: this.$t('Yes'),
+ cancelButtonText: this.$t('No'),
+ type: 'warning'
+ }).then(({ value }) => {
+ if (this.password === value) {
+ // 瀵嗙爜姝g‘锛屾墽琛岀浉搴旀搷浣�
+
this.messagepack.data = this.record.xyData.map(item => parseInt(item.value)); // 杞崲涓烘暣鏁版暟缁�
//console.log(this.messagepack);
socket?.send(JSON.stringify(this.messagepack));
+ } else {
+
+ this.$message.success(this.$t('Password error')); // 瀵嗙爜閿欒
+
+ }
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: this.$t('Operation canceled')
+ });
+ });
+
}
}
diff --git a/CanadaMes-ui/src/views/Electrical/Parameter.vue b/CanadaMes-ui/src/views/Electrical/Parameter.vue
index 7bf5973..01527f1 100644
--- a/CanadaMes-ui/src/views/Electrical/Parameter.vue
+++ b/CanadaMes-ui/src/views/Electrical/Parameter.vue
@@ -13,7 +13,7 @@
<el-form label-width="100px" style="display: flex; flex-wrap: wrap;" :model="messagepack.data">
<div id="btn_div">
- <el-button type="primary" @click="send()" id="xiafa" :disabled="isButtonDisabled">涓嬪彂鍙傛暟</el-button>
+ <el-button type="primary" @click="send()" id="xiafa" :disabled="isButtonDisabled">{{ $t('Distribute parameters') }}</el-button>
</div>
<div class="kuai_div" v-for="(item, index) in record.xyData" :key="index">
@@ -39,6 +39,7 @@
let socket;
import LanguageMixin from '../../lang/LanguageMixin'
+import { SelectPassword } from "../../api/home";
export default {
name: "Parameter",
mixins: [LanguageMixin],
@@ -78,7 +79,9 @@
created () {
this.initWebSocket();
+
this.isButtonDisabled = true;
+
},
methods: {
@@ -158,9 +161,32 @@
}
},
send () {
+
+ SelectPassword().then(res => {
+ this.password = res.data.password;
+});
+ this.$prompt(this.$t('Are you sure to perform this operation?'), this.$t('prompt'), {
+ inputType: 'password',
+ inputPlaceholder: this.$t('Please enter the password'),
+ confirmButtonText: this.$t('Yes'),
+ cancelButtonText: this.$t('No'),
+ type: 'warning'
+ }).then(({ value }) => {
+ if (this.password === value) {
+ // 瀵嗙爜姝g‘锛屾墽琛岀浉搴旀搷浣�
this.messagepack.data = this.record.xyData.map((item) => parseInt(item.value2)); // 杞崲涓烘暣鏁版暟缁�
//console.log(this.messagepack);
socket?.send(JSON.stringify(this.messagepack));
+ } else {
+ this.$message.success(this.$t('Password error')); // 瀵嗙爜閿欒
+ }
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: this.$t('Operation canceled')
+ });
+ });
+
},
handleChange (index, value) {
this.record.xyData[index].value = value;
diff --git a/springboot-vue3/src/main/java/com/example/springboot/controller/UserController.java b/springboot-vue3/src/main/java/com/example/springboot/controller/UserController.java
index a40ae9e..a7e6f9f 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/controller/UserController.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/controller/UserController.java
@@ -108,7 +108,7 @@
@RequiresRoles({"admin"})
@RequiresPermissions({"user:update", "user:add"})
public Result saveOrUpdate(@RequestBody User user) {
- if ("admin".equals(user.getUsername())) {
+ if ("admin".equals(user.getUsername()) && user.getState() == 0) {
return Result.fail("绠$悊鍛樹笉鍙互琚鐢�");
}
Integer count = userService.lambdaQuery()
--
Gitblit v1.8.0