Ver Fonte

Merge branch 'master' of http://119.23.210.103:3000/wy/zdqy_firm_former

cfort há 2 anos atrás
pai
commit
0edd93f2d6

+ 5 - 0
src/business/platform/data/templaterender/templates/list.vue

@@ -21,6 +21,7 @@
             :dynamic-params="dynamicParams"
             :form-name="template ? template.attrs.form_name : ''"
             :class="{ 'ibps-data-template-list__preview': preview }"
+            :selection_all="selectionAll"
             @display-field-change="handleDisplayField"
             @header-dragend="handleHeaderDragend"
             @selection-change="handleSelectionChange"
@@ -724,6 +725,9 @@ export default {
          */
         getSelectAllIds () {
             const selectAllIds = []
+            if (this.$utils.isEmpty(this.selectionAll)) {
+                return
+            }
             if (this.multiple) {
                 this.selectionAll.forEach((row) => {
                     selectAllIds.push(this.getPkValue(row))
@@ -1043,6 +1047,7 @@ export default {
                         this.exportActions(buttonType)
                         break
                     case 'exportSelected': // 导出选中
+
                         ActionUtils.selectedMultiRecord(this.getSelectAllIds()).then((ids) => {
                             this.selecteds = ids
                             this.exportActions(buttonType, ids)

+ 10 - 1
src/components/ibps-crud/mixin/base.js

@@ -95,6 +95,14 @@ export default {
         selectionType: {
             type: String,
             default: 'checkbox'
+        },
+        /**
+     * @description 所有列表已选择的数据id
+     *
+     */
+        selection_all: {
+            type: Array,
+            default: () => []
         }
     },
     methods: {
@@ -263,7 +271,8 @@ export default {
             const buttonKey = action.key
             let selection = null// 选中数据
             if (position === 'toolbar') { // 工具栏
-                selection = this.getSelectedIds()
+                // selection = this.getSelectedIds()
+                selection = this.selection_all.map(i => i.id_) // 默认给所有已选择的数据id
             } else { // 管理列
                 selection = data ? this.getPkValue(data) : null
             }

+ 1 - 1
src/store/modules/ibps/modules/user.js

@@ -185,7 +185,7 @@ export default {
         getDeptList ({ state, dispatch }, { first, second }) {
             const params = second ? ` and (pe.path_ like '%${second}%' or pe.id_ = '${first}')` : first ? ` and pe.path_ like '%${first}%'` : ''
             // const sql = `select id_ as positionId, name_ as positionName, path_ as path, depth_ as depth, sn_ as sn from ibps_party_entity where party_type_ = 'position'${params} order by depth_ asc, sn_ asc`
-            const sql = `select pe.id_ as positionId, pe.name_ as positionName, pe.path_ as path, pe.depth_ as depth, pe.sn_ as sn, ifnull(r.name_, '') as manager, ifnull(r.id_, '') as managerId from ibps_party_entity as pe left join (select em.id_, em.positions_, em.name_ from ibps_party_employee as em left join ibps_party_user_role as ur on em.id_ = ur.user_id_ left join ibps_party_role as pr on pr.id_ = ur.role_id_ where role_alias_ in ('zhsfzr', 'syszr', 'zhglzzc')) as r on find_in_set(pe.id_, r.positions_) > 0 where pe.party_type_ = 'position'${params} group by pe.id_ order by pe.depth_ asc, pe.sn_ asc`
+            const sql = `select pe.id_ as positionId, pe.name_ as positionName, pe.path_ as path, pe.depth_ as depth, pe.sn_ as sn, ifnull(r.name_, '') as manager, ifnull(r.id_, '') as managerId from ibps_party_entity as pe left join (select em.id_, em.positions_, em.name_ from ibps_party_employee as em left join ibps_party_user_role as ur on em.id_ = ur.user_id_ left join ibps_party_role as pr on pr.id_ = ur.role_id_ where role_alias_ in ('zhsfzr', 'syszr', 'zhglzzc')) as r on find_in_set(pe.id_, r.positions_) > 0 where pe.party_type_ = 'position'${params} group by pe.id_ order by pe.depth_ asc, pe.sn_ asc,pe.id_ ASC`
             common.request('sql', sql).then(res => {
                 const { data = [] } = res.variables || {}
                 dispatch('ibps/param/setDeptList', data, {