'use strict';

var vue = require('vue');
var pinia = require('pinia');
var core = require('@vueuse/core');
var index = require('../../../base/useLoading/index.js');
require('../../../../api/guardBasic/controller/index.js');
var postBasicV1LanguageListAll = require('../../../../api/guardBasic/controller/JiChuFuWu/YuZhongGuanLi/postBasicV1LanguageListAll.js');

const useLangListStore = pinia.defineStore("gmLangList", () => {
  const langList = core.useSessionStorage("gmLangList", [], { listenToStorageChanges: false });
  const { isLoading, exec: getLangListExec, getDataFinally } = index.useLoading(postBasicV1LanguageListAll.postBasicV1LanguageListAll);
  const isFinished = vue.ref(false);
  const getLangList = async () => {
    if (langList.value.length !== 0 || isLoading.value) {
      return;
    }
    const { data } = await getLangListExec();
    if (data.code !== 200) {
      return;
    }
    langList.value = data.data.map((item) => item.id === 10 ? { ...item, name: "\u5370\u5C3C\u8BED" } : item);
  };
  core.tryOnMounted(() => {
    getLangList();
  });
  return {
    langList,
    isLoading,
    isFinished,
    getLangList,
    getDataFinally
  };
});

exports.useLangListStore = useLangListStore;
//# sourceMappingURL=index.js.map
