mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-09 13:24:38 +00:00
拖拽排序
This commit is contained in:
parent
53eb10876a
commit
18897f3f39
1 changed files with 18 additions and 0 deletions
|
@ -47,7 +47,14 @@
|
||||||
lazy-load
|
lazy-load
|
||||||
:headerAffixedTop="{ offsetTop: 60 }"
|
:headerAffixedTop="{ offsetTop: 60 }"
|
||||||
:hover="true"
|
:hover="true"
|
||||||
|
drag-sort="row-handler"
|
||||||
|
@drag-sort="onDragSort"
|
||||||
>
|
>
|
||||||
|
<template #drag="{ row, rowIndex }">
|
||||||
|
<span>
|
||||||
|
<MoveIcon />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
<template #index="{ row, rowIndex }">
|
<template #index="{ row, rowIndex }">
|
||||||
{{ (cstate.nowPage - 1) * cstate.pageSize + rowIndex + 1 }}
|
{{ (cstate.nowPage - 1) * cstate.pageSize + rowIndex + 1 }}
|
||||||
</template>
|
</template>
|
||||||
|
@ -80,6 +87,8 @@
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { eeprom_read, uint8ArrayToHexReverseString, uint8ArrayToString, hexReverseStringToUint8Array, stringToUint8Array, eeprom_write, eeprom_reboot, eeprom_init } from '@/utils/serial.js';
|
import { eeprom_read, uint8ArrayToHexReverseString, uint8ArrayToString, hexReverseStringToUint8Array, stringToUint8Array, eeprom_write, eeprom_reboot, eeprom_init } from '@/utils/serial.js';
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
|
import { MoveIcon } from 'tdesign-icons-vue-next';
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
|
||||||
const { loading, setLoading } = useLoading(false);
|
const { loading, setLoading } = useLoading(false);
|
||||||
|
@ -120,7 +129,16 @@
|
||||||
nowPage: 1,
|
nowPage: 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const onDragSort = (params: any) => {
|
||||||
|
cstate.renderData = params.newData
|
||||||
|
}
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
{
|
||||||
|
colKey: 'drag', // 列拖拽排序必要参数
|
||||||
|
title: '排序',
|
||||||
|
width: 46,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '#',
|
title: '#',
|
||||||
colKey: 'index',
|
colKey: 'index',
|
||||||
|
|
Loading…
Reference in a new issue