@minilo/ui 0.0.2 → 0.0.4
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/minilo/dist/index.css +1 -1
- package/minilo/dist/index.full.js +1473 -111
- package/minilo/dist/index.full.min.js +1 -1
- package/minilo/dist/index.full.min.js.map +1 -1
- package/minilo/dist/index.full.min.mjs +1 -1
- package/minilo/dist/index.full.min.mjs.map +1 -1
- package/minilo/dist/index.full.mjs +1468 -113
- package/minilo/es/components/button/index.d.ts +4 -4
- package/minilo/es/components/button/index.vue.d.ts +2 -2
- package/minilo/es/components/chart/index.d.ts +4 -4
- package/minilo/es/components/chart/index.vue.d.ts +2 -2
- package/minilo/es/components/chart/index.vue2.mjs +2 -2
- package/minilo/es/components/detail/index.vue2.mjs +1 -1
- package/minilo/es/components/image-upload-pro/index.d.ts +645 -0
- package/minilo/es/components/image-upload-pro/index.mjs +7 -0
- package/minilo/es/components/image-upload-pro/index.vue.d.ts +647 -0
- package/minilo/es/components/image-upload-pro/index.vue.mjs +5 -0
- package/minilo/es/components/image-upload-pro/index.vue2.mjs +657 -0
- package/minilo/es/components/image-upload-pro/type.d.ts +147 -0
- package/minilo/es/components/image-upload-pro/type.mjs +81 -0
- package/minilo/es/components/index.d.ts +4 -0
- package/minilo/es/components/index.mjs +7 -0
- package/minilo/es/components/number-range-input/index.d.ts +3 -3
- package/minilo/es/components/number-range-input/index.vue.d.ts +1 -1
- package/minilo/es/components/search/index.d.ts +26 -26
- package/minilo/es/components/search/index.vue.d.ts +23 -23
- package/minilo/es/components/search/props.d.ts +2 -2
- package/minilo/es/components/search-table/index.d.ts +18 -18
- package/minilo/es/components/search-table/index.vue.d.ts +9 -9
- package/minilo/es/components/search-table/index.vue2.mjs +2 -2
- package/minilo/es/components/search-table/props.d.ts +3 -3
- package/minilo/es/components/tree-select/index.d.ts +32 -0
- package/minilo/es/components/tree-select/index.mjs +6 -0
- package/minilo/es/components/tree-select/index.vue.d.ts +20 -0
- package/minilo/es/components/tree-select/index.vue.mjs +5 -0
- package/minilo/es/components/tree-select/index.vue2.mjs +226 -0
- package/minilo/es/components/tree-select/type.d.ts +34 -0
- package/minilo/es/components/tree-select-dialog/index.d.ts +60 -0
- package/minilo/es/components/tree-select-dialog/index.mjs +7 -0
- package/minilo/es/components/tree-select-dialog/index.vue.d.ts +23 -0
- package/minilo/es/components/tree-select-dialog/index.vue.mjs +5 -0
- package/minilo/es/components/tree-select-dialog/index.vue2.mjs +135 -0
- package/minilo/es/components/tree-select-dialog/type.d.ts +9 -0
- package/minilo/es/components/tree-select-dialog/type.mjs +24 -0
- package/minilo/es/components/tree-select-drawer/index.d.ts +64 -0
- package/minilo/es/components/tree-select-drawer/index.mjs +7 -0
- package/minilo/es/components/tree-select-drawer/index.vue.d.ts +23 -0
- package/minilo/es/components/tree-select-drawer/index.vue.mjs +5 -0
- package/minilo/es/components/tree-select-drawer/index.vue2.mjs +140 -0
- package/minilo/es/components/tree-select-drawer/type.d.ts +10 -0
- package/minilo/es/components/tree-select-drawer/type.mjs +20 -0
- package/minilo/es/components/virtual-list/index.d.ts +4 -4
- package/minilo/es/components/virtual-list/index.vue.d.ts +2 -2
- package/minilo/es/index.d.ts +892 -61
- package/minilo/es/node_modules/.pnpm/{@element-plus_icons-vue@2.3.1_vue@3.5.17_typescript@5.8.3_ → @element-plus_icons-vue@2.3.1_vue@3.5.26_typescript@5.9.3_}/node_modules/@element-plus/icons-vue/dist/index.mjs +17 -1
- package/minilo/es/node_modules/.pnpm/{@vueuse_core@13.6.0_vue@3.5.17_typescript@5.9.3_ → @vueuse_core@13.9.0_vue@3.5.26_typescript@5.9.3_}/node_modules/@vueuse/core/index.mjs +2 -2
- package/minilo/es/resolver/index.d.ts +2 -2
- package/minilo/es/resolver/index.mjs +4 -1
- package/minilo/lib/components/button/index.d.ts +4 -4
- package/minilo/lib/components/button/index.vue.d.ts +2 -2
- package/minilo/lib/components/chart/index.d.ts +4 -4
- package/minilo/lib/components/chart/index.vue.d.ts +2 -2
- package/minilo/lib/components/chart/index.vue2.js +2 -2
- package/minilo/lib/components/detail/index.vue2.js +1 -1
- package/minilo/lib/components/image-upload-pro/index.d.ts +645 -0
- package/minilo/lib/components/image-upload-pro/index.js +13 -0
- package/minilo/lib/components/image-upload-pro/index.vue.d.ts +647 -0
- package/minilo/lib/components/image-upload-pro/index.vue.js +9 -0
- package/minilo/lib/components/image-upload-pro/index.vue2.js +661 -0
- package/minilo/lib/components/image-upload-pro/type.d.ts +147 -0
- package/minilo/lib/components/image-upload-pro/type.js +83 -0
- package/minilo/lib/components/index.d.ts +4 -0
- package/minilo/lib/components/index.js +14 -0
- package/minilo/lib/components/number-range-input/index.d.ts +3 -3
- package/minilo/lib/components/number-range-input/index.vue.d.ts +1 -1
- package/minilo/lib/components/search/index.d.ts +26 -26
- package/minilo/lib/components/search/index.vue.d.ts +23 -23
- package/minilo/lib/components/search/props.d.ts +2 -2
- package/minilo/lib/components/search-table/index.d.ts +18 -18
- package/minilo/lib/components/search-table/index.vue.d.ts +9 -9
- package/minilo/lib/components/search-table/index.vue2.js +2 -2
- package/minilo/lib/components/search-table/props.d.ts +3 -3
- package/minilo/lib/components/tree-select/index.d.ts +32 -0
- package/minilo/lib/components/tree-select/index.js +11 -0
- package/minilo/lib/components/tree-select/index.vue.d.ts +20 -0
- package/minilo/lib/components/tree-select/index.vue.js +9 -0
- package/minilo/lib/components/tree-select/index.vue2.js +230 -0
- package/minilo/lib/components/tree-select/type.d.ts +34 -0
- package/minilo/lib/components/tree-select-dialog/index.d.ts +60 -0
- package/minilo/lib/components/tree-select-dialog/index.js +13 -0
- package/minilo/lib/components/tree-select-dialog/index.vue.d.ts +23 -0
- package/minilo/lib/components/tree-select-dialog/index.vue.js +9 -0
- package/minilo/lib/components/tree-select-dialog/index.vue2.js +139 -0
- package/minilo/lib/components/tree-select-dialog/type.d.ts +9 -0
- package/minilo/lib/components/tree-select-dialog/type.js +26 -0
- package/minilo/lib/components/tree-select-drawer/index.d.ts +64 -0
- package/minilo/lib/components/tree-select-drawer/index.js +13 -0
- package/minilo/lib/components/tree-select-drawer/index.vue.d.ts +23 -0
- package/minilo/lib/components/tree-select-drawer/index.vue.js +9 -0
- package/minilo/lib/components/tree-select-drawer/index.vue2.js +144 -0
- package/minilo/lib/components/tree-select-drawer/type.d.ts +10 -0
- package/minilo/lib/components/tree-select-drawer/type.js +22 -0
- package/minilo/lib/components/virtual-list/index.d.ts +4 -4
- package/minilo/lib/components/virtual-list/index.vue.d.ts +2 -2
- package/minilo/lib/index.d.ts +892 -61
- package/minilo/lib/node_modules/.pnpm/{@element-plus_icons-vue@2.3.1_vue@3.5.17_typescript@5.8.3_ → @element-plus_icons-vue@2.3.1_vue@3.5.26_typescript@5.9.3_}/node_modules/@element-plus/icons-vue/dist/index.js +17 -0
- package/minilo/lib/node_modules/.pnpm/{@vueuse_core@13.6.0_vue@3.5.17_typescript@5.9.3_ → @vueuse_core@13.9.0_vue@3.5.26_typescript@5.9.3_}/node_modules/@vueuse/core/index.js +1 -1
- package/minilo/lib/resolver/index.d.ts +2 -2
- package/minilo/lib/resolver/index.js +4 -1
- package/minilo/theme-chalk/index.css +1 -1
- package/minilo/theme-chalk/ml-image-upload-pro.css +1 -0
- package/minilo/theme-chalk/ml-tree-select-dialog.css +0 -0
- package/minilo/theme-chalk/ml-tree-select-drawer.css +0 -0
- package/minilo/theme-chalk/ml-tree-select.css +1 -0
- package/minilo/theme-chalk/src/image-upload-pro.scss +70 -0
- package/minilo/theme-chalk/src/index.scss +2 -0
- package/minilo/theme-chalk/src/tree-select-dialog.scss +0 -0
- package/minilo/theme-chalk/src/tree-select-drawer.scss +0 -0
- package/minilo/theme-chalk/src/tree-select.scss +47 -0
- package/package.json +18 -5
- package/minilo/es/components/button/type.mjs +0 -1
- package/minilo/es/components/chart/type.mjs +0 -1
- package/minilo/es/components/detail/type.mjs +0 -1
- package/minilo/es/components/number-range-input/props.mjs +0 -1
- package/minilo/es/components/virtual-list/type.mjs +0 -1
- package/minilo/lib/components/button/type.js +0 -2
- package/minilo/lib/components/chart/type.js +0 -2
- package/minilo/lib/components/detail/type.js +0 -2
- package/minilo/lib/components/number-range-input/props.js +0 -2
- package/minilo/lib/components/virtual-list/type.js +0 -2
- /package/minilo/es/{packages → node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo}/utils/dist/func/common.mjs +0 -0
- /package/minilo/es/{packages → node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo}/utils/dist/request/index.mjs +0 -0
- /package/minilo/es/node_modules/.pnpm/{@vueuse_shared@13.6.0_vue@3.5.17_typescript@5.9.3_ → @vueuse_shared@13.9.0_vue@3.5.26_typescript@5.9.3_}/node_modules/@vueuse/shared/index.mjs +0 -0
- /package/minilo/lib/{packages → node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo}/utils/dist/func/common.js +0 -0
- /package/minilo/lib/{packages → node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo}/utils/dist/request/index.js +0 -0
- /package/minilo/lib/node_modules/.pnpm/{@vueuse_shared@13.6.0_vue@3.5.17_typescript@5.9.3_ → @vueuse_shared@13.9.0_vue@3.5.26_typescript@5.9.3_}/node_modules/@vueuse/shared/index.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getCurrentScope, onScopeDispose, toValue, computed, watch, shallowRef, getCurrentInstance, onMounted, defineComponent, ref, useAttrs, nextTick, onBeforeUnmount, createElementBlock, openBlock, mergeProps, unref, withDirectives, renderSlot, createCommentVNode, createElementVNode, normalizeClass, vShow, createVNode, markRaw, onUnmounted, h, mergeModels, useModel, withCtx, createBlock, Fragment, renderList, withModifiers, createTextVNode, toDisplayString, reactive, readonly, resolveDirective, createSlots, toHandlers, resolveDynamicComponent, resolveComponent, normalizeStyle, useSlots } from 'vue';
|
|
2
|
-
import { ElEmpty, ElForm, ElRow, ElCol, ElFormItem, ElInput, ElSelect, ElOption, ElDatePicker, ElButton, ElLink, ElMessage, ElTable, ElTableColumn, ElPagination, ElDescriptions, ElDescriptionsItem, ElTooltip } from 'element-plus';
|
|
2
|
+
import { ElEmpty, ElForm, ElRow, ElCol, ElFormItem, ElInput, ElSelect, ElOption, ElDatePicker, ElButton, ElLink, ElMessage, ElTable, ElTableColumn, ElPagination, ElDescriptions, ElDescriptionsItem, ElTooltip, ElTree, ElUpload, ElImage, ElDialog, ElInputNumber, ElMessageBox } from 'element-plus';
|
|
3
3
|
import axios from 'axios';
|
|
4
4
|
|
|
5
5
|
const libraryNamePrefix = "ml";
|
|
@@ -172,8 +172,8 @@ function useResizeObserver(target, callback, options = {}) {
|
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
const _hoisted_1$
|
|
176
|
-
var _sfc_main$
|
|
175
|
+
const _hoisted_1$3 = ["id"];
|
|
176
|
+
var _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
177
177
|
...{
|
|
178
178
|
name: "MlChart"
|
|
179
179
|
},
|
|
@@ -274,7 +274,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
274
274
|
id: __props.id,
|
|
275
275
|
ref_key: "echartRef",
|
|
276
276
|
ref: echartRef
|
|
277
|
-
}, null, 10, _hoisted_1$
|
|
277
|
+
}, null, 10, _hoisted_1$3), [
|
|
278
278
|
[vShow, !formatEmpty.value]
|
|
279
279
|
]),
|
|
280
280
|
formatEmpty.value ? renderSlot(_ctx.$slots, "empty", { key: 0 }, () => [
|
|
@@ -289,7 +289,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
291
|
|
|
292
|
-
const MlChart = withInstall(_sfc_main$
|
|
292
|
+
const MlChart = withInstall(_sfc_main$c);
|
|
293
293
|
|
|
294
294
|
var SearchTypeEnum = /* @__PURE__ */ ((SearchTypeEnum2) => {
|
|
295
295
|
SearchTypeEnum2[SearchTypeEnum2["ITEM"] = 1] = "ITEM";
|
|
@@ -2160,7 +2160,7 @@ const Icon = defineComponent((props, { emit }) => {
|
|
|
2160
2160
|
emits: ['load'],
|
|
2161
2161
|
});
|
|
2162
2162
|
|
|
2163
|
-
var _sfc_main$
|
|
2163
|
+
var _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
2164
2164
|
...{ name: "MlSearch" },
|
|
2165
2165
|
__name: "index",
|
|
2166
2166
|
props: /* @__PURE__ */ mergeModels(searchProps, {
|
|
@@ -5473,10 +5473,14 @@ class TinyColor {
|
|
|
5473
5473
|
}
|
|
5474
5474
|
}
|
|
5475
5475
|
|
|
5476
|
+
// 将颜色转换为HSL格式
|
|
5476
5477
|
function convertToHsl(color) {
|
|
5478
|
+
// 使用TinyColor库将颜色转换为HSL格式
|
|
5477
5479
|
const { a, h, l, s } = new TinyColor(color).toHsl();
|
|
5480
|
+
// 将HSL格式转换为字符串
|
|
5478
5481
|
const hsl = `hsl(${Math.round(h)} ${Math.round(s * 100)}% ${Math.round(l * 100)}%)`;
|
|
5479
|
-
|
|
5482
|
+
// 如果颜色的透明度小于1,则返回带有透明度的HSL格式
|
|
5483
|
+
return a < 1 ? `${hsl} ${a}` : hsl
|
|
5480
5484
|
}
|
|
5481
5485
|
|
|
5482
5486
|
function isPlainObject(value) {
|
|
@@ -5535,34 +5539,54 @@ function createDefu(merger) {
|
|
|
5535
5539
|
}
|
|
5536
5540
|
const defu = createDefu();
|
|
5537
5541
|
|
|
5542
|
+
/**
|
|
5543
|
+
* @description 判断url是否是http或https
|
|
5544
|
+
* @author xieshuhong
|
|
5545
|
+
* @export
|
|
5546
|
+
* @param {string} url
|
|
5547
|
+
* @return {*}
|
|
5548
|
+
*/
|
|
5549
|
+
/**
|
|
5550
|
+
* @description 根据多层级键路径从对象中获取值
|
|
5551
|
+
* @author xieshuhong
|
|
5552
|
+
* @param {Object} obj - 要查询的对象
|
|
5553
|
+
* @param {string} path - 键路径,如 'a.b' 或 'a.b.c'
|
|
5554
|
+
* @param {any} [defaultValue] - 可选,路径不存在时返回的默认值
|
|
5555
|
+
* @returns {any} 路径对应的 value 或 defaultValue
|
|
5556
|
+
*/
|
|
5538
5557
|
function getNestedValue(obj, path, defaultValue) {
|
|
5539
|
-
|
|
5540
|
-
|
|
5558
|
+
// 处理边界情况:如果obj不是对象或path为空,直接返回默认值
|
|
5559
|
+
if (typeof obj !== 'object' || obj === null || !path) {
|
|
5560
|
+
return defaultValue
|
|
5541
5561
|
}
|
|
5542
|
-
|
|
5562
|
+
// 将路径按 '.' 分割成数组(支持处理空字符串和连续点的情况)
|
|
5563
|
+
const keys = path.split('.').filter((key) => key !== '');
|
|
5564
|
+
// 逐层访问对象属性
|
|
5543
5565
|
return keys.reduce((current, key) => {
|
|
5544
|
-
|
|
5545
|
-
|
|
5566
|
+
// 如果当前值不是对象,直接返回默认值(避免访问非对象的属性)
|
|
5567
|
+
if (typeof current !== 'object' || current === null) {
|
|
5568
|
+
return defaultValue
|
|
5546
5569
|
}
|
|
5547
|
-
|
|
5548
|
-
|
|
5570
|
+
// 访问下一级属性
|
|
5571
|
+
return current[key] !== undefined ? current[key] : defaultValue
|
|
5572
|
+
}, obj)
|
|
5549
5573
|
}
|
|
5550
5574
|
|
|
5551
5575
|
const config = {
|
|
5552
5576
|
theme: {
|
|
5553
|
-
colorDestructive:
|
|
5554
|
-
colorPrimary:
|
|
5555
|
-
colorSuccess:
|
|
5556
|
-
colorWarning:
|
|
5577
|
+
colorDestructive: 'hsl(348 100% 61%)',
|
|
5578
|
+
colorPrimary: 'hsl(212 100% 45%)',
|
|
5579
|
+
colorSuccess: 'hsl(144 57% 58%)',
|
|
5580
|
+
colorWarning: 'hsl(42 84% 61%)'
|
|
5557
5581
|
},
|
|
5558
5582
|
sidebar: {
|
|
5559
5583
|
collapse: false
|
|
5560
5584
|
},
|
|
5561
5585
|
app: {
|
|
5562
|
-
locale:
|
|
5563
|
-
name:
|
|
5564
|
-
logo:
|
|
5565
|
-
defaultHomePath:
|
|
5586
|
+
locale: 'zh-CN',
|
|
5587
|
+
name: 'Minilo Adminss',
|
|
5588
|
+
logo: '',
|
|
5589
|
+
defaultHomePath: '/'
|
|
5566
5590
|
},
|
|
5567
5591
|
transition: {
|
|
5568
5592
|
progress: true
|
|
@@ -5570,9 +5594,9 @@ const config = {
|
|
|
5570
5594
|
};
|
|
5571
5595
|
|
|
5572
5596
|
class StorageManager {
|
|
5573
|
-
constructor({ prefix =
|
|
5597
|
+
constructor({ prefix = '', storageType = 'localStorage' } = {}) {
|
|
5574
5598
|
this.prefix = prefix;
|
|
5575
|
-
this.storage = storageType ===
|
|
5599
|
+
this.storage = storageType === 'localStorage' ? window.localStorage : window.sessionStorage;
|
|
5576
5600
|
}
|
|
5577
5601
|
/**
|
|
5578
5602
|
* 清除所有带前缀的存储项
|
|
@@ -5594,8 +5618,8 @@ class StorageManager {
|
|
|
5594
5618
|
for (let i = 0; i < this.storage.length; i++) {
|
|
5595
5619
|
const key = this.storage.key(i);
|
|
5596
5620
|
if (key && key.startsWith(this.prefix)) {
|
|
5597
|
-
const shortKey = key.replace(this.prefix,
|
|
5598
|
-
this.getItem(shortKey);
|
|
5621
|
+
const shortKey = key.replace(this.prefix, '');
|
|
5622
|
+
this.getItem(shortKey); // 调用 getItem 方法检查并移除过期项
|
|
5599
5623
|
}
|
|
5600
5624
|
}
|
|
5601
5625
|
}
|
|
@@ -5609,19 +5633,19 @@ class StorageManager {
|
|
|
5609
5633
|
const fullKey = this.getFullKey(key);
|
|
5610
5634
|
const itemStr = this.storage.getItem(fullKey);
|
|
5611
5635
|
if (!itemStr) {
|
|
5612
|
-
return defaultValue
|
|
5636
|
+
return defaultValue
|
|
5613
5637
|
}
|
|
5614
5638
|
try {
|
|
5615
5639
|
const item = JSON.parse(itemStr);
|
|
5616
5640
|
if (item.expiry && Date.now() > item.expiry) {
|
|
5617
5641
|
this.storage.removeItem(fullKey);
|
|
5618
|
-
return defaultValue
|
|
5642
|
+
return defaultValue
|
|
5619
5643
|
}
|
|
5620
|
-
return item.value
|
|
5644
|
+
return item.value
|
|
5621
5645
|
} catch (error) {
|
|
5622
5646
|
console.error(`Error parsing item with key "${fullKey}":`, error);
|
|
5623
|
-
this.storage.removeItem(fullKey);
|
|
5624
|
-
return defaultValue
|
|
5647
|
+
this.storage.removeItem(fullKey); // 如果解析失败,删除该项
|
|
5648
|
+
return defaultValue
|
|
5625
5649
|
}
|
|
5626
5650
|
}
|
|
5627
5651
|
/**
|
|
@@ -5640,7 +5664,7 @@ class StorageManager {
|
|
|
5640
5664
|
*/
|
|
5641
5665
|
setItem(key, value, ttl) {
|
|
5642
5666
|
const fullKey = this.getFullKey(key);
|
|
5643
|
-
const expiry = ttl ? Date.now() + ttl :
|
|
5667
|
+
const expiry = ttl ? Date.now() + ttl : undefined;
|
|
5644
5668
|
const item = { expiry, value };
|
|
5645
5669
|
try {
|
|
5646
5670
|
this.storage.setItem(fullKey, JSON.stringify(item));
|
|
@@ -5654,7 +5678,7 @@ class StorageManager {
|
|
|
5654
5678
|
* @returns 带前缀的完整键
|
|
5655
5679
|
*/
|
|
5656
5680
|
getFullKey(key) {
|
|
5657
|
-
return `${this.prefix}-${key}
|
|
5681
|
+
return `${this.prefix}-${key}`
|
|
5658
5682
|
}
|
|
5659
5683
|
}
|
|
5660
5684
|
|
|
@@ -5709,29 +5733,34 @@ function getColors(color, variants = _variants) {
|
|
|
5709
5733
|
return colors;
|
|
5710
5734
|
}
|
|
5711
5735
|
|
|
5712
|
-
function executeUpdateCSSVariables(variables, id =
|
|
5713
|
-
|
|
5736
|
+
function executeUpdateCSSVariables(variables, id = '__minilo-styles__') {
|
|
5737
|
+
// 获取或创建内联样式表元素
|
|
5738
|
+
const styleElement = document.querySelector(`#${id}`) || document.createElement('style');
|
|
5714
5739
|
styleElement.id = id;
|
|
5715
|
-
|
|
5740
|
+
// 构建要更新的 CSS 变量的样式文本
|
|
5741
|
+
let cssText = ':root {';
|
|
5716
5742
|
for (const key in variables) {
|
|
5717
5743
|
if (Object.prototype.hasOwnProperty.call(variables, key)) {
|
|
5718
5744
|
cssText += `${key}: ${variables[key]};`;
|
|
5719
5745
|
}
|
|
5720
5746
|
}
|
|
5721
|
-
cssText +=
|
|
5747
|
+
cssText += '}';
|
|
5748
|
+
// 将样式文本赋值给内联样式表
|
|
5722
5749
|
styleElement.textContent = cssText;
|
|
5750
|
+
// 将内联样式表添加到文档头部
|
|
5723
5751
|
if (!document.querySelector(`#${id}`)) {
|
|
5724
5752
|
setTimeout(() => {
|
|
5725
5753
|
document.head.append(styleElement);
|
|
5726
5754
|
});
|
|
5727
5755
|
}
|
|
5728
5756
|
}
|
|
5757
|
+
// 根据某个色值生成色值阶梯对象,key=500时为其默认初始值,也就是默认参数
|
|
5729
5758
|
function generatorColorVariables(colorItems) {
|
|
5730
5759
|
const colorVariables = {};
|
|
5731
5760
|
colorItems.forEach(({ alias, color, name }) => {
|
|
5732
5761
|
if (color) {
|
|
5733
5762
|
const colorsMap = getColors(new TinyColor(color).toHexString());
|
|
5734
|
-
let mainColor = colorsMap[
|
|
5763
|
+
let mainColor = colorsMap['500'];
|
|
5735
5764
|
const colorKeys = Object.keys(colorsMap);
|
|
5736
5765
|
colorKeys.forEach((key) => {
|
|
5737
5766
|
const colorValue = colorsMap[key];
|
|
@@ -5741,7 +5770,7 @@ function generatorColorVariables(colorItems) {
|
|
|
5741
5770
|
if (alias) {
|
|
5742
5771
|
colorVariables[`--${alias}-${key}`] = hslColor;
|
|
5743
5772
|
}
|
|
5744
|
-
if (key ===
|
|
5773
|
+
if (key === '500') {
|
|
5745
5774
|
mainColor = hslColor;
|
|
5746
5775
|
}
|
|
5747
5776
|
}
|
|
@@ -5751,31 +5780,38 @@ function generatorColorVariables(colorItems) {
|
|
|
5751
5780
|
}
|
|
5752
5781
|
}
|
|
5753
5782
|
});
|
|
5754
|
-
return colorVariables
|
|
5783
|
+
return colorVariables
|
|
5755
5784
|
}
|
|
5756
5785
|
function updateCSSVariables(config) {
|
|
5757
5786
|
const theme = config?.theme ?? {};
|
|
5758
|
-
if (
|
|
5787
|
+
if (
|
|
5788
|
+
Reflect.has(theme, 'colorPrimary') ||
|
|
5789
|
+
Reflect.has(theme, 'colorDestructive') ||
|
|
5790
|
+
Reflect.has(theme, 'colorSuccess') ||
|
|
5791
|
+
Reflect.has(theme, 'colorWarning')
|
|
5792
|
+
) {
|
|
5759
5793
|
updateMainColorVariables(config);
|
|
5760
5794
|
}
|
|
5761
5795
|
}
|
|
5762
5796
|
function updateMainColorVariables(config) {
|
|
5763
5797
|
if (!config.theme) {
|
|
5764
|
-
return
|
|
5798
|
+
return
|
|
5765
5799
|
}
|
|
5766
5800
|
const { colorDestructive, colorPrimary, colorSuccess, colorWarning } = config.theme;
|
|
5767
5801
|
const colorVariables = generatorColorVariables([
|
|
5768
|
-
{ color: colorPrimary, name:
|
|
5769
|
-
{ alias:
|
|
5770
|
-
{ alias:
|
|
5771
|
-
{ alias:
|
|
5802
|
+
{ color: colorPrimary, name: 'primary' },
|
|
5803
|
+
{ alias: 'warning', color: colorWarning, name: 'yellow' },
|
|
5804
|
+
{ alias: 'success', color: colorSuccess, name: 'green' },
|
|
5805
|
+
{ alias: 'destructive', color: colorDestructive, name: 'red' }
|
|
5772
5806
|
]);
|
|
5807
|
+
// 要设置的 CSS 变量映射
|
|
5773
5808
|
const colorMappings = {
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5809
|
+
'--green-500': '--success',
|
|
5810
|
+
'--primary-500': '--primary',
|
|
5811
|
+
'--red-500': '--destructive',
|
|
5812
|
+
'--yellow-500': '--warning'
|
|
5778
5813
|
};
|
|
5814
|
+
// 统一处理颜色变量的更新
|
|
5779
5815
|
Object.entries(colorMappings).forEach(([sourceVar, targetVar]) => {
|
|
5780
5816
|
const colorValue = colorVariables[sourceVar];
|
|
5781
5817
|
if (colorValue) {
|
|
@@ -5785,7 +5821,8 @@ function updateMainColorVariables(config) {
|
|
|
5785
5821
|
executeUpdateCSSVariables(colorVariables);
|
|
5786
5822
|
}
|
|
5787
5823
|
|
|
5788
|
-
const STORAGE_KEY =
|
|
5824
|
+
const STORAGE_KEY = 'config';
|
|
5825
|
+
// 用户配置引导类
|
|
5789
5826
|
class Guider {
|
|
5790
5827
|
constructor() {
|
|
5791
5828
|
this.isInitialized = false;
|
|
@@ -5797,7 +5834,7 @@ class Guider {
|
|
|
5797
5834
|
// 初始化配置
|
|
5798
5835
|
initConfig({ config: config$1, namespace }) {
|
|
5799
5836
|
if (this.isInitialized) {
|
|
5800
|
-
return
|
|
5837
|
+
return
|
|
5801
5838
|
}
|
|
5802
5839
|
this.cache = new StorageManager({ prefix: namespace });
|
|
5803
5840
|
const mergeDefaultConfig = defu({}, config$1, config);
|
|
@@ -5818,113 +5855,144 @@ class Guider {
|
|
|
5818
5855
|
}
|
|
5819
5856
|
// 加载配置
|
|
5820
5857
|
loadConfig() {
|
|
5821
|
-
return this.cache?.getItem(STORAGE_KEY)
|
|
5858
|
+
return this.cache?.getItem(STORAGE_KEY)
|
|
5822
5859
|
}
|
|
5823
5860
|
// 获取配置
|
|
5824
5861
|
getConfig() {
|
|
5825
|
-
return readonly(this.state)
|
|
5862
|
+
return readonly(this.state)
|
|
5826
5863
|
}
|
|
5827
5864
|
}
|
|
5828
5865
|
const guider = new Guider();
|
|
5829
5866
|
guider.getConfig();
|
|
5830
5867
|
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5868
|
+
// 创建请求实例
|
|
5869
|
+
const initRequestInstance = (
|
|
5870
|
+
extendConfig = {},
|
|
5871
|
+
interceptorsRequestFn = () => {},
|
|
5872
|
+
interceptorsResponseFn = () => {}
|
|
5873
|
+
) => {
|
|
5834
5874
|
const axiosConfig = defu({}, extendConfig, {
|
|
5835
|
-
baseURL:
|
|
5836
|
-
//
|
|
5837
|
-
timeout: 1e4,
|
|
5838
|
-
// 超时时间
|
|
5875
|
+
baseURL: '/', // 从环境变量获取基础URL
|
|
5876
|
+
timeout: 10000, // 超时时间
|
|
5839
5877
|
headers: {
|
|
5840
|
-
|
|
5878
|
+
'Content-Type': 'application/json;charset=utf-8'
|
|
5841
5879
|
}
|
|
5842
5880
|
});
|
|
5843
5881
|
const instance = axios.create(axiosConfig);
|
|
5882
|
+
// 请求拦截器
|
|
5844
5883
|
instance.interceptors.request.use(
|
|
5845
5884
|
(config) => {
|
|
5846
5885
|
interceptorsRequestFn(config);
|
|
5886
|
+
// 添加请求到pending列表,处理重复请求
|
|
5847
5887
|
addPendingRequest(config);
|
|
5848
|
-
|
|
5888
|
+
// 可以在这里添加其他请求处理逻辑,如请求加载动画等
|
|
5889
|
+
return config
|
|
5849
5890
|
},
|
|
5850
5891
|
(error) => {
|
|
5851
|
-
|
|
5892
|
+
// 请求错误处理
|
|
5893
|
+
return Promise.reject(error)
|
|
5852
5894
|
}
|
|
5853
5895
|
);
|
|
5896
|
+
// 响应拦截器
|
|
5854
5897
|
instance.interceptors.response.use(
|
|
5855
5898
|
(response) => {
|
|
5856
5899
|
interceptorsResponseFn(response);
|
|
5900
|
+
// 从pending列表移除请求
|
|
5857
5901
|
removePendingRequest(response.config);
|
|
5858
5902
|
const data = response.data;
|
|
5859
5903
|
console.log(data);
|
|
5904
|
+
// 根据实际后端接口规范处理响应
|
|
5860
5905
|
if (data.code === 200) {
|
|
5861
5906
|
return Promise.resolve({
|
|
5862
5907
|
...response,
|
|
5863
5908
|
...data,
|
|
5864
5909
|
data: data.data
|
|
5865
|
-
})
|
|
5910
|
+
})
|
|
5866
5911
|
} else {
|
|
5867
|
-
|
|
5868
|
-
|
|
5912
|
+
// 非成功状态,显示错误信息
|
|
5913
|
+
ElMessage.error(data.msg || '请求失败');
|
|
5914
|
+
return Promise.reject(new Error(data.msg || '请求失败'))
|
|
5869
5915
|
}
|
|
5870
5916
|
},
|
|
5871
5917
|
(error) => {
|
|
5872
|
-
console.log(
|
|
5918
|
+
console.log('请求发生错误>>>>>>>>>>>>>>>>>>:', error);
|
|
5919
|
+
// 请求完成后从pending列表移除
|
|
5873
5920
|
if (error.config) {
|
|
5874
5921
|
removePendingRequest(error.config);
|
|
5875
5922
|
}
|
|
5923
|
+
// 处理取消请求的错误
|
|
5876
5924
|
if (axios.isCancel(error)) {
|
|
5877
|
-
console.warn(
|
|
5878
|
-
return Promise.reject(new Error(
|
|
5925
|
+
console.warn('请求已被取消:', error.message);
|
|
5926
|
+
return Promise.reject(new Error('请求已被取消'))
|
|
5879
5927
|
}
|
|
5928
|
+
// 处理网络错误
|
|
5880
5929
|
if (!window.navigator.onLine) {
|
|
5881
|
-
ElMessage.error(
|
|
5882
|
-
return Promise.reject(new Error(
|
|
5930
|
+
ElMessage.error('网络连接已断开,请检查网络');
|
|
5931
|
+
return Promise.reject(new Error('网络连接已断开'))
|
|
5883
5932
|
}
|
|
5933
|
+
// 处理HTTP错误状态码
|
|
5884
5934
|
const { response } = error;
|
|
5885
5935
|
if (response) {
|
|
5886
5936
|
switch (response.status) {
|
|
5887
5937
|
case 401:
|
|
5888
|
-
ElMessage.error(
|
|
5889
|
-
|
|
5938
|
+
ElMessage.error('身份验证失败,请重新登录');
|
|
5939
|
+
// 可以在这里添加跳转到登录页的逻辑
|
|
5940
|
+
break
|
|
5890
5941
|
case 403:
|
|
5891
|
-
ElMessage.error(
|
|
5892
|
-
break
|
|
5942
|
+
ElMessage.error('没有权限执行此操作');
|
|
5943
|
+
break
|
|
5893
5944
|
case 404:
|
|
5894
|
-
ElMessage.error(
|
|
5895
|
-
break
|
|
5945
|
+
ElMessage.error('请求的资源不存在');
|
|
5946
|
+
break
|
|
5896
5947
|
case 500:
|
|
5897
|
-
ElMessage.error(
|
|
5898
|
-
break
|
|
5948
|
+
ElMessage.error('服务器内部错误');
|
|
5949
|
+
break
|
|
5899
5950
|
default:
|
|
5900
|
-
ElMessage.error(
|
|
5951
|
+
ElMessage.error(`请求错误: ${response.status}`);
|
|
5901
5952
|
}
|
|
5902
5953
|
} else {
|
|
5903
|
-
ElMessage.error(
|
|
5954
|
+
ElMessage.error('请求失败,请稍后重试');
|
|
5904
5955
|
}
|
|
5905
|
-
return Promise.reject(error)
|
|
5956
|
+
return Promise.reject(error)
|
|
5906
5957
|
}
|
|
5907
5958
|
);
|
|
5908
|
-
return instance
|
|
5959
|
+
return instance
|
|
5909
5960
|
};
|
|
5910
|
-
|
|
5961
|
+
// 存储当前正在进行的请求
|
|
5962
|
+
const pendingRequests = new Map();
|
|
5963
|
+
/**
|
|
5964
|
+
* 生成请求唯一标识
|
|
5965
|
+
* @param {Object} config 请求配置
|
|
5966
|
+
* @returns {String} 唯一标识
|
|
5967
|
+
*/
|
|
5911
5968
|
const generateRequestKey = (config) => {
|
|
5912
5969
|
const { method, url, params, data } = config;
|
|
5913
|
-
|
|
5914
|
-
const
|
|
5915
|
-
|
|
5970
|
+
// 序列化参数,确保相同参数生成相同key
|
|
5971
|
+
const paramsStr = params ? JSON.stringify(params) : '';
|
|
5972
|
+
const dataStr = data ? JSON.stringify(data) : '';
|
|
5973
|
+
return `${method}-${url}-${paramsStr}-${dataStr}`
|
|
5916
5974
|
};
|
|
5975
|
+
/**
|
|
5976
|
+
* 添加请求到pending列表
|
|
5977
|
+
* @param {Object} config 请求配置
|
|
5978
|
+
*/
|
|
5917
5979
|
const addPendingRequest = (config) => {
|
|
5918
5980
|
const requestKey = generateRequestKey(config);
|
|
5981
|
+
// 如果存在相同请求,则取消之前的请求
|
|
5919
5982
|
if (pendingRequests.has(requestKey)) {
|
|
5920
5983
|
const cancelToken = pendingRequests.get(requestKey);
|
|
5921
|
-
cancelToken.cancel(
|
|
5984
|
+
cancelToken.cancel(`重复请求被取消: ${config.url}`);
|
|
5922
5985
|
pendingRequests.delete(requestKey);
|
|
5923
5986
|
}
|
|
5987
|
+
// 创建新的取消令牌
|
|
5924
5988
|
const source = axios.CancelToken.source();
|
|
5925
5989
|
config.cancelToken = source.token;
|
|
5926
5990
|
pendingRequests.set(requestKey, source);
|
|
5927
5991
|
};
|
|
5992
|
+
/**
|
|
5993
|
+
* 从pending列表移除请求
|
|
5994
|
+
* @param {Object} config 请求配置
|
|
5995
|
+
*/
|
|
5928
5996
|
const removePendingRequest = (config) => {
|
|
5929
5997
|
const requestKey = generateRequestKey(config);
|
|
5930
5998
|
if (pendingRequests.has(requestKey)) {
|
|
@@ -5948,7 +6016,7 @@ const Render = defineComponent({
|
|
|
5948
6016
|
}
|
|
5949
6017
|
});
|
|
5950
6018
|
|
|
5951
|
-
var _sfc_main$
|
|
6019
|
+
var _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
5952
6020
|
...{
|
|
5953
6021
|
name: "MlSearchTable",
|
|
5954
6022
|
inheritAttrs: false
|
|
@@ -6035,7 +6103,7 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
6035
6103
|
class: normalizeClass(unref(bem)("search-table"))
|
|
6036
6104
|
},
|
|
6037
6105
|
[
|
|
6038
|
-
createVNode(_sfc_main$
|
|
6106
|
+
createVNode(_sfc_main$b, mergeProps({
|
|
6039
6107
|
onSubmit: submit,
|
|
6040
6108
|
onReset: reset,
|
|
6041
6109
|
modelValue: searchModel.value,
|
|
@@ -6133,11 +6201,11 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
6133
6201
|
}
|
|
6134
6202
|
});
|
|
6135
6203
|
|
|
6136
|
-
const MlSearchTable = withInstall(_sfc_main$
|
|
6204
|
+
const MlSearchTable = withInstall(_sfc_main$a);
|
|
6137
6205
|
|
|
6138
|
-
const MlSearch = withInstall(_sfc_main$
|
|
6206
|
+
const MlSearch = withInstall(_sfc_main$b);
|
|
6139
6207
|
|
|
6140
|
-
var _sfc_main$
|
|
6208
|
+
var _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
6141
6209
|
...{
|
|
6142
6210
|
name: "RenderTooltip"
|
|
6143
6211
|
},
|
|
@@ -6157,7 +6225,7 @@ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
6157
6225
|
}
|
|
6158
6226
|
});
|
|
6159
6227
|
|
|
6160
|
-
var _sfc_main$
|
|
6228
|
+
var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
6161
6229
|
...{
|
|
6162
6230
|
name: "RenderLabel"
|
|
6163
6231
|
},
|
|
@@ -6179,6 +6247,24 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
6179
6247
|
|
|
6180
6248
|
/*! Element Plus Icons Vue v2.3.1 */
|
|
6181
6249
|
|
|
6250
|
+
var search_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
6251
|
+
name: "Search",
|
|
6252
|
+
__name: "search",
|
|
6253
|
+
setup(__props) {
|
|
6254
|
+
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
6255
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6256
|
+
viewBox: "0 0 1024 1024"
|
|
6257
|
+
}, [
|
|
6258
|
+
createElementVNode("path", {
|
|
6259
|
+
fill: "currentColor",
|
|
6260
|
+
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
|
|
6261
|
+
})
|
|
6262
|
+
]));
|
|
6263
|
+
}
|
|
6264
|
+
});
|
|
6265
|
+
|
|
6266
|
+
// src/components/search.vue
|
|
6267
|
+
var search_default = search_vue_vue_type_script_setup_true_lang_default;
|
|
6182
6268
|
var warning_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
6183
6269
|
name: "Warning",
|
|
6184
6270
|
__name: "warning",
|
|
@@ -6198,8 +6284,8 @@ var warning_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
6198
6284
|
// src/components/warning.vue
|
|
6199
6285
|
var warning_default = warning_vue_vue_type_script_setup_true_lang_default;
|
|
6200
6286
|
|
|
6201
|
-
const _hoisted_1$
|
|
6202
|
-
const _hoisted_2 = { key: 0 };
|
|
6287
|
+
const _hoisted_1$2 = { key: 0 };
|
|
6288
|
+
const _hoisted_2$1 = { key: 0 };
|
|
6203
6289
|
const _hoisted_3 = { key: 1 };
|
|
6204
6290
|
const _hoisted_4 = { key: 0 };
|
|
6205
6291
|
const _hoisted_5 = { key: 0 };
|
|
@@ -6207,7 +6293,7 @@ const _hoisted_6 = { key: 1 };
|
|
|
6207
6293
|
const _hoisted_7 = { key: 0 };
|
|
6208
6294
|
const _hoisted_8 = { key: 1 };
|
|
6209
6295
|
const _hoisted_9 = { key: 0 };
|
|
6210
|
-
var _sfc_main$
|
|
6296
|
+
var _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
6211
6297
|
...{
|
|
6212
6298
|
name: "MlDetail"
|
|
6213
6299
|
},
|
|
@@ -6241,7 +6327,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6241
6327
|
span: item.span || 1
|
|
6242
6328
|
}, { ref_for: true }, { ...item.bind, ..._ctx.$attrs }), {
|
|
6243
6329
|
label: withCtx(() => [
|
|
6244
|
-
item.labelRender ? (openBlock(), createBlock(_sfc_main$
|
|
6330
|
+
item.labelRender ? (openBlock(), createBlock(_sfc_main$8, {
|
|
6245
6331
|
key: 0,
|
|
6246
6332
|
render: item.labelRender,
|
|
6247
6333
|
item
|
|
@@ -6257,7 +6343,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6257
6343
|
1
|
|
6258
6344
|
/* TEXT */
|
|
6259
6345
|
),
|
|
6260
|
-
__props.isColon ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
6346
|
+
__props.isColon ? (openBlock(), createElementBlock("span", _hoisted_1$2, "\uFF1A")) : createCommentVNode("v-if", true)
|
|
6261
6347
|
],
|
|
6262
6348
|
4
|
|
6263
6349
|
/* STYLE */
|
|
@@ -6281,7 +6367,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6281
6367
|
createElementVNode("span", null, [
|
|
6282
6368
|
item.filters && item.filters.list ? (openBlock(), createElementBlock(
|
|
6283
6369
|
"span",
|
|
6284
|
-
_hoisted_2,
|
|
6370
|
+
_hoisted_2$1,
|
|
6285
6371
|
toDisplayString(constantEscape(
|
|
6286
6372
|
item.fieldName ? __props.dataList[item.fieldName] : void 0,
|
|
6287
6373
|
__props.listTypeInfo[item.filters.list],
|
|
@@ -6329,7 +6415,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6329
6415
|
toDisplayString(item.tooltip),
|
|
6330
6416
|
1
|
|
6331
6417
|
/* TEXT */
|
|
6332
|
-
)) : typeof item.tooltip === "function" ? (openBlock(), createBlock(_sfc_main$
|
|
6418
|
+
)) : typeof item.tooltip === "function" ? (openBlock(), createBlock(_sfc_main$9, {
|
|
6333
6419
|
key: 1,
|
|
6334
6420
|
render: item.tooltip,
|
|
6335
6421
|
item
|
|
@@ -6384,9 +6470,9 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6384
6470
|
}
|
|
6385
6471
|
});
|
|
6386
6472
|
|
|
6387
|
-
const MlDetail = withInstall(_sfc_main$
|
|
6473
|
+
const MlDetail = withInstall(_sfc_main$7);
|
|
6388
6474
|
|
|
6389
|
-
var _sfc_main$
|
|
6475
|
+
var _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
6390
6476
|
...{
|
|
6391
6477
|
name: "MlButton"
|
|
6392
6478
|
},
|
|
@@ -6448,10 +6534,10 @@ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6448
6534
|
}
|
|
6449
6535
|
});
|
|
6450
6536
|
|
|
6451
|
-
const MlButton = withInstall(_sfc_main$
|
|
6537
|
+
const MlButton = withInstall(_sfc_main$6);
|
|
6452
6538
|
|
|
6453
|
-
const _hoisted_1 = ["data-index"];
|
|
6454
|
-
var _sfc_main$
|
|
6539
|
+
const _hoisted_1$1 = ["data-index"];
|
|
6540
|
+
var _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
6455
6541
|
...{
|
|
6456
6542
|
name: "MlVirtualList"
|
|
6457
6543
|
},
|
|
@@ -6795,7 +6881,7 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
6795
6881
|
item: item.data,
|
|
6796
6882
|
index: item.index
|
|
6797
6883
|
})
|
|
6798
|
-
], 14, _hoisted_1);
|
|
6884
|
+
], 14, _hoisted_1$1);
|
|
6799
6885
|
}),
|
|
6800
6886
|
128
|
|
6801
6887
|
/* KEYED_FRAGMENT */
|
|
@@ -6867,9 +6953,9 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
6867
6953
|
}
|
|
6868
6954
|
});
|
|
6869
6955
|
|
|
6870
|
-
const MlVirtualList = withInstall(_sfc_main$
|
|
6956
|
+
const MlVirtualList = withInstall(_sfc_main$5);
|
|
6871
6957
|
|
|
6872
|
-
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6958
|
+
var _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
6873
6959
|
...{
|
|
6874
6960
|
name: "MlNumberRangeInput"
|
|
6875
6961
|
},
|
|
@@ -7014,17 +7100,1286 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
7014
7100
|
}
|
|
7015
7101
|
});
|
|
7016
7102
|
|
|
7017
|
-
const MlNumberRangeInput = withInstall(_sfc_main);
|
|
7103
|
+
const MlNumberRangeInput = withInstall(_sfc_main$4);
|
|
7104
|
+
|
|
7105
|
+
var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
7106
|
+
...{
|
|
7107
|
+
name: "MlTreeSelect"
|
|
7108
|
+
},
|
|
7109
|
+
__name: "index",
|
|
7110
|
+
props: {
|
|
7111
|
+
treeData: { type: Array, required: true },
|
|
7112
|
+
treeProps: { type: Object, required: false, default: () => ({ label: "label", children: "children" }) },
|
|
7113
|
+
multiple: { type: Boolean, required: false, default: false },
|
|
7114
|
+
defaultExpandAll: { type: Boolean, required: false, default: true },
|
|
7115
|
+
defaultSelectedKeys: { type: Array, required: false, default: () => [] },
|
|
7116
|
+
nodeKey: { type: String, required: false, default: "id" },
|
|
7117
|
+
showSearch: { type: Boolean, required: false, default: true },
|
|
7118
|
+
expandOnClickNode: { type: Boolean, required: false },
|
|
7119
|
+
placeholder: { type: String, required: false, default: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22" }
|
|
7120
|
+
},
|
|
7121
|
+
emits: ["confirm", "cancel", "input"],
|
|
7122
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
7123
|
+
const props = __props;
|
|
7124
|
+
const emit = __emit;
|
|
7125
|
+
const searchKeyword = ref("");
|
|
7126
|
+
const treeRef = ref();
|
|
7127
|
+
const selectedKeys = ref([]);
|
|
7128
|
+
const selectedData = ref(props.multiple ? [] : {});
|
|
7129
|
+
const initSelection = () => {
|
|
7130
|
+
selectedKeys.value = [...props.defaultSelectedKeys];
|
|
7131
|
+
nextTick(() => {
|
|
7132
|
+
if (treeRef.value) {
|
|
7133
|
+
if (props.multiple) {
|
|
7134
|
+
treeRef.value.setCheckedKeys(props.defaultSelectedKeys);
|
|
7135
|
+
} else {
|
|
7136
|
+
treeRef.value.setCurrentKey(props.defaultSelectedKeys[0]);
|
|
7137
|
+
}
|
|
7138
|
+
}
|
|
7139
|
+
});
|
|
7140
|
+
};
|
|
7141
|
+
watch(
|
|
7142
|
+
() => props.defaultSelectedKeys,
|
|
7143
|
+
() => {
|
|
7144
|
+
initSelection();
|
|
7145
|
+
},
|
|
7146
|
+
{ immediate: true }
|
|
7147
|
+
);
|
|
7148
|
+
const filteredTreeData = computed(() => {
|
|
7149
|
+
if (!searchKeyword.value) return props.treeData;
|
|
7150
|
+
const filterNode = (nodes) => {
|
|
7151
|
+
return nodes.map((node) => {
|
|
7152
|
+
const children = filterNode(node[props.treeProps.children || "children"] || []);
|
|
7153
|
+
const isMatch = node[props.treeProps.label || "label"].includes(
|
|
7154
|
+
searchKeyword.value
|
|
7155
|
+
);
|
|
7156
|
+
if (isMatch || children.length > 0) {
|
|
7157
|
+
return { ...node, [props.treeProps.children || "children"]: children };
|
|
7158
|
+
}
|
|
7159
|
+
return null;
|
|
7160
|
+
}).filter(Boolean);
|
|
7161
|
+
};
|
|
7162
|
+
return filterNode(props.treeData);
|
|
7163
|
+
});
|
|
7164
|
+
const handleCheckChange = (data, checked) => {
|
|
7165
|
+
const nodeKeyField = props.nodeKey;
|
|
7166
|
+
if (checked) {
|
|
7167
|
+
selectedKeys.value.push(data[nodeKeyField]);
|
|
7168
|
+
if (Array.isArray(selectedData.value)) {
|
|
7169
|
+
selectedData.value.push(data);
|
|
7170
|
+
}
|
|
7171
|
+
} else {
|
|
7172
|
+
selectedKeys.value = selectedKeys.value.filter((key) => key !== data[nodeKeyField]);
|
|
7173
|
+
if (Array.isArray(selectedData.value)) {
|
|
7174
|
+
selectedData.value = selectedData.value.filter(
|
|
7175
|
+
(item) => item[nodeKeyField] !== data[nodeKeyField]
|
|
7176
|
+
);
|
|
7177
|
+
}
|
|
7178
|
+
}
|
|
7179
|
+
};
|
|
7180
|
+
const handleNodeClick = (data) => {
|
|
7181
|
+
if (!props.multiple) {
|
|
7182
|
+
const nodeKeyField = props.nodeKey;
|
|
7183
|
+
selectedKeys.value = [data[nodeKeyField]];
|
|
7184
|
+
selectedData.value = data;
|
|
7185
|
+
}
|
|
7186
|
+
};
|
|
7187
|
+
const reset = () => {
|
|
7188
|
+
searchKeyword.value = "";
|
|
7189
|
+
selectedKeys.value = [];
|
|
7190
|
+
selectedData.value = props.multiple ? [] : {};
|
|
7191
|
+
if (treeRef.value) {
|
|
7192
|
+
if (props.multiple) {
|
|
7193
|
+
treeRef.value.setCheckedKeys([]);
|
|
7194
|
+
} else {
|
|
7195
|
+
treeRef.value.setCurrentKey(void 0);
|
|
7196
|
+
}
|
|
7197
|
+
}
|
|
7198
|
+
};
|
|
7199
|
+
const getSelectedData = () => selectedData.value;
|
|
7200
|
+
const getSelectedKeys = () => selectedKeys.value;
|
|
7201
|
+
const handleConfirm = () => {
|
|
7202
|
+
if (selectedKeys.value.length === 0) {
|
|
7203
|
+
ElMessage.warning("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u8282\u70B9");
|
|
7204
|
+
return;
|
|
7205
|
+
}
|
|
7206
|
+
emit("confirm", selectedData.value);
|
|
7207
|
+
};
|
|
7208
|
+
const handleCancel = () => {
|
|
7209
|
+
emit("cancel");
|
|
7210
|
+
};
|
|
7211
|
+
__expose({
|
|
7212
|
+
reset,
|
|
7213
|
+
getSelectedData,
|
|
7214
|
+
getSelectedKeys,
|
|
7215
|
+
// el-tree 方法透传
|
|
7216
|
+
getCheckedNodes: () => treeRef.value?.getCheckedNodes() || [],
|
|
7217
|
+
getCheckedKeys: () => treeRef.value?.getCheckedKeys() || [],
|
|
7218
|
+
getHalfCheckedNodes: () => treeRef.value?.getHalfCheckedNodes() || [],
|
|
7219
|
+
getHalfCheckedKeys: () => treeRef.value?.getHalfCheckedKeys() || [],
|
|
7220
|
+
getCurrentKey: () => treeRef.value?.getCurrentKey() ?? void 0,
|
|
7221
|
+
getCurrentNode: () => treeRef.value?.getCurrentNode(),
|
|
7222
|
+
setCheckedKeys: (keys) => treeRef.value?.setCheckedKeys(keys),
|
|
7223
|
+
setCheckedNodes: (nodes) => treeRef.value?.setCheckedNodes(nodes),
|
|
7224
|
+
setCurrentKey: (key) => treeRef.value?.setCurrentKey(key),
|
|
7225
|
+
setCurrentNode: (node) => treeRef.value?.setCurrentNode(node),
|
|
7226
|
+
getNode: (key) => treeRef.value?.getNode(key),
|
|
7227
|
+
filter: (value) => treeRef.value?.filter(value),
|
|
7228
|
+
updateKeyChildren: (key, children) => treeRef.value?.updateKeyChildren(key, children),
|
|
7229
|
+
remove: (node) => treeRef.value?.remove(node),
|
|
7230
|
+
append: (data, parentNode) => treeRef.value?.append(data, parentNode),
|
|
7231
|
+
insertBefore: (data, refNode) => treeRef.value?.insertBefore(data, refNode),
|
|
7232
|
+
insertAfter: (data, refNode) => treeRef.value?.insertAfter(data, refNode),
|
|
7233
|
+
//
|
|
7234
|
+
input: (value) => emit("input", value)
|
|
7235
|
+
});
|
|
7236
|
+
return (_ctx, _cache) => {
|
|
7237
|
+
const _component_el_input = resolveComponent("el-input");
|
|
7238
|
+
const _component_el_button = resolveComponent("el-button");
|
|
7239
|
+
return openBlock(), createElementBlock(
|
|
7240
|
+
"div",
|
|
7241
|
+
{
|
|
7242
|
+
class: normalizeClass(unref(bem)("tree-select"))
|
|
7243
|
+
},
|
|
7244
|
+
[
|
|
7245
|
+
createCommentVNode(" \u641C\u7D22\u6846 "),
|
|
7246
|
+
__props.showSearch ? (openBlock(), createBlock(_component_el_input, {
|
|
7247
|
+
key: 0,
|
|
7248
|
+
modelValue: searchKeyword.value,
|
|
7249
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchKeyword.value = $event),
|
|
7250
|
+
placeholder: __props.placeholder,
|
|
7251
|
+
clearable: "",
|
|
7252
|
+
"prefix-icon": unref(search_default),
|
|
7253
|
+
class: normalizeClass(unref(bem)("tree-select", "search")),
|
|
7254
|
+
onInput: _cache[1] || (_cache[1] = (value) => emit("input", value))
|
|
7255
|
+
}, null, 8, ["modelValue", "placeholder", "prefix-icon", "class"])) : createCommentVNode("v-if", true),
|
|
7256
|
+
createCommentVNode(" \u6811\u5F62\u9009\u62E9 "),
|
|
7257
|
+
createElementVNode(
|
|
7258
|
+
"div",
|
|
7259
|
+
{
|
|
7260
|
+
class: normalizeClass(unref(bem)("tree-select", "tree"))
|
|
7261
|
+
},
|
|
7262
|
+
[
|
|
7263
|
+
createVNode(unref(ElTree), mergeProps({
|
|
7264
|
+
ref_key: "treeRef",
|
|
7265
|
+
ref: treeRef,
|
|
7266
|
+
data: filteredTreeData.value,
|
|
7267
|
+
props: __props.treeProps,
|
|
7268
|
+
"show-checkbox": __props.multiple,
|
|
7269
|
+
"default-expand-all": __props.defaultExpandAll,
|
|
7270
|
+
"expand-on-click-node": __props.expandOnClickNode,
|
|
7271
|
+
"node-key": __props.nodeKey,
|
|
7272
|
+
onCheckChange: handleCheckChange,
|
|
7273
|
+
onNodeClick: handleNodeClick
|
|
7274
|
+
}, _ctx.$attrs, toHandlers(_ctx.$attrs)), null, 16, ["data", "props", "show-checkbox", "default-expand-all", "expand-on-click-node", "node-key"])
|
|
7275
|
+
],
|
|
7276
|
+
2
|
|
7277
|
+
/* CLASS */
|
|
7278
|
+
),
|
|
7279
|
+
createCommentVNode(" \u5E95\u90E8\u6309\u94AE\u63D2\u69FD "),
|
|
7280
|
+
createElementVNode(
|
|
7281
|
+
"div",
|
|
7282
|
+
{
|
|
7283
|
+
class: normalizeClass(unref(bem)("tree-select", "footer"))
|
|
7284
|
+
},
|
|
7285
|
+
[
|
|
7286
|
+
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
7287
|
+
createVNode(_component_el_button, { onClick: handleCancel }, {
|
|
7288
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
7289
|
+
createTextVNode(
|
|
7290
|
+
"\u53D6\u6D88",
|
|
7291
|
+
-1
|
|
7292
|
+
/* CACHED */
|
|
7293
|
+
)
|
|
7294
|
+
])]),
|
|
7295
|
+
_: 1
|
|
7296
|
+
/* STABLE */
|
|
7297
|
+
}),
|
|
7298
|
+
createVNode(_component_el_button, {
|
|
7299
|
+
type: "primary",
|
|
7300
|
+
onClick: handleConfirm
|
|
7301
|
+
}, {
|
|
7302
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
7303
|
+
createTextVNode(
|
|
7304
|
+
"\u786E\u5B9A",
|
|
7305
|
+
-1
|
|
7306
|
+
/* CACHED */
|
|
7307
|
+
)
|
|
7308
|
+
])]),
|
|
7309
|
+
_: 1
|
|
7310
|
+
/* STABLE */
|
|
7311
|
+
})
|
|
7312
|
+
])
|
|
7313
|
+
],
|
|
7314
|
+
2
|
|
7315
|
+
/* CLASS */
|
|
7316
|
+
)
|
|
7317
|
+
],
|
|
7318
|
+
2
|
|
7319
|
+
/* CLASS */
|
|
7320
|
+
);
|
|
7321
|
+
};
|
|
7322
|
+
}
|
|
7323
|
+
});
|
|
7324
|
+
|
|
7325
|
+
const MlTreeSelect = withInstall(_sfc_main$3);
|
|
7326
|
+
|
|
7327
|
+
const dialogPropKeys = [
|
|
7328
|
+
"title",
|
|
7329
|
+
"width",
|
|
7330
|
+
"fullscreen",
|
|
7331
|
+
"top",
|
|
7332
|
+
"modal",
|
|
7333
|
+
"modalClass",
|
|
7334
|
+
"appendToBody",
|
|
7335
|
+
"appendTo",
|
|
7336
|
+
"lockScroll",
|
|
7337
|
+
"closeOnClickModal",
|
|
7338
|
+
"closeOnPressEscape",
|
|
7339
|
+
"showClose",
|
|
7340
|
+
"draggable",
|
|
7341
|
+
"overflow",
|
|
7342
|
+
"center",
|
|
7343
|
+
"alignCenter",
|
|
7344
|
+
"destroyOnClose",
|
|
7345
|
+
"closeIcon",
|
|
7346
|
+
"zIndex",
|
|
7347
|
+
"headerAriaLevel"
|
|
7348
|
+
];
|
|
7349
|
+
|
|
7350
|
+
var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
7351
|
+
...{
|
|
7352
|
+
name: "MlTreeSelectDialog"
|
|
7353
|
+
},
|
|
7354
|
+
__name: "index",
|
|
7355
|
+
props: /* @__PURE__ */ mergeModels({
|
|
7356
|
+
treeData: { type: Array, required: true },
|
|
7357
|
+
treeProps: { type: Object, required: false, default: () => ({ label: "label", children: "children" }) },
|
|
7358
|
+
multiple: { type: Boolean, required: false, default: false },
|
|
7359
|
+
defaultExpandAll: { type: Boolean, required: false, default: true },
|
|
7360
|
+
defaultSelectedKeys: { type: Array, required: false, default: () => [] },
|
|
7361
|
+
nodeKey: { type: String, required: false, default: "id" },
|
|
7362
|
+
showSearch: { type: Boolean, required: false, default: true },
|
|
7363
|
+
expandOnClickNode: { type: Boolean, required: false },
|
|
7364
|
+
placeholder: { type: String, required: false },
|
|
7365
|
+
title: { type: String, required: false, default: "\u6811\u5F62\u9009\u62E9" },
|
|
7366
|
+
width: { type: String, required: false, default: "500px" },
|
|
7367
|
+
appendToBody: { type: Boolean, required: false },
|
|
7368
|
+
appendTo: { type: null, required: false },
|
|
7369
|
+
beforeClose: { type: Function, required: false },
|
|
7370
|
+
destroyOnClose: { type: Boolean, required: false },
|
|
7371
|
+
closeOnClickModal: { type: Boolean, required: false },
|
|
7372
|
+
closeOnPressEscape: { type: Boolean, required: false },
|
|
7373
|
+
lockScroll: { type: Boolean, required: false },
|
|
7374
|
+
modal: { type: Boolean, required: false },
|
|
7375
|
+
openDelay: { type: Number, required: false },
|
|
7376
|
+
closeDelay: { type: Number, required: false },
|
|
7377
|
+
top: { type: String, required: false },
|
|
7378
|
+
modelValue: { type: Boolean, required: false },
|
|
7379
|
+
modalClass: { type: String, required: false },
|
|
7380
|
+
headerClass: { type: String, required: false },
|
|
7381
|
+
bodyClass: { type: String, required: false },
|
|
7382
|
+
footerClass: { type: String, required: false },
|
|
7383
|
+
zIndex: { type: Number, required: false },
|
|
7384
|
+
trapFocus: { type: Boolean, required: false },
|
|
7385
|
+
headerAriaLevel: { type: String, required: false },
|
|
7386
|
+
center: { type: Boolean, required: false },
|
|
7387
|
+
alignCenter: { type: Boolean, required: false },
|
|
7388
|
+
closeIcon: { type: null, required: false },
|
|
7389
|
+
draggable: { type: Boolean, required: false },
|
|
7390
|
+
overflow: { type: Boolean, required: false },
|
|
7391
|
+
fullscreen: { type: Boolean, required: false },
|
|
7392
|
+
showClose: { type: Boolean, required: false },
|
|
7393
|
+
ariaLevel: { type: String, required: false }
|
|
7394
|
+
}, {
|
|
7395
|
+
"modelValue": { type: Boolean, ...{ default: false } },
|
|
7396
|
+
"modelModifiers": {}
|
|
7397
|
+
}),
|
|
7398
|
+
emits: /* @__PURE__ */ mergeModels(["confirm", "close", "input"], ["update:modelValue"]),
|
|
7399
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
7400
|
+
const visible = useModel(__props, "modelValue");
|
|
7401
|
+
const props = __props;
|
|
7402
|
+
const emit = __emit;
|
|
7403
|
+
const attrs = useAttrs();
|
|
7404
|
+
const dialogAttrs = computed(() => {
|
|
7405
|
+
const result = {
|
|
7406
|
+
title: props.title,
|
|
7407
|
+
width: props.width
|
|
7408
|
+
};
|
|
7409
|
+
Object.keys(attrs).forEach((key) => {
|
|
7410
|
+
if (dialogPropKeys.includes(key)) {
|
|
7411
|
+
result[key] = attrs[key];
|
|
7412
|
+
}
|
|
7413
|
+
});
|
|
7414
|
+
return result;
|
|
7415
|
+
});
|
|
7416
|
+
const treeSelectAttrs = computed(() => {
|
|
7417
|
+
const result = {
|
|
7418
|
+
treeData: props.treeData,
|
|
7419
|
+
treeProps: props.treeProps,
|
|
7420
|
+
multiple: props.multiple,
|
|
7421
|
+
defaultExpandAll: props.defaultExpandAll,
|
|
7422
|
+
defaultSelectedKeys: props.defaultSelectedKeys,
|
|
7423
|
+
nodeKey: props.nodeKey,
|
|
7424
|
+
showSearch: props.showSearch
|
|
7425
|
+
};
|
|
7426
|
+
Object.keys(attrs).forEach((key) => {
|
|
7427
|
+
if (!dialogPropKeys.includes(key) && !key.startsWith("on")) {
|
|
7428
|
+
result[key] = attrs[key];
|
|
7429
|
+
}
|
|
7430
|
+
});
|
|
7431
|
+
return result;
|
|
7432
|
+
});
|
|
7433
|
+
const treeSelectRef = ref();
|
|
7434
|
+
watch(visible, (val) => {
|
|
7435
|
+
if (!val && treeSelectRef.value) {
|
|
7436
|
+
treeSelectRef.value.reset();
|
|
7437
|
+
}
|
|
7438
|
+
});
|
|
7439
|
+
const handleBeforeClose = () => {
|
|
7440
|
+
visible.value = false;
|
|
7441
|
+
};
|
|
7442
|
+
const handleConfirm = (selectedData) => {
|
|
7443
|
+
emit("confirm", selectedData);
|
|
7444
|
+
visible.value = false;
|
|
7445
|
+
};
|
|
7446
|
+
const handleCancel = () => {
|
|
7447
|
+
visible.value = false;
|
|
7448
|
+
};
|
|
7449
|
+
__expose({
|
|
7450
|
+
input: (value) => emit("input", value)
|
|
7451
|
+
});
|
|
7452
|
+
return (_ctx, _cache) => {
|
|
7453
|
+
const _component_el_dialog = resolveComponent("el-dialog");
|
|
7454
|
+
return openBlock(), createBlock(_component_el_dialog, mergeProps({
|
|
7455
|
+
modelValue: visible.value,
|
|
7456
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event)
|
|
7457
|
+
}, dialogAttrs.value, {
|
|
7458
|
+
class: unref(bem)("tree-select-dialog"),
|
|
7459
|
+
"before-close": handleBeforeClose,
|
|
7460
|
+
onClose: _cache[1] || (_cache[1] = ($event) => emit("close"))
|
|
7461
|
+
}), {
|
|
7462
|
+
default: withCtx(() => [
|
|
7463
|
+
createVNode(unref(MlTreeSelect), mergeProps({
|
|
7464
|
+
ref_key: "treeSelectRef",
|
|
7465
|
+
ref: treeSelectRef,
|
|
7466
|
+
"tree-data": props.treeData
|
|
7467
|
+
}, treeSelectAttrs.value, toHandlers(_ctx.$attrs), {
|
|
7468
|
+
onConfirm: handleConfirm,
|
|
7469
|
+
onCancel: handleCancel
|
|
7470
|
+
}), null, 16, ["tree-data"])
|
|
7471
|
+
]),
|
|
7472
|
+
_: 1
|
|
7473
|
+
/* STABLE */
|
|
7474
|
+
}, 16, ["modelValue", "class"]);
|
|
7475
|
+
};
|
|
7476
|
+
}
|
|
7477
|
+
});
|
|
7478
|
+
|
|
7479
|
+
const MlTreeSelectDialog = withInstall(_sfc_main$2);
|
|
7480
|
+
|
|
7481
|
+
const drawerPropKeys = [
|
|
7482
|
+
"title",
|
|
7483
|
+
"size",
|
|
7484
|
+
"direction",
|
|
7485
|
+
"appendToBody",
|
|
7486
|
+
"appendTo",
|
|
7487
|
+
"modal",
|
|
7488
|
+
"modalClass",
|
|
7489
|
+
"lockScroll",
|
|
7490
|
+
"closeOnClickModal",
|
|
7491
|
+
"closeOnPressEscape",
|
|
7492
|
+
"showClose",
|
|
7493
|
+
"withHeader",
|
|
7494
|
+
"openDelay",
|
|
7495
|
+
"closeDelay",
|
|
7496
|
+
"destroyOnClose",
|
|
7497
|
+
"zIndex"
|
|
7498
|
+
];
|
|
7499
|
+
|
|
7500
|
+
var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
7501
|
+
...{
|
|
7502
|
+
name: "MlTreeSelectDrawer"
|
|
7503
|
+
},
|
|
7504
|
+
__name: "index",
|
|
7505
|
+
props: /* @__PURE__ */ mergeModels({
|
|
7506
|
+
treeData: { type: Array, required: true },
|
|
7507
|
+
treeProps: { type: Object, required: false, default: () => ({ label: "label", children: "children" }) },
|
|
7508
|
+
multiple: { type: Boolean, required: false, default: false },
|
|
7509
|
+
defaultExpandAll: { type: Boolean, required: false, default: true },
|
|
7510
|
+
defaultSelectedKeys: { type: Array, required: false, default: () => [] },
|
|
7511
|
+
nodeKey: { type: String, required: false, default: "id" },
|
|
7512
|
+
showSearch: { type: Boolean, required: false, default: true },
|
|
7513
|
+
expandOnClickNode: { type: Boolean, required: false },
|
|
7514
|
+
placeholder: { type: String, required: false },
|
|
7515
|
+
title: { type: String, required: false, default: "\u6811\u5F62\u9009\u62E9" },
|
|
7516
|
+
size: { type: [String, Number], required: false, default: "400px" },
|
|
7517
|
+
direction: { type: String, required: false, default: "rtl" },
|
|
7518
|
+
withHeader: { type: Boolean, required: false },
|
|
7519
|
+
modalFade: { type: Boolean, required: false },
|
|
7520
|
+
headerAriaLevel: { type: String, required: false },
|
|
7521
|
+
appendToBody: { type: Boolean, required: false },
|
|
7522
|
+
appendTo: { type: null, required: false },
|
|
7523
|
+
beforeClose: { type: Function, required: false },
|
|
7524
|
+
destroyOnClose: { type: Boolean, required: false },
|
|
7525
|
+
closeOnClickModal: { type: Boolean, required: false },
|
|
7526
|
+
closeOnPressEscape: { type: Boolean, required: false },
|
|
7527
|
+
lockScroll: { type: Boolean, required: false },
|
|
7528
|
+
modal: { type: Boolean, required: false },
|
|
7529
|
+
openDelay: { type: Number, required: false },
|
|
7530
|
+
closeDelay: { type: Number, required: false },
|
|
7531
|
+
top: { type: String, required: false },
|
|
7532
|
+
modelValue: { type: Boolean, required: false },
|
|
7533
|
+
modalClass: { type: String, required: false },
|
|
7534
|
+
headerClass: { type: String, required: false },
|
|
7535
|
+
bodyClass: { type: String, required: false },
|
|
7536
|
+
footerClass: { type: String, required: false },
|
|
7537
|
+
width: { type: null, required: false },
|
|
7538
|
+
zIndex: { type: Number, required: false },
|
|
7539
|
+
trapFocus: { type: Boolean, required: false },
|
|
7540
|
+
center: { type: Boolean, required: false },
|
|
7541
|
+
alignCenter: { type: Boolean, required: false },
|
|
7542
|
+
closeIcon: { type: null, required: false },
|
|
7543
|
+
draggable: { type: Boolean, required: false },
|
|
7544
|
+
overflow: { type: Boolean, required: false },
|
|
7545
|
+
fullscreen: { type: Boolean, required: false },
|
|
7546
|
+
showClose: { type: Boolean, required: false },
|
|
7547
|
+
ariaLevel: { type: String, required: false }
|
|
7548
|
+
}, {
|
|
7549
|
+
"modelValue": { type: Boolean, ...{ default: false } },
|
|
7550
|
+
"modelModifiers": {}
|
|
7551
|
+
}),
|
|
7552
|
+
emits: /* @__PURE__ */ mergeModels(["confirm", "close", "input"], ["update:modelValue"]),
|
|
7553
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
7554
|
+
const visible = useModel(__props, "modelValue");
|
|
7555
|
+
const props = __props;
|
|
7556
|
+
const emit = __emit;
|
|
7557
|
+
const attrs = useAttrs();
|
|
7558
|
+
const drawerAttrs = computed(() => {
|
|
7559
|
+
const result = {
|
|
7560
|
+
title: props.title,
|
|
7561
|
+
size: props.size,
|
|
7562
|
+
direction: props.direction
|
|
7563
|
+
};
|
|
7564
|
+
Object.keys(attrs).forEach((key) => {
|
|
7565
|
+
if (drawerPropKeys.includes(key)) {
|
|
7566
|
+
result[key] = attrs[key];
|
|
7567
|
+
}
|
|
7568
|
+
});
|
|
7569
|
+
return result;
|
|
7570
|
+
});
|
|
7571
|
+
const treeSelectAttrs = computed(() => {
|
|
7572
|
+
const result = {
|
|
7573
|
+
treeProps: props.treeProps,
|
|
7574
|
+
multiple: props.multiple,
|
|
7575
|
+
defaultExpandAll: props.defaultExpandAll,
|
|
7576
|
+
defaultSelectedKeys: props.defaultSelectedKeys,
|
|
7577
|
+
nodeKey: props.nodeKey,
|
|
7578
|
+
showSearch: props.showSearch
|
|
7579
|
+
};
|
|
7580
|
+
Object.keys(attrs).forEach((key) => {
|
|
7581
|
+
if (!drawerPropKeys.includes(key) && !key.startsWith("on")) {
|
|
7582
|
+
result[key] = attrs[key];
|
|
7583
|
+
}
|
|
7584
|
+
});
|
|
7585
|
+
return result;
|
|
7586
|
+
});
|
|
7587
|
+
const treeSelectRef = ref();
|
|
7588
|
+
watch(visible, (val) => {
|
|
7589
|
+
if (!val && treeSelectRef.value) {
|
|
7590
|
+
treeSelectRef.value.reset();
|
|
7591
|
+
}
|
|
7592
|
+
});
|
|
7593
|
+
const handleBeforeClose = (done) => {
|
|
7594
|
+
visible.value = false;
|
|
7595
|
+
done();
|
|
7596
|
+
};
|
|
7597
|
+
const handleConfirm = (selectedData) => {
|
|
7598
|
+
emit("confirm", selectedData);
|
|
7599
|
+
visible.value = false;
|
|
7600
|
+
};
|
|
7601
|
+
const handleCancel = () => {
|
|
7602
|
+
visible.value = false;
|
|
7603
|
+
};
|
|
7604
|
+
__expose({
|
|
7605
|
+
input: (value) => emit("input", value)
|
|
7606
|
+
});
|
|
7607
|
+
return (_ctx, _cache) => {
|
|
7608
|
+
const _component_el_drawer = resolveComponent("el-drawer");
|
|
7609
|
+
return openBlock(), createBlock(_component_el_drawer, mergeProps({
|
|
7610
|
+
modelValue: visible.value,
|
|
7611
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event)
|
|
7612
|
+
}, drawerAttrs.value, {
|
|
7613
|
+
class: unref(bem)("tree-select-drawer"),
|
|
7614
|
+
"before-close": handleBeforeClose,
|
|
7615
|
+
onClose: _cache[1] || (_cache[1] = ($event) => emit("close"))
|
|
7616
|
+
}), {
|
|
7617
|
+
default: withCtx(() => [
|
|
7618
|
+
createVNode(_sfc_main$3, mergeProps({
|
|
7619
|
+
ref_key: "treeSelectRef",
|
|
7620
|
+
ref: treeSelectRef,
|
|
7621
|
+
"tree-data": __props.treeData
|
|
7622
|
+
}, treeSelectAttrs.value, toHandlers(_ctx.$attrs), {
|
|
7623
|
+
onConfirm: handleConfirm,
|
|
7624
|
+
onCancel: handleCancel
|
|
7625
|
+
}), null, 16, ["tree-data"])
|
|
7626
|
+
]),
|
|
7627
|
+
_: 1
|
|
7628
|
+
/* STABLE */
|
|
7629
|
+
}, 16, ["modelValue", "class"]);
|
|
7630
|
+
};
|
|
7631
|
+
}
|
|
7632
|
+
});
|
|
7633
|
+
|
|
7634
|
+
const MlTreeSelectDrawer = withInstall(_sfc_main$1);
|
|
7635
|
+
|
|
7636
|
+
const imageUploadProProps = {
|
|
7637
|
+
/**
|
|
7638
|
+
* 已上传图片列表(用于回显)
|
|
7639
|
+
* v-model 绑定的值
|
|
7640
|
+
*/
|
|
7641
|
+
modelValue: {
|
|
7642
|
+
type: Array,
|
|
7643
|
+
default: () => []
|
|
7644
|
+
},
|
|
7645
|
+
/**
|
|
7646
|
+
* 允许上传的图片格式
|
|
7647
|
+
* 默认支持 jpg、png、webp
|
|
7648
|
+
*/
|
|
7649
|
+
acceptType: {
|
|
7650
|
+
type: String,
|
|
7651
|
+
default: "image/jpeg,image/jpg,image/png,image/webp"
|
|
7652
|
+
},
|
|
7653
|
+
/**
|
|
7654
|
+
* 尺寸限制配置
|
|
7655
|
+
* width/height 为 0 表示不限制
|
|
7656
|
+
* size 为最大文件大小(MB)
|
|
7657
|
+
*/
|
|
7658
|
+
sizeLimit: {
|
|
7659
|
+
type: Object,
|
|
7660
|
+
default: () => ({
|
|
7661
|
+
width: 0,
|
|
7662
|
+
height: 0,
|
|
7663
|
+
size: 2
|
|
7664
|
+
})
|
|
7665
|
+
},
|
|
7666
|
+
/**
|
|
7667
|
+
* 最大上传数量
|
|
7668
|
+
* 默认 9 张
|
|
7669
|
+
*/
|
|
7670
|
+
maxCount: {
|
|
7671
|
+
type: Number,
|
|
7672
|
+
default: 9
|
|
7673
|
+
},
|
|
7674
|
+
/**
|
|
7675
|
+
* 是否允许裁剪图片
|
|
7676
|
+
* 启用后会在上传时弹出裁剪对话框
|
|
7677
|
+
*/
|
|
7678
|
+
allowCrop: {
|
|
7679
|
+
type: Boolean,
|
|
7680
|
+
default: true
|
|
7681
|
+
},
|
|
7682
|
+
/**
|
|
7683
|
+
* 是否支持封面标记
|
|
7684
|
+
* 允许用户标记某张图片为封面
|
|
7685
|
+
*/
|
|
7686
|
+
allowCover: {
|
|
7687
|
+
type: Boolean,
|
|
7688
|
+
default: true
|
|
7689
|
+
},
|
|
7690
|
+
/**
|
|
7691
|
+
* 是否支持拖拽排序
|
|
7692
|
+
* 启用后可以通过拖拽调整图片顺序
|
|
7693
|
+
*/
|
|
7694
|
+
allowSort: {
|
|
7695
|
+
type: Boolean,
|
|
7696
|
+
default: true
|
|
7697
|
+
},
|
|
7698
|
+
/**
|
|
7699
|
+
* 上传 API 配置
|
|
7700
|
+
* 配置后,每次选择或裁剪图片时会自动上传到服务器
|
|
7701
|
+
*/
|
|
7702
|
+
uploadApi: {
|
|
7703
|
+
type: Object,
|
|
7704
|
+
default: null
|
|
7705
|
+
},
|
|
7706
|
+
/**
|
|
7707
|
+
* 是否自动上传
|
|
7708
|
+
* 启用后,选择或裁剪图片时自动调用上传接口
|
|
7709
|
+
*/
|
|
7710
|
+
autoUpload: {
|
|
7711
|
+
type: Boolean,
|
|
7712
|
+
default: false
|
|
7713
|
+
}
|
|
7714
|
+
};
|
|
7715
|
+
|
|
7716
|
+
const _hoisted_1 = { key: 0 };
|
|
7717
|
+
const _hoisted_2 = ["onDragstart", "onDrop"];
|
|
7718
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7719
|
+
...{
|
|
7720
|
+
name: "MlImageUploadPro"
|
|
7721
|
+
},
|
|
7722
|
+
__name: "index",
|
|
7723
|
+
props: imageUploadProProps,
|
|
7724
|
+
emits: ["update:modelValue", "change", "upload"],
|
|
7725
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
7726
|
+
const ASPECT_RATIO_OPTIONS = [
|
|
7727
|
+
{ label: "\u81EA\u7531\u6BD4\u4F8B", value: "free" },
|
|
7728
|
+
{ label: "1:1", value: "1:1" },
|
|
7729
|
+
{ label: "4:3", value: "4:3" },
|
|
7730
|
+
{ label: "16:9", value: "16:9" }
|
|
7731
|
+
];
|
|
7732
|
+
const props = __props;
|
|
7733
|
+
const uploadRef = ref();
|
|
7734
|
+
const cropperRef = ref();
|
|
7735
|
+
const fileList = ref([]);
|
|
7736
|
+
const previewList = ref([]);
|
|
7737
|
+
const cropDialogVisible = ref(false);
|
|
7738
|
+
const cropImageUrl = ref("");
|
|
7739
|
+
const cropTargetItem = ref();
|
|
7740
|
+
const dragIndex = ref(-1);
|
|
7741
|
+
const cropForm = reactive({
|
|
7742
|
+
aspectRatio: "free"
|
|
7743
|
+
// 裁剪比例
|
|
7744
|
+
});
|
|
7745
|
+
const cropWidth = ref(props.sizeLimit.width || 400);
|
|
7746
|
+
const cropHeight = ref(props.sizeLimit.height || 400);
|
|
7747
|
+
const displayWidth = ref(props.sizeLimit.width || 400);
|
|
7748
|
+
const displayHeight = ref(props.sizeLimit.height || 400);
|
|
7749
|
+
const aspectRatio = reactive({
|
|
7750
|
+
fixed: false,
|
|
7751
|
+
value: [1, 1]
|
|
7752
|
+
});
|
|
7753
|
+
const axios = computed(() => {
|
|
7754
|
+
if (!props.uploadApi) return null;
|
|
7755
|
+
return initRequestInstance({
|
|
7756
|
+
baseURL: "",
|
|
7757
|
+
headers: props.uploadApi.headers || {}
|
|
7758
|
+
});
|
|
7759
|
+
});
|
|
7760
|
+
const acceptDesc = computed(() => {
|
|
7761
|
+
return props.acceptType.split(",").map((type) => type.replace("image/", ".")).join("\u3001");
|
|
7762
|
+
});
|
|
7763
|
+
watch(
|
|
7764
|
+
() => props.modelValue,
|
|
7765
|
+
(val) => {
|
|
7766
|
+
if (val.length) {
|
|
7767
|
+
previewList.value = val.map((item) => ({
|
|
7768
|
+
...item,
|
|
7769
|
+
url: item.url || item.response?.url || ""
|
|
7770
|
+
}));
|
|
7771
|
+
fileList.value = val;
|
|
7772
|
+
}
|
|
7773
|
+
},
|
|
7774
|
+
{ immediate: true, deep: true }
|
|
7775
|
+
);
|
|
7776
|
+
const uploadSingleFile = async (file) => {
|
|
7777
|
+
if (!props.uploadApi || !axios.value) {
|
|
7778
|
+
throw new Error("\u672A\u914D\u7F6E\u4E0A\u4F20 API");
|
|
7779
|
+
}
|
|
7780
|
+
const formData = new FormData();
|
|
7781
|
+
formData.append(props.uploadApi.fieldName || "file", file);
|
|
7782
|
+
if (props.uploadApi.data) {
|
|
7783
|
+
Object.keys(props.uploadApi.data).forEach((key) => {
|
|
7784
|
+
formData.append(key, props.uploadApi.data[key]);
|
|
7785
|
+
});
|
|
7786
|
+
}
|
|
7787
|
+
const method = props.uploadApi.method || "post";
|
|
7788
|
+
const response = await axios.value[method](props.uploadApi.url, formData, {
|
|
7789
|
+
headers: {
|
|
7790
|
+
"Content-Type": "multipart/form-data"
|
|
7791
|
+
}
|
|
7792
|
+
});
|
|
7793
|
+
const urlField = props.uploadApi.responseUrlField || "data.url";
|
|
7794
|
+
return getNestedValue(response, urlField);
|
|
7795
|
+
};
|
|
7796
|
+
const handleBeforeUpload = (file) => {
|
|
7797
|
+
const isAccept = props.acceptType.includes(file.type);
|
|
7798
|
+
if (!isAccept) {
|
|
7799
|
+
ElMessage.error(`\u4EC5\u652F\u6301\u4E0A\u4F20${acceptDesc.value}\u683C\u5F0F\u7684\u56FE\u7247`);
|
|
7800
|
+
return false;
|
|
7801
|
+
}
|
|
7802
|
+
const isOverSize = file.size / 1024 / 1024 > props.sizeLimit.size;
|
|
7803
|
+
if (isOverSize) {
|
|
7804
|
+
ElMessage.error(`\u5355\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7${props.sizeLimit.size}MB`);
|
|
7805
|
+
return false;
|
|
7806
|
+
}
|
|
7807
|
+
if (previewList.value.length >= props.maxCount) {
|
|
7808
|
+
ElMessage.error(`\u6700\u591A\u53EA\u80FD\u4E0A\u4F20${props.maxCount}\u5F20\u56FE\u7247`);
|
|
7809
|
+
return false;
|
|
7810
|
+
}
|
|
7811
|
+
if (props.sizeLimit.width || props.sizeLimit.height) {
|
|
7812
|
+
return new Promise((resolve) => {
|
|
7813
|
+
const img = new Image();
|
|
7814
|
+
img.onload = () => {
|
|
7815
|
+
const isOverWidth = props.sizeLimit.width && img.width < props.sizeLimit.width;
|
|
7816
|
+
const isOverHeight = props.sizeLimit.height && img.height < props.sizeLimit.height;
|
|
7817
|
+
if (isOverWidth || isOverHeight) {
|
|
7818
|
+
ElMessage.error(
|
|
7819
|
+
`\u56FE\u7247\u5C3A\u5BF8\u8981\u6C42\uFF1A\u5BBD\u2265${props.sizeLimit.width}px \u9AD8\u2265${props.sizeLimit.height}px\uFF0C\u5F53\u524D\u56FE\u7247\u5BBD${img.width}px \u9AD8${img.height}px`
|
|
7820
|
+
);
|
|
7821
|
+
resolve(false);
|
|
7822
|
+
} else {
|
|
7823
|
+
resolve(true);
|
|
7824
|
+
}
|
|
7825
|
+
};
|
|
7826
|
+
img.src = URL.createObjectURL(file);
|
|
7827
|
+
});
|
|
7828
|
+
}
|
|
7829
|
+
return true;
|
|
7830
|
+
};
|
|
7831
|
+
const handleFileChange = async (file, files) => {
|
|
7832
|
+
if (file.status === "ready") {
|
|
7833
|
+
const blobUrl = URL.createObjectURL(file.raw);
|
|
7834
|
+
const newItem = {
|
|
7835
|
+
...file,
|
|
7836
|
+
rawFile: file.raw,
|
|
7837
|
+
blobUrl,
|
|
7838
|
+
// 保存 blob URL 用于裁剪
|
|
7839
|
+
url: blobUrl
|
|
7840
|
+
// 初始显示使用 blob URL
|
|
7841
|
+
};
|
|
7842
|
+
if (props.allowCrop) {
|
|
7843
|
+
ElMessageBox.confirm("\u662F\u5426\u9700\u8981\u88C1\u526A\u8BE5\u56FE\u7247\uFF1F", "\u63D0\u793A", {
|
|
7844
|
+
type: "info",
|
|
7845
|
+
confirmButtonText: "\u88C1\u526A",
|
|
7846
|
+
cancelButtonText: "\u76F4\u63A5\u4E0A\u4F20"
|
|
7847
|
+
}).then(() => {
|
|
7848
|
+
handleCropImage(newItem);
|
|
7849
|
+
}).catch(async () => {
|
|
7850
|
+
if (props.autoUpload && props.uploadApi) {
|
|
7851
|
+
try {
|
|
7852
|
+
const uploadedUrl = await uploadSingleFile(file.raw);
|
|
7853
|
+
newItem.serverUrl = uploadedUrl;
|
|
7854
|
+
newItem.url = uploadedUrl;
|
|
7855
|
+
ElMessage.success("\u56FE\u7247\u4E0A\u4F20\u6210\u529F");
|
|
7856
|
+
} catch (error) {
|
|
7857
|
+
ElMessage.error("\u56FE\u7247\u4E0A\u4F20\u5931\u8D25");
|
|
7858
|
+
console.error(error);
|
|
7859
|
+
return;
|
|
7860
|
+
}
|
|
7861
|
+
}
|
|
7862
|
+
previewList.value.push(newItem);
|
|
7863
|
+
syncModelValue();
|
|
7864
|
+
});
|
|
7865
|
+
} else {
|
|
7866
|
+
if (props.autoUpload && props.uploadApi) {
|
|
7867
|
+
try {
|
|
7868
|
+
const uploadedUrl = await uploadSingleFile(file.raw);
|
|
7869
|
+
newItem.serverUrl = uploadedUrl;
|
|
7870
|
+
newItem.url = uploadedUrl;
|
|
7871
|
+
ElMessage.success("\u56FE\u7247\u4E0A\u4F20\u6210\u529F");
|
|
7872
|
+
} catch (error) {
|
|
7873
|
+
ElMessage.error("\u56FE\u7247\u4E0A\u4F20\u5931\u8D25");
|
|
7874
|
+
console.error(error);
|
|
7875
|
+
return;
|
|
7876
|
+
}
|
|
7877
|
+
}
|
|
7878
|
+
previewList.value.push(newItem);
|
|
7879
|
+
syncModelValue();
|
|
7880
|
+
}
|
|
7881
|
+
}
|
|
7882
|
+
fileList.value = files;
|
|
7883
|
+
};
|
|
7884
|
+
const handleFileRemove = (file) => {
|
|
7885
|
+
previewList.value = previewList.value.filter((item) => item.uid !== file.uid);
|
|
7886
|
+
syncModelValue();
|
|
7887
|
+
};
|
|
7888
|
+
const handleCropImage = (item) => {
|
|
7889
|
+
console.log(item);
|
|
7890
|
+
if (!props.allowCrop) return;
|
|
7891
|
+
cropTargetItem.value = item;
|
|
7892
|
+
cropImageUrl.value = item.blobUrl || item.url || "";
|
|
7893
|
+
cropDialogVisible.value = true;
|
|
7894
|
+
nextTick(() => {
|
|
7895
|
+
cropForm.aspectRatio = "free";
|
|
7896
|
+
cropWidth.value = props.sizeLimit.width || 400;
|
|
7897
|
+
cropHeight.value = props.sizeLimit.height || 400;
|
|
7898
|
+
displayWidth.value = props.sizeLimit.width || 400;
|
|
7899
|
+
displayHeight.value = props.sizeLimit.height || 400;
|
|
7900
|
+
aspectRatio.fixed = false;
|
|
7901
|
+
});
|
|
7902
|
+
};
|
|
7903
|
+
const handleAspectRatioChange = (val) => {
|
|
7904
|
+
if (val === "free") {
|
|
7905
|
+
aspectRatio.fixed = false;
|
|
7906
|
+
} else {
|
|
7907
|
+
aspectRatio.fixed = true;
|
|
7908
|
+
const parts = val.split(":").map(Number);
|
|
7909
|
+
const w = parts[0] ?? 1;
|
|
7910
|
+
const h = parts[1] ?? 1;
|
|
7911
|
+
aspectRatio.value = [w, h];
|
|
7912
|
+
}
|
|
7913
|
+
};
|
|
7914
|
+
const handleCropRealTime = (data) => {
|
|
7915
|
+
if (data && data.w && data.h) {
|
|
7916
|
+
displayWidth.value = Math.round(data.w);
|
|
7917
|
+
displayHeight.value = Math.round(data.h);
|
|
7918
|
+
}
|
|
7919
|
+
};
|
|
7920
|
+
const handleSizeChange = () => {
|
|
7921
|
+
cropWidth.value = displayWidth.value;
|
|
7922
|
+
cropHeight.value = displayHeight.value;
|
|
7923
|
+
};
|
|
7924
|
+
const handleCropConfirm = () => {
|
|
7925
|
+
if (!cropperRef.value || !cropTargetItem.value) return;
|
|
7926
|
+
cropperRef.value.getCropBlob(async (blob) => {
|
|
7927
|
+
const croppedFile = new File([blob], cropTargetItem.value.name || "cropped.jpg", {
|
|
7928
|
+
type: cropTargetItem.value.rawFile?.type || "image/jpeg"
|
|
7929
|
+
});
|
|
7930
|
+
const newBlobUrl = URL.createObjectURL(croppedFile);
|
|
7931
|
+
let displayUrl = newBlobUrl;
|
|
7932
|
+
if (props.autoUpload && props.uploadApi) {
|
|
7933
|
+
try {
|
|
7934
|
+
const serverUrl = await uploadSingleFile(croppedFile);
|
|
7935
|
+
displayUrl = serverUrl;
|
|
7936
|
+
ElMessage.success("\u56FE\u7247\u4E0A\u4F20\u6210\u529F");
|
|
7937
|
+
const index = previewList.value.findIndex((item) => item.uid === cropTargetItem.value.uid);
|
|
7938
|
+
const targetItem = previewList.value[index];
|
|
7939
|
+
if (index > -1 && targetItem) {
|
|
7940
|
+
targetItem.url = displayUrl;
|
|
7941
|
+
targetItem.blobUrl = newBlobUrl;
|
|
7942
|
+
targetItem.serverUrl = serverUrl;
|
|
7943
|
+
targetItem.rawFile = croppedFile;
|
|
7944
|
+
} else {
|
|
7945
|
+
previewList.value.push({
|
|
7946
|
+
...cropTargetItem.value,
|
|
7947
|
+
name: cropTargetItem.value.name ?? "cropped.jpg",
|
|
7948
|
+
url: displayUrl,
|
|
7949
|
+
blobUrl: newBlobUrl,
|
|
7950
|
+
serverUrl,
|
|
7951
|
+
rawFile: croppedFile
|
|
7952
|
+
});
|
|
7953
|
+
}
|
|
7954
|
+
} catch (error) {
|
|
7955
|
+
ElMessage.error("\u56FE\u7247\u4E0A\u4F20\u5931\u8D25");
|
|
7956
|
+
console.error(error);
|
|
7957
|
+
return;
|
|
7958
|
+
}
|
|
7959
|
+
} else {
|
|
7960
|
+
const index = previewList.value.findIndex((item) => item.uid === cropTargetItem.value.uid);
|
|
7961
|
+
const targetItem = previewList.value[index];
|
|
7962
|
+
if (index > -1 && targetItem) {
|
|
7963
|
+
targetItem.url = newBlobUrl;
|
|
7964
|
+
targetItem.blobUrl = newBlobUrl;
|
|
7965
|
+
targetItem.rawFile = croppedFile;
|
|
7966
|
+
} else {
|
|
7967
|
+
previewList.value.push({
|
|
7968
|
+
...cropTargetItem.value,
|
|
7969
|
+
name: cropTargetItem.value.name ?? "cropped.jpg",
|
|
7970
|
+
url: newBlobUrl,
|
|
7971
|
+
blobUrl: newBlobUrl,
|
|
7972
|
+
rawFile: croppedFile
|
|
7973
|
+
});
|
|
7974
|
+
}
|
|
7975
|
+
}
|
|
7976
|
+
syncModelValue();
|
|
7977
|
+
cropDialogVisible.value = false;
|
|
7978
|
+
ElMessage.success("\u56FE\u7247\u88C1\u526A\u6210\u529F");
|
|
7979
|
+
});
|
|
7980
|
+
};
|
|
7981
|
+
const resetCropper = () => {
|
|
7982
|
+
cropTargetItem.value = void 0;
|
|
7983
|
+
cropImageUrl.value = "";
|
|
7984
|
+
};
|
|
7985
|
+
const handleRemovePreview = (item) => {
|
|
7986
|
+
ElMessageBox.confirm("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u56FE\u7247\u5417\uFF1F", "\u63D0\u793A", {
|
|
7987
|
+
type: "warning",
|
|
7988
|
+
confirmButtonText: "\u786E\u5B9A",
|
|
7989
|
+
cancelButtonText: "\u53D6\u6D88"
|
|
7990
|
+
}).then(() => {
|
|
7991
|
+
previewList.value = previewList.value.filter((i) => i.uid !== item.uid);
|
|
7992
|
+
fileList.value = fileList.value.filter((i) => i.uid !== item.uid);
|
|
7993
|
+
syncModelValue();
|
|
7994
|
+
ElMessage.success("\u56FE\u7247\u5220\u9664\u6210\u529F");
|
|
7995
|
+
});
|
|
7996
|
+
};
|
|
7997
|
+
const handleDragStart = (index) => {
|
|
7998
|
+
if (!props.allowSort) return;
|
|
7999
|
+
dragIndex.value = index;
|
|
8000
|
+
};
|
|
8001
|
+
const handleDragOver = (e) => {
|
|
8002
|
+
e.preventDefault();
|
|
8003
|
+
};
|
|
8004
|
+
const handleDrop = (index) => {
|
|
8005
|
+
if (!props.allowSort || dragIndex.value === -1 || dragIndex.value === index) return;
|
|
8006
|
+
const temp = previewList.value[dragIndex.value];
|
|
8007
|
+
if (!temp) return;
|
|
8008
|
+
previewList.value.splice(dragIndex.value, 1);
|
|
8009
|
+
previewList.value.splice(index, 0, temp);
|
|
8010
|
+
dragIndex.value = -1;
|
|
8011
|
+
syncModelValue();
|
|
8012
|
+
};
|
|
8013
|
+
const syncModelValue = () => {
|
|
8014
|
+
emit("update:modelValue", [...previewList.value]);
|
|
8015
|
+
emit("change", [...previewList.value]);
|
|
8016
|
+
};
|
|
8017
|
+
const emit = __emit;
|
|
8018
|
+
const uploadToServer = async (uploadApi) => {
|
|
8019
|
+
const uploadPromises = previewList.value.map(async (item) => {
|
|
8020
|
+
if (item.rawFile) {
|
|
8021
|
+
const url = await uploadApi(item.rawFile);
|
|
8022
|
+
item.url = url;
|
|
8023
|
+
return item;
|
|
8024
|
+
}
|
|
8025
|
+
return item;
|
|
8026
|
+
});
|
|
8027
|
+
const result = await Promise.all(uploadPromises);
|
|
8028
|
+
previewList.value = result;
|
|
8029
|
+
syncModelValue();
|
|
8030
|
+
return result;
|
|
8031
|
+
};
|
|
8032
|
+
__expose({
|
|
8033
|
+
uploadToServer,
|
|
8034
|
+
// 暴露上传到服务器的方法
|
|
8035
|
+
clear: () => {
|
|
8036
|
+
previewList.value = [];
|
|
8037
|
+
fileList.value = [];
|
|
8038
|
+
syncModelValue();
|
|
8039
|
+
}
|
|
8040
|
+
});
|
|
8041
|
+
return (_ctx, _cache) => {
|
|
8042
|
+
const _component_vue_cropper = resolveComponent("vue-cropper");
|
|
8043
|
+
const _component_el_option = resolveComponent("el-option");
|
|
8044
|
+
return openBlock(), createElementBlock(
|
|
8045
|
+
"div",
|
|
8046
|
+
{
|
|
8047
|
+
class: normalizeClass(unref(bem)("image-upload-pro"))
|
|
8048
|
+
},
|
|
8049
|
+
[
|
|
8050
|
+
createCommentVNode(" \u6838\u5FC3\u4E0A\u4F20\u533A\u57DF "),
|
|
8051
|
+
createVNode(unref(ElUpload), {
|
|
8052
|
+
ref_key: "uploadRef",
|
|
8053
|
+
ref: uploadRef,
|
|
8054
|
+
class: normalizeClass(unref(bem)("image-upload-pro", "upload-container")),
|
|
8055
|
+
action: "",
|
|
8056
|
+
"auto-upload": false,
|
|
8057
|
+
"file-list": fileList.value,
|
|
8058
|
+
"before-upload": handleBeforeUpload,
|
|
8059
|
+
"on-change": handleFileChange,
|
|
8060
|
+
"on-remove": handleFileRemove,
|
|
8061
|
+
accept: _ctx.acceptType,
|
|
8062
|
+
"show-file-list": false
|
|
8063
|
+
}, {
|
|
8064
|
+
tip: withCtx(() => [
|
|
8065
|
+
createElementVNode(
|
|
8066
|
+
"div",
|
|
8067
|
+
{
|
|
8068
|
+
class: normalizeClass(unref(bem)("image-upload-pro", "upload-text"))
|
|
8069
|
+
},
|
|
8070
|
+
[
|
|
8071
|
+
createTextVNode(
|
|
8072
|
+
" \u652F\u6301\u683C\u5F0F\uFF1A" + toDisplayString(acceptDesc.value) + " | \u5355\u6587\u4EF6\u5927\u5C0F\u2264" + toDisplayString(props.sizeLimit.size) + "MB ",
|
|
8073
|
+
1
|
|
8074
|
+
/* TEXT */
|
|
8075
|
+
),
|
|
8076
|
+
props.sizeLimit.width || props.sizeLimit.height ? (openBlock(), createElementBlock(
|
|
8077
|
+
"span",
|
|
8078
|
+
_hoisted_1,
|
|
8079
|
+
" | \u5C3A\u5BF8\u8981\u6C42\uFF1A\u5BBD\u2265" + toDisplayString(props.sizeLimit.width) + "px \u9AD8\u2265" + toDisplayString(props.sizeLimit.height) + "px ",
|
|
8080
|
+
1
|
|
8081
|
+
/* TEXT */
|
|
8082
|
+
)) : createCommentVNode("v-if", true)
|
|
8083
|
+
],
|
|
8084
|
+
2
|
|
8085
|
+
/* CLASS */
|
|
8086
|
+
)
|
|
8087
|
+
]),
|
|
8088
|
+
default: withCtx(() => [
|
|
8089
|
+
createVNode(unref(ElButton), {
|
|
8090
|
+
disabled: fileList.value.length === props.maxCount,
|
|
8091
|
+
type: "primary"
|
|
8092
|
+
}, {
|
|
8093
|
+
default: withCtx(() => [..._cache[6] || (_cache[6] = [
|
|
8094
|
+
createTextVNode(
|
|
8095
|
+
"\u9009\u62E9\u56FE\u7247",
|
|
8096
|
+
-1
|
|
8097
|
+
/* CACHED */
|
|
8098
|
+
)
|
|
8099
|
+
])]),
|
|
8100
|
+
_: 1
|
|
8101
|
+
/* STABLE */
|
|
8102
|
+
}, 8, ["disabled"])
|
|
8103
|
+
]),
|
|
8104
|
+
_: 1
|
|
8105
|
+
/* STABLE */
|
|
8106
|
+
}, 8, ["class", "file-list", "accept"]),
|
|
8107
|
+
createCommentVNode(" \u5DF2\u4E0A\u4F20\u56FE\u7247\u9884\u89C8\u5217\u8868 "),
|
|
8108
|
+
previewList.value.length ? (openBlock(), createElementBlock(
|
|
8109
|
+
"div",
|
|
8110
|
+
{
|
|
8111
|
+
key: 0,
|
|
8112
|
+
class: normalizeClass(unref(bem)("image-upload-pro", "preview-list"))
|
|
8113
|
+
},
|
|
8114
|
+
[
|
|
8115
|
+
(openBlock(true), createElementBlock(
|
|
8116
|
+
Fragment,
|
|
8117
|
+
null,
|
|
8118
|
+
renderList(previewList.value, (item, index) => {
|
|
8119
|
+
return openBlock(), createElementBlock("div", {
|
|
8120
|
+
class: normalizeClass([unref(bem)("image-upload-pro", "preview-item"), { active: item.isCover }]),
|
|
8121
|
+
key: item.uid,
|
|
8122
|
+
draggable: "true",
|
|
8123
|
+
onDragstart: ($event) => handleDragStart(index),
|
|
8124
|
+
onDragover: _cache[0] || (_cache[0] = ($event) => handleDragOver($event)),
|
|
8125
|
+
onDrop: ($event) => handleDrop(index)
|
|
8126
|
+
}, [
|
|
8127
|
+
createCommentVNode(" \u56FE\u7247\u9884\u89C8 "),
|
|
8128
|
+
createElementVNode(
|
|
8129
|
+
"div",
|
|
8130
|
+
{
|
|
8131
|
+
class: normalizeClass(unref(bem)("image-upload-pro", "preview-img"))
|
|
8132
|
+
},
|
|
8133
|
+
[
|
|
8134
|
+
createVNode(unref(ElImage), {
|
|
8135
|
+
src: item.url,
|
|
8136
|
+
"preview-src-list": previewList.value.filter((i) => i.url).map((i) => i.url),
|
|
8137
|
+
"preview-current-index": index,
|
|
8138
|
+
fit: "cover"
|
|
8139
|
+
}, null, 8, ["src", "preview-src-list", "preview-current-index"])
|
|
8140
|
+
],
|
|
8141
|
+
2
|
|
8142
|
+
/* CLASS */
|
|
8143
|
+
),
|
|
8144
|
+
createCommentVNode(" \u64CD\u4F5C\u6309\u94AE\u7EC4 "),
|
|
8145
|
+
createElementVNode(
|
|
8146
|
+
"div",
|
|
8147
|
+
{
|
|
8148
|
+
class: normalizeClass(unref(bem)("image-upload-pro", "preview-actions"))
|
|
8149
|
+
},
|
|
8150
|
+
[
|
|
8151
|
+
createVNode(unref(ElButton), {
|
|
8152
|
+
type: "primary",
|
|
8153
|
+
text: "",
|
|
8154
|
+
size: "small",
|
|
8155
|
+
onClick: ($event) => handleCropImage(item)
|
|
8156
|
+
}, {
|
|
8157
|
+
default: withCtx(() => [..._cache[7] || (_cache[7] = [
|
|
8158
|
+
createTextVNode(
|
|
8159
|
+
"\u88C1\u526A",
|
|
8160
|
+
-1
|
|
8161
|
+
/* CACHED */
|
|
8162
|
+
)
|
|
8163
|
+
])]),
|
|
8164
|
+
_: 1
|
|
8165
|
+
/* STABLE */
|
|
8166
|
+
}, 8, ["onClick"]),
|
|
8167
|
+
createVNode(unref(ElButton), {
|
|
8168
|
+
text: "",
|
|
8169
|
+
size: "small",
|
|
8170
|
+
type: "danger",
|
|
8171
|
+
onClick: ($event) => handleRemovePreview(item)
|
|
8172
|
+
}, {
|
|
8173
|
+
default: withCtx(() => [..._cache[8] || (_cache[8] = [
|
|
8174
|
+
createTextVNode(
|
|
8175
|
+
"\u5220\u9664",
|
|
8176
|
+
-1
|
|
8177
|
+
/* CACHED */
|
|
8178
|
+
)
|
|
8179
|
+
])]),
|
|
8180
|
+
_: 1
|
|
8181
|
+
/* STABLE */
|
|
8182
|
+
}, 8, ["onClick"])
|
|
8183
|
+
],
|
|
8184
|
+
2
|
|
8185
|
+
/* CLASS */
|
|
8186
|
+
)
|
|
8187
|
+
], 42, _hoisted_2);
|
|
8188
|
+
}),
|
|
8189
|
+
128
|
|
8190
|
+
/* KEYED_FRAGMENT */
|
|
8191
|
+
))
|
|
8192
|
+
],
|
|
8193
|
+
2
|
|
8194
|
+
/* CLASS */
|
|
8195
|
+
)) : createCommentVNode("v-if", true),
|
|
8196
|
+
createCommentVNode(" \u88C1\u526A\u5F39\u7A97 "),
|
|
8197
|
+
createVNode(unref(ElDialog), {
|
|
8198
|
+
modelValue: cropDialogVisible.value,
|
|
8199
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => cropDialogVisible.value = $event),
|
|
8200
|
+
title: "\u56FE\u7247\u88C1\u526A",
|
|
8201
|
+
width: "900px",
|
|
8202
|
+
"close-on-click-modal": false,
|
|
8203
|
+
"destroy-on-close": "",
|
|
8204
|
+
onClose: resetCropper
|
|
8205
|
+
}, {
|
|
8206
|
+
footer: withCtx(() => [
|
|
8207
|
+
createVNode(unref(ElButton), {
|
|
8208
|
+
onClick: _cache[4] || (_cache[4] = ($event) => cropDialogVisible.value = false)
|
|
8209
|
+
}, {
|
|
8210
|
+
default: withCtx(() => [..._cache[10] || (_cache[10] = [
|
|
8211
|
+
createTextVNode(
|
|
8212
|
+
"\u53D6\u6D88",
|
|
8213
|
+
-1
|
|
8214
|
+
/* CACHED */
|
|
8215
|
+
)
|
|
8216
|
+
])]),
|
|
8217
|
+
_: 1
|
|
8218
|
+
/* STABLE */
|
|
8219
|
+
}),
|
|
8220
|
+
createVNode(unref(ElButton), {
|
|
8221
|
+
type: "primary",
|
|
8222
|
+
onClick: handleCropConfirm
|
|
8223
|
+
}, {
|
|
8224
|
+
default: withCtx(() => [..._cache[11] || (_cache[11] = [
|
|
8225
|
+
createTextVNode(
|
|
8226
|
+
"\u786E\u8BA4\u88C1\u526A",
|
|
8227
|
+
-1
|
|
8228
|
+
/* CACHED */
|
|
8229
|
+
)
|
|
8230
|
+
])]),
|
|
8231
|
+
_: 1
|
|
8232
|
+
/* STABLE */
|
|
8233
|
+
})
|
|
8234
|
+
]),
|
|
8235
|
+
default: withCtx(() => [
|
|
8236
|
+
createElementVNode(
|
|
8237
|
+
"div",
|
|
8238
|
+
{
|
|
8239
|
+
class: normalizeClass(unref(bem)("image-upload-pro", "cropper-container"))
|
|
8240
|
+
},
|
|
8241
|
+
[
|
|
8242
|
+
createCommentVNode(" \u88C1\u526A\u533A\u57DF "),
|
|
8243
|
+
createVNode(_component_vue_cropper, {
|
|
8244
|
+
ref_key: "cropperRef",
|
|
8245
|
+
ref: cropperRef,
|
|
8246
|
+
img: cropImageUrl.value,
|
|
8247
|
+
info: true,
|
|
8248
|
+
"auto-crop": true,
|
|
8249
|
+
"auto-crop-width": cropWidth.value,
|
|
8250
|
+
"auto-crop-height": cropHeight.value,
|
|
8251
|
+
fixed: aspectRatio.fixed,
|
|
8252
|
+
"fixed-number": aspectRatio.value,
|
|
8253
|
+
"can-move": true,
|
|
8254
|
+
"can-scale": true,
|
|
8255
|
+
"can-rotate": false,
|
|
8256
|
+
onRealTime: handleCropRealTime
|
|
8257
|
+
}, null, 8, ["img", "auto-crop-width", "auto-crop-height", "fixed", "fixed-number"])
|
|
8258
|
+
],
|
|
8259
|
+
2
|
|
8260
|
+
/* CLASS */
|
|
8261
|
+
),
|
|
8262
|
+
createElementVNode(
|
|
8263
|
+
"div",
|
|
8264
|
+
{
|
|
8265
|
+
class: normalizeClass(unref(bem)("image-upload-pro", "cropper-config"))
|
|
8266
|
+
},
|
|
8267
|
+
[
|
|
8268
|
+
createVNode(unref(ElForm), { model: cropForm }, {
|
|
8269
|
+
default: withCtx(() => [
|
|
8270
|
+
createVNode(unref(ElRow), { gutter: 10 }, {
|
|
8271
|
+
default: withCtx(() => [
|
|
8272
|
+
createVNode(unref(ElCol), { span: 8 }, {
|
|
8273
|
+
default: withCtx(() => [
|
|
8274
|
+
createVNode(unref(ElFormItem), { label: "\u88C1\u526A\u6BD4\u4F8B" }, {
|
|
8275
|
+
default: withCtx(() => [
|
|
8276
|
+
createVNode(unref(ElSelect), {
|
|
8277
|
+
style: { "width": "100%" },
|
|
8278
|
+
modelValue: cropForm.aspectRatio,
|
|
8279
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => cropForm.aspectRatio = $event),
|
|
8280
|
+
onChange: handleAspectRatioChange
|
|
8281
|
+
}, {
|
|
8282
|
+
default: withCtx(() => [
|
|
8283
|
+
(openBlock(), createElementBlock(
|
|
8284
|
+
Fragment,
|
|
8285
|
+
null,
|
|
8286
|
+
renderList(ASPECT_RATIO_OPTIONS, (option) => {
|
|
8287
|
+
return createVNode(_component_el_option, {
|
|
8288
|
+
key: option.value,
|
|
8289
|
+
label: option.label,
|
|
8290
|
+
value: option.value
|
|
8291
|
+
}, null, 8, ["label", "value"]);
|
|
8292
|
+
}),
|
|
8293
|
+
64
|
|
8294
|
+
/* STABLE_FRAGMENT */
|
|
8295
|
+
))
|
|
8296
|
+
]),
|
|
8297
|
+
_: 1
|
|
8298
|
+
/* STABLE */
|
|
8299
|
+
}, 8, ["modelValue"])
|
|
8300
|
+
]),
|
|
8301
|
+
_: 1
|
|
8302
|
+
/* STABLE */
|
|
8303
|
+
})
|
|
8304
|
+
]),
|
|
8305
|
+
_: 1
|
|
8306
|
+
/* STABLE */
|
|
8307
|
+
}),
|
|
8308
|
+
createVNode(unref(ElCol), { span: 16 }, {
|
|
8309
|
+
default: withCtx(() => [
|
|
8310
|
+
createVNode(unref(ElFormItem), { label: "\u88C1\u526A\u5C3A\u5BF8" }, {
|
|
8311
|
+
default: withCtx(() => [
|
|
8312
|
+
createVNode(unref(ElInputNumber), {
|
|
8313
|
+
modelValue: displayWidth.value,
|
|
8314
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => displayWidth.value = $event),
|
|
8315
|
+
placeholder: "\u5BBD\u5EA6",
|
|
8316
|
+
min: props.sizeLimit.width || 100,
|
|
8317
|
+
onChange: handleSizeChange
|
|
8318
|
+
}, null, 8, ["modelValue", "min"]),
|
|
8319
|
+
_cache[9] || (_cache[9] = createElementVNode(
|
|
8320
|
+
"span",
|
|
8321
|
+
{ style: { "margin": "0 8px" } },
|
|
8322
|
+
"*",
|
|
8323
|
+
-1
|
|
8324
|
+
/* CACHED */
|
|
8325
|
+
)),
|
|
8326
|
+
createVNode(unref(ElInputNumber), {
|
|
8327
|
+
modelValue: displayHeight.value,
|
|
8328
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => displayHeight.value = $event),
|
|
8329
|
+
placeholder: "\u9AD8\u5EA6",
|
|
8330
|
+
min: props.sizeLimit.height || 100,
|
|
8331
|
+
onChange: handleSizeChange
|
|
8332
|
+
}, null, 8, ["modelValue", "min"])
|
|
8333
|
+
]),
|
|
8334
|
+
_: 1
|
|
8335
|
+
/* STABLE */
|
|
8336
|
+
})
|
|
8337
|
+
]),
|
|
8338
|
+
_: 1
|
|
8339
|
+
/* STABLE */
|
|
8340
|
+
})
|
|
8341
|
+
]),
|
|
8342
|
+
_: 1
|
|
8343
|
+
/* STABLE */
|
|
8344
|
+
})
|
|
8345
|
+
]),
|
|
8346
|
+
_: 1
|
|
8347
|
+
/* STABLE */
|
|
8348
|
+
}, 8, ["model"])
|
|
8349
|
+
],
|
|
8350
|
+
2
|
|
8351
|
+
/* CLASS */
|
|
8352
|
+
)
|
|
8353
|
+
]),
|
|
8354
|
+
_: 1
|
|
8355
|
+
/* STABLE */
|
|
8356
|
+
}, 8, ["modelValue"])
|
|
8357
|
+
],
|
|
8358
|
+
2
|
|
8359
|
+
/* CLASS */
|
|
8360
|
+
);
|
|
8361
|
+
};
|
|
8362
|
+
}
|
|
8363
|
+
});
|
|
8364
|
+
|
|
8365
|
+
const MlImageUploadPro = withInstall(_sfc_main);
|
|
7018
8366
|
|
|
7019
8367
|
var components = /*#__PURE__*/Object.freeze({
|
|
7020
8368
|
__proto__: null,
|
|
7021
8369
|
MlButton: MlButton,
|
|
7022
8370
|
MlChart: MlChart,
|
|
7023
8371
|
MlDetail: MlDetail,
|
|
8372
|
+
MlImageUploadPro: MlImageUploadPro,
|
|
7024
8373
|
MlNumberRangeInput: MlNumberRangeInput,
|
|
7025
8374
|
MlSearch: MlSearch,
|
|
7026
8375
|
MlSearchTable: MlSearchTable,
|
|
7027
|
-
|
|
8376
|
+
MlTreeSelect: MlTreeSelect,
|
|
8377
|
+
MlTreeSelectDialog: MlTreeSelectDialog,
|
|
8378
|
+
MlTreeSelectDrawer: MlTreeSelectDrawer,
|
|
8379
|
+
MlVirtualList: MlVirtualList,
|
|
8380
|
+
dialogPropKeys: dialogPropKeys,
|
|
8381
|
+
drawerPropKeys: drawerPropKeys,
|
|
8382
|
+
imageUploadProProps: imageUploadProProps
|
|
7028
8383
|
});
|
|
7029
8384
|
|
|
7030
8385
|
const MsUIComponentsInstance = Object.values(components);
|
|
@@ -7038,4 +8393,4 @@ var index = {
|
|
|
7038
8393
|
}
|
|
7039
8394
|
};
|
|
7040
8395
|
|
|
7041
|
-
export { MlButton, MlChart, MlDetail, MlNumberRangeInput, MlSearch, MlSearchTable, MlVirtualList, MsUIComponentsInstance, MsUIComponentsName, index as default };
|
|
8396
|
+
export { MlButton, MlChart, MlDetail, MlImageUploadPro, MlNumberRangeInput, MlSearch, MlSearchTable, MlTreeSelect, MlTreeSelectDialog, MlTreeSelectDrawer, MlVirtualList, MsUIComponentsInstance, MsUIComponentsName, index as default, dialogPropKeys, drawerPropKeys, imageUploadProProps };
|