xiaodai2017 2 سال پیش
والد
کامیت
397a71e512

+ 26 - 22
src/layout/components/appMain.vue

@@ -85,42 +85,46 @@ const transitionMain = defineComponent({
             <backTop />
           </el-backtop>
           <transitionMain :route="route">
-            <keep-alive
-              v-if="keepAlive"
-              :include="usePermissionStoreHook().cachePageList"
-            >
+            <div>
+              <keep-alive
+                v-if="keepAlive"
+                :include="usePermissionStoreHook().cachePageList"
+              >
+                <component
+                  :is="Component"
+                  :key="route.fullPath"
+                  class="main-content"
+                />
+              </keep-alive>
               <component
+                v-else
                 :is="Component"
                 :key="route.fullPath"
                 class="main-content"
               />
-            </keep-alive>
-            <component
-              v-else
-              :is="Component"
-              :key="route.fullPath"
-              class="main-content"
-            />
+            </div>
           </transitionMain>
         </el-scrollbar>
         <div v-else>
           <transitionMain :route="route">
-            <keep-alive
-              v-if="keepAlive"
-              :include="usePermissionStoreHook().cachePageList"
-            >
+            <div>
+              <keep-alive
+                v-if="keepAlive"
+                :include="usePermissionStoreHook().cachePageList"
+              >
+                <component
+                  :is="Component"
+                  :key="route.fullPath"
+                  class="main-content"
+                />
+              </keep-alive>
               <component
+                v-else
                 :is="Component"
                 :key="route.fullPath"
                 class="main-content"
               />
-            </keep-alive>
-            <component
-              v-else
-              :is="Component"
-              :key="route.fullPath"
-              class="main-content"
-            />
+            </div>
           </transitionMain>
         </div>
       </template>

+ 24 - 2
src/utils/column-helper.ts

@@ -40,7 +40,7 @@ export function renderStatusList(options: any[]) {
       )
     );
   });
-  return arr2;
+  return h("div", {}, arr2);
 }
 
 export function renderImage(prop = "image") {
@@ -89,13 +89,35 @@ export function renderImages(prop: string) {
             )
           );
         });
-        return arr2;
+        return h("div", {}, arr2);
       } else {
         return "";
       }
     }
   };
 }
+export function renderGoodParam(prop: string) {
+  return {
+    cellRenderer({ row }) {
+      const arr2 = [];
+      row[prop].forEach(item => {
+        arr2.push(
+          h(
+            ElTag,
+            {
+              type: "",
+              style: "margin:0 0 0 10px"
+            },
+            {
+              default: () => `${item.key}:${item.value}` || "--"
+            }
+          )
+        );
+      });
+      return h("div", {}, arr2);
+    }
+  };
+}
 
 export function convertOptions(source: any[], prop = "id") {
   return source.map(item => ({ value: item[prop], label: item.label }));

+ 9 - 11
src/views/mobile/exchangeStock/config/_details.ts

@@ -1,16 +1,13 @@
 /* eslint-disable prettier/prettier */
-import { h } from "vue";
-import { ElImage, ElTag } from "element-plus";
+
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 import { FormConfig } from "/@/components/PageSearch";
-import { createTooltip } from "/@/utils/tooltip";
-import { GOOD_OPTIONS } from "/@/config/status";
 import {
-  renderStatus,
+  // renderStatus,
   renderImage,
-  renderImages
+  renderImages,
+  renderGoodParam
 } from "/@/utils/column-helper";
-// import { payWayOptions, sendWayOptions, supplyAreaOptions } from "./_options";
 
 export const projectFormConfig: FormConfig = {
   labelWidth: "100px",
@@ -97,22 +94,23 @@ export const bargainColumns: DescriptionColumns = [
     field: "good_banner_img",
     label: "商品轮播图",
     span: 12,
-    // render: (_, row) => renderImages("good_banner_img").cellRenderer({ row })
+    render: (_, row) => renderImages("good_banner_img").cellRenderer({ row })
   },
   {
     field: "good_img",
     label: "商品详情图",
-    // render: (_, row) => renderImages("good_img").cellRenderer({ row }),
+    render: (_, row) => renderImages("good_img").cellRenderer({ row }),
     span: 12
   },
   {
     field: "good_param",
     label: "商品参数",
-    span: 12
+    render: (_, row) => renderGoodParam("good_param").cellRenderer({ row }),
+    span: 24
   },
   {
     field: "good_remark",
     label: "商品备注",
-    span: 12
+    span: 24
   }
 ];

+ 8 - 7
src/views/mobile/shopStock/config/_details.ts

@@ -6,9 +6,9 @@ import { FormConfig } from "/@/components/PageSearch";
 import { createTooltip } from "/@/utils/tooltip";
 import { GOOD_OPTIONS } from "/@/config/status";
 import {
-  renderStatus,
   renderImage,
-  renderImages
+  renderImages,
+  renderGoodParam
 } from "/@/utils/column-helper";
 // import { payWayOptions, sendWayOptions, supplyAreaOptions } from "./_options";
 
@@ -77,23 +77,24 @@ export const bargainColumns: DescriptionColumns = [
   {
     field: "good_banner_img",
     label: "轮播图",
-    span: 12
-    // render: (_, row) => renderImages("good_banner_img").cellRenderer({ row })
+    span: 12,
+    render: (_, row) => renderImages("good_banner_img").cellRenderer({ row })
   },
   {
     field: "good_img",
     label: "详情图",
-    // render: (_, row) => renderImages("good_img").cellRenderer({ row }),
+    render: (_, row) => renderImages("good_img").cellRenderer({ row }),
     span: 12
   },
   {
     field: "good_param",
     label: "商品参数",
-    span: 12
+    render: (_, row) => renderGoodParam("good_param").cellRenderer({ row }),
+    span: 24
   },
   {
     field: "good_remark",
     label: "商品备注",
-    span: 12
+    span: 24
   }
 ];