Browse Source

同步部分医学版修改

cfort 2 years ago
parent
commit
0c2ce375d2

+ 152 - 152
src/views/platform/auth/apiInvoke/list.vue

@@ -1,36 +1,36 @@
 <template>
-  <div class="main-container">
-    <ibps-crud
-      ref="crud"
-      :height="height"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :pagination="pagination"
-      :loading="loading"
-      :index-row="false"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    >
-      <template slot="authorization">
-        <client-selector
-          style="width:200px;"
-          @input="getAuth"
-        />
-      </template>
-      <!-- 授权用户 -->
-      <template slot="user">
-        <ibps-employee-selector
-          value-key="account"
-          style="width:200px;"
-          @input="getUser"
-        />
-      </template>
-    </ibps-crud>
-  </div>
+    <div class="main-container">
+        <ibps-crud
+            ref="crud"
+            :height="height"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :pagination="pagination"
+            :loading="loading"
+            :index-row="false"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        >
+            <template slot="authorization">
+                <client-selector
+                    style="width:200px;"
+                    @input="getAuth"
+                />
+            </template>
+            <!-- 授权用户 -->
+            <template slot="user">
+                <ibps-employee-selector
+                    value-key="account"
+                    style="width:200px;"
+                    @input="getUser"
+                />
+            </template>
+        </ibps-crud>
+    </div>
 </template>
 <script>
 import { queryInvoke as queryPageList } from '@/api/platform/auth/api'
@@ -38,130 +38,130 @@ import clientSelector from '@/business/platform/auth/client/selector'
 import IbpsEmployeeSelector from '@/business/platform/org/employee/selector'
 import ActionUtils from '@/utils/action'
 export default {
-  components: {
-    clientSelector,
-    IbpsEmployeeSelector
-  },
-  data() {
-    const statusOptions = [{
-      label: '是',
-      value: 'Y'
-    }, {
-      label: '否',
-      value: 'N'
-    }]
-    return {
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      loading: true,
-      formId: '',
-      height: document.clientHeight,
+    components: {
+        clientSelector,
+        IbpsEmployeeSelector
+    },
+    data () {
+        const statusOptions = [{
+            label: '是',
+            value: 'Y'
+        }, {
+            label: '否',
+            value: 'N'
+        }]
+        return {
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            loading: true,
+            formId: '',
+            height: document.clientHeight,
 
-      auth: '',
-      user: '',
+            auth: '',
+            user: '',
 
-      listData: [],
-      pagination: {},
-      sorts: {},
-      listConfig: {
-        toolbars: [
-          {
-            key: 'search'
-          }
-        ],
-        searchForm: {
-          forms: [
-            { prop: 'Q^URI_^SL', label: '接口地址', itemWidth: 200 },
-            { prop: 'Q^CLIENT_KEY_^SL', label: '授权标识', fieldType: 'slot', slotName: 'authorization', itemWidth: 200 },
-            { prop: 'Q^ACCOUNT_^SL', label: '用户姓名', fieldType: 'slot', slotName: 'user', itemWidth: 200 },
-            { prop: 'Q^ip_^SL', label: 'IP', itemWidth: 200 },
-            {
-              prop: 'Q^STATUS_^SL',
-              label: '状态',
-              fieldType: 'select',
-              options: statusOptions,
-              itemWidth: 200
-            },
-            { prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'], label: '调用时间', fieldType: 'daterange', itemWidth: 200 }
-          ]
-        },
-        // 表格字段配置
-        columns: [
-          { prop: 'uri', label: '接口地址' },
-          { prop: 'clientKey', label: '授权标识' },
-          { prop: 'fullName', label: '用户姓名' },
-          { prop: 'ip', label: 'IP' },
-          { prop: 'status', label: '状态', tags: statusOptions },
-          { prop: 'createTime', label: '调用时间', dateFormat: 'yyyy-MM-dd HH:mm:ss' },
-          { prop: 'cause', label: '详情' }
-        ]
-      }
-    }
-  },
-  created() {
-    this.loadData()
-  },
-  methods: {
-    getAuth(val) {
-      this.auth = val
-    },
-    getUser(val) {
-      this.user = val
-    },
-    // 加载数据
-    loadData() {
-      this.loading = true
-      queryPageList(this.getSearcFormData()).then(response => {
-        ActionUtils.handleListData(this, response.data)
-        this.loading = false
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 获取格式化参数
-     */
-    getSearcFormData() {
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      params['Q^CLIENT_KEY_^SL'] = this.auth || ''
-      params['Q^ACCOUNT_^SL'] = this.user || ''
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadData()
-    },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadData()
+            listData: [],
+            pagination: {},
+            sorts: { CREATE_TIME_: 'desc' },
+            listConfig: {
+                toolbars: [
+                    {
+                        key: 'search'
+                    }
+                ],
+                searchForm: {
+                    forms: [
+                        { prop: 'Q^URI_^SL', label: '接口地址', itemWidth: 200 },
+                        { prop: 'Q^CLIENT_KEY_^SL', label: '授权标识', fieldType: 'slot', slotName: 'authorization', itemWidth: 200 },
+                        { prop: 'Q^ACCOUNT_^SL', label: '用户姓名', fieldType: 'slot', slotName: 'user', itemWidth: 200 },
+                        { prop: 'Q^ip_^SL', label: 'IP', itemWidth: 200 },
+                        // {
+                        //     prop: 'Q^STATUS_^SL',
+                        //     label: '状态',
+                        //     fieldType: 'select',
+                        //     options: statusOptions,
+                        //     itemWidth: 200
+                        // },
+                        { prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'], label: '调用时间', fieldType: 'daterange', itemWidth: 200 }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'uri', label: '接口地址', minWidth: 200 },
+                    { prop: 'clientKey', label: '授权标识', width: 120 },
+                    { prop: 'fullName', label: '用户姓名', width: 120 },
+                    { prop: 'ip', label: 'IP', width: 120 },
+                    // { prop: 'status', label: '状态', tags: statusOptions, sortable: true, width: 80 },
+                    { prop: 'createTime', label: '调用时间', dateFormat: 'yyyy-MM-dd HH:mm:ss', sortable: true, width: 150 },
+                    { prop: 'cause', label: '详情', width: 120 }
+                ]
+            }
+        }
     },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadData()
+    created () {
+        this.loadData()
     },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        default:
-          break
-      }
+    methods: {
+        getAuth (val) {
+            this.auth = val
+        },
+        getUser (val) {
+            this.user = val
+        },
+        // 加载数据
+        loadData () {
+            this.loading = true
+            queryPageList(this.getSearcFormData()).then(response => {
+                ActionUtils.handleListData(this, response.data)
+                this.loading = false
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getSearcFormData () {
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            params['Q^CLIENT_KEY_^SL'] = this.auth || ''
+            params['Q^ACCOUNT_^SL'] = this.user || ''
+            return ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadData()
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadData()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                default:
+                    break
+            }
+        }
     }
-  }
 }
 </script>

+ 306 - 308
src/views/platform/auth/appApi/list.vue

@@ -1,57 +1,57 @@
 <template>
-  <div class="main-container">
-    <ibps-crud
-      ref="crud"
-      :height="height"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :row-handle="listConfig.rowHandle"
-      :pagination="pagination"
-      :loading="loading"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    >
-      <!-- 搜索栏插槽 -->
-      <template slot="scope">
-        <el-select v-model="scope" clearable placeholder="请选择">
-          <el-option
-            v-for="item in scopeOptions"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-      </template>
-      <!-- 表格字段插槽 -->
-      <template slot="scopeColumns" slot-scope="scopeColumns">
-        <el-tag
-          v-for="(item,index ) in dataConvert(scopeColumns.row.scope)"
-          :key="index"
+    <div class="main-container">
+        <ibps-crud
+            ref="crud"
+            :height="height"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :row-handle="listConfig.rowHandle"
+            :pagination="pagination"
+            :loading="loading"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
         >
-          {{ item|optionsFilter(scopeOptions,'label') }}
-        </el-tag>
-      </template>
-    </ibps-crud>
-    <edit
-      :id="editId"
-      :title="title"
-      :constant="constantInfo(scopeOptions)"
-      :visible="dialogFormVisible"
-      :readonly="readonly"
-      @callback="search"
-      @close="visible => dialogFormVisible = visible"
-    />
-    <import
-      :title="title"
-      :visible="importFormVisible"
-      @callback="search"
-      @close="visible => importFormVisible = visible"
-    />
-  </div>
+            <!-- 搜索栏插槽 -->
+            <template slot="scope">
+                <el-select v-model="scope" clearable placeholder="请选择">
+                    <el-option
+                        v-for="item in scopeOptions"
+                        :key="item.value"
+                        :label="item.label"
+                        :value="item.value"
+                    />
+                </el-select>
+            </template>
+            <!-- 表格字段插槽 -->
+            <template slot="scopeColumns" slot-scope="scopeColumns">
+                <el-tag
+                    v-for="(item,index ) in dataConvert(scopeColumns.row.scope)"
+                    :key="index"
+                >
+                    {{ item|optionsFilter(scopeOptions,'label') }}
+                </el-tag>
+            </template>
+        </ibps-crud>
+        <edit
+            :id="editId"
+            :title="title"
+            :constant="constantInfo(scopeOptions)"
+            :visible="dialogFormVisible"
+            :readonly="readonly"
+            @callback="search"
+            @close="visible => dialogFormVisible = visible"
+        />
+        <import
+            :title="title"
+            :visible="importFormVisible"
+            @callback="search"
+            @close="visible => importFormVisible = visible"
+        />
+    </div>
 </template>
 
 <script>
@@ -64,269 +64,267 @@ import Import from './import'
 import { findApiScope } from '@/api/platform/info/find'
 
 const getScopeType = scopeType => {
-  return typeOptions.find(x => x.value === scopeType)
+    return typeOptions.find(x => x.value === scopeType)
 }
 
 export default {
-  components: {
-    Edit,
-    Import
-  },
-  filters: {
-    getScopeTypeFilter(scopeType) {
-      const t = getScopeType(scopeType)
-      return t ? t.label : scopeType
-    }
-  },
-  mixins: [FixHeight],
-  data() {
-    const statusOptions = [{
-      label: '是',
-      value: 'Y'
-    }, {
-      label: '否',
-      value: 'N',
-      type: 'danger'
-    }]
-    return {
-      dialogFormVisible: false, // 弹窗
-      importFormVisible: false,
-      editId: '', // 编辑dialog需要使用
-      readonly: false, // 是否只读
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      title: '',
-      loading: true,
-      isLimitedEnabled: false,
-      isLimited: false,
-      height: document.clientHeight,
-
-      listData: [],
-      pagination: {},
-      sorts: {},
-
-      scopeOptions: [],
-      scope: '',
-
-      listConfig: {
-        toolbars: [
-          {
-            key: 'search'
-          },
-          {
-            key: 'import'
-          },
-          {
-            key: 'add'
-          },
-          {
-            key: 'edit'
-          },
-          {
-            key: 'remove'
-          },
-          {
-            key: 'setSubmitLimit',
-            label: '设置接口提交限制',
-            icon: 'ibps-icon-plus-square-o',
-            hidden: (data) => {
-              return this.isLimitedEnabled === false || this.$store.getters.isSuper === false || this.isLimited === true
-            }
-          },
-          {
-            key: 'removeSubmitLimit',
-            label: '取消接口提交限制',
-            icon: 'ibps-icon-minus-square-o',
-            hidden: (data) => {
-              return this.isLimitedEnabled === false || this.$store.getters.isSuper === false || this.isLimited === false
-            }
-          }
-        ],
-        searchForm: {
-          forms: [
-            { prop: 'Q^APP_KEY_^SL', label: '应用标识' },
-            { prop: 'Q^API_KEY_^SL', label: '接口标识' },
-            { prop: 'Q^API_NAME_^SL', label: '接口名称' },
-            { prop: 'Q^API_URI_^SL', label: '接口地址' },
-            { prop: 'Q^SCOPE_^SL', label: '作用域', fieldType: 'slot', slotName: 'scope' },
-            { prop: 'Q^SUBMIT_CTRl_^S', label: '提交限制', fieldType: 'select',
-              options: statusOptions }
-          ]
-        },
-        // 表格字段配置
-        columns: [
-          { prop: 'appKey', label: '应用标识' },
-          { prop: 'apiKey', label: '接口标识' },
-          { prop: 'apiName', label: '接口名称' },
-          { prop: 'apiUri', label: '接口地址' },
-          { prop: 'scope', label: '作用域', slotName: 'scopeColumns' },
-          {
-            prop: 'submitCtrl', label: '提交限制',
-            tags: statusOptions
-          },
-          { prop: 'limit', label: '频次' },
-          { prop: 'testLimit', label: '测试频次' }
-        ],
-        rowHandle: {
-          actions: [{
-            key: 'edit'
-          }, {
-            key: 'remove'
-          }, {
-            key: 'detail'
-          }]
-        }
-      }
-    }
-  },
-  created() {
-    this.loadData()
-    this.constant()
-    if (this.$store.getters.isSuper === true) {
-      this.loadSubmitLimit()
-    }
-  },
-  methods: {
-    constantInfo(...params) {
-      return { ...params }
+    components: {
+        Edit,
+        Import
     },
-    dataConvert(data) {
-      return data.split(',')
-    },
-    loadSubmitLimit() {
-      getSubmitLimit().then(response => {
-        this.isLimited = response.data
-      }).catch(() => {})
-      getSubmitLimitEnabled().then(response => {
-        this.isLimitedEnabled = response.data
-      }).catch(() => {})
-    },
-    toggleSubmitLimit() {
-      if (this.isLimited) {
-        submitLimit({ limit: false }).then(response => {
-          ActionUtils.success('取消接口限制成功')
-          this.isLimited = false
-          this.$router.replace('/refresh')
-        }).catch(() => {
-        })
-      } else {
-        submitLimit({ limit: true }).then(response => {
-          ActionUtils.success('设置接口限制成功')
-          this.isLimited = true
-          this.$router.replace('/refresh')
-        }).catch(() => {
-        })
-      }
-    },
-    constant() {
-      findApiScope().then(response => { this.scopeOptions = response.data }).catch(() => {})
-    },
-    // 加载数据
-    loadData() {
-      this.loading = true
-      queryPageList(this.getSearcFormData()).then(response => {
-        ActionUtils.handleListData(this, response.data)
-        this.loading = false
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 获取格式化参数
-     */
-    getSearcFormData() {
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      params['Q^SCOPE_^SL'] = this.scope
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadData()
-    },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadData()
-    },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadData()
-    },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        case 'add':// 添加
-          this.handleEdit()
-          this.title = '添加接口'
-          break
-        case 'import':// 导入
-          this.title = '接口导入'
-          this.handleImport()
-          break
-        case 'edit':// 编辑
-          ActionUtils.selectedRecord(selection).then((id) => {
-            this.handleEdit(id)
-            this.title = '编辑接口'
-          }).catch(() => { })
-          break
-        case 'detail':// 明细
-          ActionUtils.selectedRecord(selection).then((id) => {
-            this.handleEdit(id, true, true)
-            this.title = '接口明细'
-          }).catch(() => { })
-          break
-        case 'remove':// 删除
-          ActionUtils.removeRecord(selection).then((ids) => {
-            this.handleRemove(ids)
-          }).catch(() => { })
-          break
-        case 'setSubmitLimit':// 设置接口限制
-        case 'removeSubmitLimit':// 取消接口限制
-          this.toggleSubmitLimit()
-          break
-        default:
-          break
-      }
+    filters: {
+        getScopeTypeFilter (scopeType) {
+            const t = getScopeType(scopeType)
+            return t ? t.label : scopeType
+        }
     },
-    /**
-     * 导入
-     */
-    handleImport() {
-      this.importFormVisible = true
+    mixins: [FixHeight],
+    data () {
+        const statusOptions = [{
+            label: '是',
+            value: 'Y'
+        }, {
+            label: '否',
+            value: 'N',
+            type: 'danger'
+        }]
+        return {
+            dialogFormVisible: false, // 弹窗
+            importFormVisible: false,
+            editId: '', // 编辑dialog需要使用
+            readonly: false, // 是否只读
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            title: '',
+            loading: true,
+            isLimitedEnabled: false,
+            isLimited: false,
+            height: document.clientHeight,
+            listData: [],
+            pagination: {},
+            sorts: {},
+            scopeOptions: [],
+            scope: '',
+            listConfig: {
+                toolbars: [
+                    {
+                        key: 'search'
+                    },
+                    {
+                        key: 'import'
+                    },
+                    {
+                        key: 'add'
+                    },
+                    {
+                        key: 'edit'
+                    },
+                    {
+                        key: 'remove'
+                    },
+                    {
+                        key: 'setSubmitLimit',
+                        label: '设置接口提交限制',
+                        icon: 'ibps-icon-plus-square-o',
+                        hidden: (data) => {
+                            return this.isLimitedEnabled === false || this.$store.getters.isSuper === false || this.isLimited === true
+                        }
+                    },
+                    {
+                        key: 'removeSubmitLimit',
+                        label: '取消接口提交限制',
+                        icon: 'ibps-icon-minus-square-o',
+                        hidden: (data) => {
+                            return this.isLimitedEnabled === false || this.$store.getters.isSuper === false || this.isLimited === false
+                        }
+                    }
+                ],
+                searchForm: {
+                    forms: [
+                        { prop: 'Q^APP_KEY_^SL', label: '应用标识' },
+                        { prop: 'Q^API_KEY_^SL', label: '接口标识' },
+                        { prop: 'Q^API_NAME_^SL', label: '接口名称' },
+                        { prop: 'Q^API_URI_^SL', label: '接口地址' },
+                        { prop: 'Q^SCOPE_^SL', label: '作用域', fieldType: 'slot', slotName: 'scope' },
+                        { prop: 'Q^SUBMIT_CTRl_^S', label: '提交限制', fieldType: 'select',
+                            options: statusOptions }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'appKey', label: '应用标识', width: 150 },
+                    { prop: 'apiKey', label: '接口标识', minWidth: 150 },
+                    { prop: 'apiName', label: '接口名称', width: 150 },
+                    { prop: 'apiUri', label: '接口地址', minWidth: 200 },
+                    { prop: 'scope', label: '作用域', slotName: 'scopeColumns', width: 100 },
+                    {
+                        prop: 'submitCtrl', label: '提交限制',
+                        tags: statusOptions,
+                        width: 100
+                    },
+                    { prop: 'limit', label: '频次', width: 80 },
+                    { prop: 'testLimit', label: '测试频次', width: 90 }
+                ],
+                rowHandle: {
+                    actions: [{
+                        key: 'edit'
+                    }, {
+                        key: 'remove'
+                    }, {
+                        key: 'detail'
+                    }]
+                }
+            }
+        }
     },
-    /**
-     * 处理编辑
-     */
-    handleEdit(id = '', readonly = false) {
-      this.editId = id
-      this.readonly = readonly
-      this.dialogFormVisible = true
+    created () {
+        this.loadData()
+        this.constant()
+        if (this.$store.getters.isSuper === true) {
+            this.loadSubmitLimit()
+        }
     },
-    /**
-     * 处理删除
-     */
-    handleRemove(ids) {
-      // 获取数据
-      remove({ authAppApiIds: ids }).then(response => {
-        ActionUtils.removeSuccessMessage()
-        this.search()
-      }).catch(() => {})
+    methods: {
+        constantInfo (...params) {
+            return { ...params }
+        },
+        dataConvert (data) {
+            return data.split(',')
+        },
+        loadSubmitLimit () {
+            getSubmitLimit().then(response => {
+                this.isLimited = response.data
+            }).catch(() => {})
+            getSubmitLimitEnabled().then(response => {
+                this.isLimitedEnabled = response.data
+            }).catch(() => {})
+        },
+        toggleSubmitLimit () {
+            if (this.isLimited) {
+                submitLimit({ limit: false }).then(response => {
+                    ActionUtils.success('取消接口限制成功')
+                    this.isLimited = false
+                    this.$router.replace('/refresh')
+                }).catch(() => {
+                })
+            } else {
+                submitLimit({ limit: true }).then(response => {
+                    ActionUtils.success('设置接口限制成功')
+                    this.isLimited = true
+                    this.$router.replace('/refresh')
+                }).catch(() => {
+                })
+            }
+        },
+        constant () {
+            findApiScope().then(response => { this.scopeOptions = response.data }).catch(() => {})
+        },
+        // 加载数据
+        loadData () {
+            this.loading = true
+            queryPageList(this.getSearcFormData()).then(response => {
+                ActionUtils.handleListData(this, response.data)
+                this.loading = false
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getSearcFormData () {
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            params['Q^SCOPE_^SL'] = this.scope
+            return ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadData()
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadData()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                case 'add':// 添加
+                    this.handleEdit()
+                    this.title = '添加接口'
+                    break
+                case 'import':// 导入
+                    this.title = '接口导入'
+                    this.handleImport()
+                    break
+                case 'edit':// 编辑
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleEdit(id)
+                        this.title = '编辑接口'
+                    }).catch(() => { })
+                    break
+                case 'detail':// 明细
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleEdit(id, true, true)
+                        this.title = '接口明细'
+                    }).catch(() => { })
+                    break
+                case 'remove':// 删除
+                    ActionUtils.removeRecord(selection).then((ids) => {
+                        this.handleRemove(ids)
+                    }).catch(() => { })
+                    break
+                case 'setSubmitLimit':// 设置接口限制
+                case 'removeSubmitLimit':// 取消接口限制
+                    this.toggleSubmitLimit()
+                    break
+                default:
+                    break
+            }
+        },
+        /**
+         * 导入
+         */
+        handleImport () {
+            this.importFormVisible = true
+        },
+        /**
+         * 处理编辑
+         */
+        handleEdit (id = '', readonly = false) {
+            this.editId = id
+            this.readonly = readonly
+            this.dialogFormVisible = true
+        },
+        /**
+         * 处理删除
+         */
+        handleRemove (ids) {
+            // 获取数据
+            remove({ authAppApiIds: ids }).then(response => {
+                ActionUtils.removeSuccessMessage()
+                this.search()
+            }).catch(() => {})
+        }
     }
-  }
 }
 </script>

+ 237 - 228
src/views/platform/bo/boDef/constants/index.js

@@ -1,264 +1,273 @@
 
-const uuid =()=>{
-  return  require('uuid').v1()
+const uuid = () => {
+    return require('uuid').v1()
 }
 
 export const boTypeOptions = [{
-  value: 'object',
-  label: '自建对象',
-  type: 'success'
+    value: 'object',
+    label: '自建对象',
+    type: 'success'
 },
 {
-  value: 'out',
-  label: '外部表',
-  type: 'danger'
+    value: 'out',
+    label: '外部表',
+    type: 'danger'
 }
 ]
 export const createTabelOptions = [
-  {
-    value: 'Y',
-    label: '是'
-  },
-  {
-    value: 'N',
-    label: '否',
-    type: 'danger'
-  }
+    {
+        value: 'Y',
+        label: '是'
+    },
+    {
+        value: 'N',
+        label: '否',
+        type: 'danger'
+    }
 ]
 export const statusOptions = [
-  {
-    value: 'actived',
-    label: '激活',
-    type: 'success'
-  }
+    {
+        value: 'actived',
+        label: '激活',
+        type: 'success'
+    }
 ]
 export const dataFormatOptions = [
-  {
-    value: 'json',
-    label: 'JSON'
-  }
+    {
+        value: 'json',
+        label: 'JSON'
+    }
 ]
 
 export const relationOptions = [
-  // {
-  //   value: 'one2one',
-  //   label: '一对一'
-  // },
-  {
-    value: 'one2many',
-    label: '一对多'
-  }
+    // {
+    //   value: 'one2one',
+    //   label: '一对一'
+    // },
+    {
+        value: 'one2many',
+        label: '一对多'
+    }
 ]
 export const typeOptions = [
-  {
-    value: 'varchar',
-    label: '字符串'
-  },
-  {
-    value: 'number',
-    label: '数字型'
-  },
-  {
-    value: 'date',
-    label: '日期型'
-  },
-  {
-    value: 'clob',
-    label: '大文本'
-  }
+    {
+        value: 'varchar',
+        label: '字符串'
+    },
+    {
+        value: 'number',
+        label: '数字型'
+    },
+    {
+        value: 'date',
+        label: '日期型'
+    },
+    {
+        value: 'clob',
+        label: 'text【最大长度为65,535个字符(约64KB)】'
+    }
 ]
 export const formatOptions = [
-  {
-    value: 'yyyy-MM-dd',
-    label: 'yyyy-MM-dd'
-  },
-  {
-    value: 'yyyy-MM-dd HH:mm:ss',
-    label: 'yyyy-MM-dd HH:mm:ss'
-  },
-  {
-    value: 'yyyyMMddHHmm',
-    label: 'yyyyMMddHHmm'
-  },
-  {
-    value: 'custom',
-    label: '自定义'
-  }
+    {
+        value: 'yyyy-MM-dd',
+        label: 'yyyy-MM-dd'
+    },
+    {
+        value: 'yyyy-MM-dd HH:mm:ss',
+        label: 'yyyy-MM-dd HH:mm:ss'
+    },
+    {
+        value: 'yyyyMMddHHmm',
+        label: 'yyyyMMddHHmm'
+    },
+    {
+        value: 'custom',
+        label: '自定义'
+    }
 ]
 export const struTypeOptions = [
-  {
-    value: 'list',
-    label: '列表'
-  },
-  {
-    value: 'tree',
-    label: '树型'
-  }
+    {
+        value: 'list',
+        label: '列表'
+    },
+    {
+        value: 'tree',
+        label: '树型'
+    }
 ]
 
 export const rootData = [
-  {
-    name: '业务对象根节点',
-    id: '0',
-    subBoDefs: []
-  }
+    {
+        name: '业务对象根节点',
+        id: '0',
+        subBoDefs: []
+    }
 ]
 export const subBoDefsAttrs = {
-  id: uuid(),
-  name: '外键',
-  code: 'parentId',
-  fieldName: 'PARENT_ID_',
-  dataType: 'varchar',
-  attrLength: 64,
-  precision: 0,
-  format: ''
-}
-export const masterAttrs = {
-  type: 'base',
-  updateBy: '',
-  sn: 1,
-  ip: '',
-  dataStatus: '',
-  updateTime: null,
-  defValue: '',
-  defId: '',
-  createOrgId: '',
-  createBy: '',
-  createTime: null,
-  isNull: 'Y',
-  dbtype: '',
-  tenantId: '',
-  pk: '',
-  desc: ''
-}
-
-export const defaultAttrs = [
-  {
-    id: uuid(),
-    name: '主键',
-    code: 'id',
-    fieldName: 'ID_',
-    dataType: 'varchar',
-    attrLength: 64,
-    precision: 0,
-    format: ''
-  }, {
-    id: uuid(),
-    name: '租户ID',
-    code: 'tenantId',
-    fieldName: 'TENANT_ID_',
-    dataType: 'varchar',
-    attrLength: 64,
-    precision: 0,
-    format: ''
-  }, {
-    id: uuid(),
-    name: 'IP地址',
-    code: 'ip',
-    fieldName: 'IP_',
-    dataType: 'varchar',
-    attrLength: 15,
-    precision: 0,
-    format: ''
-  }, {
-    id: uuid(),
-    name: '创建人',
-    code: 'createBy',
-    fieldName: 'CREATE_BY_',
-    dataType: 'varchar',
-    attrLength: 64,
-    precision: 0,
-    format: ''
-  }, {
-    id: uuid(),
-    name: '创建时间',
-    code: 'createTime',
-    fieldName: 'CREATE_TIME_',
-    dataType: 'date',
-    attrLength: 0,
-    precision: 0,
-    format: 'yyyy-MM-dd HH:mm:ss'
-  }, {
     id: uuid(),
-    name: '更新人',
-    code: 'updateBy',
-    fieldName: 'UPDATE_BY_',
+    name: '外键',
+    code: 'parentId',
+    fieldName: 'PARENT_ID_',
     dataType: 'varchar',
     attrLength: 64,
     precision: 0,
     format: ''
-  }, {
-    id: uuid(),
-    name: '更新时间',
-    code: 'updateTime',
-    fieldName: 'UPDATE_TIME_',
-    dataType: 'date',
-    attrLength: 0,
-    precision: 0,
-    format: 'yyyy-MM-dd HH:mm:ss'
-  }, {
-    id: uuid(),
-    name: '是否过审',
-    code: 'shiFouGuoShen',
-    fieldName: 'shi_fou_guo_shen_',
-     dataType: 'varchar',
-     attrLength: 16,
-     precision: 0,
-     format: ''
-  }, {
-    id: uuid(),
-    name: '编制人',
-    code: 'bianZhiRen',
-    fieldName: 'bian_zhi_ren_',
-    dataType: 'varchar',
-    attrLength: 32,
-    precision: 0,
-    format: ''
-  }, {
-    id: uuid(),
-    name: '编制部门',
-    code: 'bianZhiBuMen',
-    fieldName: 'bian_zhi_bu_men_',
-    dataType: 'varchar',
-    attrLength: 32,
-    precision: 0,
-    format: ''
-  }, {
-    id: uuid(),
-    name: '编制时间',
-    code: 'bianZhiShiJian',
-    fieldName: 'bian_zhi_shi_jian',
-    dataType: 'varchar',
-    attrLength: 32,
-    precision: 0,
-    format: ''
-  }
+}
+export const masterAttrs = {
+    type: 'base',
+    updateBy: '',
+    sn: 1,
+    ip: '',
+    dataStatus: '',
+    updateTime: null,
+    defValue: '',
+    defId: '',
+    createOrgId: '',
+    createBy: '',
+    createTime: null,
+    isNull: 'Y',
+    dbtype: '',
+    tenantId: '',
+    pk: '',
+    desc: ''
+}
+
+export const defaultAttrs = [
+    {
+        id: uuid(),
+        name: '主键',
+        code: 'id',
+        fieldName: 'ID_',
+        dataType: 'varchar',
+        attrLength: 64,
+        precision: 0,
+        format: ''
+    }, {
+        id: uuid(),
+        name: '租户ID',
+        code: 'tenantId',
+        fieldName: 'TENANT_ID_',
+        dataType: 'varchar',
+        attrLength: 64,
+        precision: 0,
+        format: ''
+    }, {
+        id: uuid(),
+        name: 'IP地址',
+        code: 'ip',
+        fieldName: 'IP_',
+        dataType: 'varchar',
+        attrLength: 15,
+        precision: 0,
+        format: ''
+    }, {
+        id: uuid(),
+        name: '创建人',
+        code: 'createBy',
+        fieldName: 'CREATE_BY_',
+        dataType: 'varchar',
+        attrLength: 64,
+        precision: 0,
+        format: ''
+    }, {
+        id: uuid(),
+        name: '创建时间',
+        code: 'createTime',
+        fieldName: 'CREATE_TIME_',
+        dataType: 'date',
+        attrLength: 0,
+        precision: 0,
+        format: 'yyyy-MM-dd HH:mm:ss'
+    }, {
+        id: uuid(),
+        name: '更新人',
+        code: 'updateBy',
+        fieldName: 'UPDATE_BY_',
+        dataType: 'varchar',
+        attrLength: 64,
+        precision: 0,
+        format: ''
+    }, {
+        id: uuid(),
+        name: '更新时间',
+        code: 'updateTime',
+        fieldName: 'UPDATE_TIME_',
+        dataType: 'date',
+        attrLength: 0,
+        precision: 0,
+        format: 'yyyy-MM-dd HH:mm:ss'
+    }, {
+        id: uuid(),
+        name: '是否过审',
+        code: 'shiFouGuoShen',
+        fieldName: 'shi_fou_guo_shen_',
+        dataType: 'varchar',
+        attrLength: 16,
+        precision: 0,
+        format: ''
+    }, {
+        id: uuid(),
+        name: '编制人',
+        code: 'bianZhiRen',
+        fieldName: 'bian_zhi_ren_',
+        dataType: 'varchar',
+        attrLength: 32,
+        precision: 0,
+        format: ''
+    }, {
+        id: uuid(),
+        name: '编制部门',
+        code: 'bianZhiBuMen',
+        fieldName: 'bian_zhi_bu_men_',
+        dataType: 'varchar',
+        attrLength: 256,
+        precision: 0,
+        format: ''
+    }, {
+        id: uuid(),
+        name: '编制时间',
+        code: 'bianZhiShiJian',
+        fieldName: 'bian_zhi_shi_jian',
+        dataType: 'varchar',
+        attrLength: 32,
+        precision: 0,
+        format: ''
+    }, {
+        id: uuid(),
+        name: '快照',
+        code: 'kuaiZhao',
+        fieldName: 'kuai_zhao_',
+        dataType: 'varchar',
+        attrLength: 256,
+        precision: 0,
+        format: ''
+    }
 ]
 
 export const objectAttrRootData = {
-  id: '',
-  name: '',
-  code: '',
-  fieldName: '',
-  desc: '',
-  isNull: 'Y',
-  defValue: '',
-  dataType: 'varchar',
-  attrLength: '200',
-  precision: 0,
-  type: '',
-  updateBy: '',
-  sn: 7,
-  ip: '',
-  format: 'yyyy-MM-dd',
-  dataStatus: '',
-  updateTime: null,
-  defId: '',
-  createOrgId: '',
-  createBy: '',
-  createTime: null,
-  dbtype: '',
-  tenantId: '',
-  pk: '',
-  edit: true
+    id: '',
+    name: '',
+    code: '',
+    fieldName: '',
+    desc: '',
+    isNull: 'Y',
+    defValue: '',
+    dataType: 'varchar',
+    attrLength: '200',
+    precision: 0,
+    type: '',
+    updateBy: '',
+    sn: 7,
+    ip: '',
+    format: 'yyyy-MM-dd',
+    dataStatus: '',
+    updateTime: null,
+    defId: '',
+    createOrgId: '',
+    createBy: '',
+    createTime: null,
+    dbtype: '',
+    tenantId: '',
+    pk: '',
+    edit: true
 }

+ 324 - 323
src/views/platform/bo/boDef/edit/detail/object-attr/index.vue

@@ -1,349 +1,350 @@
 <template>
-  <div class="main-container bo-attr">
-    <ibps-crud
-      ref="crud"
-      :data="listData"
-      :toolbars="!isToolbars&&formData.boType!=='out'?listConfig.toolbars:false"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :selection-row="!isToolbars&&formData.boType!=='out'?selectionRow:false"
-      :index-row="false"
-      :reserve-selection="true"
-      :show-pagination="true"
-      :pagination-options="{layout:'slot'}"
-      selection-type="checkbox"
-      row-key="id"
-      @select="handleSelect"
-      @row-click="handleRowClick"
-      @action-event="handleAction"
-    >
-      <template #footer>
-        <span class="el-pagination__total">{{ '共'+ listData.length }}条</span>
-      </template>
-    </ibps-crud>
-    <edit
-      :id="editId"
-      :datas="editData"
-      :title="title"
-      :clear="clear"
-      :is-create-table="formData.isCreateTable"
-      :visible="dialogFormVisible"
-      :readonly="readonly"
-      @callback="callback"
-      @close="visible => dialogFormVisible = visible"
-    />
-  </div>
+    <div class="main-container bo-attr">
+        <ibps-crud
+            ref="crud"
+            :data="listData"
+            :toolbars="!isToolbars&&formData.boType!=='out'?listConfig.toolbars:false"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :selection-row="!isToolbars&&formData.boType!=='out'?selectionRow:false"
+            :index-row="false"
+            :reserve-selection="true"
+            :show-pagination="true"
+            :pagination-options="{layout:'slot'}"
+            selection-type="checkbox"
+            row-key="id"
+            @select="handleSelect"
+            @row-click="handleRowClick"
+            @action-event="handleAction"
+        >
+            <template #footer>
+                <span class="el-pagination__total">{{ '共'+ listData.length }}条</span>
+            </template>
+        </ibps-crud>
+        <edit
+            :id="editId"
+            :datas="editData"
+            :title="title"
+            :clear="clear"
+            :is-create-table="formData.isCreateTable"
+            :visible="dialogFormVisible"
+            :readonly="readonly"
+            @callback="callback"
+            @close="visible => dialogFormVisible = visible"
+        />
+    </div>
 </template>
 
 <script>
-import { typeOptions, defaultAttrs, subBoDefsAttrs,objectAttrRootData } from '../../../constants'
+import { typeOptions, defaultAttrs, subBoDefsAttrs, objectAttrRootData } from '../../../constants'
 import { checkSameNode } from '@/views/platform/bo/boDef/utils'
 import ActionUtils from '@/utils/action'
 import Edit from './edit'
-const uuid =()=>{
-  return  require('uuid').v1()
+const uuid = () => {
+    return require('uuid').v1()
 }
 export default {
-  components: {
-    Edit
-  },
-  props: {
-    id: String,
-    attrs: {
-      type: Array,
-      default: () => []
+    components: {
+        Edit
     },
-    formData: Object,
-    treeData: Array,
-    review: Object,
-    isMain: {
-      type: String,
-      default: 'Y'
+    props: {
+        id: String,
+        attrs: {
+            type: Array,
+            default: () => []
+        },
+        formData: Object,
+        treeData: Array,
+        review: Object,
+        isMain: {
+            type: String,
+            default: 'Y'
+        },
+        toolbars: {
+            type: Boolean,
+            default: false
+        },
+        readonly: {
+            type: Boolean,
+            default: false
+        },
+        height: [String, Number]
     },
-    toolbars: {
-      type: Boolean,
-      default: false
-    },
-    readonly: {
-      type: Boolean,
-      default: false
+    data () {
+        return {
+            dialogFormVisible: false, // 弹窗
+            editId: '', // 编辑dialog需要使用
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            editData: {},
+            defaultData: [],
+            title: '',
+            clear: false,
+            isSame: false,
+            selection: [],
+            selectionRow: {
+                'reserveSelectione': true
+            },
+            listData: this.attrs,
+            pagination: {},
+            isRadio: true,
+            listConfig: {
+                toolbars: [
+                    {
+                        key: 'add'
+                    },
+                    {
+                        key: 'edit'
+                    },
+                    {
+                        key: 'moveUp',
+                        label: '上移',
+                        icon: 'ibps-icon-arrow-circle-up'
+                    },
+                    {
+                        key: 'moveDown',
+                        label: '下移',
+                        icon: 'ibps-icon-arrow-circle-down'
+                    },
+                    {
+                        key: 'remove'
+                    },
+                    {
+                        key: 'reset',
+                        label: '重置',
+                        icon: 'ibps-icon-undo'
+                    }
+                ],
+                searchForm: {},
+                // 表格字段配置
+                columns: [
+                    { prop: 'name', label: '名称', width: 250 },
+                    { prop: 'code', label: '编码', width: 140 },
+                    { prop: 'fieldName', label: '字段', width: 140 },
+                    { prop: 'dataType', label: '属性类型', tags: typeOptions, width: 120 },
+                    { prop: 'attrLength', label: '字段长度', width: 100 },
+                    { prop: 'desc', label: '字段描述', minWidth: 200 }
+                ]
+            }
+        }
     },
-    height: [String, Number]
-  },
-  data() {
-    return {
-      dialogFormVisible: false, // 弹窗
-      editId: '', // 编辑dialog需要使用
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      editData: {},
-      defaultData: [],
-      title: '',
-      clear: false,
-      isSame: false,
-      selection: [],
-      selectionRow: {
-        'reserveSelectione': true
-      },
-      listData: this.attrs,
-      pagination: {},
-      isRadio: true,
-      listConfig: {
-        toolbars: [
-          {
-            key: 'add'
-          },
-          {
-            key: 'edit'
-          },
-          {
-            key: 'moveUp',
-            label: '上移',
-            icon: 'ibps-icon-arrow-circle-up'
-          },
-          {
-            key: 'moveDown',
-            label: '下移',
-            icon: 'ibps-icon-arrow-circle-down'
-          },
-          {
-            key: 'remove'
-          },
-          {
-            key: 'reset',
-            label: '重置',
-            icon: 'ibps-icon-undo'
-          }
-        ],
-        searchForm: {},
-        // 表格字段配置
-        columns: [
-          { prop: 'name', label: '名称' },
-          { prop: 'code', label: '编码' },
-          { prop: 'fieldName', label: '字段' },
-          { prop: 'dataType', label: '属性类型', tags: typeOptions }
-        ]
-      }
-    }
-  },
-  computed: {
-    isToolbars() {
-      return this.toolbars
+    computed: {
+        isToolbars () {
+            return this.toolbars
+        },
+        reviewData () {
+            return this.review
+        }
     },
-    reviewData() {
-      return this.review
-    }
-  },
-  watch: {
-    attrs: {
-      handler: function(val, oldVal) {
-        if (this.$utils.isNotEmpty(this.attrs)) {
-          this.listData = this.attrs
+    watch: {
+        attrs: {
+            handler (val, oldVal) {
+                if (this.$utils.isNotEmpty(this.attrs)) {
+                    this.listData = this.attrs
+                }
+            },
+            deep: true
+        },
+        listData: {
+            handler (val, oldVal) {
+                this.checkNode(this.reviewData, this.treeData)
+                this.$emit('change', this.listData)
+            },
+            deep: true
         }
-      },
-      deep: true
     },
-    listData: {
-      handler: function(val, oldVal) {
-        this.checkNode(this.reviewData, this.treeData)
-        this.$emit('change', this.listData)
-      },
-      deep: true
-    }
-  },
-  methods: {
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'add':// 添加
-          this.handleEdit()
-          this.title = '添加对象属性'
-          break
-        case 'edit':// 编辑
-          ActionUtils.selectedRecord(selection).then((id) => {
-            this.handleEdit(id)
-            this.title = '编辑对象属性'
-          }).catch(() => { })
-          break
-        case 'moveUp':// 上移
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.moveUp(ids)
-          }).catch(() => { })
-          break
-        case 'moveDown':// 下移
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.moveDown(ids)
-          }).catch(() => { })
-          break
-        case 'remove':// 删除
-          ActionUtils.removeRecord(selection, '此操作将删除该数据, 是否确定?').then((id) => {
-            this.handleRemove(id)
-          }).catch(() => {})
-          break
-        case 'reset':// 重置
-          this.$confirm('是否重置到初始属性?', '信息', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }).then(() => {
+    methods: {
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'add':// 添加
+                    this.handleEdit()
+                    this.title = '添加对象属性'
+                    break
+                case 'edit':// 编辑
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleEdit(id)
+                        this.title = '编辑对象属性'
+                    }).catch(() => { })
+                    break
+                case 'moveUp':// 上移
+                    ActionUtils.selectedMultiRecord(selection).then((ids) => {
+                        this.moveUp(ids)
+                    }).catch(() => { })
+                    break
+                case 'moveDown':// 下移
+                    ActionUtils.selectedMultiRecord(selection).then((ids) => {
+                        this.moveDown(ids)
+                    }).catch(() => { })
+                    break
+                case 'remove':// 删除
+                    ActionUtils.removeRecord(selection, '此操作将删除该数据, 是否确定?').then((id) => {
+                        this.handleRemove(id)
+                    }).catch(() => {})
+                    break
+                case 'reset':// 重置
+                    this.$confirm('是否重置到初始属性?', '信息', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning'
+                    }).then(() => {
+                        this.$refs['crud'].clearSelection()
+                        if (this.isMain !== 'Y') {
+                            this.defaultData = JSON.parse(JSON.stringify(defaultAttrs))
+                            this.defaultData.splice(1, 0, subBoDefsAttrs)
+                        } else {
+                            this.defaultData = JSON.parse(JSON.stringify(defaultAttrs))
+                        }
+                        this.listData = JSON.parse(JSON.stringify(this.defaultData))
+                        ActionUtils.success('重置成功!')
+                    }).catch(() => {})
+                    break
+                default:
+                    break
+            }
+        },
+        /**
+         * 编辑回传
+         */
+        handleRowClick (row) {
+            this.editData = row
+        },
+        handleSelect (selection, row) {
+            this.editData = row
+        },
+        /**
+         * 处理添加||编辑
+         */
+        handleEdit (id = '', readonly = false) {
+            this.editId = id
+            const index = this.listData.findIndex(l => this.editId === l.id)
+            this.editData = this.listData[index]
+            this.readonly = readonly
+            this.dialogFormVisible = true
             this.$refs['crud'].clearSelection()
-            if (this.isMain !== 'Y') {
-              this.defaultData = JSON.parse(JSON.stringify(defaultAttrs))
-              this.defaultData.splice(1, 0, subBoDefsAttrs)
+        },
+        // 添加||编辑 数据返回
+        callback (value, buttonKey) {
+            const codeIndex = this.listData.findIndex(i => i.code === value.code)
+            const fieldNameIndex = this.listData.findIndex(i => i.fieldName === value.fieldName)
+            const curIndex = this.listData.findIndex(i => i.id === value.id)
+            this.clear = !!((codeIndex > -1 || fieldNameIndex > -1) && this.editId === '')
+            if (curIndex > -1) {
+                this.listData.splice(curIndex, 1, value)
             } else {
-              this.defaultData = JSON.parse(JSON.stringify(defaultAttrs))
+                if (codeIndex > -1 && this.editId === '') {
+                    ActionUtils.warning('编码【' + value.code + '】已存在')
+                    return
+                }
+                if (fieldNameIndex > -1 && this.editId === '') {
+                    ActionUtils.warning('字段【' + value.fieldName + '】已存在')
+                    return
+                }
+                value.id = uuid()
+                value.sn = this.listData.length + 1
+                this.listData.push(value)
             }
-            this.listData = JSON.parse(JSON.stringify(this.defaultData))
-            ActionUtils.success('重置成功!')
-          }).catch(() => {})
-          break
-        default:
-          break
-      }
-    },
-    /**
-     * 编辑回传
-     */
-    handleRowClick(row) {
-      this.editData = row
-    },
-    handleSelect(selection, row) {
-      this.editData = row
-    },
-    /**
-     * 处理添加||编辑
-     */
-    handleEdit(id = '', readonly = false) {
-      this.editId = id
-      const index = this.listData.findIndex(l => this.editId === l.id)
-      this.editData = this.listData[index]
-      this.readonly = readonly
-      this.dialogFormVisible = true
-      this.$refs['crud'].clearSelection()
-    },
-    // 添加||编辑 数据返回
-    callback(value, buttonKey) {
-      const codeIndex = this.listData.findIndex(i => i.code === value.code)
-      const fieldNameIndex = this.listData.findIndex(i => i.fieldName === value.fieldName)
-      const curIndex = this.listData.findIndex(i => i.id === value.id)
-      this.clear = !!((codeIndex > -1 || fieldNameIndex > -1) && this.editId === '')
-      if (curIndex > -1) {
-        this.listData.splice(curIndex, 1, value)
-      } else {
-        if (codeIndex > -1 && this.editId === '') {
-          ActionUtils.warning('编码【' + value.code + '】已存在')
-          return
-        }
-        if (fieldNameIndex > -1 && this.editId === '') {
-          ActionUtils.warning('字段【' + value.fieldName + '】已存在')
-          return
-        }
-        value.id = uuid()
-        value.sn = this.listData.length + 1
-        this.listData.push(value)
-      }
-      this.$emit('change', this.listData)
-    },
-    filtrationIndex(arr, move) {
-      let indexs = []
-      arr.forEach(a => {
-        this.listData.forEach((l, index) => {
-          if (a === l.id) {
-            indexs.push(index)
-          }
-        })
-      })
-      const compare = function(a, b) {
-        return move === 'moveUp' ? a - b : b - a
-      }
-      indexs = indexs.sort(compare)
-      return indexs
-    },
-    // 上移
-    moveUp(ids) {
-      const arr = ids.split(',')
-      const indexs = this.filtrationIndex(arr, 'moveUp')
-      try {
-        indexs.forEach(i => {
-          if (i === 0) {
-            throw new Error('EndIterative')
-          } else {
-            const upDate = this.listData[i - 1]
-            this.listData.splice(i - 1, 1)
-            this.listData.splice(i, 0, upDate)
-          }
-        })
-      } catch (e) {
-        if (e.message !== 'EndIterative') throw e
-      }
-    },
-    // 下移
-    moveDown(ids) {
-      const arr = ids.split(',')
-      const indexs = this.filtrationIndex(arr, 'moveDown')
-      try {
-        indexs.forEach(i => {
-          if (i === this.listData.length - 1) {
-            throw new Error('EndIterative')
-          } else {
-            const upDate = this.listData[i + 1]
-            this.listData.splice(i + 1, 1)
-            this.listData.splice(i, 0, upDate)
-          }
-        })
-      } catch (e) {
-        if (e.message !== 'EndIterative') throw e
-      }
-    },
-    /**
-     * 处理删除
-     */
-    handleRemove(ids) {
-      const arr = ids.split(',')
-      arr.forEach(a => {
-        this.listData.forEach((i, index) => {
-          if (a === i.id && i.code !== 'createTime') {
-            this.listData.splice(index, 1)
-          } else if (a === i.id && i.code === 'createTime') {
-            this.$message({
-              message: '创建时间不可删除!',
-              type: 'warning'
+            this.$emit('change', this.listData)
+        },
+        filtrationIndex (arr, move) {
+            let indexs = []
+            arr.forEach(a => {
+                this.listData.forEach((l, index) => {
+                    if (a === l.id) {
+                        indexs.push(index)
+                    }
+                })
             })
-          }
-        })
-      })
-      this.clearSelection()
-    },
-    clearSelection() {
-      this.$refs['crud'] ? this.$refs['crud'].clearSelection() : null
-    },
-    callbackListData() {
-      return this.listData
-    },
-    getListData(value) {
-      this.listData = value
-    },
-    checkNode(review, treeData) {
-      this.isSame = checkSameNode(review, treeData)
-      this.$emit('checkNode', this.isSame)
+            const compare = function (a, b) {
+                return move === 'moveUp' ? a - b : b - a
+            }
+            indexs = indexs.sort(compare)
+            return indexs
+        },
+        // 上移
+        moveUp (ids) {
+            const arr = ids.split(',')
+            const indexs = this.filtrationIndex(arr, 'moveUp')
+            try {
+                indexs.forEach(i => {
+                    if (i === 0) {
+                        throw new Error('EndIterative')
+                    } else {
+                        const upDate = this.listData[i - 1]
+                        this.listData.splice(i - 1, 1)
+                        this.listData.splice(i, 0, upDate)
+                    }
+                })
+            } catch (e) {
+                if (e.message !== 'EndIterative') throw e
+            }
+        },
+        // 下移
+        moveDown (ids) {
+            const arr = ids.split(',')
+            const indexs = this.filtrationIndex(arr, 'moveDown')
+            try {
+                indexs.forEach(i => {
+                    if (i === this.listData.length - 1) {
+                        throw new Error('EndIterative')
+                    } else {
+                        const upDate = this.listData[i + 1]
+                        this.listData.splice(i + 1, 1)
+                        this.listData.splice(i, 0, upDate)
+                    }
+                })
+            } catch (e) {
+                if (e.message !== 'EndIterative') throw e
+            }
+        },
+        /**
+         * 处理删除
+         */
+        handleRemove (ids) {
+            const arr = ids.split(',')
+            arr.forEach(a => {
+                this.listData.forEach((i, index) => {
+                    if (a === i.id && i.code !== 'createTime') {
+                        this.listData.splice(index, 1)
+                    } else if (a === i.id && i.code === 'createTime') {
+                        this.$message({
+                            message: '创建时间不可删除!',
+                            type: 'warning'
+                        })
+                    }
+                })
+            })
+            this.clearSelection()
+        },
+        clearSelection () {
+            this.$refs['crud'] ? this.$refs['crud'].clearSelection() : null
+        },
+        callbackListData () {
+            return this.listData
+        },
+        getListData (value) {
+            this.listData = value
+        },
+        checkNode (review, treeData) {
+            this.isSame = checkSameNode(review, treeData)
+            this.$emit('checkNode', this.isSame)
+        }
     }
-  }
 }
 </script>
 <style lang="scss">
 .bo-attr{
-  .el-table{
-    height:  calc(75vh + 12px ) !important;
-  }
-  .toolbar-box{
-    display: none;
-  }
-  .ibps-container-crud__footer{
-    padding-top: 5px;
-    text-align: right;
-  }
+    .el-table{
+        height:  calc(75vh + 12px ) !important;
+    }
+    .toolbar-box{
+        display: none;
+    }
+    .ibps-container-crud__footer{
+        padding-top: 5px;
+        text-align: right;
+    }
 }
-
 </style>

+ 440 - 444
src/views/platform/bo/boDef/list.vue

@@ -1,92 +1,92 @@
 <template>
-  <ibps-layout ref="layout">
-    <div slot="west">
-      <ibps-type-tree
-        :width="width"
-        :height="height"
-        :has-contextmenu="true"
-        category-key="BO_TYPE"
-        title="业务对象分类"
-        @treeData="treeData"
-        @node-click="handleNodeClick"
-        @expand-collapse="handleExpandCollapse"
-      />
-    </div>
-    <ibps-crud
-      ref="crud"
-      :style="{ marginLeft: width+'px' }"
-      :height="height"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :row-handle="listConfig.rowHandle"
-      :pagination="pagination"
-      :loading="loading"
-      :index-row="false"
-      @row-click="handleRowClick"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    >
-    <!--    @column-link-click="handleLinkClick"-->
-      <div slot="versionCount" slot-scope="scope">
-        默认:
-        <el-link type="primary" @click="handleVersion(scope.row.id)">版本({{ scope.row.version }})</el-link>
-        <el-link class="ibps-ml-5" type="primary" @click="handleVersionCount(scope.row.code)">更多版本({{ scope.row.versionCount }})</el-link>
-      </div>
-    </ibps-crud>
-    <!-- 添加编辑明细 -->
-    <edit
-      :id="editId"
-      :code="code"
-      :type-id="typeId"
-      :visible="dialogFormVisible"
-      :readonly="readonly"
-      title="业务对象添加"
-      @callback="search"
-      @close="visible => dialogFormVisible = visible"
-    />
-    <!-- 设置分类 -->
-    <setting-type
-      :visible="settingTypeFormVisible"
-      title="设置业务对象分类"
-      category-key="BO_TYPE"
-      @save="saveSettingType"
-      @close="visible => settingTypeFormVisible = visible"
-    />
-    <!-- 导入 -->
-    <import-bo
-      :id="editId"
-      :visible="importFormVisible"
-      @callback="search"
-      @close="visible => importFormVisible = visible"
-    />
-    <!-- 导出 -->
-    <export-bo
-      :id="editId"
-      title="导出业务对象数据配置"
-      :visible="exportVisible"
-      @callback="search"
-      @close="visible => exportVisible = visible"
-    />
-    <!-- 更多版本 -->
-    <more-versions
-      :code="code"
-      :visible="versionsFormVisible"
-      @callback="search"
-      @close="visible => versionsFormVisible = visible"
-    />
-    <!-- 复制 -->
-    <copy
-      :id="editId"
-      :copy-data="copyData"
-      :visible="copyFormVisible"
-      @callback="search"
-      @close="visible => copyFormVisible = visible"
-    />
-  </ibps-layout>
+    <ibps-layout ref="layout">
+        <div slot="west">
+            <ibps-type-tree
+                :width="width"
+                :height="height"
+                :has-contextmenu="true"
+                category-key="BO_TYPE"
+                title="业务对象分类"
+                @treeData="treeData"
+                @node-click="handleNodeClick"
+                @expand-collapse="handleExpandCollapse"
+            />
+        </div>
+        <ibps-crud
+            ref="crud"
+            :style="{ marginLeft: width+'px' }"
+            :height="height"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :row-handle="listConfig.rowHandle"
+            :pagination="pagination"
+            :loading="loading"
+            :index-row="false"
+            @row-click="handleRowClick"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        >
+            <!-- @column-link-click="handleLinkClick"-->
+            <div slot="versionCount" slot-scope="scope">
+                默认:
+                <el-link type="primary" @click="handleVersion(scope.row.id)">版本({{ scope.row.version }})</el-link>
+                <el-link class="ibps-ml-5" type="primary" @click="handleVersionCount(scope.row.code)">更多版本({{ scope.row.versionCount }})</el-link>
+            </div>
+        </ibps-crud>
+        <!-- 添加编辑明细 -->
+        <edit
+            :id="editId"
+            :code="code"
+            :type-id="typeId"
+            :visible="dialogFormVisible"
+            :readonly="readonly"
+            title="业务对象添加"
+            @callback="search"
+            @close="visible => dialogFormVisible = visible"
+        />
+        <!-- 设置分类 -->
+        <setting-type
+            :visible="settingTypeFormVisible"
+            title="设置业务对象分类"
+            category-key="BO_TYPE"
+            @save="saveSettingType"
+            @close="visible => settingTypeFormVisible = visible"
+        />
+        <!-- 导入 -->
+        <import-bo
+            :id="editId"
+            :visible="importFormVisible"
+            @callback="search"
+            @close="visible => importFormVisible = visible"
+        />
+        <!-- 导出 -->
+        <export-bo
+            :id="editId"
+            title="导出业务对象数据配置"
+            :visible="exportVisible"
+            @callback="search"
+            @close="visible => exportVisible = visible"
+        />
+        <!-- 更多版本 -->
+        <more-versions
+            :code="code"
+            :visible="versionsFormVisible"
+            @callback="search"
+            @close="visible => versionsFormVisible = visible"
+        />
+        <!-- 复制 -->
+        <copy
+            :id="editId"
+            :copy-data="copyData"
+            :visible="copyFormVisible"
+            @callback="search"
+            @close="visible => copyFormVisible = visible"
+        />
+    </ibps-layout>
 </template>
 <script>
 import { queryPageList, remove, synBoTable, genBoTable, setCategory, exportFile, getTableProfix } from '@/api/platform/bo/boDef'
@@ -104,370 +104,366 @@ import exportBo from './export'
 import MoreVersions from './more-versions'
 
 export default {
-  components: {
-    IbpsTypeTree,
-    SettingType,
-    MoreVersions,
-    Edit,
-    exportBo,
-    importBo,
-    Copy
-  },
-  mixins: [FixHeight],
-  data() {
-    return {
-      width: 200,
-      height: document.clientHeight,
-      settingTypeFormVisible: false, // 弹窗
-      dialogFormVisible: false,
-      versionsFormVisible: false,
-      importFormVisible: false,
-      exportVisible: false,
-      copyFormVisible: false,
-      readonly: false,
-      editId: '', // 编辑dialog需要使用
-      code: '',
-      typeId: '',
-      prefix: '',
-      copyData: {},
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      loading: false,
-      listData: [],
-      typeFiler:[],//类型过滤
-      listConfig: {
-        // 工具栏
-        toolbars: [
-          { key: 'search' },
-          { key: 'add' },
-          { key: 'edit' },
-          { key: 'remove' },
-          {
-            key: 'setCategory',
-            label: '设置分类',
-            icon: 'ibps-icon-cog'
-          },
-          {
-            key: 'export'
-          },
-          {
-            key: 'import'
-          }
-        ],
-        // 查询条件
-        searchForm: {
-          forms: [
-            { prop: 'Q^NAME_^SL', label: '名称' },
-            { prop: 'Q^CODE_^SL', label: '编码' },
-           /* {
-              prop: 'Q^IS_CREATE_TABLE_^S',
-              label: '是否生成表',
-              fieldType: 'select',
-              options: createTabelOptions
-            } */
-          ]
-        },
-        // 表格字段配置
-        columns: [
-          { prop: 'name', label: '名称', width: 150 },
-          { prop: 'code', label: '编码', width: 150 },
-          { prop: 'versionCount', label: '版本信息', fieldType: 'slot', slotName: 'versionCount' },
-          {prop:'typeId',label:'归分类型', width: 120 },
-          { prop: 'status', label: '状态', width: 100, tags: statusOptions },
-          { prop: 'boType', label: '对象类型', width: 100, tags: boTypeOptions },
-          { prop: 'isCreateTable', label: '生成表', tags: createTabelOptions, width: 80 }
-        ],
-        // 管理列
-        rowHandle: {
-          actions: [
-            {
-              key: 'genBoTable',
-              label: '生成表',
-              icon: 'ibps-icon-cog',
-              hidden: (row, index) => {
-                return !(row.boType === 'object' && row.isCreateTable === 'N')
-              }
-            },
-            {
-              key: 'synBoTable',
-              label: '同步表结构',
-              icon: 'ibps-icon-exchange',
-              hidden: (row, index) => {
-                return row.boType !== 'out'
-              }
-            },
-            {
-              key: 'copy',
-              label: '复制',
-              icon: 'ibps-icon-copy',
-              hidden: (row, index) => {
-                return row.boType === 'out'
-              }
+    components: {
+        IbpsTypeTree,
+        SettingType,
+        MoreVersions,
+        Edit,
+        exportBo,
+        importBo,
+        Copy
+    },
+    mixins: [FixHeight],
+    data () {
+        return {
+            width: 200,
+            height: document.clientHeight,
+            settingTypeFormVisible: false, // 弹窗
+            dialogFormVisible: false,
+            versionsFormVisible: false,
+            importFormVisible: false,
+            exportVisible: false,
+            copyFormVisible: false,
+            readonly: false,
+            editId: '', // 编辑dialog需要使用
+            code: '',
+            typeId: '',
+            prefix: '',
+            copyData: {},
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            loading: false,
+            listData: [],
+            typeFiler: [], // 类型过滤
+            listConfig: {
+                // 工具栏
+                toolbars: [
+                    { key: 'search' },
+                    { key: 'add' },
+                    { key: 'edit' },
+                    { key: 'remove' },
+                    {
+                        key: 'setCategory',
+                        label: '设置分类',
+                        icon: 'ibps-icon-cog'
+                    },
+                    {
+                        key: 'export'
+                    },
+                    {
+                        key: 'import'
+                    }
+                ],
+                // 查询条件
+                searchForm: {
+                    forms: [
+                        { prop: 'Q^NAME_^SL', label: '名称' },
+                        { prop: 'Q^CODE_^SL', label: '编码' }
+                        // {
+                        //     prop: 'Q^IS_CREATE_TABLE_^S',
+                        //     label: '是否生成表',
+                        //     fieldType: 'select',
+                        //     options: createTabelOptions
+                        // }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'name', label: '名称', sortable: true, minWidth: 200 },
+                    { prop: 'code', label: '编码', sortable: true, width: 100 },
+                    { prop: 'versionCount', label: '版本信息', fieldType: 'slot', slotName: 'versionCount', width: 180 },
+                    { prop: 'typeId', label: '归分类型', sortable: true, width: 120 },
+                    { prop: 'status', label: '状态', sortable: true, width: 80, tags: statusOptions },
+                    { prop: 'boType', label: '对象类型', sortable: true, width: 100, tags: boTypeOptions },
+                    { prop: 'isCreateTable', label: '生成表', sortable: true, tags: createTabelOptions, width: 80 },
+                    { prop: 'createTime', label: '创建时间', sortable: true, width: 150 }
+                ],
+                // 管理列
+                rowHandle: {
+                    actions: [
+                        {
+                            key: 'genBoTable',
+                            label: '生成表',
+                            icon: 'ibps-icon-cog',
+                            hidden: (row, index) => {
+                                return !(row.boType === 'object' && row.isCreateTable === 'N')
+                            }
+                        },
+                        {
+                            key: 'synBoTable',
+                            label: '同步表结构',
+                            icon: 'ibps-icon-exchange'
+                            //   hidden: (row, index) => {
+                            //     return row.boType === 'out'
+                            //   }
+                        },
+                        {
+                            key: 'copy',
+                            label: '复制',
+                            icon: 'ibps-icon-copy',
+                            hidden: (row, index) => {
+                                return row.boType === 'out'
+                            }
+                        },
+                        { key: 'edit' },
+                        { key: 'remove' },
+                        { key: 'detail' }
+                    ]
+                }
             },
-            { key: 'edit' },
-            { key: 'remove' },
-            { key: 'detail' }
-          ]
-        }
-      },
-      pagination: {},
-      sorts: {}
-
-    }
-  },
-  created() {
-    this.loadData()
-  },
-  methods: {
-    /**
-     * 加载数据
-     */
-    loadData(id = '') {
-      this.loading = true
-      queryPageList(this.getFormatParams(id)).then(response => {
-            response.data.dataResult.forEach((item)=>{
-              if(item.typeId && this.typeFiler.length>0){
-                  this.typeFiler.forEach((val)=>{
-                         if(item.typeId == val.id){
-                              item.typeId = val.name
-                               return
-                           }
-                      })
-                  }else{
-                   item.typeId = item.typeId ? '已分类': '未分类'
-                  }
-                })
-        ActionUtils.handleListData(this, response.data)
-        this.loading = false
-      }).catch(() => {
-        this.loading = false
-      })
+            pagination: {},
+            sorts: {}
 
+        }
     },
-    /**
-     * 获取格式化参数
-     */
-    getFormatParams() {
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      params['Q^TYPE_ID_^S'] = this.typeId
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadData()
-    },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadData()
-    },
-    search() {
-      this.loadData()
-    },
-    /**
-     * 设置分类
-     */
-    handleSetCategory(editId) {
-      this.editId = editId || ''
-      this.settingTypeFormVisible = true
-    },
-    /**
-     * 保存分类
-     */
-    saveSettingType(typeId) {
-      setCategory({
-        boDefIds: this.editId,
-        typeId: typeId
-      }).then(response => {
-        ActionUtils.successMessage('保存成功')
-        this.settingTypeFormVisible = false
-        this.search()
-      }).catch((err) => {
-        console.error(err)
-      })
-    },
-    /**
-     * 添加
-     */
-    handleEdit(editId = '', readonly = false) {
-      this.editId = editId || ''
-      this.readonly = readonly
-      this.dialogFormVisible = true
-    },
-    /**
-     * 更多版本
-     */
-    handleVersions(code = '') {
-      this.code = code || ''
-      this.versionsFormVisible = true
-    },
-    // 获取code
-    handleRowClick(row, event, column) {
-      this.code = row.code
-    },
-    /**
-     * 点击表格
-     */
-   /* handleLinkClick(data, columns) {
-      console.log(data.id)
-    }, */
-    /**
-     * 复制
-     */
-    handleCopy(editId = '') {
-      this.editId = editId || ''
-      this.copyFormVisible = true
-    },
-    /* 左侧列表参数*/
-    treeData(data){
-      this.typeFiler = data
+    created () {
+        this.loadData()
     },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        case 'add':// 添加
-          this.handleEdit()
-          break
-        case 'edit': // 编辑
-          ActionUtils.selectedRecord(selection).then((id) => {
-            this.handleEdit(id)
-            this.code = data.code
-          }).catch(() => { })
-          break
-        case 'remove': // 删除
-          ActionUtils.removeRecord(selection).then((ids) => {
-            this.handleRemove(ids)
-          }).catch(() => { })
-          break
-        case 'detail': // 明细
-          ActionUtils.selectedRecord(selection).then((ids) => {
-            this.handleEdit(ids, true)
-          }).catch(() => { })
-          break
-        case 'setCategory': // 设置分类
-          ActionUtils.selectedMultiRecord(selection).then((id) => {
-            this.handleSetCategory(id)
-          }).catch(() => { })
-          break
-        case 'export': // 导出
-          ActionUtils.selectedMultiRecord(selection).then((ids) => {
-            this.handleExport(ids)
-          }).catch(() => { })
-          break
-        case 'import': // 导入
-          this.handleImport()
-          break
-        case 'copy': // 复制
-          ActionUtils.selectedRecord(selection).then((id) => {
-            this.handleCopy(id)
-            this.copyData = data
-          }).catch(() => { })
-          break
-        case 'genBoTable': // 生成表
-          getTableProfix().then(res => {
-            ActionUtils.selectedRecord(selection).then((id) => {
-              this.$confirm('确定生成表吗?表名自动添加【' + res.data + '】业务前缀。', '消息', {
+    methods: {
+        /**
+         * 加载数据
+         */
+        loadData (id = '') {
+            this.loading = true
+            queryPageList(this.getFormatParams(id)).then(response => {
+                response.data.dataResult.forEach((item) => {
+                    if (item.typeId && this.typeFiler.length) {
+                        const temp = this.typeFiler.find(i => i.id === item.typeId)
+                        item.typeId = temp ? temp.name : '未分类'
+                    } else {
+                        item.typeId = item.typeId ? '分类被删除' : '未分类'
+                    }
+                })
+                ActionUtils.handleListData(this, response.data)
+                this.loading = false
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getFormatParams () {
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            params['Q^TYPE_ID_^S'] = this.typeId
+            return ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadData()
+        },
+        search () {
+            this.loadData()
+        },
+        /**
+         * 设置分类
+         */
+        handleSetCategory (editId) {
+            this.editId = editId || ''
+            this.settingTypeFormVisible = true
+        },
+        /**
+         * 保存分类
+         */
+        saveSettingType (typeId) {
+            setCategory({
+                boDefIds: this.editId,
+                typeId: typeId
+            }).then(response => {
+                ActionUtils.successMessage('保存成功')
+                this.settingTypeFormVisible = false
+                this.search()
+            }).catch((err) => {
+                console.error(err)
+            })
+        },
+        /**
+         * 添加
+         */
+        handleEdit (editId = '', readonly = false) {
+            this.editId = editId || ''
+            this.readonly = readonly
+            this.dialogFormVisible = true
+        },
+        /**
+         * 更多版本
+         */
+        handleVersions (code = '') {
+            this.code = code || ''
+            this.versionsFormVisible = true
+        },
+        // 获取code
+        handleRowClick (row, event, column) {
+            this.code = row.code
+        },
+        /**
+         * 点击表格
+         */
+        // handleLinkClick (data, columns) {
+        //     console.log(data.id)
+        // },
+        /**
+         * 复制
+         */
+        handleCopy (editId = '') {
+            this.editId = editId || ''
+            this.copyFormVisible = true
+        },
+        /* 左侧列表参数*/
+        treeData (data) {
+            this.typeFiler = data
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                case 'add':// 添加
+                    this.handleEdit()
+                    break
+                case 'edit': // 编辑
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleEdit(id)
+                        this.code = data.code
+                    }).catch(() => { })
+                    break
+                case 'remove': // 删除
+                    ActionUtils.removeRecord(selection).then((ids) => {
+                        this.handleRemove(ids)
+                    }).catch(() => { })
+                    break
+                case 'detail': // 明细
+                    ActionUtils.selectedRecord(selection).then((ids) => {
+                        this.handleEdit(ids, true)
+                    }).catch(() => { })
+                    break
+                case 'setCategory': // 设置分类
+                    ActionUtils.selectedMultiRecord(selection).then((id) => {
+                        this.handleSetCategory(id)
+                    }).catch(() => { })
+                    break
+                case 'export': // 导出
+                    ActionUtils.selectedMultiRecord(selection).then((ids) => {
+                        this.handleExport(ids)
+                    }).catch(() => { })
+                    break
+                case 'import': // 导入
+                    this.handleImport()
+                    break
+                case 'copy': // 复制
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleCopy(id)
+                        this.copyData = data
+                    }).catch(() => { })
+                    break
+                case 'genBoTable': // 生成表
+                    getTableProfix().then(res => {
+                        ActionUtils.selectedRecord(selection).then((id) => {
+                            this.$confirm('确定生成表吗?表名自动添加【' + res.data + '】业务前缀。', '消息', {
+                                confirmButtonText: '确定',
+                                cancelButtonText: '取消',
+                                type: 'warning'
+                            }).then(() => {
+                                this.handleGenBoTable(id)
+                                ActionUtils.success('生成表成功!')
+                            }).catch(() => {})
+                        }).catch(() => { })
+                    })
+                    break
+                case 'synBoTable': // 同步表结构
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.$confirm('是否同步表结构?', '消息', {
+                            confirmButtonText: '确定',
+                            cancelButtonText: '取消',
+                            type: 'warning'
+                        }).then(() => {
+                            this.handlesynBoTable(id)
+                        }).catch(() => {})
+                    }).catch(() => {})
+                    break
+                default:
+                    break
+            }
+        },
+        handleExport (ids) {
+            this.$confirm('是否进一步配置导出数据?否,则直接导出当前业务对象。', '业务导出', {
                 confirmButtonText: '确定',
                 cancelButtonText: '取消',
                 type: 'warning'
-              }).then(() => {
-                this.handleGenBoTable(id)
-                ActionUtils.success('生成表成功!')
-              }).catch(() => {})
-            }).catch(() => { })
-          })
-          break
-        case 'synBoTable': // 同步表结构
-          ActionUtils.selectedRecord(selection).then((id) => {
-            this.$confirm('是否同步表结构?', '消息', {
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning'
             }).then(() => {
-              this.handlesynBoTable(id)
-            }).catch(() => {})
-          }).catch(() => {})
-          break
-        default:
-          break
-      }
-    },
-    handleExport(ids) {
-      this.$confirm('是否进一步配置导出数据?否,则直接导出当前业务对象。', '业务导出', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.editId = ids
-        this.exportVisible = true
-      }).catch(() => {
-        exportFile({ boDefIds: ids }).then((response) => {
-          if (!response) {
-            return
-          }
-          ActionUtils.exportFile(
-            response.data,
-            'boDef_' + fecha.formatDate('yyyyMMddHHmmss') + '.zip'
-          )
-        })
-      })
-    },
-    handleImport() {
-      this.importFormVisible = true
-    },
-    handleRemove(id) {
-      remove({
-        boDefIds: id,
-        rmType: 'all',
-        clean: true
-      }).then(response => {
-        this.loadData()
-      })
-    },
-    handlesynBoTable(id) {
-      synBoTable({
-        boDefId: id
-      }).then(response => {
-        this.$message({
-          type: 'success',
-          message: '同步外部数据表结构成功!'
-        })
-        this.loadData()
-      })
-    },
-    handleGenBoTable(id) {
-      genBoTable({
-        boDefId: id
-      }).then(response => {
-        this.loadData()
-      })
-    },
-    handleVersion(id) {
-      this.handleEdit(id, true)
-    },
-    handleVersionCount(code) {
-      this.handleVersions(code)
-    },
-    handleNodeClick(id) {
-      this.typeId = id
-      this.loadData(id)
-    },
-    handleExpandCollapse(isExpand) {
-      this.width = isExpand ? 230 : 30
+                this.editId = ids
+                this.exportVisible = true
+            }).catch(() => {
+                exportFile({ boDefIds: ids }).then((response) => {
+                    if (!response) {
+                        return
+                    }
+                    ActionUtils.exportFile(
+                        response.data,
+                        'boDef_' + fecha.formatDate('yyyyMMddHHmmss') + '.zip'
+                    )
+                })
+            })
+        },
+        handleImport () {
+            this.importFormVisible = true
+        },
+        handleRemove (id) {
+            remove({
+                boDefIds: id,
+                rmType: 'all',
+                clean: true
+            }).then(response => {
+                this.loadData()
+            })
+        },
+        handlesynBoTable (id) {
+            synBoTable({
+                boDefId: id
+            }).then(response => {
+                this.$message({
+                    type: 'success',
+                    message: '同步外部数据表结构成功!'
+                })
+                this.loadData()
+            })
+        },
+        handleGenBoTable (id) {
+            genBoTable({
+                boDefId: id
+            }).then(response => {
+                this.loadData()
+            })
+        },
+        handleVersion (id) {
+            this.handleEdit(id, true)
+        },
+        handleVersionCount (code) {
+            this.handleVersions(code)
+        },
+        handleNodeClick (id) {
+            this.typeId = id
+            this.loadData(id)
+        },
+        handleExpandCollapse (isExpand) {
+            this.width = isExpand ? 230 : 30
+        }
     }
-  }
 }
 </script>

+ 18 - 18
src/views/platform/bpmn/bpmDef/list.vue

@@ -170,33 +170,34 @@ export default {
           forms: [
             { prop: 'Q^name_^SL', label: '名称', width: 150 },
             { prop: 'Q^def_key_^SL', label: '业务主键', width: 150 },
-            /* {
-              prop: 'Q^status_^S',
-              label: '流程状态',
-              fieldType: 'select',
-              options: statusOptions
-            },
-            {
-              prop: 'Q^test_status_^S',
-              label: '测试状态',
-              fieldType: 'select',
-              options: testStatusOptions
-            },
+            // {
+            //   prop: 'Q^status_^S',
+            //   label: '流程状态',
+            //   fieldType: 'select',
+            //   options: statusOptions
+            // },
+            // {
+            //   prop: 'Q^test_status_^S',
+            //   label: '测试状态',
+            //   fieldType: 'select',
+            //   options: testStatusOptions
+            // },
             {
               prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'],
               label: '创建时间',
               fieldType: 'daterange'
-            } */
+            }
           ]
         },
         // 表格字段配置
         columns: [
-          { prop: 'name', label: '流程名称', slotName: 'defName' },
-          { prop: 'defKey', label: '流程业务主键', width: 150 },
+          { prop: 'name', label: '流程名称', slotName: 'defName', sortable: true, minWidth: 200 },
+          { prop: 'defKey', label: '流程业务主键', width: 120, sortable: true },
           { prop: 'status', label: '流程状态', tags: statusOptions, width: 90 },
           { prop: 'testStatus', label: '测试状态', tags: testStatusOptions, width: 90 },
-          { prop: 'updateTime', label: '更新时间', width: 150 },
-          { prop: 'version', label: '版本号', width: 90 }
+          { prop: 'createTime', label: '创建时间', width: 140, sortable: true },
+          { prop: 'updateTime', label: '更新时间', width: 140, sortable: true },
+          { prop: 'version', label: '版本号', width: 80, sortable: true }
         ],
         rowHandle: {
           actions: [
@@ -456,7 +457,6 @@ export default {
         console.error(err)
       })
     }
-
   }
 }
 </script>

+ 12 - 3
src/views/platform/bpmn/bpmTask/list.vue

@@ -131,6 +131,10 @@
                                 prop: 'Q^subject_^SL',
                                 label: '请求标题'
                             },
+                            {
+                                prop: 'Q^proc_def_key_^SL',
+                                label: '业务主键'
+                            },
                             {
                                 prop: 'Q^NAME_^SL',
                                 label: '当前节点'
@@ -149,21 +153,26 @@
                             label: '请求标题',
                             link: 'dialog'
                         },
+                        {
+                            prop: 'procDefKey',
+                            label: '业务主键',
+                            width: 120
+                        },
                         {
                             prop: 'name',
                             label: '当前节点',
-                            width: 200
+                            width: 120
                         },
                         {
                             prop: 'ownerName',
                             label: '候选人',
-                            width: 200,
+                            width: 150,
                             headerName: 'headerIcon'
                         },
                         {
                             prop: 'partyTypeName',
                             label: '候选人范围',
-                            width: 200
+                            width: 150
                         },
                         {
                             prop: 'createTime',