Bläddra i källkod

:recycle: 重构代码。searchForm 传递及其租户字段-修改

冷冷 6 år sedan
förälder
incheckning
0c0205da5e

+ 4 - 4
src/api/login.js

@@ -24,7 +24,7 @@ export const loginByUsername = (username, password, code, randomStr) => {
     url: '/auth/oauth/token',
     headers: {
       isToken: false,
-      'TENANT_ID': '1',
+      'TENANT-ID': '1',
       'Authorization': 'Basic cGlnOnBpZw=='
     },
     method: 'post',
@@ -38,7 +38,7 @@ export const refreshToken = (refresh_token) => {
     url: '/auth/oauth/token',
     headers: {
       'isToken': false,
-      'TENANT_ID': '1',
+      'TENANT-ID': '1',
       'Authorization': 'Basic cGlnOnBpZw=='
     },
     method: 'post',
@@ -51,7 +51,7 @@ export const loginByMobile = (mobile, code) => {
   return request({
     url: '/auth/mobile/token/sms',
     headers: {
-      'TENANT_ID': '1',
+      'TENANT-ID': '1',
       'Authorization': 'Basic cGlnOnBpZw=='
     },
     method: 'post',
@@ -64,7 +64,7 @@ export const loginBySocial = (state, code) => {
   return request({
     url: '/auth/mobile/token/social',
     headers: {
-      'TENANT_ID': '1',
+      'TENANT-ID': '1',
       'Authorization': 'Basic cGlnOnBpZw=='
     },
     method: 'post',

+ 2 - 18
src/const/crud/pay/paytradeorder.js

@@ -40,14 +40,14 @@ export const tableOption = {
       width: 120
     },
     {
-      label: '渠道订单',
+      label: '渠道订单',
       prop: 'channelOrderNo',
       width: 150,
     },
     {
       label: '商品描述',
       prop: 'body',
-      overHidden:true
+      overHidden: true
     },
     {
       label: '金额',
@@ -69,22 +69,6 @@ export const tableOption = {
       prop: 'clientIp',
       width: 120,
     },
-    {
-      label: '商品标题',
-      prop: 'subject'
-    },
-    {
-      label: '错误码',
-      prop: 'errCode'
-    },
-    {
-      label: '错误描述',
-      prop: 'errMsg'
-    },
-    {
-      label: '失效时间',
-      prop: 'expireTime'
-    },
     {
       label: '成功时间',
       prop: 'paySuccTime',

+ 99 - 99
src/page/login/index.vue

@@ -48,117 +48,117 @@
   </div>
 </template>
 <script>
-  import request from '@/router/axios'
-  import userLogin from './userlogin'
-  import codeLogin from './codelogin'
-  import thirdLogin from './thirdlogin'
-  import {mapGetters} from 'vuex'
-  import {getStore, setStore} from '@/util/store'
-  import {dateFormat} from '@/util/date'
-  import topColor from '@/page/index/top/top-color'
+import request from '@/router/axios'
+import userLogin from './userlogin'
+import codeLogin from './codelogin'
+import thirdLogin from './thirdlogin'
+import { mapGetters } from 'vuex'
+import { getStore, setStore } from '@/util/store'
+import { dateFormat } from '@/util/date'
+import topColor from '@/page/index/top/top-color'
 
-  export default {
-    name: 'Login',
-    components: {
-      userLogin,
-      codeLogin,
-      thirdLogin,
-      topColor
-    },
-    data() {
-      return {
-        tenantList: [],
-        time: '',
-        active: '',
-        activeName: 'user',
-        socialForm: {}
-      }
-    },
-    watch: {
-      $route: {
-        handler() {
-          const params = this.$route.query
-          if (this.validatenull(params.state) && this.validatenull(params.code)) return
+export default {
+  name: 'Login',
+  components: {
+    userLogin,
+    codeLogin,
+    thirdLogin,
+    topColor
+  },
+  data() {
+    return {
+      tenantList: [],
+      time: '',
+      active: '',
+      activeName: 'user',
+      socialForm: {}
+    }
+  },
+  watch: {
+    $route: {
+      handler() {
+        const params = this.$route.query
+        if (this.validatenull(params.state) && this.validatenull(params.code)) return
 
-          this.socialForm.state = params.state
-          this.socialForm.code = params.code
+        this.socialForm.state = params.state
+        this.socialForm.code = params.code
 
-          const loading = this.$loading({
-            lock: true,
-            text: `登录中,请稍后。。。`,
-            spinner: 'el-icon-loading'
-          })
-          this.$store.dispatch('LoginBySocial', this.socialForm).then(
-            () => {
-              loading.close()
-              this.$router.push({path: this.tagWel.value})
-            }).catch(() => {
+        const loading = this.$loading({
+          lock: true,
+          text: `登录中,请稍后。。。`,
+          spinner: 'el-icon-loading'
+        })
+        this.$store.dispatch('LoginBySocial', this.socialForm).then(
+          () => {
             loading.close()
-          })
-        },
-        immediate: true
-      }
-    },
-    created() {
-      this.watermark()
-      this.getTenantList()
-      this.active = getStore({name: 'tenantId'})
+            this.$router.push({ path: this.tagWel.value })
+          }).catch(() => {
+          loading.close()
+        })
+      },
+      immediate: true
+    }
+  },
+  created() {
+    this.watermark()
+    this.getTenantList()
+    this.active = getStore({ name: 'tenantId' })
+    this.getTime()
+    setInterval(() => {
       this.getTime()
-      setInterval(() => {
-        this.getTime()
-      }, 1000)
+    }, 1000)
+  },
+  mounted() {
+  },
+  computed: {
+    ...mapGetters(['website', 'tagWel'])
+  },
+  methods: {
+    handleCommand(command) {
+      setStore({ name: 'tenantId', content: command })
     },
-    mounted() {
+    getTime() {
+      this.time = dateFormat(new Date())
     },
-    computed: {
-      ...mapGetters(['website', 'tagWel'])
+    getTenantList() {
+      request({
+        url: '/admin/tenant/list',
+        method: 'get'
+      }).then(response => {
+        this.tenantList = response.data.data
+      })
     },
-    methods: {
-      handleCommand(command) {
-        setStore({name: 'tenantId', content: command})
-      },
-      getTime() {
-        this.time = dateFormat(new Date())
-      },
-      getTenantList() {
-        request({
-          url: '/admin/tenant/list',
-          method: 'get'
-        }).then(response => {
-          this.tenantList = response.data.data
-        })
-      },
-      watermark() {
-        const text = ''
-        const canvas = document.createElement('canvas')
-        canvas.width = '500'
-        canvas.height = '200'
-        const ctx = canvas.getContext('2d')
-        ctx.clearRect(0, 0, 200, 200) // 绘制之前画布清除
-        ctx.font = '30px 黑体'
-        ctx.rotate(-20 * Math.PI / 180) // 为了实现水印倾斜效果,旋转画布坐标系
-        ctx.fillStyle = 'rgba(100,100,100,0.15)' // 画笔颜色
-        ctx.fillText(text, -20, 200) // 书写的内容及位置
-        ctx.rotate('20*Math.PI/180') // 坐标系还原,如果后续没有其他操作,这一步可以省略
-        // 将canvas的内容转换为base64编码
-        const data = canvas.toDataURL('image/png', 1) // 1表示质量(无损压缩)
+    watermark() {
+      const text = ''
+      const canvas = document.createElement('canvas')
+      canvas.width = '500'
+      canvas.height = '200'
+      const ctx = canvas.getContext('2d')
+      ctx.clearRect(0, 0, 200, 200) // 绘制之前画布清除
+      ctx.font = '30px 黑体'
+      ctx.rotate(-20 * Math.PI / 180) // 为了实现水印倾斜效果,旋转画布坐标系
+      ctx.fillStyle = 'rgba(100,100,100,0.15)' // 画笔颜色
+      ctx.fillText(text, -20, 200) // 书写的内容及位置
+      ctx.rotate('20*Math.PI/180') // 坐标系还原,如果后续没有其他操作,这一步可以省略
+      // 将canvas的内容转换为base64编码
+      const data = canvas.toDataURL('image/png', 1) // 1表示质量(无损压缩)
 
-        window.onload = () => {
-          const background = 'url(' + data + ') repeat'
-          var watermark = document.createElement('div')
-          watermark.style.width = '100%'
-          watermark.style.height = '100%'
-          watermark.style.position = 'fixed'
-          watermark.style.left = '0'
-          watermark.style.top = '0'
-          watermark.style.pointerEvents = 'none'
-          watermark.style.background = background
-          watermark.style.zIndex = '9999'
-          document.body.append(watermark)
-        }
+      window.onload = () => {
+        const background = 'url(' + data + ') repeat'
+        var watermark = document.createElement('div')
+        watermark.style.width = '100%'
+        watermark.style.height = '100%'
+        watermark.style.position = 'fixed'
+        watermark.style.left = '0'
+        watermark.style.top = '0'
+        watermark.style.pointerEvents = 'none'
+        watermark.style.background = background
+        watermark.style.zIndex = '9999'
+        document.body.append(watermark)
       }
     }
   }
+}
 </script>
 
 <style lang="scss">

+ 1 - 1
src/router/axios.js

@@ -30,7 +30,7 @@ axios.interceptors.request.use(config => {
   if (TENANT_ID) {
     config.headers['TENANT-ID'] = TENANT_ID // 租户ID
   }
-  config.headers['VERSION'] = 'V1.2' // 租户ID
+
   // headers中配置serialize为true开启序列化
   if (config.method === 'post' && config.headers.serialize) {
     config.data = serialize(config.data)

+ 3 - 1
src/views/activiti/index.vue

@@ -63,6 +63,7 @@ export default {
   name: 'Activiti',
   data() {
     return {
+      searchForm: {},
       tableData: [],
       page: {
         total: 0, // 总页数
@@ -87,7 +88,7 @@ export default {
         descs: 'create_time',
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -164,6 +165,7 @@ export default {
        * 搜索回调
        */
     searchChange(form) {
+      this.searchForm = form
       this.getList(this.page, form)
     },
     /**

+ 3 - 2
src/views/activiti/leave.vue

@@ -71,6 +71,7 @@ export default {
   name: 'LeaveBill',
   data() {
     return {
+      searchForm: {},
       tableData: [],
       page: {
         total: 0, // 总页数
@@ -95,7 +96,7 @@ export default {
         descs: 'create_time',
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -191,7 +192,7 @@ export default {
        * 搜索回调
        */
     searchChange(form) {
-      this.page.state = form.state
+      this.searchForm = form
       this.getList(this.page, form)
     },
     /**

+ 4 - 1
src/views/activiti/process.vue

@@ -74,6 +74,7 @@ export default {
   name: 'Process',
   data() {
     return {
+      searchForm: {},
       showPicDialog: false,
       actPicUrl: '',
       tableData: [],
@@ -103,7 +104,8 @@ export default {
             current: page.currentPage,
             size: page.pageSize
           },
-          params
+          params,
+          this.searchForm
         )
       ).then(response => {
         this.tableData = response.data.data.records
@@ -172,6 +174,7 @@ export default {
        * 搜索回调
        */
     searchChange(form) {
+      this.searchForm = form
       this.getList(this.page, form)
     },
     /**

+ 0 - 16
src/views/admin/client/index.vue

@@ -103,13 +103,6 @@ export default {
       }).catch(function() {
       })
     },
-    /**
-       * @title 数据更新
-       * @param row 为当前的数据
-       * @param index 为当前更新数据的行数
-       * @param done 为表单关闭函数
-       *
-       **/
     handleUpdate: function(row, index, done) {
       putObj(row).then(() => {
         this.tableData.splice(index, 1, Object.assign({}, row))
@@ -122,12 +115,6 @@ export default {
         done()
       })
     },
-    /**
-       * @title 数据添加
-       * @param row 为当前的数据
-       * @param done 为表单关闭函数
-       *
-       **/
     handleSave: function(row, done) {
       addObj(row).then(() => {
         this.tableData.push(Object.assign({}, row))
@@ -140,9 +127,6 @@ export default {
         done()
       })
     },
-    /**
-       * 刷新回调
-       */
     refreshChange() {
       this.getList(this.page)
     }

+ 3 - 18
src/views/admin/dict/index.vue

@@ -73,6 +73,7 @@ export default {
   name: 'Dict',
   data() {
     return {
+      searchForm: {},
       form: {
         type: undefined,
         dictId: undefined
@@ -112,7 +113,7 @@ export default {
       fetchList(Object.assign({
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -155,13 +156,6 @@ export default {
       }).catch(function() {
       })
     },
-    /**
-       * @title 数据更新
-       * @param row 为当前的数据
-       * @param index 为当前更新数据的行数
-       * @param done 为表单关闭函数
-       *
-       **/
     handleUpdate: function(row, index, done) {
       putObj(row).then(() => {
         this.$message({
@@ -173,12 +167,6 @@ export default {
         done()
       })
     },
-    /**
-       * @title 数据添加
-       * @param row 为当前的数据
-       * @param done 为表单关闭函数
-       *
-       **/
     handleSave: function(row, done) {
       addObj(row).then(() => {
         this.$message({
@@ -213,12 +201,9 @@ export default {
       })
     },
     searchChange(form) {
+      this.searchForm = form
       this.getList(this.page, form)
     },
-    /**
-       * 加载 字典项
-       * @param row
-       */
     handleItem: function(row) {
       this.getDictItemList(row.id, row.type)
     },

+ 85 - 82
src/views/admin/file/index.vue

@@ -17,16 +17,17 @@
 <template>
   <div class="execution">
     <basic-container>
-      <avue-crud ref="crud"
-                 :page="page"
-                 :data="tableData"
-                 :permission="permissionList"
-                 :table-loading="tableLoading"
-                 :option="tableOption"
-                 @on-load="getList"
-                 @search-change="searchChange"
-                 @refresh-change="refreshChange"
-                 @row-del="rowDel">
+      <avue-crud
+        ref="crud"
+        :page="page"
+        :data="tableData"
+        :permission="permissionList"
+        :table-loading="tableLoading"
+        :option="tableOption"
+        @on-load="getList"
+        @search-change="searchChange"
+        @refresh-change="refreshChange"
+        @row-del="rowDel">
         <template
           slot="menu"
           slot-scope="scope">
@@ -44,90 +45,92 @@
 </template>
 
 <script>
-  import {delObj, fetchList} from '@/api/admin/sys-file'
-  import {tableOption} from '@/const/crud/admin/sys-file'
-  import {mapGetters} from 'vuex'
-  import {handleDown} from '@/util/util'
+import { delObj, fetchList } from '@/api/admin/sys-file'
+import { tableOption } from '@/const/crud/admin/sys-file'
+import { mapGetters } from 'vuex'
+import { handleDown } from '@/util/util'
 
 
-  export default {
-    name: 'sys-file',
-    data() {
+export default {
+  name: 'sys-file',
+  data() {
+    return {
+      searchForm: {},
+      tableData: [],
+      page: {
+        total: 0, // 总页数
+        currentPage: 1, // 当前页数
+        pageSize: 20 // 每页显示多少条
+      },
+      tableLoading: false,
+      tableOption: tableOption
+    }
+  },
+  created() {
+  },
+  mounted: function() {
+  },
+  computed: {
+    ...mapGetters(['permissions']),
+    permissionList() {
       return {
-        tableData: [],
-        page: {
-          total: 0, // 总页数
-          currentPage: 1, // 当前页数
-          pageSize: 20 // 每页显示多少条
-        },
-        tableLoading: false,
-        tableOption: tableOption
-      }
-    },
-    created() {
-    },
-    mounted: function () {
-    },
-    computed: {
-      ...mapGetters(['permissions']),
-      permissionList() {
-        return {
-          addBtn: this.vaildData(this.permissions.sys_file_add, false),
-          delBtn: this.vaildData(this.permissions.sys_file_del, true),
-          editBtn: this.vaildData(this.permissions.sys_file_edit, false)
-        }
+        addBtn: this.vaildData(this.permissions.sys_file_add, false),
+        delBtn: this.vaildData(this.permissions.sys_file_del, true),
+        editBtn: this.vaildData(this.permissions.sys_file_edit, false)
       }
+    }
+  },
+  methods: {
+    getList(page, params) {
+      this.tableLoading = true
+      fetchList(Object.assign({
+        descs: 'create_time',
+        current: page.currentPage,
+        size: page.pageSize
+      }, params, this.searchForm)).then(response => {
+        this.tableData = response.data.data.records
+        this.page.total = response.data.data.total
+        this.tableLoading = false
+      }).catch(() => {
+        this.tableLoading = false
+      })
     },
-    methods: {
-      getList(page, params) {
-        this.tableLoading = true
-        fetchList(Object.assign({
-          descs: 'create_time',
-          current: page.currentPage,
-          size: page.pageSize
-        }, params)).then(response => {
-          this.tableData = response.data.data.records
-          this.page.total = response.data.data.total
-          this.tableLoading = false
-        }).catch(() => {
-          this.tableLoading = false
-        })
-      },
-      rowDel: function (row, index) {
-        var _this = this
-        this.$confirm('是否确认删除ID为' + row.id, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(function () {
-          return delObj(row.id)
-        }).then(data => {
-          _this.tableData.splice(index, 1)
-          _this.$message({
-            showClose: true,
-            message: '删除成功',
-            type: 'success'
-          })
-          this.getList(this.page)
+    rowDel: function(row, index) {
+      var _this = this
+      this.$confirm('是否确认删除ID为' + row.id, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return delObj(row.id)
+      }).then(data => {
+        _this.tableData.splice(index, 1)
+        _this.$message({
+          showClose: true,
+          message: '删除成功',
+          type: 'success'
         })
-      },
-      /**
+        this.getList(this.page)
+      })
+    },
+    /**
        * 搜索回调
        */
-      searchChange(form) {
-        this.getList(this.page, form)
-      },
-      /**
+    searchChange(form) {
+      this.getList(this.page, form)
+    },
+    /**
        * 刷新回调
        */
-      refreshChange() {
-        this.getList(this.page)
-      },
-      download: function (row, index) {
-        handleDown(row.name,row.bucketName)
-      }
+    refreshChange() {
+      this.searchForm = form
+      this.getList(this.page)
+    },
+    download: function(row, index) {
+      handleDown(row.name, row.bucketName)
     }
   }
+}
 </script>
 
 <style lang="scss" scoped>

+ 3 - 7
src/views/admin/log/index.vue

@@ -43,6 +43,7 @@ export default {
   data() {
     return {
       tableData: [],
+      searchForm: {},
       page: {
         total: 0, // 总页数
         currentPage: 1, // 当前页数
@@ -71,7 +72,7 @@ export default {
         descs: 'create_time',
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -95,15 +96,10 @@ export default {
       }).catch(function() {
       })
     },
-    /**
-       * 搜索回调
-       */
     searchChange(form) {
+      this.searchForm = form
       this.getList(this.page, form)
     },
-    /**
-       * 刷新回调
-       */
     refreshChange() {
       this.getList(this.page)
     }

+ 201 - 201
src/views/admin/menu/index.vue

@@ -76,8 +76,8 @@
                   placeholder="请输入父级节点"/>
               </el-form-item>
               <el-form-item
-                label="节点ID"
                 v-if="form.menuId"
+                label="节点ID"
                 prop="menuId">
                 <el-input
                   v-model="form.menuId"
@@ -96,8 +96,8 @@
               <el-form-item
                 label="类型"
                 prop="type">
-                <el-radio v-model="form.type" label="0" :disabled="formEdit">菜单</el-radio>
-                <el-radio v-model="form.type" label="1" :disabled="formEdit">按钮</el-radio>
+                <el-radio v-model="form.type" :disabled="formEdit" label="0">菜单</el-radio>
+                <el-radio v-model="form.type" :disabled="formEdit" label="1">按钮</el-radio>
               </el-form-item>
 
               <el-form-item
@@ -173,226 +173,226 @@
 </template>
 
 <script>
-  import {addObj, delObj, fetchMenuTree, getObj, putObj} from '@/api/admin/menu'
-  import {mapGetters} from 'vuex'
-  import iconList from '@/const/iconList'
+import { addObj, delObj, fetchMenuTree, getObj, putObj } from '@/api/admin/menu'
+import { mapGetters } from 'vuex'
+import iconList from '@/const/iconList'
 
-  export default {
-    name: 'Menu',
-    filters: {
-      typeFilter(type) {
-        const typeMap = {
-          0: '菜单',
-          1: '按钮'
-        }
-        return typeMap[type]
+export default {
+  name: 'Menu',
+  filters: {
+    typeFilter(type) {
+      const typeMap = {
+        0: '菜单',
+        1: '按钮'
       }
-    },
-    data() {
-      return {
-        iconList: iconList,
-        list: null,
-        total: null,
-        formEdit: true,
-        formAdd: true,
-        formStatus: '',
-        showElement: false,
-        typeOptions: ['0', '1'],
-        listQuery: {
-          name: undefined
-        },
-        treeData: [],
-        oExpandedKey: {
-          // key (from tree id) : expandedOrNot boolean
-        },
-        oTreeNodeChildren: {
-          // id1 : [children] (from tree node id1)
-          // id2 : [children] (from tree node id2)
-        },
-        aExpandedKeys: [],
-        defaultProps: {
-          children: 'children',
-          label: 'name'
-        },
-        labelPosition: 'right',
-        form: {
-          permission: undefined,
-          name: undefined,
-          menuId: undefined,
-          parentId: undefined,
-          icon: undefined,
-          sort: undefined,
-          component: undefined,
-          type: undefined,
-          path: undefined
-        },
-        currentId: -1,
-        menuManager_btn_add: false,
-        menuManager_btn_edit: false,
-        menuManager_btn_del: false,
-        rules: {
-          menuId: [{required: true, message: '节点ID不合法', trigger: 'blur'}],
-          name: [{required: true, message: '标题不合法', trigger: 'blur'}],
-          type: [{required: true, message: '类型不合法', trigger: 'blur'}],
-          path: [{validator: this.checkPath, trigger: 'blur'}]
-        }
-      }
-    },
-
-    computed: {
-      ...mapGetters(['elements', 'permissions'])
-    },
-    created() {
-      this.getList()
-      this.menuManager_btn_add = this.permissions['sys_menu_add']
-      this.menuManager_btn_edit = this.permissions['sys_menu_edit']
-      this.menuManager_btn_del = this.permissions['sys_menu_del']
-    },
-    methods: {
-      getList() {
-        fetchMenuTree(this.listQuery).then(response => {
-          this.treeData = response.data.data
-        })
+      return typeMap[type]
+    }
+  },
+  data() {
+    return {
+      iconList: iconList,
+      list: null,
+      total: null,
+      formEdit: true,
+      formAdd: true,
+      formStatus: '',
+      showElement: false,
+      typeOptions: ['0', '1'],
+      listQuery: {
+        name: undefined
       },
-      filterNode(value, data) {
-        if (!value) return true
-        return data.label.indexOf(value) !== -1
+      treeData: [],
+      oExpandedKey: {
+        // key (from tree id) : expandedOrNot boolean
       },
-
-      nodeExpand(data) {
-        const aChildren = data.children
-        if (aChildren.length > 0) {
-          this.oExpandedKey[data.id] = true
-          this.oTreeNodeChildren[data.id] = aChildren
-        }
-        this.setExpandedKeys()
+      oTreeNodeChildren: {
+        // id1 : [children] (from tree node id1)
+        // id2 : [children] (from tree node id2)
       },
-      nodeCollapse(data) {
-        this.oExpandedKey[data.id] = false
-        // 如果有子节点
-        this.treeRecursion(this.oTreeNodeChildren[data.id], oNode => {
-          this.oExpandedKey[oNode.id] = false
-        })
-        this.setExpandedKeys()
+      aExpandedKeys: [],
+      defaultProps: {
+        children: 'children',
+        label: 'name'
       },
-      setExpandedKeys() {
-        const oTemp = this.oExpandedKey
-        this.aExpandedKeys = []
-        for (const sKey in oTemp) {
-          if (oTemp[sKey]) {
-            this.aExpandedKeys.push(parseInt(sKey))
-          }
-        }
-      },
-      treeRecursion(aChildren, fnCallback) {
-        if (aChildren) {
-          for (let i = 0; i < aChildren.length; ++i) {
-            const oNode = aChildren[i]
-            fnCallback && fnCallback(oNode)
-            this.treeRecursion(oNode.children, fnCallback)
-          }
-        }
+      labelPosition: 'right',
+      form: {
+        permission: undefined,
+        name: undefined,
+        menuId: undefined,
+        parentId: undefined,
+        icon: undefined,
+        sort: undefined,
+        component: undefined,
+        type: undefined,
+        path: undefined
       },
+      currentId: -1,
+      menuManager_btn_add: false,
+      menuManager_btn_edit: false,
+      menuManager_btn_del: false,
+      rules: {
+        menuId: [{ required: true, message: '节点ID不合法', trigger: 'blur' }],
+        name: [{ required: true, message: '标题不合法', trigger: 'blur' }],
+        type: [{ required: true, message: '类型不合法', trigger: 'blur' }],
+        path: [{ validator: this.checkPath, trigger: 'blur' }]
+      }
+    }
+  },
 
-      getNodeData(data) {
-        if (!this.formEdit) {
-          this.formStatus = 'update'
-        }
-        getObj(data.id).then(response => {
-          this.form = response.data.data
-        })
-        this.currentId = data.id
-        this.showElement = true
-      },
-      checkPath(rule, value, callback) {
-        if (this.form.type === '1') {
-          callback()
-        } else if (this.validatenull(value)) {
-          callback(new Error('请输入前端组件'))
-        } else {
-          callback()
+  computed: {
+    ...mapGetters(['elements', 'permissions'])
+  },
+  created() {
+    this.getList()
+    this.menuManager_btn_add = this.permissions['sys_menu_add']
+    this.menuManager_btn_edit = this.permissions['sys_menu_edit']
+    this.menuManager_btn_del = this.permissions['sys_menu_del']
+  },
+  methods: {
+    getList() {
+      fetchMenuTree(this.listQuery).then(response => {
+        this.treeData = response.data.data
+      })
+    },
+    filterNode(value, data) {
+      if (!value) return true
+      return data.label.indexOf(value) !== -1
+    },
+
+    nodeExpand(data) {
+      const aChildren = data.children
+      if (aChildren.length > 0) {
+        this.oExpandedKey[data.id] = true
+        this.oTreeNodeChildren[data.id] = aChildren
+      }
+      this.setExpandedKeys()
+    },
+    nodeCollapse(data) {
+      this.oExpandedKey[data.id] = false
+      // 如果有子节点
+      this.treeRecursion(this.oTreeNodeChildren[data.id], oNode => {
+        this.oExpandedKey[oNode.id] = false
+      })
+      this.setExpandedKeys()
+    },
+    setExpandedKeys() {
+      const oTemp = this.oExpandedKey
+      this.aExpandedKeys = []
+      for (const sKey in oTemp) {
+        if (oTemp[sKey]) {
+          this.aExpandedKeys.push(parseInt(sKey))
         }
-      },
-      handlerEdit() {
-        if (this.form.menuId) {
-          this.formEdit = false
-          this.formStatus = 'update'
+      }
+    },
+    treeRecursion(aChildren, fnCallback) {
+      if (aChildren) {
+        for (let i = 0; i < aChildren.length; ++i) {
+          const oNode = aChildren[i]
+          fnCallback && fnCallback(oNode)
+          this.treeRecursion(oNode.children, fnCallback)
         }
-      },
-      handlerAdd() {
-        this.resetForm()
+      }
+    },
+
+    getNodeData(data) {
+      if (!this.formEdit) {
+        this.formStatus = 'update'
+      }
+      getObj(data.id).then(response => {
+        this.form = response.data.data
+      })
+      this.currentId = data.id
+      this.showElement = true
+    },
+    checkPath(rule, value, callback) {
+      if (this.form.type === '1') {
+        callback()
+      } else if (this.validatenull(value)) {
+        callback(new Error('请输入前端组件'))
+      } else {
+        callback()
+      }
+    },
+    handlerEdit() {
+      if (this.form.menuId) {
         this.formEdit = false
-        this.formStatus = 'create'
-      },
-      handleDelete() {
-        this.$confirm('此操作将永久删除, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          delObj(this.currentId).then(() => {
+        this.formStatus = 'update'
+      }
+    },
+    handlerAdd() {
+      this.resetForm()
+      this.formEdit = false
+      this.formStatus = 'create'
+    },
+    handleDelete() {
+      this.$confirm('此操作将永久删除, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        delObj(this.currentId).then(() => {
+          this.getList()
+          this.resetForm()
+          this.onCancel()
+          this.$notify({
+            title: '成功',
+            message: '删除成功',
+            type: 'success',
+            duration: 2000
+          })
+        })
+      })
+    },
+    update() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          putObj(this.form).then(() => {
             this.getList()
-            this.resetForm()
-            this.onCancel()
+            this.formEdit = false
             this.$notify({
               title: '成功',
-              message: '删除成功',
+              message: '更新成功',
               type: 'success',
               duration: 2000
             })
           })
-        })
-      },
-      update() {
-        this.$refs.form.validate((valid) => {
-          if (valid) {
-            putObj(this.form).then(() => {
-              this.getList()
-              this.formEdit = false
-              this.$notify({
-                title: '成功',
-                message: '更新成功',
-                type: 'success',
-                duration: 2000
-              })
-            })
-          }
-        })
-      },
-      create() {
-        this.$refs.form.validate((valid) => {
-          if (valid) {
-            addObj(this.form).then(() => {
-              this.getList()
-              this.formEdit = false
-              this.$notify({
-                title: '成功',
-                message: '创建成功',
-                type: 'success',
-                duration: 2000
-              })
+        }
+      })
+    },
+    create() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          addObj(this.form).then(() => {
+            this.getList()
+            this.formEdit = false
+            this.$notify({
+              title: '成功',
+              message: '创建成功',
+              type: 'success',
+              duration: 2000
             })
-          }
-        })
-      },
-      onCancel() {
-        this.formEdit = true
-        this.formStatus = ''
-      },
-      resetForm() {
-        this.form = {
-          permission: undefined,
-          name: undefined,
-          menuId: undefined,
-          parentId: this.currentId,
-          icon: undefined,
-          sort: undefined,
-          component: undefined,
-          type: undefined,
-          path: undefined
+          })
         }
+      })
+    },
+    onCancel() {
+      this.formEdit = true
+      this.formStatus = ''
+    },
+    resetForm() {
+      this.form = {
+        permission: undefined,
+        name: undefined,
+        menuId: undefined,
+        parentId: this.currentId,
+        icon: undefined,
+        sort: undefined,
+        component: undefined,
+        type: undefined,
+        path: undefined
       }
     }
   }
+}
 </script>
 

+ 3 - 1
src/views/admin/param/index.vue

@@ -43,6 +43,7 @@ export default {
   name: 'Syspublicparam',
   data() {
     return {
+      searchForm: {},
       tableData: [],
       page: {
         total: 0, // 总页数
@@ -74,7 +75,7 @@ export default {
         descs: 'create_time',
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -138,6 +139,7 @@ export default {
        * 搜索回调
        */
     searchChange(form) {
+      this.searchForm = form
       this.getList(this.page, form)
     },
     /**

+ 5 - 4
src/views/admin/role/index.vue

@@ -121,6 +121,7 @@ export default {
   name: 'TableRole',
   data() {
     return {
+      searchForm: {},
       tableOption: tableOption,
       dsScopeData: [],
       treeData: [],
@@ -164,7 +165,7 @@ export default {
       fetchList(Object.assign({
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.list = response.data.data.records
         this.page.total = response.data.data.total
         this.listLoading = false
@@ -175,9 +176,9 @@ export default {
     handleRefreshChange() {
       this.getList(this.page)
     },
-    handleFilter(param) {
-      this.page.page = 1
-      this.getList(this.page, param)
+    handleFilter(form) {
+      this.searchForm = form
+      this.getList(this.page, form)
     },
     handleCreate() {
       this.$refs.crud.rowAdd()

+ 3 - 1
src/views/admin/social/index.vue

@@ -44,6 +44,7 @@ export default {
   name: 'SysSocialDetails',
   data() {
     return {
+      searchForm: {},
       tableData: [],
       page: {
         total: 0, // 总页数
@@ -74,7 +75,7 @@ export default {
       fetchList(Object.assign({
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -146,6 +147,7 @@ export default {
        * 搜索回调
        */
     searchChange(form) {
+      this.searchForm = form
       this.getList(this.page, form)
     }
   }

+ 3 - 1
src/views/admin/tenant/index.vue

@@ -43,6 +43,7 @@ export default {
   name: 'Tenant',
   data() {
     return {
+      searchForm: {},
       tableData: [],
       page: {
         total: 0, // 总页数
@@ -69,7 +70,7 @@ export default {
       fetchList(Object.assign({
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -140,6 +141,7 @@ export default {
        * 搜索回调
        */
     searchChange(form) {
+      this.searchForm = form
       this.getList(this.page, form)
     },
     /**

+ 3 - 2
src/views/admin/user/index.vue

@@ -140,6 +140,7 @@ export default {
   name: 'SysUser',
   data() {
     return {
+      searchForm: {},
       treeOption: {
         nodeKey: 'id',
         addBtn: false,
@@ -203,7 +204,7 @@ export default {
       fetchList(Object.assign({
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.list = response.data.data.records
         this.page.total = response.data.data.total
         this.listLoading = false
@@ -220,7 +221,7 @@ export default {
       })
     },
     handleFilter(param) {
-      this.page.page = 1
+      this.searchForm = param
       this.getList(this.page, param)
     },
     handleRefreshChange() {

+ 2 - 2
src/views/daemon/job-log/index.vue

@@ -42,7 +42,7 @@ export default {
   name: 'JobLog',
   data() {
     return {
-      queryParams: [], // 全局检索条件
+      queryParams: {}, // 全局检索条件
       tableData: [],
       page: {
         total: 0, // 总页数
@@ -80,7 +80,7 @@ export default {
        * 清除全局检索条件
        */
     handleSearchReset() {
-      this.queryParams = []
+      this.queryParams = {}
     },
     /**
        * 检索查询

+ 2 - 2
src/views/daemon/job-manage/index.vue

@@ -150,7 +150,7 @@ export default {
     return {
       form: {},
       cronPopover: false,
-      queryParams: [], // 全局检索条件
+      queryParams: {}, // 全局检索条件
       tableData: [],
       tableLogData: [],
       dialogFormVisible: false,
@@ -213,7 +213,7 @@ export default {
        * 清除全局检索条件
        */
     handleSearchReset() {
-      this.queryParams = []
+      this.queryParams = {}
     },
     /**
        * 定时任务检索查询分页查询

+ 3 - 1
src/views/daemon/status-trace-log/index.vue

@@ -54,6 +54,7 @@ export default {
   name: 'StatusTraceLog',
   data() {
     return {
+      searchForm: {},
       tableData: [],
       page: {
         total: 0, // 总页数
@@ -77,7 +78,7 @@ export default {
       fetchList(Object.assign({
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -151,6 +152,7 @@ export default {
       })
     },
     searchChange(form) {
+      this.searchForm = form
       this.getList(this.page, form)
     },
     /**

+ 3 - 1
src/views/mp/wxfansmsg/index.vue

@@ -62,6 +62,7 @@ export default {
   name: 'Wxfansmsg',
   data() {
     return {
+      searchForm: {},
       dialogFormVisible: false,
       tableData: [],
       tableResData: [],
@@ -97,7 +98,7 @@ export default {
       fetchList(Object.assign({
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -183,6 +184,7 @@ export default {
        * 搜索回调
        */
     searchChange(form) {
+      this.searchForm = form
       this.getList(this.page, form)
     },
     reply: function(row) {

+ 1 - 1
src/views/pay/cd/index.vue

@@ -11,7 +11,7 @@
         </el-col>
       </el-row>
       <el-row>
-        <el-col :span="24"><h4>请使用支付宝(沙箱)或微信手机客户端扫一扫</h4></el-col>
+        <el-col :span="24"><h4>请使用微信或支付宝(沙箱)手机客户端扫一扫</h4></el-col>
       </el-row>
       <el-row>
         1. 请勿大额支付,无法退还请知悉

+ 4 - 2
src/views/pay/goods/index.vue

@@ -43,6 +43,7 @@ export default {
   name: 'Paygoodsorder',
   data() {
     return {
+      searchForm: {},
       tableData: [],
       page: {
         total: 0, // 总页数
@@ -70,7 +71,7 @@ export default {
         descs: 'create_time',
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -128,7 +129,8 @@ export default {
        * 搜索回调
        */
     searchChange(form) {
-      this.getList(this.page,form)
+      this.searchForm = form
+      this.getList(this.page, form)
     },
     /**
        * 刷新回调

+ 3 - 1
src/views/pay/notify/index.vue

@@ -52,6 +52,7 @@ export default {
   name: 'Paynotifyrecord',
   data() {
     return {
+      searchForm: {},
       tableData: [],
       page: {
         total: 0, // 总页数
@@ -79,7 +80,7 @@ export default {
         descs: 'create_time',
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -134,6 +135,7 @@ export default {
       })
     },
     searchChange(form) {
+      this.searchForm = form
       this.getList(this.page, form)
     },
     refreshChange() {

+ 4 - 2
src/views/pay/orders/index.vue

@@ -52,6 +52,7 @@ export default {
   name: 'Paytradeorder',
   data() {
     return {
+      searchForm: {},
       tableData: [],
       page: {
         total: 0, // 总页数
@@ -79,7 +80,7 @@ export default {
         descs: 'create_time',
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -134,7 +135,8 @@ export default {
       })
     },
     searchChange(form) {
-      this.getList(this.page,form)
+      this.searchForm = form
+      this.getList(this.page, form)
     },
     refreshChange() {
       this.getList(this.page)

+ 3 - 20
src/views/pay/paychannel/index.vue

@@ -53,6 +53,7 @@ export default {
   name: 'Paychannel',
   data() {
     return {
+      searchForm: {},
       tableData: [],
       page: {
         total: 0, // 总页数
@@ -79,7 +80,7 @@ export default {
       fetchList(Object.assign({
         current: page.currentPage,
         size: page.pageSize
-      }, params)).then(response => {
+      }, params, this.searchForm)).then(response => {
         this.tableData = response.data.data.records
         this.page.total = response.data.data.total
         this.tableLoading = false
@@ -105,13 +106,6 @@ export default {
         this.getList(this.page)
       })
     },
-    /**
-             * @title 数据更新
-             * @param row 为当前的数据
-             * @param index 为当前更新数据的行数
-             * @param done 为表单关闭函数
-             *
-             **/
     handleUpdate: function(row, index, done, loading) {
       putObj(row).then(data => {
         this.tableData.splice(index, 1, Object.assign({}, row))
@@ -126,12 +120,6 @@ export default {
         loading()
       })
     },
-    /**
-             * @title 数据添加
-             * @param row 为当前的数据
-             * @param done 为表单关闭函数
-             *
-             **/
     handleSave: function(row, done, loading) {
       addObj(row).then(data => {
         this.tableData.push(Object.assign({}, row))
@@ -146,15 +134,10 @@ export default {
         loading()
       })
     },
-    /**
-             * 搜索回调
-             */
     searchChange(form) {
+      this.searchForm = form
       this.getList(this.page, form)
     },
-    /**
-             * 刷新回调
-             */
     refreshChange() {
       this.getList(this.page)
     }