格式化代码
This commit is contained in:
parent
cd9c1d9660
commit
3201d90a53
@ -21,24 +21,26 @@ use JetBrains\PhpStorm\Pure;
|
|||||||
* @property string $title 标题
|
* @property string $title 标题
|
||||||
* @property string $type 汇报类型
|
* @property string $type 汇报类型
|
||||||
* @property int $userid
|
* @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 newModelQuery()
|
||||||
* @method static Builder|Report newQuery()
|
* @method static Builder|Report newQuery()
|
||||||
* @method static Builder|Report query()
|
* @method static Builder|Report query()
|
||||||
* @method static Builder|Report whereContent($value)
|
* @method static Builder|Report whereContent($value)
|
||||||
* @method static Builder|Report whereCreatedAt($value)
|
* @method static Builder|Report whereCreatedAt($value)
|
||||||
* @method static Builder|Report whereId($value)
|
* @method static Builder|Report whereId($value)
|
||||||
|
* @method static Builder|Report whereSign($value)
|
||||||
* @method static Builder|Report whereTitle($value)
|
* @method static Builder|Report whereTitle($value)
|
||||||
* @method static Builder|Report whereType($value)
|
* @method static Builder|Report whereType($value)
|
||||||
* @method static Builder|Report whereUpdatedAt($value)
|
* @method static Builder|Report whereUpdatedAt($value)
|
||||||
* @method static Builder|Report whereUserid($value)
|
* @method static Builder|Report whereUserid($value)
|
||||||
* @mixin \Eloquent
|
* @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
|
class Report extends AbstractModel
|
||||||
{
|
{
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="report">
|
<div class="report">
|
||||||
<Tabs v-model="reportTabs">
|
<Tabs v-model="reportTabs">
|
||||||
<TabPane :label="$L('填写汇报')" name="edit">
|
<TabPane :label="$L('填写汇报')" name="edit">
|
||||||
<ReportEdit :id="reportId" @saveSuccess="saveSuccess"></ReportEdit>
|
<ReportEdit :id="reportId" @saveSuccess="saveSuccess"></ReportEdit>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane :label="$L('我的汇报')" name="my">
|
<TabPane :label="$L('我的汇报')" name="my">
|
||||||
<ReportMy v-if="reportTabs === 'my'" @detail="showDetail" @edit="editReport"></ReportMy>
|
<ReportMy v-if="reportTabs === 'my'" @detail="showDetail" @edit="editReport"></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'" @detail="showDetail"></ReportReceive>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
<DrawerOverlay
|
<DrawerOverlay
|
||||||
v-model="showDetailDrawer"
|
v-model="showDetailDrawer"
|
||||||
placement="right"
|
placement="right"
|
||||||
:size="950"
|
:size="950"
|
||||||
transfer>
|
transfer>
|
||||||
<ReportDetail :data="detailData"/>
|
<ReportDetail :data="detailData"/>
|
||||||
</DrawerOverlay>
|
</DrawerOverlay>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -27,66 +27,65 @@ import ReportMy from "./ReportMy"
|
|||||||
import ReportReceive from "./ReportReceive"
|
import ReportReceive from "./ReportReceive"
|
||||||
import ReportDetail from "./ReportDetail"
|
import ReportDetail from "./ReportDetail"
|
||||||
import DrawerOverlay from "../../../components/DrawerOverlay";
|
import DrawerOverlay from "../../../components/DrawerOverlay";
|
||||||
import {mapState} from "vuex";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Report",
|
name: "Report",
|
||||||
components: {
|
components: {
|
||||||
DrawerOverlay,
|
DrawerOverlay,
|
||||||
ReportEdit, ReportMy, ReportReceive, ReportDetail
|
ReportEdit, ReportMy, ReportReceive, ReportDetail
|
||||||
},
|
|
||||||
props: {
|
|
||||||
reportUnreadNumber: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
},
|
||||||
reportType:{
|
props: {
|
||||||
default: "my"
|
reportUnreadNumber: {
|
||||||
}
|
type: Number,
|
||||||
},
|
default: 0
|
||||||
data() {
|
},
|
||||||
return {
|
reportType: {
|
||||||
reportTabs: "my",
|
default: "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' }, '收到的汇报'),
|
|
||||||
])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.reportTabs = this.reportType;
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
showDetail(row) {
|
|
||||||
this.showDetailDrawer = true;
|
|
||||||
this.detailData = row;
|
|
||||||
//1.5秒后执行
|
|
||||||
setTimeout(() => {
|
|
||||||
this.$emit("read");
|
|
||||||
}, 1500);
|
|
||||||
},
|
},
|
||||||
editReport(id) {
|
data() {
|
||||||
this.reportId = id;
|
return {
|
||||||
this.reportTabs = "edit";
|
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() {
|
mounted() {
|
||||||
this.reportId = 0;
|
this.reportTabs = this.reportType;
|
||||||
this.reportTabs = "my";
|
},
|
||||||
|
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>
|
</script>
|
||||||
|
|
||||||
|
@ -78,12 +78,12 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
reportData: {
|
reportData: {
|
||||||
title: ""
|
title: "",
|
||||||
, content: ""
|
content: "",
|
||||||
, type: "weekly"
|
type: "weekly",
|
||||||
, receive: []
|
receive: [],
|
||||||
, id: 0
|
id: 0,
|
||||||
, offset: 0 // 以当前日期为基础的周期偏移量。例如选择了上一周那么就是 -1,上一天同理。
|
offset: 0 // 以当前日期为基础的周期偏移量。例如选择了上一周那么就是 -1,上一天同理。
|
||||||
},
|
},
|
||||||
disabledType: false,
|
disabledType: false,
|
||||||
userInputShow: true,
|
userInputShow: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user