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