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 { dbGetJSON, dbSetJSON } from '@/utils/cache-db-utils';
|
||||
import { CACHE_DB_TABLE_DND } from '@/constants/cache-keys-constants';
|
||||
const { t } = useI18n();
|
||||
const { t, currentLocale } = useI18n();
|
||||
|
||||
const emit = defineEmits(['update:columns-dnd']);
|
||||
const props = defineProps({
|
||||
@@ -98,7 +98,11 @@ function fnUpdateColumns() {
|
||||
|
||||
if (props.cacheId) {
|
||||
// 存入数据
|
||||
dbSetJSON(CACHE_DB_TABLE_DND, props.cacheId, list);
|
||||
dbSetJSON(
|
||||
CACHE_DB_TABLE_DND,
|
||||
`${props.cacheId}#${currentLocale.value}`,
|
||||
list
|
||||
);
|
||||
}
|
||||
nextTick(() => {
|
||||
emit('update:columns-dnd', list);
|
||||
@@ -119,7 +123,7 @@ watch(
|
||||
onMounted(() => {
|
||||
if (props.cacheId) {
|
||||
// 读取数据后响应
|
||||
dbGetJSON(CACHE_DB_TABLE_DND, props.cacheId)
|
||||
dbGetJSON(CACHE_DB_TABLE_DND, `${props.cacheId}#${currentLocale.value}`)
|
||||
.then(data => {
|
||||
if (data) {
|
||||
const titleList: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user