hy-dispatch-ui-v3 0.1.4 → 0.1.6
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/tailwind.css +59 -0
- package/es/components/appConfigProvider/appConfigProvider.vue.mjs +3 -3
- package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs +3 -3
- package/es/components/appConfirmDialog/appConfirmMethod.mjs +13 -13
- package/es/components/appCutter/appCutter.vue.mjs +285 -0
- package/es/components/appCutter/index.mjs +6 -0
- package/es/components/appCutter/style/appCutter.scss +51 -0
- package/es/components/appDialog/appDialog.vue.mjs +205 -0
- package/es/components/appDialog/index.mjs +6 -0
- package/es/components/appDialog/style/appDialog.scss +0 -0
- package/es/components/appSearch/appSearch.vue.mjs +4 -8
- package/es/components/appTable/appTable.vue.mjs +4 -4
- package/es/components/appTable/js/useAppTable.mjs +4 -3
- package/es/components/index.mjs +2 -0
- package/es/hooks/useApi.mjs +6 -2
- package/es/hooks/useGlobalConfig.mjs +2 -2
- package/es/hooks/useLocale.mjs +14 -4
- package/es/hooks/useUserAvatarMap.mjs +6 -2
- package/es/index.mjs +4 -1
- package/es/locale/en.mjs +6 -1
- package/es/locale/zh_CN.mjs +8 -3
- package/es/utils/file.mjs +68 -0
- package/es/utils/index.mjs +2 -1
- package/es/utils/is.mjs +4 -1
- package/es/version.mjs +1 -1
- package/lib/components/appConfigProvider/appConfigProvider.vue.js +1 -1
- package/lib/components/appConfirmDialog/appConfirmDialog.vue.js +3 -3
- package/lib/components/appConfirmDialog/appConfirmMethod.js +13 -13
- package/lib/components/appCutter/appCutter.vue.js +289 -0
- package/lib/components/appCutter/index.js +11 -0
- package/lib/components/appCutter/style/appCutter.scss +51 -0
- package/lib/components/appDialog/appDialog.vue.js +209 -0
- package/lib/components/appDialog/index.js +11 -0
- package/lib/components/appDialog/style/appDialog.scss +0 -0
- package/lib/components/appSearch/appSearch.vue.js +4 -8
- package/lib/components/appTable/appTable.vue.js +26 -26
- package/lib/components/appTable/js/useAppTable.js +4 -3
- package/lib/components/index.js +26 -22
- package/lib/hooks/useApi.js +6 -2
- package/lib/hooks/useLocale.js +13 -3
- package/lib/hooks/useUserAvatarMap.js +6 -2
- package/lib/index.js +35 -22
- package/lib/locale/en.js +6 -1
- package/lib/locale/zh_CN.js +8 -3
- package/lib/utils/file.js +76 -0
- package/lib/utils/index.js +9 -0
- package/lib/utils/is.js +4 -0
- package/lib/version.js +1 -1
- package/package.json +2 -3
|
@@ -6,8 +6,8 @@ var vue = require('vue');
|
|
|
6
6
|
var useApi = require('../../hooks/useApi.js');
|
|
7
7
|
var index = require('../appConfigProvider/index.js');
|
|
8
8
|
var appConfirmDialog = require('./appConfirmDialog.vue.js');
|
|
9
|
-
var useGlobalConfig = require('../../hooks/useGlobalConfig.js');
|
|
10
9
|
var useLocale = require('../../hooks/useLocale.js');
|
|
10
|
+
var useGlobalConfig = require('../../hooks/useGlobalConfig.js');
|
|
11
11
|
|
|
12
12
|
function appConfirmMethod(config) {
|
|
13
13
|
let container = document.createDocumentFragment();
|
|
@@ -56,9 +56,9 @@ function appConfirmMethod(config) {
|
|
|
56
56
|
appConfirmDialog.default.tip = (props) => {
|
|
57
57
|
const { t } = useLocale.useLocale();
|
|
58
58
|
return appConfirmMethod({
|
|
59
|
-
dialogTitle: t("
|
|
60
|
-
title: t("
|
|
61
|
-
content: t("
|
|
59
|
+
dialogTitle: t("dialog.prompt"),
|
|
60
|
+
title: t("dialog.prompt"),
|
|
61
|
+
content: t("dialog.content"),
|
|
62
62
|
showCancel: false,
|
|
63
63
|
...props
|
|
64
64
|
});
|
|
@@ -66,19 +66,19 @@ appConfirmDialog.default.tip = (props) => {
|
|
|
66
66
|
appConfirmDialog.default.confirm = (props) => {
|
|
67
67
|
const { t } = useLocale.useLocale();
|
|
68
68
|
return appConfirmMethod({
|
|
69
|
-
dialogTitle: t("
|
|
70
|
-
title: t("
|
|
71
|
-
content: t("
|
|
69
|
+
dialogTitle: t("dialog.prompt"),
|
|
70
|
+
title: t("dialog.prompt"),
|
|
71
|
+
content: t("dialog.content"),
|
|
72
72
|
...props
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
75
|
appConfirmDialog.default.warning = (props) => {
|
|
76
76
|
const { t } = useLocale.useLocale();
|
|
77
77
|
return appConfirmMethod({
|
|
78
|
-
dialogTitle: t("
|
|
79
|
-
title: t("
|
|
78
|
+
dialogTitle: t("dialog.riskWarning"),
|
|
79
|
+
title: t("dialog.prompt"),
|
|
80
80
|
titleClass: "text-warning",
|
|
81
|
-
content: t("
|
|
81
|
+
content: t("dialog.content"),
|
|
82
82
|
iconColor: "rgb(var(--hy-warning))",
|
|
83
83
|
...props
|
|
84
84
|
});
|
|
@@ -86,10 +86,10 @@ appConfirmDialog.default.warning = (props) => {
|
|
|
86
86
|
appConfirmDialog.default.danger = (props) => {
|
|
87
87
|
const { t } = useLocale.useLocale();
|
|
88
88
|
return appConfirmMethod({
|
|
89
|
-
dialogTitle: t("
|
|
89
|
+
dialogTitle: t("dialog.dangerousOperation"),
|
|
90
90
|
titleClass: "text-danger",
|
|
91
|
-
title: t("
|
|
92
|
-
content: t("
|
|
91
|
+
title: t("dialog.prompt"),
|
|
92
|
+
content: t("dialog.content"),
|
|
93
93
|
submitType: "danger",
|
|
94
94
|
iconColor: "rgb(var(--hy-danger))",
|
|
95
95
|
...props
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var vueCropper = require('vue-cropper');
|
|
7
|
+
var elementPlus = require('element-plus');
|
|
8
|
+
var iconsVue = require('@element-plus/icons-vue');
|
|
9
|
+
var index = require('../appDialog/index.js');
|
|
10
|
+
var is = require('../../utils/is.js');
|
|
11
|
+
var file$1 = require('../../utils/file.js');
|
|
12
|
+
var useLocale = require('../../hooks/useLocale.js');
|
|
13
|
+
|
|
14
|
+
import "vue-cropper/dist/index.css";
|
|
15
|
+
|
|
16
|
+
import "./style/appCutter.scss";
|
|
17
|
+
|
|
18
|
+
const __default__ = vue.defineComponent({
|
|
19
|
+
name: "AppCutter"
|
|
20
|
+
});
|
|
21
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
22
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
23
|
+
dialogWidth: { type: [String, Number], default: 1e3 },
|
|
24
|
+
defaultImg: { type: String },
|
|
25
|
+
uploadText: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: () => {
|
|
28
|
+
const { t } = useLocale.useLocale();
|
|
29
|
+
return t("cutter.uploadPicture");
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
showUpload: { type: Boolean, default: true },
|
|
33
|
+
showText: { type: Boolean, default: true },
|
|
34
|
+
showDelete: { type: Boolean, default: true },
|
|
35
|
+
maxSize: { type: Number, default: 1024 * 1024 * 2 },
|
|
36
|
+
accept: { type: String, default: "image/png,image/jpg,image/jpeg,image/gif" },
|
|
37
|
+
info: { type: Boolean, default: true },
|
|
38
|
+
outputSize: { type: Number, default: 1 },
|
|
39
|
+
outputType: { type: String, default: "jpeg" },
|
|
40
|
+
autoCrop: { type: Boolean, default: true },
|
|
41
|
+
autoCropWidth: { type: Number, default: 100 },
|
|
42
|
+
autoCropHeight: { type: Number, default: 100 },
|
|
43
|
+
fixedBox: { type: Boolean, default: false },
|
|
44
|
+
fixed: { type: Boolean, default: true },
|
|
45
|
+
fixedNumber: { type: Array },
|
|
46
|
+
full: { type: Boolean, default: true },
|
|
47
|
+
canMoveBox: { type: Boolean, default: false },
|
|
48
|
+
original: { type: Boolean, default: false },
|
|
49
|
+
centerBox: { type: Boolean, default: true },
|
|
50
|
+
infoTrue: { type: Boolean, default: false }
|
|
51
|
+
}, {
|
|
52
|
+
"modelValue": { type: String },
|
|
53
|
+
"modelModifiers": {}
|
|
54
|
+
}),
|
|
55
|
+
emits: /* @__PURE__ */ vue.mergeModels(["confirm"], ["update:modelValue"]),
|
|
56
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
57
|
+
const props = __props;
|
|
58
|
+
const emits = __emit;
|
|
59
|
+
const { t } = useLocale.useLocale();
|
|
60
|
+
const modelValue = vue.useModel(__props, "modelValue");
|
|
61
|
+
const cropperRef = vue.useTemplateRef("cropperRef");
|
|
62
|
+
const uploadRef = vue.useTemplateRef("uploadRef");
|
|
63
|
+
const visible = vue.ref(false);
|
|
64
|
+
const imgSrc = vue.ref();
|
|
65
|
+
const fileInfo = vue.ref({
|
|
66
|
+
name: "",
|
|
67
|
+
src: ""
|
|
68
|
+
});
|
|
69
|
+
const imageSrc = vue.computed(() => imgSrc.value || props.defaultImg);
|
|
70
|
+
const options = vue.computed(() => ({
|
|
71
|
+
info: props.info,
|
|
72
|
+
// 裁剪框的大小信息
|
|
73
|
+
outputSize: props.outputSize,
|
|
74
|
+
// 裁剪生成图片的质量
|
|
75
|
+
outputType: props.outputType,
|
|
76
|
+
// 裁剪生成图片的格式
|
|
77
|
+
canScale: props.canScale,
|
|
78
|
+
// 图片是否允许滚轮缩放
|
|
79
|
+
autoCrop: props.autoCrop,
|
|
80
|
+
// 是否默认生成截图框
|
|
81
|
+
autoCropWidth: props.autoCropWidth,
|
|
82
|
+
// 默认生成截图框宽度
|
|
83
|
+
autoCropHeight: props.autoCropHeight,
|
|
84
|
+
// 默认生成截图框高度
|
|
85
|
+
fixedBox: props.fixedBox,
|
|
86
|
+
// 固定截图框大小 不允许改变
|
|
87
|
+
fixed: props.fixed,
|
|
88
|
+
// 是否开启截图框宽高固定比例
|
|
89
|
+
fixedNumber: props.fixedNumber,
|
|
90
|
+
// 截图框的宽高比例
|
|
91
|
+
full: props.full,
|
|
92
|
+
// 是否输出原图比例的截图
|
|
93
|
+
canMoveBox: props.canMoveBox,
|
|
94
|
+
// 截图框能否拖动
|
|
95
|
+
original: props.original,
|
|
96
|
+
// 上传图片按照原始比例渲染
|
|
97
|
+
centerBox: props.centerBox,
|
|
98
|
+
// 截图框是否被限制在图片里面
|
|
99
|
+
infoTrue: props.infoTrue
|
|
100
|
+
// true 为展示真实输出图片宽高 false 展示看到的截图框宽高
|
|
101
|
+
}));
|
|
102
|
+
function openFilePicker(param, name = "img.png") {
|
|
103
|
+
if (typeof param === "string") {
|
|
104
|
+
openCutter(param, name);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (is.isFile(param)) {
|
|
108
|
+
beforeAvatarUpload(file);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
uploadRef.value.click();
|
|
112
|
+
}
|
|
113
|
+
async function beforeAvatarUpload(file2) {
|
|
114
|
+
const limit = file2.size < props.maxSize;
|
|
115
|
+
if (!limit) {
|
|
116
|
+
elementPlus.ElMessage.error(
|
|
117
|
+
t("cutter.uploadPictureLimit", [file$1.sizeToTextHandler(props.maxSize)])
|
|
118
|
+
);
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
const result = await file$1.blobToDataURL(file2);
|
|
122
|
+
openCutter(result, file2.name);
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
function openCutter(src, name) {
|
|
126
|
+
visible.value = true;
|
|
127
|
+
fileInfo.value.src = src;
|
|
128
|
+
fileInfo.value.name = name;
|
|
129
|
+
}
|
|
130
|
+
function onClearHandler() {
|
|
131
|
+
imgSrc.value = "";
|
|
132
|
+
modelValue.value = null;
|
|
133
|
+
fileInfo.value = {
|
|
134
|
+
name: "",
|
|
135
|
+
src: ""
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
async function onSubmitHandler() {
|
|
139
|
+
return new Promise((resolve, reject) => {
|
|
140
|
+
cropperRef.value.getCropBlob(async (data) => {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
data.name = fileInfo.value.name;
|
|
143
|
+
const res = await file$1.fileUpload(data).catch((res2) => {
|
|
144
|
+
elementPlus.ElMessage.error(res2.msg || res2);
|
|
145
|
+
reject();
|
|
146
|
+
});
|
|
147
|
+
if (res.code === 200) {
|
|
148
|
+
imgSrc.value = await file$1.blobToDataURL(data);
|
|
149
|
+
modelValue.value = ((_a = res.data) == null ? void 0 : _a.key) || ((_b = res.data) == null ? void 0 : _b.url) || res.data;
|
|
150
|
+
emits("confirm", res);
|
|
151
|
+
resolve();
|
|
152
|
+
} else {
|
|
153
|
+
elementPlus.ElMessage.error(res.msg || res);
|
|
154
|
+
reject();
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
__expose({
|
|
160
|
+
open: openFilePicker,
|
|
161
|
+
clear: onClearHandler
|
|
162
|
+
});
|
|
163
|
+
return (_ctx, _cache) => {
|
|
164
|
+
const _component_User = vue.resolveComponent("User");
|
|
165
|
+
return vue.openBlock(), vue.createElementBlock("div", { class: "inline-block" }, [
|
|
166
|
+
vue.withDirectives(vue.createVNode(
|
|
167
|
+
vue.unref(elementPlus.ElUpload),
|
|
168
|
+
{
|
|
169
|
+
accept: ".png,.jpg,.gif,.jpeg",
|
|
170
|
+
"before-upload": beforeAvatarUpload,
|
|
171
|
+
action: "",
|
|
172
|
+
class: "upload_box",
|
|
173
|
+
"show-file-list": false
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
default: vue.withCtx(() => [
|
|
177
|
+
vue.createElementVNode(
|
|
178
|
+
"div",
|
|
179
|
+
{
|
|
180
|
+
ref_key: "uploadRef",
|
|
181
|
+
ref: uploadRef,
|
|
182
|
+
class: "app-cutter-upload-box"
|
|
183
|
+
},
|
|
184
|
+
[
|
|
185
|
+
vue.renderSlot(_ctx.$slots, "default", { src: imgSrc.value }, () => [
|
|
186
|
+
vue.createElementVNode(
|
|
187
|
+
"div",
|
|
188
|
+
{
|
|
189
|
+
class: "app-cutter-upload-card",
|
|
190
|
+
style: vue.normalizeStyle({
|
|
191
|
+
width: `${__props.autoCropWidth}px`,
|
|
192
|
+
height: `${__props.autoCropHeight}px`
|
|
193
|
+
})
|
|
194
|
+
},
|
|
195
|
+
[
|
|
196
|
+
modelValue.value && imageSrc.value ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElImage), {
|
|
197
|
+
key: 0,
|
|
198
|
+
src: imageSrc.value,
|
|
199
|
+
style: vue.normalizeStyle({
|
|
200
|
+
width: `${__props.autoCropWidth}px`,
|
|
201
|
+
height: `${__props.autoCropHeight}px`
|
|
202
|
+
})
|
|
203
|
+
}, null, 8, ["src", "style"])) : (vue.openBlock(), vue.createElementBlock(
|
|
204
|
+
vue.Fragment,
|
|
205
|
+
{ key: 1 },
|
|
206
|
+
[
|
|
207
|
+
vue.createCommentVNode(' <AppIcon\n v-else\n svg-name="emptyHead"\n style="width: 70px; height: 70px"\n /> '),
|
|
208
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
209
|
+
color: "rgb(var(--hy-auxiliary))",
|
|
210
|
+
size: "64"
|
|
211
|
+
}, {
|
|
212
|
+
default: vue.withCtx(() => [
|
|
213
|
+
vue.createVNode(_component_User)
|
|
214
|
+
]),
|
|
215
|
+
_: 1
|
|
216
|
+
/* STABLE */
|
|
217
|
+
})
|
|
218
|
+
],
|
|
219
|
+
2112
|
|
220
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
221
|
+
))
|
|
222
|
+
],
|
|
223
|
+
4
|
|
224
|
+
/* STYLE */
|
|
225
|
+
)
|
|
226
|
+
]),
|
|
227
|
+
__props.uploadText && __props.showText ? (vue.openBlock(), vue.createElementBlock(
|
|
228
|
+
"div",
|
|
229
|
+
{
|
|
230
|
+
key: 0,
|
|
231
|
+
class: "app-cutter-tip"
|
|
232
|
+
},
|
|
233
|
+
vue.toDisplayString(__props.uploadText),
|
|
234
|
+
1
|
|
235
|
+
/* TEXT */
|
|
236
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
237
|
+
__props.showDelete ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
238
|
+
key: 1,
|
|
239
|
+
class: "app-cutter-delete",
|
|
240
|
+
onClick: vue.withModifiers(($event) => onClearHandler(), ["stop"])
|
|
241
|
+
}, [
|
|
242
|
+
vue.createCommentVNode(' <AppIcon svg-name="delete" /> '),
|
|
243
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), { color: "rgb(var(--hy-danger-2))" }, {
|
|
244
|
+
default: vue.withCtx(() => [
|
|
245
|
+
vue.createVNode(vue.unref(iconsVue.Delete))
|
|
246
|
+
]),
|
|
247
|
+
_: 1
|
|
248
|
+
/* STABLE */
|
|
249
|
+
})
|
|
250
|
+
], 8, ["onClick"])), [
|
|
251
|
+
[vue.vShow, modelValue.value]
|
|
252
|
+
]) : vue.createCommentVNode("v-if", true)
|
|
253
|
+
],
|
|
254
|
+
512
|
|
255
|
+
/* NEED_PATCH */
|
|
256
|
+
)
|
|
257
|
+
]),
|
|
258
|
+
_: 3
|
|
259
|
+
/* FORWARDED */
|
|
260
|
+
},
|
|
261
|
+
512
|
|
262
|
+
/* NEED_PATCH */
|
|
263
|
+
), [
|
|
264
|
+
[vue.vShow, __props.showUpload]
|
|
265
|
+
]),
|
|
266
|
+
vue.createVNode(vue.unref(index.AppDialog), {
|
|
267
|
+
modelValue: visible.value,
|
|
268
|
+
"onUpdate:modelValue": ($event) => visible.value = $event,
|
|
269
|
+
title: vue.unref(t)("cutter.imageSegmentation"),
|
|
270
|
+
onSubmit: onSubmitHandler
|
|
271
|
+
}, {
|
|
272
|
+
default: vue.withCtx(() => [
|
|
273
|
+
vue.createElementVNode("div", { class: "h-[500px]" }, [
|
|
274
|
+
vue.createVNode(vue.unref(vueCropper.VueCropper), vue.mergeProps({
|
|
275
|
+
ref_key: "cropperRef",
|
|
276
|
+
ref: cropperRef,
|
|
277
|
+
img: fileInfo.value.src
|
|
278
|
+
}, options.value), null, 16, ["img"])
|
|
279
|
+
])
|
|
280
|
+
]),
|
|
281
|
+
_: 1
|
|
282
|
+
/* STABLE */
|
|
283
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "title"])
|
|
284
|
+
]);
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var appCutter = require('./appCutter.vue.js');
|
|
6
|
+
var handler = require('../../utils/handler.js');
|
|
7
|
+
|
|
8
|
+
const AppCutter = handler.withInstall(appCutter.default);
|
|
9
|
+
|
|
10
|
+
exports.AppCutter = AppCutter;
|
|
11
|
+
exports.default = AppCutter;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
.app-cutter-upload-box {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
position: relative;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
border-radius: 4px;
|
|
6
|
+
.app-cutter-delete {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 23px;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
position: absolute;
|
|
13
|
+
bottom: -23px;
|
|
14
|
+
z-index: 3;
|
|
15
|
+
transition: all 0.3s;
|
|
16
|
+
background: rgba(0, 0, 0, 0.6);
|
|
17
|
+
}
|
|
18
|
+
.app-cutter-tip {
|
|
19
|
+
width: 100%;
|
|
20
|
+
position: absolute;
|
|
21
|
+
left: 50%;
|
|
22
|
+
top: 50%;
|
|
23
|
+
transform: translate(-50%, -50%);
|
|
24
|
+
z-index: 3;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
color: rgb(var(--hy-theme));
|
|
27
|
+
text-align: center;
|
|
28
|
+
user-select: none;
|
|
29
|
+
opacity: 0;
|
|
30
|
+
transition: all 0.3s;
|
|
31
|
+
}
|
|
32
|
+
&:hover {
|
|
33
|
+
.app-cutter-delete {
|
|
34
|
+
bottom: 0;
|
|
35
|
+
}
|
|
36
|
+
.app-cutter-tip {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.app-cutter-upload-card {
|
|
41
|
+
width: 70px;
|
|
42
|
+
height: 70px;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
border: 1px solid rgb(var(--hy-border));
|
|
47
|
+
border-radius: 4px;
|
|
48
|
+
background-color: rgb(var(--hy-background-2));
|
|
49
|
+
position: relative;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var elementPlus = require('element-plus');
|
|
7
|
+
var iconsVue = require('@element-plus/icons-vue');
|
|
8
|
+
var useLocale = require('../../hooks/useLocale.js');
|
|
9
|
+
var index = require('../appButton/index.js');
|
|
10
|
+
|
|
11
|
+
import "./style/appDialog.scss";
|
|
12
|
+
|
|
13
|
+
const __default__ = vue.defineComponent({
|
|
14
|
+
name: "AppDialog"
|
|
15
|
+
});
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
17
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
18
|
+
title: { type: String, default: "\u6807\u9898" },
|
|
19
|
+
titleAlign: { type: String, default: "default" },
|
|
20
|
+
// default、center
|
|
21
|
+
showClose: { type: Boolean, default: true },
|
|
22
|
+
showCancel: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
cancelType: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "default"
|
|
29
|
+
},
|
|
30
|
+
cancelText: {
|
|
31
|
+
type: String
|
|
32
|
+
},
|
|
33
|
+
showSubmit: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
},
|
|
37
|
+
submitType: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "primary"
|
|
40
|
+
},
|
|
41
|
+
submitText: {
|
|
42
|
+
type: String
|
|
43
|
+
},
|
|
44
|
+
onClose: Function,
|
|
45
|
+
onCancel: Function,
|
|
46
|
+
onSubmit: Function
|
|
47
|
+
}, {
|
|
48
|
+
"modelValue": { type: Boolean, default: false },
|
|
49
|
+
"modelModifiers": {}
|
|
50
|
+
}),
|
|
51
|
+
emits: /* @__PURE__ */ vue.mergeModels(["hide"], ["update:modelValue"]),
|
|
52
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
53
|
+
const props = __props;
|
|
54
|
+
const emits = __emit;
|
|
55
|
+
const { t } = useLocale.useLocale();
|
|
56
|
+
const visible = vue.useModel(__props, "modelValue");
|
|
57
|
+
const loading = vue.ref(false);
|
|
58
|
+
async function onSubmitHandler() {
|
|
59
|
+
if (loading.value) return;
|
|
60
|
+
loading.value = true;
|
|
61
|
+
if (props.onSubmit) {
|
|
62
|
+
try {
|
|
63
|
+
await props.onSubmit();
|
|
64
|
+
} catch (err) {
|
|
65
|
+
console.error(err);
|
|
66
|
+
loading.value = false;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
visible.value = false;
|
|
71
|
+
loading.value = false;
|
|
72
|
+
emits("hide");
|
|
73
|
+
}
|
|
74
|
+
async function onCancelHandler() {
|
|
75
|
+
if (loading.value) return;
|
|
76
|
+
loading.value = true;
|
|
77
|
+
if (props.onCancel) {
|
|
78
|
+
try {
|
|
79
|
+
await props.onCancel();
|
|
80
|
+
} catch (err) {
|
|
81
|
+
console.error(err);
|
|
82
|
+
loading.value = false;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
visible.value = false;
|
|
87
|
+
loading.value = false;
|
|
88
|
+
emits("hide");
|
|
89
|
+
}
|
|
90
|
+
async function onCloseHandler() {
|
|
91
|
+
if (loading.value) return;
|
|
92
|
+
loading.value = true;
|
|
93
|
+
if (props.onClose) {
|
|
94
|
+
try {
|
|
95
|
+
await props.onClose();
|
|
96
|
+
} catch (err) {
|
|
97
|
+
console.error(err);
|
|
98
|
+
loading.value = false;
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
visible.value = false;
|
|
103
|
+
loading.value = false;
|
|
104
|
+
emits("hide");
|
|
105
|
+
}
|
|
106
|
+
__expose({});
|
|
107
|
+
return (_ctx, _cache) => {
|
|
108
|
+
return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDialog), vue.mergeProps({
|
|
109
|
+
modelValue: visible.value,
|
|
110
|
+
"onUpdate:modelValue": ($event) => visible.value = $event,
|
|
111
|
+
"append-to-body": true,
|
|
112
|
+
"close-on-click-modal": false,
|
|
113
|
+
"close-on-press-escape": false,
|
|
114
|
+
"show-close": false,
|
|
115
|
+
width: "37.5rem"
|
|
116
|
+
}, _ctx.$attrs), {
|
|
117
|
+
header: vue.withCtx(() => [
|
|
118
|
+
vue.createElementVNode(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
class: vue.normalizeClass(["box-border w-full border-0 border-b border-solid border-background-3 px-4 py-[10px] text-main text-sm font-bold flex justify-between items-center relative", { "!justify-center": __props.titleAlign === "center" }])
|
|
122
|
+
},
|
|
123
|
+
[
|
|
124
|
+
vue.createElementVNode(
|
|
125
|
+
"span",
|
|
126
|
+
null,
|
|
127
|
+
vue.toDisplayString(__props.title),
|
|
128
|
+
1
|
|
129
|
+
/* TEXT */
|
|
130
|
+
),
|
|
131
|
+
__props.showClose ? (vue.openBlock(), vue.createElementBlock(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
key: 0,
|
|
135
|
+
class: vue.normalizeClass(["text-lg absolute right-4 cursor-pointer text-danger-2", { "cursor-not-allowed": loading.value }]),
|
|
136
|
+
onClick: onCloseHandler
|
|
137
|
+
},
|
|
138
|
+
[
|
|
139
|
+
vue.createCommentVNode(' <AppIcon svg-name="close" class="!w-[20px] !h-[20px]" /> '),
|
|
140
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
141
|
+
size: "18",
|
|
142
|
+
color: "rgb(var(--hy-danger-2))"
|
|
143
|
+
}, {
|
|
144
|
+
default: vue.withCtx(() => [
|
|
145
|
+
vue.createVNode(vue.unref(iconsVue.CircleClose))
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
/* STABLE */
|
|
149
|
+
})
|
|
150
|
+
],
|
|
151
|
+
2
|
|
152
|
+
/* CLASS */
|
|
153
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
154
|
+
],
|
|
155
|
+
2
|
|
156
|
+
/* CLASS */
|
|
157
|
+
)
|
|
158
|
+
]),
|
|
159
|
+
default: vue.withCtx(() => [
|
|
160
|
+
vue.createElementVNode("div", { class: "text-main" }, [
|
|
161
|
+
vue.createElementVNode("div", { class: "p-6 box-border" }, [
|
|
162
|
+
vue.renderSlot(_ctx.$slots, "default"),
|
|
163
|
+
vue.createElementVNode("div", { class: "flex items-center justify-between pt-5" }, [
|
|
164
|
+
__props.showCancel ? (vue.openBlock(), vue.createBlock(vue.unref(index.AppButton), {
|
|
165
|
+
key: 0,
|
|
166
|
+
type: __props.cancelType,
|
|
167
|
+
disabled: loading.value,
|
|
168
|
+
class: "!min-w-[120px]",
|
|
169
|
+
onClick: onCancelHandler
|
|
170
|
+
}, {
|
|
171
|
+
default: vue.withCtx(() => [
|
|
172
|
+
vue.createTextVNode(
|
|
173
|
+
vue.toDisplayString(vue.unref(t)("dialog.cancel")),
|
|
174
|
+
1
|
|
175
|
+
/* TEXT */
|
|
176
|
+
)
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
/* STABLE */
|
|
180
|
+
}, 8, ["type", "disabled"])) : vue.createCommentVNode("v-if", true),
|
|
181
|
+
__props.showSubmit ? (vue.openBlock(), vue.createBlock(vue.unref(index.AppButton), {
|
|
182
|
+
key: 1,
|
|
183
|
+
type: __props.submitType,
|
|
184
|
+
disabled: loading.value,
|
|
185
|
+
class: "!min-w-[120px]",
|
|
186
|
+
onClick: onSubmitHandler
|
|
187
|
+
}, {
|
|
188
|
+
default: vue.withCtx(() => [
|
|
189
|
+
vue.createTextVNode(
|
|
190
|
+
vue.toDisplayString(vue.unref(t)("dialog.confirm")),
|
|
191
|
+
1
|
|
192
|
+
/* TEXT */
|
|
193
|
+
)
|
|
194
|
+
]),
|
|
195
|
+
_: 1
|
|
196
|
+
/* STABLE */
|
|
197
|
+
}, 8, ["type", "disabled"])) : vue.createCommentVNode("v-if", true)
|
|
198
|
+
])
|
|
199
|
+
])
|
|
200
|
+
])
|
|
201
|
+
]),
|
|
202
|
+
_: 3
|
|
203
|
+
/* FORWARDED */
|
|
204
|
+
}, 16, ["modelValue", "onUpdate:modelValue"]);
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var appDialog = require('./appDialog.vue.js');
|
|
6
|
+
var handler = require('../../utils/handler.js');
|
|
7
|
+
|
|
8
|
+
const AppDialog = handler.withInstall(appDialog.default);
|
|
9
|
+
|
|
10
|
+
exports.AppDialog = AppDialog;
|
|
11
|
+
exports.default = AppDialog;
|
|
File without changes
|
|
@@ -94,10 +94,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
94
94
|
shrinkDestroy();
|
|
95
95
|
});
|
|
96
96
|
function onChangeHandler(value, column) {
|
|
97
|
-
var _a;
|
|
98
|
-
if ((_a = column.attrs) == null ? void 0 : _a.onChange) {
|
|
99
|
-
column.attrs.onChange(value);
|
|
100
|
-
}
|
|
101
97
|
emits("search");
|
|
102
98
|
}
|
|
103
99
|
function onKeydownEnterHander(e) {
|
|
@@ -285,7 +281,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
285
281
|
}, { ref_for: true }, column.attrs, {
|
|
286
282
|
disabled: vue.unref(index.isDisabled)(props, column),
|
|
287
283
|
onKeydown: vue.withKeys(($event) => onKeydownEnterHander(), ["enter"]),
|
|
288
|
-
onChange: ($event) => onChangeHandler(
|
|
284
|
+
onChange: ($event) => onChangeHandler()
|
|
289
285
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "onKeydown", "onChange"])
|
|
290
286
|
],
|
|
291
287
|
2112
|
|
@@ -300,7 +296,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
300
296
|
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event
|
|
301
297
|
}, { ref_for: true }, column.attrs, {
|
|
302
298
|
disabled: vue.unref(index.isDisabled)(props, column),
|
|
303
|
-
onChange: ($event) => onChangeHandler(
|
|
299
|
+
onChange: ($event) => onChangeHandler()
|
|
304
300
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "onChange"])
|
|
305
301
|
],
|
|
306
302
|
2112
|
|
@@ -326,7 +322,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
326
322
|
}, { ref_for: true }, column.attrs, {
|
|
327
323
|
disabled: vue.unref(index.isDisabled)(props, column),
|
|
328
324
|
timeRangeFill: column.timeRangeFill,
|
|
329
|
-
onChange: ($event) => onChangeHandler(
|
|
325
|
+
onChange: ($event) => onChangeHandler()
|
|
330
326
|
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled", "timeRangeFill", "onChange"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$1.AppDatePicker), vue.mergeProps({
|
|
331
327
|
key: 1,
|
|
332
328
|
modelValue: __props.model[column.field],
|
|
@@ -336,7 +332,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
336
332
|
}, { ref_for: true }, column.attrs, {
|
|
337
333
|
disabled: vue.unref(index.isDisabled)(props, column),
|
|
338
334
|
timeRangeFill: column.timeRangeFill,
|
|
339
|
-
onChange: ($event) => onChangeHandler(
|
|
335
|
+
onChange: ($event) => onChangeHandler()
|
|
340
336
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "timeRangeFill", "onChange"]))
|
|
341
337
|
],
|
|
342
338
|
64
|