添加国家独立设置

This commit is contained in:
2026-03-12 09:59:19 +08:00
parent b4efa96416
commit bfd8748554
3 changed files with 230 additions and 27 deletions

View File

@@ -228,7 +228,7 @@ import { getUser } from "@/utils/storage";
import { getCountryName } from "@/utils/countryUtil";
import { ElMessage, ElMessageBox, ElLoading } from "element-plus";
import { useI18n } from 'vue-i18n';
import { useCountryStore } from '@/stores/countryStore';
import { useCountryInfo } from '@/composables/useCountryInfo';
// Mock API calls if not present
// Ideally we should import these from api file, but for simplicity I will mock them or use empty callbacks
@@ -239,7 +239,14 @@ import { useCountryStore } from '@/stores/countryStore';
import { tkbigdata, getCountryinfo } from "@/api/account";
const { t, locale } = useI18n();
const countryStore = useCountryStore();
// 使用独立的国家信息管理(不与其他页面共享)
const {
countryData,
isLoading: isRefreshingCountry,
initCountryInfo,
refreshCountry: refreshCountryInfo,
showEditCountryDialog
} = useCountryInfo();
// Component State
const queryFormData = ref({
@@ -275,9 +282,8 @@ const streamdialogVisible = ref(false);
const streamdialogVisibletext = ref(false);
const filterdialogVisible = ref(false);
const textarea = ref("");
// 使用共享 store 的国家信息
const countryData = computed(() => countryStore.countryData);
const isRefreshingCountry = computed(() => countryStore.isLoading);
// 使用独立的国家信息
const countryDataRef = countryData;
const userInfo = ref({});
const options = ref([]);
@@ -326,8 +332,8 @@ const timerId = ref(null);
onMounted(async () => {
userInfo.value = getUser() || { tenantId: 0, id: 0 };
// 使用共享 store 初始化国家信息
await countryStore.initCountryInfo(t);
// 初始化独立的国家信息
await initCountryInfo(t);
getCountry();
getlist();
@@ -564,14 +570,14 @@ function openTikTok() {
loginBigTikTok();
}
// 编辑国家信息 - 使用共享 store
// 编辑国家信息
const editCountry = () => {
countryStore.showEditCountryDialog(t);
showEditCountryDialog(t);
};
// 刷新国家信息 - 使用共享 store
// 刷新国家信息
const refreshCountry = async () => {
await countryStore.refreshCountry(t);
await refreshCountryInfo(t);
};
function getCountry() {