no message

This commit is contained in:
kuaifan 2022-12-12 08:38:21 +08:00
parent b2bb2ddb1f
commit 8b406c594b
7 changed files with 221 additions and 141 deletions

View File

@ -820,6 +820,11 @@ class SystemController extends AbstractController
{
User::auth('admin');
//
$setting = Base::setting('checkinSetting');
if ($setting['open'] !== 'open') {
return Base::retError('此功能未开启,请前往系统设置开启');
}
//
$userid = Base::arrayRetainInt(Request::input('userid'), true);
$date = Request::input('date');
$time = Request::input('time');
@ -848,7 +853,7 @@ class SystemController extends AbstractController
$headings[] = '成员名称';
$headings[] = '成员邮箱';
$headings[] = '签到日期';
$headings[] = '签到班次';
$headings[] = '班次时间';
$headings[] = '首次签到时间';
$headings[] = '首次签到结果';
$headings[] = '最后签到时间';

View File

@ -70,6 +70,7 @@
</div>
</DropdownItem>
<DropdownItem name="exportTask">{{$L('导出任务统计')}}</DropdownItem>
<DropdownItem name="exportCheckin">{{$L('导出签到数据')}}</DropdownItem>
</DropdownMenu>
</Dropdown>
<!-- 其他菜单 -->
@ -236,34 +237,10 @@
</Modal>
<!--导出任务统计-->
<Modal
v-model="exportTaskShow"
:title="$L('导出任务统计')"
:mask-closable="false">
<Form ref="exportTask" :model="exportData" label-width="auto" @submit.native.prevent>
<FormItem :label="$L('导出成员')">
<UserInput v-model="exportData.userid" :multiple-max="20" :placeholder="$L('请选择成员')"/>
</FormItem>
<FormItem :label="$L('时间范围')">
<DatePicker
v-model="exportData.time"
type="daterange"
format="yyyy/MM/dd"
style="width:100%"
:placeholder="$L('请选择时间')"/>
</FormItem>
<FormItem prop="type" :label="$L('导出时间类型')">
<RadioGroup v-model="exportData.type">
<Radio label="taskTime">{{$L('任务时间')}}</Radio>
<Radio label="createdTime">{{$L('创建时间')}}</Radio>
</RadioGroup>
</FormItem>
</Form>
<div slot="footer" class="adaption">
<Button type="default" @click="exportTaskShow=false">{{$L('取消')}}</Button>
<Button type="primary" :loading="exportLoadIng > 0" @click="onExportTask">{{$L('导出')}}</Button>
</div>
</Modal>
<TaskExport v-model="exportTaskShow"/>
<!--导出签到数据-->
<CheckinExport v-model="exportCheckinShow"/>
<!--任务详情-->
<TaskModal ref="taskModal"/>
@ -322,7 +299,6 @@ import TeamManagement from "./manage/components/TeamManagement";
import ProjectManagement from "./manage/components/ProjectManagement";
import DrawerOverlay from "../components/DrawerOverlay";
import MobileTabbar from "../components/Mobile/Tabbar";
import UserInput from "../components/UserInput";
import TaskAdd from "./manage/components/TaskAdd";
import Report from "./manage/components/Report";
import MobileBack from "../components/Mobile/Back";
@ -331,18 +307,21 @@ import MeetingManager from "./manage/components/MeetingManager";
import longpress from "../directives/longpress";
import DialogModal from "./manage/components/DialogModal";
import TaskModal from "./manage/components/TaskModal";
import CheckinExport from "./manage/components/CheckinExport";
import TaskExport from "./manage/components/TaskExport";
import notificationKoro from "notification-koro1";
import {Store} from "le5le-store";
export default {
components: {
TaskExport,
CheckinExport,
TaskModal,
DialogModal,
MeetingManager,
MobileNotification,
MobileBack,
MobileTabbar,
UserInput,
TaskAdd,
Report,
DrawerOverlay,
@ -373,12 +352,7 @@ export default {
addTaskSubscribe: null,
exportTaskShow: false,
exportLoadIng: 0,
exportData: {
userid: [],
time: [],
type:'taskTime',
},
exportCheckinShow: false,
dialogMsgSubscribe: null,
@ -738,6 +712,9 @@ export default {
case 'exportTask':
this.exportTaskShow = true;
return;
case 'exportCheckin':
this.exportCheckinShow = true;
return;
case 'workReport':
if (this.reportUnreadNumber > 0) {
this.reportTabs = "receive";
@ -1037,26 +1014,6 @@ export default {
});
},
onExportTask() {
if (this.exportLoadIng > 0) {
return;
}
this.exportLoadIng++;
this.$store.dispatch("call", {
url: 'project/task/export',
data: this.exportData,
}).then(({data}) => {
this.exportTaskShow = false;
this.$store.dispatch('downUrl', {
url: data.url
});
}).catch(({msg}) => {
$A.modalError(msg);
}).finally(_ => {
this.exportLoadIng--;
});
},
onTabbarClick(act) {
switch (act) {
case 'addTask':

View File

@ -0,0 +1,111 @@
<template>
<Modal
v-model="show"
:title="$L('导出签到数据')"
:mask-closable="false">
<Form ref="export" :model="formData" label-width="auto" @submit.native.prevent>
<FormItem :label="$L('导出成员')">
<UserInput v-model="formData.userid" :multiple-max="20" :placeholder="$L('请选择成员')"/>
<div class="form-tip">{{$L('每次最多选择导出20个成员')}}</div>
</FormItem>
<FormItem :label="$L('签到日期')">
<DatePicker
v-model="formData.date"
type="daterange"
format="yyyy/MM/dd"
style="width:100%"
:placeholder="$L('请选择签到日期')"/>
<div class="form-tip page-setting-checkin-export-common">
{{$L('快捷选择')}}:
<em @click="formData.date=dateShortcuts('prev')">{{$L('上个月')}}</em>
<em @click="formData.date=dateShortcuts('this')">{{$L('这个月')}}</em>
</div>
</FormItem>
<FormItem :label="$L('班次时间')">
<TimePicker
v-model="formData.time"
type="timerange"
format="HH:mm"
style="width:100%"
:placeholder="$L('请选择班次时间')"/>
<div class="form-tip page-setting-checkin-export-common">
{{$L('快捷选择')}}:
<em @click="formData.time=['8:30', '18:00']">8:30-18:00</em>
<em @click="formData.time=['9:00', '18:00']">9:00-18:00</em>
<em @click="formData.time=['9:30', '18:00']">9:30-18:30</em>
</div>
</FormItem>
</Form>
<div slot="footer" class="adaption">
<Button type="default" @click="show=false">{{$L('取消')}}</Button>
<Button type="primary" :loading="loadIng > 0" @click="onExport">{{$L('导出')}}</Button>
</div>
</Modal>
</template>
<script>
import UserInput from "../../../components/UserInput";
export default {
name: "CheckinExport",
components: {UserInput},
props: {
value: {
type: Boolean,
default: false
},
},
data() {
return {
show: this.value,
loadIng: 0,
formData: {
userid: [],
date: [],
time: [],
},
}
},
watch: {
value(v) {
this.show = v;
},
show(v) {
this.value !== v && this.$emit("input", v)
}
},
methods: {
dateShortcuts(act) {
const lastSecond = (e) => {
return $A.Date($A.formatDate("Y-m-d 23:59:29", Math.round(e / 1000)))
};
if (act === 'prev') {
return [$A.getData('上个月', true), lastSecond($A.getData('上个月结束', true))];
} else if (act === 'this') {
return [$A.getData('本月', true), lastSecond($A.getData('本月结束', true))]
}
},
onExport() {
if (this.loadIng > 0) {
return;
}
this.loadIng++;
this.$store.dispatch("call", {
url: 'system/checkin/export',
data: this.formData,
}).then(({data}) => {
this.show = false;
this.$store.dispatch('downUrl', {
url: data.url
});
}).catch(({msg}) => {
$A.modalError(msg);
}).finally(_ => {
this.loadIng--;
});
}
}
}
</script>

View File

@ -0,0 +1,86 @@
<template>
<Modal
v-model="show"
:title="$L('导出任务统计')"
:mask-closable="false">
<Form ref="exportTask" :model="formData" label-width="auto" @submit.native.prevent>
<FormItem :label="$L('导出成员')">
<UserInput v-model="formData.userid" :multiple-max="20" :placeholder="$L('请选择成员')"/>
</FormItem>
<FormItem :label="$L('时间范围')">
<DatePicker
v-model="formData.time"
type="daterange"
format="yyyy/MM/dd"
style="width:100%"
:placeholder="$L('请选择时间')"/>
</FormItem>
<FormItem prop="type" :label="$L('导出时间类型')">
<RadioGroup v-model="formData.type">
<Radio label="taskTime">{{$L('任务时间')}}</Radio>
<Radio label="createdTime">{{$L('创建时间')}}</Radio>
</RadioGroup>
</FormItem>
</Form>
<div slot="footer" class="adaption">
<Button type="default" @click="show=false">{{$L('取消')}}</Button>
<Button type="primary" :loading="loadIng > 0" @click="onExport">{{$L('导出')}}</Button>
</div>
</Modal>
</template>
<script>
import UserInput from "../../../components/UserInput";
export default {
name: "TaskExport",
components: {UserInput},
props: {
value: {
type: Boolean,
default: false
},
},
data() {
return {
show: this.value,
loadIng: 0,
formData: {
userid: [],
time: [],
type:'taskTime',
},
}
},
watch: {
value(v) {
this.show = v;
},
show(v) {
this.value !== v && this.$emit("input", v)
}
},
methods: {
onExport() {
if (this.loadIng > 0) {
return;
}
this.loadIng++;
this.$store.dispatch("call", {
url: 'project/task/export',
data: this.formData,
}).then(({data}) => {
this.show = false;
this.$store.dispatch('downUrl', {
url: data.url
});
}).catch(({msg}) => {
$A.modalError(msg);
}).finally(_ => {
this.loadIng--;
});
}
}
}
</script>

View File

@ -38,48 +38,7 @@
</div>
<!--导出签到数据-->
<Modal
v-model="exportShow"
:title="$L('导出签到数据')"
:mask-closable="false">
<Form ref="export" :model="exportData" label-width="auto" @submit.native.prevent>
<FormItem :label="$L('导出成员')">
<UserInput v-model="exportData.userid" :multiple-max="20" :placeholder="$L('请选择成员')"/>
<div class="form-tip">{{$L('每次最多选择导出20个成员')}}</div>
</FormItem>
<FormItem :label="$L('签到日期')">
<DatePicker
v-model="exportData.date"
type="daterange"
format="yyyy/MM/dd"
style="width:100%"
:placeholder="$L('请选择签到日期')"/>
<div class="form-tip page-setting-checkin-export-common">
{{$L('快捷选择')}}:
<em @click="exportData.date=dateShortcuts('prev')">{{$L('上个月')}}</em>
<em @click="exportData.date=dateShortcuts('this')">{{$L('这个月')}}</em>
</div>
</FormItem>
<FormItem :label="$L('签到班次')">
<TimePicker
v-model="exportData.time"
type="timerange"
format="HH:mm"
style="width:100%"
:placeholder="$L('请选择签到班次')"/>
<div class="form-tip page-setting-checkin-export-common">
{{$L('快捷选择')}}:
<em @click="exportData.time=['8:30', '18:00']">8:30-18:00</em>
<em @click="exportData.time=['9:00', '18:00']">9:00-18:00</em>
<em @click="exportData.time=['9:30', '18:00']">9:30-18:30</em>
</div>
</FormItem>
</Form>
<div slot="footer" class="adaption">
<Button type="default" @click="exportShow=false">{{$L('取消')}}</Button>
<Button type="primary" :loading="exportLoadIng > 0" @click="onExport">{{$L('导出')}}</Button>
</div>
</Modal>
<CheckinExport v-model="exportShow"/>
<!--查看所有团队-->
<DrawerOverlay
@ -92,12 +51,12 @@
</template>
<script>
import UserInput from "../../../../components/UserInput";
import DrawerOverlay from "../../../../components/DrawerOverlay";
import TeamManagement from "../../components/TeamManagement";
import CheckinExport from "../../components/CheckinExport";
export default {
name: "SystemCheckin",
components: {TeamManagement, DrawerOverlay, UserInput},
components: {CheckinExport, TeamManagement, DrawerOverlay},
data() {
return {
loadIng: 0,
@ -127,14 +86,7 @@ export default {
},
allUserShow: false,
exportShow: false,
exportLoadIng: 0,
exportData: {
userid: [],
date: [],
time: [],
},
}
},
@ -175,42 +127,11 @@ export default {
});
},
dateShortcuts(act) {
const lastSecond = (e) => {
return $A.Date($A.formatDate("Y-m-d 23:59:29", Math.round(e / 1000)))
};
if (act === 'prev') {
return [$A.getData('上个月', true), lastSecond($A.getData('上个月结束', true))];
} else if (act === 'this') {
return [$A.getData('本月', true), lastSecond($A.getData('本月结束', true))]
}
},
clickCmd() {
this.$nextTick(_ => {
this.$refs.cmd.focus({cursor:'all'});
});
},
onExport() {
if (this.exportLoadIng > 0) {
return;
}
this.exportLoadIng++;
this.$store.dispatch("call", {
url: 'system/checkin/export',
data: this.exportData,
}).then(({data}) => {
this.exportShow = false;
this.$store.dispatch('downUrl', {
url: data.url
});
}).catch(({msg}) => {
$A.modalError(msg);
}).finally(_ => {
this.exportLoadIng--;
});
}
}
}
</script>

View File

@ -79,7 +79,7 @@ export default {
]
if (this.$Electron) {
menu.splice(2, 0, {path: 'keyboard', name: '快捷键'})
menu.splice(2, 0, {path: 'keyboard', name: '快捷键', desc: ' (Beta)'})
}
if ([

View File

@ -1,7 +1,7 @@
<template>
<div class="setting-item submit">
<Form ref="formData" :model="formData" :rules="ruleData" label-width="auto" @submit.native.prevent>
<FormItem :label="`${$L('截图快捷键')} (Beta)`" prop="screenshot">
<FormItem :label="$L('截图快捷键')" prop="screenshot">
<div class="input-box">
<Checkbox v-model="formData.screenshot_mate">{{mateName}}</Checkbox>
<div class="input-box-push">+</div>