소스 검색

Merge branch 'feature/#base_management' into 'master'

Feature/#base management

See merge request motive-power/yxl/yxl-web-admin-frontend!5
梁展鹏 3 년 전
부모
커밋
62388efa03

+ 2 - 2
.env.development

@@ -2,8 +2,8 @@
 ENV = 'development'
 
 # base api
-VUE_APP_BASE_API = 'http://127.0.0.1:18080'
-# VUE_APP_BASE_API = 'https://430jy.uutime.cn/'
+# VUE_APP_BASE_API = 'http://127.0.0.1:18080'
+VUE_APP_BASE_API = 'https://430jy.uutime.cn/'
 VUE_APP_API_TIMEOUT = 30000
 
 

+ 9 - 0
src/components/BaseTable.vue

@@ -47,6 +47,15 @@
                   }}
                 </el-tag>
               </span>
+              <span v-else-if="column.type === 'switch'">
+                <el-switch
+                  :value="scope.row[column.key]"
+                  :active-text="column.switchName[0]"
+                  :inactive-text="column.switchName[1]"
+                  @change="column.api(scope.row)"
+                >
+                </el-switch>
+              </span>
               <span v-else>{{ scope.row[column.key] || '-' }}</span>
             </template>
           </el-table-column>

+ 21 - 11
src/components/MultUpload.vue

@@ -78,6 +78,10 @@ export default {
     api: {
       type: Function,
       default: () => {}
+    },
+    error: {
+      type: String,
+      default: null
     }
   },
   data() {
@@ -129,6 +133,10 @@ export default {
       this.imgList.push(fileList);
     },
     submitUpload() {
+      if (this.error) {
+        this.$error(this.error);
+        return false;
+      }
       if (this.imgList.length == 0) {
         this.$error('未选择图片,请先选择图片');
         return false;
@@ -144,19 +152,21 @@ export default {
         form.append('file', file.raw);
       });
 
-      this.api(form).then(({ success }) => {
-        if (success) {
-          this.mark = false;
-          this.$emit('finish');
-        } else {
+      this.api(form)
+        .then(({ success }) => {
+          if (success) {
+            this.mark = false;
+            this.$emit('finish');
+          } else {
+            this.$error('上传失败,请稍后重试...');
+            this.mark = false;
+          }
+        })
+        .catch(err => {
+          console.error(err);
           this.$error('上传失败,请稍后重试...');
           this.mark = false;
-        }
-      }).catch(err => {
-        console.error(err);
-        this.$error('上传失败,请稍后重试...');
-        this.mark = false;
-      });
+        });
     },
     handlePictureCardPreview(file) {
       this.dialogImageUrl = file.url;

+ 33 - 1
src/components/Upload.vue

@@ -12,6 +12,7 @@
       :on-success="handleAvatarSuccess"
       :on-error="handleError"
       :on-progress="onProgress"
+      :before-upload="handleBeforeUpload"
       :disabled="limit <= value.length"
     >
       <i slot="default" class="el-icon-plus" />
@@ -41,6 +42,19 @@
         </span>
       </div>
     </el-upload>
+    <template v-if="config">
+      图片长宽比为
+      <b style="color: #f56c6c">{{ config[0] }}:{{ config[1] }}</b>
+    </template>
+    <!--         <template v-if="fileSize">
+          大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
+        </template> -->
+
+    <template v-if="limit">
+      最多上传 <b style="color: #f56c6c">{{ limit }}</b
+      >张
+    </template>
+
     <el-dialog :visible.sync="dialogVisible" :modal="false">
       <img width="100%" :src="dialogImageUrl" alt="" />
     </el-dialog>
@@ -61,6 +75,11 @@ export default {
       type: Array,
       default: () => []
     },
+
+    config: {
+      type: Array,
+      default: null
+    },
     limit: {
       type: Number,
       default: 1
@@ -86,7 +105,9 @@ export default {
         token: getToken()
       },
       imgList: this.value,
-      tmp: []
+      tmp: [],
+
+      loading: null
     };
   },
 
@@ -125,6 +146,7 @@ export default {
     handleError() {
       this.mark = false;
       this.$error('上传失败,请稍后重试...');
+      this.loading.close();
     },
     handleAvatarSuccess(res, file, fileList) {
       if (file.response.code !== 200) {
@@ -143,7 +165,9 @@ export default {
           : [];
       this.$nextTick(() => {
         this.$emit('input', result);
+        this.$message.success('上传成功');
         this.mark = false;
+        this.loading.close();
       });
     },
     // handleChange(file, fileList) {
@@ -168,6 +192,14 @@ export default {
     handlePictureCardPreview(file) {
       this.dialogImageUrl = file.url;
       this.dialogVisible = true;
+    },
+    handleBeforeUpload() {
+      this.loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
     }
   }
 };

+ 1 - 0
src/containers/sceneSelect/SceneSelect.vue

@@ -4,6 +4,7 @@
     placeholder="请选择"
     filterable
     clearable
+    v-bind="$attrs"
     @change="onChange"
   >
     <el-option

+ 224 - 105
src/router/index.js

@@ -60,107 +60,110 @@ export const constantRoutes = [
     ]
   },
 
-  {
-    path: '/statistics',
-    component: Layout,
-    redirect: '/statistics/DownloadImage',
-    name: '数据统计',
-    meta: {
-      title: '数据统计',
-      icon: 'el-icon-s-help'
-    },
-    children: [
-      {
-        path: 'DownloadImage',
-        name: '下载照片',
-        component: () => import('@/views/statistics/downloadImage/index'),
-        meta: {
-          title: '下载照片'
-          // icon: 'table'
-        }
-      },
-      {
-        path: 'UploadImage',
-        name: '上传照片',
-        component: () => import('@/views/statistics/uploadImage/index'),
-        meta: {
-          title: '上传照片'
-          // icon: 'tree'
-        }
-      },
-      {
-        path: 'WithdrawalRecord',
-        name: '提现记录',
-        component: () => import('@/views/statistics/withdrawalRecord/index'),
-        meta: {
-          title: '提现记录'
-          // icon: 'tree'
-        }
-      }
-    ]
-  },
+  // {
+  //   path: '/statistics',
+  //   component: Layout,
+  //   redirect: '/statistics/DownloadImage',
+  //   name: '数据统计',
+  //   meta: {
+  //     title: '数据统计',
+  //     icon: 'el-icon-s-help'
+  //   },
+  //   children: [
+  //     {
+  //       path: 'DownloadImage',
+  //       name: '下载照片',
+  //       component: () => import('@/views/statistics/downloadImage/index'),
+  //       meta: {
+  //         title: '下载照片'
+  //         // icon: 'table'
+  //       }
+  //     },
+  //     {
+  //       path: 'UploadImage',
+  //       name: '上传照片',
+  //       component: () => import('@/views/statistics/uploadImage/index'),
+  //       meta: {
+  //         title: '上传照片'
+  //         // icon: 'tree'
+  //       }
+  //     },
+  //     {
+  //       path: 'WithdrawalRecord',
+  //       name: '提现记录',
+  //       component: () => import('@/views/statistics/withdrawalRecord/index'),
+  //       meta: {
+  //         title: '提现记录'
+  //         // icon: 'tree'
+  //       }
+  //     }
+  //   ]
+  // },
 
-  {
-    path: '/photographerManagement',
-    component: Layout,
-    redirect: '/photographerManagement/PhotoVerify',
-    name: '摄影师',
-    meta: {
-      title: '摄影师',
-      icon: 'el-icon-s-help'
-    },
-    children: [
-      {
-        path: 'PhotoVerify',
-        name: '摄影师', // add by 梁展鹏 20210723 因为只有一个菜单,所以暂时把菜单名称写到这里。实际上这里是"照片管理"
-        component: () => import('@/views/photographerManagement/photoVerify/index'),
-        meta: {
-          title: '摄影师'
-          // icon: 'tree'
-        }
-      }
-    ]
-  },
+  // {
+  //   path: '/photographerManagement',
+  //   component: Layout,
+  //   redirect: '/photographerManagement/PhotoVerify',
+  //   name: '摄影师',
+  //   meta: {
+  //     title: '摄影师',
+  //     icon: 'el-icon-s-help'
+  //   },
+  //   children: [
+  //     {
+  //       path: 'PhotoVerify',
+  //       name: '摄影师', // add by 梁展鹏 20210723 因为只有一个菜单,所以暂时把菜单名称写到这里。实际上这里是"照片管理"
+  //       component: () =>
+  //         import('@/views/photographerManagement/photoVerify/index'),
+  //       meta: {
+  //         title: '摄影师'
+  //         // icon: 'tree'
+  //       }
+  //     }
+  //   ]
+  // },
 
-  {
-    path: '/photoManagement',
-    component: Layout,
-    redirect: '/photoManagement/ImageGoodsManagement',
-    name: '图片库管理',
-    meta: {
-      title: '图片库管理',
-      icon: 'el-icon-s-help'
-    },
-    children: [
-      {
-        path: 'EventsList',
-        name: '活动列表',
-        component: () => import('@/views/photoManagement/eventsList/index'),
-        meta: {
-          title: '活动列表'
-          // icon: 'tree'
-        }
-      },
-      {
-        path: 'ImageGoodsManagement',
-        name: '照片商品管理',
-        component: () => import('@/views/photoManagement/imageGoodsManagement/index'),
-        meta: {
-          title: '照片商品管理'
-          // icon: 'table'
-        }
-      },
-      {
-        path: 'PhotoVerifyManagement',
-        name: '上传照片审核',
-        component: () => import('@/views/photoManagement/photoVerifyManagement/index'),
-        meta: {
-          title: '上传照片审核'
-          // icon: 'tree'
-        }
-      }
-    ]
-  },
+  // {
+  //   path: '/photoManagement',
+  //   component: Layout,
+  //   redirect: '/photoManagement/ImageGoodsManagement',
+  //   name: '图片库管理',
+  //   meta: {
+  //     title: '图片库管理',
+  //     icon: 'el-icon-s-help'
+  //   },
+  //   children: [
+  //     {
+  //       path: 'EventsList',
+  //       name: '活动列表',
+  //       component: () => import('@/views/photoManagement/eventsList/index'),
+  //       meta: {
+  //         title: '活动列表'
+  //         // icon: 'tree'
+  //       }
+  //     },
+  //     {
+  //       path: 'ImageGoodsManagement',
+  //       name: '照片商品管理',
+  //       component: () =>
+  //         import('@/views/photoManagement/imageGoodsManagement/index'),
+  //       meta: {
+  //         title: '照片商品管理'
+  //         // icon: 'table'
+  //       }
+  //     },
+  //     {
+  //       path: 'PhotoVerifyManagement',
+  //       name: '上传照片审核',
+  //       component: () =>
+  //         import('@/views/photoManagement/photoVerifyManagement/index'),
+  //       meta: {
+  //         title: '上传照片审核'
+  //         // icon: 'tree'
+  //       }
+  //     }
+  //   ]
+  // },
 
   {
     path: '/certification-management',
@@ -175,7 +178,8 @@ export const constantRoutes = [
       {
         path: 'PhotographerVerify',
         name: '摄影师认证审核',
-        component: () => import('@/views/photographerManagement/photographerVerify/index'),
+        component: () =>
+          import('@/views/photographerManagement/photographerVerify/index'),
         meta: {
           title: '摄影师认证审核'
           // icon: 'table'
@@ -246,7 +250,8 @@ export const constantRoutes = [
       {
         path: 'OrderManagement',
         name: '订单列表',
-        component: () => import('@/views/financialManagement/orderManagement/index'),
+        component: () =>
+          import('@/views/financialManagement/orderManagement/index'),
         meta: {
           title: '订单列表'
           // icon: 'table'
@@ -317,7 +322,8 @@ export const constantRoutes = [
       {
         path: 'BannerManagement',
         name: 'Banner管理',
-        component: () => import('@/views/baseManagement/bannerManagement/index'),
+        component: () =>
+          import('@/views/baseManagement/bannerManagement/index'),
         meta: {
           title: 'Banner管理'
           // icon: 'table'
@@ -335,7 +341,8 @@ export const constantRoutes = [
       {
         path: 'ProblemFeedbackManagement',
         name: '问题管理',
-        component: () => import('@/views/baseManagement/problemFeedbackManagement/index'),
+        component: () =>
+          import('@/views/baseManagement/problemFeedbackManagement/index'),
         meta: {
           title: '问题管理'
           // icon: 'tree'
@@ -357,7 +364,8 @@ export const constantRoutes = [
       {
         path: 'AccountManagement',
         name: '账号列表',
-        component: () => import('@/views/systemManagement/accountManagement/index'),
+        component: () =>
+          import('@/views/systemManagement/accountManagement/index'),
         meta: {
           title: '账号列表'
           // icon: 'table'
@@ -366,7 +374,8 @@ export const constantRoutes = [
       {
         path: 'RoleManagement',
         name: '角色列表',
-        component: () => import('@/views/systemManagement/roleManagement/index'),
+        component: () =>
+          import('@/views/systemManagement/roleManagement/index'),
         meta: {
           title: '角色列表'
           // icon: 'tree'
@@ -414,11 +423,121 @@ export const constantRoutes = [
   }
 ];
 
+// TODO 上方菜单搬运下方,在meta追加roles
 /**
  * asyncRoutes
  * the routes that need to be dynamically loaded based on user roles
  */
 export const asyncRoutes = [
+  {
+    path: '/statistics',
+    component: Layout,
+    redirect: '/statistics/DownloadImage',
+    name: '数据统计',
+    meta: {
+      title: '数据统计',
+      icon: 'el-icon-s-help',
+      roles: ['admin', 'editor'] // you can set roles in root nav
+    },
+    children: [
+      {
+        path: 'DownloadImage',
+        name: '下载照片',
+        component: () => import('@/views/statistics/downloadImage/index'),
+        meta: {
+          title: '下载照片',
+          // icon: 'table'
+          roles: ['admin'] // or you can only set roles in sub nav
+        }
+      },
+      {
+        path: 'UploadImage',
+        name: '上传照片',
+        component: () => import('@/views/statistics/uploadImage/index'),
+        meta: {
+          title: '上传照片',
+          // icon: 'tree'
+          roles: ['admin'] // or you can only set roles in sub nav
+        }
+      },
+      {
+        path: 'WithdrawalRecord',
+        name: '提现记录',
+        component: () => import('@/views/statistics/withdrawalRecord/index'),
+        meta: {
+          title: '提现记录'
+          // icon: 'tree'
+        }
+      }
+    ]
+  },
+
+  {
+    path: '/photographerManagement',
+    component: Layout,
+    redirect: '/photographerManagement/PhotoVerify',
+    name: '摄影师',
+    meta: {
+      title: '摄影师',
+      icon: 'el-icon-s-help',
+      roles: ['admin', 'editor', 'photoer'] // you can set roles in root nav
+    },
+    children: [
+      {
+        path: 'PhotoVerify',
+        name: '摄影师', // add by 梁展鹏 20210723 因为只有一个菜单,所以暂时把菜单名称写到这里。实际上这里是"照片管理"
+        component: () =>
+          import('@/views/photographerManagement/photoVerify/index'),
+        meta: {
+          title: '摄影师'
+          // icon: 'tree'
+        }
+      }
+    ]
+  },
+
+  {
+    path: '/photoManagement',
+    component: Layout,
+    redirect: '/photoManagement/ImageGoodsManagement',
+    name: '图片库管理',
+    meta: {
+      title: '图片库管理',
+      icon: 'el-icon-s-help',
+      roles: ['admin'] // you can set roles in root nav
+    },
+    children: [
+      {
+        path: 'EventsList',
+        name: '活动列表',
+        component: () => import('@/views/photoManagement/eventsList/index'),
+        meta: {
+          title: '活动列表'
+          // icon: 'tree'
+        }
+      },
+      {
+        path: 'ImageGoodsManagement',
+        name: '照片商品管理',
+        component: () =>
+          import('@/views/photoManagement/imageGoodsManagement/index'),
+        meta: {
+          title: '照片商品管理'
+          // icon: 'table'
+        }
+      },
+      {
+        path: 'PhotoVerifyManagement',
+        name: '上传照片审核',
+        component: () =>
+          import('@/views/photoManagement/photoVerifyManagement/index'),
+        meta: {
+          title: '上传照片审核'
+          // icon: 'tree'
+        }
+      }
+    ]
+  }
 ];
 
 const createRouter = () =>

+ 4 - 1
src/store/modules/permission.js

@@ -48,8 +48,11 @@ const mutations = {
 
 const actions = {
   generateRoutes({ commit }, roles) {
+    console.error(roles);
     return new Promise(resolve => {
-      let accessedRoutes = asyncRoutes;
+      // let accessedRoutes = asyncRoutes;
+      let accessedRoutes = filterAsyncRoutes(asyncRoutes, roles);
+
       // commit('SET_ROUTES', []);
       commit('SET_ROUTES', accessedRoutes);
       resolve(accessedRoutes);

+ 1 - 0
src/utils/request.js

@@ -49,6 +49,7 @@ axios.interceptors.response.use(
     const res = response.data;
     if (res.code === 401) {
       setToken();
+      // 045 登录态失效,重定向到登录页 更改地址
       // location.replace(`http://wxhd.lifespaceprobiotics.cn/code/admin/#/login`);
 
       Message({

+ 6 - 1
src/views/baseManagement/bannerManagement/modal/ItemModal.vue

@@ -12,7 +12,12 @@
   >
     <el-form ref="form" :model="form" :rules="rules" label-width="100px">
       <el-form-item label="图片" prop="imgUrl">
-        <upload v-model="form.imgUrl" params="prefix=/banner" />
+        <!-- TODO 043 -->
+        <upload
+          v-model="form.imgUrl"
+          :config="[1, 1]"
+          params="prefix=/banner"
+        />
       </el-form-item>
       <el-form-item label="位置" prop="type">
         <DataSelect

+ 35 - 11
src/views/photoManagement/eventsList/modal/ItemModal.vue

@@ -116,10 +116,23 @@ export default {
         sort: 1
       },
       rules: {
-        name: [{ required: true, message: '请输入活动名称', trigger: 'change' }],
-        cover: [{ type: 'array', required: true, message: '请上传图片', trigger: 'change'  }],
-        brief: [{ required: true, message: '请输入活动介绍', trigger: 'change' }],
-        kindergartenId: [{ required: true, message: '请选择场景', trigger: 'change' }],
+        name: [
+          { required: true, message: '请输入活动名称', trigger: 'change' }
+        ],
+        cover: [
+          {
+            type: 'array',
+            required: true,
+            message: '请上传图片',
+            trigger: 'change'
+          }
+        ],
+        brief: [
+          { required: true, message: '请输入活动介绍', trigger: 'change' }
+        ],
+        kindergartenId: [
+          { required: true, message: '请选择场景', trigger: 'change' }
+        ],
         eventTimeArr: [{ validator: validateTimer, trigger: 'blur' }]
       },
 
@@ -158,25 +171,36 @@ export default {
 
       if (success) {
         let result = data;
-        result.cover = data.cover && [{ url: data.cover }];
-        result.previewLogo = data.previewLogo && [{ url: data.previewLogo }];
-        result.hdLogo = data.hdLogo && [{ url: data.hdLogo }];
+        result.cover = data.cover ? [{ url: data.cover }] : [];
+        result.previewLogo = data.previewLogo
+          ? [{ url: data.previewLogo }]
+          : [];
+        result.hdLogo = data.hdLogo ? [{ url: data.hdLogo }] : [];
         result.eventTimeArr = [result.eventStartDate, result.eventEndDate];
         this.form = result;
       }
     },
 
     handleConfirm() {
-      let _that = this
+      let _that = this;
       _that.$refs.form.validate(async valid => {
         if (!valid) {
           return false;
         }
 
         let params = Object.assign({}, _that.form);
-        params.cover = (_that.form.cover && _that.form.cover.length > 0) && _that.form.cover[0].url;
-        params.previewLogo = (_that.form.previewLogo && _that.form.previewLogo.length > 0) && _that.form.previewLogo[0].url;
-        params.hdLogo = (_that.form.hdLogo && _that.form.hdLogo.length > 0) && _that.form.hdLogo[0].url;
+        params.cover =
+          _that.form.cover &&
+          _that.form.cover.length > 0 &&
+          _that.form.cover[0].url;
+        params.previewLogo =
+          _that.form.previewLogo &&
+          _that.form.previewLogo.length > 0 &&
+          _that.form.previewLogo[0].url;
+        params.hdLogo =
+          _that.form.hdLogo &&
+          _that.form.hdLogo.length > 0 &&
+          _that.form.hdLogo[0].url;
         params.eventStartDate = _that.form.eventTimeArr[0];
         params.eventEndDate = _that.form.eventTimeArr[1];
 

+ 32 - 9
src/views/photoManagement/imageGoodsManagement/index.vue

@@ -15,7 +15,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
-import { getPage, delItem } from '@/api/photoWarehouse';
+import { getPage, delItem, updateItem } from '@/api/photoWarehouse';
 
 export default {
   name: 'ImageGoodsManagement',
@@ -116,10 +116,21 @@ export default {
         {
           key: 'isBeautiful',
           name: '精选',
-          width: this.$col.s,
-          type: 'tag',
-          fetchTagType: val => (val ? 'success' : 'info'),
-          tagName: row => (row.isBeautiful ? '是' : '否')
+          width: this.$col.m,
+          type: 'switch',
+          switchName: ['是', '否'],
+          api: async row => {
+            console.log(row);
+            row.isBeautiful = !row.isBeautiful;
+            const { success } = await updateItem(row);
+            if (success) {
+              this.$success('修改成功!');
+            }
+            this.$g_emit('photo_reload');
+          }
+          // type: 'tag',
+          // fetchTagType: val => (val ? 'success' : 'info'),
+          // tagName: row => (row.isBeautiful ? '是' : '否')
         },
         {
           key: 'isTake',
@@ -132,10 +143,22 @@ export default {
         {
           key: 'isShow',
           name: '状态',
-          width: this.$col.s,
-          type: 'tag',
-          fetchTagType: val => (val ? 'success' : 'info'),
-          tagName: row => (row.isShow ? '上架' : '下架')
+          width: this.$col.b,
+          type: 'switch',
+          switchName: ['上架', '下架'],
+          api: async row => {
+            console.log(row);
+            row.isShow = !row.isShow;
+            const { success } = await updateItem(row);
+            if (success) {
+              this.$success('修改成功!');
+            }
+            this.$g_emit('photo_reload');
+          }
+          // width: this.$col.s,
+          // type: 'tag',
+          // fetchTagType: val => (val ? 'success' : 'info'),
+          // tagName: row => (row.isShow ? '上架' : '下架')
         },
         {
           key: 'action',

+ 3 - 3
src/views/photographerManagement/photoVerify/index.vue

@@ -3,14 +3,14 @@
     <toolbar @on-filter="filterData" @on-reset="filterData" />
 
     <div class="m-10 bg-w p-20 br-10">
-      <el-button type="primary" icon="el-icon-plus" @click="$PhotoUploadModal()"
+      <!-- <el-button type="primary" icon="el-icon-plus" @click="$PhotoUploadModal()"
         >新增</el-button
-      >
+      > -->
       <el-button
         type="primary"
         icon="el-icon-plus"
         @click="$PhotoMultUploadModal()"
-        >批量新增</el-button
+        >批量上传照片</el-button
       >
 
       <base-table

+ 28 - 18
src/views/photographerManagement/photoVerify/modal/MultItemModal.vue

@@ -11,24 +11,24 @@
     "
   >
     <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-      <el-steps class="mrow-40 pb-40" :space="200" :active="step">
+      <!-- <el-steps class="mrow-40 pb-40" :space="200" :active="step">
         <el-step title="关联信息"></el-step>
         <el-step title="批量上传"></el-step>
-      </el-steps>
+      </el-steps> -->
 
-      <div v-if="step === 0">
-        <el-form-item label="关联场景" prop="kindergartenId">
-          <SceneSelect v-model="form.kindergartenId" />
-        </el-form-item>
-        <el-form-item label="关联活动">
-          <ActivitySelect
-            v-model="form.activityId"
-            :kindergartenId="form.kindergartenId"
-            :firstLoad="false"
-            :disabled="form.kindergartenId === null"
-          />
-        </el-form-item>
-        <div class="f-fe-fs" :style="{ width: '50%' }">
+      <!-- <div v-if="step === 0"> -->
+      <el-form-item label="关联场景" prop="kindergartenId">
+        <SceneSelect v-model="form.kindergartenId" :clearable="false" />
+      </el-form-item>
+      <el-form-item label="关联活动">
+        <ActivitySelect
+          v-model="form.activityId"
+          :kindergartenId="form.kindergartenId"
+          :firstLoad="false"
+          :disabled="form.kindergartenId === null"
+        />
+      </el-form-item>
+      <!-- <div class="f-fe-fs" :style="{ width: '50%' }">
           <el-button
             type="primary"
             round
@@ -36,13 +36,14 @@
             @click="step++"
             >下一步</el-button
           >
-        </div>
-      </div>
-      <el-form-item v-show="step === 1" label="图片" prop="urls" required>
+        </div> -->
+      <!-- </div> -->
+      <el-form-item label="图片" prop="urls" required>
         <mult-upload
           v-model="form.urls"
           :api="multUpload"
           :limit="999"
+          :error="errorMsg"
           :paramsData="uploadParams"
           @finish="handleFinish"
         />
@@ -93,6 +94,15 @@ export default {
     uploadParams() {
       const { kindergartenId, activityId } = this.form;
       return { kindergartenId, activityId };
+    },
+
+    errorMsg() {
+      const { kindergartenId } = this.form;
+      if (kindergartenId) {
+        return null;
+      } else {
+        return '请先选择关联场景';
+      }
     }
   },
 

+ 6 - 1
src/views/sceneManagement/sceneList/modal/ItemModal.vue

@@ -33,7 +33,12 @@
         <el-input v-model="form.address" placeholder="请输入详细地址" />
       </el-form-item>
       <el-form-item label="幼儿园logo" prop="logo" required>
-        <upload v-model="form.logo" params="prefix=/kindergarten" />
+        <!-- TODO 043 -->
+        <upload
+          v-model="form.logo"
+          :config="[1, 1]"
+          params="prefix=/kindergarten"
+        />
       </el-form-item>
       <el-form-item label="幼儿园预览图logo" prop="previewLogo" required>
         <upload v-model="form.previewLogo" params="prefix=/kindergarten" />