1 line
25 KiB
JSON
1 line
25 KiB
JSON
{"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\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\applicationPart1\\attendence\\record.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\applicationPart1\\attendence\\record.vue","mtime":1624883381528},{"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},{"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\\vue-loader\\lib\\index.js","mtime":499162500000},{"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},{"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\\vue-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/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.constructor\";\nimport \"core-js/modules/es6.regexp.replace\";\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\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//\nimport mixinViewModule from '@/mixins/view-module'; // import AddOrUpdate from './attendancerecords-add-or-update'\n\nimport debounce from \"lodash/debounce\"; // import {getDictDataListAll, getPersonRegion} from \"@/utils\";\n\nexport default {\n mixins: [mixinViewModule],\n data: function data() {\n return {\n mixinViewModuleOptions: {\n getDataListURL: '/system/attendence/attendancerecords/page',\n getDataListIsPage: true,\n deleteURL: '/system/attendence/attendancerecords',\n deleteIsBatch: true,\n createdIsNeed: false,\n activatedIsNeed: false\n },\n dataForm: {\n id: '',\n studentNumber: this.$store.state.user.username,\n todayDate: \"\"\n },\n dataPost: _objectSpread({}, this.dataForm),\n popIsEdit: false\n };\n },\n created: function created() {\n Date.prototype.myFormat = function (fmt) {\n var o = {\n \"M+\": this.getMonth() + 1,\n //月份\n \"d+\": this.getDate(),\n //日\n \"h+\": this.getHours(),\n //小时\n \"m+\": this.getMinutes(),\n //分\n \"s+\": this.getSeconds(),\n //秒\n \"q+\": Math.floor((this.getMonth() + 3) / 3),\n //季度\n \"S\": this.getMilliseconds() //毫秒\n\n };\n\n if (/(y+)/.test(fmt)) {\n fmt = fmt.replace(RegExp.$1, (this.getFullYear() + \"\").substr(4 - RegExp.$1.length));\n }\n\n for (var k in o) {\n if (new RegExp(\"(\" + k + \")\").test(fmt)) {\n fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : (\"00\" + o[k]).substr((\"\" + o[k]).length));\n }\n }\n\n return fmt;\n }; // var time1 = new Date().myFormat(\"yyyy-MM-dd hh:mm:ss\");\n\n\n this.dataForm.todayDate = new Date().myFormat(\"yyyy-MM-dd\");\n this.myQuery();\n },\n // components: {\n // AddOrUpdate\n // },\n methods: {\n myQuery: function myQuery() {\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 // console.log(\"===========\");\n // console.log(this.dataList);\n\n if (!_this.dataList.length) {\n _this.dataPost.startTime = new Date().myFormat(\"yyyy-MM-dd hh:mm:ss\");\n _this.dataPost.studentNumber = _this.$store.state.user.username;\n _this.dataPost.studentName = _this.$store.state.user.realName;\n _this.dataPost.todayDate = new Date().myFormat(\"yyyy-MM-dd\");\n\n _this.dataFormSubmitHandle();\n } else {\n // 如果有查询到记录,原则上只能有今天这一条\n _this.dataPost = _objectSpread({}, _this.dataList[0]);\n } // 如果查询到多条记录,就删除到只剩一条\n // console.log(\"===========\");\n // console.log(this.dataList);\n // console.log(this.dataList.length > 1);\n\n\n if (_this.dataList.length > 1) {\n // console.log(\"this.dataList[this.dataList.length - 1].id\");\n // console.log(this.dataList[this.dataList.length - 1].id);\n _this.deleteHandleWapper(_this.dataList[_this.dataList.length - 1].id);\n } // console.log(\"this.dataPost\");\n // console.log(this.dataPost);\n\n\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 updateInfo: function updateInfo(scopeRowId) {\n var s = new Date(this.dataPost.startTime);\n var e = new Date(); // 保留一位小数\n\n var delta = Math.floor((e - s) / 1000 / 60 / 60 * 10) / 10;\n this.dataPost.endTime = e.myFormat(\"yyyy-MM-dd hh:mm:ss\");\n this.dataPost.duration = delta; // console.log(this.dataPost.duration);\n\n this.dataPost.id = scopeRowId;\n this.dataFormSubmitHandle();\n },\n // addOrUpdateHandleWapper(scopeRowId) {\n // this.popIsEdit = true;\n // this.addOrUpdateHandle(scopeRowId)\n // },\n deleteHandleWapper: function deleteHandleWapper(id) {\n var _this2 = this;\n\n this.$http.delete(\"\".concat(this.mixinViewModuleOptions.deleteURL).concat(this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id), this.mixinViewModuleOptions.deleteIsBatch ? {\n 'data': id ? [id] : this.dataListSelections.map(function (item) {\n return item[_this2.mixinViewModuleOptions.deleteIsBatchKey];\n })\n } : {}).then(function (_ref2) {\n var res = _ref2.data;\n\n if (res.code !== 0) {\n return _this2.$message.error(res.msg);\n }\n\n _this2.myQuery();\n }).catch(function () {});\n },\n // 表单提交\n dataFormSubmitHandle: debounce(function () {\n var _this3 = this;\n\n this.$http[!this.dataPost.id ? 'post' : 'put']('/system/attendence/attendancerecords/', this.dataPost).then(function (_ref3) {\n var res = _ref3.data;\n\n if (res.code !== 0) {\n return _this3.$message.error(res.msg);\n }\n\n _this3.$message({\n message: _this3.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: function onClose() {\n _this3.visible = false;\n\n _this3.myQuery();\n }\n });\n }).catch(function () {});\n }, 1000, {\n 'leading': true,\n 'trailing': false\n })\n }\n};",{"version":3,"sources":["record.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,OAAA,eAAA,MAAA,sBAAA,C,CACA;;AACA,OAAA,QAAA,MAAA,iBAAA,C,CACA;;AAEA,eAAA;AACA,EAAA,MAAA,EAAA,CAAA,eAAA,CADA;AAEA,EAAA,IAFA,kBAEA;AACA,WAAA;AACA,MAAA,sBAAA,EAAA;AACA,QAAA,cAAA,EAAA,2CADA;AAEA,QAAA,iBAAA,EAAA,IAFA;AAGA,QAAA,SAAA,EAAA,sCAHA;AAIA,QAAA,aAAA,EAAA,IAJA;AAKA,QAAA,aAAA,EAAA,KALA;AAMA,QAAA,eAAA,EAAA;AANA,OADA;AASA,MAAA,QAAA,EAAA;AACA,QAAA,EAAA,EAAA,EADA;AAEA,QAAA,aAAA,EAAA,KAAA,MAAA,CAAA,KAAA,CAAA,IAAA,CAAA,QAFA;AAGA,QAAA,SAAA,EAAA;AAHA,OATA;AAcA,MAAA,QAAA,oBACA,KAA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AA,CACA,CAbA;AAcA,KAjGA;AAoGA;AACA,IAAA,oBAAA,EAAA,QAAA,CAAA,YAAA;AAAA;;AACA,WAAA,KAAA,CAAA,CAAA,KAAA,QAAA,CAAA,EAAA,GAAA,MAAA,GAAA,KAAA,EAAA,uCAAA,EAAA,KAAA,QAAA,EAAA,IAAA,CAAA,iBAAA;AAAA,YAAA,GAAA,SAAA,IAAA;;AACA,YAAA,GAAA,CAAA,IAAA,KAAA,CAAA,EAAA;AACA,iBAAA,MAAA,CAAA,QAAA,CAAA,KAAA,CAAA,GAAA,CAAA,GAAA,CAAA;AACA;;AACA,QAAA,MAAA,CAAA,QAAA,CAAA;AACA,UAAA,OAAA,EAAA,MAAA,CAAA,EAAA,CAAA,gBAAA,CADA;AAEA,UAAA,IAAA,EAAA,SAFA;AAGA,UAAA,QAAA,EAAA,GAHA;AAIA,UAAA,OAAA,EAAA,mBAAA;AACA,YAAA,MAAA,CAAA,OAAA,GAAA,KAAA;;AACA,YAAA,MAAA,CAAA,OAAA;AACA;AAPA,SAAA;AASA,OAbA,EAaA,KAbA,CAaA,YAAA,CACA,CAdA;AAeA,KAhBA,EAgBA,IAhBA,EAgBA;AAAA,iBAAA,IAAA;AAAA,kBAAA;AAAA,KAhBA;AArGA;AApDA,CAAA","sourcesContent":["<template>\n <el-card shadow=\"never\" class=\"aui-card--fill\">\n <div class=\"mod-attendence__record}\">\n <!-- <el-form :inline=\"true\" :model=\"dataForm\" @keyup.enter.native=\"getDataList()\">-->\n <!-- <el-form-item>-->\n <!-- <el-input v-model=\"dataForm.id\" placeholder=\"id\" clearable></el-input>-->\n <!-- </el-form-item>-->\n <!-- <el-form-item>-->\n <!-- <el-button @click=\"getDataList()\">{{ $t('query') }}</el-button>-->\n <!-- </el-form-item>-->\n <!-- <el-form-item>-->\n <!-- <el-button type=\"primary\" @click=\"addOrUpdateHandleWapper()\">{{ $t('add') }}</el-button>-->\n <!-- </el-form-item>-->\n <!-- <el-form-item>-->\n <!-- <el-button type=\"danger\" @click=\"deleteHandleWapper()\">{{ $t('deleteBatch') }}</el-button>-->\n <!-- </el-form-item>-->\n <!-- </el-form>-->\n <el-table v-loading=\"dataListLoading\" :data=\"dataList\" border @selection-change=\"dataListSelectionChangeHandle\"\n style=\"width: 100%;\">\n<!-- <el-table-column type=\"selection\" header-align=\"center\" align=\"center\" width=\"50\"></el-table-column>-->\n<!-- <el-table-column prop=\"id\" label=\"记录id\" header-align=\"center\" align=\"center\"></el-table-column>-->\n <el-table-column prop=\"studentNumber\" label=\"学号\" header-align=\"center\" align=\"center\"></el-table-column>\n <el-table-column prop=\"studentName\" label=\"学生名字\" header-align=\"center\" align=\"center\"></el-table-column>\n <el-table-column prop=\"startTime\" label=\"打卡开始时间\" header-align=\"center\" align=\"center\"></el-table-column>\n <el-table-column prop=\"endTime\" label=\"打卡结束时间\" header-align=\"center\" align=\"center\"></el-table-column>\n <el-table-column prop=\"duration\" label=\"在线时长(小时)\" header-align=\"center\" align=\"center\"></el-table-column>\n<!-- <el-table-column prop=\"todayDate\" label=\"打卡日期\" header-align=\"center\" align=\"center\"></el-table-column>-->\n<!-- <el-table-column prop=\"createDate\" label=\"创建时间\" header-align=\"center\" align=\"center\"></el-table-column>-->\n<!-- <el-table-column prop=\"creator\" label=\"创建人\" header-align=\"center\" align=\"center\"></el-table-column>-->\n <el-table-column :label=\"$t('handle')\" fixed=\"right\" header-align=\"center\" align=\"center\" width=\"230\">\n <template slot-scope=\"scope\">\n <el-button size=\"small\" @click=\"updateInfo(scope.row.id)\">{{ \"下班打卡\" }}</el-button>\n<!-- <el-button size=\"small\" @click=\"addOrUpdateHandleWapper(scope.row.id)\">{{ $t('update') }}</el-button>-->\n<!-- <el-button type=\"danger\" size=\"small\" @click=\"deleteHandleWapper(scope.row.id)\">{{-->\n<!-- $t('delete')-->\n<!-- }}-->\n<!-- </el-button>-->\n </template>\n </el-table-column>\n </el-table>\n <!-- <el-pagination-->\n <!-- :current-page=\"page\"-->\n <!-- :page-sizes=\"[10, 20, 50, 100]\"-->\n <!-- :page-size=\"limit\"-->\n <!-- :total=\"total\"-->\n <!-- layout=\"total, sizes, prev, pager, next, jumper\"-->\n <!-- @size-change=\"pageSizeChangeHandle\"-->\n <!-- @current-change=\"pageCurrentChangeHandle\">-->\n <!-- </el-pagination>-->\n <!-- 弹窗, 新增 / 详情/ 修改 -->\n </div>\n </el-card>\n</template>\n\n<script>\nimport mixinViewModule from '@/mixins/view-module'\n// import AddOrUpdate from './attendancerecords-add-or-update'\nimport debounce from \"lodash/debounce\";\n// import {getDictDataListAll, getPersonRegion} from \"@/utils\";\n\nexport default {\n mixins: [mixinViewModule],\n data() {\n return {\n mixinViewModuleOptions: {\n getDataListURL: '/system/attendence/attendancerecords/page',\n getDataListIsPage: true,\n deleteURL: '/system/attendence/attendancerecords',\n deleteIsBatch: true,\n createdIsNeed: false,\n activatedIsNeed: false,\n },\n dataForm: {\n id: '',\n studentNumber: this.$store.state.user.username,\n todayDate: \"\",\n },\n dataPost: {\n ...this.dataForm,\n },\n popIsEdit: false,\n }\n },\n created() {\n Date.prototype.myFormat = function (fmt) {\n var o = {\n \"M+\": this.getMonth() + 1, //月份\n \"d+\": this.getDate(), //日\n \"h+\": this.getHours(), //小时\n \"m+\": this.getMinutes(), //分\n \"s+\": this.getSeconds(), //秒\n \"q+\": Math.floor((this.getMonth() + 3) / 3), //季度\n \"S\": this.getMilliseconds() //毫秒\n };\n if (/(y+)/.test(fmt)) {\n fmt = fmt.replace(RegExp.$1, (this.getFullYear() + \"\").substr(4 - RegExp.$1.length));\n }\n for (var k in o) {\n if (new RegExp(\"(\" + k + \")\").test(fmt)) {\n fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : ((\"00\" + o[k]).substr((\"\" + o[k]).length)));\n }\n }\n return fmt;\n }\n\n // var time1 = new Date().myFormat(\"yyyy-MM-dd hh:mm:ss\");\n this.dataForm.todayDate = new Date().myFormat(\"yyyy-MM-dd\");\n this.myQuery()\n },\n // components: {\n // AddOrUpdate\n // },\n methods: {\n myQuery(){\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\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 // 如果没有查询到记录,就增加今天的打卡记录\n // console.log(\"===========\");\n // console.log(this.dataList);\n if(!this.dataList.length){\n this.dataPost.startTime = new Date().myFormat(\"yyyy-MM-dd hh:mm:ss\");\n this.dataPost.studentNumber = this.$store.state.user.username;\n this.dataPost.studentName = this.$store.state.user.realName;\n this.dataPost.todayDate = new Date().myFormat(\"yyyy-MM-dd\");\n this.dataFormSubmitHandle()\n }else {\n // 如果有查询到记录,原则上只能有今天这一条\n this.dataPost = {...this.dataList[0]}\n }\n // 如果查询到多条记录,就删除到只剩一条\n // console.log(\"===========\");\n // console.log(this.dataList);\n // console.log(this.dataList.length > 1);\n if(this.dataList.length>1){\n // console.log(\"this.dataList[this.dataList.length - 1].id\");\n // console.log(this.dataList[this.dataList.length - 1].id);\n this.deleteHandleWapper(this.dataList[this.dataList.length-1].id);\n\n }\n // console.log(\"this.dataPost\");\n // console.log(this.dataPost);\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 updateInfo(scopeRowId) {\n let s = new Date(this.dataPost.startTime);\n let e = new Date();\n // 保留一位小数\n let delta = Math.floor((e-s)/1000/60/60 * 10) / 10\n this.dataPost.endTime = e.myFormat(\"yyyy-MM-dd hh:mm:ss\");\n this.dataPost.duration = delta\n // console.log(this.dataPost.duration);\n this.dataPost.id = scopeRowId\n this.dataFormSubmitHandle()\n },\n // addOrUpdateHandleWapper(scopeRowId) {\n // this.popIsEdit = true;\n // this.addOrUpdateHandle(scopeRowId)\n // },\n deleteHandleWapper(id) {\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 this.myQuery()\n }).catch(() => {\n })\n },\n\n\n // 表单提交\n dataFormSubmitHandle: debounce(function () {\n this.$http[!this.dataPost.id ? 'post' : 'put']('/system/attendence/attendancerecords/', this.dataPost).then(({data: res}) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.$message({\n message: this.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: () => {\n this.visible = false\n this.myQuery()\n }\n })\n }).catch(() => {\n })\n }, 1000, {'leading': true, 'trailing': false})\n\n }\n}\n</script>\n"],"sourceRoot":"src/views/modules/applicationPart1/attendence"}]} |