smart-admin-web 10.13.1 → 10.15.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 +5 -5
- package/dist/api/index.d.ts +37 -0
- package/dist/api/index.js +35 -14
- package/dist/api/index.js.map +1 -1
- package/dist/api/schema.d.ts +381 -3
- package/dist/assets/icons/ph-subset.json.js +3 -3
- package/dist/assets/smart-logo.svg.js +5 -0
- package/dist/assets/smart-logo.svg.js.map +1 -0
- package/dist/components/SmartLogo.vue.d.ts +3 -0
- package/dist/components/SmartLogo.vue.js +1 -1
- package/dist/components/SmartLogo2.vue.js +22 -64
- package/dist/components/SmartLogo2.vue.js.map +1 -1
- package/dist/composables/useLoginHero.d.ts +2 -0
- package/dist/composables/useLoginHero.js +22 -0
- package/dist/composables/useLoginHero.js.map +1 -0
- package/dist/composables/usePageTitle.js +16 -14
- package/dist/composables/usePageTitle.js.map +1 -1
- package/dist/composables/useSite.d.ts +5 -0
- package/dist/composables/useSite.js +16 -13
- package/dist/composables/useSite.js.map +1 -1
- package/dist/index.js +92 -91
- package/dist/lib/favicon.d.ts +1 -0
- package/dist/lib/favicon.js +12 -0
- package/dist/lib/favicon.js.map +1 -0
- package/dist/lib/loginHero.d.ts +16 -0
- package/dist/lib/loginHero.js +33 -0
- package/dist/lib/loginHero.js.map +1 -0
- package/dist/lib/logoCrop.d.ts +25 -0
- package/dist/lib/logoCrop.js +22 -0
- package/dist/lib/logoCrop.js.map +1 -0
- package/dist/lib/runtime.d.ts +2 -0
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/runtime.js.map +1 -1
- package/dist/lib/securityRules.d.ts +26 -0
- package/dist/lib/securityRules.js +86 -0
- package/dist/lib/securityRules.js.map +1 -0
- package/dist/locales/en-US.d.ts +250 -28
- package/dist/locales/en-US.js +271 -58
- package/dist/locales/en-US.js.map +1 -1
- package/dist/locales/zh-CN.d.ts +250 -28
- package/dist/locales/zh-CN.js +266 -58
- package/dist/locales/zh-CN.js.map +1 -1
- package/dist/router/viewRegistry.js +10 -10
- package/dist/router/viewRegistry.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/oauthBrand.d.ts +34 -9
- package/dist/utils/oauthBrand.js +70 -74
- package/dist/utils/oauthBrand.js.map +1 -1
- package/dist/views/login/components/LoginHeroPanel.vue.d.ts +18 -0
- package/dist/views/login/components/LoginHeroPanel.vue.js +8 -0
- package/dist/views/login/components/LoginHeroPanel.vue.js.map +1 -0
- package/dist/views/login/components/LoginHeroPanel2.vue.js +66 -0
- package/dist/views/login/components/LoginHeroPanel2.vue.js.map +1 -0
- package/dist/views/login/skins/SplitPanel.vue.js +1 -1
- package/dist/views/login/skins/SplitPanel2.vue.js +39 -59
- package/dist/views/login/skins/SplitPanel2.vue.js.map +1 -1
- package/dist/views/system/api-docs/index.vue.js +5 -0
- package/dist/views/system/api-docs/index.vue.js.map +1 -0
- package/dist/views/system/api-docs/index2.vue.js +64 -0
- package/dist/views/system/api-docs/index2.vue.js.map +1 -0
- package/dist/views/system/config/components/AdminMock.vue.js +8 -0
- package/dist/views/system/config/components/AdminMock.vue.js.map +1 -0
- package/dist/views/system/config/components/AdminMock2.vue.js +76 -0
- package/dist/views/system/config/components/AdminMock2.vue.js.map +1 -0
- package/dist/views/system/config/components/AdvancedSection.vue.js +5 -0
- package/dist/views/system/config/components/AdvancedSection.vue.js.map +1 -0
- package/dist/views/system/config/components/AdvancedSection2.vue.js +135 -0
- package/dist/views/system/config/components/AdvancedSection2.vue.js.map +1 -0
- package/dist/views/system/config/components/BrandSection.vue.d.ts +7 -0
- package/dist/views/system/config/components/BrandSection.vue.js +8 -0
- package/dist/views/system/config/components/BrandSection.vue.js.map +1 -0
- package/dist/views/system/config/components/BrandSection2.vue.js +264 -0
- package/dist/views/system/config/components/BrandSection2.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgGroup.vue.d.ts +18 -0
- package/dist/views/system/config/components/CfgGroup.vue.js +8 -0
- package/dist/views/system/config/components/CfgGroup.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgGroup2.vue.js +22 -0
- package/dist/views/system/config/components/CfgGroup2.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgRow.vue.d.ts +26 -0
- package/dist/views/system/config/components/CfgRow.vue.js +9 -0
- package/dist/views/system/config/components/CfgRow.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgRow2.vue.js +53 -0
- package/dist/views/system/config/components/CfgRow2.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgSegment.vue.d.ts +28 -0
- package/dist/views/system/config/components/CfgSegment.vue.js +8 -0
- package/dist/views/system/config/components/CfgSegment.vue.js.map +1 -0
- package/dist/views/system/config/components/CfgSegment2.vue.js +44 -0
- package/dist/views/system/config/components/CfgSegment2.vue.js.map +1 -0
- package/dist/views/system/config/components/ConfigFormModal.vue.js +5 -2
- package/dist/views/system/config/components/ConfigFormModal.vue.js.map +1 -1
- package/dist/views/system/config/components/ConfigFormModal2.vue.js +66 -56
- package/dist/views/system/config/components/ConfigFormModal2.vue.js.map +1 -1
- package/dist/views/system/config/components/JobSection.vue.js +8 -0
- package/dist/views/system/config/components/JobSection.vue.js.map +1 -0
- package/dist/views/system/config/components/JobSection2.vue.js +138 -0
- package/dist/views/system/config/components/JobSection2.vue.js.map +1 -0
- package/dist/views/system/config/components/{GroupExtraConfig.vue.d.ts → LoginMock.vue.d.ts} +3 -4
- package/dist/views/system/config/components/LoginMock.vue.js +8 -0
- package/dist/views/system/config/components/LoginMock.vue.js.map +1 -0
- package/dist/views/system/config/components/LoginMock2.vue.js +121 -0
- package/dist/views/system/config/components/LoginMock2.vue.js.map +1 -0
- package/dist/views/system/config/components/LogoCropper.vue.d.ts +10 -0
- package/dist/views/system/config/components/LogoCropper.vue.js +8 -0
- package/dist/views/system/config/components/LogoCropper.vue.js.map +1 -0
- package/dist/views/system/config/components/LogoCropper2.vue.js +122 -0
- package/dist/views/system/config/components/LogoCropper2.vue.js.map +1 -0
- package/dist/views/system/config/components/LogoEditor.vue.js +8 -0
- package/dist/views/system/config/components/LogoEditor.vue.js.map +1 -0
- package/dist/views/system/config/components/LogoEditor2.vue.js +163 -0
- package/dist/views/system/config/components/LogoEditor2.vue.js.map +1 -0
- package/dist/views/system/config/components/ProviderSheet.vue.d.ts +17 -0
- package/dist/views/system/config/components/ProviderSheet.vue.js +8 -0
- package/dist/views/system/config/components/ProviderSheet.vue.js.map +1 -0
- package/dist/views/system/config/components/ProviderSheet2.vue.js +343 -0
- package/dist/views/system/config/components/ProviderSheet2.vue.js.map +1 -0
- package/dist/views/system/config/components/ScaleToFit.vue.d.ts +17 -0
- package/dist/views/system/config/components/ScaleToFit.vue.js +8 -0
- package/dist/views/system/config/components/ScaleToFit.vue.js.map +1 -0
- package/dist/views/system/config/components/ScaleToFit2.vue.js +41 -0
- package/dist/views/system/config/components/ScaleToFit2.vue.js.map +1 -0
- package/dist/views/system/config/components/SectionLayout.vue.d.ts +28 -0
- package/dist/views/system/config/components/SectionLayout.vue.js +8 -0
- package/dist/views/system/config/components/SectionLayout.vue.js.map +1 -0
- package/dist/views/system/config/components/SectionLayout2.vue.js +45 -0
- package/dist/views/system/config/components/SectionLayout2.vue.js.map +1 -0
- package/dist/views/system/config/components/SecuritySection.vue.js +8 -0
- package/dist/views/system/config/components/SecuritySection.vue.js.map +1 -0
- package/dist/views/system/config/components/SecuritySection2.vue.js +416 -0
- package/dist/views/system/config/components/SecuritySection2.vue.js.map +1 -0
- package/dist/views/system/config/components/SensitiveSection.vue.js +8 -0
- package/dist/views/system/config/components/SensitiveSection.vue.js.map +1 -0
- package/dist/views/system/config/components/SensitiveSection2.vue.js +209 -0
- package/dist/views/system/config/components/SensitiveSection2.vue.js.map +1 -0
- package/dist/views/system/config/components/SigninSection.vue.d.ts +3 -0
- package/dist/views/system/config/components/SigninSection.vue.js +8 -0
- package/dist/views/system/config/components/SigninSection.vue.js.map +1 -0
- package/dist/views/system/config/components/SigninSection2.vue.js +201 -0
- package/dist/views/system/config/components/SigninSection2.vue.js.map +1 -0
- package/dist/views/system/config/components/UploadSection.vue.d.ts +3 -0
- package/dist/views/system/config/components/UploadSection.vue.js +8 -0
- package/dist/views/system/config/components/UploadSection.vue.js.map +1 -0
- package/dist/views/system/config/components/UploadSection2.vue.js +167 -0
- package/dist/views/system/config/components/UploadSection2.vue.js.map +1 -0
- package/dist/views/system/config/draft.d.ts +148 -0
- package/dist/views/system/config/draft.js +170 -0
- package/dist/views/system/config/draft.js.map +1 -0
- package/dist/views/system/config/flash.d.ts +2 -0
- package/dist/views/system/config/flash.js +9 -0
- package/dist/views/system/config/flash.js.map +1 -0
- package/dist/views/system/config/groups.d.ts +35 -7
- package/dist/views/system/config/groups.js +99 -14
- package/dist/views/system/config/groups.js.map +1 -1
- package/dist/views/system/config/index.vue.js +4 -1
- package/dist/views/system/config/index.vue.js.map +1 -1
- package/dist/views/system/config/index2.vue.js +180 -115
- package/dist/views/system/config/index2.vue.js.map +1 -1
- package/dist/views/system/config/providerForm.d.ts +33 -0
- package/dist/views/system/config/providerForm.js +63 -0
- package/dist/views/system/config/providerForm.js.map +1 -0
- package/package.json +4 -4
- package/dist/views/system/config/components/ExternalAuthConfig.vue.js +0 -8
- package/dist/views/system/config/components/ExternalAuthConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/ExternalAuthConfig2.vue.js +0 -218
- package/dist/views/system/config/components/ExternalAuthConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/GroupExtraConfig.vue.js +0 -8
- package/dist/views/system/config/components/GroupExtraConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/GroupExtraConfig2.vue.js +0 -108
- package/dist/views/system/config/components/GroupExtraConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/HighSensConfig.vue.js +0 -5
- package/dist/views/system/config/components/HighSensConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/HighSensConfig2.vue.js +0 -134
- package/dist/views/system/config/components/HighSensConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/JobConfig.vue.js +0 -5
- package/dist/views/system/config/components/JobConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/JobConfig2.vue.js +0 -116
- package/dist/views/system/config/components/JobConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/OtherConfig.vue.js +0 -5
- package/dist/views/system/config/components/OtherConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/OtherConfig2.vue.js +0 -121
- package/dist/views/system/config/components/OtherConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/SecurityConfig.vue.js +0 -8
- package/dist/views/system/config/components/SecurityConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/SecurityConfig2.vue.js +0 -456
- package/dist/views/system/config/components/SecurityConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/SysBaseConfig.vue.js +0 -5
- package/dist/views/system/config/components/SysBaseConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/SysBaseConfig2.vue.js +0 -107
- package/dist/views/system/config/components/SysBaseConfig2.vue.js.map +0 -1
- package/dist/views/system/config/components/UploadConfig.vue.js +0 -5
- package/dist/views/system/config/components/UploadConfig.vue.js.map +0 -1
- package/dist/views/system/config/components/UploadConfig2.vue.js +0 -135
- package/dist/views/system/config/components/UploadConfig2.vue.js.map +0 -1
- /package/dist/views/system/{config/components/ExternalAuthConfig.vue.d.ts → api-docs/index.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{HighSensConfig.vue.d.ts → AdminMock.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{JobConfig.vue.d.ts → AdvancedSection.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{OtherConfig.vue.d.ts → JobSection.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{SecurityConfig.vue.d.ts → LogoEditor.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{SysBaseConfig.vue.d.ts → SecuritySection.vue.d.ts} +0 -0
- /package/dist/views/system/config/components/{UploadConfig.vue.d.ts → SensitiveSection.vue.d.ts} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineComponent as n, openBlock as o, createElementBlock as s, createElementVNode as r, toDisplayString as i, renderSlot as l, createCommentVNode as a } from "vue";
|
|
2
|
+
const c = { class: "cfg-group" }, d = { key: 0 }, u = { class: "cfg-list" }, f = /* @__PURE__ */ n({
|
|
3
|
+
__name: "CfgGroup",
|
|
4
|
+
props: {
|
|
5
|
+
title: {}
|
|
6
|
+
},
|
|
7
|
+
setup(t) {
|
|
8
|
+
return (e, m) => (o(), s("div", c, [
|
|
9
|
+
t.title || e.$slots.extra ? (o(), s("h4", d, [
|
|
10
|
+
r("span", null, i(t.title), 1),
|
|
11
|
+
l(e.$slots, "extra", {}, void 0, !0)
|
|
12
|
+
])) : a("", !0),
|
|
13
|
+
r("div", u, [
|
|
14
|
+
l(e.$slots, "default", {}, void 0, !0)
|
|
15
|
+
])
|
|
16
|
+
]));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
f as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=CfgGroup2.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CfgGroup2.vue.js","sources":["../../../../../src/views/system/config/components/CfgGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// 圆角分组列表(仿 macOS「系统设置」):组名在卡片外的左上方,#extra 放在组名右侧(如语言切换)。\ndefineProps<{ title?: string }>()\n</script>\n\n<template>\n <div class=\"cfg-group\">\n <h4 v-if=\"title || $slots.extra\">\n <span>{{ title }}</span>\n <slot name=\"extra\" />\n </h4>\n <div class=\"cfg-list\">\n <slot />\n </div>\n </div>\n</template>\n\n<style scoped>\n.cfg-group {\n flex: none;\n min-width: 0;\n}\nh4 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n min-height: 22px;\n margin: 0 0 6px 12px;\n font-size: var(--font-size-sm);\n font-weight: 500;\n color: var(--color-text-secondary);\n}\n.cfg-list {\n border-radius: 12px;\n background: var(--color-bg-container);\n border: 1px solid var(--color-border);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_hoisted_1","__props","$slots","_hoisted_2","_createElementVNode","_renderSlot","_ctx","_hoisted_3"],"mappings":";;;;;;;sBAMEA,EAAA,GAAAC,EAQM,OARNC,GAQM;AAAA,MAPMC,EAAA,SAASC,EAAAA,OAAO,cAA1BH,EAGK,MAAAI,GAAA;AAAA,QAFHC,EAAwB,gBAAfH,EAAA,KAAK,GAAA,CAAA;AAAA,QACdI,EAAqBC,EAAA,QAAA,SAAA,CAAA,GAAA,QAAA,EAAA;AAAA,MAAA;MAEvBF,EAEM,OAFNG,GAEM;AAAA,QADJF,EAAQC,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,MAAA;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
hint?: string;
|
|
4
|
+
keys?: readonly string[];
|
|
5
|
+
sub?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** 控件比一行高(多行输入、标签组):顶端对齐 */
|
|
8
|
+
tall?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
label?: (props: typeof __VLS_1) => any;
|
|
13
|
+
} & {
|
|
14
|
+
hint?: (props: typeof __VLS_3) => any;
|
|
15
|
+
} & {
|
|
16
|
+
default?: (props: typeof __VLS_5) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import o from "./CfgRow2.vue.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import t from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-bd8e29b3"]]);
|
|
6
|
+
export {
|
|
7
|
+
_ as default
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=CfgRow.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CfgRow.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent as h, computed as b, openBlock as s, createElementBlock as o, normalizeClass as y, createElementVNode as l, createCommentVNode as n, renderSlot as d, createTextVNode as r, toDisplayString as i, unref as v } from "vue";
|
|
2
|
+
import { useI18n as g } from "vue-i18n";
|
|
3
|
+
import { useConfigDraft as k } from "../draft.js";
|
|
4
|
+
const B = ["aria-disabled"], C = { class: "lb" }, p = { class: "name" }, $ = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "dot",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
}, N = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "sr-only"
|
|
11
|
+
}, V = { key: 0 }, w = { class: "ctl" }, T = /* @__PURE__ */ h({
|
|
12
|
+
__name: "CfgRow",
|
|
13
|
+
props: {
|
|
14
|
+
label: {},
|
|
15
|
+
hint: {},
|
|
16
|
+
keys: {},
|
|
17
|
+
sub: { type: Boolean },
|
|
18
|
+
disabled: { type: Boolean },
|
|
19
|
+
tall: { type: Boolean }
|
|
20
|
+
},
|
|
21
|
+
setup(e) {
|
|
22
|
+
const u = e, { t: m } = g(), f = k(), a = b(() => {
|
|
23
|
+
var t;
|
|
24
|
+
return !!((t = u.keys) != null && t.some((c) => f.dirtyKeys.value.includes(c)));
|
|
25
|
+
});
|
|
26
|
+
return (t, c) => (s(), o("div", {
|
|
27
|
+
class: y(["cfg-row", { sub: e.sub, off: e.disabled, tall: e.tall, changed: a.value }]),
|
|
28
|
+
"aria-disabled": e.disabled || void 0
|
|
29
|
+
}, [
|
|
30
|
+
l("div", C, [
|
|
31
|
+
l("span", p, [
|
|
32
|
+
a.value ? (s(), o("i", $)) : n("", !0),
|
|
33
|
+
d(t.$slots, "label", {}, () => [
|
|
34
|
+
r(i(e.label), 1)
|
|
35
|
+
], !0),
|
|
36
|
+
a.value ? (s(), o("span", N, i(v(m)("config.unsavedTab")), 1)) : n("", !0)
|
|
37
|
+
]),
|
|
38
|
+
e.hint || t.$slots.hint ? (s(), o("small", V, [
|
|
39
|
+
d(t.$slots, "hint", {}, () => [
|
|
40
|
+
r(i(e.hint), 1)
|
|
41
|
+
], !0)
|
|
42
|
+
])) : n("", !0)
|
|
43
|
+
]),
|
|
44
|
+
l("div", w, [
|
|
45
|
+
d(t.$slots, "default", {}, void 0, !0)
|
|
46
|
+
])
|
|
47
|
+
], 10, B));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
T as default
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=CfgRow2.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CfgRow2.vue.js","sources":["../../../../../src/views/system/config/components/CfgRow.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// 分组列表里的一行:左边标签(可带一行灰色说明),右边控件。\n// keys 里任一键有未保存改动,标签前出现橙点——用户一眼看出改了哪几项。\n// sub 是缩进的从属项(如「验证码类型」),disabled 让整行变灰不可操作(从属的总开关关着)。\nimport { computed } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport { useConfigDraft } from '../draft'\n\nconst props = defineProps<{\n label?: string\n hint?: string\n keys?: readonly string[]\n sub?: boolean\n disabled?: boolean\n /** 控件比一行高(多行输入、标签组):顶端对齐 */\n tall?: boolean\n}>()\n\nconst { t } = useI18n()\nconst draft = useConfigDraft()\nconst changed = computed(() => !!props.keys?.some(key => draft.dirtyKeys.value.includes(key)))\n</script>\n\n<template>\n <div\n :class=\"['cfg-row', { sub, off: disabled, tall, changed }]\"\n :aria-disabled=\"disabled || undefined\"\n >\n <div class=\"lb\">\n <span class=\"name\">\n <i v-if=\"changed\" class=\"dot\" aria-hidden=\"true\" />\n <slot name=\"label\">{{ label }}</slot>\n <span v-if=\"changed\" class=\"sr-only\">{{ t('config.unsavedTab') }}</span>\n </span>\n <small v-if=\"hint || $slots.hint\">\n <slot name=\"hint\">{{ hint }}</slot>\n </small>\n </div>\n <div class=\"ctl\">\n <slot />\n </div>\n </div>\n</template>\n\n<style scoped>\n.cfg-row {\n position: relative;\n display: flex;\n align-items: center;\n gap: 12px;\n min-height: 48px;\n padding: 6px 14px;\n font-size: var(--font-size-base);\n}\n.cfg-row + .cfg-row::before {\n content: '';\n position: absolute;\n top: 0;\n left: 14px;\n right: 0;\n border-top: 0.5px solid var(--color-border);\n}\n.cfg-row.sub {\n padding-left: 34px;\n}\n.cfg-row.sub::before {\n left: 34px;\n}\n.cfg-row.tall {\n align-items: flex-start;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n.cfg-row.off .lb,\n.cfg-row.off .ctl {\n opacity: 0.45;\n pointer-events: none;\n}\n.lb {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-width: 130px;\n}\n.name {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n white-space: nowrap;\n color: var(--color-text-primary);\n}\n.dot {\n position: absolute;\n left: -11px;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--color-warning);\n}\nsmall {\n font-size: var(--font-size-sm);\n line-height: 1.4;\n color: var(--color-text-tertiary);\n}\n.ctl {\n display: flex;\n flex: 0 1 auto;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n min-width: 0;\n}\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n</style>\n\n<style>\n/* 带文本输入框的行:标签与输入按 1:1.8 分(输入框是主角,要宽),输入框铺满自己那一份。\n 放在非 scoped 块里::has() 要看子孙里有没有输入框,scoped 的属性选择器改写会打乱它。 */\n.cfg-row:has(> .ctl > :is(.n-input, .n-select)) > .lb {\n flex: 1 1 0;\n}\n.cfg-row:has(> .ctl > :is(.n-input, .n-select)) > .ctl {\n flex: 1.8 1 0;\n}\n.cfg-row > .ctl > :is(.n-input, .n-select) {\n flex: 1;\n min-width: 0;\n}\n</style>\n"],"names":["props","__props","t","useI18n","draft","useConfigDraft","changed","computed","_a","key","_createElementBlock","_createElementVNode","_hoisted_2","_hoisted_3","_openBlock","_hoisted_4","_renderSlot","_ctx","_hoisted_5","_toDisplayString","_unref","$slots","_hoisted_6","_hoisted_7"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,UAAMA,IAAQC,GAUR,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAQC,EAAA,GACRC,IAAUC,EAAS,MAAA;;AAAM,cAAC,GAACC,IAAAR,EAAM,SAAN,QAAAQ,EAAY,KAAK,CAAAC,MAAOL,EAAM,UAAU,MAAM,SAASK,CAAG;AAAA,KAAE;2BAI3FC,EAiBM,OAAA;AAAA,MAhBH,4BAAqBT,EAAA,KAAG,KAAOA,YAAQ,MAAEA,EAAA,eAAMK,EAAA,MAAA,CAAO,CAAA;AAAA,MACtD,iBAAeL,EAAA,YAAY;AAAA,IAAA;MAE5BU,EASM,OATNC,GASM;AAAA,QARJD,EAIO,QAJPE,GAIO;AAAA,UAHIP,EAAA,SAATQ,EAAA,GAAAJ,EAAmD,KAAnDK,CAAmD;UACnDC,EAAqCC,uBAArC,MAAqC;AAAA,gBAAfhB,EAAA,KAAK,GAAA,CAAA;AAAA,UAAA;UACfK,EAAA,cAAZI,EAAwE,QAAxEQ,GAAwEC,EAAhCC,EAAAlB,CAAA,EAAC,mBAAA,CAAA,GAAA,CAAA;;QAE9BD,EAAA,QAAQoB,EAAAA,OAAO,aAA5BX,EAEQ,SAAAY,GAAA;AAAA,UADNN,EAAmCC,sBAAnC,MAAmC;AAAA,gBAAdhB,EAAA,IAAI,GAAA,CAAA;AAAA,UAAA;;;MAG7BU,EAEM,OAFNY,GAEM;AAAA,QADJP,EAAQC,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,MAAA;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const __VLS_export: <T extends string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
2
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<({
|
|
3
|
+
options: readonly {
|
|
4
|
+
value: T;
|
|
5
|
+
label: string;
|
|
6
|
+
}[];
|
|
7
|
+
label?: string;
|
|
8
|
+
} & {
|
|
9
|
+
modelValue: T;
|
|
10
|
+
}) & {
|
|
11
|
+
"onUpdate:modelValue"?: ((value: T) => any) | undefined;
|
|
12
|
+
}> & (typeof globalThis extends {
|
|
13
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
14
|
+
} ? P : {});
|
|
15
|
+
expose: (exposed: {}) => void;
|
|
16
|
+
attrs: any;
|
|
17
|
+
slots: {};
|
|
18
|
+
emit: (event: "update:modelValue", value: T) => void;
|
|
19
|
+
}>) => import('vue').VNode & {
|
|
20
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
21
|
+
};
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
25
|
+
[K in keyof T]: T[K];
|
|
26
|
+
} : {
|
|
27
|
+
[K in keyof T as K]: T[K];
|
|
28
|
+
}) & {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import o from "./CfgSegment2.vue.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-aedf9324"]]);
|
|
5
|
+
export {
|
|
6
|
+
r as default
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=CfgSegment.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CfgSegment.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineComponent as v, useModel as p, openBlock as u, createElementBlock as i, Fragment as m, renderList as f, normalizeClass as g, toDisplayString as k, mergeModels as y } from "vue";
|
|
2
|
+
const b = ["aria-label"], h = ["aria-checked", "tabindex", "data-value", "onClick"], x = /* @__PURE__ */ v({
|
|
3
|
+
__name: "CfgSegment",
|
|
4
|
+
props: /* @__PURE__ */ y({
|
|
5
|
+
options: {},
|
|
6
|
+
label: {}
|
|
7
|
+
}, {
|
|
8
|
+
modelValue: { required: !0 },
|
|
9
|
+
modelModifiers: {}
|
|
10
|
+
}),
|
|
11
|
+
emits: ["update:modelValue"],
|
|
12
|
+
setup(l) {
|
|
13
|
+
const o = l, t = p(l, "modelValue");
|
|
14
|
+
function c(a) {
|
|
15
|
+
var s;
|
|
16
|
+
const n = a.key === "ArrowRight" || a.key === "ArrowDown" ? 1 : a.key === "ArrowLeft" || a.key === "ArrowUp" ? -1 : 0;
|
|
17
|
+
if (!n) return;
|
|
18
|
+
a.preventDefault();
|
|
19
|
+
const e = o.options.findIndex((d) => d.value === t.value), r = o.options[(e + n + o.options.length) % o.options.length];
|
|
20
|
+
t.value = r.value, (s = a.currentTarget.querySelector(`[data-value="${r.value}"]`)) == null || s.focus();
|
|
21
|
+
}
|
|
22
|
+
return (a, n) => (u(), i("span", {
|
|
23
|
+
class: "seg",
|
|
24
|
+
role: "radiogroup",
|
|
25
|
+
"aria-label": l.label,
|
|
26
|
+
onKeydown: c
|
|
27
|
+
}, [
|
|
28
|
+
(u(!0), i(m, null, f(l.options, (e) => (u(), i("button", {
|
|
29
|
+
key: e.value,
|
|
30
|
+
type: "button",
|
|
31
|
+
role: "radio",
|
|
32
|
+
"aria-checked": t.value === e.value,
|
|
33
|
+
tabindex: t.value === e.value ? 0 : -1,
|
|
34
|
+
"data-value": e.value,
|
|
35
|
+
class: g({ on: t.value === e.value }),
|
|
36
|
+
onClick: (r) => t.value = e.value
|
|
37
|
+
}, k(e.label), 11, h))), 128))
|
|
38
|
+
], 40, b));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
x as default
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=CfgSegment2.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CfgSegment2.vue.js","sources":["../../../../../src/views/system/config/components/CfgSegment.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T extends string\">\n// 分段控件(仿 macOS):一组互斥选项,选中的一格浮起。语义上是 radiogroup,方向键切换。\nconst props = defineProps<{\n options: readonly { value: T; label: string }[]\n label?: string\n}>()\nconst model = defineModel<T>({ required: true })\n\nfunction onKey(e: KeyboardEvent) {\n const step =\n e.key === 'ArrowRight' || e.key === 'ArrowDown'\n ? 1\n : e.key === 'ArrowLeft' || e.key === 'ArrowUp'\n ? -1\n : 0\n if (!step) return\n e.preventDefault()\n const i = props.options.findIndex(o => o.value === model.value)\n const next = props.options[(i + step + props.options.length) % props.options.length]\n model.value = next.value\n ;(e.currentTarget as HTMLElement)\n .querySelector<HTMLElement>(`[data-value=\"${next.value}\"]`)\n ?.focus()\n}\n</script>\n\n<template>\n <span class=\"seg\" role=\"radiogroup\" :aria-label=\"label\" @keydown=\"onKey\">\n <button\n v-for=\"o in options\"\n :key=\"o.value\"\n type=\"button\"\n role=\"radio\"\n :aria-checked=\"model === o.value\"\n :tabindex=\"model === o.value ? 0 : -1\"\n :data-value=\"o.value\"\n :class=\"{ on: model === o.value }\"\n @click=\"model = o.value\"\n >\n {{ o.label }}\n </button>\n </span>\n</template>\n\n<style scoped>\n.seg {\n display: inline-flex;\n flex: none;\n padding: 2px;\n border-radius: 8px;\n background: var(--color-fill);\n}\nbutton {\n padding: 2px 12px;\n border: 0;\n border-radius: 6px;\n background: none;\n font: inherit;\n font-size: var(--font-size-sm);\n line-height: 20px;\n color: var(--color-text-secondary);\n cursor: pointer;\n white-space: nowrap;\n}\nbutton.on {\n background: var(--color-bg-container);\n color: var(--color-text-primary);\n font-weight: 500;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);\n}\nbutton:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: 1px;\n}\n</style>\n"],"names":["props","__props","model","_useModel","onKey","e","step","i","o","next","_a","_createElementBlock","_Fragment","_renderList","_normalizeClass","$event","_toDisplayString","_hoisted_2"],"mappings":";;;;;;;;;;;;AAEA,UAAMA,IAAQC,GAIRC,IAAQC,EAAcF,GAAA,YAAmB;AAE/C,aAASG,EAAMC,GAAkB;;AAC/B,YAAMC,IACJD,EAAE,QAAQ,gBAAgBA,EAAE,QAAQ,cAChC,IACAA,EAAE,QAAQ,eAAeA,EAAE,QAAQ,YACjC,KACA;AACR,UAAI,CAACC,EAAM;AACX,MAAAD,EAAE,eAAA;AACF,YAAME,IAAIP,EAAM,QAAQ,UAAU,OAAKQ,EAAE,UAAUN,EAAM,KAAK,GACxDO,IAAOT,EAAM,SAASO,IAAID,IAAON,EAAM,QAAQ,UAAUA,EAAM,QAAQ,MAAM;AACnF,MAAAE,EAAM,QAAQO,EAAK,QACjBC,IAAAL,EAAE,cACD,cAA2B,gBAAgBI,EAAK,KAAK,IAAI,MAD1D,QAAAC,EAEE;AAAA,IACN;2BAIEC,EAcO,QAAA;AAAA,MAdD,OAAM;AAAA,MAAM,MAAK;AAAA,MAAc,cAAYV,EAAA;AAAA,MAAQ,WAASG;AAAA,IAAA;cAChEO,EAYSC,GAAA,MAAAC,EAXKZ,EAAA,SAAO,CAAZO,YADTG,EAYS,UAAA;AAAA,QAVN,KAAKH,EAAE;AAAA,QACR,MAAK;AAAA,QACL,MAAK;AAAA,QACJ,gBAAcN,EAAA,UAAUM,EAAE;AAAA,QAC1B,UAAUN,EAAA,UAAUM,EAAE,QAAK,IAAA;AAAA,QAC3B,cAAYA,EAAE;AAAA,QACd,OAAKM,EAAA,EAAA,IAAQZ,EAAA,UAAUM,EAAE,OAAK;AAAA,QAC9B,SAAK,CAAAO,MAAEb,EAAA,QAAQM,EAAE;AAAA,MAAA,GAEfQ,EAAAR,EAAE,KAAK,GAAA,IAAAS,CAAA;;;;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./ConfigFormModal2.vue.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import r from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-cfd3060b"]]);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
a as default
|
|
4
7
|
};
|
|
5
8
|
//# sourceMappingURL=ConfigFormModal.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigFormModal.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfigFormModal.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useMessage as
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as K, useModel as x, ref as N, reactive as V, watch as R, computed as U, openBlock as y, createBlock as w, unref as e, withCtx as n, createVNode as r, createTextVNode as M, toDisplayString as q, createCommentVNode as B, mergeModels as I } from "vue";
|
|
2
|
+
import { useMessage as F, NForm as T, NAlert as z, NFormItem as u, NInput as f, NInputNumber as A } from "naive-ui";
|
|
3
|
+
import { useI18n as D } from "vue-i18n";
|
|
4
|
+
import O from "../../../../components/FormContainer/index.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { configApi as b } from "../../../../api/index.js";
|
|
7
|
-
import { translateError as
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import { translateError as $ } from "../../../../utils/error.js";
|
|
8
|
+
import { tabOfKey as j, bumpConfigRevision as E } from "../groups.js";
|
|
9
|
+
import { useConfigDraft as H } from "../draft.js";
|
|
10
|
+
const Z = /* @__PURE__ */ K({
|
|
10
11
|
__name: "ConfigFormModal",
|
|
11
|
-
props: /* @__PURE__ */
|
|
12
|
+
props: /* @__PURE__ */ I({
|
|
12
13
|
row: {}
|
|
13
14
|
}, {
|
|
14
15
|
show: { type: Boolean, default: !1 },
|
|
@@ -16,7 +17,7 @@ const P = /* @__PURE__ */ k({
|
|
|
16
17
|
}),
|
|
17
18
|
emits: ["update:show"],
|
|
18
19
|
setup(s) {
|
|
19
|
-
const d =
|
|
20
|
+
const d = x(s, "show"), m = s, { t: a } = D(), g = F(), c = N(null), k = {
|
|
20
21
|
configKey: {
|
|
21
22
|
required: !0,
|
|
22
23
|
whitespace: !0,
|
|
@@ -29,19 +30,19 @@ const P = /* @__PURE__ */ k({
|
|
|
29
30
|
message: () => a("config.nameRequired"),
|
|
30
31
|
trigger: ["input", "blur"]
|
|
31
32
|
}
|
|
32
|
-
},
|
|
33
|
+
}, p = () => ({
|
|
33
34
|
configKey: "",
|
|
34
35
|
configValue: "",
|
|
35
36
|
name: "",
|
|
36
37
|
groupCode: "",
|
|
37
38
|
sort: 0,
|
|
38
39
|
remark: ""
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
if (!
|
|
40
|
+
}), t = V(p());
|
|
41
|
+
R(d, (i) => {
|
|
42
|
+
if (!i) return;
|
|
42
43
|
const o = m.row;
|
|
43
44
|
Object.assign(
|
|
44
|
-
|
|
45
|
+
t,
|
|
45
46
|
o ? {
|
|
46
47
|
configKey: o.configKey,
|
|
47
48
|
configValue: o.configValue ?? "",
|
|
@@ -49,48 +50,59 @@ const P = /* @__PURE__ */ k({
|
|
|
49
50
|
groupCode: o.groupCode ?? "",
|
|
50
51
|
sort: o.sort,
|
|
51
52
|
remark: o.remark ?? ""
|
|
52
|
-
} :
|
|
53
|
+
} : p()
|
|
53
54
|
);
|
|
54
55
|
});
|
|
55
|
-
const v =
|
|
56
|
-
const
|
|
57
|
-
return
|
|
56
|
+
const h = H(), v = U(() => {
|
|
57
|
+
const i = t.configKey.trim();
|
|
58
|
+
return h.claimedKeys.value.includes(i) ? a("config.keyManagedBy", { tab: a(`config.tab.${j(i)}`) }) : void 0;
|
|
58
59
|
});
|
|
59
|
-
async function
|
|
60
|
-
var
|
|
61
|
-
await ((
|
|
60
|
+
async function C() {
|
|
61
|
+
var i;
|
|
62
|
+
await ((i = c.value) == null ? void 0 : i.validate());
|
|
62
63
|
try {
|
|
63
|
-
m.row === null ? await b.add({ ...
|
|
64
|
+
m.row === null ? await b.add({ ...t }) : await b.update(m.row.id, { ...t }), g.success(a("config.saved")), E();
|
|
64
65
|
} catch (o) {
|
|
65
|
-
return g.error(
|
|
66
|
+
return g.error($(o)), !1;
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
|
-
return (
|
|
69
|
+
return (i, o) => (y(), w(O, {
|
|
69
70
|
show: d.value,
|
|
70
|
-
"onUpdate:show": o[6] || (o[6] = (
|
|
71
|
+
"onUpdate:show": o[6] || (o[6] = (l) => d.value = l),
|
|
71
72
|
title: s.row === null ? e(a)("config.addTitle") : e(a)("config.editTitle"),
|
|
72
73
|
width: 520,
|
|
73
|
-
"on-confirm":
|
|
74
|
+
"on-confirm": C,
|
|
74
75
|
"confirm-text": e(a)("common.save")
|
|
75
76
|
}, {
|
|
76
|
-
default:
|
|
77
|
-
r(e(
|
|
77
|
+
default: n(() => [
|
|
78
|
+
r(e(T), {
|
|
78
79
|
ref_key: "formRef",
|
|
79
|
-
ref:
|
|
80
|
-
model:
|
|
81
|
-
rules:
|
|
80
|
+
ref: c,
|
|
81
|
+
model: t,
|
|
82
|
+
rules: k,
|
|
82
83
|
"label-placement": "left",
|
|
83
84
|
"label-width": 90
|
|
84
85
|
}, {
|
|
85
|
-
default:
|
|
86
|
+
default: n(() => [
|
|
87
|
+
v.value ? (y(), w(e(z), {
|
|
88
|
+
key: 0,
|
|
89
|
+
type: "warning",
|
|
90
|
+
bordered: !1,
|
|
91
|
+
class: "key-hint"
|
|
92
|
+
}, {
|
|
93
|
+
default: n(() => [
|
|
94
|
+
M(q(v.value), 1)
|
|
95
|
+
]),
|
|
96
|
+
_: 1
|
|
97
|
+
})) : B("", !0),
|
|
86
98
|
r(e(u), {
|
|
87
99
|
label: e(a)("config.key"),
|
|
88
100
|
path: "configKey"
|
|
89
101
|
}, {
|
|
90
|
-
default:
|
|
102
|
+
default: n(() => [
|
|
91
103
|
r(e(f), {
|
|
92
|
-
value:
|
|
93
|
-
"onUpdate:value": o[0] || (o[0] = (
|
|
104
|
+
value: t.configKey,
|
|
105
|
+
"onUpdate:value": o[0] || (o[0] = (l) => t.configKey = l),
|
|
94
106
|
placeholder: e(a)("config.key"),
|
|
95
107
|
disabled: s.row !== null
|
|
96
108
|
}, null, 8, ["value", "placeholder", "disabled"])
|
|
@@ -101,10 +113,10 @@ const P = /* @__PURE__ */ k({
|
|
|
101
113
|
label: e(a)("config.name"),
|
|
102
114
|
path: "name"
|
|
103
115
|
}, {
|
|
104
|
-
default:
|
|
116
|
+
default: n(() => [
|
|
105
117
|
r(e(f), {
|
|
106
|
-
value:
|
|
107
|
-
"onUpdate:value": o[1] || (o[1] = (
|
|
118
|
+
value: t.name,
|
|
119
|
+
"onUpdate:value": o[1] || (o[1] = (l) => t.name = l),
|
|
108
120
|
placeholder: e(a)("config.name")
|
|
109
121
|
}, null, 8, ["value", "placeholder"])
|
|
110
122
|
]),
|
|
@@ -113,10 +125,10 @@ const P = /* @__PURE__ */ k({
|
|
|
113
125
|
r(e(u), {
|
|
114
126
|
label: e(a)("config.value")
|
|
115
127
|
}, {
|
|
116
|
-
default:
|
|
128
|
+
default: n(() => [
|
|
117
129
|
r(e(f), {
|
|
118
|
-
value:
|
|
119
|
-
"onUpdate:value": o[2] || (o[2] = (
|
|
130
|
+
value: t.configValue,
|
|
131
|
+
"onUpdate:value": o[2] || (o[2] = (l) => t.configValue = l),
|
|
120
132
|
type: "textarea",
|
|
121
133
|
autosize: { minRows: 2 }
|
|
122
134
|
}, null, 8, ["value"])
|
|
@@ -124,26 +136,24 @@ const P = /* @__PURE__ */ k({
|
|
|
124
136
|
_: 1
|
|
125
137
|
}, 8, ["label"]),
|
|
126
138
|
r(e(u), {
|
|
127
|
-
label: e(a)("config.group")
|
|
128
|
-
feedback: v.value,
|
|
129
|
-
"validation-status": v.value ? "warning" : void 0
|
|
139
|
+
label: e(a)("config.group")
|
|
130
140
|
}, {
|
|
131
|
-
default:
|
|
141
|
+
default: n(() => [
|
|
132
142
|
r(e(f), {
|
|
133
|
-
value:
|
|
134
|
-
"onUpdate:value": o[3] || (o[3] = (
|
|
143
|
+
value: t.groupCode,
|
|
144
|
+
"onUpdate:value": o[3] || (o[3] = (l) => t.groupCode = l),
|
|
135
145
|
placeholder: e(a)("config.group")
|
|
136
146
|
}, null, 8, ["value", "placeholder"])
|
|
137
147
|
]),
|
|
138
148
|
_: 1
|
|
139
|
-
}, 8, ["label"
|
|
149
|
+
}, 8, ["label"]),
|
|
140
150
|
r(e(u), {
|
|
141
151
|
label: e(a)("config.sort")
|
|
142
152
|
}, {
|
|
143
|
-
default:
|
|
144
|
-
r(e(
|
|
145
|
-
value:
|
|
146
|
-
"onUpdate:value": o[4] || (o[4] = (
|
|
153
|
+
default: n(() => [
|
|
154
|
+
r(e(A), {
|
|
155
|
+
value: t.sort,
|
|
156
|
+
"onUpdate:value": o[4] || (o[4] = (l) => t.sort = l),
|
|
147
157
|
min: 0,
|
|
148
158
|
style: { width: "160px" }
|
|
149
159
|
}, null, 8, ["value"])
|
|
@@ -153,10 +163,10 @@ const P = /* @__PURE__ */ k({
|
|
|
153
163
|
r(e(u), {
|
|
154
164
|
label: e(a)("config.remark")
|
|
155
165
|
}, {
|
|
156
|
-
default:
|
|
166
|
+
default: n(() => [
|
|
157
167
|
r(e(f), {
|
|
158
|
-
value:
|
|
159
|
-
"onUpdate:value": o[5] || (o[5] = (
|
|
168
|
+
value: t.remark,
|
|
169
|
+
"onUpdate:value": o[5] || (o[5] = (l) => t.remark = l),
|
|
160
170
|
type: "textarea",
|
|
161
171
|
autosize: { minRows: 2 }
|
|
162
172
|
}, null, 8, ["value"])
|
|
@@ -172,6 +182,6 @@ const P = /* @__PURE__ */ k({
|
|
|
172
182
|
}
|
|
173
183
|
});
|
|
174
184
|
export {
|
|
175
|
-
|
|
185
|
+
Z as default
|
|
176
186
|
};
|
|
177
187
|
//# sourceMappingURL=ConfigFormModal2.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigFormModal2.vue.js","sources":["../../../../../src/views/system/config/components/ConfigFormModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// 配置行新增/编辑弹窗(
|
|
1
|
+
{"version":3,"file":"ConfigFormModal2.vue.js","sources":["../../../../../src/views/system/config/components/ConfigFormModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// 配置行新增/编辑弹窗(「高级」页用)。\n// FormContainer 接管 loading/关闭时机:校验失败 reject / API 失败 return false → 弹层不关。\nimport { computed, reactive, ref, watch } from 'vue'\nimport {\n NAlert,\n NInput,\n NInputNumber,\n NForm,\n NFormItem,\n useMessage,\n type FormInst,\n type FormRules,\n} from 'naive-ui'\nimport { useI18n } from 'vue-i18n'\nimport FormContainer from '#/components/FormContainer/index.vue'\nimport { configApi } from '#/api'\nimport { translateError } from '#/utils/error'\nimport type { ConfigInput, SysConfig } from '#/types/api'\nimport { bumpConfigRevision, tabOfKey } from '../groups'\nimport { useConfigDraft } from '../draft'\n\nconst show = defineModel<boolean>('show', { default: false })\n/** 要编辑的行;null = 新增。 */\nconst props = defineProps<{ row: SysConfig | null }>()\n\nconst { t } = useI18n()\nconst message = useMessage()\nconst formRef = ref<FormInst | null>(null)\n\nconst rules: FormRules = {\n configKey: {\n required: true,\n whitespace: true,\n message: () => t('config.keyRequired'),\n trigger: ['input', 'blur'],\n },\n name: {\n required: true,\n whitespace: true,\n message: () => t('config.nameRequired'),\n trigger: ['input', 'blur'],\n },\n}\nconst blank = (): ConfigInput => ({\n configKey: '',\n configValue: '',\n name: '',\n groupCode: '',\n sort: 0,\n remark: '',\n})\nconst form = reactive<ConfigInput>(blank())\n\nwatch(show, v => {\n if (!v) return\n const r = props.row\n Object.assign(\n form,\n r\n ? {\n configKey: r.configKey,\n configValue: r.configValue ?? '',\n name: r.name,\n groupCode: r.groupCode ?? '',\n sort: r.sort,\n remark: r.remark ?? '',\n }\n : blank(),\n )\n})\n\n// 键已被某个结构化表单认领时,保存后它显示在那个分类的表单里、不在「高级」表里,先告诉用户去哪找\nconst draft = useConfigDraft()\nconst keyHint = computed(() => {\n const key = form.configKey.trim()\n return draft.claimedKeys.value.includes(key)\n ? t('config.keyManagedBy', { tab: t(`config.tab.${tabOfKey(key)}`) })\n : undefined\n})\n\nasync function save() {\n await formRef.value?.validate()\n try {\n if (props.row === null) await configApi.add({ ...form })\n else await configApi.update(props.row.id, { ...form })\n message.success(t('config.saved'))\n // 用到这批行的列表(「其他配置」与各 Tab 的「本组其它配置」)都跟着版本号重拉\n bumpConfigRevision()\n } catch (e) {\n message.error(translateError(e))\n return false\n }\n}\n</script>\n\n<template>\n <FormContainer\n v-model:show=\"show\"\n :title=\"row === null ? t('config.addTitle') : t('config.editTitle')\"\n :width=\"520\"\n :on-confirm=\"save\"\n :confirm-text=\"t('common.save')\"\n >\n <n-form ref=\"formRef\" :model=\"form\" :rules=\"rules\" label-placement=\"left\" :label-width=\"90\">\n <n-alert v-if=\"keyHint\" type=\"warning\" :bordered=\"false\" class=\"key-hint\">\n {{ keyHint }}\n </n-alert>\n <n-form-item :label=\"t('config.key')\" path=\"configKey\">\n <n-input\n v-model:value=\"form.configKey\"\n :placeholder=\"t('config.key')\"\n :disabled=\"row !== null\"\n />\n </n-form-item>\n <n-form-item :label=\"t('config.name')\" path=\"name\">\n <n-input v-model:value=\"form.name\" :placeholder=\"t('config.name')\" />\n </n-form-item>\n <n-form-item :label=\"t('config.value')\">\n <n-input\n v-model:value=\"form.configValue as string\"\n type=\"textarea\"\n :autosize=\"{ minRows: 2 }\"\n />\n </n-form-item>\n <n-form-item :label=\"t('config.group')\">\n <n-input v-model:value=\"form.groupCode as string\" :placeholder=\"t('config.group')\" />\n </n-form-item>\n <n-form-item :label=\"t('config.sort')\">\n <n-input-number v-model:value=\"form.sort\" :min=\"0\" style=\"width: 160px\" />\n </n-form-item>\n <n-form-item :label=\"t('config.remark')\">\n <n-input v-model:value=\"form.remark as string\" type=\"textarea\" :autosize=\"{ minRows: 2 }\" />\n </n-form-item>\n </n-form>\n </FormContainer>\n</template>\n\n<style scoped>\n.key-hint {\n margin-bottom: 12px;\n}\n</style>\n"],"names":["show","_useModel","__props","props","t","useI18n","message","useMessage","formRef","ref","rules","blank","form","reactive","watch","v","r","draft","useConfigDraft","keyHint","computed","key","tabOfKey","save","_a","configApi","bumpConfigRevision","e","translateError","_createBlock","FormContainer","$event","_unref","_createVNode","NForm","NAlert","NFormItem","NInput","_cache","NInputNumber"],"mappings":";;;;;;;;;;;;;;;;;;;AAsBA,UAAMA,IAAOC,EAAoBC,GAAC,MAA0B,GAEtDC,IAAQD,GAER,EAAE,GAAAE,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6B,EAA0ED,EAAAO,CAAA,GAAA;AAAA,kBAAlD,OAAO3B,EAAK;AAAA,kBAAL,kBAAA0B,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAP,MAAAnB,EAAK,OAAImB;AAAA,kBAAG,KAAK;AAAA,kBAAG,OAAA,EAAA,OAAA,QAAA;AAAA,gBAAA;;;;YAErDE,EAEcD,EAAAI,CAAA,GAAA;AAAA,cAFA,OAAOJ,EAAA5B,CAAA,EAAC,eAAA;AAAA,YAAA;yBACpB,MAA4F;AAAA,gBAA5F6B,EAA4FD,EAAAK,CAAA,GAAA;AAAA,kBAA3E,OAAOzB,EAAK;AAAA,kBAAL,kBAAA0B,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAP,MAAAnB,EAAK,SAAMmB;AAAA,kBAAY,MAAK;AAAA,kBAAY,UAAU,EAAA,SAAA,EAAA;AAAA,gBAAA;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import o from "./JobSection2.vue.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1c9fd766"]]);
|
|
5
|
+
export {
|
|
6
|
+
m as default
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=JobSection.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JobSection.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|