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.
- package/README.md +61 -0
- package/components/close/style/index.js +2 -2
- package/components/col/col.vue.js +1 -1
- package/components/col/style/index.js +3 -3
- package/components/config-provider/config-provider.d.ts +2 -0
- package/components/config-provider/config-provider.vue.js +13 -3
- package/components/context-menu/context-menu.vue.js +4 -4
- package/components/context-menu/context-sub-menu.vue.js +2 -2
- package/components/context-menu/style/index.js +2 -2
- package/components/editor/components/color-picker/color-picker.vue.js +15 -11
- package/components/editor/components/color-picker/useHistoryColor.js +3 -3
- package/components/editor/components/resize/resize.js +9 -9
- package/components/editor/components/resize/resize.style.js +20 -20
- package/components/editor/components/resize/resize.vue.js +2 -2
- package/components/editor/components/table-toolbar/table-toolbar.style.js +2 -2
- package/components/editor/components/table-toolbar/table-toolbar.vue.js +2 -2
- package/components/editor/components/toolbar/formats/font.vue.js +5 -1
- package/components/editor/components/toolbar/formats/header.vue.js +6 -2
- package/components/editor/components/toolbar/formats/link.vue.js +17 -13
- package/components/editor/components/toolbar/formats/size.vue.js +5 -1
- package/components/editor/components/toolbar/formats/source.vue.d.ts +2 -0
- package/components/editor/components/toolbar/formats/source.vue.js +78 -0
- package/components/editor/components/toolbar/formats/table.style.js +2 -2
- package/components/editor/components/toolbar/formats/video.vue.js +9 -5
- package/components/editor/components/toolbar/toolbar.vue.js +5 -0
- package/components/editor/formats/font.js +2 -2
- package/components/editor/formats/indent.js +1 -1
- package/components/editor/formats/kbd.d.ts +7 -0
- package/components/editor/formats/kbd.js +13 -0
- package/components/editor/modules/image-uploader/formats/image-loading.style.js +2 -2
- package/components/editor/quill.js +8 -6
- package/components/editor/style/index.js +25 -16
- package/components/field/components/autocomplete/autocomplete.vue.js +5 -1
- package/components/field/components/cascader/cascader.vue.js +5 -1
- package/components/field/components/checkbox-group/checkbox-group.vue.js +1 -1
- package/components/field/components/checkbox-group/panel.vue.js +10 -5
- package/components/field/components/date/date.vue.js +5 -1
- package/components/field/components/date-range/date-range.vue.js +6 -2
- package/components/field/components/date-time/date-time.vue.js +5 -1
- package/components/field/components/date-time-range/date-time-range.vue.js +6 -2
- package/components/field/components/dates/dates.vue.js +5 -1
- package/components/field/components/input/input.vue.js +5 -1
- package/components/field/components/input-tag/input-tag.vue.js +5 -1
- package/components/field/components/mention/mention.vue.js +5 -1
- package/components/field/components/month/month.vue.js +5 -1
- package/components/field/components/month-range/month-range.vue.js +6 -2
- package/components/field/components/months/months.vue.js +5 -1
- package/components/field/components/password/password.vue.js +5 -1
- package/components/field/components/select/select.d.ts +2 -2
- package/components/field/components/select/select.js +3 -3
- package/components/field/components/select/select.vue.js +5 -1
- package/components/field/components/select-v2/select-v2.d.ts +6 -3
- package/components/field/components/select-v2/select-v2.js +9 -0
- package/components/field/components/select-v2/select-v2.vue.js +21 -3
- package/components/field/components/textarea/textarea.vue.js +5 -1
- package/components/field/components/time/time.vue.js +5 -1
- package/components/field/components/time-range/time-range.vue.js +6 -2
- package/components/field/components/time-select/time-select.vue.js +5 -1
- package/components/field/components/tree-select/tree-select.vue.js +5 -1
- package/components/field/components/week/week.vue.js +6 -2
- package/components/field/components/year/year.vue.js +5 -1
- package/components/field/components/year-range/year-range.vue.js +6 -2
- package/components/field/components/years/years.vue.js +5 -1
- package/components/form/form-item.d.ts +1 -1
- package/components/form/form.d.ts +2 -0
- package/components/form/form.js +2 -2
- package/components/form/form.vue.d.ts +5 -0
- package/components/form/form.vue.js +6 -2
- package/components/form/index.d.ts +10 -1
- package/components/form/useBubbleTemplate.js +13 -5
- package/components/form-dialog/form-dialog.js +2 -2
- package/components/form-dialog/index.d.ts +4 -1552
- package/components/form-list/form-list.js +1 -1
- package/components/form-list/form-list.vue.js +5 -1
- package/components/form-list/index.d.ts +1 -1
- package/components/form-query/form-query.d.ts +2 -0
- package/components/form-query/form-query.vue.d.ts +5 -0
- package/components/form-query/form-query.vue.js +13 -7
- package/components/form-query/index.d.ts +9 -0
- package/components/highlight/style/index.js +2 -2
- package/components/horizontal-tree/horizontal-tree.vue.js +11 -6
- package/components/image-card/image-card.d.ts +1 -8
- package/components/image-card/image-card.vue.d.ts +4 -18
- package/components/image-card/index.d.ts +8 -29
- package/components/long-text/style/index.js +2 -2
- package/components/mask/style/index.js +2 -2
- package/components/row/row.vue.js +1 -1
- package/components/scroll-view/scroll-view.vue.js +1 -1
- package/components/scroll-view/style/index.js +9 -9
- package/components/table/index.d.ts +73 -78
- package/components/table/table-column/renderer.d.ts +2 -1
- package/components/table/table-column/renderer.js +2 -2
- package/components/table/table-column/table-column.d.ts +15 -15
- package/components/table/table-column/table-column.vue.d.ts +9 -5
- package/components/table/table-column/table-column.vue.js +5 -1
- package/components/table/table-column-editor/table-column-editor.vue.js +22 -14
- package/components/table/table-export/table-export.vue.js +31 -26
- package/components/table/table-query/table-query.d.ts +2 -0
- package/components/table/table-query/table-query.vue.d.ts +5 -0
- package/components/table/table.d.ts +22 -25
- package/components/table/table.vue.d.ts +45 -51
- package/components/table/table.vue.js +13 -9
- package/components/table/useTable.d.ts +2 -1
- package/components/table/useTable.js +2 -2
- package/components/table-action/index.d.ts +48 -6
- package/components/table-action/item.d.ts +16 -2
- package/components/table-action/item.vue.d.ts +34 -6
- package/components/table-action/item.vue.js +15 -9
- package/components/table-action/table-action.vue.d.ts +16 -2
- package/components/toggle/toggle.vue.js +5 -1
- package/components/upload/style/index.js +2 -2
- package/components/upload/upload-item.vue.d.ts +2 -2
- package/components/upload/upload-item.vue.js +16 -9
- package/components/upload/upload.vue.js +7 -1
- package/config/index.d.ts +1 -2
- package/config/index.js +2 -2
- package/config/nprogress.style.js +5 -5
- package/config/root-config-provider.vue.js +5 -5
- package/constant.d.ts +2 -2
- package/constant.js +2 -2
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useColorScheme.js +4 -4
- package/hooks/useDir.d.ts +2 -0
- package/hooks/useDir.js +20 -0
- package/hooks/useEcharts.d.ts +3 -2
- package/hooks/useEcharts.js +15 -3
- package/hooks/useLocale.d.ts +23 -371
- package/hooks/useLocale.js +26 -35
- package/hooks/useUpsert.d.ts +5 -3
- package/hooks/useUpsert.js +33 -25
- package/index.d.ts +1 -1
- package/index.js +4 -4
- package/layout/layout-auth/style/index.js +6 -6
- package/layout/layout-breadcrumb/layout-breadcrumb.vue.js +6 -2
- package/layout/layout-change-password/layout-change-password.vue.js +28 -22
- package/layout/layout-content/layout-content.vue.js +1 -1
- package/layout/layout-content/style/index.js +1 -1
- package/layout/layout-forbidden/layout-forbidden.vue.js +11 -6
- package/layout/layout-header/layout-header.vue.js +4 -4
- package/layout/layout-header/style/index.js +3 -3
- package/layout/layout-iframe/style/index.js +2 -2
- package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +11 -6
- package/layout/layout-login/layout-login.vue.js +19 -14
- package/layout/layout-main/layout-main.vue.js +1 -1
- package/layout/layout-menu/layout-menu.vue.js +5 -1
- package/layout/layout-menu/style/index.js +1 -1
- package/layout/layout-not-found/layout-not-found.vue.js +11 -6
- package/layout/layout-search/layout-search.vue.js +22 -14
- package/layout/layout-sidebar/layout-sidebar.vue.js +8 -5
- package/layout/layout-sidebar/style/index.js +2 -2
- package/layout/layout-snug-aside/style/index.js +1 -1
- package/layout/layout-tabbar/layout-tabbar.vue.js +21 -13
- package/layout/layout-tabbar/style/index.js +1 -1
- package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +24 -17
- package/layout/layout-user-menu/layout-user-menu.vue.js +10 -6
- package/locale/index.d.ts +10 -0
- package/locale/index.js +2 -0
- package/locale/lang/ar.d.ts +280 -0
- package/locale/lang/ar.js +129 -0
- package/locale/lang/en.d.ts +302 -0
- package/locale/lang/en.js +129 -0
- package/locale/lang/zh-cn.d.ts +301 -0
- package/locale/lang/zh-cn.js +129 -0
- package/package.json +10 -8
- package/request/useRequest.js +31 -23
- package/store/index.d.ts +1 -1
- package/store/index.js +6 -3
- package/store/layout.js +208 -190
- package/store/plugin.d.ts +9 -0
- package/store/plugin.js +22 -0
- package/store/user.d.ts +1 -1
- package/utils/css.d.ts +4 -0
- package/utils/css.js +5 -2
- package/utils/excel/bookFormats.js +5 -5
- package/utils/excel/xlsx.js +2 -2
- package/utils/index.js +1 -1
- package/utils/message-box.js +3 -1
- package/utils/tree.js +2 -2
- package/components/form-dialog/form-dialog.vue.d.ts +0 -675
package/hooks/useUpsert.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ElMessage } from 'element-plus';
|
|
2
2
|
import { cloneDeep, pick } from 'lodash-es';
|
|
3
|
-
import { useTemplateRef, onMounted,
|
|
4
|
-
import {
|
|
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: "
|
|
9
|
-
add: "
|
|
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 || "
|
|
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 || "
|
|
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 =
|
|
63
|
+
const data = shallowRef();
|
|
64
|
+
const row = shallowRef();
|
|
61
65
|
let exposeOptions;
|
|
62
66
|
const expose = {
|
|
63
|
-
edit: async (
|
|
67
|
+
edit: async (_row) => {
|
|
64
68
|
type.value = "edit";
|
|
65
|
-
|
|
69
|
+
row.value = _row;
|
|
70
|
+
deepAssign(unref(model), initialModel);
|
|
66
71
|
visible.value = true;
|
|
67
|
-
show?.(type.value, row);
|
|
68
|
-
let filledRow =
|
|
69
|
-
if (details) {
|
|
70
|
-
filledRow = await details(
|
|
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
|
-
|
|
83
|
+
row.value = void 0;
|
|
84
|
+
deepAssign(unref(model), initialModel);
|
|
79
85
|
visible.value = true;
|
|
80
|
-
show?.(type.value
|
|
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
|
-
|
|
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 {
|
|
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
|
|
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(
|
|
84
|
+
app.use(pinia);
|
|
85
85
|
registerGlobalComponents(app);
|
|
86
86
|
},
|
|
87
|
-
|
|
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
|
-
|
|
17
|
-
|
|
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
|
-
|
|
38
|
-
|
|
37
|
+
insetBlockStart: token.size,
|
|
38
|
+
insetInlineStart: token.size,
|
|
39
39
|
zIndex: 10
|
|
40
40
|
},
|
|
41
41
|
[`${componentCls}-widget`]: {
|
|
42
42
|
position: "fixed",
|
|
43
|
-
|
|
44
|
-
|
|
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("
|
|
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
|
-
}, "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
113
|
+
message: unref(t)("co.auth.enterConfirmPassword")
|
|
110
114
|
}, {
|
|
111
115
|
validator(_, value) {
|
|
112
116
|
return value === formState.newPassword;
|
|
113
117
|
},
|
|
114
|
-
message: "
|
|
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: "
|
|
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(() =>
|
|
144
|
-
|
|
145
|
-
|
|
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(() =>
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
21
|
+
marginInlineStart: layoutStore.sidebarWidth + "px"
|
|
22
22
|
};
|
|
23
23
|
});
|
|
24
24
|
return (_ctx, _cache) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createVNode,
|
|
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": "
|
|
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(() =>
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
23
|
-
const
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
insetBlockStart: 0,
|
|
9
|
+
insetInlineStart: 0,
|
|
10
|
+
insetInlineEnd: 0,
|
|
11
11
|
zIndex: 1e3,
|
|
12
12
|
backgroundColor: token.colorBgContainer,
|
|
13
13
|
transition: `left ${token.motionDurationSlow}`
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createVNode,
|
|
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": "
|
|
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(() =>
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
}, "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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(() =>
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
23
|
+
marginBlockStart: layoutStore.headerHeight + "px"
|
|
24
24
|
};
|
|
25
25
|
});
|
|
26
26
|
return (_ctx, _cache) => {
|