@gct-paas/design-web 0.1.4-dev.16 → 0.1.4-dev.18
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.min.css +1 -1
- package/dist/loader.esm.min.js +1 -1
- package/es/components/form-component/FieldCheckbox.d.ts +1 -1
- package/es/components/form-component/FieldCheckbox.mjs +2 -2
- package/es/components/form-component/FieldRadio.d.ts +1 -1
- package/es/components/form-component/FieldRadio.mjs +1 -1
- package/es/components/form-component/FieldSelect.d.ts +1 -1
- package/es/components/form-component/FieldSelect.mjs +2 -2
- package/es/components/form-component/field-label/ref-card-label-design.vue.d.ts +17 -0
- package/es/components/form-component/field-label/ref-card-label-design.vue.mjs +6 -0
- package/es/components/form-component/field-label/ref-card-label-design.vue_vue_type_script_setup_true_lang.mjs +125 -0
- package/es/components/form-component/field-label/ref-card-label-design.vue_vue_type_style_index_0_lang.css +9 -0
- package/es/components/form-component/field-label/tag-label.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/form-component/field-label/tag-span.vue.mjs +1 -1
- package/es/components/form-component/index.d.ts +2 -1
- package/es/components/form-component/index.mjs +1 -0
- package/es/components/index.d.ts +0 -1
- package/es/components/index.mjs +1 -8
- package/es/index.mjs +2 -8
- package/package.json +7 -7
- package/es/components/I18nSelect/index.d.ts +0 -7
- package/es/components/I18nSelect/index.mjs +0 -7
- package/es/components/I18nSelect/src/i18n-modal.vue.d.ts +0 -21
- package/es/components/I18nSelect/src/i18n-modal.vue.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-modal.vue_vue_type_script_setup_true_lang.mjs +0 -128
- package/es/components/I18nSelect/src/i18n-select-btn.vue.d.ts +0 -17
- package/es/components/I18nSelect/src/i18n-select-btn.vue.mjs +0 -7
- package/es/components/I18nSelect/src/i18n-select-btn.vue_vue_type_script_setup_true_name_i18n-select-btn_lang.mjs +0 -116
- package/es/components/I18nSelect/src/i18n-select-btn.vue_vue_type_style_index_0_scoped_dc8ffb2c_lang.css +0 -58
- package/es/components/I18nSelect/src/i18n-select-container.vue.d.ts +0 -10
- package/es/components/I18nSelect/src/i18n-select-container.vue.mjs +0 -7
- package/es/components/I18nSelect/src/i18n-select-container.vue_vue_type_script_setup_true_name_i18n-select-container_lang.mjs +0 -217
- package/es/components/I18nSelect/src/i18n-select-container.vue_vue_type_style_index_0_scoped_0160ed5e_lang.css +0 -6
- package/es/components/I18nSelect/src/i18n-select-input-form.vue.d.ts +0 -15
- package/es/components/I18nSelect/src/i18n-select-input-form.vue.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-select-input-form.vue_vue_type_script_setup_true_name_i18n-select-input-form_lang.mjs +0 -56
- package/es/components/I18nSelect/src/i18n-select-input.vue.d.ts +0 -51
- package/es/components/I18nSelect/src/i18n-select-input.vue.mjs +0 -7
- package/es/components/I18nSelect/src/i18n-select-input.vue_vue_type_script_setup_true_name_i18n-select-input_lang.mjs +0 -125
- package/es/components/I18nSelect/src/i18n-select-input.vue_vue_type_style_index_0_scoped_64c5221c_lang.css +0 -3
- package/es/components/I18nSelect/src/i18n-select-modal.vue.d.ts +0 -4
- package/es/components/I18nSelect/src/i18n-select-modal.vue.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-select-modal.vue_vue_type_script_setup_true_lang.mjs +0 -19
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.d.ts +0 -15
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue_vue_type_script_setup_true_name_i18n-select-input-form_lang.mjs +0 -56
- package/es/components/I18nSelect/src/i18n-select-textarea.vue.d.ts +0 -26
- package/es/components/I18nSelect/src/i18n-select-textarea.vue.mjs +0 -7
- package/es/components/I18nSelect/src/i18n-select-textarea.vue_vue_type_script_setup_true_name_i18n-select-input_lang.mjs +0 -86
- package/es/components/I18nSelect/src/i18n-select-textarea.vue_vue_type_style_index_0_scoped_cd95c416_lang.css +0 -17
- package/es/components/I18nSelect/src/useI18nSelect.d.ts +0 -13
- package/es/components/I18nSelect/src/useI18nSelect.mjs +0 -47
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { Fragment, createBlock, createElementBlock, createVNode, defineComponent, mergeProps, openBlock, reactive, ref, renderList, resolveComponent, toRaw, unref, withCtx } from "vue";
|
|
2
|
-
import { useModalInner } from "@gct-paas/core-web";
|
|
3
|
-
import { t } from "@gct-paas/core";
|
|
4
|
-
//#region src/components/I18nSelect/src/i18n-modal.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var i18n_modal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
6
|
-
__name: "i18n-modal",
|
|
7
|
-
props: {
|
|
8
|
-
lang: {},
|
|
9
|
-
getContainer: { type: Function }
|
|
10
|
-
},
|
|
11
|
-
emits: ["ok", "register"],
|
|
12
|
-
setup(__props, { emit: __emit }) {
|
|
13
|
-
const props = __props;
|
|
14
|
-
const emit = __emit;
|
|
15
|
-
const formRef = ref();
|
|
16
|
-
const i18nState = reactive({ id: "" });
|
|
17
|
-
const isEdit = ref(false);
|
|
18
|
-
const handleShow = (visible) => {
|
|
19
|
-
if (visible) isEdit.value = false;
|
|
20
|
-
};
|
|
21
|
-
const [registerInner, { closeModal }] = useModalInner((data) => {
|
|
22
|
-
data && onDataReceive(data);
|
|
23
|
-
});
|
|
24
|
-
const onDataReceive = (data) => {
|
|
25
|
-
isEdit.value = true;
|
|
26
|
-
i18nState.id = data.key;
|
|
27
|
-
const { lang } = props;
|
|
28
|
-
console.log(lang, "lang========");
|
|
29
|
-
for (const item of lang) {
|
|
30
|
-
const key = item.dataIndex;
|
|
31
|
-
i18nState[key] = data[key];
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const validateSpecialCharacters = (_, value, callback) => {
|
|
35
|
-
if (!/^[a-zA-Z_.]*$/.test(value)) callback(t("sys.i18n.validated18nKeyErrorMsg"));
|
|
36
|
-
callback();
|
|
37
|
-
};
|
|
38
|
-
const validateLang = async (_rule, value) => {
|
|
39
|
-
if (/^\s*$/g.test(value)) return Promise.reject(t("sys.notEmptySth", { sth: t("sys.i18n") }));
|
|
40
|
-
else return Promise.resolve();
|
|
41
|
-
};
|
|
42
|
-
const handleOk = () => {
|
|
43
|
-
formRef.value?.validate().then(() => {
|
|
44
|
-
emit("ok", { ...toRaw(i18nState) }, isEdit.value);
|
|
45
|
-
closeModal();
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
const handleClose = () => {
|
|
49
|
-
formRef.value?.resetFields();
|
|
50
|
-
};
|
|
51
|
-
return (_ctx, _cache) => {
|
|
52
|
-
const _component_a_input = resolveComponent("a-input");
|
|
53
|
-
const _component_a_form_item = resolveComponent("a-form-item");
|
|
54
|
-
const _component_a_form = resolveComponent("a-form");
|
|
55
|
-
const _component_BasicModal = resolveComponent("BasicModal");
|
|
56
|
-
return openBlock(), createBlock(_component_BasicModal, mergeProps(_ctx.$attrs, {
|
|
57
|
-
title: isEdit.value ? unref(t)("sys.edit") : unref(t)("sys.new"),
|
|
58
|
-
centered: "",
|
|
59
|
-
width: "640px",
|
|
60
|
-
"min-height": 100,
|
|
61
|
-
"mask-closable": false,
|
|
62
|
-
"after-close": handleClose,
|
|
63
|
-
"get-container": __props.getContainer,
|
|
64
|
-
onRegister: unref(registerInner),
|
|
65
|
-
onOk: handleOk,
|
|
66
|
-
onVisibleChange: handleShow
|
|
67
|
-
}), {
|
|
68
|
-
default: withCtx(() => [createVNode(_component_a_form, {
|
|
69
|
-
ref_key: "formRef",
|
|
70
|
-
ref: formRef,
|
|
71
|
-
model: i18nState,
|
|
72
|
-
"label-col": { span: 6 },
|
|
73
|
-
"wrapper-col": { span: 16 },
|
|
74
|
-
autocomplete: "off",
|
|
75
|
-
layout: "horizontal"
|
|
76
|
-
}, {
|
|
77
|
-
default: withCtx(() => [createVNode(_component_a_form_item, {
|
|
78
|
-
label: unref(t)("sys.i18n.resourceIdentification"),
|
|
79
|
-
name: "id",
|
|
80
|
-
rules: [{
|
|
81
|
-
required: true,
|
|
82
|
-
message: unref(t)("sys.pleaseInputSth", { sth: unref(t)("sys.i18n.resourceIdentification") })
|
|
83
|
-
}, { validator: validateSpecialCharacters }]
|
|
84
|
-
}, {
|
|
85
|
-
default: withCtx(() => [createVNode(_component_a_input, {
|
|
86
|
-
value: i18nState.id,
|
|
87
|
-
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => i18nState.id = $event),
|
|
88
|
-
"show-count": "",
|
|
89
|
-
maxlength: 128,
|
|
90
|
-
disabled: isEdit.value
|
|
91
|
-
}, null, 8, ["value", "disabled"])]),
|
|
92
|
-
_: 1
|
|
93
|
-
}, 8, ["label", "rules"]), (openBlock(true), createElementBlock(Fragment, null, renderList(props.lang, (item) => {
|
|
94
|
-
return openBlock(), createBlock(_component_a_form_item, {
|
|
95
|
-
key: item.dataIndex,
|
|
96
|
-
label: item.title,
|
|
97
|
-
name: item.dataIndex,
|
|
98
|
-
rules: [{
|
|
99
|
-
required: true,
|
|
100
|
-
message: unref(t)("sys.pleaseInputSth", { sth: item.title })
|
|
101
|
-
}, { validator: validateLang }]
|
|
102
|
-
}, {
|
|
103
|
-
default: withCtx(() => [createVNode(_component_a_input, {
|
|
104
|
-
value: i18nState[item.dataIndex],
|
|
105
|
-
"onUpdate:value": ($event) => i18nState[item.dataIndex] = $event,
|
|
106
|
-
"show-count": "",
|
|
107
|
-
maxlength: 300
|
|
108
|
-
}, null, 8, ["value", "onUpdate:value"])]),
|
|
109
|
-
_: 2
|
|
110
|
-
}, 1032, [
|
|
111
|
-
"label",
|
|
112
|
-
"name",
|
|
113
|
-
"rules"
|
|
114
|
-
]);
|
|
115
|
-
}), 128))]),
|
|
116
|
-
_: 1
|
|
117
|
-
}, 8, ["model"])]),
|
|
118
|
-
_: 1
|
|
119
|
-
}, 16, [
|
|
120
|
-
"title",
|
|
121
|
-
"get-container",
|
|
122
|
-
"onRegister"
|
|
123
|
-
]);
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
//#endregion
|
|
128
|
-
export { i18n_modal_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
i18nValue?: string;
|
|
3
|
-
buttonExtraProps?: IObject;
|
|
4
|
-
size?: string;
|
|
5
|
-
i18nModalKey?: string;
|
|
6
|
-
simpleBtn?: boolean;
|
|
7
|
-
btnHeight?: string;
|
|
8
|
-
btnWidth?: string;
|
|
9
|
-
}
|
|
10
|
-
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
-
"on-select-i18n": (...args: any[]) => void;
|
|
12
|
-
closed: (...args: any[]) => void;
|
|
13
|
-
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
14
|
-
"onOn-select-i18n"?: ((...args: any[]) => any) | undefined;
|
|
15
|
-
onClosed?: ((...args: any[]) => any) | undefined;
|
|
16
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
2
|
-
import i18n_select_btn_vue_vue_type_script_setup_true_name_i18n_select_btn_lang_default from "./i18n-select-btn.vue_vue_type_script_setup_true_name_i18n-select-btn_lang.mjs";
|
|
3
|
-
import './i18n-select-btn.vue_vue_type_style_index_0_scoped_dc8ffb2c_lang.css';/* empty css */
|
|
4
|
-
//#region src/components/I18nSelect/src/i18n-select-btn.vue
|
|
5
|
-
var i18n_select_btn_default = /* @__PURE__ */ _plugin_vue_export_helper_default(i18n_select_btn_vue_vue_type_script_setup_true_name_i18n_select_btn_lang_default, [["__scopeId", "data-v-dc8ffb2c"]]);
|
|
6
|
-
//#endregion
|
|
7
|
-
export { i18n_select_btn_default as default };
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { useI18nSelect } from "./useI18nSelect.mjs";
|
|
2
|
-
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, reactive, ref, renderList, resolveComponent, toDisplayString, watch, withCtx } from "vue";
|
|
3
|
-
import { isEmpty } from "lodash-es";
|
|
4
|
-
//#region src/components/I18nSelect/src/i18n-select-btn.vue?vue&type=script&setup=true&name=i18n-select-btn&lang.ts
|
|
5
|
-
var _hoisted_1 = { class: "i18n-tooltip-title" };
|
|
6
|
-
var _hoisted_2 = { style: { "margin-left": "4px" } };
|
|
7
|
-
var i18n_select_btn_vue_vue_type_script_setup_true_name_i18n_select_btn_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
|
-
__name: "i18n-select-btn",
|
|
9
|
-
props: {
|
|
10
|
-
i18nValue: {},
|
|
11
|
-
buttonExtraProps: {},
|
|
12
|
-
size: {},
|
|
13
|
-
i18nModalKey: {},
|
|
14
|
-
simpleBtn: { type: Boolean },
|
|
15
|
-
btnHeight: {},
|
|
16
|
-
btnWidth: {}
|
|
17
|
-
},
|
|
18
|
-
emits: ["on-select-i18n", "closed"],
|
|
19
|
-
setup(__props, { emit: __emit }) {
|
|
20
|
-
const getEnableLocaleList = ref();
|
|
21
|
-
const i18nInstance = useI18nSelect();
|
|
22
|
-
const props = __props;
|
|
23
|
-
const emit = __emit;
|
|
24
|
-
const i18nMap = reactive({});
|
|
25
|
-
const isHighlight = computed(() => {
|
|
26
|
-
return !isEmpty(props.i18nValue);
|
|
27
|
-
});
|
|
28
|
-
const getTableData = async (keyword) => {
|
|
29
|
-
const result = await _api.apaas.i18NInfo.getPageList({
|
|
30
|
-
pageNo: 1,
|
|
31
|
-
pageSize: 20,
|
|
32
|
-
searchKey: keyword
|
|
33
|
-
});
|
|
34
|
-
if (result && result.data) {
|
|
35
|
-
const row = result.data.find((item) => item.key === props.i18nValue);
|
|
36
|
-
if (row) Object.assign(i18nMap, Object.fromEntries(Object.entries(JSON.parse(row.info)).map(([_, item]) => [item.locale, item.info])));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
watch(() => props.i18nValue, () => {
|
|
40
|
-
if (!isEmpty(props.i18nValue)) getTableData(props.i18nValue);
|
|
41
|
-
}, { immediate: true });
|
|
42
|
-
const handleOpenI18nSelectModal = () => {
|
|
43
|
-
i18nInstance.open({
|
|
44
|
-
i18nModalKey: props.i18nModalKey,
|
|
45
|
-
saveCallback: (params) => {
|
|
46
|
-
emit("on-select-i18n", { ...params });
|
|
47
|
-
},
|
|
48
|
-
destroyCallback: () => {
|
|
49
|
-
emit("closed");
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
return (_ctx, _cache) => {
|
|
54
|
-
const _component_Icon = resolveComponent("Icon");
|
|
55
|
-
const _component_a_button = resolveComponent("a-button");
|
|
56
|
-
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
57
|
-
return __props.simpleBtn ? (openBlock(), createBlock(_component_Icon, {
|
|
58
|
-
key: 0,
|
|
59
|
-
class: normalizeClass(["i18n-icon simple-btn", { "is-highlight": isHighlight.value }]),
|
|
60
|
-
icon: "ion:language",
|
|
61
|
-
onClick: handleOpenI18nSelectModal
|
|
62
|
-
}, null, 8, ["class"])) : isHighlight.value ? (openBlock(), createBlock(_component_a_tooltip, {
|
|
63
|
-
key: 1,
|
|
64
|
-
color: "#fff",
|
|
65
|
-
placement: "topRight"
|
|
66
|
-
}, {
|
|
67
|
-
title: withCtx(() => [createElementVNode("div", _hoisted_1, "语言标识:" + toDisplayString(__props.i18nValue), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(getEnableLocaleList.value, (item) => {
|
|
68
|
-
return openBlock(), createElementBlock("div", {
|
|
69
|
-
key: item.id,
|
|
70
|
-
class: "i18n-tooltip-item"
|
|
71
|
-
}, [createElementVNode("strong", null, toDisplayString(item.language) + ": ", 1), createElementVNode("span", _hoisted_2, toDisplayString(i18nMap[item.languageTag]), 1)]);
|
|
72
|
-
}), 128))]),
|
|
73
|
-
default: withCtx(() => [createVNode(_component_a_button, mergeProps(__props.buttonExtraProps, {
|
|
74
|
-
class: { "is-highlight": isHighlight.value },
|
|
75
|
-
style: {
|
|
76
|
-
"--btn-width": __props.btnWidth,
|
|
77
|
-
"--btn-height": __props.btnHeight
|
|
78
|
-
},
|
|
79
|
-
size: __props.size,
|
|
80
|
-
onClick: handleOpenI18nSelectModal
|
|
81
|
-
}), {
|
|
82
|
-
icon: withCtx(() => [createVNode(_component_Icon, {
|
|
83
|
-
class: "i18n-icon",
|
|
84
|
-
icon: "ion:language"
|
|
85
|
-
})]),
|
|
86
|
-
_: 1
|
|
87
|
-
}, 16, [
|
|
88
|
-
"class",
|
|
89
|
-
"style",
|
|
90
|
-
"size"
|
|
91
|
-
])]),
|
|
92
|
-
_: 1
|
|
93
|
-
})) : (openBlock(), createBlock(_component_a_button, mergeProps({ key: 2 }, __props.buttonExtraProps, {
|
|
94
|
-
class: { "is-highlight": isHighlight.value },
|
|
95
|
-
style: {
|
|
96
|
-
"--btn-width": __props.btnWidth,
|
|
97
|
-
"--btn-height": __props.btnHeight
|
|
98
|
-
},
|
|
99
|
-
size: __props.size,
|
|
100
|
-
onClick: handleOpenI18nSelectModal
|
|
101
|
-
}), {
|
|
102
|
-
icon: withCtx(() => [createVNode(_component_Icon, {
|
|
103
|
-
class: "i18n-icon",
|
|
104
|
-
icon: "ion:language"
|
|
105
|
-
})]),
|
|
106
|
-
_: 1
|
|
107
|
-
}, 16, [
|
|
108
|
-
"class",
|
|
109
|
-
"style",
|
|
110
|
-
"size"
|
|
111
|
-
]));
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
//#endregion
|
|
116
|
-
export { i18n_select_btn_vue_vue_type_script_setup_true_name_i18n_select_btn_lang_default as default };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
.ant-btn[data-v-dc8ffb2c] {
|
|
2
|
-
background-color: #fff !important;
|
|
3
|
-
}
|
|
4
|
-
.ant-btn.ant-btn-icon-only[data-v-dc8ffb2c] {
|
|
5
|
-
width: var(--btn-width, 32px);
|
|
6
|
-
height: var(--btn-height, 32px);
|
|
7
|
-
}
|
|
8
|
-
.ant-btn.ant-btn-icon-only.ant-btn-sm[data-v-dc8ffb2c] {
|
|
9
|
-
width: 26px;
|
|
10
|
-
height: 26px;
|
|
11
|
-
}
|
|
12
|
-
.ant-btn:hover .i18n-icon[data-v-dc8ffb2c] {
|
|
13
|
-
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
14
|
-
color: var(--ant-primary-color);
|
|
15
|
-
}
|
|
16
|
-
.ant-btn.is-highlight[data-v-dc8ffb2c] {
|
|
17
|
-
color: var(--ant-primary-color);
|
|
18
|
-
border-color: var(--ant-primary-color);
|
|
19
|
-
}
|
|
20
|
-
.ant-btn.is-highlight .i18n-icon[data-v-dc8ffb2c] {
|
|
21
|
-
color: var(--ant-primary-color);
|
|
22
|
-
}
|
|
23
|
-
.i18n-icon[data-v-dc8ffb2c] {
|
|
24
|
-
color: #7f8695;
|
|
25
|
-
display: flex !important;
|
|
26
|
-
}
|
|
27
|
-
.simple-btn[data-v-dc8ffb2c]:hover {
|
|
28
|
-
color: var(--ant-primary-color);
|
|
29
|
-
}
|
|
30
|
-
.simple-btn.is-highlight[data-v-dc8ffb2c] {
|
|
31
|
-
color: var(--ant-primary-color);
|
|
32
|
-
}
|
|
33
|
-
.i18n-tooltip-title[data-v-dc8ffb2c] {
|
|
34
|
-
color: #303133;
|
|
35
|
-
font-size: 16px;
|
|
36
|
-
line-height: 1;
|
|
37
|
-
margin-bottom: 12px;
|
|
38
|
-
}
|
|
39
|
-
.i18n-tooltip-item[data-v-dc8ffb2c] {
|
|
40
|
-
color: #606266;
|
|
41
|
-
font-size: 14px;
|
|
42
|
-
}
|
|
43
|
-
.custom-i18n-btn[data-v-dc8ffb2c] {
|
|
44
|
-
vertical-align: middle;
|
|
45
|
-
background: #fff;
|
|
46
|
-
color: #303133;
|
|
47
|
-
border: none;
|
|
48
|
-
font-size: 14px;
|
|
49
|
-
display: inline-flex;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
align-items: center;
|
|
52
|
-
padding: 0;
|
|
53
|
-
}
|
|
54
|
-
.custom-i18n-btn.reg-i18n[data-v-dc8ffb2c] {
|
|
55
|
-
position: absolute;
|
|
56
|
-
right: -32px;
|
|
57
|
-
bottom: 0;
|
|
58
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface Prop {
|
|
2
|
-
i18nModalKey?: string;
|
|
3
|
-
destroyCallback?: () => void;
|
|
4
|
-
saveCallback?: (params: IObject) => void;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: import('vue').DefineComponent<Prop, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Prop> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
7
|
-
formRef: unknown;
|
|
8
|
-
tableRef: unknown;
|
|
9
|
-
}, any>;
|
|
10
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import i18n_select_container_vue_vue_type_script_setup_true_name_i18n_select_container_lang_default from "./i18n-select-container.vue_vue_type_script_setup_true_name_i18n-select-container_lang.mjs";
|
|
2
|
-
import './i18n-select-container.vue_vue_type_style_index_0_scoped_0160ed5e_lang.css';/* empty css */
|
|
3
|
-
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
//#region src/components/I18nSelect/src/i18n-select-container.vue
|
|
5
|
-
var i18n_select_container_default = /* @__PURE__ */ _plugin_vue_export_helper_default(i18n_select_container_vue_vue_type_script_setup_true_name_i18n_select_container_lang_default, [["__scopeId", "data-v-0160ed5e"]]);
|
|
6
|
-
//#endregion
|
|
7
|
-
export { i18n_select_container_default as default };
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import i18n_modal_default from "./i18n-modal.vue.mjs";
|
|
2
|
-
import { computed, createBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, onMounted, openBlock, reactive, ref, resolveComponent, toDisplayString, unref, withCtx } from "vue";
|
|
3
|
-
import { useModal, useModalInner } from "@gct-paas/core-web";
|
|
4
|
-
import { SearchOutlined } from "@ant-design/icons-vue";
|
|
5
|
-
import { t } from "@gct-paas/core";
|
|
6
|
-
//#region src/components/I18nSelect/src/i18n-select-container.vue?vue&type=script&setup=true&name=i18n-select-container&lang.ts
|
|
7
|
-
var _hoisted_1 = { class: "i18n-select-container" };
|
|
8
|
-
var _hoisted_2 = { class: "table-wrap" };
|
|
9
|
-
var i18n_select_container_vue_vue_type_script_setup_true_name_i18n_select_container_lang_default = /* @__PURE__ */ defineComponent({
|
|
10
|
-
__name: "i18n-select-container",
|
|
11
|
-
props: {
|
|
12
|
-
i18nModalKey: {},
|
|
13
|
-
destroyCallback: { type: Function },
|
|
14
|
-
saveCallback: { type: Function }
|
|
15
|
-
},
|
|
16
|
-
setup(__props) {
|
|
17
|
-
const [registerInner, { closeModal }] = useModalInner();
|
|
18
|
-
const [userRegister, { openModal }] = useModal();
|
|
19
|
-
const props = __props;
|
|
20
|
-
const getContainer = () => document.querySelector(`#${props.i18nModalKey}`);
|
|
21
|
-
const formRef = ref();
|
|
22
|
-
const formState = reactive({ keywords: "" });
|
|
23
|
-
const pagination = reactive({
|
|
24
|
-
current: 1,
|
|
25
|
-
pageSize: 5,
|
|
26
|
-
total: 0,
|
|
27
|
-
size: "small",
|
|
28
|
-
showTotal: (total) => t("sys.component.table.total", { total })
|
|
29
|
-
});
|
|
30
|
-
const tableData = ref([]);
|
|
31
|
-
const selectRows = ref();
|
|
32
|
-
const rowSelection = ref({
|
|
33
|
-
type: "radio",
|
|
34
|
-
hideSelectAll: true,
|
|
35
|
-
selectedRowKeys: [],
|
|
36
|
-
onChange: handleRowChange
|
|
37
|
-
});
|
|
38
|
-
const loading = ref(false);
|
|
39
|
-
const columns = computed(() => {
|
|
40
|
-
return [];
|
|
41
|
-
});
|
|
42
|
-
const getTableData = async (keyword, current) => {
|
|
43
|
-
loading.value = true;
|
|
44
|
-
const result = await _api.apaas.i18NInfo.getPageList({
|
|
45
|
-
pageNo: current ?? pagination.current,
|
|
46
|
-
pageSize: pagination.pageSize,
|
|
47
|
-
searchKey: keyword
|
|
48
|
-
});
|
|
49
|
-
loading.value = false;
|
|
50
|
-
if (result && result.data) {
|
|
51
|
-
const rows = result.data.map((item) => {
|
|
52
|
-
const infos = JSON.parse(item?.info);
|
|
53
|
-
return {
|
|
54
|
-
key: item.key,
|
|
55
|
-
type: item.type,
|
|
56
|
-
...Object.fromEntries(infos.map((i) => [i.locale, i.info]))
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
pagination.total = result.totalCount;
|
|
60
|
-
tableData.value = rows;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
onMounted(getTableData);
|
|
64
|
-
const handleSearch = () => {
|
|
65
|
-
formRef.value?.validate().then(async () => {
|
|
66
|
-
await getTableData(formState.keywords, 1);
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
const handleTableChange = (paginationInfo) => {
|
|
70
|
-
const { current, total, pageSize } = paginationInfo;
|
|
71
|
-
pagination.current = current;
|
|
72
|
-
pagination.total = total;
|
|
73
|
-
pagination.pageSize = pageSize;
|
|
74
|
-
getTableData();
|
|
75
|
-
};
|
|
76
|
-
const handleAddI18n = () => {
|
|
77
|
-
openModal();
|
|
78
|
-
};
|
|
79
|
-
const handleModalOk = async (data, isEdit) => {
|
|
80
|
-
const langInfos = columns.value.map((item) => {
|
|
81
|
-
return {
|
|
82
|
-
locale: item.dataIndex,
|
|
83
|
-
info: data[item.dataIndex]
|
|
84
|
-
};
|
|
85
|
-
});
|
|
86
|
-
loading.value = true;
|
|
87
|
-
try {
|
|
88
|
-
if (isEdit) await _api.apaas.i18NInfo.putKey({ key: data.id }, { info: JSON.stringify(langInfos) });
|
|
89
|
-
else await _api.apaas.i18NInfo.post({
|
|
90
|
-
info: JSON.stringify(langInfos),
|
|
91
|
-
key: data.id
|
|
92
|
-
});
|
|
93
|
-
getTableData();
|
|
94
|
-
handleRowChange([data.id], [reactive(data)]);
|
|
95
|
-
} catch (error) {
|
|
96
|
-
loading.value = false;
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
function handleRowChange(selectedRowKeys, selectedRows) {
|
|
100
|
-
rowSelection.value.selectedRowKeys = selectedRowKeys;
|
|
101
|
-
selectRows.value = selectedRows;
|
|
102
|
-
}
|
|
103
|
-
const handleClose = () => {
|
|
104
|
-
if (props.destroyCallback && typeof props.destroyCallback === "function") props.destroyCallback();
|
|
105
|
-
};
|
|
106
|
-
const handleOk = async () => {
|
|
107
|
-
if (props.saveCallback && typeof props.saveCallback === "function") {
|
|
108
|
-
const selectRowKey = rowSelection.value.selectedRowKeys;
|
|
109
|
-
const params = {};
|
|
110
|
-
if (selectRowKey && selectRowKey[0]) {
|
|
111
|
-
const selectRow = selectRows.value?.[0];
|
|
112
|
-
console.log("selectRow", selectRow);
|
|
113
|
-
Object.assign(params, { i18nKey: selectRowKey[0] });
|
|
114
|
-
}
|
|
115
|
-
props.saveCallback(params);
|
|
116
|
-
}
|
|
117
|
-
closeModal();
|
|
118
|
-
};
|
|
119
|
-
return (_ctx, _cache) => {
|
|
120
|
-
const _component_a_input = resolveComponent("a-input");
|
|
121
|
-
const _component_a_form_item = resolveComponent("a-form-item");
|
|
122
|
-
const _component_a_col = resolveComponent("a-col");
|
|
123
|
-
const _component_a_button = resolveComponent("a-button");
|
|
124
|
-
const _component_plus_outlined = resolveComponent("plus-outlined");
|
|
125
|
-
const _component_a_row = resolveComponent("a-row");
|
|
126
|
-
const _component_a_form = resolveComponent("a-form");
|
|
127
|
-
const _component_a_table = resolveComponent("a-table");
|
|
128
|
-
const _component_basic_modal = resolveComponent("basic-modal");
|
|
129
|
-
return openBlock(), createBlock(_component_basic_modal, mergeProps(_ctx.$attrs, {
|
|
130
|
-
"min-height": 40,
|
|
131
|
-
title: unref(t)("sys.i18n.i18nConfig"),
|
|
132
|
-
centered: "",
|
|
133
|
-
width: "640px",
|
|
134
|
-
"can-fullscreen": false,
|
|
135
|
-
"mask-closable": false,
|
|
136
|
-
"after-close": handleClose,
|
|
137
|
-
"get-container": getContainer,
|
|
138
|
-
onRegister: unref(registerInner),
|
|
139
|
-
onOk: handleOk
|
|
140
|
-
}), {
|
|
141
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_1, [createVNode(_component_a_form, {
|
|
142
|
-
ref_key: "formRef",
|
|
143
|
-
ref: formRef,
|
|
144
|
-
model: formState,
|
|
145
|
-
autocomplete: "off",
|
|
146
|
-
layout: "horizontal"
|
|
147
|
-
}, {
|
|
148
|
-
default: withCtx(() => [createVNode(_component_a_row, null, {
|
|
149
|
-
default: withCtx(() => [createVNode(_component_a_col, { span: 12 }, {
|
|
150
|
-
default: withCtx(() => [createVNode(_component_a_form_item, {
|
|
151
|
-
name: "keywords",
|
|
152
|
-
label: unref(t)("sys.keywords")
|
|
153
|
-
}, {
|
|
154
|
-
default: withCtx(() => [createVNode(_component_a_input, {
|
|
155
|
-
value: formState.keywords,
|
|
156
|
-
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => formState.keywords = $event),
|
|
157
|
-
placeholder: unref(t)("sys.keywordsPlaceholder"),
|
|
158
|
-
style: { "display": "inline-flex" }
|
|
159
|
-
}, null, 8, ["value", "placeholder"])]),
|
|
160
|
-
_: 1
|
|
161
|
-
}, 8, ["label"])]),
|
|
162
|
-
_: 1
|
|
163
|
-
}), createVNode(_component_a_col, {
|
|
164
|
-
span: 12,
|
|
165
|
-
style: { "text-align": "right" }
|
|
166
|
-
}, {
|
|
167
|
-
default: withCtx(() => [createVNode(_component_a_button, {
|
|
168
|
-
type: "primary",
|
|
169
|
-
onClick: handleSearch
|
|
170
|
-
}, {
|
|
171
|
-
icon: withCtx(() => [createVNode(unref(SearchOutlined))]),
|
|
172
|
-
default: withCtx(() => [createTextVNode(" " + toDisplayString(unref(t)("sys.queryText")), 1)]),
|
|
173
|
-
_: 1
|
|
174
|
-
}), createVNode(_component_a_button, {
|
|
175
|
-
style: { "margin": "0 8px" },
|
|
176
|
-
type: "primary",
|
|
177
|
-
onClick: handleAddI18n
|
|
178
|
-
}, {
|
|
179
|
-
icon: withCtx(() => [createVNode(_component_plus_outlined)]),
|
|
180
|
-
default: withCtx(() => [createTextVNode(" " + toDisplayString(unref(t)("sys.new")), 1)]),
|
|
181
|
-
_: 1
|
|
182
|
-
})]),
|
|
183
|
-
_: 1
|
|
184
|
-
})]),
|
|
185
|
-
_: 1
|
|
186
|
-
})]),
|
|
187
|
-
_: 1
|
|
188
|
-
}, 8, ["model"]), createElementVNode("div", _hoisted_2, [createVNode(_component_a_table, {
|
|
189
|
-
ref: "tableRef",
|
|
190
|
-
"data-source": tableData.value,
|
|
191
|
-
columns: columns.value,
|
|
192
|
-
"show-index-column": false,
|
|
193
|
-
pagination,
|
|
194
|
-
striped: false,
|
|
195
|
-
bordered: true,
|
|
196
|
-
"row-selection": rowSelection.value,
|
|
197
|
-
loading: loading.value,
|
|
198
|
-
onChange: handleTableChange
|
|
199
|
-
}, null, 8, [
|
|
200
|
-
"data-source",
|
|
201
|
-
"columns",
|
|
202
|
-
"pagination",
|
|
203
|
-
"row-selection",
|
|
204
|
-
"loading"
|
|
205
|
-
]), createVNode(i18n_modal_default, {
|
|
206
|
-
lang: columns.value,
|
|
207
|
-
"get-container": getContainer,
|
|
208
|
-
onRegister: unref(userRegister),
|
|
209
|
-
onOk: handleModalOk
|
|
210
|
-
}, null, 8, ["lang", "onRegister"])])])]),
|
|
211
|
-
_: 1
|
|
212
|
-
}, 16, ["title", "onRegister"]);
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
//#endregion
|
|
217
|
-
export { i18n_select_container_vue_vue_type_script_setup_true_name_i18n_select_container_lang_default as default };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { FormInstance, FormItemProps, InputProps } from 'ant-design-vue';
|
|
2
|
-
interface Props {
|
|
3
|
-
formItemName: string | string[];
|
|
4
|
-
fromItemExtraProps?: FormItemProps;
|
|
5
|
-
inputExtraProps?: InputProps;
|
|
6
|
-
i18nConfig?: string;
|
|
7
|
-
text?: string;
|
|
8
|
-
formRef?: FormInstance;
|
|
9
|
-
}
|
|
10
|
-
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
-
"update:text": (...args: any[]) => void;
|
|
12
|
-
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
13
|
-
"onUpdate:text"?: ((...args: any[]) => any) | undefined;
|
|
14
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
-
export default _default;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import i18n_select_input_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default from "./i18n-select-input-form.vue_vue_type_script_setup_true_name_i18n-select-input-form_lang.mjs";
|
|
2
|
-
//#region src/components/I18nSelect/src/i18n-select-input-form.vue
|
|
3
|
-
var i18n_select_input_form_default = i18n_select_input_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { i18n_select_input_form_default as default };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import i18n_select_input_default from "./i18n-select-input.vue.mjs";
|
|
2
|
-
import { Fragment, computed, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, openBlock, resolveComponent, toDisplayString, withCtx } from "vue";
|
|
3
|
-
//#region src/components/I18nSelect/src/i18n-select-input-form.vue?vue&type=script&setup=true&name=i18n-select-input-form&lang.ts
|
|
4
|
-
var i18n_select_input_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default = /* @__PURE__ */ defineComponent({
|
|
5
|
-
__name: "i18n-select-input-form",
|
|
6
|
-
props: {
|
|
7
|
-
formItemName: {},
|
|
8
|
-
fromItemExtraProps: {},
|
|
9
|
-
inputExtraProps: {},
|
|
10
|
-
i18nConfig: {},
|
|
11
|
-
text: {},
|
|
12
|
-
formRef: {}
|
|
13
|
-
},
|
|
14
|
-
emits: ["update:text"],
|
|
15
|
-
setup(__props, { emit: __emit }) {
|
|
16
|
-
const props = __props;
|
|
17
|
-
const emit = __emit;
|
|
18
|
-
const i18nText = computed({
|
|
19
|
-
get() {
|
|
20
|
-
return props.text ?? "";
|
|
21
|
-
},
|
|
22
|
-
set(value) {
|
|
23
|
-
emit("update:text", value);
|
|
24
|
-
props.formRef?.validateFields([props.formItemName]);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return (_ctx, _cache) => {
|
|
28
|
-
const _component_a_form_item = resolveComponent("a-form-item");
|
|
29
|
-
return openBlock(), createElementBlock(Fragment, null, [createVNode(_component_a_form_item, mergeProps({ name: __props.formItemName }, __props.fromItemExtraProps), {
|
|
30
|
-
default: withCtx(() => [createVNode(i18n_select_input_default, mergeProps(_ctx.$attrs, {
|
|
31
|
-
"i18n-text": i18nText.value,
|
|
32
|
-
"onUpdate:i18nText": _cache[0] || (_cache[0] = ($event) => i18nText.value = $event),
|
|
33
|
-
"input-extra-props": __props.inputExtraProps,
|
|
34
|
-
"i18n-config": __props.i18nConfig,
|
|
35
|
-
attr: Array.isArray(__props.formItemName) ? __props.formItemName.join(".") : __props.formItemName,
|
|
36
|
-
"placeholder-text": _ctx.$t("sys.inputText")
|
|
37
|
-
}), null, 16, [
|
|
38
|
-
"i18n-text",
|
|
39
|
-
"input-extra-props",
|
|
40
|
-
"i18n-config",
|
|
41
|
-
"attr",
|
|
42
|
-
"placeholder-text"
|
|
43
|
-
])]),
|
|
44
|
-
_: 1
|
|
45
|
-
}, 16, ["name"]), createVNode(_component_a_form_item, {
|
|
46
|
-
name: "i18nConfig",
|
|
47
|
-
hidden: ""
|
|
48
|
-
}, {
|
|
49
|
-
default: withCtx(() => [createElementVNode("span", null, toDisplayString(__props.i18nConfig), 1)]),
|
|
50
|
-
_: 1
|
|
51
|
-
})], 64);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
//#endregion
|
|
56
|
-
export { i18n_select_input_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default as default };
|