فهرست منبع

调整部分数据选择默认排序

cfort 2 سال پیش
والد
کامیت
8053ad91d3

+ 1 - 1
src/business/platform/bo/def/panel.vue

@@ -62,7 +62,7 @@ export default {
         ]
       },
       pagination: {},
-      sorts: {}
+      sorts: { CREATE_TIME_: 'DESC' }
     }
   },
   computed: {

+ 1 - 1
src/business/platform/bpmn/definition/panel.vue

@@ -90,7 +90,7 @@
                     ]
                 },
                 pagination: {},
-                sorts: {},
+                sorts: { CREATE_TIME_: 'DESC' },
                 moreSearchParams: {}
             }
         },

+ 135 - 135
src/business/platform/data/dataTemplate/panel.vue

@@ -1,22 +1,22 @@
 <template>
-  <ibps-layout ref="layout">
-    <ibps-crud
-      ref="crud"
-      :height="tableHeight"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :pagination="pagination"
-      :loading="loading"
-      :selection-type="multiple?'checkbox':'radio'"
-      @selection-change="handleSelectionChange"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    />
-  </ibps-layout>
+    <ibps-layout ref="layout">
+        <ibps-crud
+            ref="crud"
+            :height="tableHeight"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :pagination="pagination"
+            :loading="loading"
+            :selection-type="multiple?'checkbox':'radio'"
+            @selection-change="handleSelectionChange"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        />
+    </ibps-layout>
 </template>
 <script>
 import { queryPageList } from '@/api/platform/data/dataTemplate'
@@ -24,129 +24,129 @@ import ActionUtils from '@/utils/action'
 import SelectionMixin from '@/components/ibps-selector/mixins/selection'
 
 export default {
-  mixins: [SelectionMixin],
-  props: {
-    value: [Object, Array],
-    multiple: Boolean,
-    height: {
-      type: String,
-      default: '400px'
-    },
-    type: {
-      type: String
-    }
-  },
-  data() {
-    return {
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      loading: false,
-      listData: [],
-      listConfig: {
-        // 工具栏
-        toolbars: [
-          { key: 'search' }
-        ],
-        // 查询条件
-        searchForm: {
-          labelWidth: 100,
-          forms: [
-            { prop: 'Q^name_^SL', label: '名称', itemWidth: '200' },
-            { prop: 'Q^key_^SL', label: '编码', itemWidth: '200' }
-          ]
+    mixins: [SelectionMixin],
+    props: {
+        value: [Object, Array],
+        multiple: Boolean,
+        height: {
+            type: String,
+            default: '400px'
         },
-        // 表格字段配置
-        columns: [
-          { prop: 'name', label: '名称' },
-          { prop: 'key', label: '编码' }
-        ]
-      },
-      pagination: {},
-      sorts: {}
-
-    }
-  },
-  computed: {
-    tableHeight() {
-      const h = this.height.substr(0, this.height.length - 2)
-      return parseInt(h) - 10
-    }
-  },
-  watch: {
-    type: {
-      handler(val, oldVal) {
-        if (val) {
-          this.loadListData()
+        type: {
+            type: String
         }
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    /**
-     * 加载数据
-     */
-    loadListData() {
-      this.loading = true
-      queryPageList(this.getFormatParams()).then(response => {
-        this.loading = false
-        ActionUtils.handleListData(this, response.data)
-        this.setSelectRow()
-      }).catch(() => {
-        this.loading = false
-      })
     },
-    /**
-     * 获取格式化参数
-     */
-    getFormatParams() {
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      params['Q^show_type_^S:'] = this.type
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      this.changePageCoreRecordData()
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadListData()
-    },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadListData()
+    data () {
+        return {
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            loading: false,
+            listData: [],
+            listConfig: {
+                // 工具栏
+                toolbars: [
+                    { key: 'search' }
+                ],
+                // 查询条件
+                searchForm: {
+                    labelWidth: 100,
+                    forms: [
+                        { prop: 'Q^name_^SL', label: '名称', itemWidth: '200' },
+                        { prop: 'Q^key_^SL', label: '编码', itemWidth: '200' }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'name', label: '名称' },
+                    { prop: 'key', label: '编码' }
+                ]
+            },
+            pagination: {},
+            sorts: { CREATE_TIME_: 'DESC' }
+
+        }
     },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadListData()
+    computed: {
+        tableHeight () {
+            const h = this.height.substr(0, this.height.length - 2)
+            return parseInt(h) - 10
+        }
     },
-    /**
-     * 重置查询条件
-     */
-    reset() {
-      this.$refs['crud'].handleReset()
+    watch: {
+        type: {
+            handler (val, oldVal) {
+                if (val) {
+                    this.loadListData()
+                }
+            },
+            immediate: true
+        }
     },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        default:
-          break
-      }
-    }
+    methods: {
+        /**
+         * 加载数据
+         */
+        loadListData () {
+            this.loading = true
+            queryPageList(this.getFormatParams()).then(response => {
+                this.loading = false
+                ActionUtils.handleListData(this, response.data)
+                this.setSelectRow()
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getFormatParams () {
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            params['Q^show_type_^S:'] = this.type
+            return ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            this.changePageCoreRecordData()
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadListData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadListData()
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadListData()
+        },
+        /**
+         * 重置查询条件
+         */
+        reset () {
+            this.$refs['crud'].handleReset()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                default:
+                    break
+            }
+        }
 
-  }
+    }
 }
 </script>

+ 126 - 126
src/business/platform/data/dataset/panel.vue

@@ -1,22 +1,22 @@
 <template>
-  <div>
-    <ibps-crud
-      ref="crud"
-      :height="tableHeight"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :pagination="pagination"
-      :loading="loading"
-      :selection-type="multiple?'checkbox':'radio'"
-      @selection-change="handleSelectionChange"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    />
-  </div>
+    <div>
+        <ibps-crud
+            ref="crud"
+            :height="tableHeight"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :pagination="pagination"
+            :loading="loading"
+            :selection-type="multiple?'checkbox':'radio'"
+            @selection-change="handleSelectionChange"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        />
+    </div>
 </template>
 <script>
 import { queryPageList } from '@/api/platform/data/dataset'
@@ -25,118 +25,118 @@ import ActionUtils from '@/utils/action'
 import SelectionMixin from '@/components/ibps-selector/mixins/selection'
 
 export default {
-  mixins: [SelectionMixin],
-  props: {
-    value: [Object, Array],
-    multiple: Boolean,
-    height: {
-      type: String,
-      default: '400px'
-    }
-  },
-  data() {
-    return {
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      loading: false,
-      listData: [],
-      listConfig: {
-        // 工具栏
-        toolbars: [
-          { key: 'search' }
-        ],
-        // 查询条件
-        searchForm: {
-          labelWidth: 100,
-          forms: [
-            { prop: 'Q^name_^SL', label: '名称', itemWidth: '200' },
-            { prop: 'Q^key_^SL', label: '编码', itemWidth: '200' }
-            // { prop: 'Q^TYPE_^SL', label: '类型', itemWidth: '200', fieldType: 'select', options: datasetTypeOptions }
-          ]
-        },
-        // 表格字段配置
-        columns: [
-          { prop: 'name', label: '名称' },
-          { prop: 'key', label: '编码' },
-          { prop: 'type', label: '类型', tags: datasetTypeOptions }
-        ]
-      },
-      pagination: {},
-      sorts: {}
-    }
-  },
-  computed: {
-    tableHeight() {
-      const h = this.height.substr(0, this.height.length - 2)
-      return parseInt(h) - 10
-    }
-  },
-  created() {
-    this.loadListData()
-  },
-  methods: {
-    /**
-     * 加载数据
-     */
-    loadListData() {
-      this.loading = true
-      queryPageList(this.getFormatParams()).then(response => {
-        this.loading = false
-        ActionUtils.handleListData(this, response.data)
-        this.setSelectRow()
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 获取格式化参数
-     */
-    getFormatParams() {
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      this.changePageCoreRecordData()
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadListData()
+    mixins: [SelectionMixin],
+    props: {
+        value: [Object, Array],
+        multiple: Boolean,
+        height: {
+            type: String,
+            default: '400px'
+        }
     },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadListData()
+    data () {
+        return {
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            loading: false,
+            listData: [],
+            listConfig: {
+                // 工具栏
+                toolbars: [
+                    { key: 'search' }
+                ],
+                // 查询条件
+                searchForm: {
+                    labelWidth: 100,
+                    forms: [
+                        { prop: 'Q^name_^SL', label: '名称', itemWidth: '200' },
+                        { prop: 'Q^key_^SL', label: '编码', itemWidth: '200' }
+                        // { prop: 'Q^TYPE_^SL', label: '类型', itemWidth: '200', fieldType: 'select', options: datasetTypeOptions }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'name', label: '名称' },
+                    { prop: 'key', label: '编码' },
+                    { prop: 'type', label: '类型', tags: datasetTypeOptions }
+                ]
+            },
+            pagination: {},
+            sorts: { CREATE_TIME_: 'DESC' }
+        }
     },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadListData()
+    computed: {
+        tableHeight () {
+            const h = this.height.substr(0, this.height.length - 2)
+            return parseInt(h) - 10
+        }
     },
-    /**
-     * 重置查询条件
-     */
-    reset() {
-      this.$refs['crud'].handleReset()
+    created () {
+        this.loadListData()
     },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        default:
-          break
-      }
+    methods: {
+        /**
+         * 加载数据
+         */
+        loadListData () {
+            this.loading = true
+            queryPageList(this.getFormatParams()).then(response => {
+                this.loading = false
+                ActionUtils.handleListData(this, response.data)
+                this.setSelectRow()
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getFormatParams () {
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            return ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            this.changePageCoreRecordData()
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadListData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadListData()
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadListData()
+        },
+        /**
+         * 重置查询条件
+         */
+        reset () {
+            this.$refs['crud'].handleReset()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                default:
+                    break
+            }
+        }
     }
-  }
 }
 </script>

+ 154 - 154
src/business/platform/form/form-def/panel.vue

@@ -1,22 +1,22 @@
 <template>
-  <div>
-    <ibps-crud
-      ref="crud"
-      :height="tableHeight"
-      :data="listData"
-      :toolbars="dataType === 'bo'?null:listConfig.toolbars"
-      :search-form="dataType === 'bo'?null:listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :pagination="dataType === 'bo'?null:pagination"
-      :loading="loading"
-      :selection-type="multiple?'checkbox':'radio'"
-      @selection-change="handleSelectionChange"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    />
-  </div>
+    <div>
+        <ibps-crud
+            ref="crud"
+            :height="tableHeight"
+            :data="listData"
+            :toolbars="dataType === 'bo'?null:listConfig.toolbars"
+            :search-form="dataType === 'bo'?null:listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :pagination="dataType === 'bo'?null:pagination"
+            :loading="loading"
+            :selection-type="multiple?'checkbox':'radio'"
+            @selection-change="handleSelectionChange"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        />
+    </div>
 </template>
 <script>
 import { queryPageList, findFormJsonByBo } from '@/api/platform/form/formDef'
@@ -24,148 +24,148 @@ import ActionUtils from '@/utils/action'
 import SelectionMixin from '@/components/ibps-selector/mixins/selection'
 
 export default {
-  mixins: [SelectionMixin],
-  props: {
-    value: [Object, Array],
-    multiple: Boolean,
-    height: {
-      type: String,
-      default: '400px'
-    },
-
-    boCode: String,
-    dataType: {
-      type: String
-    }
-  },
-  data() {
-    return {
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      loading: false,
-      listData: [],
-      listConfig: {
-        // 工具栏
-        toolbars: [
-          { key: 'search' }
-        ],
-        // 查询条件
-        searchForm: {
-          labelWidth: 100,
-          forms: [
-            { prop: 'Q^name_^SL', label: '名称', itemWidth: '200' },
-            { prop: 'Q^key_^SL', label: '编码', itemWidth: '200' }
-          ]
+    mixins: [SelectionMixin],
+    props: {
+        value: [Object, Array],
+        multiple: Boolean,
+        height: {
+            type: String,
+            default: '400px'
         },
-        // 表格字段配置
-        columns: [
-          { prop: 'name', label: '名称' },
-          { prop: 'key', label: '编码' }
-        ]
-      },
-      pagination: {},
-      sorts: {}
-    }
-  },
-  computed: {
-    tableHeight() {
-      const h = this.height.substr(0, this.height.length - 2)
-      return parseInt(h) - 10
-    }
-  },
-  watch: {
-    dataType: {
-      handler(val, oldVal) {
-        this.loadListData()
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    /**
-     * 加载数据
-     */
-    loadListDataByBo() {
-      this.loading = true
-      findFormJsonByBo({ boCode: this.boCode }).then(response => {
-        this.loading = false
-        this.listData = response.data
-        this.setSelectRow()
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 加载数据
-     */
-    loadListDataByPage() {
-      this.loading = true
-      queryPageList(this.getFormatParams()).then(response => {
-        this.loading = false
-        ActionUtils.handleListData(this, response.data)
-        this.setSelectRow()
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    loadListData() {
-      if (this.dataType === 'bo') {
-        this.loadListDataByBo()
-      } else {
-        this.loadListDataByPage()
-      }
-    },
 
-    /**
-     * 获取格式化参数
-     */
-    getFormatParams() {
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
+        boCode: String,
+        dataType: {
+            type: String
+        }
     },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      this.changePageCoreRecordData()
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadListData()
+    data () {
+        return {
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            loading: false,
+            listData: [],
+            listConfig: {
+                // 工具栏
+                toolbars: [
+                    { key: 'search' }
+                ],
+                // 查询条件
+                searchForm: {
+                    labelWidth: 100,
+                    forms: [
+                        { prop: 'Q^name_^SL', label: '名称', itemWidth: '200' },
+                        { prop: 'Q^key_^SL', label: '编码', itemWidth: '200' }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'name', label: '名称' },
+                    { prop: 'key', label: '编码' }
+                ]
+            },
+            pagination: {},
+            sorts: { CREATE_TIME_: 'DESC' }
+        }
     },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadListData()
+    computed: {
+        tableHeight () {
+            const h = this.height.substr(0, this.height.length - 2)
+            return parseInt(h) - 10
+        }
     },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadListData()
+    watch: {
+        dataType: {
+            handler (val, oldVal) {
+                this.loadListData()
+            },
+            immediate: true
+        }
     },
-    /**
-     * 重置查询条件
-     */
-    reset() {
-      this.$refs['crud'].handleReset()
-    },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        default:
-          break
-      }
-    }
+    methods: {
+        /**
+         * 加载数据
+         */
+        loadListDataByBo () {
+            this.loading = true
+            findFormJsonByBo({ boCode: this.boCode }).then(response => {
+                this.loading = false
+                this.listData = response.data
+                this.setSelectRow()
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 加载数据
+         */
+        loadListDataByPage () {
+            this.loading = true
+            queryPageList(this.getFormatParams()).then(response => {
+                this.loading = false
+                ActionUtils.handleListData(this, response.data)
+                this.setSelectRow()
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        loadListData () {
+            if (this.dataType === 'bo') {
+                this.loadListDataByBo()
+            } else {
+                this.loadListDataByPage()
+            }
+        },
+
+        /**
+         * 获取格式化参数
+         */
+        getFormatParams () {
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            return ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            this.changePageCoreRecordData()
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadListData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadListData()
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadListData()
+        },
+        /**
+         * 重置查询条件
+         */
+        reset () {
+            this.$refs['crud'].handleReset()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                default:
+                    break
+            }
+        }
 
-  }
+    }
 }
 </script>

+ 138 - 138
src/business/platform/form/form-print/panel.vue

@@ -1,22 +1,22 @@
 <template>
-  <ibps-layout ref="layout">
-    <ibps-crud
-      ref="crud"
-      :height="tableHeight"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :pagination="pagination"
-      :loading="loading"
-      :selection-type="multiple?'checkbox':'radio'"
-      @selection-change="handleSelectionChange"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    />
-  </ibps-layout>
+    <ibps-layout ref="layout">
+        <ibps-crud
+            ref="crud"
+            :height="tableHeight"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :pagination="pagination"
+            :loading="loading"
+            :selection-type="multiple?'checkbox':'radio'"
+            @selection-change="handleSelectionChange"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        />
+    </ibps-layout>
 </template>
 <script>
 import { queryPageList } from '@/api/platform/form/formPrint'
@@ -24,132 +24,132 @@ import ActionUtils from '@/utils/action'
 import SelectionMixin from '@/components/ibps-selector/mixins/selection'
 
 export default {
-  mixins: [SelectionMixin],
-  props: {
-    value: [Object, Array],
-    multiple: Boolean,
-    height: {
-      type: String,
-      default: '400px'
-    },
-    type: {
-      type: String
-    },
-    formKey: {
-      type: String
-    }
-  },
-  data() {
-    return {
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      loading: false,
-      listData: [],
-      listConfig: {
-        // 工具栏
-        toolbars: [
-          { key: 'search' }
-        ],
-        // 查询条件
-        searchForm: {
-          labelWidth: 100,
-          forms: [
-            { prop: 'Q^name_^SL', label: '名称', itemWidth: '200' },
-            { prop: 'Q^key_^SL', label: '编码', itemWidth: '200' }
-          ]
+    mixins: [SelectionMixin],
+    props: {
+        value: [Object, Array],
+        multiple: Boolean,
+        height: {
+            type: String,
+            default: '400px'
         },
-        // 表格字段配置
-        columns: [
-          { prop: 'name', label: '名称' },
-          { prop: 'key', label: '编码' }
-        ]
-      },
-      pagination: {},
-      sorts: {}
-
-    }
-  },
-  computed: {
-    tableHeight() {
-      const h = this.height.substr(0, this.height.length - 2)
-      return parseInt(h) - 10
-    }
-  },
-  watch: {
-    type: {
-      handler(val, oldVal) {
-        if (val) {
-          this.loadListData()
+        type: {
+            type: String
+        },
+        formKey: {
+            type: String
         }
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    /**
-     * 加载数据
-     */
-    loadListData() {
-      this.loading = true
-      queryPageList(this.getFormatParams()).then(response => {
-        this.loading = false
-        ActionUtils.handleListData(this, response.data)
-        this.setSelectRow()
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 获取格式化参数
-     */
-    getFormatParams() {
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      params['Q^FORM_KEY_^S'] = this.formKey
-      params.type = this.type
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
     },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      this.changePageCoreRecordData()
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadListData()
-    },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadListData()
+    data () {
+        return {
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            loading: false,
+            listData: [],
+            listConfig: {
+                // 工具栏
+                toolbars: [
+                    { key: 'search' }
+                ],
+                // 查询条件
+                searchForm: {
+                    labelWidth: 100,
+                    forms: [
+                        { prop: 'Q^name_^SL', label: '名称', itemWidth: '200' },
+                        { prop: 'Q^key_^SL', label: '编码', itemWidth: '200' }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'name', label: '名称' },
+                    { prop: 'key', label: '编码' }
+                ]
+            },
+            pagination: {},
+            sorts: { CREATE_TIME_: 'DESC' }
+
+        }
     },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadListData()
+    computed: {
+        tableHeight () {
+            const h = this.height.substr(0, this.height.length - 2)
+            return parseInt(h) - 10
+        }
     },
-    /**
-     * 重置查询条件
-     */
-    reset() {
-      this.$refs['crud'].handleReset()
+    watch: {
+        type: {
+            handler (val, oldVal) {
+                if (val) {
+                    this.loadListData()
+                }
+            },
+            immediate: true
+        }
     },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        default:
-          break
-      }
+    methods: {
+        /**
+         * 加载数据
+         */
+        loadListData () {
+            this.loading = true
+            queryPageList(this.getFormatParams()).then(response => {
+                this.loading = false
+                ActionUtils.handleListData(this, response.data)
+                this.setSelectRow()
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getFormatParams () {
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            params['Q^FORM_KEY_^S'] = this.formKey
+            params.type = this.type
+            return ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            this.changePageCoreRecordData()
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadListData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadListData()
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadListData()
+        },
+        /**
+         * 重置查询条件
+         */
+        reset () {
+            this.$refs['crud'].handleReset()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                default:
+                    break
+            }
+        }
     }
-  }
 }
 </script>