{"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\\MobileTrainingPlan\\index.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Mobile\\Manage\\MobileTrainingPlan\\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\r\nimport SecurityFileApi from '@/views/Manage/saftyDanger/api/SecurityFileApi'\r\nimport dictUtils from '@/components/dict/DictSelectUtils'\r\nimport QuerySearchPopup from './components/QuerySearchPopup/index.vue'\r\n\r\nconst {loadCmgtSaftyTrainingPlan} = SecurityFileApi\r\n\r\nexport default {\r\n name: 'MobileTrainingPlan',\r\n components: {QuerySearchPopup},\r\n // 隐患档案查询\r\n data() {\r\n return {\r\n // 自定义请求参数配置对象\r\n customQueryPrams: {\r\n pageSize: 10,\r\n page: 1,\r\n 'unit_name_': '', // 单位名称\r\n 'type_': '', // 受检单位类别\r\n 'name_': '' // 负责人姓名\r\n },\r\n listData: [],// 列表数据\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 loading: false, // 列表是否触发loading\r\n finished: false, // 列表是否加载完成\r\n refreshing: false, // 列表是否开始下拉刷新\r\n querySearchPopup: false // 搜索弹层\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 querys = [\r\n {\r\n group: 'main',\r\n operation: 'LIKE',\r\n parentGroup: '',\r\n property: 'unit_name_',\r\n relation: 'AND'\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'type_',\r\n relation: 'AND'\r\n },\r\n {\r\n group: 'main',\r\n operation: 'LIKE',\r\n parentGroup: '',\r\n property: 'name_',\r\n relation: 'AND'\r\n }\r\n ]\r\n const escapeOpt = {'type_': 'unitsTypeOpt'}\r\n return {\r\n pageBean: {pageSize, page},\r\n querys: querys.map(i => {\r\n let value = item[i.property]\r\n let escape = this[escapeOpt[i.property]]\r\n if (!escape) return {...i, value}\r\n value = this.dictionaryEscape(escape, value, {dictionaryType: false})\r\n return {...i, value}\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 goSecurityInvestigationPlan({unitName, id}) {\r\n this.$router.push({\r\n name: 'securityInvestigationPlan',\r\n query: {unitName, id}\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 showPopup(popupName) {\r\n this[popupName] = true\r\n },\r\n\r\n // 获取列表数据\r\n async getListData(callback) {\r\n const {data: {rows, total}} = await loadCmgtSaftyTrainingPlan(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 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]}