| | |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | import {mapGetters} from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | |
| | | export default { |
| | | name: '', |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | | components: {limsTable}, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | this.deviceImpowerDetails.forEach(item => { |
| | | item['delegatedUserArr'] = item.delegatedUser.split(',') |
| | | }) |
| | | this.restoreImpowerDraft() |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | } else { |
| | | this.restoreImpowerDraft() |
| | | } |
| | | this.getEquipOptions() |
| | | this.getUserList() |
| | | }, |
| | | restoreImpowerDraft() { |
| | | if (this.operationType === 'add' || this.operationType === 'edit') { |
| | | const rid = this.operationType === 'edit' ? this.impowerId : '' |
| | | this.draftRestore('usageAuthorizationForm', 'form', rid, 'usageTableDia') |
| | | this.draftRestore('usageAuthorizationRows', 'deviceImpowerDetails', rid, 'usageTableDia') |
| | | } |
| | | }, |
| | | closeDialog () { |
| | | this.usageTableDia = false |
| | |
| | | addImpower(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('新增成功') |
| | | this.draftClear('usageAuthorizationForm') |
| | | this.draftClear('usageAuthorizationRows') |
| | | this.usageTableDia = false |
| | | this.refreshTableList() |
| | | } |
| | |
| | | updateImpower(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('修改成功') |
| | | this.draftClear('usageAuthorizationForm') |
| | | this.draftClear('usageAuthorizationRows') |
| | | this.usageTableDia = false |
| | | this.refreshTableList() |
| | | } |