@skyfox2000/webui 1.4.7 → 1.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/lib/assets/modules/{baseLayout-DOrecPPK.js → baseLayout-DIny49tw.js} +3 -3
  2. package/lib/assets/modules/{file-upload-lbkluj3p.js → file-upload-DHUBZlX4.js} +1 -1
  3. package/lib/assets/modules/{index-DQ-VDAr-.js → index-BIAdOoSj.js} +2 -2
  4. package/lib/assets/modules/{index-BLNKcgk-.js → index-CEffEFtI.js} +1 -1
  5. package/lib/assets/modules/index-DyRjXb_O.js +114 -0
  6. package/lib/assets/modules/{menuTabs-DOtYQ9Zu.js → menuTabs-CCrFWIOl.js} +2 -2
  7. package/lib/assets/modules/{toolIcon-CqJWc5B7.js → toolIcon-BGZR_aUI.js} +1 -1
  8. package/lib/assets/modules/{uploadList-DafDrGgh.js → uploadList-CMXuGRWT.js} +20 -20
  9. package/lib/assets/modules/{uploadList-3SuA7du0.js → uploadList-l4q5o65m.js} +4 -4
  10. package/lib/components/common/icon/helper.vue.d.ts +2 -0
  11. package/lib/components/content/dialog/index.vue.d.ts +1 -0
  12. package/lib/components/content/drawer/index.vue.d.ts +2 -0
  13. package/lib/es/AceEditor/index.js +3 -3
  14. package/lib/es/BasicLayout/index.js +2 -2
  15. package/lib/es/Error403/index.js +1 -1
  16. package/lib/es/Error404/index.js +1 -1
  17. package/lib/es/ExcelForm/index.js +5 -5
  18. package/lib/es/MenuLayout/index.js +2 -2
  19. package/lib/es/TemplateFile/index.js +4 -4
  20. package/lib/es/UploadForm/index.js +4 -4
  21. package/lib/webui.css +1 -1
  22. package/lib/webui.es.js +170 -161
  23. package/package.json +1 -1
  24. package/src/components/common/icon/helper.vue +3 -1
  25. package/src/components/content/dialog/index.vue +15 -13
  26. package/src/components/content/drawer/index.vue +29 -51
  27. package/src/components/form/propEditor/index.vue +21 -7
  28. package/src/components/form/select/index.vue +1 -1
  29. package/lib/assets/modules/index-B1MSCuqH.js +0 -112
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.4.7",
3
+ "version": "1.4.9",
4
4
  "description": "后台前端通用组件定义",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -2,11 +2,13 @@
2
2
  import { Popover } from 'ant-design-vue';
3
3
  import ToolIcon from './toolIcon.vue';
4
4
  import { useAttrs } from 'vue';
5
+ import { TooltipPlacement } from 'ant-design-vue/es/tooltip';
5
6
 
6
7
  defineProps<{
7
8
  text?: string;
8
9
  maxWidth?: string;
9
10
  size?: number;
11
+ placement?: TooltipPlacement;
10
12
  }>();
11
13
  // 关闭自动继承属性到根元素
12
14
  defineOptions({
@@ -16,7 +18,7 @@ const attrs = useAttrs(); // 手动获取 $attrs
16
18
  </script>
17
19
 
18
20
  <template>
19
- <Popover placement="topRight">
21
+ <Popover :placement="placement ?? 'topRight'">
20
22
  <template #content>
21
23
  <slot>
22
24
  <div class="text-[14px]" :class="[maxWidth]">
@@ -100,19 +100,21 @@ const doDialogClose = () => {
100
100
  <slot></slot>
101
101
  </div>
102
102
  <template #footer>
103
- <Space>
104
- <Button @click="doDialogClose" v-if="cancelText !== ''">
105
- {{ cancelText ?? '取消' }}
106
- </Button>
107
- <Button @click="doDialogSaveAs" v-if="saveAsText !== '' && editorCtrl?.saveAsBtnVisible !== false"
108
- type="primary" :loading="editorCtrl?.isFormSaving.value">
109
- {{ saveAsText ?? '另存为' }}
110
- </Button>
111
- <Button @click="doDialogSave" v-if="saveText !== '' && editorCtrl?.saveBtnVisible !== false" type="primary"
112
- :loading="editorCtrl?.isFormSaving.value">
113
- {{ saveText ?? '保存' }}
114
- </Button>
115
- </Space>
103
+ <slot name="footer">
104
+ <Space>
105
+ <Button @click="doDialogClose" v-if="cancelText !== ''">
106
+ {{ cancelText ?? '取消' }}
107
+ </Button>
108
+ <Button @click="doDialogSaveAs" v-if="saveAsText !== '' && editorCtrl?.saveAsBtnVisible !== false"
109
+ type="primary" :loading="editorCtrl?.isFormSaving.value">
110
+ {{ saveAsText ?? '另存为' }}
111
+ </Button>
112
+ <Button @click="doDialogSave" v-if="saveText !== '' && editorCtrl?.saveBtnVisible !== false"
113
+ type="primary" :loading="editorCtrl?.isFormSaving.value">
114
+ {{ saveText ?? '保存' }}
115
+ </Button>
116
+ </Space>
117
+ </slot>
116
118
  </template>
117
119
  </Modal>
118
120
  </template>
@@ -74,65 +74,43 @@ const doDrawerClose = () => {
74
74
  };
75
75
  </script>
76
76
  <template>
77
- <Drawer
78
- v-model:open="open"
79
- :get-container="false"
80
- :closable="false"
81
- :header-style="{
82
- height: '40px',
83
- padding: '10px 6px 10px 16px',
84
- backgroundColor: token.colorBgLayout,
85
- }"
86
- :body-style="{
87
- padding: '10px 16px',
88
- }"
89
- :footer-style="{
90
- textAlign: 'right',
91
- }"
92
- :style="{
77
+ <Drawer v-model:open="open" :get-container="false" :closable="false" :header-style="{
78
+ height: '40px',
79
+ padding: '10px 6px 10px 16px',
80
+ backgroundColor: token.colorBgLayout,
81
+ }" :body-style="{
82
+ padding: '10px 16px',
83
+ }" :footer-style="{
84
+ textAlign: 'right',
85
+ }" :style="{
93
86
  position: 'absolute',
94
87
  boxShadow: 'rgba(0, 0, 0, 0.3) -2px 0px 8px',
95
- }"
96
- width="420px"
97
- @close="doDrawerClose"
98
- >
88
+ }" width="420px" @close="doDrawerClose">
99
89
  <template #extra>
100
- <div class="hover:bg-gray-200 w-[24px] h-[24px] rounded-md">
101
- <ToolIcon
102
- class="top-[-2px] left-[2px] w-6 h-6"
103
- icon="icon-new"
104
- :angle="45"
105
- fontsize="24px"
106
- clickable
107
- color="#666"
108
- :position="[0, 0]"
109
- @click="doDrawerClose"
110
- />
111
- </div>
90
+ <slot name="extra">
91
+ <div class="hover:bg-gray-200 w-[24px] h-[24px] rounded-md">
92
+ <ToolIcon class="top-[-2px] left-[2px] w-6 h-6" icon="icon-new" :angle="45" fontsize="24px" clickable
93
+ color="#666" :position="[0, 0]" @click="doDrawerClose" />
94
+ </div>
95
+ </slot>
112
96
  </template>
113
97
  <template #default>
114
98
  <slot></slot>
115
99
  </template>
116
100
  <template #footer>
117
- <Space>
118
- <Button @click="doDrawerClose" v-if="cancelText !== ''">{{ cancelText ?? '取消' }}</Button>
119
- <Button
120
- @click="doDrawerSaveAs"
121
- v-if="saveAsText !== '' && editorCtrl.saveAsBtnVisible !== false"
122
- type="primary"
123
- :loading="editorCtrl.isFormSaving.value"
124
- >
125
- {{ saveAsText ?? '另存为' }}
126
- </Button>
127
- <Button
128
- @click="doDrawerSave"
129
- v-if="saveText !== '' && editorCtrl.saveBtnVisible !== false"
130
- type="primary"
131
- :loading="editorCtrl.isFormSaving.value"
132
- >
133
- {{ saveText ?? '保存' }}
134
- </Button>
135
- </Space>
101
+ <slot name="footer">
102
+ <Space>
103
+ <Button @click="doDrawerClose" v-if="cancelText !== ''">{{ cancelText ?? '取消' }}</Button>
104
+ <Button @click="doDrawerSaveAs" v-if="saveAsText !== '' && editorCtrl.saveAsBtnVisible !== false"
105
+ type="primary" :loading="editorCtrl.isFormSaving.value">
106
+ {{ saveAsText ?? '另存为' }}
107
+ </Button>
108
+ <Button @click="doDrawerSave" v-if="saveText !== '' && editorCtrl.saveBtnVisible !== false"
109
+ type="primary" :loading="editorCtrl.isFormSaving.value">
110
+ {{ saveText ?? '保存' }}
111
+ </Button>
112
+ </Space>
113
+ </slot>
136
114
  </template>
137
115
  </Drawer>
138
116
  </template>
@@ -80,15 +80,29 @@ watch(
80
80
  );
81
81
 
82
82
  const updateConfig = () => {
83
- const newConfig = configList.value.reduce(
84
- (acc: Record<string, string>, item: PropConfigItem) => {
83
+ let newConfig: Record<string, string>;
84
+
85
+ if (props.selectList && props.selectList.length > 0) {
86
+ // 有selectList时,只更新selectList中定义的字段,保留其他字段不变
87
+ newConfig = { ...props.value };
88
+ configList.value.forEach((item: PropConfigItem) => {
85
89
  if (item.field) {
86
- acc[item.field] = item.value;
90
+ newConfig[item.field] = item.value;
87
91
  }
88
- return acc;
89
- },
90
- {} as Record<string, string>,
91
- );
92
+ });
93
+ } else {
94
+ // 没有selectList时,更新所有字段
95
+ newConfig = configList.value.reduce(
96
+ (acc: Record<string, string>, item: PropConfigItem) => {
97
+ if (item.field) {
98
+ acc[item.field] = item.value;
99
+ }
100
+ return acc;
101
+ },
102
+ {} as Record<string, string>,
103
+ );
104
+ }
105
+
92
106
  isInnerChange = true;
93
107
  emit('update:value', newConfig);
94
108
  };
@@ -89,7 +89,7 @@ const onChanged = (value: any) => {
89
89
  innerValue.value = value;
90
90
  emit('update:labels', labels);
91
91
  emit('update:label', labels.join(";"));
92
- emit('change', value);
92
+ emit('change', value, selectedOptions);
93
93
 
94
94
  if (errInfo?.value.errClass && editorCtrl) {
95
95
  /// 重新开始验证
@@ -1,112 +0,0 @@
1
- import { defineComponent as F, provide as _, ref as w, watch as p, onMounted as B, createBlock as n, openBlock as r, unref as a, withCtx as i, createElementVNode as N, renderSlot as b, createVNode as V, createCommentVNode as d, createTextVNode as u, toDisplayString as v } from "vue";
2
- import { _ as m } from "./index-BLNKcgk-.js";
3
- import { Modal as D, Space as E } from "ant-design-vue";
4
- import "@skyfox2000/fapi";
5
- import { P as M, d as P, o as $, b as K } from "./uploadList-DafDrGgh.js";
6
- import "@skyfox2000/microbase";
7
- import "vue-m-message";
8
- import "async-validator";
9
- import "dayjs";
10
- import "vue-draggable-next";
11
- const U = { class: "overflow-y-auto w-full h-full" }, R = /* @__PURE__ */ F({
12
- __name: "index",
13
- props: {
14
- saveText: {},
15
- saveAsText: {},
16
- cancelText: {},
17
- editorCtrl: {},
18
- dialogSave: { type: Function },
19
- dialogSaveAs: { type: Function },
20
- width: {},
21
- full: { type: Boolean },
22
- open: { type: Boolean }
23
- },
24
- emits: ["update:open"],
25
- setup(C, { emit: T }) {
26
- const l = C, e = l.editorCtrl;
27
- _(M.EditorControl, e);
28
- const t = w(l.open ?? !1), A = T, h = w(l.width ?? 430);
29
- p(
30
- () => e == null ? void 0 : e.visible.value,
31
- (o) => {
32
- t.value = o ?? !1;
33
- }
34
- ), p(
35
- () => l.open,
36
- (o) => {
37
- t.value = o;
38
- }
39
- ), p(
40
- () => t.value,
41
- (o) => {
42
- A("update:open", o), o || f();
43
- }
44
- ), B(() => {
45
- t.value = (e == null ? void 0 : e.visible.value) ?? !1;
46
- });
47
- const k = () => {
48
- l.dialogSave ? l.dialogSave() : e && $(e);
49
- }, x = () => {
50
- l.dialogSaveAs ? l.dialogSaveAs() : e && K(e);
51
- }, f = () => {
52
- e ? P(e) : t.value = !1;
53
- };
54
- return (o, c) => (r(), n(a(D), {
55
- open: t.value,
56
- "onUpdate:open": c[0] || (c[0] = (s) => t.value = s),
57
- wrapClassName: "modal mx-auto min-w-[430px] " + (o.full ? "full-modal w-full" : ""),
58
- width: h.value
59
- }, {
60
- footer: i(() => [
61
- V(a(E), null, {
62
- default: i(() => {
63
- var s, g, S, y;
64
- return [
65
- o.cancelText !== "" ? (r(), n(a(m), {
66
- key: 0,
67
- onClick: f
68
- }, {
69
- default: i(() => [
70
- u(v(o.cancelText ?? "取消"), 1)
71
- ]),
72
- _: 1
73
- })) : d("", !0),
74
- o.saveAsText !== "" && ((s = a(e)) == null ? void 0 : s.saveAsBtnVisible) !== !1 ? (r(), n(a(m), {
75
- key: 1,
76
- onClick: x,
77
- type: "primary",
78
- loading: (g = a(e)) == null ? void 0 : g.isFormSaving.value
79
- }, {
80
- default: i(() => [
81
- u(v(o.saveAsText ?? "另存为"), 1)
82
- ]),
83
- _: 1
84
- }, 8, ["loading"])) : d("", !0),
85
- o.saveText !== "" && ((S = a(e)) == null ? void 0 : S.saveBtnVisible) !== !1 ? (r(), n(a(m), {
86
- key: 2,
87
- onClick: k,
88
- type: "primary",
89
- loading: (y = a(e)) == null ? void 0 : y.isFormSaving.value
90
- }, {
91
- default: i(() => [
92
- u(v(o.saveText ?? "保存"), 1)
93
- ]),
94
- _: 1
95
- }, 8, ["loading"])) : d("", !0)
96
- ];
97
- }),
98
- _: 1
99
- })
100
- ]),
101
- default: i(() => [
102
- N("div", U, [
103
- b(o.$slots, "default")
104
- ])
105
- ]),
106
- _: 3
107
- }, 8, ["open", "wrapClassName", "width"]));
108
- }
109
- });
110
- export {
111
- R as _
112
- };