优化客户端工作报告

This commit is contained in:
kuaifan
2022-03-16 10:24:36 +08:00
parent d1036c3be7
commit 1263603c7b
51 changed files with 84 additions and 86 deletions
@@ -3,6 +3,7 @@
namespace App\Http\Controllers\Api;
use App\Exceptions\ApiException;
use App\Models\AbstractModel;
use App\Models\ProjectTask;
use App\Models\Report;
use App\Models\ReportReceive;
@@ -173,7 +174,7 @@ class ReportController extends AbstractController
}
// 在事务中运行
Report::transaction(function () use ($input, $user) {
return AbstractModel::transaction(function () use ($input, $user) {
$id = $input["id"];
if ($id) {
// 编辑
@@ -224,8 +225,9 @@ class ReportController extends AbstractController
];
Task::deliver(new PushTask($params, false));
}
//
return Base::retSuccess('保存成功', $report);
});
return Base::retSuccess('保存成功');
}
/**
+2 -2
View File
@@ -2,10 +2,10 @@
directory=/var/www
# 生产环境
#command=php bin/laravels start -i
command=php bin/laravels start -i
# 开发环境
command=./bin/inotify ./app
#command=./bin/inotify ./app
numprocs=1
autostart=true
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.11.51",
"version": "0.11.91",
"description": "DooTask is task management system.",
"main": "electron.js",
"license": "MIT",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.11.51",
"version": "0.11.91",
"description": "DooTask is task management system.",
"scripts": {
"start": "./cmd dev",
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,5 +1,5 @@
/*!
* html2canvas 1.4.0 <https://html2canvas.hertzen.com>
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
* Released under MIT License
*/
+2
View File
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
/*!
* clipboard.js v2.0.8
* clipboard.js v2.0.10
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -257,7 +257,7 @@
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 2.5.0 Built on 2021-12-21T09:44:51.866Z
* Version 2.5.1 Built on 2022-01-28T15:37:57.791Z
* CommitID 00000000
*
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
-2
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
+2
View File
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
/*!
* clipboard.js v2.0.8
* clipboard.js v2.0.10
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
-1
View File
File diff suppressed because one or more lines are too long
-2
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[445],{29793:(t,e,a)=>{a.d(e,{Z:()=>r});var i=a(1519),s=a.n(i)()((function(t){return t[1]}));s.push([t.id,".valid-wrap[data-v-06e57314]{align-items:center;display:flex;height:100vh;justify-content:center;width:100vw}.valid-wrap .valid-box[data-v-06e57314]{background-color:#fff;border-radius:10px;padding:5px 15px 20px;width:500px}.valid-wrap .valid-box .valid-title[data-v-06e57314]{border-bottom:1px solid #e8eaec;line-height:1;padding:14px 16px}.valid-wrap .valid-box .validation-text[data-v-06e57314]{color:#333;font-size:14px;padding:10px}",""]);const r=s},98445:(t,e,a)=>{a.r(e),a.d(e,{default:()=>d});const i={data:function(){return{success:!1,error:!1,errorText:this.$L("链接已过期,已重新发送")}},mounted:function(){this.verificationEmail()},watch:{},methods:{verificationEmail:function(){var t=this;this.$store.dispatch("call",{url:"users/email/verification",data:{code:this.$route.query.code}}).then((function(){t.success=!0,t.error=!1})).catch((function(e){var a=e.data,i=e.msg;2===a.code?t.goForward({path:"/"},!0):(t.success=!1,t.error=!0,t.errorText=t.$L(i))}))},userLogout:function(){this.$store.dispatch("logout",!1)}}};var s=a(93379),r=a.n(s),o=a(29793),c={insert:"head",singleton:!1};r()(o.Z,c);o.Z.locals;const d=(0,a(51900).Z)(i,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"valid-wrap"},[a("div",{staticClass:"valid-box"},[a("div",{staticClass:"valid-title"},[t._v(t._s(t.$L("验证邮箱")))]),t._v(" "),t.success||t.error?t._e():a("Spin",{attrs:{size:"large"}}),t._v(" "),t.success?a("div",{staticClass:"validation-text"},[a("p",[t._v(t._s(t.$L("您的邮箱已通过验证")))]),t._v(" "),a("p",[t._v(t._s(t.$L("今后您可以通过此邮箱重置您的账号密码")))])]):t._e(),t._v(" "),t.error?a("div",{staticClass:"validation-text"},[a("div",[t._v(t._s(t.errorText))])]):t._e(),t._v(" "),t.success?a("div",{attrs:{slot:"footer"},slot:"footer"},[a("Button",{attrs:{type:"primary",long:""},on:{click:t.userLogout}},[t._v(t._s(t.$L("返回首页")))])],1):t._e()],1)])}),[],!1,null,"06e57314",null).exports}}]);
+1 -1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -257,7 +257,7 @@
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 2.5.0 Built on 2021-12-21T09:44:51.866Z
* Version 2.5.1 Built on 2022-01-28T15:37:57.791Z
* CommitID 00000000
*
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -257,7 +257,7 @@
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 2.5.0 Built on 2021-12-21T09:44:51.866Z
* Version 2.5.1 Built on 2022-01-28T15:37:57.791Z
* CommitID 00000000
*
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
+1 -1
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[596],{55983:(t,s,e)=>{e.d(s,{Z:()=>r});var i=e(1519),o=e.n(i)()((function(t){return t[1]}));o.push([t.id,".valid-wrap{align-items:center;display:flex;height:100vh;justify-content:center;width:100vw}.valid-box{background-color:#fff;border-radius:10px;padding:5px 15px 20px;width:500px}.valid-box .valid-title{border-bottom:1px solid #e8eaec;line-height:1;padding:14px 16px}.valid-box .validation-text{color:#333;font-size:14px;padding:10px}",""]);const r=o},58596:(t,s,e)=>{e.r(s),e.d(s,{default:()=>c});const i={data:function(){return{success:!1,error:!1,errorText:this.$L("链接已过期,已重新发送")}},mounted:function(){this.verificationEmail()},watch:{},methods:{verificationEmail:function(){var t=this;this.$store.dispatch("call",{url:"users/email/verification",data:{code:this.$route.query.code}}).then((function(){t.success=!0,t.error=!1})).catch((function(s){var e=s.data,i=s.msg;2===e.code?t.goForward({path:"/"},!0):(t.success=!1,t.error=!0,t.errorText=t.$L(i))}))},userLogout:function(){this.$store.dispatch("logout",!1)}}};var o=e(93379),r=e.n(o),a=e(55983),n={insert:"head",singleton:!1};r()(a.Z,n);a.Z.locals;const c=(0,e(51900).Z)(i,(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"valid-wrap"},[e("div",{staticClass:"valid-box"},[e("div",{staticClass:"valid-title"},[t._v(t._s(t.$L("验证邮箱")))]),t._v(" "),t.success||t.error?t._e():e("Spin",{attrs:{size:"large"}}),t._v(" "),t.success?e("div",{staticClass:"validation-text"},[e("p",[t._v(t._s(t.$L("您的邮箱已通过验证")))]),t._v(" "),e("p",[t._v(t._s(t.$L("今后您可以通过此邮箱重置您的账号密码")))])]):t._e(),t._v(" "),t.error?e("div",{staticClass:"validation-text"},[e("div",[t._v(t._s(t.errorText))])]):t._e(),t._v(" "),t.success?e("div",{attrs:{slot:"footer"},slot:"footer"},[e("Button",{attrs:{type:"primary",long:""},on:{click:t.userLogout}},[t._v(t._s(t.$L("返回首页")))])],1):t._e()],1)])}),[],!1,null,null,null).exports}}]);
+1 -1
View File
@@ -1 +1 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[783],{84288:(t,a,s)=>{s.d(a,{Z:()=>i});var e=s(1519),r=s.n(e)()((function(t){return t[1]}));r.push([t.id,".electron-report[data-v-2580f3c1]{display:flex;flex-direction:column;height:100%;overflow:auto}",""]);const i=r},93185:(t,a,s)=>{s.d(a,{Z:()=>r});const e={name:"ReportDetail",props:{data:{default:{}}},mounted:function(){this.data.id>0&&this.sendRead()},watch:{data:function(){this.data.id>0&&this.sendRead()}},methods:{sendRead:function(){this.$store.dispatch("call",{url:"report/read",data:{ids:[this.data.id]}}).then((function(t){t.data,t.msg})).catch((function(t){t.msg}))}}};const r=(0,s(51900).Z)(e,(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"report-detail"},[s("div",{staticClass:"report-title"},[t._v(t._s(t.data.title))]),t._v(" "),s("div",{staticClass:"report-detail-context"},[s("div",{staticClass:"report-profile"},[s("Row",[s("Col",{attrs:{span:"2"}},[s("div",{staticClass:"report-submitter"},[s("p",[t._v(t._s(t.$L("汇报人")))])])]),t._v(" "),s("Col",{attrs:{span:"6"}},[s("div",{staticClass:"report-submitter"},[s("UserAvatar",{attrs:{userid:t.data.userid,size:28}})],1)]),t._v(" "),s("Col",{attrs:{span:"2"}},[s("div",{staticClass:"report-submitter"},[s("p",[t._v(t._s(t.$L("提交时间")))])])]),t._v(" "),s("Col",{attrs:{span:"6"}},[s("div",{staticClass:"report-submitter"},[s("div",[t._v(t._s(t.data.created_at))])])]),t._v(" "),s("Col",{attrs:{span:"2"}},[s("div",{staticClass:"report-submitter"},[s("p",[t._v(t._s(t.$L("汇报对象")))])])]),t._v(" "),s("Col",{attrs:{span:"6"}},[s("div",{staticClass:"report-submitter"},t._l(t.data.receives_user,(function(t,a){return s("UserAvatar",{key:a,attrs:{userid:t.userid,size:28}})})),1)])],1)],1),t._v(" "),s("Row",{staticClass:"report-main"},[s("Col",{attrs:{span:"2"}},[s("div",{staticClass:"report-submitter"},[s("p",[t._v(t._s(t.$L("汇报内容")))])])]),t._v(" "),s("Col",{attrs:{span:"22"}},[s("div",{staticClass:"report-content",domProps:{innerHTML:t._s(t.data.content)}})])],1)],1)])}),[],!1,null,"50c4f848",null).exports},67783:(t,a,s)=>{s.r(a),s.d(a,{default:()=>l});const e={components:{ReportDetail:s(93185).Z},name:"reportDetail",data:function(){return{detailData:{}}},watch:{$route:{handler:function(){this.getDetail()},immediate:!0}},methods:{getDetail:function(){var t=this;this.$store.dispatch("call",{url:"report/detail",data:{id:$A.runNum(this.$route.params.id)}}).then((function(a){var s=a.data;t.detailData=s})).catch((function(t){var a=t.msg;$A.messageError(a)}))}}};var r=s(93379),i=s.n(r),n=s(84288),o={insert:"head",singleton:!1};i()(n.Z,o);n.Z.locals;const l=(0,s(51900).Z)(e,(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"electron-report"},[s("PageTitle",{attrs:{title:t.$L("报告详情")}}),t._v(" "),s("ReportDetail",{attrs:{data:t.detailData}})],1)}),[],!1,null,"2580f3c1",null).exports}}]);
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[631],{83439:(t,a,s)=>{s.d(a,{Z:()=>i});var e=s(1519),r=s.n(e)()((function(t){return t[1]}));r.push([t.id,".electron-report[data-v-0d3a45ba]{display:flex;flex-direction:column;height:100%;overflow:auto}",""]);const i=r},84353:(t,a,s)=>{s.d(a,{Z:()=>r});const e={name:"ReportDetail",props:{data:{default:{}}},mounted:function(){this.data.id>0&&this.sendRead()},watch:{data:function(){this.data.id>0&&this.sendRead()}},methods:{sendRead:function(){this.$store.dispatch("call",{url:"report/read",data:{ids:[this.data.id]}}).then((function(t){t.data,t.msg})).catch((function(t){t.msg}))}}};const r=(0,s(51900).Z)(e,(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"report-detail"},[s("div",{staticClass:"report-title"},[t._v(t._s(t.data.title))]),t._v(" "),s("div",{staticClass:"report-detail-context"},[s("div",{staticClass:"report-profile"},[s("Row",[s("Col",{attrs:{span:"2"}},[s("div",{staticClass:"report-submitter"},[s("p",[t._v(t._s(t.$L("汇报人")))])])]),t._v(" "),s("Col",{attrs:{span:"6"}},[s("div",{staticClass:"report-submitter"},[s("UserAvatar",{attrs:{userid:t.data.userid,size:28}})],1)]),t._v(" "),s("Col",{attrs:{span:"2"}},[s("div",{staticClass:"report-submitter"},[s("p",[t._v(t._s(t.$L("提交时间")))])])]),t._v(" "),s("Col",{attrs:{span:"6"}},[s("div",{staticClass:"report-submitter"},[s("div",[t._v(t._s(t.data.created_at))])])]),t._v(" "),s("Col",{attrs:{span:"2"}},[s("div",{staticClass:"report-submitter"},[s("p",[t._v(t._s(t.$L("汇报对象")))])])]),t._v(" "),s("Col",{attrs:{span:"6"}},[s("div",{staticClass:"report-submitter"},t._l(t.data.receives_user,(function(t,a){return s("UserAvatar",{key:a,attrs:{userid:t.userid,size:28}})})),1)])],1)],1),t._v(" "),s("Row",{staticClass:"report-main"},[s("Col",{attrs:{span:"2"}},[s("div",{staticClass:"report-submitter"},[s("p",[t._v(t._s(t.$L("汇报内容")))])])]),t._v(" "),s("Col",{attrs:{span:"22"}},[s("div",{staticClass:"report-content",domProps:{innerHTML:t._s(t.data.content)}})])],1)],1)])}),[],!1,null,null,null).exports},77631:(t,a,s)=>{s.r(a),s.d(a,{default:()=>d});const e={components:{ReportDetail:s(84353).Z},data:function(){return{detailData:{}}},watch:{$route:{handler:function(){this.getDetail()},immediate:!0}},methods:{getDetail:function(){var t=this;this.$store.dispatch("call",{url:"report/detail",data:{id:$A.runNum(this.$route.params.id)}}).then((function(a){var s=a.data;t.detailData=s})).catch((function(t){var a=t.msg;$A.messageError(a)}))}}};var r=s(93379),i=s.n(r),n=s(83439),o={insert:"head",singleton:!1};i()(n.Z,o);n.Z.locals;const d=(0,s(51900).Z)(e,(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"electron-report"},[s("PageTitle",{attrs:{title:t.$L("报告详情")}}),t._v(" "),s("ReportDetail",{attrs:{data:t.detailData}})],1)}),[],!1,null,"0d3a45ba",null).exports}}]);
-1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
/*! @license DOMPurify 2.3.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.4/LICENSE */
/*! @license DOMPurify 2.3.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.6/LICENSE */
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -257,7 +257,7 @@
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 2.5.0 Built on 2021-12-21T09:44:51.866Z
* Version 2.5.1 Built on 2022-01-28T15:37:57.791Z
* CommitID 00000000
*
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -257,7 +257,7 @@
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 2.5.0 Built on 2021-12-21T09:44:51.866Z
* Version 2.5.1 Built on 2022-01-28T15:37:57.791Z
* CommitID 00000000
*
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
-1
View File
@@ -501,6 +501,5 @@
{"CN": "邀请码:注册时需填写下方邀请码。","EN": "Invitation code: You need to fill in the following invitation code when registering.","TC": "邀請碼:註冊時需填寫下方邀請碼。","KM": "លេខកូដលិខិតអញ្ជើញ: អ្នកត្រូវបំពេញលេខកូដលិខិតអញ្ជើញខាងក្រោមនៅពេលចុះឈ្មោះ។","TH": "รหัสเชิญ: คุณต้องกรอกรหัสคำเชิญต่อไปนี้เมื่อลงทะเบียน","KO": "초대 코드 : 등록 할 때 다음 초대 코드를 입력해야합니다.","JA": "招待コード:登録時に次の招待コードを入力する必要があります。"},
{"CN": "添加模板","EN": "Add template","TC": "添加模板","KM": "បន្ថែមគំរូ","TH": "เพิ่มเทมเพลต","KO": "템플릿을 추가하십시오","JA": "テンプレートを追加します"},
{"CN": "版本","EN": "Version","TC": "版本","KM": "កមបុរក្នា","TH": "รุ่น","KO": "버전","JA": "バージョン"},
{"CN": "聊天记录","EN": "Chat record","TC": "聊天記錄","KM": "កំណត់ត្រាជជែកកំសាន្ត","TH": "บันทึกการแชท","KO": "채팅 기록","JA": "チャットレコード"},
]
})(window)
@@ -89,7 +89,7 @@ export default {
this.$emit("on-read");
if (this.$Electron) {
let config = {
title: this.formatName(row.title),
title: row.title,
titleFixed: true,
parent: null,
width: Math.min(window.screen.availWidth, 1440),
@@ -106,12 +106,11 @@ export default {
}
},
onEditReport(id,title) {
onEditReport(id) {
this.reportId = id;
if (this.$Electron) {
let config = {
title: title,
titleFixed: true,
title: this.$L(id > 0 ? '修改报告' : '新增报告'),
parent: null,
width: Math.min(window.screen.availWidth, 1440),
height: Math.min(window.screen.availHeight, 900),
@@ -125,7 +124,6 @@ export default {
} else {
this.showEditDrawer = true;
}
},
saveSuccess() {
@@ -83,7 +83,3 @@ export default {
}
}
</script>
<style scoped>
</style>
@@ -93,7 +93,6 @@ export default {
id: 0,
offset: 0 // 以当前日期为基础的周期偏移量。例如选择了上一周那么就是 -1,上一天同理。
},
disabledType: false,
prevCycleText: "",
nextCycleText: "",
};
@@ -102,7 +101,7 @@ export default {
id(val) {
if (this.id > 0) {
this.getDetail(val);
}else{
} else {
this.reportData.offset = 0;
this.reportData.type = "weekly";
this.reportData.receive = [];
@@ -117,7 +116,7 @@ export default {
this.getTemplate();
},
methods: {
initLanguage () {
initLanguage() {
this.prevCycleText = this.$L("上一周");
this.nextCycleText = this.$L("下一周");
},
@@ -127,14 +126,13 @@ export default {
$A.messageError(this.$L("请选择接收人"));
return false;
}
if (this.id === 0 && this.reportData.id > 1) {
if (this.id === 0 && this.reportData.id > 0) {
$A.modalConfirm({
title: '覆盖提交',
content: '你已提交过此日期的报告,是否覆盖提交?',
loading: true,
append: this.$el,
onOk: () => {
this.doSubmit();
this.doSubmit(true);
}
});
} else {
@@ -142,24 +140,23 @@ export default {
}
},
doSubmit() {
doSubmit(isModal = false) {
this.$store.dispatch("call", {
url: 'report/store',
data: this.reportData,
method: 'post',
}).then(({data, msg}) => {
isModal && this.$Modal.remove();
// data 结果数据
this.reportData.offset = 0;
this.reportData.type = "weekly";
this.reportData.receive = [];
this.getTemplate();
this.disabledType = false;
this.$Modal.remove();
// msg 结果描述
$A.messageSuccess(msg);
this.$emit("saveSuccess");
this.$emit("saveSuccess", data);
}).catch(({msg}) => {
this.$Modal.remove();
isModal && this.$Modal.remove();
// msg 错误原因
$A.messageError(msg);
});
@@ -173,13 +170,13 @@ export default {
offset: this.reportData.offset,
id: this.id
},
}).then(({data, msg}) => {
}).then(({data}) => {
// data 结果数据
if (data.id) {
this.reportData.id = data.id;
if(this.id > 0){
if (this.id > 0) {
this.getDetail(data.id);
}else{
} else {
this.reportData.title = data.title;
this.reportData.content = data.content;
}
@@ -188,7 +185,6 @@ export default {
this.reportData.title = data.title;
this.reportData.content = data.content;
}
// msg 结果描述
}).catch(({msg}) => {
// msg 错误原因
$A.messageError(msg);
@@ -198,14 +194,14 @@ export default {
typeChange(value) {
// 切换汇报类型后偏移量归零
this.reportData.offset = 0;
if ( value === "weekly" ) {
if (value === "weekly") {
this.prevCycleText = this.$L("上一周");
this.nextCycleText = this.$L("下一周");
} else {
this.prevCycleText = this.$L("上一天");
this.nextCycleText = this.$L("下一天");
}
this.getTemplate();
this.getTemplate();
},
getDetail(reportId) {
@@ -214,15 +210,13 @@ export default {
data: {
id: reportId
},
}).then(({data, msg}) => {
}).then(({data}) => {
// data 结果数据
this.reportData.title = data.title;
this.reportData.content = data.content;
this.reportData.receive = data.receives_user.map(({userid}) => userid);
this.reportData.type = data.type_val;
this.reportData.id = reportId;
this.disabledType = true;
// msg 结果描述
}).catch(({msg}) => {
// msg 错误原因
$A.messageError(msg);
@@ -231,17 +225,15 @@ export default {
prevCycle() {
this.reportData.offset -= 1;
this.disabledType = false;
this.reReportData();
this.getTemplate();
},
nextCycle() {
// 周期偏移量不允许大于0
if ( this.reportData.offset < 0 ) {
if (this.reportData.offset < 0) {
this.reportData.offset += 1;
}
this.disabledType = false;
this.reReportData();
this.getTemplate();
},
@@ -250,12 +242,9 @@ export default {
getLastSubmitter() {
this.$store.dispatch("call", {
url: 'report/last_submitter',
}).then(({data, msg}) => {
// data 结果数据
}).then(({data}) => {
this.reportData.receive = data;
// msg 结果描述
}).catch(({msg}) => {
// msg 错误原因
$A.messageError(msg);
});
},
@@ -269,7 +258,3 @@ export default {
}
}
</script>
<style scoped>
</style>
@@ -140,7 +140,7 @@ export default {
},
on: {
action: (name) => {
if (name === 'edit') this.$emit("on-edit", row.id, row.title);
if (name === 'edit') this.$emit("on-edit", row.id);
if (name === 'view') this.$emit("on-view", row);
}
}
@@ -197,7 +197,7 @@ export default {
},
addReport() {
this.$emit("on-edit", 0, this.$L('新增报告'));
this.$emit("on-edit", 0);
}
}
}
@@ -1,7 +1,7 @@
<template>
<div class="electron-report">
<PageTitle :title="$L('添加/编辑报告')"/>
<ReportEdit :id="$A.runNum(this.$route.params.id)"/>
<PageTitle :title="title"/>
<ReportEdit :id="id" @saveSuccess="saveSuccess"/>
</div>
</template>
<style lang="scss" scoped>
@@ -17,5 +17,23 @@ import ReportEdit from "../manage/components/ReportEdit"
export default {
components: {ReportEdit},
data() {
return {
detail: {}
}
},
computed: {
id() {
return $A.runNum(this.detail.id || this.$route.params.id)
},
title() {
return this.$L(this.id > 0 ? '修改报告' : '新增报告');
}
},
methods: {
saveSuccess(data) {
this.detail = data;
}
}
}
</script>