{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\reform-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\reform-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\reform-fvue\\src\\views\\ReformSituation\\Municipal\\IndexManagement.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\views\\ReformSituation\\Municipal\\IndexManagement.vue","mtime":1743469941154},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.array.sort\";\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//\nimport pagination from '@/components/pagination';\nimport { TableMixin } from '@/mixins/tableMixin';\nimport projectsAPI from '@/api/municipalReform/index.js';\nimport api from '@/api/ReformSituation/municipal';\nimport utils from '@/utils';\nexport default {\n name: 'IndexManagement',\n components: {\n pagination: pagination\n },\n mixins: [TableMixin],\n data: function data() {\n return {\n markLoading: false,\n searchForm: {},\n loading: false,\n tableData: [],\n multipleSelection: [],\n querys: [{\n group: 'main',\n operation: 'LIKE',\n parentGroup: '',\n property: 'index_Name_',\n relation: 'AND',\n value: ''\n }, {\n group: 'main',\n operation: 'EQUAL',\n parentGroup: '',\n property: 'index_type_',\n relation: 'AND',\n value: ''\n }, {\n group: 'main',\n operation: 'EQUAL',\n parentGroup: '',\n property: 'is_use_',\n relation: 'AND',\n value: ''\n }],\n queryParam: {\n pageBean: {\n page: 1,\n pageSize: 20,\n total: 0\n }\n },\n options: [{\n label: '启用',\n value: 1\n }, {\n label: '禁用',\n value: 0\n }]\n };\n },\n created: function created() {\n this.getData();\n },\n mounted: function mounted() {},\n methods: {\n getDictName: function getDictName(code, value) {\n return utils.getDictName(code, value);\n },\n selectHandle: function selectHandle(row) {\n if (row.status != 1) {\n return true;\n }\n },\n // 字段必填校验\n requiredCheck: function requiredCheck(data) {\n var indexName = data.indexName,\n indexType = data.indexType,\n indexUnit = data.indexUnit,\n sn = data.sn;\n\n if (!indexName) {\n this.$message.error('指标名称不能为空');\n return false;\n } else if (!indexType) {\n this.$message.error('指标类型不能为空');\n return false;\n } else if (!indexUnit) {\n this.$message.error('指标单位不能为空');\n return false;\n } else if (!sn) {\n this.$message.error('排序号不能为空');\n return false;\n } else {\n return true;\n }\n },\n // 添加\n handleAdd: function handleAdd() {\n this.tableData.unshift({\n indexName: '',\n indexType: 1,\n indexUnit: '',\n sn: '',\n isUse: true,\n type: 'edit'\n });\n },\n // \n handleEdit: function handleEdit(row, index) {\n row.type = 'edit';\n },\n // 启用或禁用指标\n switchChange: function switchChange(row) {\n var _this = this;\n\n if (row.id) {\n this.loading = true;\n var data = JSON.parse(JSON.stringify(row));\n data.isUse = data.isUse ? 1 : 0;\n api.updateIndex(data).then(function (res) {\n if (res.state) {\n var msg = data.isUse ? '指标启用成功!' : '指标禁用成功!';\n\n _this.$message.success(msg);\n\n _this.getData();\n }\n });\n }\n },\n // 取消\n handleCancel: function handleCancel(row) {\n if (row.id) {\n row.type = 'detail';\n } else {\n this.tableData.shift();\n }\n },\n //保存\n handleDbClick: function handleDbClick(row) {\n var _this2 = this;\n\n var data = JSON.parse(JSON.stringify(row));\n data.isUse = data.isUse ? 1 : 0;\n var flag = this.requiredCheck(data);\n\n if (flag) {\n this.loading = true;\n var apiName = row.id ? 'updateIndex' : 'addIndex';\n api[apiName](data).then(function (res) {\n if (res.state) {\n var msg = row.id ? '指标修改保存成功!' : '新增指标成功!';\n\n _this2.$message.success(msg);\n\n _this2.getData();\n }\n });\n }\n },\n handleSearch: function handleSearch(page) {\n var _this3 = this;\n\n this.queryParam.querys = [];\n this.querys.forEach(function (item) {\n if (item.value !== undefined) {\n _this3.queryParam.querys.push(item);\n }\n });\n\n if (page) {\n this.queryParam.pageBean.page = page;\n }\n\n this.getData();\n },\n //获取数据\n getData: function getData() {\n var _this4 = this;\n\n this.loading = true;\n this.tableData = [];\n this.queryParam.querys = this.querys;\n api.getIndexTable(this.queryParam).then(function (res) {\n if (res.rows) {\n var arr = res.rows.map(function (item) {\n item.isUse = item.isUse > 0 ? true : false;\n item.type = 'detail';\n return item;\n });\n _this4.tableData = arr.sort(function (a, b) {\n return a.sn - b.sn;\n });\n _this4.queryParam.pageBean.page = res.page;\n _this4.queryParam.pageBean.total = res.total; // this.$set(this.tableData)\n\n _this4.loading = false;\n }\n });\n },\n //表格选中\n handleSelectionChange: function handleSelectionChange(val) {\n var _this5 = this;\n\n this.multipleSelection = [];\n this.$refs.multipleSelection.selection.forEach(function (item) {\n _this5.multipleSelection.push(item.id);\n });\n },\n //展示数量\n handleSizeChange: function handleSizeChange(val) {\n this.queryParam.pageBean.pageSize = val;\n this.handleSearch(1);\n },\n //表格页数\n handleCurrentChange: function handleCurrentChange(val) {\n this.queryParam.pageBean.page = val;\n this.handleSearch(val);\n }\n }\n};",null]}