{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Mobile\\Manage\\MobileSaftyDanger\\index.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Mobile\\Manage\\MobileSaftyDanger\\index.vue","mtime":1691463999696},{"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\r\nimport CmgtSaftyDangerCheckrecordApi from '@/views/Manage/saftyDanger/api/CmgtSaftyDangerCheckrecordApi'\r\nimport productManage from '@/api/device/productManage.js'\r\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\r\nimport ModifyPopup from '@/views/Mobile/Manage/MobileSaftyDanger/components/ModifyPopup/index.vue'\r\nimport QuerySearchPopup from './components/QuerySearchPopup/index.vue'\r\n\r\nconst {CSaftyDangerAbarbeitungList} = CmgtSaftyDangerCheckrecordApi\r\n\r\nexport default {\r\n name: 'MobileSaftyDanger',\r\n components: {QuerySearchPopup, ModifyPopup},\r\n // 隐患查询\r\n data() {\r\n return {\r\n listData: [], // 列表数据\r\n querys: [\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 't.handleStatus', // 处理状态\r\n relation: 'AND',\r\n value: ''\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 't.expireStatus', // 超期状态\r\n relation: 'AND',\r\n value: ''\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 't.type', // 受检单位类别\r\n relation: 'AND',\r\n value: ''\r\n },\r\n {\r\n group: 'main',\r\n operation: 'LIKE',\r\n parentGroup: '',\r\n property: 't.unitName', // 受检单位名称\r\n relation: 'AND',\r\n value: ''\r\n },\r\n {\r\n group: 'main',\r\n operation: 'BETWEEN',\r\n parentGroup: '',\r\n property: 't.latestReviewDate', // 排查时间\r\n relation: 'AND',\r\n value: ''\r\n }\r\n ],\r\n // 自定义请求参数配置对象\r\n customQueryPrams: {\r\n pageSize: 10,\r\n page: 1,\r\n 't.expireStatus': '',\r\n 't.handleStatus': '',\r\n 't.type': '',\r\n 't.unitName': '',\r\n 't.latestReviewDate': ''\r\n },\r\n // 超期状态配置数组对象\r\n expireStatusOpt: [\r\n {text: '全部', value: '', type: 'primary'},\r\n {text: '正常', value: '1', type: 'success'},\r\n {text: '临期', value: '2', type: 'warning'},\r\n {text: '超期', value: '3', type: 'danger'}\r\n ],\r\n // 受检单位配置数组对象\r\n unitsTypeOpt: [\r\n {text: '所有受检单位', value: ''},\r\n ...dictUtils.getDictItemsFromCache('zhgl-dwlx').map(i => {\r\n return {text: i.name, value: i.value}\r\n })\r\n ],\r\n // 超期状态配置数组对象\r\n statusOpt: [\r\n {text: '所有', value: '', type: 'primary'},\r\n {text: '待排查', value: '1', type: 'danger'},\r\n {text: '整改中', value: '2', type: 'warning'},\r\n {text: '已完成', value: '3', type: 'success'}\r\n ],\r\n loading: false,\r\n finished: false,\r\n refreshing: false,\r\n modifyPopup: false, // 修改弹层\r\n querySearchPopup: false, // 搜索弹层\r\n rowInfo: {} // 点击行信息\r\n }\r\n },\r\n computed: {\r\n // 加工为后端需要的请求格式\r\n queryParams() {\r\n const {pageSize, page, ...item} = this.customQueryPrams\r\n /*\r\n * 定义 escapeOpt 字段对应字典名 对象,后续进行字段的翻译逻辑\r\n * 为重新加工结构赋值的新请求配置参数\r\n * */\r\n const escapeOpt = {\r\n 't.handleStatus': 'statusOpt',\r\n 't.expireStatus': 'expireStatusOpt',\r\n 't.type': 'unitsTypeOpt'\r\n }\r\n return {\r\n pageBean: {pageSize, page},\r\n querys: this.querys.map(i => {\r\n let value = item[i.property]\r\n let escape = this[escapeOpt[i.property]]\r\n if (escape) {\r\n value = this.dictionaryEscape(escape, value, {dictionaryType: false})\r\n return {...i, value}\r\n } else {\r\n if (i.property === 't.latestReviewDate') {\r\n value = value === '' ? '' : value.split(' ~ ')\r\n return {...i, value}\r\n }\r\n return {...i, value}\r\n }\r\n })\r\n }\r\n }\r\n },\r\n created() {\r\n this.getListData() // 获取列表数据\r\n },\r\n methods: {\r\n // 字典转义(转义、翻译)\r\n dictionaryEscape(dictionary, val, option = {}) {\r\n if (!(Array.isArray(dictionary) && dictionary.length)) return ''\r\n option = {\r\n valueKey: 'value',\r\n labelKey: 'text',\r\n dictionaryType: true,// true 为转义 false 为翻译\r\n ...option\r\n }\r\n const {valueKey, labelKey, dictionaryType} = option\r\n let item = dictionary.find(i => i[dictionaryType ? valueKey : labelKey] === val) || {}\r\n return item[dictionaryType ? labelKey : valueKey] || ''\r\n },\r\n\r\n // 触底时触发\r\n onLoad() {\r\n this.customQueryPrams.page++\r\n this.getListData(_ => this.loading = false)\r\n },\r\n\r\n // 下拉时触发\r\n onRefresh() {\r\n this.customQueryPrams.page = 1\r\n this.listData = []\r\n this.getListData(_ => this.refreshing = false)\r\n },\r\n\r\n // 获取列表数据\r\n async getListData(callback) {\r\n const {data: {value: {rows, total}}} = await CSaftyDangerAbarbeitungList(this.queryParams)\r\n const {pageSize, page} = this.customQueryPrams\r\n this.listData = this.listData.concat(rows)\r\n this.$nextTick(_ => callback && callback())\r\n if (pageSize * page >= total) this.finished = true\r\n },\r\n\r\n // 打开弹层\r\n showPopup(popupName, rowInfo) {\r\n // 复制数据\r\n if (\r\n Object.prototype.toString.call(rowInfo) === '[object Object]' &&\r\n Object.keys(rowInfo).length) {\r\n this.rowInfo = rowInfo\r\n }\r\n\r\n switch (popupName) {\r\n case 'querySearchPopup' :\r\n this[popupName] = true\r\n break\r\n case 'modifyPopup' :\r\n const {modifyPopup} = this.$refs\r\n modifyPopup.getDetail(rowInfo, _ => this[popupName] = true)\r\n break\r\n }\r\n },\r\n\r\n // 改变数据\r\n changeData(rowInfo) {\r\n const {modifyPopup} = this.$refs\r\n modifyPopup.getDetail(rowInfo, newRowInfo => {\r\n let index = this.listData.findIndex(i => i.id === newRowInfo.id)\r\n this.listData.splice(index, 1, newRowInfo)\r\n this.modifyPopup = false\r\n })\r\n },\r\n\r\n // 查询/重置按钮点击\r\n searchData() {\r\n this.finished = false\r\n this.customQueryPrams.page = 1\r\n this.listData = []\r\n this.getListData()\r\n }\r\n\r\n }\r\n}\r\n",null]}