giime 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +22 -22
- package/es/giime/version.d.ts +1 -1
- package/es/hooks/store/index.d.ts +1 -0
- package/es/hooks/store/useCurrencyList/index.d.ts +4 -4
- package/es/hooks/store/useLangList/index.d.ts +4 -4
- package/es/hooks/store/useLineList/index.d.ts +4 -4
- package/es/hooks/store/useOrgUserList/index.d.ts +29 -0
- package/es/hooks/store/usePlatformLineList/index.d.ts +4 -4
- package/es/index.css +22 -22
- package/es/packages/giime/index.mjs +1 -0
- package/es/packages/giime/index.mjs.map +1 -1
- package/es/packages/hooks/index.mjs +1 -0
- package/es/packages/hooks/index.mjs.map +1 -1
- package/es/packages/hooks/store/index.mjs +1 -0
- package/es/packages/hooks/store/index.mjs.map +1 -1
- package/es/packages/hooks/store/useCurrencyList/index.mjs +7 -7
- package/es/packages/hooks/store/useCurrencyList/index.mjs.map +1 -1
- package/es/packages/hooks/store/useLangList/index.mjs +7 -7
- package/es/packages/hooks/store/useLangList/index.mjs.map +1 -1
- package/es/packages/hooks/store/useLineList/index.mjs +7 -7
- package/es/packages/hooks/store/useLineList/index.mjs.map +1 -1
- package/es/packages/hooks/store/useOrgUserList/index.mjs +26 -0
- package/es/packages/hooks/store/useOrgUserList/index.mjs.map +1 -0
- package/es/packages/hooks/store/usePlatformLineList/index.mjs +7 -7
- package/es/packages/hooks/store/usePlatformLineList/index.mjs.map +1 -1
- package/es/packages/utils/src/http/createAxios.mjs +1 -1
- package/es/packages/utils/src/http/createAxios.mjs.map +1 -1
- package/lib/giime/version.d.ts +1 -1
- package/lib/hooks/store/index.d.ts +1 -0
- package/lib/hooks/store/useCurrencyList/index.d.ts +4 -4
- package/lib/hooks/store/useLangList/index.d.ts +4 -4
- package/lib/hooks/store/useLineList/index.d.ts +4 -4
- package/lib/hooks/store/useOrgUserList/index.d.ts +29 -0
- package/lib/hooks/store/usePlatformLineList/index.d.ts +4 -4
- package/lib/index.css +22 -22
- package/lib/packages/giime/index.js +2 -0
- package/lib/packages/giime/index.js.map +1 -1
- package/lib/packages/hooks/index.js +2 -0
- package/lib/packages/hooks/index.js.map +1 -1
- package/lib/packages/hooks/store/index.js +2 -0
- package/lib/packages/hooks/store/index.js.map +1 -1
- package/lib/packages/hooks/store/useCurrencyList/index.js +7 -7
- package/lib/packages/hooks/store/useCurrencyList/index.js.map +1 -1
- package/lib/packages/hooks/store/useLangList/index.js +7 -7
- package/lib/packages/hooks/store/useLangList/index.js.map +1 -1
- package/lib/packages/hooks/store/useLineList/index.js +7 -7
- package/lib/packages/hooks/store/useLineList/index.js.map +1 -1
- package/lib/packages/hooks/store/useOrgUserList/index.js +28 -0
- package/lib/packages/hooks/store/useOrgUserList/index.js.map +1 -0
- package/lib/packages/hooks/store/usePlatformLineList/index.js +7 -7
- package/lib/packages/hooks/store/usePlatformLineList/index.js.map +1 -1
- package/lib/packages/utils/src/http/createAxios.js +1 -1
- package/lib/packages/utils/src/http/createAxios.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../packages/hooks/store/useOrgUserList/index.ts"],"sourcesContent":["import { computed, onMounted } from 'vue';\r\nimport { defineStore } from 'pinia';\r\nimport { usePostPubGetOrgUser } from '@giime/api/gatewayApi/controller';\r\n\r\n/**用户-家族列表 */\r\nexport const useOrgUserListStore = defineStore('gmOrgUserList', () => {\r\n const { isLoading, exec, data: userListData } = usePostPubGetOrgUser();\r\n const orgUserList = computed(() => userListData.value?.data || []);\r\n const getOrgUserList = async () => {\r\n if (orgUserList.value.length !== 0 || isLoading.value) {\r\n return;\r\n }\r\n exec();\r\n };\r\n onMounted(() => {\r\n getOrgUserList();\r\n });\r\n return {\r\n orgUserList,\r\n isLoading,\r\n getOrgUserList,\r\n };\r\n});\r\n"],"names":["defineStore","usePostPubGetOrgUser","computed","onMounted"],"mappings":";;;;;;;AAKa,MAAA,mBAAA,GAAsBA,iBAAY,CAAA,eAAA,EAAiB,MAAM;AACpE,EAAA,MAAM,EAAE,SAAW,EAAA,IAAA,EAAM,IAAM,EAAA,YAAA,KAAiBC,yCAAqB,EAAA,CAAA;AACrE,EAAA,MAAM,cAAcC,YAAS,CAAA,MAAM,aAAa,KAAO,EAAA,IAAA,IAAQ,EAAE,CAAA,CAAA;AACjE,EAAA,MAAM,iBAAiB,YAAY;AACjC,IAAA,IAAI,WAAY,CAAA,KAAA,CAAM,MAAW,KAAA,CAAA,IAAK,UAAU,KAAO,EAAA;AACrD,MAAA,OAAA;AAAA,KACF;AACA,IAAK,IAAA,EAAA,CAAA;AAAA,GACP,CAAA;AACA,EAAAC,aAAA,CAAU,MAAM;AACd,IAAe,cAAA,EAAA,CAAA;AAAA,GAChB,CAAA,CAAA;AACD,EAAO,OAAA;AAAA,IACL,WAAA;AAAA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,GACF,CAAA;AACF,CAAC;;;;"}
|
|
@@ -8,19 +8,19 @@ var getPlatformLine = require('../../../api/shopAdmin/store/getPlatformLine.js')
|
|
|
8
8
|
const usePlatformLineListStore = pinia.defineStore("gmPlatformLineList", () => {
|
|
9
9
|
const platformLineList = vue.ref([]);
|
|
10
10
|
const cascaderList = vue.ref([]);
|
|
11
|
-
const
|
|
11
|
+
const isLoading = vue.ref(false);
|
|
12
12
|
const getPlatformLineList = async (options) => {
|
|
13
13
|
if (!options?.isReload && platformLineList.value.length !== 0) {
|
|
14
|
-
|
|
14
|
+
isLoading.value = false;
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
if (
|
|
17
|
+
if (isLoading.value) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
try {
|
|
21
|
-
|
|
21
|
+
isLoading.value = true;
|
|
22
22
|
const { data } = await getPlatformLine.getPlatformLineApi();
|
|
23
|
-
|
|
23
|
+
isLoading.value = false;
|
|
24
24
|
if (data.code !== 0) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
@@ -39,7 +39,7 @@ const usePlatformLineListStore = pinia.defineStore("gmPlatformLineList", () => {
|
|
|
39
39
|
});
|
|
40
40
|
} catch (e) {
|
|
41
41
|
console.error(e);
|
|
42
|
-
|
|
42
|
+
isLoading.value = false;
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
vue.onMounted(() => {
|
|
@@ -51,7 +51,7 @@ const usePlatformLineListStore = pinia.defineStore("gmPlatformLineList", () => {
|
|
|
51
51
|
* 获取平台线路级联列表
|
|
52
52
|
*/
|
|
53
53
|
cascaderList,
|
|
54
|
-
|
|
54
|
+
isLoading,
|
|
55
55
|
getPlatformLineList
|
|
56
56
|
};
|
|
57
57
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../packages/hooks/store/usePlatformLineList/index.ts"],"sourcesContent":["import { onMounted, ref } from 'vue';\r\nimport { defineStore } from 'pinia';\r\nimport { getPlatformLineApi } from '@giime/api/shopAdmin';\r\nimport type { GetPlatformLineResponseDatum } from '@giime/api/shopAdmin';\r\nexport interface UsePlatformLineListStoreCascaderListItem {\r\n id: number;\r\n name: string;\r\n lineList: {\r\n id: string;\r\n name: string;\r\n }[];\r\n}\r\n/**三方平台线路列表 */\r\nexport const usePlatformLineListStore = defineStore('gmPlatformLineList', () => {\r\n const platformLineList = ref<GetPlatformLineResponseDatum[]>([]);\r\n /**\r\n * 获取平台线路级联列表\r\n */\r\n const cascaderList = ref<UsePlatformLineListStoreCascaderListItem[]>([]);\r\n const
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../packages/hooks/store/usePlatformLineList/index.ts"],"sourcesContent":["import { onMounted, ref } from 'vue';\r\nimport { defineStore } from 'pinia';\r\nimport { getPlatformLineApi } from '@giime/api/shopAdmin';\r\nimport type { GetPlatformLineResponseDatum } from '@giime/api/shopAdmin';\r\nexport interface UsePlatformLineListStoreCascaderListItem {\r\n id: number;\r\n name: string;\r\n lineList: {\r\n id: string;\r\n name: string;\r\n }[];\r\n}\r\n/**三方平台线路列表 */\r\nexport const usePlatformLineListStore = defineStore('gmPlatformLineList', () => {\r\n const platformLineList = ref<GetPlatformLineResponseDatum[]>([]);\r\n /**\r\n * 获取平台线路级联列表\r\n */\r\n const cascaderList = ref<UsePlatformLineListStoreCascaderListItem[]>([]);\r\n const isLoading = ref(false);\r\n const getPlatformLineList = async (options?: { isReload: boolean }) => {\r\n if (!options?.isReload && platformLineList.value.length !== 0) {\r\n isLoading.value = false;\r\n return;\r\n }\r\n if (isLoading.value) {\r\n return;\r\n }\r\n try {\r\n isLoading.value = true;\r\n const { data } = await getPlatformLineApi();\r\n isLoading.value = false;\r\n if (data.code !== 0) {\r\n return;\r\n }\r\n platformLineList.value = data.data;\r\n cascaderList.value = data.data.map(item => {\r\n return {\r\n id: item.plat_id,\r\n name: item.platform,\r\n lineList: item.line_list.map(it => {\r\n return {\r\n id: it.line_code,\r\n name: it.line_name,\r\n };\r\n }),\r\n };\r\n });\r\n } catch (e) {\r\n console.error(e);\r\n isLoading.value = false;\r\n }\r\n };\r\n onMounted(() => {\r\n getPlatformLineList();\r\n });\r\n return {\r\n platformLineList,\r\n /**\r\n * 获取平台线路级联列表\r\n */\r\n cascaderList,\r\n isLoading,\r\n getPlatformLineList,\r\n };\r\n});\r\n"],"names":["defineStore","ref","getPlatformLineApi","onMounted"],"mappings":";;;;;;;AAaa,MAAA,wBAAA,GAA2BA,iBAAY,CAAA,oBAAA,EAAsB,MAAM;AAC9E,EAAM,MAAA,gBAAA,GAAmBC,OAAoC,CAAA,EAAE,CAAA,CAAA;AAI/D,EAAM,MAAA,YAAA,GAAeA,OAAgD,CAAA,EAAE,CAAA,CAAA;AACvE,EAAM,MAAA,SAAA,GAAYA,QAAI,KAAK,CAAA,CAAA;AAC3B,EAAM,MAAA,mBAAA,GAAsB,OAAO,OAAoC,KAAA;AACrE,IAAA,IAAI,CAAC,OAAS,EAAA,QAAA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YAAA;AAAA,IACA,SAAA;AAAA,IACA,mBAAA;AAAA,GACF,CAAA;AACF,CAAC;;;;"}
|
|
@@ -46,7 +46,7 @@ const createAxios = (config) => {
|
|
|
46
46
|
if (res.code === 401) {
|
|
47
47
|
interceptors.res401Interceptors();
|
|
48
48
|
return response;
|
|
49
|
-
} else if (res.code !== successCode
|
|
49
|
+
} else if (res.code !== successCode && res.errCode !== successCode) {
|
|
50
50
|
elementPlus.ElMessage({
|
|
51
51
|
message: res.comment ?? res.message ?? res.errMsg,
|
|
52
52
|
type: "error",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAxios.js","sources":["../../../../../../../packages/utils/src/http/createAxios.ts"],"sourcesContent":["import axios from 'axios';\r\nimport { ElMessage } from 'element-plus';\r\nimport Cookies from 'js-cookie';\r\nimport { res401Interceptors } from './interceptors';\r\nimport { responseErrorMessage } from './errorMessage';\r\nimport type { AxiosError, CreateAxiosDefaults } from 'axios';\r\nexport interface CreateAxiosConfig extends CreateAxiosDefaults {\r\n baseURL: string;\r\n /**服务器调用成功的code 一般是 0 或 200 */\r\n successCode: number;\r\n}\r\n\r\nexport const createAxios = (config: CreateAxiosConfig) => {\r\n const successCode = config.successCode ?? 0;\r\n const service = axios.create({\r\n withCredentials: true, // send cookies when cross-domain requests\r\n timeout: 120_000,\r\n headers: {\r\n 'content-type': 'application/json',\r\n },\r\n ...config,\r\n });\r\n\r\n // 请求拦截器\r\n service.interceptors.request.use(\r\n config => {\r\n const _token = Cookies.get('token');\r\n const _user = Cookies.get('sso_user_id');\r\n if (!config.params) {\r\n config.params = {};\r\n }\r\n config.params = {\r\n ...config.params,\r\n _token,\r\n _user,\r\n };\r\n config.headers.Authorization = `Bearer ${_token}`;\r\n return config;\r\n },\r\n error => {\r\n console.error('请求错误', error); // for debug\r\n return Promise.reject(error);\r\n },\r\n );\r\n // 添加响应拦截器\r\n service.interceptors.response.use(\r\n response => {\r\n // 对响应数据做点什么\r\n const res = response.data;\r\n if (!res?.code) {\r\n return response;\r\n }\r\n if (res.code === 401) {\r\n res401Interceptors();\r\n return response;\r\n } else if (res.code !== successCode
|
|
1
|
+
{"version":3,"file":"createAxios.js","sources":["../../../../../../../packages/utils/src/http/createAxios.ts"],"sourcesContent":["import axios from 'axios';\r\nimport { ElMessage } from 'element-plus';\r\nimport Cookies from 'js-cookie';\r\nimport { res401Interceptors } from './interceptors';\r\nimport { responseErrorMessage } from './errorMessage';\r\nimport type { AxiosError, CreateAxiosDefaults } from 'axios';\r\nexport interface CreateAxiosConfig extends CreateAxiosDefaults {\r\n baseURL: string;\r\n /**服务器调用成功的code 一般是 0 或 200 */\r\n successCode: number;\r\n}\r\n\r\nexport const createAxios = (config: CreateAxiosConfig) => {\r\n const successCode = config.successCode ?? 0;\r\n const service = axios.create({\r\n withCredentials: true, // send cookies when cross-domain requests\r\n timeout: 120_000,\r\n headers: {\r\n 'content-type': 'application/json',\r\n },\r\n ...config,\r\n });\r\n\r\n // 请求拦截器\r\n service.interceptors.request.use(\r\n config => {\r\n const _token = Cookies.get('token');\r\n const _user = Cookies.get('sso_user_id');\r\n if (!config.params) {\r\n config.params = {};\r\n }\r\n config.params = {\r\n ...config.params,\r\n _token,\r\n _user,\r\n };\r\n config.headers.Authorization = `Bearer ${_token}`;\r\n return config;\r\n },\r\n error => {\r\n console.error('请求错误', error); // for debug\r\n return Promise.reject(error);\r\n },\r\n );\r\n // 添加响应拦截器\r\n service.interceptors.response.use(\r\n response => {\r\n // 对响应数据做点什么\r\n const res = response.data;\r\n if (!res?.code) {\r\n return response;\r\n }\r\n if (res.code === 401) {\r\n res401Interceptors();\r\n return response;\r\n } else if (res.code !== successCode && res.errCode !== successCode) {\r\n ElMessage({\r\n message: res.comment ?? res.message ?? res.errMsg,\r\n type: 'error',\r\n grouping: true,\r\n duration: 5 * 1000,\r\n });\r\n }\r\n return response;\r\n },\r\n (err: AxiosError) => {\r\n console.error(err);\r\n if (err?.response?.status === 401 && !err.message.includes('timeout')) {\r\n res401Interceptors();\r\n } else {\r\n // 对响应错误做点什么\r\n responseErrorMessage(err);\r\n return Promise.reject(err);\r\n }\r\n },\r\n );\r\n\r\n return {\r\n service,\r\n };\r\n};\r\n"],"names":["config","res401Interceptors","ElMessage","responseErrorMessage"],"mappings":";;;;;;;;AAYa,MAAA,WAAA,GAAc,CAAC,MAA8B,KAAA;AACxD,EAAM,MAAA,WAAA,GAAc,OAAO,WAAe,IAAA,CAAA,CAAA;AAC1C,EAAM,MAAA,OAAA,GAAU,MAAM,MAAO,CAAA;AAAA,IAC3B,eAAiB,EAAA,IAAA;AAAA;AAAA,IACjB,OAAS,EAAA,IAAA;AAAA,IACT,OAAS,EAAA;AAAA,MACP,cAAgB,EAAA,kBAAA;AAAA,KAClB;AAAA,IACA,GAAG,MAAA;AAAA,GACJ,CAAA,CAAA;AAGD,EAAA,OAAA,CAAQ,aAAa,OAAQ,CAAA,GAAA;AAAA,IAC3B,CAAAA,OAAU,KAAA;AACR,MAAM,MAAA,MAAA,GAAS,OAAQ,CAAA,GAAA,CAAI,OAAO,CAAA,CAAA;AAClC,MAAM,MAAA,KAAA,GAAQ,OAAQ,CAAA,GAAA,CAAI,aAAa,CAAA,CAAA;AACvC,MAAI,IAAA,CAACA,QAAO,MAAQ,EAAA;AAClB,QAAAA,OAAAA,CAAO,SAAS,EAAC,CAAA;AAAA,OACnB;AACA,MAAAA,QAAO,MAAS,GAAA;AAAA,QACd,GAAGA,OAAO,CAAA,MAAA;AAAA,QACV,MAAA;AAAA,QACA,KAAA;AAAA,OACF,CAAA;AACA,MAAAA,OAAO,CAAA,OAAA,CAAQ,aAAgB,GAAA,CAAA,OAAA,EAAU,MAAM,CAAA,CAAA,CAAA;AAC/C,MAAOA,OAAAA,OAAAA,CAAAA;AAAA,KACT;AAAA,IACA,CAAS,KAAA,KAAA;AACP,MAAQ,OAAA,CAAA,KAAA,CAAM,4BAAQ,KAAK,CAAA,CAAA;AAC3B,MAAO,OAAA,OAAA,CAAQ,OAAO,K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