perf: 工作汇报样式

This commit is contained in:
kuaifan 2022-01-14 17:57:51 +08:00
parent e63c5c074c
commit ede298a142
9 changed files with 263 additions and 163 deletions

View File

@ -189,7 +189,7 @@ class ReportController extends AbstractController
} }
} ); } );
return Base::retSuccess('success'); return Base::retSuccess('保存成功');
} }
/** /**

View File

@ -1,5 +1,10 @@
<template> <template>
<div :class="['drawer-overlay', placement, value ? 'overlay-visible' : 'overlay-hide']"> <transition name="transition-drop">
<div
:data-transfer="transfer"
:transfer="transfer"
v-transfer-dom
:class="['drawer-overlay', placement, value ? 'overlay-visible' : 'overlay-hide']">
<div class="overlay-mask" @click="mask"></div> <div class="overlay-mask" @click="mask"></div>
<div class="overlay-body" :style="bodyStyle"> <div class="overlay-body" :style="bodyStyle">
<div class="overlay-close"> <div class="overlay-close">
@ -13,13 +18,17 @@
<div class="overlay-content"><slot/></div> <div class="overlay-content"><slot/></div>
</div> </div>
</div> </div>
</transition>
</template> </template>
<script> <script>
import ResizeLine from "./ResizeLine"; import ResizeLine from "./ResizeLine";
import TransferDom from '../directives/transfer-dom';
export default { export default {
name: 'DrawerOverlay', name: 'DrawerOverlay',
components: {ResizeLine}, components: {ResizeLine},
directives: { TransferDom },
props: { props: {
value: { value: {
type: Boolean, type: Boolean,
@ -47,6 +56,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
transfer: {
type: Boolean,
default: false
},
}, },
data() { data() {

View File

@ -76,6 +76,10 @@
height: { height: {
default: 360, default: 360,
}, },
minHeight: {
type: Number,
default: 0,
},
htmlClass: { htmlClass: {
default: '', default: '',
type: String type: String
@ -115,6 +119,10 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
autoSize: {
type: Boolean,
default: false
},
placeholder: { placeholder: {
type: String, type: String,
default: '' default: ''
@ -212,7 +220,7 @@
}, },
option(isFull) { option(isFull) {
return { let optionInfo = {
inline: isFull ? false : this.inline, inline: isFull ? false : this.inline,
selector: (isFull ? '#T_' : '#') + this.id, selector: (isFull ? '#T_' : '#') + this.id,
base_url: $A.originUrl('js/tinymce'), base_url: $A.originUrl('js/tinymce'),
@ -374,6 +382,13 @@
} }
}, },
}; };
if (this.autoSize) {
optionInfo.plugins.push('autoresize')
}
if (this.minHeight > 0) {
optionInfo.min_height = this.minHeight
}
return optionInfo;
}, },
closeFull() { closeFull() {

View File

@ -23,7 +23,7 @@
:divided="!!item.divided" :divided="!!item.divided"
:name="item.path"> :name="item.path">
{{$L(item.name)}} {{$L(item.name)}}
<Badge v-if="item.path === 'workReport'" :count="reportUnreadNumber"/> <Badge v-if="item.path === 'workReport'" class="manage-menu-report-badge" :count="reportUnreadNumber"/>
</DropdownItem> </DropdownItem>
<Dropdown placement="right-start" @on-click="setLanguage"> <Dropdown placement="right-start" @on-click="setLanguage">
<DropdownItem divided> <DropdownItem divided>
@ -167,7 +167,7 @@
<DrawerOverlay <DrawerOverlay
v-model="workReportShow" v-model="workReportShow"
placement="right" placement="right"
:size="900"> :size="1100">
<Report v-if="workReportShow" @read="reportUnread" /> <Report v-if="workReportShow" @read="reportUnread" />
</DrawerOverlay> </DrawerOverlay>
@ -263,6 +263,7 @@ export default {
natificationHidden: false, natificationHidden: false,
natificationReady: false, natificationReady: false,
notificationClass: null, notificationClass: null,
reportUnreadNumber: 0, reportUnreadNumber: 0,
} }
}, },
@ -278,6 +279,7 @@ export default {
// //
this.notificationInit(); this.notificationInit();
this.onVisibilityChange(); this.onVisibilityChange();
this.reportUnread(); //
// //
this.addTaskSubscribe = Store.subscribe('addTask', this.onAddTask); this.addTaskSubscribe = Store.subscribe('addTask', this.onAddTask);
this.dialogMsgSubscribe = Store.subscribe('dialogMsgPush', this.addDialogMsg); this.dialogMsgSubscribe = Store.subscribe('dialogMsgPush', this.addDialogMsg);
@ -288,9 +290,6 @@ export default {
if (this.$Electron) { if (this.$Electron) {
this.$Electron.ipcRenderer.send('setDockBadge', 0); this.$Electron.ipcRenderer.send('setDockBadge', 0);
} }
//
this.reportUnread();
}, },
beforeDestroy() { beforeDestroy() {
@ -712,11 +711,9 @@ export default {
this.$store.dispatch("call", { this.$store.dispatch("call", {
url: 'report/unread', url: 'report/unread',
method: 'get', method: 'get',
}).then(({data, msg}) => { }).then(({data}) => {
// data
this.reportUnreadNumber = data.total ? data.total : 0; this.reportUnreadNumber = data.total ? data.total : 0;
// msg }).catch(() => {});
});
} }
} }
} }

View File

@ -1,19 +1,23 @@
<template> <template>
<div class="report"> <div class="report">
<Tabs v-model="reportTabs"> <Tabs v-model="reportTabs">
<TabPane label="填写" name="edit" icon="md-create"> <TabPane :label="$L('填写汇报')" name="edit">
<ReportEdit :id="reportId" @saveSuccess="saveSuccess">填写</ReportEdit> <ReportEdit :id="reportId" @saveSuccess="saveSuccess"></ReportEdit>
</TabPane> </TabPane>
<TabPane label="我的汇报" name="my" icon="ios-paper-plane-outline"> <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="收到的汇报" name="receive" icon="ios-paper-outline"> <TabPane :label="$L('收到的汇报')" name="receive">
<ReportReceive v-if="reportTabs === 'receive'" @detail="showDetail">收到的汇报</ReportReceive> <ReportReceive v-if="reportTabs === 'receive'" @detail="showDetail"></ReportReceive>
</TabPane> </TabPane>
</Tabs> </Tabs>
<Drawer v-model="showDetailDrawer" width="900px" :closable="false"> <DrawerOverlay
<ReportDetail :data="detailData" @closeDrawer="closeDrawer"/> v-model="showDetailDrawer"
</Drawer> placement="right"
:size="950"
transfer>
<ReportDetail :data="detailData"/>
</DrawerOverlay>
</div> </div>
</template> </template>
@ -22,10 +26,12 @@ import ReportEdit from "./ReportEdit"
import ReportMy from "./ReportMy" 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";
export default { export default {
name: "Report", name: "Report",
components: { components: {
DrawerOverlay,
ReportEdit, ReportMy, ReportReceive, ReportDetail ReportEdit, ReportMy, ReportReceive, ReportDetail
}, },
data() { data() {
@ -37,9 +43,6 @@ export default {
} }
}, },
methods: { methods: {
closeDrawer(){
this.showDetailDrawer = false
},
showDetail(row) { showDetail(row) {
this.showDetailDrawer = true; this.showDetailDrawer = true;
this.detailData = row; this.detailData = row;

View File

@ -1,9 +1,8 @@
<template> <template>
<div class="report-detail"> <div class="report-detail">
<div class="report-title">{{ data.title }}</div>
<p class="report-title"><Icon type="ios-arrow-back" class="report-title-icon" @click="closeDrawer"/> {{ data.title }}</p> <div class="report-detail-context">
<Divider />
<div class="report-profile"> <div class="report-profile">
<Row> <Row>
<Col span="2"> <Col span="2">
@ -41,6 +40,7 @@
</div> </div>
</Col> </Col>
</Row> </Row>
</div>
</div> </div>
</template> </template>
@ -75,9 +75,6 @@ export default {
// msg // msg
}); });
}, },
closeDrawer(){
this.$emit('closeDrawer')
},
} }
} }
</script> </script>

View File

@ -2,13 +2,11 @@
<Form class="report-box" label-position="top" @submit.native.prevent> <Form class="report-box" label-position="top" @submit.native.prevent>
<Row class="report-row report-row-header" > <Row class="report-row report-row-header" >
<Col span="2"><p class="report-titles">{{ $L("汇报类型") }}</p></Col> <Col span="2"><p class="report-titles">{{ $L("汇报类型") }}</p></Col>
<Col span="6"> <Col span="12">
<RadioGroup type="button" button-style="solid" v-model="reportData.type" @on-change="typeChange" class="report-radiogroup"> <RadioGroup type="button" button-style="solid" v-model="reportData.type" @on-change="typeChange" class="report-radiogroup">
<Radio label="weekly">{{ $L("周报") }}</Radio> <Radio label="weekly">{{ $L("周报") }}</Radio>
<Radio label="daily">{{ $L("日报") }}</Radio> <Radio label="daily">{{ $L("日报") }}</Radio>
</RadioGroup> </RadioGroup>
</Col>
<Col span="6">
<ButtonGroup class="report-buttongroup"> <ButtonGroup class="report-buttongroup">
<Tooltip class="report-poptip" trigger="hover" :content="prevCycleText" placement="bottom"> <Tooltip class="report-poptip" trigger="hover" :content="prevCycleText" placement="bottom">
<Button type="primary" @click="prevCycle"> <Button type="primary" @click="prevCycle">
@ -16,7 +14,7 @@
</Button> </Button>
</Tooltip> </Tooltip>
<div class="report-buttongroup-shu"></div> <div class="report-buttongroup-shu"></div>
<Tooltip class="report-poptip" trigger="hover" :content="nextCycleText" placement="bottom"> <Tooltip class="report-poptip" trigger="hover" :disabled="reportData.offset >= 0" :content="nextCycleText" placement="bottom">
<Button type="primary" @click="nextCycle" :disabled="reportData.offset >= 0"> <Button type="primary" @click="nextCycle" :disabled="reportData.offset >= 0">
<Icon type="ios-arrow-forward" /> <Icon type="ios-arrow-forward" />
</Button> </Button>
@ -32,19 +30,22 @@
</Row> </Row>
<Row class="report-row report-row-header"> <Row class="report-row report-row-header">
<Col span="2"><p class="report-titles">{{ $L("汇报对象") }}</p></Col> <Col span="2"><p class="report-titles">{{ $L("汇报对象") }}</p></Col>
<Col span="16"> <Col span="22">
<div class="report-users">
<UserInput <UserInput
v-if="userInputShow" v-if="userInputShow"
v-model="reportData.receive" v-model="reportData.receive"
:disabledChoice="[userId]"
:placeholder="$L('选择接收人')" /> :placeholder="$L('选择接收人')" />
<a class="report-row-a" href="javascript:void(0);" @click="getLastSubmitter"><Icon class="report-row-a-icon" type="ios-share-outline" />{{ $L("使用我上次的汇报对象") }}</a>
</div>
</Col> </Col>
<Col span="6"><a class="report-row-a" href="javascript:void(0);" @click="getLastSubmitter"><Icon class="report-row-a-icon" type="ios-share-outline" />{{ $L("使用我上次的汇报对象") }}</a></Col>
</Row> </Row>
<Row class="report-row report-row-content"> <Row class="report-row report-row-content">
<Col span="2"><p class="report-titles">{{ $L("汇报内容") }}</p></Col> <Col span="2"><p class="report-titles">{{ $L("汇报内容") }}</p></Col>
<Col span="22"> <Col span="22">
<FormItem> <FormItem class="report-row-content-editor">
<TEditor v-model="reportData.content" height="550px"/> <TEditor v-model="reportData.content" height="100%"/>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
@ -53,8 +54,6 @@
<Col span="4"> <Col span="4">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" class="report-bottom">提交</Button> <Button type="primary" @click="handleSubmit" class="report-bottom">提交</Button>
<!-- <Button type="primary" @click="prevCycle">{{ prevCycleText }}</Button>-->
<!-- <Button type="primary" @click="nextCycle" :disabled="reportData.offset >= 0">{{ nextCycleText }}</Button>-->
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
@ -63,6 +62,7 @@
<script> <script>
import UserInput from "../../../components/UserInput" import UserInput from "../../../components/UserInput"
import {mapState} from "vuex";
const TEditor = () => import('../../../components/TEditor'); const TEditor = () => import('../../../components/TEditor');
export default { export default {
@ -96,6 +96,9 @@ export default {
if (this.id > 0) this.getDetail(val); if (this.id > 0) this.getDetail(val);
}, },
}, },
computed: {
...mapState(["userId"])
},
mounted() { mounted() {
this.getTemplate(); this.getTemplate();
}, },

View File

@ -1,6 +1,7 @@
.report { .report {
height: 100%; height: 100%;
padding: 10px 20px; padding: 10px 20px;
.report-list-wrap { .report-list-wrap {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -9,12 +10,15 @@
padding-top: 53px; padding-top: 53px;
flex-direction: column; flex-direction: column;
position: absolute; position: absolute;
.report-row-header, .report-row-foot { .report-row-header, .report-row-foot {
flex: 0 0 auto; flex: 0 0 auto;
} }
.report-row-content { .report-row-content {
flex: 1 1 auto; flex: 1 1 auto;
overflow-y: auto; overflow-y: auto;
.ivu-table { .ivu-table {
.ivu-table-body { .ivu-table-body {
height: 100%; height: 100%;
@ -29,20 +33,24 @@
text-align: center; text-align: center;
margin-top: 15px; margin-top: 15px;
} }
.ivu-tabs { .ivu-tabs {
height: 100%; height: 100%;
position: relative; position: relative;
.ivu-tabs-bar { .ivu-tabs-bar {
position: relative; position: relative;
z-index: 2; z-index: 2;
background: #fff; background: #fff;
} }
.ivu-tabs-content { .ivu-tabs-content {
height: 100%; height: 100%;
width: 100%; width: 100%;
margin-top: -53px; margin-top: -53px;
padding-top: 53px; padding-top: 53px;
} }
.ivu-tabs-tabpane { .ivu-tabs-tabpane {
} }
@ -54,12 +62,12 @@
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
margin-bottom: 12px; margin-bottom: 12px;
padding-top: 20px; padding: 20px 24px;
.report-title-icon{ border-bottom: 1px solid #eeeeee;
font-size: 22px;
cursor: pointer;
margin-right: 20px;
} }
.report-detail-context {
padding: 12px 24px;
} }
.report-profile { .report-profile {
@ -71,17 +79,20 @@
flex-wrap: wrap; flex-wrap: wrap;
height: 28px; height: 28px;
line-height: 28px; line-height: 28px;
p { p {
display: block; display: block;
width: 100%; width: 100%;
text-align: justify; text-align: justify;
padding-right: 12px; padding-right: 12px;
&:after { &:after {
content: ''; content: '';
display: inline-block; display: inline-block;
width: 100%; width: 100%;
} }
} }
& > div { & > div {
margin-right: 8px; margin-right: 8px;
} }
@ -94,12 +105,15 @@
.report-content { .report-content {
margin-top: 12px; margin-top: 12px;
width: 100%; width: 100%;
h2 { h2 {
margin-bottom: 10px; margin-bottom: 10px;
} }
ol { ol {
margin-bottom: 20px; margin-bottom: 20px;
padding-left: 18px; padding-left: 18px;
li { li {
font-size: 14px; font-size: 14px;
line-height: 24px; line-height: 24px;
@ -107,69 +121,112 @@
} }
} }
} }
.report-box { .report-box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
.report-row-header, .report-row-foot { .report-row-header, .report-row-foot {
flex: 0 0 auto; flex: 0 0 auto;
} }
.report-row-content { .report-row-content {
flex: 1 1 auto; flex: 1 1 auto;
overflow-y: auto; overflow-y: auto;
.report-row-content-editor {
height: 100%;
.ivu-form-item-content {
height: 100%;
display: flex;
.teditor-wrapper {
flex: 1;
display: flex;
} }
}
}
}
.report-row-foot { .report-row-foot {
margin-bottom: 0; margin-bottom: 0;
} }
} }
.report-row { .report-row {
margin-bottom: 20px; margin-bottom: 20px;
.report-row-a { .report-row-a {
float: right; float: right;
line-height: 32px; line-height: 32px;
.report-row-a-icon { .report-row-a-icon {
transform: rotate(-90deg); transform: rotate(-90deg);
font-size: 16px; font-size: 16px;
margin-right: 2px; margin-right: 2px;
} }
} }
.report-bottom { .report-bottom {
width: 120px; height: 36px;
line-height: 34px;
min-width: 110px;
} }
.report-bottom-save{
width: 120px; .ivu-input[disabled] {
background: #F4F5F7 ; color: #666666;
color: #515A6E;
border-color: #F4F5F7 ;
} }
} }
.report-titles { .report-titles {
line-height: 32px; line-height: 32px;
} }
.report-users {
display: flex;
align-items: center;
.common-user {
flex: 1;
margin-right: 12px;
}
.report-row-a {
flex-shrink: 0;
}
}
.report-radiogroup { .report-radiogroup {
background: #F4F5F7 !important; background: #F4F5F7 !important;
padding: 2px !important; padding: 2px !important;
border-radius: 4px !important; border-radius: 4px !important;
.ivu-radio-wrapper { .ivu-radio-wrapper {
padding: 0 30px !important; padding: 0 30px !important;
background: #F4F5F7 !important; background: #F4F5F7 !important;
color: #515A6E !important; color: #515A6E !important;
box-shadow: none !important; box-shadow: none !important;
border: none !important; border: none !important;
&:before { &:before {
width: 0 !important; width: 0 !important;
} }
&:after { &:after {
width: 0 !important; width: 0 !important;
} }
} }
.ivu-radio-focus { .ivu-radio-focus {
box-shadow: none !important; box-shadow: none !important;
border: none !important; border: none !important;
&:after { &:after {
background: none !important; background: none !important;
} }
} }
.ivu-radio-wrapper-checked:not(.ivu-radio-wrapper-disabled) { .ivu-radio-wrapper-checked:not(.ivu-radio-wrapper-disabled) {
background: #fff !important; background: #fff !important;
color: #8BCF70 !important; color: #8BCF70 !important;
@ -179,10 +236,12 @@
} }
} }
.report-buttongroup { .report-buttongroup {
margin-top: 2px; margin-left: 20px;
background: #F4F5F7 !important; background: #F4F5F7 !important;
border-radius: 4px; border-radius: 4px;
.report-buttongroup-shu { .report-buttongroup-shu {
position: absolute; position: absolute;
left: 47px; left: 47px;
@ -191,28 +250,36 @@
background-color: #E5E5E5; background-color: #E5E5E5;
top: 5px; top: 5px;
} }
.ivu-btn-primary { .ivu-btn-primary {
background: #F4F5F7 !important; background: #F4F5F7 !important;
box-shadow: none !important; box-shadow: none !important;
border: none !important; border: none !important;
color: #8BCF70 !important; color: #8BCF70 !important;
height: 36px;
line-height: 34px;
&[disabled] { &[disabled] {
color: #515A6E !important; color: #515A6E !important;
} }
} }
} }
.report-poptip { .report-poptip {
.ivu-tooltip-inner { .ivu-tooltip-inner {
min-width: 60px !important; min-width: 60px !important;
font-size: 12px !important; font-size: 12px !important;
} }
} }
.reportmy-row { .reportmy-row {
margin-bottom: 20px; margin-bottom: 20px;
.reportmy-titles { .reportmy-titles {
line-height: 32px; line-height: 32px;
} }
} }
.report-main { .report-main {
.report-submitter { .report-submitter {
padding-top: 13px; padding-top: 13px;

View File

@ -70,6 +70,11 @@
} }
} }
} }
.manage-menu-report-badge {
margin-left: 6px;
transform: scale(0.9);
vertical-align: top;
}
.manage-menu-language { .manage-menu-language {
display: flex; display: flex;
align-items: center; align-items: center;