{"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\\MobileSaftyDangerCheckPlan\\index.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Mobile\\Manage\\MobileSaftyDangerCheckPlan\\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\r\nimport programApi from '@/views/Manage/saftyDanger/api/programApi'\r\nimport DingMaterialApi from '../api/DingMaterialApi'\r\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\r\nimport QuerySearchPopup from './components/QuerySearchPopup/index.vue'\r\n\r\nconst {loadCmgtSaftyDangerUnit} = programApi\r\nconst {loadCmgtSaftyDangerCheckrecord} = DingMaterialApi\r\n\r\nexport default {\r\n name: 'MobileSaftyDangerCheckPlan',\r\n components: {QuerySearchPopup},\r\n // 安全排查\r\n data() {\r\n return {\r\n querys: [\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'checkschemeId', // 排查方案\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: 'status', // 整改状态\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: 'unit_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: 'unit_name_', // 受检单位\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: 'checkDate', // 最后复查时间\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 checkschemeId: '',\r\n status: '',\r\n unit_type_: '',\r\n unit_name_: '',\r\n checkDate: ''\r\n },\r\n listData: [], // 列表数据\r\n troubleshootingPlanOpt: [], // 排查方案配置数组对象\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 querySearchPopup: false, // 搜索弹层\r\n loading: false, // 列表加载loading状态\r\n finished: false, // 是否数据加载完毕\r\n refreshing: false // 下拉刷新\r\n }\r\n },\r\n computed: {\r\n // 加工为后端需要的请求格式\r\n queryParams() {\r\n const {pageSize, page, ...item} = this.customQueryPrams\r\n return {\r\n pageBean: {pageSize, page},\r\n querys: this.querys.map(i => {\r\n return {...i, value: item[i.property]}\r\n })\r\n }\r\n }\r\n },\r\n created() {\r\n this.getTroubleshootingPlanOpt() // 获取排查方案配置数组对象\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 getTroubleshootingPlanOpt() {\r\n loadCmgtSaftyDangerUnit(\r\n {\r\n pageBean: {\r\n pageSize: -1, page: 1\r\n },\r\n querys: [\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'pubState',\r\n relation: 'AND',\r\n value: 2\r\n }\r\n ]\r\n },\r\n res => {\r\n this.troubleshootingPlanOpt = [\r\n {text: '所有排查方案', value: ''},\r\n ...res.rows.map(item => {\r\n return {text: item.schemeName, value: item.pkVal}\r\n })\r\n ]\r\n }\r\n )\r\n },\r\n\r\n // 跳转设备详情\r\n handleDetail(item) {\r\n this.$router.push({\r\n name: 'MobileSaftyDangerCheckPlanDetail',\r\n query: {id: item.id}\r\n })\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 /*\r\n * 定义 escapeOpt 字段对应字典名 对象,后续进行字段的翻译逻辑\r\n * queryParams 为重新加工结构赋值的新请求配置参数\r\n * */\r\n const escapeOpt = {\r\n status: 'statusOpt',\r\n unit_type_: 'unitsTypeOpt',\r\n checkschemeId: 'troubleshootingPlanOpt'\r\n }\r\n const queryParams = {\r\n ...this.queryParams,\r\n querys: this.queryParams.querys.map(i => {\r\n if (i.property === 'checkDate') {\r\n return {\r\n ...i,\r\n value: i.value === '' ? '' : i.value.split(' ~ ')\r\n }\r\n }\r\n let escape = this[escapeOpt[i.property]]\r\n if (!escape) return i\r\n return {\r\n ...i,\r\n value: this.dictionaryEscape(escape, i.value, {dictionaryType: false})\r\n }\r\n })\r\n }\r\n\r\n const {data: {rows, total}} = await loadCmgtSaftyDangerCheckrecord(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) {\r\n this[popupName] = true\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",null]}