{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\base\\components\\CmgtBasePositionFormDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\base\\components\\CmgtBasePositionFormDialog.vue","mtime":1688615807641},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport CmgtBasePositionApi from '@/views/Manage/base/api/CmgtBasePositionApi'\r\nimport dictContracts from '@/components/dict/DictSelectUtils.js'\r\nimport CommonApi from '@/views/Manage/CommonApi.js'\r\nimport {mapState} from 'vuex'\r\n\r\nexport default {\r\n name: 'CmgtBasePositionFormDialog',\r\n props: {\r\n equipmentList: {\r\n type: Array,\r\n default: []\r\n },\r\n userList: {\r\n type: Array,\r\n default: []\r\n }\r\n },\r\n components: {},\r\n data() {\r\n return {\r\n title: '新增',\r\n CommonApi,\r\n showFormDia: false,\r\n loading: false,\r\n activeCollapseNames: ['1'],\r\n activeTabChildName: '0',\r\n\r\n dtypeSelectOptions: [],\r\n params: {\r\n name: null,\r\n alias: null,\r\n dtype: null,\r\n rid: null,\r\n latitude: null,\r\n longitude: null,\r\n location: null,\r\n receiveTime: null,\r\n memo: null,\r\n userList: [],\r\n userInfoList:[],\r\n area: null\r\n },\r\n rules: {\r\n name: [\r\n {required: true, message: '名称不能为空', trigger: 'blur'}\r\n ],\r\n dtype: [\r\n {required: true, message: ' 类型不能为空', trigger: 'blur'}\r\n ]\r\n }\r\n }\r\n },\r\n computed: mapState({\r\n header: state => {\r\n return {\r\n Authorization: `Bearer ${state.login.currentUser.token}`\r\n }\r\n }\r\n }),\r\n created() {\r\n CommonApi.loadSelectOptions(\r\n {name: 'cmgtBasePositionManagerImpl.getAllPositionType'},\r\n res => {\r\n console.log('========res===res===', res)\r\n this.dtypeSelectOptions = res\r\n }\r\n )\r\n },\r\n methods: {\r\n add() {\r\n this.title = '新增'\r\n this.resetForm()\r\n this.showFormDia = true\r\n },\r\n resetForm() {\r\n this.params = {\r\n name: null,\r\n alias: null,\r\n dtype: null,\r\n rid: null,\r\n latitude: null,\r\n longitude: null,\r\n location: null,\r\n receiveTime: null,\r\n memo: null,\r\n userList: [],\r\n userInfoList:[],\r\n area: null\r\n }\r\n },\r\n handleClose() {\r\n this.resetForm()\r\n this.showFormDia = false\r\n },\r\n handleSave() {\r\n this.$refs.formInfo.validate(valid => {\r\n if (valid) {\r\n let arr = []\r\n this.params.userInfoList.forEach(item => {\r\n this.userList.forEach(it => {\r\n if (item === it.id) {\r\n arr.push({\r\n orgId: it.orgId,\r\n teamId: it.teamId,\r\n teamMemberId: it.id\r\n })\r\n console.log(arr);\r\n }\r\n })\r\n })\r\n this.params.userList = arr\r\n let method\r\n if (!this.params.id) {\r\n // 新增\r\n method = CmgtBasePositionApi.addCmgtBasePosition\r\n } else {\r\n // 修改\r\n method = CmgtBasePositionApi.editCmgtBasePosition\r\n }\r\n this.loading = true\r\n method(this.params, res => {\r\n this.loading = false\r\n if (res.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: this.title + '成功',\r\n duration: 2000\r\n })\r\n //this.$emit('loadData')\r\n this.$parent.loadData()\r\n this.handleClose()\r\n } else {\r\n this.$message.warning(res.message)\r\n }\r\n })\r\n }\r\n })\r\n },\r\n Update(row) {\r\n this.title = '修改'\r\n this.showFormDia = true\r\n CmgtBasePositionApi.getCmgtBasePositionByID(row.id, res => {\r\n res.userInfoList = res.userList.map(item => {\r\n return item.teamMemberId\r\n })\r\n this.params = res\r\n })\r\n }\r\n }\r\n}\r\n",null]}