瀏覽代碼

🎨 修改细节问题

快乐的梦鱼 1 周之前
父節點
當前提交
44bff5cf6f
共有 3 個文件被更改,包括 44 次插入8 次删除
  1. 13 5
      src/components/dynamicf/UploadImageFormItem.vue
  2. 8 1
      src/pages/forms/form.vue
  3. 23 2
      src/pages/inheritor.vue

+ 13 - 5
src/components/dynamicf/UploadImageFormItem.vue

@@ -15,7 +15,7 @@
     <template v-if="single && !disabled">
       
       <div v-if="Boolean(value)" class="ant-upload-image">
-        点击替换图片
+        <span>点击替换图片</span>
         <a-image
           :src="(value as string)"
           alt="avatar"
@@ -198,13 +198,21 @@ function handleUploadSubImgChange(info: FileInfo) {
 
 <style lang="scss">
 .ant-upload-image {
-  margin-top: 10px;
-  display: flex;
-  flex-direction: column;
+  position: relative;
   border: 1px solid #666666;
-  background-color: #e8e8e8;
+  overflow: hidden;
   border-radius: 8px;
   text-align: center;
+
+  span {
+    position: absolute;
+    margin: 10px;
+    background-color: #e8e8e8;
+    border-radius: 8px;
+    padding: 5px 10px;
+    font-size: 12px;
+    z-index: 1;
+  }
 }
 
 </style>

+ 8 - 1
src/pages/forms/form.vue

@@ -255,8 +255,15 @@ async function loadData() {
   }
 }
 async function loadHistoryData(page: number, pageSize: number, dropDownValues: number[], searchText: string) {
+  const contentId = Number(route.query.id || formModel.value.contentId)
+  if (isNaN(contentId))
+    return {
+      page,
+      total: 0,
+      data: []
+    };
   const res = (await InheritorContent.getCollectList(props.model, {
-    contentId: Number(route.query.id || formModel.value.contentId),
+    contentId,
     collectType: 'content',
     userId: authStore.userInfo?.id,
     page,

+ 23 - 2
src/pages/inheritor.vue

@@ -195,6 +195,7 @@ import ShowValueOrNull from '@/components/dynamicf/Display/ShowValueOrNull.vue';
 import EmptyToRecord from '@/components/parts/EmptyToRecord.vue';
 import { SettingsUtils } from '@imengyu/imengyu-utils';
 import { useSimpleDataLoader } from '@/composeable/SimpleDataLoader';
+import { RequestApiError } from '@imengyu/imengyu-utils/dist/request';
 
 const router = useRouter();
 const route = useRoute();
@@ -211,8 +212,28 @@ const ichData = useSimpleDataLoader(async () => {
   planData.value = await InheritorContent.getPlanList(data.id);
   return data;
 });
-const inheritorData = useSimpleDataLoader(async () => await InheritorContent.getInheritorInfo(undefined));
-const seminarData = useSimpleDataLoader(async () => await InheritorContent.getSeminarInfo(undefined));
+const inheritorData = useSimpleDataLoader<InheritorInfo|null>(async () => {
+  try {
+    return await InheritorContent.getInheritorInfo(undefined)
+  } catch (e) {
+    if (e instanceof RequestApiError) {
+      if (e.errorMessage === '暂无信息,等待采集')
+        return null;
+    }
+    throw e;
+  }
+});
+const seminarData = useSimpleDataLoader<SeminarInfo|null>(async () => {
+  try {
+    return await InheritorContent.getSeminarInfo(undefined);
+  } catch (e) {
+    if (e instanceof RequestApiError) {
+      if (e.errorMessage === '暂无信息,等待采集')
+        return null;
+    }
+    throw e;
+  }
+});
 
 
 function openInMessage() {