优化代码

This commit is contained in:
kuaifan 2022-01-21 23:30:13 +08:00
parent cc767b164e
commit 7ce15d5a71
8 changed files with 15 additions and 18 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "DooTask", "name": "DooTask",
"version": "0.6.78", "version": "0.6.79",
"description": "DooTask is task management system.", "description": "DooTask is task management system.",
"main": "main.js", "main": "main.js",
"license": "MIT", "license": "MIT",

View File

@ -1,6 +1,6 @@
{ {
"name": "DooTask", "name": "DooTask",
"version": "0.6.78", "version": "0.6.79",
"description": "DooTask is task management system.", "description": "DooTask is task management system.",
"scripts": { "scripts": {
"start": "./cmd dev", "start": "./cmd dev",

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -180,7 +180,7 @@
v-model="workReportShow" v-model="workReportShow"
placement="right" placement="right"
:size="1100"> :size="1100">
<Report v-if="workReportShow" :reportType="reportTabs" :reportUnreadNumber="reportUnreadNumber" @read="getReportUnread" /> <Report v-if="workReportShow" :reportType="reportTabs" :reportUnreadNumber="reportUnreadNumber" @on-read="getReportUnread" />
</DrawerOverlay> </DrawerOverlay>
<!--查看所有团队--> <!--查看所有团队-->

View File

@ -2,10 +2,10 @@
<div class="report"> <div class="report">
<Tabs v-model="reportTabs"> <Tabs v-model="reportTabs">
<TabPane :label="$L('我的汇报')" name="my"> <TabPane :label="$L('我的汇报')" name="my">
<ReportMy ref="report" v-if="reportTabs === 'my'" @detail="showDetail" @edit="editReport"></ReportMy> <ReportMy ref="report" v-if="reportTabs === 'my'" @on-view="onView" @on-edit="onEditReport"></ReportMy>
</TabPane> </TabPane>
<TabPane :label="tabRebder(reportUnreadNumber)" name="receive"> <TabPane :label="tabRebder(reportUnreadNumber)" name="receive">
<ReportReceive v-if="reportTabs === 'receive'" @detail="showDetail"></ReportReceive> <ReportReceive v-if="reportTabs === 'receive'" @on-view="onView"></ReportReceive>
</TabPane> </TabPane>
</Tabs> </Tabs>
<DrawerOverlay <DrawerOverlay
@ -84,16 +84,13 @@ export default {
} }
}, },
showDetail(row) { onView(row) {
this.showDetailDrawer = true; this.showDetailDrawer = true;
this.detailData = row; this.detailData = row;
//1.5 this.$emit("on-read");
setTimeout(() => {
this.$emit("read");
}, 1500);
}, },
editReport(id) { onEditReport(id) {
this.reportId = id; this.reportId = id;
this.showEditDrawer = true; this.showEditDrawer = true;
}, },
@ -102,7 +99,7 @@ export default {
this.reportId = 0; this.reportId = 0;
this.reportTabs = "my"; this.reportTabs = "my";
this.showEditDrawer = false; this.showEditDrawer = false;
this.$refs.report.getLists(); this.$refs.report && this.$refs.report.getLists();
} }
} }
} }

View File

@ -126,7 +126,7 @@ export default {
style: {margin: '0 3px', cursor: 'pointer'}, style: {margin: '0 3px', cursor: 'pointer'},
on: { on: {
click: () => { click: () => {
this.$emit("edit", row.id); this.$emit("on-edit", row.id);
} }
} }
})]), })]),
@ -138,7 +138,7 @@ export default {
style: {margin: '0 3px', cursor: 'pointer'}, style: {margin: '0 3px', cursor: 'pointer'},
on: { on: {
click: () => { click: () => {
this.$emit("detail", row); this.$emit("on-view", row);
} }
} }
})]), })]),
@ -200,7 +200,7 @@ export default {
}, },
addReport() { addReport() {
this.$emit("edit", 0); this.$emit("on-edit", 0);
} }
} }
} }

View File

@ -157,7 +157,7 @@ export default {
style: {margin: '0 3px', cursor: 'pointer'}, style: {margin: '0 3px', cursor: 'pointer'},
on: { on: {
click: () => { click: () => {
this.$emit("detail", row) this.$emit("on-view", row)
const myUser = row.receives_user.find(({userid}) => userid == this.userId) const myUser = row.receives_user.find(({userid}) => userid == this.userId)
if (myUser) { if (myUser) {
this.$set(myUser.pivot, 'read', 1) this.$set(myUser.pivot, 'read', 1)