Просмотр исходного кода

修复数据模板归档切换异常bug

cfort 2 лет назад
Родитель
Сommit
220cf0bf3d

+ 1 - 1
src/business/platform/data/constants/buttons.js

@@ -82,7 +82,7 @@ const buttons = {
         label: '导出模板',
         type: 'primary',
         icon: 'ibps-icon-export',
-        scope: ['toolbar'],
+        scope: ['toolbar']
     },
     'openTask': {
         label: '编制',

+ 2 - 3
src/business/platform/file/attachment/index.vue

@@ -190,7 +190,6 @@ export default {
         }
     },
     data () {
-        console.log(this.value)
         return {
             fileList: [],
             targetExt: false,
@@ -358,8 +357,8 @@ export default {
         },
         updateSort ({ to, from, item, clone, oldIndex, newlndex }) {
             // console.log(to, from, item, clone, oldIndex, newlndex)
-            console.log(this.value)
-            console.log(this.sortList)
+            // console.log(this.value)
+            // console.log(this.sortList)
         }
     }
 }

+ 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>

+ 4 - 1
src/views/platform/bpmn/bpmInstHis/list.vue

@@ -11,7 +11,7 @@
                 @expand-collapse="handleExpandCollapse"
             />
         </div>
-        <template-list v-if="templateData.templateid_" :template-data="templateData" />
+        <template-list v-if="templateShow" :template-data="templateData" />
         <ibps-crud
             v-else
             ref="crud"
@@ -221,6 +221,7 @@ export default {
                 process: [],
                 template: []
             },
+            templateShow: false,
             templateData: {},
             listData: [],
             pagination: {},
@@ -599,8 +600,10 @@ export default {
             this.typeId = typeId
             this.templateData = this.reportAll.template.find(i => i.fen_lei_id_ === typeId) || {}
             if (!this.templateData.templateid_) {
+                this.templateShow = false
                 this.loadData()
             } else {
+                this.templateShow = true
                 this.templateData.typeId = typeId
                 this.templateData.typeName = typeName.name
             }

+ 9 - 4
src/views/platform/bpmn/bpmInstHis/templateList.vue

@@ -1,7 +1,6 @@
 <template>
     <div class="template-container">
         <template-list
-            v-if="templateId"
             :template-id="templateId"
             :dynamic-params="dynamicParams"
             :filter-params="filterParams"
@@ -24,8 +23,6 @@ export default {
     },
     data () {
         const { templateid_, guo_lv_can_shu_, typeName } = this.templateData
-        console.log(guo_lv_can_shu_)
-        console.log(JSON.parse(guo_lv_can_shu_))
         return {
             typeName,
             templateId: templateid_,
@@ -33,8 +30,16 @@ export default {
             dynamicParams: {}
         }
     },
+    watch: {
+        templateData (v) {
+            const { templateid_, guo_lv_can_shu_, typeName } = v
+            this.typeName = typeName
+            this.templateId = templateid_
+            this.filterParams = guo_lv_can_shu_ ? JSON.parse(guo_lv_can_shu_) : []
+        }
+    }
     // methods: {
-        
+
     // }
 }
 </script>

+ 9 - 9
src/views/platform/data/dataTemplate/template-list.vue

@@ -70,16 +70,16 @@ export default {
             },
             deep: true,
             immediate: true
+        },
+        templateId: {
+            handler (val) {
+                if (this.$utils.isNotEmpty(val)) {
+                    this.dataTemplateId = val
+                    this.loadDataTemplate()
+                }
+            },
+            immediate: true
         }
-        // templateId: {
-        //     handler (val) {
-        //         if (this.$utils.isNotEmpty(val)) {
-        //             this.dataTemplateId = val
-        //             this.loadDataTemplate()
-        //         }
-        //     },
-        //     immediate: true
-        // }
     },
     // created () {
     //     this.loadDataTemplate()