cosey 0.1.4 → 0.2.0

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.
Files changed (180) hide show
  1. package/README.md +61 -0
  2. package/components/close/style/index.js +2 -2
  3. package/components/col/col.vue.js +1 -1
  4. package/components/col/style/index.js +3 -3
  5. package/components/config-provider/config-provider.d.ts +2 -0
  6. package/components/config-provider/config-provider.vue.js +13 -3
  7. package/components/context-menu/context-menu.vue.js +4 -4
  8. package/components/context-menu/context-sub-menu.vue.js +2 -2
  9. package/components/context-menu/style/index.js +2 -2
  10. package/components/editor/components/color-picker/color-picker.vue.js +15 -11
  11. package/components/editor/components/color-picker/useHistoryColor.js +3 -3
  12. package/components/editor/components/resize/resize.js +9 -9
  13. package/components/editor/components/resize/resize.style.js +20 -20
  14. package/components/editor/components/resize/resize.vue.js +2 -2
  15. package/components/editor/components/table-toolbar/table-toolbar.style.js +2 -2
  16. package/components/editor/components/table-toolbar/table-toolbar.vue.js +2 -2
  17. package/components/editor/components/toolbar/formats/font.vue.js +5 -1
  18. package/components/editor/components/toolbar/formats/header.vue.js +6 -2
  19. package/components/editor/components/toolbar/formats/link.vue.js +17 -13
  20. package/components/editor/components/toolbar/formats/size.vue.js +5 -1
  21. package/components/editor/components/toolbar/formats/source.vue.d.ts +2 -0
  22. package/components/editor/components/toolbar/formats/source.vue.js +78 -0
  23. package/components/editor/components/toolbar/formats/table.style.js +2 -2
  24. package/components/editor/components/toolbar/formats/video.vue.js +9 -5
  25. package/components/editor/components/toolbar/toolbar.vue.js +5 -0
  26. package/components/editor/formats/font.js +2 -2
  27. package/components/editor/formats/indent.js +1 -1
  28. package/components/editor/formats/kbd.d.ts +7 -0
  29. package/components/editor/formats/kbd.js +13 -0
  30. package/components/editor/modules/image-uploader/formats/image-loading.style.js +2 -2
  31. package/components/editor/quill.js +8 -6
  32. package/components/editor/style/index.js +25 -16
  33. package/components/field/components/autocomplete/autocomplete.vue.js +5 -1
  34. package/components/field/components/cascader/cascader.vue.js +5 -1
  35. package/components/field/components/checkbox-group/checkbox-group.vue.js +1 -1
  36. package/components/field/components/checkbox-group/panel.vue.js +10 -5
  37. package/components/field/components/date/date.vue.js +5 -1
  38. package/components/field/components/date-range/date-range.vue.js +6 -2
  39. package/components/field/components/date-time/date-time.vue.js +5 -1
  40. package/components/field/components/date-time-range/date-time-range.vue.js +6 -2
  41. package/components/field/components/dates/dates.vue.js +5 -1
  42. package/components/field/components/input/input.vue.js +5 -1
  43. package/components/field/components/input-tag/input-tag.vue.js +5 -1
  44. package/components/field/components/mention/mention.vue.js +5 -1
  45. package/components/field/components/month/month.vue.js +5 -1
  46. package/components/field/components/month-range/month-range.vue.js +6 -2
  47. package/components/field/components/months/months.vue.js +5 -1
  48. package/components/field/components/password/password.vue.js +5 -1
  49. package/components/field/components/select/select.d.ts +2 -2
  50. package/components/field/components/select/select.js +3 -3
  51. package/components/field/components/select/select.vue.js +5 -1
  52. package/components/field/components/select-v2/select-v2.d.ts +6 -3
  53. package/components/field/components/select-v2/select-v2.js +9 -0
  54. package/components/field/components/select-v2/select-v2.vue.js +21 -3
  55. package/components/field/components/textarea/textarea.vue.js +5 -1
  56. package/components/field/components/time/time.vue.js +5 -1
  57. package/components/field/components/time-range/time-range.vue.js +6 -2
  58. package/components/field/components/time-select/time-select.vue.js +5 -1
  59. package/components/field/components/tree-select/tree-select.vue.js +5 -1
  60. package/components/field/components/week/week.vue.js +6 -2
  61. package/components/field/components/year/year.vue.js +5 -1
  62. package/components/field/components/year-range/year-range.vue.js +6 -2
  63. package/components/field/components/years/years.vue.js +5 -1
  64. package/components/form/form-item.d.ts +1 -1
  65. package/components/form/form.d.ts +2 -0
  66. package/components/form/form.js +2 -2
  67. package/components/form/form.vue.d.ts +5 -0
  68. package/components/form/form.vue.js +6 -2
  69. package/components/form/index.d.ts +10 -1
  70. package/components/form/useBubbleTemplate.js +13 -5
  71. package/components/form-dialog/form-dialog.js +2 -2
  72. package/components/form-dialog/index.d.ts +4 -1552
  73. package/components/form-list/form-list.js +1 -1
  74. package/components/form-list/form-list.vue.js +5 -1
  75. package/components/form-list/index.d.ts +1 -1
  76. package/components/form-query/form-query.d.ts +2 -0
  77. package/components/form-query/form-query.vue.d.ts +5 -0
  78. package/components/form-query/form-query.vue.js +13 -7
  79. package/components/form-query/index.d.ts +9 -0
  80. package/components/highlight/style/index.js +2 -2
  81. package/components/horizontal-tree/horizontal-tree.vue.js +11 -6
  82. package/components/image-card/image-card.d.ts +1 -8
  83. package/components/image-card/image-card.vue.d.ts +4 -18
  84. package/components/image-card/index.d.ts +8 -29
  85. package/components/long-text/style/index.js +2 -2
  86. package/components/mask/style/index.js +2 -2
  87. package/components/row/row.vue.js +1 -1
  88. package/components/scroll-view/scroll-view.vue.js +1 -1
  89. package/components/scroll-view/style/index.js +9 -9
  90. package/components/table/index.d.ts +73 -78
  91. package/components/table/table-column/renderer.d.ts +2 -1
  92. package/components/table/table-column/renderer.js +2 -2
  93. package/components/table/table-column/table-column.d.ts +15 -15
  94. package/components/table/table-column/table-column.vue.d.ts +9 -5
  95. package/components/table/table-column/table-column.vue.js +5 -1
  96. package/components/table/table-column-editor/table-column-editor.vue.js +22 -14
  97. package/components/table/table-export/table-export.vue.js +31 -26
  98. package/components/table/table-query/table-query.d.ts +2 -0
  99. package/components/table/table-query/table-query.vue.d.ts +5 -0
  100. package/components/table/table.d.ts +22 -25
  101. package/components/table/table.vue.d.ts +45 -51
  102. package/components/table/table.vue.js +13 -9
  103. package/components/table/useTable.d.ts +2 -1
  104. package/components/table/useTable.js +2 -2
  105. package/components/table-action/index.d.ts +48 -6
  106. package/components/table-action/item.d.ts +16 -2
  107. package/components/table-action/item.vue.d.ts +34 -6
  108. package/components/table-action/item.vue.js +15 -9
  109. package/components/table-action/table-action.vue.d.ts +16 -2
  110. package/components/toggle/toggle.vue.js +5 -1
  111. package/components/upload/style/index.js +2 -2
  112. package/components/upload/upload-item.vue.d.ts +2 -2
  113. package/components/upload/upload-item.vue.js +16 -9
  114. package/components/upload/upload.vue.js +7 -1
  115. package/config/index.d.ts +1 -2
  116. package/config/index.js +2 -2
  117. package/config/nprogress.style.js +5 -5
  118. package/config/root-config-provider.vue.js +5 -5
  119. package/constant.d.ts +2 -2
  120. package/constant.js +2 -2
  121. package/hooks/index.d.ts +1 -0
  122. package/hooks/index.js +2 -1
  123. package/hooks/useColorScheme.js +4 -4
  124. package/hooks/useDir.d.ts +2 -0
  125. package/hooks/useDir.js +20 -0
  126. package/hooks/useEcharts.d.ts +3 -2
  127. package/hooks/useEcharts.js +15 -3
  128. package/hooks/useLocale.d.ts +23 -371
  129. package/hooks/useLocale.js +26 -35
  130. package/hooks/useUpsert.d.ts +5 -3
  131. package/hooks/useUpsert.js +33 -25
  132. package/index.d.ts +1 -1
  133. package/index.js +4 -4
  134. package/layout/layout-auth/style/index.js +6 -6
  135. package/layout/layout-breadcrumb/layout-breadcrumb.vue.js +6 -2
  136. package/layout/layout-change-password/layout-change-password.vue.js +28 -22
  137. package/layout/layout-content/layout-content.vue.js +1 -1
  138. package/layout/layout-content/style/index.js +1 -1
  139. package/layout/layout-forbidden/layout-forbidden.vue.js +11 -6
  140. package/layout/layout-header/layout-header.vue.js +4 -4
  141. package/layout/layout-header/style/index.js +3 -3
  142. package/layout/layout-iframe/style/index.js +2 -2
  143. package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +11 -6
  144. package/layout/layout-login/layout-login.vue.js +19 -14
  145. package/layout/layout-main/layout-main.vue.js +1 -1
  146. package/layout/layout-menu/layout-menu.vue.js +5 -1
  147. package/layout/layout-menu/style/index.js +1 -1
  148. package/layout/layout-not-found/layout-not-found.vue.js +11 -6
  149. package/layout/layout-search/layout-search.vue.js +22 -14
  150. package/layout/layout-sidebar/layout-sidebar.vue.js +8 -5
  151. package/layout/layout-sidebar/style/index.js +2 -2
  152. package/layout/layout-snug-aside/style/index.js +1 -1
  153. package/layout/layout-tabbar/layout-tabbar.vue.js +21 -13
  154. package/layout/layout-tabbar/style/index.js +1 -1
  155. package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +24 -17
  156. package/layout/layout-user-menu/layout-user-menu.vue.js +10 -6
  157. package/locale/index.d.ts +10 -0
  158. package/locale/index.js +2 -0
  159. package/locale/lang/ar.d.ts +280 -0
  160. package/locale/lang/ar.js +129 -0
  161. package/locale/lang/en.d.ts +302 -0
  162. package/locale/lang/en.js +129 -0
  163. package/locale/lang/zh-cn.d.ts +301 -0
  164. package/locale/lang/zh-cn.js +129 -0
  165. package/package.json +10 -8
  166. package/request/useRequest.js +31 -23
  167. package/store/index.d.ts +1 -1
  168. package/store/index.js +6 -3
  169. package/store/layout.js +208 -190
  170. package/store/plugin.d.ts +9 -0
  171. package/store/plugin.js +22 -0
  172. package/store/user.d.ts +1 -1
  173. package/utils/css.d.ts +4 -0
  174. package/utils/css.js +5 -2
  175. package/utils/excel/bookFormats.js +5 -5
  176. package/utils/excel/xlsx.js +2 -2
  177. package/utils/index.js +1 -1
  178. package/utils/message-box.js +3 -1
  179. package/utils/tree.js +2 -2
  180. package/components/form-dialog/form-dialog.vue.d.ts +0 -675
@@ -1,12 +1,14 @@
1
1
  import { ElMessage } from 'element-plus';
2
2
  import { cloneDeep, pick } from 'lodash-es';
3
- import { useTemplateRef, onMounted, ref, computed, reactive } from 'vue';
4
- import { deepAssign } from '../utils/object.js';
3
+ import { useTemplateRef, onMounted, computed, unref, ref, reactive, shallowRef } from 'vue';
4
+ import { toRefs } from '@vueuse/core';
5
5
  import { uuid } from '../utils/string.js';
6
+ import { useLocale } from './useLocale.js';
7
+ import { deepAssign } from '../utils/object.js';
6
8
 
7
9
  const mapTypeTitle = {
8
- edit: "\u7F16\u8F91",
9
- add: "\u65B0\u589E"
10
+ edit: "co.common.edit",
11
+ add: "co.common.add"
10
12
  };
11
13
  function useUpsert(options) {
12
14
  const {
@@ -22,13 +24,14 @@ function useUpsert(options) {
22
24
  add,
23
25
  edit,
24
26
  success
25
- } = options;
27
+ } = toRefs(computed(() => unref(options)));
28
+ const { t, lang } = useLocale();
26
29
  const type = ref("add");
27
30
  const visible = ref(false);
28
31
  const mergedTitle = computed(() => {
29
- return title || mapTypeTitle[type.value] + (stuffTitle || "");
32
+ return unref(title) || t(mapTypeTitle[type.value]) + (lang.value === "zh-cn" ? "" : " ") + (unref(stuffTitle) || "");
30
33
  });
31
- const initialModel = cloneDeep(model);
34
+ const initialModel = cloneDeep(unref(model));
32
35
  const modelKeys = Object.keys(initialModel);
33
36
  const dialogProps = reactive({
34
37
  modelValue: visible,
@@ -40,16 +43,16 @@ function useUpsert(options) {
40
43
  const formRefKey = uuid();
41
44
  const formRef = useTemplateRef(formRefKey);
42
45
  const onSubmit = async () => {
43
- const data2 = await beforeSubmit?.(model) || model;
46
+ const data2 = await unref(beforeSubmit)?.(unref(model)) || unref(model);
44
47
  let res;
45
48
  if (type.value === "add") {
46
- res = await add?.(data2);
47
- ElMessage.success(addSuccessText || "\u65B0\u589E\u6210\u529F");
49
+ res = await unref(add)?.(data2);
50
+ ElMessage.success(unref(addSuccessText) || t("co.common.addSuccess"));
48
51
  } else {
49
- res = await edit?.(data2);
50
- ElMessage.success(editSuccessText || "\u7F16\u8F91\u6210\u529F");
52
+ res = await unref(edit)?.(data2);
53
+ ElMessage.success(unref(editSuccessText) || t("co.common.editSuccess"));
51
54
  }
52
- success?.(res);
55
+ unref(success)?.(res);
53
56
  exposeOptions?.success?.();
54
57
  };
55
58
  const formProps = reactive({
@@ -57,27 +60,30 @@ function useUpsert(options) {
57
60
  ref: formRefKey,
58
61
  submit: onSubmit
59
62
  });
60
- const data = ref();
63
+ const data = shallowRef();
64
+ const row = shallowRef();
61
65
  let exposeOptions;
62
66
  const expose = {
63
- edit: async (row) => {
67
+ edit: async (_row) => {
64
68
  type.value = "edit";
65
- deepAssign(model, initialModel);
69
+ row.value = _row;
70
+ deepAssign(unref(model), initialModel);
66
71
  visible.value = true;
67
- show?.(type.value, row);
68
- let filledRow = row;
69
- if (details) {
70
- filledRow = await details(row);
72
+ unref(show)?.(type.value, row.value);
73
+ let filledRow = _row;
74
+ if (unref(details)) {
75
+ filledRow = await unref(details)(_row);
71
76
  }
72
77
  filledRow = { ...filledRow };
73
- filledRow = beforeFill?.(filledRow) || filledRow;
74
- Object.assign(model, pick(filledRow, modelKeys));
78
+ filledRow = unref(beforeFill)?.(filledRow) || filledRow;
79
+ Object.assign(unref(model), pick(filledRow, modelKeys));
75
80
  },
76
81
  add: () => {
77
82
  type.value = "add";
78
- deepAssign(model, initialModel);
83
+ row.value = void 0;
84
+ deepAssign(unref(model), initialModel);
79
85
  visible.value = true;
80
- show?.(type.value, void 0);
86
+ unref(show)?.(type.value);
81
87
  },
82
88
  setData: (_data) => {
83
89
  data.value = _data;
@@ -93,7 +99,9 @@ function useUpsert(options) {
93
99
  formProps,
94
100
  formRef,
95
101
  data,
96
- expose
102
+ expose,
103
+ row,
104
+ type
97
105
  };
98
106
  return result;
99
107
  }
package/index.d.ts CHANGED
@@ -11,6 +11,6 @@ export interface CoseyApp<HostElement> extends App<HostElement> {
11
11
  }
12
12
  export declare const createCosey: (options?: CoseyOptions) => {
13
13
  install(app: App): void;
14
- store: import("pinia").Pinia;
14
+ pinia: import("pinia").Pinia;
15
15
  router: import("vue-router").Router;
16
16
  };
package/index.js CHANGED
@@ -4,7 +4,7 @@ import { registerRouterGuard } from './router/guard/index.js';
4
4
  import { provideGlobalConfig } from './config/index.js';
5
5
  export { useGlobalConfig } from './config/index.js';
6
6
  import { registerGlobalComponents } from './layout/index.js';
7
- import { createStore } from './store/index.js';
7
+ import { createPiniaStore } from './store/index.js';
8
8
  export { getAlgorithm } from './config/root-config-provider.js';
9
9
  export { default as RootConfigProvider } from './config/root-config-provider.vue.js';
10
10
  export { useAppearanceStore } from './store/appearance.js';
@@ -74,17 +74,17 @@ export { defineRoute, defineRoutes, mergeRouteModules } from './router/utils.js'
74
74
  export { getBreadcrumbRoutes, getMenuPathKeys, getMenus, getMenusMap } from './router/menus/index.js';
75
75
 
76
76
  const createCosey = (options = {}) => {
77
- const store = createStore();
77
+ const pinia = createPiniaStore();
78
78
  const router = createCoseyRouter(options.router);
79
79
  return {
80
80
  install(app) {
81
81
  provideGlobalConfig(app, options);
82
82
  app.use(router);
83
83
  registerRouterGuard(router);
84
- app.use(store);
84
+ app.use(pinia);
85
85
  registerGlobalComponents(app);
86
86
  },
87
- store,
87
+ pinia,
88
88
  router
89
89
  };
90
90
  };
@@ -13,8 +13,8 @@ var stdin_default = getSimpleStyleHook("LayoutAuth", (token) => {
13
13
  backgroundColor: token.colorBgLayout,
14
14
  [`${componentCls}-bg`]: {
15
15
  position: "absolute",
16
- top: 0,
17
- left: 0,
16
+ insetBlockStart: 0,
17
+ insetInlineStart: 0,
18
18
  width: "100%",
19
19
  height: "100%",
20
20
  background: `linear-gradient(154deg, transparent 35%, ${token.colorPrimaryBg} 35%, ${token.colorPrimaryBgHover} 50%, ${token.colorPrimaryBg} 65%, transparent 65%)`,
@@ -34,14 +34,14 @@ var stdin_default = getSimpleStyleHook("LayoutAuth", (token) => {
34
34
  },
35
35
  [`${componentCls}-brand`]: {
36
36
  position: "fixed",
37
- top: token.size,
38
- left: token.size,
37
+ insetBlockStart: token.size,
38
+ insetInlineStart: token.size,
39
39
  zIndex: 10
40
40
  },
41
41
  [`${componentCls}-widget`]: {
42
42
  position: "fixed",
43
- top: token.size,
44
- right: token.size,
43
+ insetBlockStart: token.size,
44
+ insetInlineEnd: token.size,
45
45
  zIndex: 10,
46
46
  display: "flex",
47
47
  paddingInline: token.padding,
@@ -2,6 +2,7 @@ import { defineComponent, ref, watch, resolveComponent, createBlock, openBlock,
2
2
  import { useRoute } from 'vue-router';
3
3
  import { getBreadcrumbRoutes } from '../../router/menus/index.js';
4
4
  import { useLayoutStore } from '../../store/layout.js';
5
+ import { useI18n } from 'vue-i18n';
5
6
 
6
7
  var stdin_default = /* @__PURE__ */defineComponent({
7
8
  ...{
@@ -9,6 +10,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
9
10
  },
10
11
  __name: "layout-breadcrumb",
11
12
  setup(__props) {
13
+ const {
14
+ t
15
+ } = useI18n();
12
16
  const layoutStore = useLayoutStore();
13
17
  const route = useRoute();
14
18
  const routes = ref([]);
@@ -31,7 +35,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
31
35
  }, {
32
36
  default: withCtx(() => [unref(route).name === item.route.name || item.children && item.children.length > 0 ? (openBlock(), createElementBlock(Fragment, {
33
37
  key: 0
34
- }, [createTextVNode(toDisplayString(item.route.meta?.title), 1
38
+ }, [createTextVNode(toDisplayString(unref(t)(item.route.meta?.title ?? "")), 1
35
39
  /* TEXT */)], 64
36
40
  /* STABLE_FRAGMENT */)) : (openBlock(), createBlock(_component_router_link, {
37
41
  key: 1,
@@ -39,7 +43,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
39
43
  name: String(item.route.name)
40
44
  }
41
45
  }, {
42
- default: withCtx(() => [createTextVNode(toDisplayString(item.route.meta?.title), 1
46
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)(item.route.meta?.title ?? "")), 1
43
47
  /* TEXT */)]),
44
48
  _: 2
45
49
  /* DYNAMIC */
@@ -1,13 +1,17 @@
1
- import { defineComponent, reactive, useTemplateRef, ref, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, createVNode, withKeys, withModifiers, withCtx, createTextVNode } from 'vue';
1
+ import { defineComponent, reactive, useTemplateRef, ref, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, createVNode, toDisplayString, withKeys, withModifiers, withCtx, createTextVNode } from 'vue';
2
2
  import { useRouter } from 'vue-router';
3
3
  import stdin_default$1 from './style/index.js';
4
4
  import { useUserStore } from '../../store/user.js';
5
5
  import { ElButton, ElMessage } from 'element-plus';
6
+ import { useLocale } from '../../hooks/useLocale.js';
6
7
  import { useComponentConfig } from '../../components/config-provider/config-provider.js';
7
8
 
8
9
  var stdin_default = /* @__PURE__ */defineComponent({
9
10
  __name: "layout-change-password",
10
11
  setup(__props) {
12
+ const {
13
+ t
14
+ } = useLocale();
11
15
  const {
12
16
  prefixCls
13
17
  } = useComponentConfig("layout-change-password");
@@ -31,7 +35,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
31
35
  oldPassword: formState.oldPassword,
32
36
  newPassword: formState.newPassword
33
37
  }).then(() => {
34
- ElMessage.success("\u4FEE\u6539\u6210\u529F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55");
38
+ ElMessage.success(t("co.auth.loginAgain"));
35
39
  userStore.logout();
36
40
  }).catch(() => {}).finally(() => {
37
41
  loading.value = false;
@@ -47,8 +51,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
47
51
  class: normalizeClass([unref(hashId), unref(prefixCls)])
48
52
  }, [createElementVNode("div", {
49
53
  class: normalizeClass(`${unref(prefixCls)}-title`)
50
- }, "\u4FEE\u6539\u5BC6\u7801", 2
51
- /* CLASS */), createVNode(_component_el_form, {
54
+ }, toDisplayString(unref(t)("co.auth.changePassword")), 3
55
+ /* TEXT, CLASS */), createVNode(_component_el_form, {
52
56
  ref_key: "formRef",
53
57
  ref: formRef,
54
58
  model: formState,
@@ -58,7 +62,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
58
62
  prop: "oldPassword",
59
63
  rules: [{
60
64
  required: true,
61
- message: "\u8BF7\u8F93\u5165\u539F\u5BC6\u7801"
65
+ message: unref(t)("co.auth.enterCurrentPassword")
62
66
  }]
63
67
  }, {
64
68
  default: withCtx(() => [createVNode(_component_el_input, {
@@ -67,7 +71,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
67
71
  type: "password",
68
72
  "show-password": "",
69
73
  size: "large",
70
- placeholder: "\u539F\u5BC6\u7801"
74
+ placeholder: unref(t)("co.auth.currentPassword")
71
75
  }, {
72
76
  prefix: withCtx(() => [createVNode(_component_co_icon, {
73
77
  name: "co:password",
@@ -75,14 +79,14 @@ var stdin_default = /* @__PURE__ */defineComponent({
75
79
  }, null, 8, ["class"])]),
76
80
  _: 1
77
81
  /* STABLE */
78
- }, 8, ["modelValue"])]),
82
+ }, 8, ["modelValue", "placeholder"])]),
79
83
  _: 1
80
84
  /* STABLE */
81
- }), createVNode(_component_el_form_item, {
85
+ }, 8, ["rules"]), createVNode(_component_el_form_item, {
82
86
  prop: "newPassword",
83
87
  rules: [{
84
88
  required: true,
85
- message: "\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801"
89
+ message: unref(t)("co.auth.enterNewPassword")
86
90
  }]
87
91
  }, {
88
92
  default: withCtx(() => [createVNode(_component_el_input, {
@@ -91,7 +95,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
91
95
  type: "password",
92
96
  "show-password": "",
93
97
  size: "large",
94
- placeholder: "\u65B0\u5BC6\u7801"
98
+ placeholder: unref(t)("co.auth.newPassword")
95
99
  }, {
96
100
  prefix: withCtx(() => [createVNode(_component_co_icon, {
97
101
  name: "co:password",
@@ -99,19 +103,19 @@ var stdin_default = /* @__PURE__ */defineComponent({
99
103
  }, null, 8, ["class"])]),
100
104
  _: 1
101
105
  /* STABLE */
102
- }, 8, ["modelValue"])]),
106
+ }, 8, ["modelValue", "placeholder"])]),
103
107
  _: 1
104
108
  /* STABLE */
105
- }), createVNode(_component_el_form_item, {
109
+ }, 8, ["rules"]), createVNode(_component_el_form_item, {
106
110
  prop: "confirmNewPassword",
107
111
  rules: [{
108
112
  required: true,
109
- message: "\u8BF7\u8F93\u5165\u786E\u8BA4\u5BC6\u7801"
113
+ message: unref(t)("co.auth.enterConfirmPassword")
110
114
  }, {
111
115
  validator(_, value) {
112
116
  return value === formState.newPassword;
113
117
  },
114
- message: "\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4",
118
+ message: unref(t)("co.auth.passwordNotMatch"),
115
119
  trigger: "blur"
116
120
  }]
117
121
  }, {
@@ -121,7 +125,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
121
125
  type: "password",
122
126
  "show-password": "",
123
127
  size: "large",
124
- placeholder: "\u786E\u8BA4\u5BC6\u7801"
128
+ placeholder: unref(t)("co.auth.confirmPassword")
125
129
  }, {
126
130
  prefix: withCtx(() => [createVNode(_component_co_icon, {
127
131
  name: "co:password",
@@ -129,7 +133,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
129
133
  }, null, 8, ["class"])]),
130
134
  _: 1
131
135
  /* STABLE */
132
- }, 8, ["modelValue"])]),
136
+ }, 8, ["modelValue", "placeholder"])]),
133
137
  _: 1
134
138
  /* STABLE */
135
139
  }, 8, ["rules"]), createVNode(_component_el_form_item, null, {
@@ -140,9 +144,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
140
144
  loading: loading.value,
141
145
  onClick: onSubmit
142
146
  }, {
143
- default: withCtx(() => _cache[4] || (_cache[4] = [createTextVNode(" \u4FEE\u6539\u5BC6\u7801 ")])),
144
- _: 1,
145
- __: [4]
147
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.auth.changePassword")), 1
148
+ /* TEXT */)]),
149
+ _: 1
150
+ /* STABLE */
146
151
  }, 8, ["class", "loading"])]),
147
152
  _: 1
148
153
  /* STABLE */
@@ -152,9 +157,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
152
157
  class: normalizeClass(`${unref(prefixCls)}-button`),
153
158
  onClick: _cache[3] || (_cache[3] = $event => unref(router).back())
154
159
  }, {
155
- default: withCtx(() => _cache[5] || (_cache[5] = [createTextVNode(" \u8FD4\u56DE ")])),
156
- _: 1,
157
- __: [5]
160
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.common.back")), 1
161
+ /* TEXT */)]),
162
+ _: 1
163
+ /* STABLE */
158
164
  }, 8, ["class"])]),
159
165
  _: 1
160
166
  /* STABLE */
@@ -18,7 +18,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
18
18
  const layoutStore = useLayoutStore();
19
19
  const contentStyle = computed(() => {
20
20
  return {
21
- marginLeft: layoutStore.sidebarWidth + "px"
21
+ marginInlineStart: layoutStore.sidebarWidth + "px"
22
22
  };
23
23
  });
24
24
  return (_ctx, _cache) => {
@@ -8,7 +8,7 @@ var stdin_default = getSimpleStyleHook("LayoutContent", (token) => {
8
8
  flexDirection: "column",
9
9
  flex: 1,
10
10
  minWidth: 0,
11
- transition: `margin-left ${token.motionDurationSlow}`
11
+ transition: `margin-inline-start ${token.motionDurationSlow}`
12
12
  }
13
13
  };
14
14
  });
@@ -1,6 +1,7 @@
1
- import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createVNode, unref, createTextVNode } from 'vue';
1
+ import { defineComponent, resolveComponent, createBlock, openBlock, unref, withCtx, createVNode, createTextVNode, toDisplayString } from 'vue';
2
2
  import { ElButton } from 'element-plus';
3
3
  import { useGlobalConfig } from '../../config/index.js';
4
+ import { useLocale } from '../../hooks/useLocale.js';
4
5
 
5
6
  var stdin_default = /* @__PURE__ */defineComponent({
6
7
  ...{
@@ -8,6 +9,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
8
9
  },
9
10
  __name: "layout-forbidden",
10
11
  setup(__props) {
12
+ const {
13
+ t
14
+ } = useLocale();
11
15
  const routerConfig = useGlobalConfig().router;
12
16
  return (_ctx, _cache) => {
13
17
  const _component_router_link = resolveComponent("router-link");
@@ -15,7 +19,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
15
19
  return openBlock(), createBlock(_component_el_result, {
16
20
  icon: "warning",
17
21
  title: "403",
18
- "sub-title": "\u5BF9\u4E0D\u8D77\uFF0C\u60A8\u6CA1\u6709\u6743\u9650\u8BBF\u95EE\u6B64\u9875\u9762\u3002"
22
+ "sub-title": unref(t)("co.exception.noPermission")
19
23
  }, {
20
24
  extra: withCtx(() => [createVNode(_component_router_link, {
21
25
  to: unref(routerConfig).homePath
@@ -23,16 +27,17 @@ var stdin_default = /* @__PURE__ */defineComponent({
23
27
  default: withCtx(() => [createVNode(unref(ElButton), {
24
28
  type: "primary"
25
29
  }, {
26
- default: withCtx(() => _cache[0] || (_cache[0] = [createTextVNode("\u8FD4\u56DE\u4E3B\u9875")])),
27
- _: 1,
28
- __: [0]
30
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.exception.backToHome")), 1
31
+ /* TEXT */)]),
32
+ _: 1
33
+ /* STABLE */
29
34
  })]),
30
35
  _: 1
31
36
  /* STABLE */
32
37
  }, 8, ["to"])]),
33
38
  _: 1
34
39
  /* STABLE */
35
- });
40
+ }, 8, ["sub-title"]);
36
41
  };
37
42
  }
38
43
  });
@@ -19,11 +19,11 @@ var stdin_default = /* @__PURE__ */defineComponent({
19
19
  const layoutStore = useLayoutStore();
20
20
  const locked = useLockscreenObserver();
21
21
  const headerStyle = computed(() => {
22
- const left = layoutStore.includeHorizontal ? 0 : layoutStore.sidebarWidth + "px";
23
- const paddingRight = locked.value ? window.innerWidth - document.body.offsetWidth + "px" : 0;
22
+ const insetInlineStart = layoutStore.includeHorizontal ? 0 : layoutStore.sidebarWidth + "px";
23
+ const paddingInlineEnd = locked.value ? window.innerWidth - document.body.offsetWidth + "px" : 0;
24
24
  return {
25
- left,
26
- paddingRight
25
+ insetInlineStart,
26
+ paddingInlineEnd
27
27
  };
28
28
  });
29
29
  return (_ctx, _cache) => {
@@ -5,9 +5,9 @@ var stdin_default = getSimpleStyleHook("LayoutHeader", (token) => {
5
5
  return {
6
6
  [componentCls]: {
7
7
  position: "fixed",
8
- top: 0,
9
- left: 0,
10
- right: 0,
8
+ insetBlockStart: 0,
9
+ insetInlineStart: 0,
10
+ insetInlineEnd: 0,
11
11
  zIndex: 1e3,
12
12
  backgroundColor: token.colorBgContainer,
13
13
  transition: `left ${token.motionDurationSlow}`
@@ -5,8 +5,8 @@ var stdin_default = getSimpleStyleHook("LayoutIframe", (token) => {
5
5
  return {
6
6
  [componentCls]: {
7
7
  position: "absolute",
8
- top: 0,
9
- left: 0,
8
+ insetBlockStart: 0,
9
+ insetInlineStart: 0,
10
10
  width: "100%",
11
11
  height: "100%",
12
12
  [`${componentCls}-loading`]: {
@@ -1,6 +1,7 @@
1
- import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createVNode, unref, createTextVNode } from 'vue';
1
+ import { defineComponent, resolveComponent, createBlock, openBlock, unref, withCtx, createVNode, createTextVNode, toDisplayString } from 'vue';
2
2
  import { ElButton } from 'element-plus';
3
3
  import { useGlobalConfig } from '../../config/index.js';
4
+ import { useLocale } from '../../hooks/useLocale.js';
4
5
 
5
6
  var stdin_default = /* @__PURE__ */defineComponent({
6
7
  ...{
@@ -8,6 +9,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
8
9
  },
9
10
  __name: "layout-internal-server-error",
10
11
  setup(__props) {
12
+ const {
13
+ t
14
+ } = useLocale();
11
15
  const routerConfig = useGlobalConfig().router;
12
16
  return (_ctx, _cache) => {
13
17
  const _component_router_link = resolveComponent("router-link");
@@ -15,7 +19,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
15
19
  return openBlock(), createBlock(_component_el_result, {
16
20
  icon: "error",
17
21
  title: "500",
18
- "sub-title": "\u5BF9\u4E0D\u8D77\uFF0C\u670D\u52A1\u5668\u9519\u8BEF\u3002"
22
+ "sub-title": unref(t)("co.exception.serverError")
19
23
  }, {
20
24
  extra: withCtx(() => [createVNode(_component_router_link, {
21
25
  to: unref(routerConfig).homePath
@@ -23,16 +27,17 @@ var stdin_default = /* @__PURE__ */defineComponent({
23
27
  default: withCtx(() => [createVNode(unref(ElButton), {
24
28
  type: "primary"
25
29
  }, {
26
- default: withCtx(() => _cache[0] || (_cache[0] = [createTextVNode("\u8FD4\u56DE\u4E3B\u9875")])),
27
- _: 1,
28
- __: [0]
30
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.exception.backToHome")), 1
31
+ /* TEXT */)]),
32
+ _: 1
33
+ /* STABLE */
29
34
  })]),
30
35
  _: 1
31
36
  /* STABLE */
32
37
  }, 8, ["to"])]),
33
38
  _: 1
34
39
  /* STABLE */
35
- });
40
+ }, 8, ["sub-title"]);
36
41
  };
37
42
  }
38
43
  });
@@ -1,12 +1,16 @@
1
- import { defineComponent, reactive, useTemplateRef, ref, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, createVNode, withKeys, withModifiers, withCtx, createTextVNode } from 'vue';
1
+ import { defineComponent, reactive, useTemplateRef, ref, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, createVNode, toDisplayString, withKeys, withModifiers, withCtx, createTextVNode } from 'vue';
2
2
  import { ElButton } from 'element-plus';
3
3
  import { useUserStore } from '../../store/user.js';
4
4
  import stdin_default$1 from './style/index.js';
5
+ import { useLocale } from '../../hooks/useLocale.js';
5
6
  import { useComponentConfig } from '../../components/config-provider/config-provider.js';
6
7
 
7
8
  var stdin_default = /* @__PURE__ */defineComponent({
8
9
  __name: "layout-login",
9
10
  setup(__props) {
11
+ const {
12
+ t
13
+ } = useLocale();
10
14
  const {
11
15
  prefixCls
12
16
  } = useComponentConfig("layout-login");
@@ -38,8 +42,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
38
42
  class: normalizeClass([unref(hashId), unref(prefixCls)])
39
43
  }, [createElementVNode("div", {
40
44
  class: normalizeClass(`${unref(prefixCls)}-title`)
41
- }, "\u767B\u5F55", 2
42
- /* CLASS */), createVNode(_component_el_form, {
45
+ }, toDisplayString(unref(t)("co.auth.login")), 3
46
+ /* TEXT, CLASS */), createVNode(_component_el_form, {
43
47
  ref_key: "formRef",
44
48
  ref: formRef,
45
49
  model: formState,
@@ -49,14 +53,14 @@ var stdin_default = /* @__PURE__ */defineComponent({
49
53
  prop: "username",
50
54
  rules: [{
51
55
  required: true,
52
- message: "\u8BF7\u8F93\u5165\u7528\u6237\u540D"
56
+ message: unref(t)("co.auth.enterUsername")
53
57
  }]
54
58
  }, {
55
59
  default: withCtx(() => [createVNode(_component_el_input, {
56
60
  modelValue: formState.username,
57
61
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => formState.username = $event),
58
62
  size: "large",
59
- placeholder: "\u7528\u6237\u540D"
63
+ placeholder: unref(t)("co.auth.username")
60
64
  }, {
61
65
  prefix: withCtx(() => [createVNode(_component_co_icon, {
62
66
  name: "co:user",
@@ -64,14 +68,14 @@ var stdin_default = /* @__PURE__ */defineComponent({
64
68
  }, null, 8, ["class"])]),
65
69
  _: 1
66
70
  /* STABLE */
67
- }, 8, ["modelValue"])]),
71
+ }, 8, ["modelValue", "placeholder"])]),
68
72
  _: 1
69
73
  /* STABLE */
70
- }), createVNode(_component_el_form_item, {
74
+ }, 8, ["rules"]), createVNode(_component_el_form_item, {
71
75
  prop: "password",
72
76
  rules: [{
73
77
  required: true,
74
- message: "\u8BF7\u8F93\u5165\u5BC6\u7801"
78
+ message: unref(t)("co.auth.enterPassword")
75
79
  }]
76
80
  }, {
77
81
  default: withCtx(() => [createVNode(_component_el_input, {
@@ -80,7 +84,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
80
84
  type: "password",
81
85
  "show-password": "",
82
86
  size: "large",
83
- placeholder: "\u5BC6\u7801"
87
+ placeholder: unref(t)("co.auth.password")
84
88
  }, {
85
89
  prefix: withCtx(() => [createVNode(_component_co_icon, {
86
90
  name: "co:password",
@@ -88,19 +92,20 @@ var stdin_default = /* @__PURE__ */defineComponent({
88
92
  }, null, 8, ["class"])]),
89
93
  _: 1
90
94
  /* STABLE */
91
- }, 8, ["modelValue"])]),
95
+ }, 8, ["modelValue", "placeholder"])]),
92
96
  _: 1
93
97
  /* STABLE */
94
- }), createVNode(unref(ElButton), {
98
+ }, 8, ["rules"]), createVNode(unref(ElButton), {
95
99
  size: "large",
96
100
  type: "primary",
97
101
  class: normalizeClass(`${unref(prefixCls)}-button`),
98
102
  loading: loading.value,
99
103
  onClick: onSubmit
100
104
  }, {
101
- default: withCtx(() => _cache[2] || (_cache[2] = [createTextVNode(" \u767B\u5F55 ")])),
102
- _: 1,
103
- __: [2]
105
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.auth.login")), 1
106
+ /* TEXT */)]),
107
+ _: 1
108
+ /* STABLE */
104
109
  }, 8, ["class", "loading"])]),
105
110
  _: 1
106
111
  /* STABLE */
@@ -20,7 +20,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
20
20
  const layoutStore = useLayoutStore();
21
21
  const mainStyle = computed(() => {
22
22
  return {
23
- marginTop: layoutStore.headerHeight + "px"
23
+ marginBlockStart: layoutStore.headerHeight + "px"
24
24
  };
25
25
  });
26
26
  return (_ctx, _cache) => {