{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\mixins\\view-module.js","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\mixins\\view-module.js","mtime":1622438583806},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/web.dom.iterable\";\nimport _defineProperty from \"C:\\\\Users\\\\27446\\\\Desktop\\\\up\\\\front\\\\dkha-web-sz-main\\\\node_modules\\\\@babel\\\\runtime-corejs2/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport Cookies from 'js-cookie';\nimport qs from 'qs';\nimport { getDictDataListAll, getPersonRegion } from '@/utils';\nexport default {\n data: function data() {\n /* eslint-disable */\n return {\n // 设置属性\n mixinViewModuleOptions: {\n createdIsNeed: true,\n // 此页面是否在创建时,调用查询数据列表接口?\n activatedIsNeed: true,\n // 此页面是否在激活(进入)时,调用查询数据列表接口?\n getDataListURL: '',\n // 数据列表接口,API地址\n getDataListIsPage: false,\n // 数据列表接口,是否需要分页?\n deleteURL: '',\n // 删除接口,API地址\n deleteIsBatch: false,\n // 删除接口,是否需要批量?\n deleteIsBatchKey: 'id',\n // 删除接口,批量状态下由那个key进行标记操作?比如:pid,uid...\n exportURL: '',\n // 导出接口,API地址\n needCheckRecord: false //是否需要在翻页的时候 记录勾选状态\n\n },\n // 默认属性\n dataForm: {},\n // 查询条件\n dataList: [],\n // 数据列表\n order: '',\n // 排序,asc/desc\n orderField: '',\n // 排序,字段\n page: 1,\n // 当前页码\n limit: 10,\n // 每页数\n total: 0,\n // 总条数\n dataListLoading: false,\n // 数据列表,loading状态\n dataListSelections: [],\n // 数据列表,多选项\n addOrUpdateVisible: false,\n // 新增/更新,弹窗visible状态\n checkList: {} //分页跳转 记录 勾选状态\n\n /* eslint-enable */\n\n };\n },\n created: function created() {\n var params = this.$route.params;\n\n for (var key in this.dataForm) {\n if (params[key]) {\n this.dataForm[key] = params[key];\n }\n }\n\n if (this.mixinViewModuleOptions.createdIsNeed) {\n this.query();\n }\n },\n activated: function activated() {\n var params = this.$route.params;\n\n for (var key in this.dataForm) {\n if (params[key]) {\n this.dataForm[key] = params[key];\n }\n }\n\n if (this.mixinViewModuleOptions.activatedIsNeed) {\n this.query();\n }\n },\n methods: {\n // 获取数据列表\n query: function query() {\n var _this = this;\n\n this.dataListLoading = true;\n this.$http.get(this.mixinViewModuleOptions.getDataListURL, {\n params: _objectSpread({\n order: this.order,\n orderField: this.orderField,\n page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null,\n limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null\n }, this.dataForm)\n }).then(function (_ref) {\n var res = _ref.data;\n _this.dataListLoading = false;\n\n if (res.code !== 0) {\n _this.dataList = [];\n _this.total = 0;\n return _this.$message.error(res.msg);\n }\n\n _this.dataList = _this.mixinViewModuleOptions.getDataListIsPage ? res.data.list : res.data;\n _this.total = _this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0;\n var list = _this.checkList[_this.page];\n\n if (_this.mixinViewModuleOptions.needCheckRecord && list && list.length > 0) {\n _this.$nextTick(function () {\n var func = _this.$refs.tableSelect.toggleRowSelection;\n var ids = list.map(function (item) {\n return item.id;\n });\n\n _this.dataList.forEach(function (item) {\n if (ids.includes(item.id)) {\n func(item, true);\n }\n });\n });\n }\n }).catch(function () {\n _this.dataListLoading = false;\n });\n },\n // 表单重置\n resetForm: function resetForm(formName) {\n this.$refs[formName].resetFields(); // 当存在 el-date-picker && ( type=\"daterange\"||type=\"datetimerange\")时,将变量定义为daterange\n\n if (this.daterange) {\n this.daterange = null;\n }\n\n this.page = 1;\n this.limit = 10;\n this.query();\n },\n // 多选\n dataListSelectionChangeHandle: function dataListSelectionChangeHandle(val) {\n this.dataListSelections = val;\n this.checkList[this.page] = JSON.parse(JSON.stringify(val));\n },\n // 排序\n dataListSortChangeHandle: function dataListSortChangeHandle(data) {\n if (!data.order || !data.prop) {\n this.order = '';\n this.orderField = '';\n return false;\n }\n\n this.order = data.order.replace(/ending$/, '');\n this.orderField = data.prop.replace(/([A-Z])/g, '_$1').toLowerCase();\n this.query();\n },\n // 分页, 每页条数\n pageSizeChangeHandle: function pageSizeChangeHandle(val) {\n this.page = 1;\n this.limit = val;\n this.query();\n },\n // 分页, 当前页\n pageCurrentChangeHandle: function pageCurrentChangeHandle(val) {\n this.page = val;\n this.query();\n },\n getDataList: function getDataList() {\n this.page = 1;\n this.checkList = {};\n this.query();\n },\n // 新增 / 修改\n addOrUpdateHandle: function addOrUpdateHandle(id) {\n var _this2 = this;\n\n this.addOrUpdateVisible = true;\n this.$nextTick(function () {\n _this2.$refs.addOrUpdate.dataForm.id = id;\n\n _this2.$refs.addOrUpdate.init();\n });\n },\n // 关闭当前窗口\n closeCurrentTab: function closeCurrentTab(data) {\n var tabName = this.$store.state.contentTabsActiveName;\n this.$store.state.contentTabs = this.$store.state.contentTabs.filter(function (item) {\n return item.name !== tabName;\n });\n\n if (this.$store.state.contentTabs.length <= 0) {\n this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home';\n return false;\n }\n\n if (tabName === this.$store.state.contentTabsActiveName) {\n this.$router.push({\n name: this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1].name\n });\n }\n },\n // 删除\n deleteHandle: function deleteHandle(id, type) {\n var _this3 = this;\n\n if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {\n return this.$message({\n message: this.$t('prompt.deleteBatch'),\n type: 'warning',\n duration: 500\n });\n }\n\n this.$confirm(this.$t('prompt.info', {\n 'handle': this.$t('delete')\n }), this.$t('prompt.title'), {\n confirmButtonText: this.$t('confirm'),\n cancelButtonText: this.$t('cancel'),\n type: 'warning'\n }).then(function () {\n _this3.$http.delete(\"\".concat(_this3.mixinViewModuleOptions.deleteURL).concat(_this3.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id), _this3.mixinViewModuleOptions.deleteIsBatch ? {\n 'data': id ? [id] : _this3.dataListSelections.map(function (item) {\n return item[_this3.mixinViewModuleOptions.deleteIsBatchKey];\n })\n } : {}).then(function (_ref2) {\n var res = _ref2.data;\n\n if (res.code !== 0) {\n return _this3.$message.error(res.msg);\n }\n\n if (type) {\n //字典码表\n getDictDataListAll(); //行政区域\n\n getPersonRegion();\n }\n\n _this3.$message({\n message: _this3.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: function onClose() {\n if (_this3.dataList.length === 1 && _this3.page > 1) {\n --_this3.page;\n }\n\n _this3.query();\n }\n });\n }).catch(function () {});\n }).catch(function () {});\n },\n // 导出\n exportHandle: function exportHandle() {\n var params = qs.stringify(_objectSpread({\n 'access_token': Cookies.get('access_token')\n }, this.dataForm));\n window.location.href = \"\".concat(window.SITE_CONFIG['apiURL']).concat(this.mixinViewModuleOptions.exportURL, \"?\").concat(params);\n }\n }\n};",{"version":3,"sources":["C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\mixins\\view-module.js"],"names":["Cookies","qs","getDictDataListAll","getPersonRegion","data","mixinViewModuleOptions","createdIsNeed","activatedIsNeed","getDataListURL","getDataListIsPage","deleteURL","deleteIsBatch","deleteIsBatchKey","exportURL","needCheckRecord","dataForm","dataList","order","orderField","page","limit","total","dataListLoading","dataListSelections","addOrUpdateVisible","checkList","created","params","$route","key","query","activated","methods","$http","get","then","res","code","$message","error","msg","list","length","$nextTick","func","$refs","tableSelect","toggleRowSelection","ids","map","item","id","forEach","includes","catch","resetForm","formName","resetFields","daterange","dataListSelectionChangeHandle","val","JSON","parse","stringify","dataListSortChangeHandle","prop","replace","toLowerCase","pageSizeChangeHandle","pageCurrentChangeHandle","getDataList","addOrUpdateHandle","addOrUpdate","init","closeCurrentTab","tabName","$store","state","contentTabsActiveName","contentTabs","filter","name","sidebarMenuActiveName","$router","push","deleteHandle","type","message","$t","duration","$confirm","confirmButtonText","cancelButtonText","delete","onClose","exportHandle","window","location","href","SITE_CONFIG"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,OAAP,MAAoB,WAApB;AACA,OAAOC,EAAP,MAAe,IAAf;AACA,SACIC,kBADJ,EAEIC,eAFJ,QAGO,SAHP;AAKA,eAAe;AACXC,EAAAA,IADW,kBACJ;AACH;AACA,WAAO;AACH;AACAC,MAAAA,sBAAsB,EAAE;AACpBC,QAAAA,aAAa,EAAE,IADK;AACC;AACrBC,QAAAA,eAAe,EAAE,IAFG;AAEG;AACvBC,QAAAA,cAAc,EAAE,EAHI;AAGA;AACpBC,QAAAA,iBAAiB,EAAE,KAJC;AAIM;AAC1BC,QAAAA,SAAS,EAAE,EALS;AAKL;AACfC,QAAAA,aAAa,E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mBAAM;AACX,kBAAI,MAAI,CAAC9E,QAAL,CAAc0B,MAAd,KAAyB,CAAzB,IAA8B,MAAI,CAACvB,IAAL,GAAY,CAA9C,EAAiD;AAC7C,kBAAE,MAAI,CAACA,IAAP;AACH;;AACD,cAAA,MAAI,CAACW,KAAL;AACH;AATS,WAAd;AAWH,SA5BD,EA4BGwB,KA5BH,CA4BS,YAAM,CACd,CA7BD;AA8BH,OArCD,EAqCGA,KArCH,CAqCS,YAAM,CACd,CAtCD;AAuCH,KA1JI;AA2JL;AACAyC,IAAAA,YA5JK,0BA4JU;AACX,UAAIpE,MAAM,GAAG1B,EAAE,CAAC8D,SAAH;AACT,wBAAgB/D,OAAO,CAACkC,GAAR,CAAY,cAAZ;AADP,SAEN,KAAKnB,QAFC,EAAb;AAIAiF,MAAAA,MAAM,CAACC,QAAP,CAAgBC,IAAhB,aAA0BF,MAAM,CAACG,WAAP,CAAmB,QAAnB,CAA1B,SAAyD,KAAK9F,sBAAL,CAA4BQ,SAArF,cAAkGc,MAAlG;AACH;AAlKI;AAxDE,CAAf","sourcesContent":["import Cookies from 'js-cookie'\nimport qs from 'qs'\nimport {\n getDictDataListAll,\n getPersonRegion\n} from '@/utils'\n\nexport default {\n data() {\n /* eslint-disable */\n return {\n // 设置属性\n mixinViewModuleOptions: {\n createdIsNeed: true, // 此页面是否在创建时,调用查询数据列表接口?\n activatedIsNeed: true, // 此页面是否在激活(进入)时,调用查询数据列表接口?\n getDataListURL: '', // 数据列表接口,API地址\n getDataListIsPage: false, // 数据列表接口,是否需要分页?\n deleteURL: '', // 删除接口,API地址\n deleteIsBatch: false, // 删除接口,是否需要批量?\n deleteIsBatchKey: 'id', // 删除接口,批量状态下由那个key进行标记操作?比如:pid,uid...\n exportURL: '', // 导出接口,API地址\n needCheckRecord: false //是否需要在翻页的时候 记录勾选状态\n },\n // 默认属性\n dataForm: {}, // 查询条件\n dataList: [], // 数据列表\n order: '', // 排序,asc/desc\n orderField: '', // 排序,字段\n page: 1, // 当前页码\n limit: 10, // 每页数\n total: 0, // 总条数\n dataListLoading: false, // 数据列表,loading状态\n dataListSelections: [], // 数据列表,多选项\n addOrUpdateVisible: false, // 新增/更新,弹窗visible状态\n checkList: {} //分页跳转 记录 勾选状态\n }\n /* eslint-enable */\n },\n created() {\n let params = this.$route.params;\n for (var key in this.dataForm) {\n\n if (params[key]) {\n this.dataForm[key] = params[key]\n }\n }\n\n if (this.mixinViewModuleOptions.createdIsNeed) {\n this.query()\n }\n },\n activated() {\n let params = this.$route.params;\n for (var key in this.dataForm) {\n\n if (params[key]) {\n this.dataForm[key] = params[key]\n }\n }\n if (this.mixinViewModuleOptions.activatedIsNeed) {\n this.query()\n }\n },\n methods: {\n // 获取数据列表\n query() {\n this.dataListLoading = true\n this.$http.get(\n this.mixinViewModuleOptions.getDataListURL, {\n params: {\n order: this.order,\n orderField: this.orderField,\n page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null,\n limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null,\n ...this.dataForm,\n }\n }\n ).then(({\n data: res\n }) => {\n this.dataListLoading = false\n if (res.code !== 0) {\n this.dataList = []\n this.total = 0\n return this.$message.error(res.msg)\n }\n this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? res.data.list : res.data\n this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0\n let list = this.checkList[this.page]\n if (this.mixinViewModuleOptions.needCheckRecord && list && list.length > 0) {\n this.$nextTick(() => {\n let func = this.$refs.tableSelect.toggleRowSelection;\n let ids = list.map(item => item.id);\n this.dataList.forEach(item => {\n if (ids.includes(item.id)) {\n func(item, true)\n }\n })\n })\n }\n }).catch(() => {\n this.dataListLoading = false\n })\n },\n // 表单重置\n resetForm(formName) {\n this.$refs[formName].resetFields();\n // 当存在 el-date-picker && ( type=\"daterange\"||type=\"datetimerange\")时,将变量定义为daterange\n if (this.daterange) {\n this.daterange = null\n }\n this.page = 1\n this.limit = 10\n this.query()\n },\n // 多选\n dataListSelectionChangeHandle(val) {\n this.dataListSelections = val\n this.checkList[this.page] = JSON.parse(JSON.stringify(val))\n },\n // 排序\n dataListSortChangeHandle(data) {\n if (!data.order || !data.prop) {\n this.order = ''\n this.orderField = ''\n return false\n }\n this.order = data.order.replace(/ending$/, '')\n this.orderField = data.prop.replace(/([A-Z])/g, '_$1').toLowerCase()\n this.query()\n },\n // 分页, 每页条数\n pageSizeChangeHandle(val) {\n this.page = 1\n this.limit = val\n this.query()\n },\n // 分页, 当前页\n pageCurrentChangeHandle(val) {\n this.page = val\n this.query()\n },\n getDataList: function () {\n this.page = 1\n this.checkList = {};\n this.query()\n },\n // 新增 / 修改\n addOrUpdateHandle(id) {\n this.addOrUpdateVisible = true\n this.$nextTick(() => {\n this.$refs.addOrUpdate.dataForm.id = id\n this.$refs.addOrUpdate.init()\n })\n },\n // 关闭当前窗口\n closeCurrentTab(data) {\n var tabName = this.$store.state.contentTabsActiveName\n this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)\n if (this.$store.state.contentTabs.length <= 0) {\n this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home'\n return false\n }\n if (tabName === this.$store.state.contentTabsActiveName) {\n this.$router.push({\n name: this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1].name\n })\n }\n },\n // 删除\n deleteHandle(id, type) {\n if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {\n return this.$message({\n message: this.$t('prompt.deleteBatch'),\n type: 'warning',\n duration: 500\n })\n }\n this.$confirm(this.$t('prompt.info', {\n 'handle': this.$t('delete')\n }), this.$t('prompt.title'), {\n confirmButtonText: this.$t('confirm'),\n cancelButtonText: this.$t('cancel'),\n type: 'warning'\n }).then(() => {\n this.$http.delete(\n `${this.mixinViewModuleOptions.deleteURL}${this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id}`,\n this.mixinViewModuleOptions.deleteIsBatch ? {\n 'data': id ? [id] : this.dataListSelections.map(item => item[this.mixinViewModuleOptions.deleteIsBatchKey])\n } : {}\n ).then(({\n data: res\n }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n if (type) {\n //字典码表\n getDictDataListAll();\n //行政区域\n getPersonRegion();\n }\n this.$message({\n message: this.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: () => {\n if (this.dataList.length === 1 && this.page > 1) {\n --this.page\n }\n this.query()\n }\n })\n }).catch(() => {\n })\n }).catch(() => {\n })\n },\n // 导出\n exportHandle() {\n var params = qs.stringify({\n 'access_token': Cookies.get('access_token'),\n ...this.dataForm\n })\n window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}`\n }\n }\n}\n"]}]}