Files
tekelanew_acs/acs/nladmin-ui/node_modules/.cache/babel-loader/b4e0550f4fac87e56924030aa3aad08c.json
2024-12-05 09:33:18 +08:00

1 line
12 KiB
JSON

{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\eslint-loader\\index.js??ref--13-0!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\mixins\\crud.js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\mixins\\crud.js","mtime":1732871026540},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\babel.config.js","mtime":1732871025888},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\eslint-loader\\index.js","mtime":1732872823677}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _interopRequireDefault = require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/interopRequireDefault.js\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nrequire(\"core-js/modules/es6.array.sort\");\nvar _objectSpread2 = _interopRequireDefault(require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/objectSpread2.js\"));\nvar _regeneratorRuntime2 = _interopRequireDefault(require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/regeneratorRuntime.js\"));\nrequire(\"regenerator-runtime/runtime\");\nvar _asyncToGenerator2 = _interopRequireDefault(require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/asyncToGenerator.js\"));\nvar _data = require(\"@/api/data\");\nvar _index = require(\"@/utils/index\");\nvar _permission = _interopRequireDefault(require(\"@/utils/permission\"));\nvar _default = exports.default = {\n data: function data() {\n return {\n // 表格数据\n data: [],\n // 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']\n sort: ['id,desc'],\n // 页码\n page: 0,\n // 每页数据条数\n size: 10,\n // 总数据条数\n total: 0,\n // 请求数据的url\n url: '',\n // 查询数据的参数\n params: {},\n // 待查询的对象\n query: {},\n // 等待时间\n time: 50,\n // 是否为新增类型的表单\n isAdd: false,\n // 导出的 Loading\n downloadLoading: false,\n // 表格 Loading 属性\n loading: true,\n // 删除 Loading 属性\n delLoading: false,\n delAllLoading: false,\n // 弹窗属性\n dialog: false,\n // Form 表单\n form: {},\n // 重置表单\n resetForm: {},\n // 标题\n title: ''\n };\n },\n methods: {\n parseTime: _index.parseTime,\n downloadFile: _index.downloadFile,\n checkPermission: _permission.default,\n init: function () {\n var _init = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {\n var _this = this;\n return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this.beforeInit();\n case 2:\n if (_context.sent) {\n _context.next = 4;\n break;\n }\n return _context.abrupt(\"return\");\n case 4:\n return _context.abrupt(\"return\", new Promise(function (resolve, reject) {\n _this.loading = true;\n // 请求数据\n (0, _data.initData)(_this.url, _this.getQueryParame()).then(function (data) {\n _this.total = data.totalElements;\n _this.data = data.content;\n // time 毫秒后显示表格\n setTimeout(function () {\n _this.loading = false;\n }, _this.time);\n resolve(data);\n }).catch(function (err) {\n _this.loading = false;\n reject(err);\n });\n }));\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function init() {\n return _init.apply(this, arguments);\n }\n return init;\n }(),\n beforeInit: function beforeInit() {\n return true;\n },\n getQueryParame: function getQueryParame() {\n return (0, _objectSpread2.default)((0, _objectSpread2.default)({\n page: this.page,\n size: this.size,\n sort: this.sort\n }, this.query), this.params);\n },\n // 改变页码\n pageChange: function pageChange(e) {\n this.page = e - 1;\n this.init();\n },\n // 改变每页显示数\n sizeChange: function sizeChange(e) {\n this.page = 0;\n this.size = e;\n this.init();\n },\n // 预防删除第二页最后一条数据时,或者多选删除第二页的数据时,页码错误导致请求无数据\n dleChangePage: function dleChangePage(size) {\n if (size === undefined) {\n size = 1;\n }\n if (this.data.length === size && this.page !== 0) {\n this.page = this.page - 1;\n }\n },\n // 查询方法\n toQuery: function toQuery() {\n this.page = 0;\n this.init();\n },\n /**\r\n * 通用的提示封装\r\n */\n submitSuccessNotify: function submitSuccessNotify() {\n this.$notify({\n title: '提交成功',\n type: 'success',\n duration: 2500\n });\n },\n addSuccessNotify: function addSuccessNotify() {\n this.$notify({\n title: '新增成功',\n type: 'success',\n duration: 2500\n });\n },\n editSuccessNotify: function editSuccessNotify() {\n this.$notify({\n title: '编辑成功',\n type: 'success',\n duration: 2500\n });\n },\n delSuccessNotify: function delSuccessNotify() {\n this.$notify({\n title: '删除成功',\n type: 'success',\n duration: 2500\n });\n },\n notify: function notify(title, type) {\n this.$notify({\n title: title,\n type: type,\n duration: 2500\n });\n },\n /**\r\n * 删除前可以调用 beforeDelMethod 做一些操作\r\n */\n beforeDelMethod: function beforeDelMethod() {\n return true;\n },\n /**\r\n * 通用的删除\r\n */\n delMethod: function delMethod(id) {\n var _this2 = this;\n if (!this.beforeDelMethod()) {\n return;\n }\n this.delLoading = true;\n this.crudMethod.del(id).then(function () {\n _this2.delLoading = false;\n _this2.$refs[id].doClose();\n _this2.dleChangePage();\n _this2.delSuccessNotify();\n _this2.afterDelMethod();\n _this2.init();\n }).catch(function () {\n _this2.delLoading = false;\n _this2.$refs[id].doClose();\n });\n },\n afterDelMethod: function afterDelMethod() {},\n /**\r\n * 多选删除提示\r\n */\n beforeDelAllMethod: function beforeDelAllMethod() {\n var _this3 = this;\n this.$confirm('你确定删除选中的数据吗?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n _this3.delAllMethod();\n });\n },\n /**\r\n * 多选删除\r\n */\n delAllMethod: function delAllMethod() {\n var _this4 = this;\n this.delAllLoading = true;\n var data = this.$refs.table.selection;\n var ids = [];\n for (var i = 0; i < data.length; i++) {\n ids.push(data[i].id);\n }\n this.crudMethod.delAll(ids).then(function () {\n _this4.delAllLoading = false;\n _this4.dleChangePage(ids.length);\n _this4.init();\n _this4.$notify({\n title: '删除成功',\n type: 'success',\n duration: 2500\n });\n }).catch(function () {\n _this4.delAllLoading = false;\n });\n },\n /**\r\n * 显示新增弹窗前可以调用该方法\r\n */\n beforeShowAddForm: function beforeShowAddForm() {},\n /**\r\n * 显示新增弹窗\r\n */\n showAddFormDialog: function showAddFormDialog() {\n this.isAdd = true;\n this.resetForm = JSON.parse(JSON.stringify(this.form));\n this.beforeShowAddForm();\n this.dialog = true;\n },\n /**\r\n * 显示编辑弹窗前可以调用该方法\r\n */\n beforeShowEditForm: function beforeShowEditForm(data) {},\n /**\r\n * 显示编辑弹窗\r\n */\n showEditFormDialog: function showEditFormDialog() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n this.isAdd = false;\n if (data) {\n this.resetForm = JSON.parse(JSON.stringify(this.form));\n this.form = JSON.parse(JSON.stringify(data));\n }\n this.beforeShowEditForm(data);\n this.dialog = true;\n },\n /**\r\n * 新增方法\r\n */\n addMethod: function addMethod() {\n var _this5 = this;\n this.crudMethod.add(this.form).then(function () {\n _this5.addSuccessNotify();\n _this5.loading = false;\n _this5.afterAddMethod();\n _this5.cancel();\n _this5.init();\n }).catch(function () {\n _this5.loading = false;\n _this5.afterAddErrorMethod();\n });\n },\n /**\r\n * 新增后可以调用该方法\r\n */\n afterAddMethod: function afterAddMethod() {},\n /**\r\n * 新增失败后调用该方法\r\n */\n afterAddErrorMethod: function afterAddErrorMethod() {},\n /**\r\n * 通用的编辑方法\r\n */\n editMethod: function editMethod() {\n var _this6 = this;\n this.crudMethod.edit(this.form).then(function () {\n _this6.editSuccessNotify();\n _this6.loading = false;\n _this6.afterEditMethod();\n _this6.cancel();\n _this6.init();\n }).catch(function () {\n _this6.loading = false;\n });\n },\n /**\r\n * 编辑后可以调用该方法\r\n */\n afterEditMethod: function afterEditMethod() {},\n /**\r\n * 提交前可以调用该方法\r\n */\n beforeSubmitMethod: function beforeSubmitMethod() {\n return true;\n },\n /**\r\n * 提交\r\n */\n submitMethod: function submitMethod() {\n var _this7 = this;\n if (!this.beforeSubmitMethod()) {\n return;\n }\n if (this.$refs['form']) {\n this.$refs['form'].validate(function (valid) {\n if (valid) {\n _this7.loading = true;\n if (_this7.isAdd) {\n _this7.addMethod();\n } else _this7.editMethod();\n }\n });\n }\n },\n /**\r\n * 隐藏弹窗\r\n */\n cancel: function cancel() {\n this.dialog = false;\n if (this.$refs['form']) {\n this.$refs['form'].clearValidate();\n this.form = this.resetForm;\n }\n },\n /**\r\n * 获取弹窗的标题\r\n */\n getFormTitle: function getFormTitle() {\n return this.isAdd ? \"\\u65B0\\u589E\".concat(this.title) : \"\\u7F16\\u8F91\".concat(this.title);\n },\n /**\r\n * 通用导出\r\n */\n downloadMethod: function downloadMethod() {\n var _this8 = this;\n this.beforeInit();\n this.downloadLoading = true;\n (0, _data.download)(this.url + '/download', this.params).then(function (result) {\n _this8.downloadFile(result, _this8.title + '数据', 'xlsx');\n _this8.downloadLoading = false;\n }).catch(function () {\n _this8.downloadLoading = false;\n });\n }\n }\n};",null]}