代码格式化
This commit is contained in:
parent
fe2803590c
commit
03bf58569e
|
|
@ -2,29 +2,32 @@
|
||||||
<div>
|
<div>
|
||||||
<!--查询区域-->
|
<!--查询区域-->
|
||||||
<div class="jeecg-basic-table-form-container">
|
<div class="jeecg-basic-table-form-container">
|
||||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||||
|
:wrapper-col="wrapperCol">
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="paramStatus">
|
<a-form-item name="paramStatus">
|
||||||
<template #label><span title="反馈状态">本次反馈状态</span></template>
|
<template #label><span title="反馈状态">本次反馈状态</span></template>
|
||||||
<a-select placeholder="请选择反馈状态" v-model:value="queryParam.paramStatus" all-clear>
|
<a-select placeholder="请选择反馈状态" v-model:value="queryParam.paramStatus" all-clear>
|
||||||
<a-select-option value="">全部</a-select-option>
|
<a-select-option value="">全部</a-select-option>
|
||||||
<a-select-option value="0">成功</a-select-option>
|
<a-select-option value="0">成功</a-select-option>
|
||||||
<a-select-option value="1">失败</a-select-option>
|
<a-select-option value="1">失败</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="paramsRequestTime">
|
<a-form-item name="paramsRequestTime">
|
||||||
<template #label><span title="抄表时间">本次抄表时间</span></template>
|
<template #label><span title="抄表时间">本次抄表时间</span></template>
|
||||||
<a-date-picker placeholder="请选择日期" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" v-model:value="queryParam.paramsRequestTime" style="width: 100%" />
|
<a-date-picker placeholder="请选择日期" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD"
|
||||||
</a-form-item>
|
v-model:value="queryParam.paramsRequestTime" style="width: 100%" />
|
||||||
</a-col>
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||||
|
style="margin-left: 8px">重置</a-button>
|
||||||
</span>
|
</span>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
@ -36,6 +39,12 @@
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
<template v-if="column.dataIndex === 'requestValue'">
|
||||||
|
<span>{{ (text == null || text == undefined) ? '-' : ((text == '0' || text == '0.00') ? 0 : text) }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'resolveValue'">
|
||||||
|
<span>{{ (text == null || text == undefined) ? '-' : ((text == '0' || text == '0.00') ? 0 : text) }}</span>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
|
|
@ -44,155 +53,161 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" name="ApiRequestLog-ApiRequestLog" setup>
|
<script lang="ts" name="ApiRequestLog-ApiRequestLog" setup>
|
||||||
import { ref, reactive } from 'vue';
|
import { ref, reactive } from 'vue';
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { columns, superQuerySchema } from './ApiRequestLog.data';
|
import { columns, superQuerySchema } from './ApiRequestLog.data';
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ApiRequestLog.api';
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ApiRequestLog.api';
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
import ApiRequestLogModal from './components/ApiRequestLogModal.vue'
|
import ApiRequestLogModal from './components/ApiRequestLogModal.vue'
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
//注册table数据
|
//注册table数据
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
tableProps: {
|
tableProps: {
|
||||||
title: 'api请求日志',
|
title: 'api请求日志',
|
||||||
api: list,
|
api: list,
|
||||||
columns,
|
columns,
|
||||||
canResize:false,
|
canResize: false,
|
||||||
useSearchForm: false,
|
useSearchForm: false,
|
||||||
immediate: false,
|
immediate: false,
|
||||||
showActionColumn: false,
|
showActionColumn: false,
|
||||||
actionColumn: {
|
actionColumn: {
|
||||||
width: 120,
|
width: 120,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
},
|
|
||||||
beforeFetch: async (params) => {
|
|
||||||
return Object.assign(params, queryParam);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
beforeFetch: async (params) => {
|
||||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
return Object.assign(params, queryParam);
|
||||||
const labelCol = reactive({
|
},
|
||||||
xs:24,
|
},
|
||||||
sm:8,
|
});
|
||||||
xl:6,
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||||
xxl:8
|
const labelCol = reactive({
|
||||||
});
|
xs: 24,
|
||||||
const wrapperCol = reactive({
|
sm: 8,
|
||||||
xs: 24,
|
xl: 6,
|
||||||
sm: 16,
|
xxl: 8
|
||||||
});
|
});
|
||||||
|
const wrapperCol = reactive({
|
||||||
|
xs: 24,
|
||||||
|
sm: 16,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增事件
|
* 新增事件
|
||||||
*/
|
*/
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
registerModal.value.disableSubmit = false;
|
registerModal.value.disableSubmit = false;
|
||||||
registerModal.value.add();
|
registerModal.value.add();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑事件
|
|
||||||
*/
|
|
||||||
function handleEdit(record: Recordable) {
|
|
||||||
registerModal.value.disableSubmit = false;
|
|
||||||
registerModal.value.edit(record);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
function handleDetail(record: Recordable) {
|
|
||||||
registerModal.value.disableSubmit = true;
|
|
||||||
registerModal.value.edit(record);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除事件
|
|
||||||
*/
|
|
||||||
async function handleDelete(record) {
|
|
||||||
await deleteOne({ id: record.id }, handleSuccess);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除事件
|
|
||||||
*/
|
|
||||||
async function batchHandleDelete() {
|
|
||||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 成功回调
|
|
||||||
*/
|
|
||||||
function handleSuccess() {
|
|
||||||
(selectedRowKeys.value = []) && reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询
|
* 编辑事件
|
||||||
*/
|
*/
|
||||||
function searchQuery() {
|
function handleEdit(record: Recordable) {
|
||||||
console.log('searchQuery',queryParam);
|
registerModal.value.disableSubmit = false;
|
||||||
reload();
|
registerModal.value.edit(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置
|
* 详情
|
||||||
*/
|
*/
|
||||||
function searchReset() {
|
function handleDetail(record: Recordable) {
|
||||||
formRef.value.resetFields();
|
registerModal.value.disableSubmit = true;
|
||||||
selectedRowKeys.value = [];
|
registerModal.value.edit(record);
|
||||||
//刷新数据
|
}
|
||||||
reload();
|
|
||||||
}
|
/**
|
||||||
|
* 删除事件
|
||||||
function init(record) {
|
*/
|
||||||
|
async function handleDelete(record) {
|
||||||
|
await deleteOne({ id: record.id }, handleSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除事件
|
||||||
|
*/
|
||||||
|
async function batchHandleDelete() {
|
||||||
|
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功回调
|
||||||
|
*/
|
||||||
|
function handleSuccess() {
|
||||||
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
*/
|
||||||
|
function searchQuery() {
|
||||||
|
console.log('searchQuery', queryParam);
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置
|
||||||
|
*/
|
||||||
|
function searchReset() {
|
||||||
|
formRef.value.resetFields();
|
||||||
|
selectedRowKeys.value = [];
|
||||||
|
//刷新数据
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
function init(record) {
|
||||||
console.log("🚀 ~ init ~ record:", record)
|
console.log("🚀 ~ init ~ record:", record)
|
||||||
queryParam.cid = record.cid;
|
queryParam.cid = record.cid;
|
||||||
queryParam.type = record.type;
|
queryParam.type = record.type;
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
init,
|
init,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.jeecg-basic-table-form-container {
|
.jeecg-basic-table-form-container {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
.table-page-search-submitButtons {
|
|
||||||
display: block;
|
.table-page-search-submitButtons {
|
||||||
margin-bottom: 24px;
|
display: block;
|
||||||
white-space: nowrap;
|
margin-bottom: 24px;
|
||||||
}
|
white-space: nowrap;
|
||||||
.query-group-cust{
|
|
||||||
min-width: 100px !important;
|
|
||||||
}
|
|
||||||
.query-group-split-cust{
|
|
||||||
width: 30px;
|
|
||||||
display: inline-block;
|
|
||||||
text-align: center
|
|
||||||
}
|
|
||||||
.ant-form-item:not(.ant-form-item-with-help){
|
|
||||||
margin-bottom: 16px;
|
|
||||||
height: 32px;
|
|
||||||
}
|
|
||||||
:deep(.ant-picker),:deep(.ant-input-number){
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.query-group-cust {
|
||||||
|
min-width: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-split-cust {
|
||||||
|
width: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-form-item:not(.ant-form-item-with-help) {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-picker),
|
||||||
|
:deep(.ant-input-number) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue