浏览代码

🎨 优化审核页面显示

快乐的梦鱼 2 周之前
父节点
当前提交
dac795ac3b

+ 6 - 0
src/assets/scss/fix.scss

@@ -54,6 +54,12 @@
 }
 .ant-upload-list-item-name {
   white-space: wrap!important;
+  word-break: break-all;
+  max-width: 100%;
+  max-height: 60px;
+  overflow: hidden;
+  overflow-y: scroll!important;
+  font-size: 12px;
 }
 
 @media screen and (max-width: 768px) {

+ 1 - 1
src/assets/scss/main.scss

@@ -341,7 +341,7 @@ $small-banner-height: 445px;
 }
 @media (max-width: 425px) {
   .main-section {
-    padding: 80px 10px;
+    padding: 50px 10px;
     &.small-h {
       padding-top: 20px;
       padding-bottom: 20px;

+ 10 - 0
src/assets/scss/news.scss

@@ -233,8 +233,14 @@
 }
 @media (max-width: 540px) {
   .news-list {
+
+    .list {
+      gap: 10px;
+    }
+
     .item {
       flex-direction: column;
+      padding: 6px 8px;
 
       img {
         width: 100%;
@@ -242,6 +248,10 @@
         
         margin-right: 0;
         margin-bottom: 16px;
+
+        &:not(.has-image) {
+          display: none;
+        }
       }
     }
   }

+ 1 - 0
src/common/config/AppCofig.ts

@@ -7,6 +7,7 @@ export default {
   loginPage: '/login',
   noLoginPages: [
     '/login',
+    '/test',
     '/',
   ],
 }

+ 1 - 0
src/components/content/CommonListBlock.vue

@@ -91,6 +91,7 @@
           >
             <a class="hidden" :href="router.resolve({ path: props.detailsPage, query: { id: item.id }}).href" />
             <img
+              :class="item.image ? 'has-image' : ''"
               :src="item.image || defaultImage" alt="新闻图片" 
             />
             <TitleDescBlock

+ 1 - 0
src/components/controls/SimpleInput.vue

@@ -75,6 +75,7 @@ function handleBlur() {
     border: none;
     outline: none;
     background-color: transparent;
+    width: calc(100% - 40px);
   }
 
   .prefix {

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

@@ -112,7 +112,7 @@
                 </a-button>
               </div>
             </template>
-            <a-button type="default" size="small" class="ml-3">选择文件上传</a-button>
+            <a-button v-if="!readonly" type="default" size="small" class="ml-3">上传</a-button>
           </a-upload>
         </template>
       </div>

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

@@ -30,7 +30,7 @@
               <ExclamationCircleOutlined /> 已退回
             </span>
             <span v-if="item.progress > 0" class="mr-3 text-sm">
-              之前退回
+              <InfoCircleOutlined /> 之前退回
             </span>
           </a-popover>
           <span class="mr-3 text-sm text-gray-600">{{ selfAssessmentProgressLabel(item.progress) }}</span>
@@ -79,7 +79,7 @@
 import { ref } from 'vue';
 import { useRouter } from 'vue-router';
 import { message } from 'ant-design-vue';
-import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
+import { ExclamationCircleOutlined, InfoCircleOutlined } from '@ant-design/icons-vue';
 import CommonListBlock, { type DropdownCommonItem } from '@/components/content/CommonListBlock.vue';
 import AssessmentContentApi from '@/api/collect/AssessmentContent';
 import { useMemorizeVar } from '@/composeables/useMemorizeVar';

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

@@ -49,7 +49,7 @@
                 :description="`仅项目保护单位(9)、县(区)文旅部门(5)、设区市文旅部门/省非遗中心(10)、省文化和旅游厅(11) 可提交。`"
               />
               <a-form layout="vertical" size="middle">
-                <div class="flex row w-full gap-3">
+                <div class="flex flex-col md:flex-row lg:flex-row w-full gap-3">
                   <div class="flex flex-col flex-1">
                     <a-form-item required :label="`审核通过:${reviewLevelLabel}`">
                       <a-select

+ 29 - 0
src/pages/test.vue

@@ -0,0 +1,29 @@
+<template>
+  <div class="flex flex-col gap-2">
+    <p class="break-all">directAuthInfo: {{ directAuthInfo }} 
+      <pre>decodeURIComponent: {{ decodeURIComponent(directAuthInfo) }}</pre>
+      <pre>{{ prasedDirectAuthInfo }}</pre>
+    </p>
+    <p v-if="err" class="text-red-600">err: {{ err }}</p>
+    <p>isInMiniProgram: {{ isInMiniProgram }}</p>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { HtmlUtils } from '@imengyu/imengyu-utils';
+import { computed, ref } from 'vue';
+
+const directAuthInfo = HtmlUtils.getQueryVariable('directAuthInfo') || '{}';
+const isInMiniProgram = HtmlUtils.getQueryVariable('inMiniProgram') === 'true';
+
+const err = ref('');
+
+const prasedDirectAuthInfo = computed(() => {
+  try {
+    return JSON.parse(decodeURIComponent(directAuthInfo));
+  } catch (e) {
+    err.value = e + '';
+    return {};
+  }
+});
+</script>

+ 6 - 0
src/router/index.ts

@@ -1,5 +1,6 @@
 import { createRouter, createWebHashHistory } from 'vue-router'
 import Index from '@/pages/index.vue'
+import Test from '@/pages/test.vue'
 import NotFound from '@/pages/404.vue'
 
 const router = createRouter({
@@ -11,6 +12,11 @@ const router = createRouter({
       component: Index,
     },
     {
+      path: '/test',
+      name: 'Test',
+      component: Test,
+    },
+    {
       path: '/forms/ich',
       name: 'FormIch',
       component: () => import('@/pages/forms/ich.vue'),

+ 22 - 15
src/stores/auth.ts

@@ -18,20 +18,25 @@ export const useAuthStore = defineStore('auth', {
   actions: {
     async loadLoginState() {
       try {
+        let fromMp = false;
         let res = localStorage.getItem(STORAGE_KEY);
-        if (!res) {
-          const directAuthInfo = HtmlUtils.getQueryVariable('directAuthInfo');
-          if (directAuthInfo)
-            res = directAuthInfo;
-          else  
-            throw 'no storage';
+        const directAuthInfo = HtmlUtils.getQueryVariable('directAuthInfo');
+        if (directAuthInfo) {
+          res = decodeURIComponent(directAuthInfo);
+          fromMp = true;
         }
+
+        if (!res) 
+          throw 'no storage';
+  
         const authInfo = JSON.parse(res);
         this.token = authInfo.token;
         this.userId = authInfo.userId;
         this.expireAt = authInfo.expireAt;
         this.userInfo = authInfo.userInfo;
         this.loginType = authInfo.loginType;
+        if (fromMp)
+          this.saveLogData();
 
         // 检查token是否过期,如果快要过期,则刷新token
         if (canRefresh && Date.now() > this.expireAt + 1000 * 3600 * 5) {
@@ -68,25 +73,27 @@ export const useAuthStore = defineStore('auth', {
       this.userInfo = loginResult.userInfo;
       this.loginType = loginType;
       this.expireAt = (loginResult.expiresIn || 0) + Date.now();
+      this.saveLogData();
+    },
+    async logout() {
+      this.token = '';
+      this.userId = 0;
+      this.userInfo = null;
 
+      SettingsUtils.setSettings('inheritorShowInMessageLastTime', 0);
+      localStorage.removeItem(STORAGE_KEY);
+    },
+    saveLogData() {
       localStorage.setItem(STORAGE_KEY, 
         JSON.stringify({ 
           token: this.token, 
           userId: this.userId ,
           expireAt: this.expireAt,
           userInfo: this.userInfo,
-          loginType,
+          loginType: this.loginType,
         }) 
       );
     },
-    async logout() {
-      this.token = '';
-      this.userId = 0;
-      this.userInfo = null;
-
-      SettingsUtils.setSettings('inheritorShowInMessageLastTime', 0);
-      localStorage.removeItem(STORAGE_KEY);
-    }
   },
   getters: {
     isAdmin(state) {