Browse Source

fix(bugs): 修改问题

tangning 3 years ago
parent
commit
23e7727dc6

+ 2 - 4
src/api/scene/live.ts

@@ -125,7 +125,7 @@ export const getLiveInfoApi = (params: InfoParams) => {
     },
   });
 };
-export const brandUpdateApi = (params: SceneLiveItem) => {
+export const brandUpdateApi = (params: SceneLiveItem) =>
   defHttp.post<GetAllSceneModel>({
     url: Api.brandUpdate,
     params,
@@ -134,7 +134,6 @@ export const brandUpdateApi = (params: SceneLiveItem) => {
       ignoreCancelToken: true,
     },
   });
-};
 export const LiveSceneAddApi = (params: SceneLiveItem) =>
   defHttp.post<GetAllSceneModel>({
     url: Api.brandDelete,
@@ -145,7 +144,7 @@ export const LiveSceneAddApi = (params: SceneLiveItem) =>
     },
   });
 
-export const LiveSceneDeleteApi = (params: string[]) => {
+export const LiveSceneDeleteApi = (params: string[]) =>
   defHttp.post<GetAllSceneModel>({
     url: Api.brandDelete,
     params,
@@ -154,7 +153,6 @@ export const LiveSceneDeleteApi = (params: string[]) => {
       ignoreCancelToken: true,
     },
   });
-};
 
 export const addSave = (params: SceneLiveItem) =>
   defHttp.post<RentListGetResultModel>({

+ 1 - 38
src/views/advertisement/pads.vue

@@ -71,7 +71,7 @@
           width: 230,
         },
         {
-          title: '链接',
+          title: '直播间链接',
           dataIndex: 'sceneUrl',
           width: 300,
         },
@@ -98,43 +98,6 @@
           width: 150,
         },
       ];
-      // const searchForm: Partial<FormProps> = {
-      //   labelWidth: 100,
-      //   schemas: [
-      //     {
-      //       field: 'type',
-      //       label: '推荐类型',
-      //       component: 'Select',
-      //       defaultValue: 0,
-      //       colProps: {
-      //         xl: 5,
-      //         xxl: 5,
-      //       },
-      //       componentProps: {
-      //         onChange: function () {
-      //           reload();
-      //         },
-      //         options: [
-      //           {
-      //             label: '新上房源',
-      //             value: 0,
-      //             key: '0',
-      //           },
-      //           {
-      //             label: '热门房源',
-      //             value: 1,
-      //             key: '1',
-      //           },
-      //           {
-      //             label: '热门企业',
-      //             value: 2,
-      //             key: '2',
-      //           },
-      //         ],
-      //       },
-      //     },
-      //   ],
-      // };reload
 
       const [registerTable, { getForm, reload }] = useTable({
         title: '推荐位',

+ 30 - 31
src/views/advertisement/schemas.ts

@@ -7,24 +7,31 @@ import { BrandListApi } from '/@/api/order/list';
 
 export const padsSchemas: FormSchema[] = [
   {
-    field: 'title',
-    component: 'Input',
-    label: '正文标题',
+    field: 'image',
+    component: 'Upload',
+    label: '封面',
+    rules: [{ required: true, message: '请选择上传文件' }],
+    itemProps: {
+      validateTrigger: 'blur',
+    },
     componentProps: {
-      placeholder: '轮播图正文标题',
+      api: uploadApi,
+      maxNumber: 1,
+      accept: ['jpg', 'jpeg', 'gif', 'png'],
+      afterFetch: function (data) {
+        console.log('data', data);
+        Reflect.set(data, 'url', data.message);
+        return data;
+      },
     },
     required: true,
   },
-
   {
-    field: 'orderNum',
+    field: 'title',
     component: 'Input',
-    label: '轮播排序',
-    defaultValue: 0,
+    label: '标题',
     componentProps: {
-      placeholder: '轮播排序',
-      type: 'number',
-      min: 0,
+      placeholder: '标题',
     },
     required: true,
   },
@@ -49,6 +56,18 @@ export const padsSchemas: FormSchema[] = [
       },
     },
   },
+  {
+    field: 'orderNum',
+    component: 'Input',
+    label: '排序',
+    defaultValue: 0,
+    componentProps: {
+      placeholder: '推荐排序',
+      type: 'number',
+      min: 0,
+    },
+    required: true,
+  },
   // {
   //   field: 'connectId',
   //   component: 'Input',
@@ -58,26 +77,6 @@ export const padsSchemas: FormSchema[] = [
   //   },
   //   // required: true,
   // },
-  {
-    field: 'image',
-    component: 'Upload',
-    label: '封面图',
-    rules: [{ required: true, message: '请选择上传文件' }],
-    itemProps: {
-      validateTrigger: 'blur',
-    },
-    componentProps: {
-      api: uploadApi,
-      maxNumber: 1,
-      accept: ['jpg', 'jpeg', 'gif', 'png'],
-      afterFetch: function (data) {
-        console.log('data', data);
-        Reflect.set(data, 'url', data.message);
-        return data;
-      },
-    },
-    required: true,
-  },
 ];
 export const schemas: FormSchema[] = [
   {

+ 4 - 6
src/views/scenes/live.vue

@@ -288,12 +288,10 @@
         });
       }
       async function handleDeleteLiveScene(record: Recordable) {
-        try {
-          const id = [record.id];
-          await LiveSceneDeleteApi(id);
-          createMessage.success(t('common.optSuccess'));
-          reload();
-        } catch (error) {}
+        const id = [record.id];
+        await LiveSceneDeleteApi(id);
+        createMessage.success(t('common.optSuccess'));
+        reload();
       }
       return {
         registerTable,