¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="APIåç±»"> |
| | | <j-search-select-tag |
| | | placeholder="è¯·éæ©APIåç±»" |
| | | v-model="queryParam.apiCategory" |
| | | dict="api_log_category" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æ¥å£åç§°"> |
| | | <j-input placeholder="请è¾å
¥æ¥å£åç§°" v-model="queryParam.apiName"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a |
| | | style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :scroll="{ x: 200 }" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | |
| | | <!-- 表ååºå --> |
| | | <sysApiLog-modal ref="modalForm" @ok="modalFormOk"></sysApiLog-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import '@/assets/less/TableExpand.less' |
| | | import SysApiLogModal from './modules/SysApiLogModal' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'SysApiLogList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | SysApiLogModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'ç³»ç»ç¬¬ä¸æ¹éææ¥å£æ¥å¿ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | title: 'APIåç±»', |
| | | align: 'center', |
| | | dataIndex: 'apiCategory', |
| | | fixed: 'left', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'æ¥å£åç§°', |
| | | align: 'center', |
| | | dataIndex: 'apiName', |
| | | fixed: 'left', |
| | | width: 200, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: 'è¯·æ±æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'requestTime', |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: 'ååºæ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'responseTime', |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: 'è¯·æ±æ¹å¼', |
| | | align: 'center', |
| | | dataIndex: 'requestMethod', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: '请æ±URL', |
| | | align: 'center', |
| | | dataIndex: 'requestUrl', |
| | | width: 200, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: '请æ±å¤´', |
| | | align: 'center', |
| | | dataIndex: 'requestHeaders', |
| | | width: 200, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: '请æ±ä½', |
| | | align: 'center', |
| | | dataIndex: 'requestBody', |
| | | width: 200, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: 'ååºç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'responseCode', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'ååºæ¶æ¯', |
| | | align: 'center', |
| | | dataIndex: 'responseMessage', |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: 'ååºä½', |
| | | align: 'center', |
| | | dataIndex: 'responseBody', |
| | | width: 200, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'requestStatus', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'è°ç¨æ¹æ³', |
| | | align: 'center', |
| | | dataIndex: 'method', |
| | | width: 200, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' }, |
| | | fixed: 'right', |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/system/sysApiLog/list', |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | fullscreen |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="apiCategory" label="APIåç±»"> |
| | | <a-input v-model="model.apiCategory" readonly /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="apiName" label="æ¥å£åç§°"> |
| | | <a-input v-model="model.apiName" readonly /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="requestTime" label="è¯·æ±æ¶é´"> |
| | | <a-input v-model="model.requestTime" readonly /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="responseTime" label="ååºæ¶é´"> |
| | | <a-input v-model="model.responseTime" readonly /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="requestMethod" label="è¯·æ±æ¹å¼"> |
| | | <a-input v-model="model.requestMethod" readonly /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="requestStatus" label="请æ±ç¶æ"> |
| | | <a-input v-model="model.requestStatus" readonly /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="responseCode" label="ååºç¼ç "> |
| | | <a-input v-model="model.responseCode" readonly /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="responseMessage" label="ååºæ¶æ¯"> |
| | | <a-input v-model="model.responseMessage" readonly /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row> |
| | | <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="requestUrl" |
| | | label="请æ±URL"> |
| | | <a-textarea v-model="model.requestUrl" :rows="1" readonly /> |
| | | </a-form-model-item> |
| | | </a-row> |
| | | <a-row> |
| | | <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="requestHeaders" label="请æ±å¤´"> |
| | | <a-textarea v-model="model.requestHeaders" :rows="2" readonly /> |
| | | </a-form-model-item> |
| | | </a-row> |
| | | <a-row> |
| | | <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="requestBody" label="请æ±ä½"> |
| | | <a-textarea v-model="model.requestBody" :rows="4" readonly /> |
| | | </a-form-model-item> |
| | | </a-row> |
| | | <a-row> |
| | | <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="responseBody" label="ååºä½"> |
| | | <a-textarea v-model="model.responseBody" :rows="4" readonly /> |
| | | </a-form-model-item> |
| | | </a-row> |
| | | <a-row> |
| | | <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="method" |
| | | label="è°ç¨æ¹æ³"> |
| | | <a-textarea v-model="model.method" :rows="1" readonly /> |
| | | </a-form-model-item> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | import moment from 'moment' |
| | | |
| | | export default { |
| | | name: 'SysApiLogModal', |
| | | data() { |
| | | return { |
| | | title: 'æä½', |
| | | visible: false, |
| | | disableSubmit: true, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | labelColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 3 } |
| | | }, |
| | | wrapperColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 20 } |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: {}, |
| | | url: { |
| | | add: '/system/sysApiLog/add', |
| | | edit: '/system/sysApiLog/edit' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add() { |
| | | //åå§åé»è®¤å¼ |
| | | this.edit({}) |
| | | }, |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.$refs.form.clearValidate() |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpurl = '' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | httpurl += this.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpurl += this.url.edit |
| | | method = 'put' |
| | | } |
| | | httpAction(httpurl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |