Explorar o código

修改助力道具提示

silent %!s(int64=4) %!d(string=hai) anos
pai
achega
4cb0b9e254

+ 2 - 1
src/api/sing_desk/platformsetting.js

@@ -48,12 +48,13 @@ export const update = (row) => {
   })
 }
 
-export const getPlatformSetting = (key) => {
+export const getPlatformSetting = (key,activeId) => {
   return request({
     url: '/api/app/platformsetting/getPlatformValue',
     method: 'get',
     params: {
       platformSettingEnum:key,
+      activeId:activeId,
     }
   })
 }

+ 66 - 8
src/views/sing_desk/platformsetting.vue

@@ -2,13 +2,38 @@
   <basic-container>
     <avue-tabs :option="tabOption" @change="(data)=>tabChange(data.prop)">
     </avue-tabs>
-    <avue-form ref="form" v-model="form" :option="option" @submit="updateSetting">
+    <avue-crud v-if="['PAGE_INTERFACE_SHOW','ACTIVE_SETTING'].indexOf(key)!==-1"
+               :option="option"
+               :table-loading="loading"
+               :data="data"
+               :page.sync="page"
+               :permission="permissionList"
+               :before-open="beforeOpen"
+               v-model="form"
+               ref="crud"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @expand-change=""
+               @on-load="onLoad">
+      <template slot="expand" slot-scope="{row}">
+
+      </template>
+    </avue-crud>
+    <avue-form v-if="['POINT_GOODS_SETTING','COMMON_SETTING'].indexOf(key)!==-1"
+               ref="form"
+               v-model="form"
+               :option="option"
+               @submit="updateSetting">
     </avue-form>
   </basic-container>
 </template>
 
 <script>
 import {getPlatformSetting, updatePlatformValue} from "@/api/sing_desk/platformsetting";
+import {getList} from "@/api/sing_active/activerecord";
 
 export default {
   data() {
@@ -16,6 +41,10 @@ export default {
       form: {},
       tabOption: {
         column: [{
+          icon: 'iconfont icon-jifen',
+          label: '公共设置',
+          prop: 'COMMON_SETTING',
+        }, {
           icon: 'el-icon-s-operation',
           label: '页面设置',
           prop: 'PAGE_INTERFACE_SHOW',
@@ -55,7 +84,7 @@ export default {
      */
     updateSetting(row, loading) {
       const data = {};
-      this.option.column.forEach(ele=>{
+      this.option.column.forEach(ele => {
         data[ele.prop] = this.form[ele.prop];
       });
       updatePlatformValue({
@@ -140,7 +169,7 @@ export default {
                   message: "请输入类型",
                   trigger: "blur"
                 }]
-              },{
+              }, {
                 label: '类型',
                 prop: "type",
                 rules: [{
@@ -148,7 +177,7 @@ export default {
                   message: "请输入类型",
                   trigger: "blur"
                 }],
-              },{
+              }, {
                 label: '地址',
                 prop: "path",
                 rules: [{
@@ -160,7 +189,7 @@ export default {
             }
           }
         ]
-      } else if(this.key === "ACTIVE_SETTING"){
+      } else if (this.key === "ACTIVE_SETTING") {
         this.option.column = [
           {
             label: "默认活动",
@@ -254,7 +283,7 @@ export default {
             }
           }
         ]
-      } else if(this.key === "POINT_GOODS_SETTING"){
+      } else if (this.key === "POINT_GOODS_SETTING") {
         this.option.column = [
           {
             label: "主页轮播图",
@@ -281,7 +310,7 @@ export default {
                   message: "请输入类型",
                   trigger: "blur"
                 }]
-              },{
+              }, {
                 label: '类型',
                 prop: "type",
                 rules: [{
@@ -289,7 +318,7 @@ export default {
                   message: "请输入类型",
                   trigger: "blur"
                 }],
-              },{
+              }, {
                 label: '地址',
                 prop: "path",
                 rules: [{
@@ -306,6 +335,35 @@ export default {
       }
       this.form = {};
       this.getSetting(this.key);
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    currentChange(currentPage){
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
     }
   }
 };