master
2358328281@qq.com 2 months ago
parent 7f2103a36b
commit 5d2c6f77ba

@ -146,7 +146,6 @@ $primaryLightBlue: #3289fb;
border-radius: 8px !important; border-radius: 8px !important;
cursor: pointer; cursor: pointer;
&.disabled-done { &.disabled-done {
opacity: 0.3; opacity: 0.3;
pointer-events: none; pointer-events: none;
@ -154,7 +153,7 @@ $primaryLightBlue: #3289fb;
} }
&.smaller { &.smaller {
padding: 6px 15px !important; padding: 5px 11px !important;
} }
&.rosein-sign { &.rosein-sign {

@ -59,7 +59,7 @@
</div> </div>
</header> </header>
<main class="admin-content"> <main class="admin-content">
<slot /> <slot />
</main> </main>
@ -92,12 +92,10 @@
<PasswordDialog v-model="passwordDialogVisible" :role="passwordRole" /> <PasswordDialog v-model="passwordDialogVisible" :role="passwordRole" />
<!-- 全局签到弹窗医院端登录后自动触发未签到时弹出 --> <!-- 全局签到弹窗医院端登录后自动触发未签到时弹出 -->
<SignInDialog v-model="signInDialogStore.visible" <SignInDialog v-model="signInDialogStore.visible" :signed-in="signInDialogStore.summary.isSignIn"
:signed-in="signInDialogStore.summary.isSignIn"
:total-points="signInDialogStore.summary.totalPoints" :total-points="signInDialogStore.summary.totalPoints"
:consecutive-sign-in-days="signInDialogStore.summary.consecutiveSignInDays" :consecutive-sign-in-days="signInDialogStore.summary.consecutiveSignInDays"
:sign-in-rank="signInDialogStore.summary.signInRank" :sign-in-rank="signInDialogStore.summary.signInRank" :beat-percent="signInDialogStore.summary.beatPercent"
:beat-percent="signInDialogStore.summary.beatPercent"
@success="onSignInDialogSuccess" /> @success="onSignInDialogSuccess" />
<!-- 全局奖励结果弹窗抽奖/签到/提交工单 共用 --> <!-- 全局奖励结果弹窗抽奖/签到/提交工单 共用 -->
@ -519,7 +517,7 @@ const handleCommand = async (cmd) => {
} }
} }
.admin-content { .admin-content {
flex: 1; flex: 1;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;

@ -242,6 +242,7 @@ const onClosed = () => {
height: 766px; height: 766px;
background: transparent; background: transparent;
box-shadow: none; box-shadow: none;
transform: scale(0.75);
.el-dialog__header { .el-dialog__header {

@ -399,7 +399,6 @@ const showRule = () => {
ElMessage.info("📖 签到 +1 · 抽奖 +1~10 · 提交工单 +1"); ElMessage.info("📖 签到 +1 · 抽奖 +1~10 · 提交工单 +1");
}; };
// : todo false
const signInVisible = ref(false); const signInVisible = ref(false);
const handleSignIn = async () => { const handleSignIn = async () => {
if (summary.value.isSignIn) { if (summary.value.isSignIn) {
@ -430,7 +429,7 @@ const onSignInSuccess = async () => {
const lotteryVisible = ref(false); const lotteryVisible = ref(false);
const handleDraw = () => { const handleDraw = () => {
if (summary.value.isDraw) { if (summary.value.isDraw) {
ElMessage.info("今日已抽奖,明天再来吧!"); ElMessage.warning("今日已抽奖,明天再来吧!");
return; return;
} }
lotteryVisible.value = true; lotteryVisible.value = true;

@ -373,24 +373,6 @@ const onResize = () => setTimeout(computeStripeTargets, 50);
window.addEventListener("resize", onResize); window.addEventListener("resize", onResize);
onBeforeUnmount(() => window.removeEventListener("resize", onResize)); onBeforeUnmount(() => window.removeEventListener("resize", onResize));
// TODO: mock
const buildMockTrendData = (startDate, endDate) => {
const start = startDate ? dayjs(startDate) : dayjs().startOf("month");
const end = endDate ? dayjs(endDate) : dayjs().endOf("month");
const days = [];
let cursor = start;
while (cursor.isBefore(end) || cursor.isSame(end, "day")) {
days.push(cursor.format("YYYY-MM-DD"));
cursor = cursor.add(1, "day");
}
if (!days.length) days.push(dayjs().format("YYYY-MM-DD"));
return days.map((date, i) => ({
date,
submitCount: 3 + ((i * 7) % 9),
completeCount: 2 + ((i * 5) % 7),
}));
};
const loadStats = async () => { const loadStats = async () => {
// isCustom score.vue // isCustom score.vue
const params = {}; const params = {};
@ -402,18 +384,11 @@ const loadStats = async () => {
} }
try { try {
const data = await getWorkbench(params); const data = await getWorkbench(params);
// TODO: mock data
if (data && Array.isArray(data.trendData) && data.trendData.length) { if (data && Array.isArray(data.trendData) && data.trendData.length) {
stats.value = data; stats.value = data;
const { startDate, endDate } = resolveDateRange();
stats.value = { ...stats.value, trendData: buildMockTrendData(startDate, endDate) };
} else { } else {
const { startDate, endDate } = resolveDateRange();
stats.value = { ...stats.value, trendData: buildMockTrendData(startDate, endDate) };
} }
} catch (_) { } catch (_) {
const { startDate, endDate } = resolveDateRange();
stats.value = { ...stats.value, trendData: buildMockTrendData(startDate, endDate) };
} }
}; };

Loading…
Cancel
Save