Переглянути джерело

🎨 优化显示,优化审核回退状态显示

快乐的梦鱼 2 тижнів тому
батько
коміт
b68f7a45c6

+ 3 - 2
src/App.vue

@@ -8,7 +8,7 @@
     }"
     :componentSize="'large'"
   >
-    <NavBar />
+    <NavBar v-if="!isInMiniProgram" />
     <main>
       <RouterView v-slot="{ Component }">
         <KeepAlive>
@@ -17,7 +17,7 @@
         <component :is="Component" v-if="!route.meta.keepAlive" />
       </RouterView>
     </main>
-    <FooterSmall />
+    <FooterSmall v-if="!isInMiniProgram" />
   </a-config-provider>
 </template>
 
@@ -30,6 +30,7 @@ import { useAppConfiguration } from './api/system/useAppConfiguration';
 import NavBar from './components/NavBar.vue';
 import zhCN from "ant-design-vue/es/locale/zh_CN";
 import FooterSmall from './components/FooterSmall.vue';
+import { isInMiniProgram } from './composeables/MiniProgramIng.ts';
 
 const authStore = useAuthStore();
 const { checkAndRedirectLoginPage } = useRedirectLoginPage();

+ 8 - 4
src/components/content/CommonListBlock.vue

@@ -3,7 +3,7 @@
   <div v-show="show" >
     <div class="content mb-2">
       <!-- 搜素栏 -->
-      <div class="row mt-4 items-center">
+      <div class="row mt-4 mb-2 items-center">
         <!-- 左栏 -->
         <div class="col-sm-12 col-md-6 col-lg-6">
           <!-- 分类 -->
@@ -24,17 +24,21 @@
           <slot name="headLeft"></slot>
         </div>
         <!-- 右栏 -->
-        <div class="col-sm-12 col-md-6 col-lg-6 flex flex-row justify-end items-start flex-wrap gap-[5px]">
+        <div class="col-sm-12 col-md-6 col-lg-6 flex flex-row justify-end items-start flex-wrap gap-1.25">
           <Dropdown
             v-for="(drop, k) in dropDownNames" :key="k" 
             :selectedValue="dropDownValues[k]"
             :options="drop.options" 
             labelKey="name"
             valueKey="id"
-            style="max-width: 150px"
             @update:selectedValue="(v) => handleChangeDropDownValue(k, v)"
           />
-          <SimpleInput v-if="showSearch" v-model="searchText" placeholder="请输入关键词" @search="handleSearch">
+          <SimpleInput 
+            v-if="showSearch" v-model="searchText" 
+            class="max-w-40 md:max-w-50 lg:max-w-75"
+            placeholder="请输入关键词" 
+            @search="handleSearch"
+          >
             <template #suffix>
               <IconSearch
                 class="search-icon"

+ 3 - 2
src/components/controls/Dropdown.vue

@@ -85,7 +85,7 @@ function selectOption(option: any) {
   flex-direction: row;
   align-items: center;
   justify-content: space-between;
-  padding: 10px 15px;
+  padding: 6px 8px;
   background-color: $box-inset-color;
   border: 1px solid $primary-color;
   user-select: none;
@@ -94,6 +94,7 @@ function selectOption(option: any) {
   overflow: hidden;
   text-overflow: ellipsis;
   max-width: 100%;
+  font-size: 12px;
 
   .arrow {
     width: 15px;
@@ -106,7 +107,7 @@ function selectOption(option: any) {
     }
   }
   span {
-    font-size: 17.5px;
+    font-size: 12px;
     color: var(--nana-text-1);
     max-width: calc(100% - 25px);
     white-space: nowrap;

+ 4 - 3
src/components/controls/SimpleInput.vue

@@ -60,8 +60,9 @@ function handleBlur() {
   flex-direction: row;
   align-items: center;
   justify-content: space-between;
-  padding: 10px 15px;
+  padding: 3px 6px;
   background-color: $box-color;
+  font-size: 12px;
   border: 1px solid $border-default-color;
 
   &.focus {
@@ -69,7 +70,7 @@ function handleBlur() {
   }
 
   input {
-    font-size: 1rem;
+    font-size: inherit;
     color: $text-color;
     border: none;
     outline: none;
@@ -106,6 +107,6 @@ function handleBlur() {
 }
 .nana-input-text {
   color: $text-color;
-  font-size: 26px;
+  font-size: 12px;
 }
 </style>

+ 3 - 0
src/composeables/MiniProgramIng.ts

@@ -0,0 +1,3 @@
+import { HtmlUtils } from "@imengyu/imengyu-utils";
+
+export const isInMiniProgram = HtmlUtils.getQueryVariable('inMiniProgram') === 'true';

+ 6 - 2
src/pages/admin.vue

@@ -1,16 +1,19 @@
 <template>
   <!-- 管理员管理首页 -->
   <div class="about main-background main-background-type0">
-    <div class="nav-placeholder">
+    <div v-if="!isInMiniProgram" class="nav-placeholder">
     </div>
     <!-- 表单 -->
     <section class="main-section large">
       <div class="content">
-        <div class="title">
+        <div v-if="!isInMiniProgram" class="title">
           <h2>管理员管理</h2>
         </div>
        
         <a-tabs v-model:activeKey="activeKey" centered>
+          <template #renderTabBar="{ DefaultTabBar, ...props }">
+            <component v-if="!isInMiniProgram" :is="DefaultTabBar" v-bind="props" />
+          </template>
           <a-tab-pane key="1" tab="传承人列表">
             <CommonListBlock 
               :showTotal="true"
@@ -191,6 +194,7 @@ import EvaluationFormList from './collect/assessment/evaluation-form-list.vue';
 import { InfoCircleOutlined } from '@ant-design/icons-vue';
 import { useSimpleDataLoader } from '@/composeables/useSimpleDataLoader';
 import { useMemorizeVar } from '@/composeables/useMemorizeVar';
+import { isInMiniProgram } from '@/composeables/MiniProgramIng.ts';
 
 const { toClipboard } = useClipboard();
 const router = useRouter();

+ 1 - 0
src/pages/collect/assessment/components/SelfAssessmentFormBlock.vue

@@ -101,6 +101,7 @@
                   <component :is="originNode" />
                 </div>
                 <a-button
+                  v-if="!readonly"
                   type="link"
                   size="small"
                   class="mt-2!"

+ 8 - 3
src/pages/collect/assessment/evaluation-form-list.vue

@@ -19,16 +19,19 @@
           },
         ]"
         :load="(page: number, pageSize: number, _tag: number, searchText: string, drop: number[]) => loadSelfAssessmentAdminList(page, pageSize, searchText, drop)"
-        :show-detail="(item) => router.push({ name: 'CollectEvaluationForm', query: { id: item.checkId ?? item.id, userId: item.userId } })"
+        :show-detail="handleReviewSelfAssessment"
       >
         <template #itemRight="{ item }">
           <a-popover v-if="item.rejectType && item.rejectType > 0" title="退回原因" trigger="hover">
             <template #content>
               <div style="max-width: 300px">{{ item.rejectReason || '无' }}</div>
             </template>
-            <span class="mr-3 text-sm" style="color: #f5222d; cursor: pointer;">
+            <span v-if="item.progress <= 0" class="mr-3 text-sm" style="color: #f5222d; cursor: pointer;">
               <ExclamationCircleOutlined /> 已退回
             </span>
+            <span v-if="item.progress > 0" class="mr-3 text-sm">
+              之前退回
+            </span>
           </a-popover>
           <span class="mr-3 text-sm text-gray-600">{{ selfAssessmentProgressLabel(item.progress) }}</span>
           <a-button type="link" @click.stop="router.push({ name: 'CollectEvaluationForm', query: { id: item.checkId ?? item.id, userId: item.userId } })">编辑</a-button>
@@ -36,7 +39,9 @@
             type="primary"
             v-if="item.checkId && item.progress != null && item.progress >= 1 && item.progress < 5"
             @click.stop="handleReviewSelfAssessment(item)"
-          >审核</a-button>
+          >
+            审核
+          </a-button>
         </template>
       </CommonListBlock>
     </a-tab-pane>

+ 1 - 4
src/pages/collect/assessment/evaluation-form-review.vue

@@ -299,9 +299,6 @@ onMounted(() => {
   loader.load();
 });
 
-/** 回退后 progress:退回至上一环节 */
-const rejectTargetProgress = computed(() => Math.max(1, reviewProgress.value - 1));
-
 async function submitReject() {
   const f = currentForm.value;
   if (!f?.id) {
@@ -322,7 +319,7 @@ async function submitReject() {
     rejectLoading.value = true;
     await AssessmentContentApi.reviewSelfAssessment({
       id: f.id,
-      progress: rejectTargetProgress.value,
+      progress: f.progress,
       rejectType: t,
       rejectReason: reason,
     });

+ 9 - 4
src/stores/auth.ts

@@ -1,5 +1,5 @@
 import UserApi, { LoginResult, UserInfo } from "@/api/auth/UserApi";
-import { SettingsUtils } from "@imengyu/imengyu-utils";
+import { HtmlUtils, SettingsUtils } from "@imengyu/imengyu-utils";
 import { defineStore } from "pinia"
 
 const STORAGE_KEY = 'authInfo';
@@ -18,9 +18,14 @@ export const useAuthStore = defineStore('auth', {
   actions: {
     async loadLoginState() {
       try {
-        const res = localStorage.getItem(STORAGE_KEY);
-        if (!res)
-          throw 'no storage';
+        let res = localStorage.getItem(STORAGE_KEY);
+        if (!res) {
+          const directAuthInfo = HtmlUtils.getQueryVariable('directAuthInfo');
+          if (directAuthInfo)
+            res = directAuthInfo;
+          else  
+            throw 'no storage';
+        }
         const authInfo = JSON.parse(res);
         this.token = authInfo.token;
         this.userId = authInfo.userId;