forked from zhurui/management
1 line
17 KiB
JSON
1 line
17 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\\components\\ren-process-running\\src\\ren-task-handle.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\ren-process-running\\src\\ren-task-handle.vue","mtime":1614735254000},{"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":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport debounce from 'lodash/debounce';\nimport qs from 'qs';\nexport default {\n data: function data() {\n return {\n visible: false,\n handleType: '',\n handleTitle: '',\n dataForm: {\n comment: '',\n taskId: ''\n },\n // 回调函数\n callbacks: {\n taskHandleSuccessCallback: null,\n taskHandleErrorCallback: null\n }\n };\n },\n computed: {\n dataRule: function dataRule() {\n return {\n comment: [{\n required: true,\n message: this.$t('validate.required'),\n trigger: 'blur'\n }]\n };\n }\n },\n methods: {\n init: function init() {\n var _this = this;\n\n this.visible = true;\n\n if (this.handleType === 'complete') {\n this.handleTitle = this.$t('process.completeTask');\n } else if (this.handleType === 'reject') {\n this.handleTitle = this.$t('process.rejectTask');\n } else if (this.handleType === 'termination') {\n this.handleTitle = this.$t('process.terminationTask');\n }\n\n this.$nextTick(function () {\n _this.$refs['dataForm'].resetFields();\n });\n },\n // 表单提交\n dataFormSubmitHandle: function dataFormSubmitHandle() {\n if (this.handleType === 'complete') {\n this.completeTask();\n } else if (this.handleType === 'reject') {\n this.rejectTask();\n } else if (this.handleType === 'termination') {\n this.terminationTask();\n }\n },\n // 驳回\n rejectTask: debounce(function () {\n var _this2 = this;\n\n this.$refs['dataForm'].validate(function (valid) {\n if (!valid) {\n return false;\n }\n\n if (!_this2.dataForm.taskId) {\n return false;\n }\n\n var params = qs.stringify({\n 'taskId': _this2.dataForm.taskId,\n 'comment': _this2.dataForm.comment\n });\n\n _this2.$http['post']('/activiti/task/backToFirst?', params).then(function (_ref) {\n var res = _ref.data;\n\n if (res.code !== 0) {\n _this2.$message.error(res.msg);\n\n if (_this2.callbacks.taskHandleErrorCallback) {\n _this2.callbacks.taskHandleErrorCallback(res);\n }\n\n return;\n }\n\n _this2.$message({\n message: _this2.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: function onClose() {\n _this2.visible = false;\n\n if (_this2.callbacks.taskHandleSuccessCallback) {\n _this2.callbacks.taskHandleSuccessCallback(res);\n }\n }\n });\n });\n });\n }, 1000, {\n 'leading': true,\n 'trailing': false\n }),\n // 通过\n completeTask: debounce(function () {\n var _this3 = this;\n\n this.$refs['dataForm'].validate(function (valid) {\n if (!valid) {\n return false;\n }\n\n if (!_this3.dataForm.taskId) {\n return false;\n }\n\n var params = qs.stringify({\n 'taskId': _this3.dataForm.taskId,\n 'comment': _this3.dataForm.comment\n });\n\n _this3.$http.post('/activiti/task/complete?' + params).then(function (_ref2) {\n var res = _ref2.data;\n\n if (res.code !== 0) {\n _this3.$message.error(res.msg);\n\n if (_this3.callbacks.taskHandleErrorCallback) {\n _this3.callbacks.taskHandleErrorCallback(res);\n }\n\n return;\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 if (_this3.callbacks.taskHandleSuccessCallback) {\n _this3.callbacks.taskHandleSuccessCallback(res);\n }\n }\n });\n }).catch(function () {});\n });\n }, 1000, {\n 'leading': true,\n 'trailing': false\n }),\n // 终止\n terminationTask: debounce(function () {\n var _this4 = this;\n\n this.$refs['dataForm'].validate(function (valid) {\n if (!valid) {\n return false;\n }\n\n if (!_this4.dataForm.taskId) {\n return false;\n }\n\n var task = qs.stringify({\n taskId: _this4.dataForm.taskId,\n comment: _this4.dataForm.comment\n });\n\n _this4.$http['post']('/activiti/task/endProcess', task).then(function (_ref3) {\n var res = _ref3.data;\n\n if (res.code !== 0) {\n _this4.$message.error(res.msg);\n\n if (_this4.callbacks.taskHandleErrorCallback) {\n _this4.callbacks.taskHandleErrorCallback(res);\n }\n\n return;\n }\n\n _this4.$message({\n message: _this4.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: function onClose() {\n _this4.visible = false;\n\n if (_this4.callbacks.taskHandleSuccessCallback) {\n _this4.callbacks.taskHandleSuccessCallback(res);\n }\n }\n });\n }).catch(function () {});\n });\n }, 1000, {\n 'leading': true,\n 'trailing': false\n })\n }\n};",{"version":3,"sources":["ren-task-handle.vue"],"names":[],"mappings":";;;;;;;;;;;;;;AAeA,OAAA,QAAA,MAAA,iBAAA;AACA,OAAA,EAAA,MAAA,IAAA;AACA,eAAA;AACA,EAAA,IADA,kBACA;AACA,WAAA;AACA,MAAA,OAAA,EAAA,KADA;AAEA,MAAA,UAAA,EAAA,EAFA;AAGA,MAAA,WAAA,EAAA,EAHA;AAIA,MAAA,QAAA,EAAA;AACA,QAAA,OAAA,EAAA,EADA;AAEA,QAAA,MAAA,EAAA;AAFA,OAJA;AAQA;AACA,MAAA,SAAA,EAAA;AACA,QAAA,yBAAA,EAAA,IADA;AAEA,QAAA,uBAA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,CAAA,QAAA,CAAA,MAAA,EAAA;AACA,iBAAA,KAAA;AACA;;AACA,YAAA,IAAA,GAAA,EAAA,CAAA,SAAA,CAAA;AACA,UAAA,MAAA,EAAA,MAAA,CAAA,QAAA,CAAA,MADA;AAEA,UAAA,OAAA,EAAA,MAAA,CAAA,QAAA,CAAA;AAFA,SAAA,CAAA;;AAIA,QAAA,MAAA,CAAA,KAAA,CAAA,MAAA,EAAA,2BAAA,EAAA,IAAA,EAAA,IAAA,CAAA,iBAAA;AAAA,cAAA,GAAA,SAAA,IAAA;;AACA,cAAA,GAAA,CAAA,IAAA,KAAA,CAAA,EAAA;AACA,YAAA,MAAA,CAAA,QAAA,CAAA,KAAA,CAAA,GAAA,CAAA,GAAA;;AACA,gBAAA,MAAA,CAAA,SAAA,CAAA,uBAAA,EAAA;AACA,cAAA,MAAA,CAAA,SAAA,CAAA,uBAAA,CAAA,GAAA;AACA;;AACA;AACA;;AACA,UAAA,MAAA,CAAA,QAAA,CAAA;AACA,YAAA,OAAA,EAAA,MAAA,CAAA,EAAA,CAAA,gBAAA,CADA;AAEA,YAAA,IAAA,EAAA,SAFA;AAGA,YAAA,QAAA,EAAA,GAHA;AAIA,YAAA,OAAA,EAAA,mBAAA;AACA,cAAA,MAAA,CAAA,OAAA,GAAA,KAAA;;AACA,kBAAA,MAAA,CAAA,SAAA,CAAA,yBAAA,EAAA;AACA,gBAAA,MAAA,CAAA,SAAA,CAAA,yBAAA,CAAA,GAAA;AACA;AACA;AATA,WAAA;AAWA,SAnBA,EAmBA,KAnBA,CAmBA,YAAA,CAAA,CAnBA;AAoBA,OA/BA;AAgCA,KAjCA,EAiCA,IAjCA,EAiCA;AAAA,iBAAA,IAAA;AAAA,kBAAA;AAAA,KAjCA;AA/FA;AA1BA,CAAA","sourcesContent":["<template>\n <el-dialog :visible.sync=\"visible\" :title=\"handleTitle\" :close-on-click-modal=\"false\" :close-on-press-escape=\"false\">\n <el-form :model=\"dataForm\" :rules=\"dataRule\" ref=\"dataForm\" @keyup.enter.native=\"dataFormSubmitHandle()\" :label-width=\"$i18n.locale === 'en-US' ? '120px' : '80px'\">\n <el-form-item :label=\"$t('process.comment')\" prop=\"comment\">\n <el-input type=\"textarea\" v-model=\"dataForm.comment\" :placeholder=\"$t('process.comment')\"></el-input>\n </el-form-item>\n </el-form>\n <template slot=\"footer\">\n <el-button @click=\"visible = false\">{{ $t('cancel') }}</el-button>\n <el-button type=\"primary\" @click=\"dataFormSubmitHandle()\">{{ $t('confirm') }}</el-button>\n </template>\n </el-dialog>\n</template>\n\n<script>\nimport debounce from 'lodash/debounce'\nimport qs from 'qs'\nexport default {\n data () {\n return {\n visible: false,\n handleType: '',\n handleTitle: '',\n dataForm: {\n comment: '',\n taskId: ''\n },\n // 回调函数\n callbacks: {\n taskHandleSuccessCallback: null,\n taskHandleErrorCallback: null\n }\n }\n },\n computed: {\n dataRule () {\n return {\n comment: [\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\n ]\n }\n }\n },\n methods: {\n init () {\n this.visible = true\n if (this.handleType === 'complete') {\n this.handleTitle = this.$t('process.completeTask')\n } else if (this.handleType === 'reject') {\n this.handleTitle = this.$t('process.rejectTask')\n } else if (this.handleType === 'termination') {\n this.handleTitle = this.$t('process.terminationTask')\n }\n this.$nextTick(() => {\n this.$refs['dataForm'].resetFields()\n })\n },\n // 表单提交\n dataFormSubmitHandle () {\n if (this.handleType === 'complete') {\n this.completeTask()\n } else if (this.handleType === 'reject') {\n this.rejectTask()\n } else if (this.handleType === 'termination') {\n this.terminationTask()\n }\n },\n // 驳回\n rejectTask: debounce(function () {\n this.$refs['dataForm'].validate((valid) => {\n if (!valid) {\n return false\n }\n if (!this.dataForm.taskId) {\n return false\n }\n var params = qs.stringify({\n 'taskId': this.dataForm.taskId,\n 'comment': this.dataForm.comment\n })\n this.$http['post']('/activiti/task/backToFirst?', params).then(({ data: res }) => {\n if (res.code !== 0) {\n this.$message.error(res.msg)\n if (this.callbacks.taskHandleErrorCallback) {\n this.callbacks.taskHandleErrorCallback(res)\n }\n return\n }\n this.$message({\n message: this.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: () => {\n this.visible = false\n if (this.callbacks.taskHandleSuccessCallback) {\n this.callbacks.taskHandleSuccessCallback(res)\n }\n }\n })\n })\n })\n }, 1000, { 'leading': true, 'trailing': false }),\n // 通过\n completeTask: debounce(function () {\n this.$refs['dataForm'].validate((valid) => {\n if (!valid) {\n return false\n }\n if (!this.dataForm.taskId) {\n return false\n }\n var params = qs.stringify({\n 'taskId': this.dataForm.taskId,\n 'comment': this.dataForm.comment\n })\n this.$http.post('/activiti/task/complete?' + params).then(({ data: res }) => {\n if (res.code !== 0) {\n this.$message.error(res.msg)\n if (this.callbacks.taskHandleErrorCallback) {\n this.callbacks.taskHandleErrorCallback(res)\n }\n return\n }\n this.$message({\n message: this.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: () => {\n this.visible = false\n if (this.callbacks.taskHandleSuccessCallback) {\n this.callbacks.taskHandleSuccessCallback(res)\n }\n }\n })\n }).catch(() => {})\n })\n }, 1000, { 'leading': true, 'trailing': false }),\n // 终止\n terminationTask: debounce(function () {\n this.$refs['dataForm'].validate((valid) => {\n if (!valid) {\n return false\n }\n if (!this.dataForm.taskId) {\n return false\n }\n var task = qs.stringify({\n taskId: this.dataForm.taskId,\n comment: this.dataForm.comment\n })\n this.$http['post']('/activiti/task/endProcess', task).then(({ data: res }) => {\n if (res.code !== 0) {\n this.$message.error(res.msg)\n if (this.callbacks.taskHandleErrorCallback) {\n this.callbacks.taskHandleErrorCallback(res)\n }\n return\n }\n this.$message({\n message: this.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: () => {\n this.visible = false\n if (this.callbacks.taskHandleSuccessCallback) {\n this.callbacks.taskHandleSuccessCallback(res)\n }\n }\n })\n }).catch(() => {})\n })\n }, 1000, { 'leading': true, 'trailing': false })\n }\n}\n</script>\n"],"sourceRoot":"src/components/ren-process-running/src"}]} |