删除不需要的代码,parameter、action页不需要输入密码
| | |
| | | |
| | | <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> |
| | | |
| | |
| | | |
| | | <script > |
| | | import LanguageMixin from '../../lang/LanguageMixin' |
| | | import { SelectPassword } from "../../api/home"; |
| | | let socket; |
| | | export default { |
| | | name: "Action", |
| | |
| | | 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: [ |
| | |
| | | } |
| | | }, |
| | | created () { |
| | | |
| | | this.init(); |
| | | |
| | | }, |
| | | methods: { |
| | | setActiveButton(buttonName) { |
| | |
| | | |
| | | }, |
| | | 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) { |
| | | // 密码正确,执行相应操作 |
| | | |
| | | 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') |
| | | }); |
| | | }); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | |
|
| | | let socket;
|
| | | import LanguageMixin from '../../lang/LanguageMixin'
|
| | | import { SelectPassword } from "../../api/home";
|
| | | export default {
|
| | | name: "Parameter",
|
| | | mixins: [LanguageMixin],
|
| | |
| | |
|
| | | created () {
|
| | | this.initWebSocket();
|
| | |
|
| | | this.isButtonDisabled = true;
|
| | |
|
| | | },
|
| | | methods: {
|
| | |
|
| | |
| | | }
|
| | | },
|
| | | 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) {
|
| | | // 密码正确,执行相应操作
|
| | | 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;
|
| | |
| | | @RequiresRoles({"admin"}) |
| | | @RequiresPermissions({"user:update", "user:add"}) |
| | | public Result saveOrUpdate(@RequestBody User user) { |
| | | if ("admin".equals(user.getUsername()) && user.getState() == 0) { |
| | | if ("admin".equals(user.getUsername())) { |
| | | return Result.fail("管理员不可以被禁用"); |
| | | } |
| | | Integer count = userService.lambdaQuery() |