4 changed files with 424 additions and 6 deletions
			
			
		- 
					13src/api/system/param.js
- 
					2src/views/home.vue
- 
					262src/views/visualCheck/checkManage/bookshelfSearch/index.vue
- 
					153src/views/visualCheck/checkManage/paramSetting/index.vue
| @ -0,0 +1,13 @@ | |||||
|  | import request from '@/utils/request' | ||||
|  | 
 | ||||
|  | export function verifyMaintenance(code) { | ||||
|  |   const params = { | ||||
|  |     code | ||||
|  |   } | ||||
|  |   return request({ | ||||
|  |     url: 'api/dictionary/maintenanceVerification', | ||||
|  |     method: 'get', | ||||
|  |     params | ||||
|  |   }) | ||||
|  | } | ||||
|  | export default { verifyMaintenance } | ||||
| @ -0,0 +1,153 @@ | |||||
|  | <template> | ||||
|  |   <div class="app-container  row-container"> | ||||
|  |     <div class="container-wrap"> | ||||
|  |       <span class="right-top-line" /> | ||||
|  |       <span class="left-bottom-line" /> | ||||
|  |       <el-form ref="form" :rules="rules" :model="form" size="small" label-width="120px" style="display: flex; justify-content: flex-start;"> | ||||
|  |         <el-form-item label="AI处理终端IP" prop="ip"> | ||||
|  |           <el-input v-model="form.ip" placeholder="请输入IP地址,如:192.168.1.1" style="width: 300px;" /> | ||||
|  |         </el-form-item> | ||||
|  |         <p style="line-height: 32px; margin-left: 20px; font-size: 12px;">设置成功后,方可执行视觉盘点任务(该参数设置需要超级管理员权限授权)</p> | ||||
|  |       </el-form> | ||||
|  |       <el-button style="margin-left: 30px;" :loading="crud.status.cu === 2" type="primary" @click="toVerify">保存</el-button> | ||||
|  |     </div> | ||||
|  | 
 | ||||
|  |     <el-dialog class="tip-dialog tip-middle-dialog" title="操作提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="verifyDialogVisible" :before-close="handleClose"> | ||||
|  |       <div class="setting-dialog"> | ||||
|  |         <div class="tip-content"> | ||||
|  |           <p class="tipMsg">这里为技术人员维护系统时使用,普通用户无需设置</p> | ||||
|  |           <p class="delt-tip"><span>注意:强行修改会导致系统数据异常或丢失!如因用户强行修改,本系统不负责因此导致的相关后果!</span></p> | ||||
|  |         </div> | ||||
|  |         <el-form ref="verfiyForm" :model="verfiyForm" style="margin-top:30px;" @submit.native.prevent> | ||||
|  |           <el-form-item label="维护验证码" label-width="110px"> | ||||
|  |             <el-input v-model="verfiyForm.verifyCode" show-password style="width: 480px;" /> | ||||
|  |           </el-form-item> | ||||
|  |         </el-form> | ||||
|  |         <div slot="footer" class="dialog-footer"> | ||||
|  |           <el-button @click="handleClose">取消 </el-button> | ||||
|  |           <el-button type="primary" @click.native="handleConfirm">确定</el-button> | ||||
|  |         </div> | ||||
|  |       </div> | ||||
|  |     </el-dialog> | ||||
|  |   </div> | ||||
|  | </template> | ||||
|  | 
 | ||||
|  | <script> | ||||
|  | import { encrypt } from '@/utils/rsaEncrypt' | ||||
|  | import crudParam, { verifyMaintenance } from '@/api/system/param' | ||||
|  | import CRUD, { presenter, header, form, crud } from '@crud/crud' | ||||
|  | import { mapGetters } from 'vuex' | ||||
|  | 
 | ||||
|  | const defaultForm = { id: null, ip: '' } | ||||
|  | 
 | ||||
|  | export default { | ||||
|  |   name: 'ParamSetting', | ||||
|  |   components: { }, | ||||
|  |   cruds() { | ||||
|  |     return CRUD({ | ||||
|  |       title: '参数设置', | ||||
|  |       url: 'api/database/databaseList', | ||||
|  |       crudMethod: { ...crudParam }, | ||||
|  |       sort: [], | ||||
|  |       optShow: { | ||||
|  |         add: true, | ||||
|  |         edit: false, | ||||
|  |         del: false, | ||||
|  |         download: false, | ||||
|  |         group: false, | ||||
|  |         reset: false | ||||
|  |       } | ||||
|  |     }) | ||||
|  |   }, | ||||
|  |   mixins: [presenter(), header(), form(defaultForm), crud()], | ||||
|  |   data() { | ||||
|  |     return { | ||||
|  |       permission: { | ||||
|  |         add: ['admin', 'paramSetting:add'], | ||||
|  |         edit: ['admin', 'paramSetting:edit'], | ||||
|  |         del: ['admin', 'paramSetting:del'] | ||||
|  |       }, | ||||
|  |       verifyDialogVisible: false, | ||||
|  |       verfiyForm: { | ||||
|  |         verifyCode: '' | ||||
|  |       }, | ||||
|  |       showVerifyDialog: true, | ||||
|  |       rules: { | ||||
|  |         ip: [ | ||||
|  |           { required: true, message: 'AI处理终端IP不可为空', trigger: 'blur' } | ||||
|  |         ] | ||||
|  |       } | ||||
|  |     } | ||||
|  |   }, | ||||
|  |   computed: { | ||||
|  |     ...mapGetters([ | ||||
|  |       'baseApi' | ||||
|  |     ]) | ||||
|  |   }, | ||||
|  |   created() { | ||||
|  |   }, | ||||
|  |   methods: { | ||||
|  |     [CRUD.HOOK.beforeToCU](crud, form, btn) { | ||||
|  |       if (this.showVerifyDialog) { | ||||
|  |         // 打开输入验证码对话框 | ||||
|  |         this.verifyDialogVisible = true | ||||
|  |         return false | ||||
|  |       } | ||||
|  |     }, | ||||
|  |     [CRUD.HOOK.beforeRefresh]() { | ||||
|  |     }, | ||||
|  |     // 提交前的验证 | ||||
|  |     [CRUD.HOOK.afterValidateCU](crud) { | ||||
|  |       console.log(crud.form) | ||||
|  |       return true | ||||
|  |     }, | ||||
|  |     toVerify(btn) { | ||||
|  |       if (this.form.ip) { | ||||
|  |         if (this.showVerifyDialog) { | ||||
|  |         // 打开输入验证码对话框 | ||||
|  |           this.verifyDialogVisible = true | ||||
|  |           return false | ||||
|  |         } | ||||
|  |       } else { | ||||
|  |         this.$refs.form.validateField(['ip'], err => { | ||||
|  |           console.log('err', err) | ||||
|  |           if (err) { | ||||
|  |             return | ||||
|  |           } | ||||
|  |         }) | ||||
|  |       } | ||||
|  |     }, | ||||
|  |     handleConfirm() { | ||||
|  |       verifyMaintenance(encrypt(this.verfiyForm.verifyCode)).then((res) => { | ||||
|  |         if (res) { | ||||
|  |           // 关闭输入验证码对话框 | ||||
|  |           this.verifyDialogVisible = false | ||||
|  |           this.verfiyForm.verifyCode = '' | ||||
|  |           this.showVerifyDialog = false | ||||
|  |           //  this.crud.form.ip | ||||
|  |           // crudSql.FetchBackupName().then((data) => { | ||||
|  |           //  console.log('data',data) | ||||
|  |           // }).catch(err => { | ||||
|  |           //   console.log(err) | ||||
|  |           // }) | ||||
|  |         } else { | ||||
|  |           this.$message({ message: '验证码错误!', type: 'error', offset: 8 }) | ||||
|  |         } | ||||
|  |       }) | ||||
|  |     }, | ||||
|  |     handleClose() { | ||||
|  |       if (this.$refs.verfiyForm) { | ||||
|  |         this.verfiyForm.verifyCode = '' | ||||
|  |         this.$refs.verfiyForm.resetFields() | ||||
|  |         this.verifyDialogVisible = false | ||||
|  |       } | ||||
|  |     } | ||||
|  |   } | ||||
|  | } | ||||
|  | </script> | ||||
|  | 
 | ||||
|  | <style lang="scss" scoped> | ||||
|  | ::v-deep div.el-dialog__footer { | ||||
|  |   text-align: center; | ||||
|  | } | ||||
|  | </style> | ||||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue