格式化代码

This commit is contained in:
kuaifan 2022-01-21 14:07:02 +08:00
parent cd9c1d9660
commit 3201d90a53
3 changed files with 87 additions and 86 deletions

View File

@ -21,24 +21,26 @@ use JetBrains\PhpStorm\Pure;
* @property string $title 标题
* @property string $type 汇报类型
* @property int $userid
* @property string|null $content
* @property string $content
* @property string $sign 汇报唯一标识
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ReportReceive[] $Receives
* @property-read int|null $receives_count
* @property-read mixed $receives
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\User[] $receivesUser
* @property-read int|null $receives_user_count
* @property-read \App\Models\User|null $sendUser
* @method static Builder|Report newModelQuery()
* @method static Builder|Report newQuery()
* @method static Builder|Report query()
* @method static Builder|Report whereContent($value)
* @method static Builder|Report whereCreatedAt($value)
* @method static Builder|Report whereId($value)
* @method static Builder|Report whereSign($value)
* @method static Builder|Report whereTitle($value)
* @method static Builder|Report whereType($value)
* @method static Builder|Report whereUpdatedAt($value)
* @method static Builder|Report whereUserid($value)
* @mixin \Eloquent
* @property string $sign 汇报唯一标识
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ReportReceive[] $Receives
* @property-read int|null $receives_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\User[] $receivesUser
* @property-read int|null $receives_user_count
* @method static Builder|Report whereSign($value)
*/
class Report extends AbstractModel
{

View File

@ -1,24 +1,24 @@
<template>
<div class="report">
<Tabs v-model="reportTabs">
<TabPane :label="$L('填写汇报')" name="edit">
<ReportEdit :id="reportId" @saveSuccess="saveSuccess"></ReportEdit>
</TabPane>
<TabPane :label="$L('我的汇报')" name="my">
<ReportMy v-if="reportTabs === 'my'" @detail="showDetail" @edit="editReport"></ReportMy>
</TabPane>
<TabPane :label="tabRebder(reportUnreadNumber)" name="receive">
<ReportReceive v-if="reportTabs === 'receive'" @detail="showDetail"></ReportReceive>
</TabPane>
</Tabs>
<DrawerOverlay
v-model="showDetailDrawer"
placement="right"
:size="950"
transfer>
<ReportDetail :data="detailData"/>
</DrawerOverlay>
</div>
<div class="report">
<Tabs v-model="reportTabs">
<TabPane :label="$L('填写汇报')" name="edit">
<ReportEdit :id="reportId" @saveSuccess="saveSuccess"></ReportEdit>
</TabPane>
<TabPane :label="$L('我的汇报')" name="my">
<ReportMy v-if="reportTabs === 'my'" @detail="showDetail" @edit="editReport"></ReportMy>
</TabPane>
<TabPane :label="tabRebder(reportUnreadNumber)" name="receive">
<ReportReceive v-if="reportTabs === 'receive'" @detail="showDetail"></ReportReceive>
</TabPane>
</Tabs>
<DrawerOverlay
v-model="showDetailDrawer"
placement="right"
:size="950"
transfer>
<ReportDetail :data="detailData"/>
</DrawerOverlay>
</div>
</template>
<script>
@ -27,66 +27,65 @@ import ReportMy from "./ReportMy"
import ReportReceive from "./ReportReceive"
import ReportDetail from "./ReportDetail"
import DrawerOverlay from "../../../components/DrawerOverlay";
import {mapState} from "vuex";
export default {
name: "Report",
components: {
DrawerOverlay,
ReportEdit, ReportMy, ReportReceive, ReportDetail
},
props: {
reportUnreadNumber: {
type: Number,
default: 0
name: "Report",
components: {
DrawerOverlay,
ReportEdit, ReportMy, ReportReceive, ReportDetail
},
reportType:{
default: "my"
}
},
data() {
return {
reportTabs: "my",
showDetailDrawer: false,
detailData: {},
reportId: 0,
tabRebder: data => {
return h => {
if(data > 0){
return h('div', [
h('span', { class: 'navbar-item-content' }, '收到的汇报'),
h('Badge', { class: 'manage-box-report' }, data),
])
}else {
return h('div', [
h('span', { class: 'navbar-item-content' }, '收到的汇报'),
])
}
props: {
reportUnreadNumber: {
type: Number,
default: 0
},
reportType: {
default: "my"
}
}
}
},
mounted() {
this.reportTabs = this.reportType;
},
methods: {
showDetail(row) {
this.showDetailDrawer = true;
this.detailData = row;
//1.5
setTimeout(() => {
this.$emit("read");
}, 1500);
},
editReport(id) {
this.reportId = id;
this.reportTabs = "edit";
data() {
return {
reportTabs: "my",
showDetailDrawer: false,
detailData: {},
reportId: 0,
tabRebder: data => {
return h => {
if (data > 0) {
return h('div', [
h('span', {class: 'navbar-item-content'}, '收到的汇报'),
h('Badge', {class: 'manage-box-report'}, data),
])
} else {
return h('div', [
h('span', {class: 'navbar-item-content'}, '收到的汇报'),
])
}
}
}
}
},
saveSuccess() {
this.reportId = 0;
this.reportTabs = "my";
mounted() {
this.reportTabs = this.reportType;
},
methods: {
showDetail(row) {
this.showDetailDrawer = true;
this.detailData = row;
//1.5
setTimeout(() => {
this.$emit("read");
}, 1500);
},
editReport(id) {
this.reportId = id;
this.reportTabs = "edit";
},
saveSuccess() {
this.reportId = 0;
this.reportTabs = "my";
}
}
}
}
</script>

View File

@ -78,12 +78,12 @@ export default {
data() {
return {
reportData: {
title: ""
, content: ""
, type: "weekly"
, receive: []
, id: 0
, offset: 0 // -1
title: "",
content: "",
type: "weekly",
receive: [],
id: 0,
offset: 0 // -1
},
disabledType: false,
userInputShow: true,