fix: 表格字段列排序对语言失效问题
This commit is contained in:
@@ -5,7 +5,7 @@ import useI18n from '@/hooks/useI18n';
|
|||||||
import { type ColumnsType } from 'ant-design-vue/lib/table';
|
import { type ColumnsType } from 'ant-design-vue/lib/table';
|
||||||
import { dbGetJSON, dbSetJSON } from '@/utils/cache-db-utils';
|
import { dbGetJSON, dbSetJSON } from '@/utils/cache-db-utils';
|
||||||
import { CACHE_DB_TABLE_DND } from '@/constants/cache-keys-constants';
|
import { CACHE_DB_TABLE_DND } from '@/constants/cache-keys-constants';
|
||||||
const { t } = useI18n();
|
const { t, currentLocale } = useI18n();
|
||||||
|
|
||||||
const emit = defineEmits(['update:columns-dnd']);
|
const emit = defineEmits(['update:columns-dnd']);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -98,7 +98,11 @@ function fnUpdateColumns() {
|
|||||||
|
|
||||||
if (props.cacheId) {
|
if (props.cacheId) {
|
||||||
// 存入数据
|
// 存入数据
|
||||||
dbSetJSON(CACHE_DB_TABLE_DND, props.cacheId, list);
|
dbSetJSON(
|
||||||
|
CACHE_DB_TABLE_DND,
|
||||||
|
`${props.cacheId}#${currentLocale.value}`,
|
||||||
|
list
|
||||||
|
);
|
||||||
}
|
}
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
emit('update:columns-dnd', list);
|
emit('update:columns-dnd', list);
|
||||||
@@ -119,7 +123,7 @@ watch(
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.cacheId) {
|
if (props.cacheId) {
|
||||||
// 读取数据后响应
|
// 读取数据后响应
|
||||||
dbGetJSON(CACHE_DB_TABLE_DND, props.cacheId)
|
dbGetJSON(CACHE_DB_TABLE_DND, `${props.cacheId}#${currentLocale.value}`)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data) {
|
if (data) {
|
||||||
const titleList: string[] = [];
|
const titleList: string[] = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user