| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | deptId:'', |
| | | deviceSn:'', |
| | | deptId: '', |
| | | deviceSn: '', |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | |
| | | total: 0, |
| | | }, |
| | | selectionList: [], |
| | | deptTreeData: [], |
| | | option: { |
| | | lazy: true, |
| | | tree: true, |
| | | height: 'atuo', |
| | | height: 'auto', |
| | | calcHeight: 32, |
| | | dialogWidth: 750, |
| | | tip: false, |
| | |
| | | column: [ |
| | | { |
| | | label: '授权单位', |
| | | prop: 'dept_id', |
| | | prop: 'deptId', |
| | | labelWidth: 130, |
| | | type: 'tree', |
| | | dicData:[], |
| | | dicData: [], |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | }, |
| | | span:24, |
| | | row:true, |
| | | hide:true, |
| | | editDisplay:false, |
| | | viewDisplay:false, |
| | | span: 24, |
| | | row: true, |
| | | hide: true, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | }, |
| | | { |
| | | label: '授权单位', |
| | | prop: 'dept_name', |
| | | prop: 'deptName', |
| | | labelWidth: 130, |
| | | addDisplay:false, |
| | | addDisplay: false, |
| | | editDisabled: true, |
| | | search: true, |
| | | searchSpan: 6, |
| | | span:24, |
| | | row:true, |
| | | span: 24, |
| | | row: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | }, |
| | | { |
| | | label: '授权功能', |
| | | prop: 'device_per_menu_id', |
| | | prop: 'devicePerMenuId', |
| | | labelWidth: 130, |
| | | type: 'tree', |
| | | dicUrl: '/blade-system/manage/api/v1/devicePerMenu/selectDeviceList', |
| | |
| | | }, |
| | | multiple: true, |
| | | dataType: 'string', |
| | | span:24, |
| | | row:true, |
| | | span: 24, |
| | | row: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | }, |
| | | { |
| | | label: '授权时间', |
| | | prop: 'create_time', |
| | | prop: 'createTime', |
| | | type: 'date', |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | |
| | | row: true, |
| | | width: 160, |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | // valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | // 初始化数据 |
| | | init(data) { |
| | | this.deptId = data.dept_id; |
| | | this.deviceSn = data.device_sn; |
| | | this.getDeptTreeInfo(); |
| | | this.getLoadPage(this.page); |
| | | }, |
| | | getDeptTreeInfo(){ |
| | | getDeptTreeByNotItself(this.deptId,this.deviceSn).then(res => { |
| | | const column = this.findObject(this.option.column, 'dept_id'); |
| | | getDeptTreeInfo() { |
| | | getDeptTreeByNotItself(this.deptId, this.deviceSn).then(res => { |
| | | const column = this.findObject(this.option.column, 'deptId'); |
| | | this.deptTreeData = res.data.data; |
| | | column.dicData = res.data.data; |
| | | }); |
| | | }, |
| | |
| | | () => { |
| | | this.initFlag = false; |
| | | this.getLoadPage(this.page); |
| | | // 刷新机构树 |
| | | this.getDeptTreeInfo(); |
| | | this.$message({ |
| | | type: 'success', |
| | |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | row['device_sn'] = this.deviceSn; |
| | | update(row).then( |
| | | update(row).then( |
| | | () => { |
| | | this.getLoadPage(this.page); |
| | | this.$message({ |
| | |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | // 刷新机构树 |
| | | this.getDeptTreeInfo(); |
| | | this.getLoadPage(this.page); |
| | | this.$message({ |
| | |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.getLoadPage(this.page, this.query); // 添加数据刷新 |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.currentPage = 1; // 每页条数改变时,重置到第一页 |
| | | this.getLoadPage(this.page, this.query); // 添加数据刷新 |
| | | }, |
| | | refreshChange() { |
| | | this.getLoadPage(this.page, this.query); |
| | |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }).catch(err => { |
| | | console.error('加载数据失败:', err); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | }, |
| | |
| | | } |
| | | .firmware_status:hover { |
| | | cursor: pointer; |
| | | /* color: aqua; */ |
| | | } |
| | | </style> |
| | | </style> |