Pārlūkot izejas kodu

:memo: 优化上传数量、新增时的逻辑等细节

Twelve615 1 gadu atpakaļ
vecāks
revīzija
78b423f61f

+ 2 - 2
jlsb-vue/src/views/aa/AaCommodityList.vue

@@ -232,8 +232,8 @@
         fieldList.push({type:'BigDecimal',value:'price',text:'价格',dictCode:''})
         fieldList.push({type:'string',value:'typeId',text:'分类'})
         fieldList.push({type:'Text',value:'introduce',text:'介绍',dictCode:''})
-        fieldList.push({type:'string',value:'introducePic',text:'介绍图片',dictCode:''})
-        fieldList.push({type:'string',value:'pics',text:'图片集',dictCode:''})
+        // fieldList.push({type:'string',value:'introducePic',text:'介绍图片',dictCode:''})
+        // fieldList.push({type:'string',value:'pics',text:'图片集',dictCode:''})
         fieldList.push({type:'string',value:'modelNumber',text:'型号',dictCode:''})
         fieldList.push({type:'Text',value:'copyWriter',text:'文案',dictCode:''})
         fieldList.push({type:'datetime',value:'createTime',text:'创建时间'})

+ 4 - 4
jlsb-vue/src/views/aa/AaNewsFlList.vue

@@ -27,12 +27,12 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增一级</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('新闻分类')">导出</a-button>
+<!--      <a-button type="primary" icon="download" @click="handleExportXls('新闻分类')">导出</a-button>-->
 <!--      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
 <!--        <a-button type="primary" icon="import">导入</a-button>-->
 <!--      </a-upload>-->
       <!-- 高级查询区域 -->
-      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+<!--      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
@@ -130,12 +130,12 @@
             align:"left",
             dataIndex: 'name'
           },
-          {
+/*           {
             title:'分类图片',
             align:"left",
             dataIndex: 'pic',
             scopedSlots: {customRender: 'imgSlot'}
-          },
+          }, */
           {
             title:'分类名称英语',
             align:"left",

+ 2 - 2
jlsb-vue/src/views/aa/modules/AaCommodityForm.vue

@@ -25,7 +25,7 @@
           </a-col>-->
           <a-col :span="24">
             <a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pic">
-              <j-image-upload isMultiple  v-model="model.pic" ></j-image-upload>
+              <j-image-upload :number="1" isMultiple  v-model="model.pic" ></j-image-upload>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
@@ -67,7 +67,7 @@
           </a-col>-->
           <a-col :span="24">
             <a-form-model-item label="介绍图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="introducePic">
-              <j-image-upload isMultiple  v-model="model.introducePic" ></j-image-upload>
+              <j-image-upload :number="1" isMultiple  v-model="model.introducePic" ></j-image-upload>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">

+ 11 - 7
jlsb-vue/src/views/aa/modules/AaCommonProblemForm.vue

@@ -110,13 +110,17 @@
         this.edit(this.modelDefault);
       },
       edit (record) {
-        getAction(this.url.queryById,{id:record.id}).then(res=>{
-          if (res.success) {
-            this.model = res.result;
-          } else {
-            this.model = Object.assign({}, record);
-          }
-        })
+        if (record.id) {
+          getAction(this.url.queryById,{id:record.id}).then(res=>{
+            if (res.success) {
+              this.model = res.result;
+            } else {
+              this.model = Object.assign({}, record);
+            }
+          })
+        } else {
+          this.model = Object.assign({}, record);
+        }
         this.visible = true;
       },
       submitForm () {

+ 2 - 2
jlsb-vue/src/views/aa/modules/AaNewsFlModal.vue

@@ -10,9 +10,9 @@
     cancelText="关闭">
     <a-spin :spinning="confirmLoading">
       <a-form-model ref="form" :model="model" :rules="validatorRules">
-        <a-form-model-item label="分类图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pic">
+<!--        <a-form-model-item label="分类图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pic">
           <j-image-upload isMultiple  v-model="model.pic" ></j-image-upload>
-        </a-form-model-item>
+        </a-form-model-item>-->
         <a-form-model-item label="分类名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
           <a-input v-model="model.name" placeholder="请输入分类名称" ></a-input>
         </a-form-model-item>

+ 12 - 8
jlsb-vue/src/views/aa/modules/AaNewsForm.vue

@@ -5,7 +5,7 @@
         <a-row>
           <a-col :span="24">
             <a-form-model-item label="新闻缩略图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pic">
-              <j-image-upload isMultiple  v-model="model.pic" ></j-image-upload>
+              <j-image-upload isMultiple :number="1"  v-model="model.pic" ></j-image-upload>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
@@ -138,13 +138,17 @@
         this.edit(this.modelDefault);
       },
       edit (record) {
-        getAction(this.url.queryById,{id:record.id}).then(res=>{
-          if (res.success) {
-            this.model = res.result;
-          } else {
-            this.model = Object.assign({}, record);
-          }
-        })
+        if (record.id) {
+          getAction(this.url.queryById,{id:record.id}).then(res=>{
+            if (res.success) {
+              this.model = res.result;
+            } else {
+              this.model = Object.assign({}, record);
+            }
+          })
+        } else {
+          this.model = Object.assign({}, record);
+        }
         this.visible = true;
       },
       submitForm () {