Explorar o código

feat: 修复org

double.huang %!s(int64=5) %!d(string=hai) anos
pai
achega
0acfa96b3e
Modificáronse 2 ficheiros con 8 adicións e 16 borrados
  1. 3 9
      src/components/Sheet/index.vue
  2. 5 7
      src/views/org/index.vue

+ 3 - 9
src/components/Sheet/index.vue

@@ -67,10 +67,7 @@
                 @click.native.prevent="btn.method(scope.row)"
               >{{ btn.label }}</el-button>
             </template>
-            <div
-              v-if="operates.dropdown != undefined && operates.dropdown.filter(_x=>_x.show === true).length > 0"
-              style="display: inline-block;"
-            >
+            <div v-if="operates.dropdown != undefined && operates.dropdown.filter(_x=>_x.show === true).length > 0" style="display: inline-block;">
               <el-dropdown style="font-size: 12px" size="mini">
                 <el-button type="primary" size="mini">More</el-button>
                 <el-dropdown-menu slot="dropdown">
@@ -182,11 +179,8 @@ export default {
   },
   computed: {
     tableMaxHeight() {
-      if (
-        this.$store === undefined ||
-        this.$store.getters.pageTableHeaderHeight === 0
-      ) { return null }
-      const height = 240 + 20 + this.$store.getters.pageTableHeaderHeight
+      if (this.$store === undefined || this.$store.getters.pageTableHeaderHeight === 0) { return null }
+      const height = 220 + this.$store.getters.pageTableHeaderHeight
       return 'calc(100vh - ' + height + 'px)'
     }
   },

+ 5 - 7
src/views/org/index.vue

@@ -7,10 +7,10 @@
         </el-aside>
         <el-container>
           <el-header style="margin-bottom: 10px;">
-            <query ref="searchForm" :form-config="query" @onSubmit="search" />
+            <query ref="searchForm" :form-config="query" @onSubmit="search" @onCreate="create" @onDeleteBatch="deleteBatch" />
           </el-header>
           <el-main class="table-main">
-            <sheet ref="qtable" :api="this.$api.sysOrg.page" :columns="tableColumns" :data-query="dataQuery" :operates="operates" :float-type="'right'" :select-type="'selection'" />
+            <sheet ref="qtable" :api="this.$api.sysOrg.page" :columns="tableColumns" :data-query="dataQuery" :operates="operates" :float-type="'right'" :select-type="'selection'" :selection-data.sync="selectionData" />
           </el-main>
         </el-container>
       </el-container>
@@ -179,7 +179,8 @@ export default {
         { id: 0, name: 'Dir' },
         { id: 1, name: 'Menu' },
         { id: 2, name: 'Button' }
-      ]
+      ],
+      selectionData: []
     }
   },
   computed: {
@@ -253,10 +254,7 @@ export default {
       })
     },
     deleteBatch() {
-      const ids = []
-      this.$refs.qtable.selectionData.forEach(row => {
-        ids.push({ id: row.id })
-      })
+      const ids = this.selectionData.map(row => ({ id: row.id }))
       this.$confirm('Are you sure to delete selected data in batch ?', 'Prompt', {
         type: 'warning'
       }).then(() => {