{"remainingRequest":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\damDance-fvue\\src\\views\\BasicData\\components\\IntelligentDeviceDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\damDance-fvue\\src\\views\\BasicData\\components\\IntelligentDeviceDialog.vue","mtime":1703831130600},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/web.dom.iterable\";\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//\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//\nimport utils from '@/utils.js';\nimport IntelligentDevice from '@/api/basicConfiguration/IntelligentDevice';\nimport Team from '@/api/basicConfiguration/Team';\nimport dictUtils from '@/components/dict/DictSelectUtils.js';\nimport placesDialog from \"../../BasicData/components/placesDialog.vue\";\nexport default {\n props: {},\n name: 'IntelligentDeviceDialog',\n components: {\n placesDialog: placesDialog\n },\n data: function data() {\n var validateDevice = function validateDevice(rule, value, callback) {\n console.log(value);\n\n if (value.length) {\n callback();\n } else {\n callback(new Error('请选择关联设备'));\n }\n };\n\n return {\n visible: false,\n loading: false,\n rules: {\n code: [{\n required: true,\n message: '请输入设备编码',\n trigger: 'blur'\n }],\n name: [{\n required: true,\n message: '请输入设备名称',\n trigger: 'blur'\n }],\n type: [{\n required: true,\n message: '请选择设备类型',\n trigger: 'blur'\n }],\n // squareLocationId: [\n // {\n // required: true,\n // message: '请选择所属广场舞',\n // trigger: 'blur',\n // },\n // ],\n areaCode: [{\n required: true,\n message: '请选择行政区划',\n trigger: 'blur'\n }],\n detailAddress: [{\n required: true,\n message: '请输入详细地址',\n trigger: 'blur'\n }],\n deviceRelateds: [{\n required: true,\n validator: validateDevice,\n tirgger: 'change'\n }]\n },\n xboptions: [],\n type: '新增',\n formData: {\n code: '',\n name: '',\n type: null,\n squareLocationId: '',\n areaCode: '',\n detailAddress: '',\n lgtd: null,\n lttd: null,\n status: null,\n deviceRelateds: []\n },\n areaCode: [],\n options: [],\n sblxList: [],\n //设备类型\n sbztList: [],\n //设备状态\n squareList: [],\n //广场舞地址\n btnLoading: false,\n deviceList: [],\n deviceInfo: []\n };\n },\n created: function created() {\n this.sblxList = dictUtils.getDictItemsFromCache('sblx');\n this.sbztList = dictUtils.getDictItemsFromCache('sbzt');\n this.getTownTree();\n this.getPlazaLocation(); // this.getNoiseTree()\n // this.getTeam()\n },\n methods: {\n //行政区划\n getTownTree: function getTownTree() {\n var _this = this;\n\n Team.townTree({}, function (res) {\n if (res.state) {\n _this.options = res.value;\n }\n });\n },\n handleChange: function handleChange(val) {\n var nodesObj = this.$refs['cascader'].getCheckedNodes()[0].data;\n this.formData.areaFullCode = nodesObj.fullCode;\n this.formData.areaFullName = nodesObj.fullName;\n this.formData.areaCode = nodesObj.code;\n },\n //获取广场舞地点\n getPlazaLocation: function getPlazaLocation() {\n var _this2 = this;\n\n IntelligentDevice.plazaQuery({\n pageBean: {\n page: 1,\n pageSize: -1\n }\n }, function (res) {\n _this2.squareList = res.rows;\n });\n },\n handleSelect: function handleSelect(val) {\n var _this3 = this;\n\n this.squareList.forEach(function (e) {\n if (e.id === val) {\n _this3.areaCode = e.areaFullCode ? e.areaFullCode.split('/').splice(1) : [];\n _this3.formData.areaCode = e.areaCode;\n _this3.formData.detailAddress = e.detailAddress;\n }\n });\n },\n open: function open(data) {\n this.deviceInfo = [];\n this.noise = [];\n this.squareTeam = [];\n this.areaCode = [];\n this.visible = true;\n this.formData = {\n code: '',\n name: '',\n type: '1',\n squareLocationId: '',\n areaCode: '',\n detailAddress: '',\n lgtd: null,\n lttd: null,\n status: null,\n deviceRelateds: []\n };\n this.type = '新增';\n this.getDeviceList();\n },\n handleClose: function handleClose() {\n this.visible = false;\n },\n getDeviceList: function getDeviceList(id) {\n var _this4 = this;\n\n this.deviceList = [];\n IntelligentDevice.getDeviceList(id, function (res) {\n for (var key in res) {\n // 循环代码块\n _this4.deviceList.push({\n name: key,\n children: res[key]\n });\n }\n\n console.log(_this4.deviceList);\n });\n },\n submitForm: function submitForm(formName) {\n var _this5 = this;\n\n this.$refs.form.validate(function (valid) {\n if (valid) {\n _this5.btnLoading = true;\n alert('submit!');\n } else {\n console.log('error submit!!');\n return false;\n }\n });\n },\n edit: function edit(val) {\n var _this6 = this;\n\n this.deviceInfo = [];\n this.noise = [];\n this.squareTeam = [];\n this.areaCode = [];\n this.formData = {\n code: '',\n name: '',\n type: null,\n squareLocationId: '',\n areaCode: '',\n detailAddress: '',\n lgtd: null,\n lttd: null,\n status: null,\n deviceRelateds: []\n };\n this.type = '编辑';\n this.visible = true;\n IntelligentDevice.detailId(val, function (res) {\n if (res) {\n _this6.formData = res;\n\n _this6.getDeviceList(res.code);\n\n _this6.deviceInfo = res.deviceRelateds.map(function (it) {\n return it.relatedDeviceCode;\n });\n _this6.areaCode = res.areaFullCode ? res.areaFullCode.split('/').splice(1) : [];\n\n if (res.noiseLevelId && res.noiseTypeId) {\n _this6.noise = [res.noiseTypeId, res.noiseLevelId];\n } else if (res.noiseTypeId) {\n _this6.noise = [res.noiseTypeId];\n } else {\n _this6.noise = [];\n }\n }\n });\n },\n handleSave: function handleSave() {\n var _this7 = this;\n\n this.$refs.form.validate(function (valid) {\n if (valid) {\n var method;\n\n if (_this7.type === '新增') {\n method = IntelligentDevice.addSave;\n } else {\n method = IntelligentDevice.upData;\n }\n\n method(_this7.formData, function (response) {\n if (response.state) {\n _this7.$notify({\n type: 'success',\n message: _this7.type + '成功',\n duration: 2000\n });\n\n _this7.handleClose();\n\n _this7.$emit('getData');\n } else {\n _this7.$message.warning(response.message);\n }\n });\n } else {\n _this7.$notify({\n type: 'warning',\n message: '请完善表单信息!',\n duration: 2000\n });\n }\n });\n },\n handleSearchPlaces: function handleSearchPlaces() {\n this.$refs.placesDialog.open();\n },\n changePlaces: function changePlaces(data) {\n this.formData.squareLocationName = data.squareLocationName;\n this.formData.squareLocationId = data.id;\n this.formData.areaCode = data.areaCode;\n this.formData.areaFullCode = data.areaFullCode;\n this.$forceUpdate();\n },\n changeDevice: function changeDevice(val) {\n var _this8 = this;\n\n this.formData.deviceRelateds = val.map(function (it) {\n return {\n deviceInfoCode: _this8.formData.code,\n relatedDeviceCode: it\n };\n });\n }\n }\n};",null]}