fix(缺陷管理): 缺陷列表部分字段支持排序

This commit is contained in:
song-cc-rock 2024-02-22 20:04:17 +08:00 committed by Craftsman
parent d8d40f1a6d
commit 5b3e2c1716
2 changed files with 61 additions and 42 deletions

View File

@ -14,7 +14,7 @@
</resultMap> </resultMap>
<select id="list" resultMap="BugDTO"> <select id="list" resultMap="BugDTO">
select b.id, b.num, b.title, b.handle_user, b.create_user, b.create_time, b.update_time, b.delete_time, b.delete_user, select b.id, b.num, b.title, b.handle_user, b.create_user, b.create_time, b.update_user, b.update_time, b.delete_user, b.delete_time,
b.project_id, b.template_id, b.platform, b.status, b.tags from bug b b.project_id, b.template_id, b.platform, b.status, b.tags from bug b
<include refid="queryWhereCondition"/> <include refid="queryWhereCondition"/>
</select> </select>

View File

@ -126,25 +126,25 @@
</template> </template>
<script lang="ts" async setup> <script lang="ts" async setup>
import { useRoute } from 'vue-router'; import {useRoute} from 'vue-router';
import { Message, TableData } from '@arco-design/web-vue'; import {Message, TableData} from '@arco-design/web-vue';
import { MsAdvanceFilter, timeSelectOptions } from '@/components/pure/ms-advance-filter'; import {MsAdvanceFilter, timeSelectOptions} from '@/components/pure/ms-advance-filter';
import { BackEndEnum, FilterFormItem, FilterResult, FilterType } from '@/components/pure/ms-advance-filter/type'; import {BackEndEnum, FilterFormItem, FilterResult, FilterType} from '@/components/pure/ms-advance-filter/type';
import MsButton from '@/components/pure/ms-button/index.vue'; import MsButton from '@/components/pure/ms-button/index.vue';
import MsCard from '@/components/pure/ms-card/index.vue'; import MsCard from '@/components/pure/ms-card/index.vue';
import MsExportDrawer from '@/components/pure/ms-export-drawer/index.vue'; import MsExportDrawer from '@/components/pure/ms-export-drawer/index.vue';
import { MsExportDrawerMap, MsExportDrawerOption } from '@/components/pure/ms-export-drawer/types'; import {MsExportDrawerMap, MsExportDrawerOption} from '@/components/pure/ms-export-drawer/types';
import MsBaseTable from '@/components/pure/ms-table/base-table.vue'; import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
import { BatchActionParams, BatchActionQueryParams, MsTableColumn } from '@/components/pure/ms-table/type'; import {BatchActionParams, BatchActionQueryParams, MsTableColumn} from '@/components/pure/ms-table/type';
import useTable from '@/components/pure/ms-table/useTable'; import useTable from '@/components/pure/ms-table/useTable';
import MsTableMoreAction from '@/components/pure/ms-table-more-action/index.vue'; import MsTableMoreAction from '@/components/pure/ms-table-more-action/index.vue';
import { ActionsItem } from '@/components/pure/ms-table-more-action/types'; import {ActionsItem} from '@/components/pure/ms-table-more-action/types';
import BatchEditModal from './components/batchEditModal.vue'; import BatchEditModal from './components/batchEditModal.vue';
import BugDetailDrawer from './components/bug-detail-drawer.vue'; import BugDetailDrawer from './components/bug-detail-drawer.vue';
import DeleteModal from './components/deleteModal.vue'; import DeleteModal from './components/deleteModal.vue';
import { import {
deleteBatchBug, deleteBatchBug,
deleteSingleBug, deleteSingleBug,
exportBug, exportBug,
@ -152,26 +152,21 @@
getCustomFieldHeader, getCustomFieldHeader,
getExportConfig, getExportConfig,
syncBugOpenSource, syncBugOpenSource,
} from '@/api/modules/bug-management'; } from '@/api/modules/bug-management';
import { useI18n } from '@/hooks/useI18n'; import {useI18n} from '@/hooks/useI18n';
import useModal from '@/hooks/useModal'; import useModal from '@/hooks/useModal';
import router from '@/router'; import router from '@/router';
import { useAppStore, useTableStore } from '@/store'; import {useAppStore, useTableStore} from '@/store';
import useLicenseStore from '@/store/modules/setting/license'; import useLicenseStore from '@/store/modules/setting/license';
import { import {customFieldDataToTableData, customFieldToColumns, downloadByteFile, tableParamsToRequestParams,} from '@/utils';
customFieldDataToTableData,
customFieldToColumns,
downloadByteFile,
tableParamsToRequestParams,
} from '@/utils';
import { BugEditCustomField, BugListItem } from '@/models/bug-management'; import {BugEditCustomField, BugListItem} from '@/models/bug-management';
import { RouteEnum } from '@/enums/routeEnum'; import {RouteEnum} from '@/enums/routeEnum';
import { TableKeyEnum } from '@/enums/tableEnum'; import {TableKeyEnum} from '@/enums/tableEnum';
import { useRequest } from 'ahooks-vue'; import {useRequest} from 'ahooks-vue';
const { t } = useI18n(); const { t } = useI18n();
const tableStore = useTableStore(); const tableStore = useTableStore();
const appStore = useAppStore(); const appStore = useAppStore();
@ -249,12 +244,20 @@
dataIndex: 'num', dataIndex: 'num',
slotName: 'num', slotName: 'num',
width: 80, width: 80,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
}
}, },
{ {
title: 'bugManagement.bugName', title: 'bugManagement.bugName',
dataIndex: 'title', dataIndex: 'title',
width: 200, width: 200,
showTooltip: true, showTooltip: true,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
}
}, },
{ {
title: 'bugManagement.status', title: 'bugManagement.status',
@ -296,6 +299,10 @@
width: 112, width: 112,
showTooltip: true, showTooltip: true,
showDrag: true, showDrag: true,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
}
}, },
{ {
title: 'bugManagement.updateUser', title: 'bugManagement.updateUser',
@ -303,18 +310,30 @@
width: 112, width: 112,
showTooltip: true, showTooltip: true,
showDrag: true, showDrag: true,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
}
}, },
{ {
title: 'bugManagement.createTime', title: 'bugManagement.createTime',
dataIndex: 'createTime', dataIndex: 'createTime',
showDrag: true, showDrag: true,
width: 199, width: 199,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
}
}, },
{ {
title: 'bugManagement.updateTime', title: 'bugManagement.updateTime',
dataIndex: 'updateTime', dataIndex: 'updateTime',
showDrag: true, showDrag: true,
width: 199, width: 199,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
}
}, },
{ {
title: 'common.operation', title: 'common.operation',