You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
15 KiB
1 line
15 KiB
{"version":3,"sources":["webpack:///./src/views/basic/page/unitInfo.vue","webpack:///src/views/basic/page/unitInfo.vue","webpack:///./src/views/basic/page/unitInfo.vue?3cea","webpack:///./src/views/basic/page/unitInfo.vue?5fa5"],"names":["render","_vm","this","_c","_self","staticClass","_m","attrs","on","$event","addBuild","_v","ref","config","tableCheck","slot","revise","table_row","del","drawerTitle","drawer_vrisible","drawerClose","staticStyle","reviseForm","ruleSubmit","onSubmit","staticRenderFns","data","bool","drawerControl","thead","label","type","width","prop","callback","loading","pageNum","size","table_data","url","search_item","placeholder","ruleForm","isElevator","no","totalFloor","buildingId","rules","name","required","message","trigger","form_item","options","value","mounted","cpmBuildingUnitFindAll","console","methods","cpmBuildingUnitInsert","then","res","catch","error","id","cpmBuildingUnitUpdate","getData","arr","confirmButtonText","cancelButtonText","confirmButtonClass","cancelButtonClass","action","component"],"mappings":"uHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAACJ,EAAIK,GAAG,GAAGH,EAAG,MAAM,CAACE,YAAY,WAAW,CAACF,EAAG,MAAM,CAACE,YAAY,eAAe,CAACF,EAAG,YAAY,CAACE,YAAY,cAAcE,MAAM,CAAC,KAAO,gBAAgBC,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOR,EAAIS,cAAc,CAACT,EAAIU,GAAG,WAAW,GAAGR,EAAG,WAAW,CAACS,IAAI,QAAQL,MAAM,CAAC,OAASN,EAAIY,QAAQL,GAAG,CAAC,WAAaP,EAAIa,aAAa,CAACX,EAAG,WAAW,CAACY,KAAK,UAAU,CAACZ,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAACF,EAAG,SAAS,CAACK,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOR,EAAIe,OAAOf,E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,cACAG,kBACAD,aACAD,gBACAG,+CAEA,CAAAJ,aAAAG,UAAAD,eAEAG,WACAT,MACAU,UACAC,SAEAC,cACAC,eAEAC,aACA,CACAT,aACAD,aACAW,oBACAR,qBAEA,CACAF,WACAD,cACAW,kBACAR,aAKAjB,aACAM,YACAoB,UACAC,gBACAC,QACAC,gBACAC,iBAEAC,OACAC,MACA,CACAC,YACAC,kBACAC,iBAGAP,IACA,CAAAK,YAAAC,kBAAAC,kBAGAC,WACA,CACArB,cACAD,WACAW,kBACAT,aACAC,kBACAoB,YAEA,CACAtB,WACAD,cACAW,kBACAT,aACAC,WAEA,CACAF,WACAD,YACAW,kBACAT,aACAC,mBACA,CACAF,cACAD,cACAW,kBACAT,aACAC,kBACAoB,SACA,CAAAC,QAAAxB,aACA,CAAAwB,QAAAxB,mBAOAyB,UAEAC,0BACAC,eACA,0CAGAC,SAEAnC,cACA,aAGAC,WAIA,GAFA,kCAEA,UAEA,uBAEA,OACAsB,+CACAD,+CACAF,+CACAC,gCAEAe,kBACAC,KAAAC,IACAJ,eACA,WACA,eACAP,kBACAnB,iBAEA,eACA,sBAEA+B,MAAAC,IACAN,qBAEA,CAEA,OACAO,wBACAlB,+CACAD,+CACAF,+CACAC,gCAEAqB,kBACAL,KAAAC,IACAJ,eACA,WACA,eACAP,kBACAnB,iBAEA,eACA,sBAGA+B,MAAAC,IACAN,mBAMA5C,cACA,kBAGAqD,UAEA,6BAGA9C,cACA,sCACA,+BAEA,yBAGAX,WACAgD,sCACA,sBACA,wBACA,yBAGA1C,UACA0C,eACA,SACA,WACA,iCAQA,sBACA,wBACA,wBACAA,6BACA,oDACA,oDACA,oDACA,qCAXA,mCAcAxC,OACA,aACA,SACA,wCACAkD,6BAEA,oCACAC,uBACAC,sBACAC,mCACAC,mCACAX,KAAA,KACA,kCACAE,MAAAU,YAEA,qCChSgX,I,YCO5WC,EAAY,eACd,EACA1E,EACA0B,GACA,EACA,KACA,WACA,MAIa,aAAAgD,E","file":"js/chunk-2d0b25d5.c5bae0c9.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"main-content\"},[_vm._m(0),_c('div',{staticClass:\"content\"},[_c('div',{staticClass:\"content-btn\"},[_c('el-button',{staticClass:\"init-button\",attrs:{\"icon\":\"el-icon-plus\"},on:{\"click\":function($event){return _vm.addBuild()}}},[_vm._v(\"新增单元\")])],1),_c('VueTable',{ref:\"table\",attrs:{\"config\":_vm.config},on:{\"tableCheck\":_vm.tableCheck}},[_c('template',{slot:\"footer\"},[_c('div',{staticClass:\"table-footer\"},[_c('button',{on:{\"click\":function($event){return _vm.revise(_vm.table_row)}}},[_vm._v(\"修改\")]),_c('button',{on:{\"click\":function($event){return _vm.del(_vm.table_row)}}},[_vm._v(\"删除\")])])])],2)],1),_c('Drawer',{attrs:{\"drawerTitle\":_vm.drawerTitle,\"drawerVrisible\":_vm.drawer_vrisible},on:{\"drawerClose\":_vm.drawerClose}},[_c('div',{staticStyle:{\"padding\":\"30px\"}},[_c('FromCard',[_c('template',{slot:\"title\"},[_vm._v(\"基本信息\")]),[_c('VueForm',{ref:\"childFrom\",attrs:{\"formObj\":_vm.reviseForm},on:{\"ruleSubmit\":_vm.ruleSubmit}})]],2)],1),_c('div',{attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('button',{staticClass:\"btn-orange\",on:{\"click\":function($event){return _vm.onSubmit()}}},[_c('span',[_c('i',{staticClass:\"el-icon-circle-check\"}),_vm._v(\"提交\")])]),_c('button',{staticClass:\"btn-gray\",on:{\"click\":_vm.drawerClose}},[_c('span',[_vm._v(\"取消\")])])])])],1)\n}\nvar staticRenderFns = [function (){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"main-titel\"},[_c('span',[_vm._v(\"单位信息\")])])\n}]\n\nexport { render, staticRenderFns }","<template>\n <div class=\"main-content\">\n <div class=\"main-titel\">\n <span>单位信息</span>\n </div>\n <div class=\"content\">\n <div class=\"content-btn\">\n <el-button class=\"init-button\"\n @click=\"addBuild()\"\n icon=\"el-icon-plus\">新增单元</el-button>\n </div>\n <VueTable ref=\"table\"\n :config='config'\n @tableCheck=\"tableCheck\">\n <template slot=\"footer\">\n <div class=\"table-footer\">\n <button @click=\"revise(table_row)\">修改</button>\n <button @click=\"del(table_row)\">删除</button>\n </div>\n </template>\n </VueTable>\n </div>\n <Drawer :drawerTitle=\"drawerTitle\"\n @drawerClose=\"drawerClose\"\n :drawerVrisible='drawer_vrisible'>\n <div style=\"padding:30px\">\n <FromCard>\n <template slot=\"title\">基本信息</template>\n <template>\n <VueForm ref=\"childFrom\"\n @ruleSubmit='ruleSubmit'\n :formObj='reviseForm'></VueForm>\n </template>\n </FromCard>\n </div>\n <div slot=\"footer\">\n <button class=\"btn-orange\"\n @click=\"onSubmit()\"><span> <i class=\"el-icon-circle-check\"></i>提交</span></button>\n <button class=\"btn-gray\"\n @click=\"drawerClose\"><span>取消</span></button>\n </div>\n </Drawer>\n </div>\n</template>\n<script>\nimport { cpmBuildingUnitUpdate, cpmBuildingUnitInsert, cpmBuildingUnitFindAll } from '@/api/basic'\nexport default {\n data () {\n return {\n // 抽屉标题\n drawerTitle: '',\n // 是否通过校验\n bool: false,\n // 抽屉显示隐藏\n drawer_vrisible: false,\n // 控制弹窗为添加或修改 默认为true 添加\n drawerControl: true,\n\n // 表格配置\n config: {\n thead: [\n { label: '序号', type: 'index', width: '80' },\n { label: '楼栋', prop: 'buildingName', width: 'auto' },\n { label: '单元(号)', prop: 'no', width: 'auto' },\n {\n label: '总层数', prop: 'totalFloor', width: 'auto',\n type: \"function\",\n callback: (row, prop) => `${row.totalFloor}层`\n },\n {\n label: '是否有电梯',\n prop: 'isElevator',\n width: 'auto',\n type: \"function\",\n callback: (row, prop) => `${row.isElevator ? '有电梯' : '无电梯'}`\n },\n { label: '导入编号', prop: 'id', width: 'auto' },\n ],\n loading: true,\n data: {\n pageNum: 1,\n size: 10,\n },\n table_data: [],\n url: 'UnitList',\n // search_item\n search_item: [\n {\n type: 'Input',\n label: '楼栋名称',\n placeholder: '请输入内容',\n prop: 'buildingName'\n },\n {\n type: 'Int',\n label: '单元(号)',\n placeholder: '请输入',\n prop: 'no'\n }\n ],\n },\n // 选中表格数据\n table_row: [],\n reviseForm: {\n ruleForm: {\n isElevator: null,\n no: null,\n totalFloor: null,\n buildingId: null,\n },\n rules: {\n name: [\n {\n required: true,\n message: '请填写楼栋名称',\n trigger: 'blur'\n }\n ],\n no: [\n { required: true, message: '请填写楼栋名称', trigger: 'blur' }\n ],\n },\n form_item: [\n {\n type: 'Select',\n label: '楼栋',\n placeholder: '请输入',\n width: '100%',\n prop: 'buildingId',\n options: [],\n },\n {\n type: 'Int',\n label: '单元(号)',\n placeholder: '请输入',\n width: '100%',\n prop: 'no'\n },\n {\n type: 'Int',\n label: '总层数',\n placeholder: '请输入',\n width: '100%',\n prop: 'totalFloor'\n }, {\n type: 'Select',\n label: '是否有电梯',\n placeholder: '请输入',\n width: '100%',\n prop: 'isElevator',\n options: [\n { value: 0, label: '无电梯' },\n { value: 1, label: '有电梯' }\n ]\n }\n ]\n },\n }\n },\n mounted () {\n // 弹窗内下拉框\n cpmBuildingUnitFindAll().then(res => {\n console.log(res)\n this.reviseForm.form_item[0].options = res\n })\n },\n methods: {\n // 监听验证是否通过from表单\n ruleSubmit (val) {\n this.bool = val;\n },\n // 增加或修改\n onSubmit () {\n // 检查form表单校验\n this.$refs.childFrom.submitForm();\n // 通过from表单验证\n if (this.bool) {\n // 控制是添加还是修改\n if (this.drawerControl) {\n // 添加\n let requestData = {\n buildingId: this.reviseForm.ruleForm.buildingId,\n totalFloor: this.reviseForm.ruleForm.totalFloor,\n isElevator: this.reviseForm.ruleForm.isElevator,\n no: this.reviseForm.ruleForm.no\n }\n cpmBuildingUnitInsert(requestData)\n .then((res) => {\n console.log(res)\n if (res.status) {\n this.$message({\n message: res.message,\n type: 'success'\n })\n this.getData()\n this.drawerClose()\n }\n }).catch((error) => {\n console.log(error)\n })\n } else {\n // 修改\n let requestData = {\n id: this.table_row[0].id,\n buildingId: this.reviseForm.ruleForm.buildingId,\n totalFloor: this.reviseForm.ruleForm.totalFloor,\n isElevator: this.reviseForm.ruleForm.isElevator,\n no: this.reviseForm.ruleForm.no\n }\n cpmBuildingUnitUpdate(requestData)\n .then((res) => {\n console.log(res)\n if (res.status) {\n this.$message({\n message: res.message,\n type: 'success'\n })\n this.getData()\n this.drawerClose()\n }\n })\n .catch((error) => {\n console.log(error)\n })\n }\n }\n },\n // 表格选择数据\n tableCheck (arr) {\n this.table_row = arr\n },\n // 数据加载\n getData () {\n // 调用子组件的方法\n this.$refs.table.loadData()\n },\n // 弹窗关闭\n drawerClose () {\n for (let key in this.reviseForm.ruleForm) {\n this.reviseForm.ruleForm[key] = ''\n }\n this.drawer_vrisible = false\n },\n // 添加\n addBuild () {\n console.log(this.reviseForm.ruleForm)\n this.drawerControl = true;\n this.drawer_vrisible = true\n this.drawerTitle = '添加单元'\n },\n // 修改\n revise (data) {\n console.log(data)\n if (data.length) {\n if (data.length > 1) {\n this.$message.error('只能单条数据修改')\n return\n }\n } else {\n this.$message.error('请选中需要修改的数据')\n return\n }\n\n this.drawerControl = false;\n this.drawerTitle = '修改单元'\n this.drawer_vrisible = true\n console.log(data[0].isElevator)\n this.reviseForm.ruleForm.buildingId = data[0].buildingId\n this.reviseForm.ruleForm.totalFloor = data[0].totalFloor\n this.reviseForm.ruleForm.isElevator = data[0].isElevator\n this.reviseForm.ruleForm.no = data[0].no\n },\n // 删除\n del (data) {\n if (data.length) {\n let arr = []\n for (let i = 0; i < this.table_row.length; i++) {\n arr.push(this.table_row[i].id)\n }\n this.$confirm('是否确认删除?删除不可恢复', '删除', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n confirmButtonClass: 'confirmButton',\n cancelButtonClass: 'cancelButton'\n }).then(() => {\n this.$refs.table.tableDelete(arr)\n }).catch(action => { });\n } else {\n this.$message.error('请选中需要删除的数据');\n }\n },\n }\n}\n</script>\n<style scoped lang='scss'>\n</style>\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./unitInfo.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./unitInfo.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./unitInfo.vue?vue&type=template&id=776a3146&scoped=true&\"\nimport script from \"./unitInfo.vue?vue&type=script&lang=js&\"\nexport * from \"./unitInfo.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"776a3146\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""} |