zs 1 rok temu
rodzic
commit
d856321e0d

+ 4 - 11
src/views/goods/index.vue

@@ -19,15 +19,8 @@
         <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
           <cForm :span="24" :fields="formFields" :form="form" :rules="rules" @save="onSubmit">
             <template #file>
-              <cUpload
-                :model="`${'file'}`"
-                :limit="6"
-                listType="picture"
-                url="/files/material/goods/upload"
-                accept="*"
-                :list="form.file"
-                @change="onUpload"
-              ></cUpload>
+              <cUpload :model="`${'file'}`" :limit="6" listType="picture" url="/files/material/goods/upload" accept="*"
+                :list="form.file" @change="onUpload"></cUpload>
             </template>
             <template #supplier_id>
               <el-option v-for="i in supplierList" :key="i._id" :label="i.name" :value="i._id"></el-option>
@@ -152,8 +145,8 @@ const getDict = (value: any, model: any) => {
 };
 // 上传图片
 const onUpload = (e: { model: string; value: Array<[]> }) => {
-  const { model, value } = e;
-  form.value[model] = value;
+  const { value } = e;
+  form.value.file = value;
 };
 // 商品规格
 const toSpec = (data: any) => {

+ 4 - 1
src/views/system/config/index.vue

@@ -61,7 +61,10 @@ const search = async () => {
 };
 const onUpload = (e: { model: string; value: Array<[]> }) => {
   const { model, value } = e;
-  form.value[model] = value;
+  if (model == 'logo_url') form.value.logo_url = value;
+  else if (model == 'boy_url') form.value.boy_url = value;
+  else form.value.girl_url = value;
+
 };
 const toSave = async (data: any) => {
   let res: IQueryResult;

+ 2 - 1
src/views/system/role/detail.vue

@@ -138,7 +138,8 @@ const tomenuSave = async (data: any) => {
 // 上传图片
 const onUpload = (e: { model: string; value: Array<[]> }) => {
   const { model, value } = e;
-  menuform.value[model] = value;
+  if (model == 'iconPath') menuform.value.iconPath = value;
+  else menuform.value.selectedIconPath = value;
 };
 // 查询其他信息
 const searchOther = async () => {