{"remainingRequest":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\damDance-fvue\\src\\views\\BasicData\\components\\NoiseLevelDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\damDance-fvue\\src\\views\\BasicData\\components\\NoiseLevelDialog.vue","mtime":1698314313125},{"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":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 utils from '@/utils.js'\r\nimport NoiseLevel from '@/api/basicConfiguration/NoiseLevel'\r\nimport NoiseClassify from '@/api/basicConfiguration/NoiseClassify'\r\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\r\nexport default {\r\n props: {},\r\n name: 'NoiseLevelDialog',\r\n data() {\r\n return {\r\n visible: false,\r\n loading: false,\r\n type: '新增',\r\n rules: {\r\n noiseTypeId: [\r\n {\r\n required: true,\r\n message: '请选择噪音分类',\r\n trigger: 'change',\r\n },\r\n ],\r\n level: [\r\n {\r\n required: true,\r\n message: '请选择分类级别',\r\n trigger: 'change',\r\n },\r\n ],\r\n code: [\r\n {\r\n required: true,\r\n message: '请输入分级编码',\r\n trigger: 'blur',\r\n },\r\n ],\r\n daytimeNoiseLevel: [\r\n {\r\n required: true,\r\n message: '请输入白天分贝',\r\n trigger: 'blur',\r\n },\r\n ],\r\n nightNoiseLevel: [\r\n {\r\n required: true,\r\n message: '请输入夜晚分贝',\r\n trigger: 'blur',\r\n },\r\n ],\r\n },\r\n formData: {},\r\n sortList: [], //分类\r\n btnLoading: false,\r\n }\r\n },\r\n created() {\r\n this.fljbList = dictUtils.getDictItemsFromCache('fljb')\r\n this.getSortData()\r\n },\r\n methods: {\r\n getSortData() {\r\n NoiseClassify.dataQuery(\r\n {\r\n pageBean: {\r\n page: 1,\r\n pageSize: -1,\r\n },\r\n },\r\n (res) => {\r\n this.sortList = res.rows\r\n }\r\n )\r\n },\r\n\r\n open(data) {\r\n this.formData = {}\r\n this.visible = true\r\n this.type = '新增'\r\n if (this.fljbList.length > 0) {\r\n this.formData.level = this.fljbList[0].value\r\n }\r\n if (this.sortList.length > 0) {\r\n this.formData.noiseTypeId = this.sortList[0].id\r\n }\r\n },\r\n handleClose() {\r\n this.visible = false\r\n },\r\n //编辑\r\n edit(id) {\r\n this.formData = {}\r\n this.visible = true\r\n this.type = '编辑'\r\n NoiseLevel.detailId(id, (res) => {\r\n this.formData = res\r\n })\r\n },\r\n //保存\r\n handleSave() {\r\n this.$refs.form.validate((valid) => {\r\n if (valid) {\r\n this.btnLoading = true\r\n\r\n let method\r\n if (this.type === '新增') {\r\n method = NoiseLevel.addSave\r\n } else {\r\n method = NoiseLevel.upData\r\n }\r\n method(this.formData, (response) => {\r\n if (response.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: this.type + '成功',\r\n duration: 2000,\r\n })\r\n this.handleClose()\r\n this.$emit('getData')\r\n } else {\r\n this.$message.warning(response.message)\r\n }\r\n this.btnLoading = false\r\n })\r\n } else {\r\n this.$notify({\r\n type: 'warning',\r\n message: '请完善表单信息!',\r\n duration: 2000,\r\n })\r\n }\r\n })\r\n },\r\n },\r\n}\r\n",null]}