🔨 添加排序字段.
This commit is contained in:
@@ -3,12 +3,14 @@
|
||||
search-input-placeholder="输入搜索值"
|
||||
:create-card-position="false"
|
||||
:loading="loading"
|
||||
:field-config="fieldConfig"
|
||||
:field-config="cardFieldConfig"
|
||||
:list="list"
|
||||
:pagination="pagination"
|
||||
:card-layout-cols="cardColLayout"
|
||||
:filter-count="filterCount"
|
||||
:add-permission="['${package.ModuleName}:${typeHyphen}:create']"
|
||||
:query-order="queryOrder"
|
||||
:fields-hook="fieldsHook"
|
||||
@add="emits('openAdd')"
|
||||
@reset="reset"
|
||||
@search="fetchCardData"
|
||||
@@ -118,26 +120,29 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { ${vue.featureEntity}QueryRequest, ${vue.featureEntity}QueryResponse } from '@/api/${vue.module}/${vue.feature}';
|
||||
import { useCardPagination, useCardColLayout } from '@/hooks/card';
|
||||
import { useCardPagination, useCardColLayout, useCardFieldConfig } from '@/hooks/card';
|
||||
import { computed, reactive, ref, onMounted } from 'vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { objectTruthKeyCount, resetObject } from '@/utils';
|
||||
import fieldConfig from '../types/card.fields';
|
||||
#if($dictMap.entrySet().size() > 0)
|
||||
import { #foreach($entry in ${dictMap.entrySet()})${entry.value.keyField}#if($foreach.hasNext), #end#end } from '../types/const';
|
||||
import { TableName, #foreach($entry in ${dictMap.entrySet()})${entry.value.keyField}#if($foreach.hasNext), #end#end } from '../types/const';
|
||||
#else
|
||||
import {} from '../types/const';
|
||||
import { TableName } from '../types/const';
|
||||
#end
|
||||
import { delete${vue.featureEntity}, get${vue.featureEntity}Page } from '@/api/${vue.module}/${vue.feature}';
|
||||
import { Message, Modal } from '@arco-design/web-vue';
|
||||
#if($dictMap.entrySet().size() > 0)
|
||||
import { useDictStore } from '@/store';
|
||||
#end
|
||||
import { useQueryOrder, ASC } from '@/hooks/query-order';
|
||||
|
||||
const emits = defineEmits(['openAdd', 'openUpdate']);
|
||||
|
||||
const cardColLayout = useCardColLayout();
|
||||
const pagination = useCardPagination();
|
||||
const queryOrder = useQueryOrder(TableName, ASC);
|
||||
const { cardFieldConfig, fieldsHook } = useCardFieldConfig(TableName, fieldConfig);
|
||||
const { loading, setLoading } = useLoading();
|
||||
#if($dictMap.entrySet().size() > 0)
|
||||
const { toOptions, getDictValue } = useDictStore();
|
||||
@@ -198,7 +203,7 @@
|
||||
const doFetchCardData = async (request: ${vue.featureEntity}QueryRequest) => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const { data } = await get${vue.featureEntity}Page(request);
|
||||
const { data } = await get${vue.featureEntity}Page(queryOrder.markOrderly(request));
|
||||
list.value = data.rows;
|
||||
pagination.total = data.total;
|
||||
pagination.current = request.page;
|
||||
|
||||
@@ -75,6 +75,11 @@
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
#end
|
||||
<!-- 调整 -->
|
||||
<table-adjust :columns="columns"
|
||||
:columns-hook="columnsHook"
|
||||
:query-order="queryOrder"
|
||||
@query="fetchTableData" />
|
||||
</a-space>
|
||||
</div>
|
||||
</template>
|
||||
@@ -87,7 +92,7 @@
|
||||
#end
|
||||
ref="tableRef"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:columns="tableColumns"
|
||||
#if($vue.enableRowSelection)
|
||||
:row-selection="rowSelection"
|
||||
#end
|
||||
@@ -146,25 +151,29 @@
|
||||
import useLoading from '@/hooks/loading';
|
||||
import columns from '../types/table.columns';
|
||||
#if($dictMap.entrySet().size() > 0)
|
||||
import { #foreach($entry in ${dictMap.entrySet()})${entry.value.keyField}#if($foreach.hasNext), #end#end } from '../types/const';
|
||||
import { TableName, #foreach($entry in ${dictMap.entrySet()})${entry.value.keyField}#if($foreach.hasNext), #end#end } from '../types/const';
|
||||
#else
|
||||
import {} from '../types/const';
|
||||
import { TableName } from '../types/const';
|
||||
#end
|
||||
#if($vue.enableRowSelection)
|
||||
import { useTablePagination, useRowSelection } from '@/hooks/table';
|
||||
import { useTablePagination, useRowSelection, useTableColumns } from '@/hooks/table';
|
||||
#else
|
||||
import { useTablePagination } from '@/hooks/table';
|
||||
import { useTablePagination, useTableColumns } from '@/hooks/table';
|
||||
#end
|
||||
#if($dictMap.entrySet().size() > 0)
|
||||
import { useDictStore } from '@/store';
|
||||
#end
|
||||
import { useQueryOrder, ASC } from '@/hooks/query-order';
|
||||
import TableAdjust from '@/components/app/table-adjust/index.vue';
|
||||
|
||||
const emits = defineEmits(['openAdd', 'openUpdate']);
|
||||
|
||||
const pagination = useTablePagination();
|
||||
#if($vue.enableRowSelection)
|
||||
const rowSelection = useRowSelection();
|
||||
#end
|
||||
const pagination = useTablePagination();
|
||||
const queryOrder = useQueryOrder(TableName, ASC);
|
||||
const { tableColumns, columnsHook } = useTableColumns(TableName, columns);
|
||||
const { loading, setLoading } = useLoading();
|
||||
#if($dictMap.entrySet().size() > 0)
|
||||
const { toOptions, getDictValue } = useDictStore();
|
||||
@@ -227,7 +236,7 @@
|
||||
const doFetchTableData = async (request: ${vue.featureEntity}QueryRequest) => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const { data } = await get${vue.featureEntity}Page(request);
|
||||
const { data } = await get${vue.featureEntity}Page(queryOrder.markOrderly(request));
|
||||
tableRenderData.value = data.rows;
|
||||
pagination.total = data.total;
|
||||
pagination.current = request.page;
|
||||
|
||||
Reference in New Issue
Block a user