@10yun/cv-pc-ui 0.4.7 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cv-ui.cjs +2 -2
- package/lib/cv-ui.js +21 -25
- package/package.json +2 -2
- package/src/utils/value.js +11 -1
package/lib/cv-ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! cvPcUI v0.4.
|
|
1
|
+
/*! cvPcUI v0.4.9 */
|
|
2
2
|
import { ClickOutside as e, ElAutocomplete as t, ElAvatar as n, ElBadge as r, ElButton as i, ElButton as a, ElCascader as o, ElCheckbox as s, ElCheckboxButton as c, ElCheckboxGroup as l, ElDatePicker as u, ElDialog as d, ElDrawer as f, ElForm as p, ElFormItem as m, ElIcon as ee, ElImage as te, ElInput as ne, ElInput as h, ElInputNumber as re, ElMessage as ie, ElMessage as g, ElMessageBox as ae, ElMessageBox as oe, ElOption as se, ElPagination as ce, ElPopover as le, ElScrollbar as ue, ElSelect as de, ElSwitch as fe, ElTable as pe, ElTableColumn as _, ElTag as me, ElTimePicker as he } from "element-plus";
|
|
3
3
|
import { Fragment as v, Transition as ge, TransitionGroup as _e, computed as ve, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createSlots as ye, createTextVNode as C, createVNode as w, defineComponent as be, getCurrentInstance as xe, getCurrentScope as Se, guardReactiveProps as T, h as Ce, inject as we, markRaw as Te, mergeProps as E, nextTick as Ee, normalizeClass as D, normalizeProps as O, normalizeStyle as k, onBeforeUnmount as De, onMounted as Oe, onScopeDispose as ke, onUnmounted as Ae, openBlock as A, provide as je, reactive as Me, ref as j, render as Ne, renderList as M, renderSlot as N, resolveComponent as P, resolveDirective as Pe, resolveDynamicComponent as Fe, shallowReadonly as Ie, shallowRef as Le, toDisplayString as F, toHandlers as Re, toRaw as ze, toRefs as Be, toValue as Ve, unref as I, useCssVars as He, useSlots as Ue, vModelText as We, vShow as L, watch as Ge, withCtx as R, withDirectives as z, withKeys as Ke, withModifiers as qe } from "vue";
|
|
4
4
|
import { basicSetup as Je } from "codemirror";
|
|
@@ -4404,11 +4404,11 @@ function Na(e) {
|
|
|
4404
4404
|
}
|
|
4405
4405
|
function Pa(e, t) {
|
|
4406
4406
|
let n = [];
|
|
4407
|
-
Array.isArray(e) && e.length > 0 && n.push(...e), Array.isArray(t) && t.length > 0 && n.push(...t), typeof t == "string" && n.push(t);
|
|
4407
|
+
Array.isArray(e) && e.length > 0 && n.push(...e), Array.isArray(t) && t.length > 0 && n.push(...t), (typeof t == "string" || typeof t == "number") && n.push(t);
|
|
4408
4408
|
let r = [];
|
|
4409
4409
|
for (let e in n) {
|
|
4410
4410
|
let t = n[e], i = Object.prototype.toString.call(t);
|
|
4411
|
-
i === "[object String]" ? r.push(t) : i === "[object Object]" && t.url && r.push(t.url);
|
|
4411
|
+
i === "[object String]" ? r.push(t) : i === "[object Number]" ? r.push(String(t)) : i === "[object Object]" && t.url && r.push(t.url);
|
|
4412
4412
|
}
|
|
4413
4413
|
return r;
|
|
4414
4414
|
}
|
|
@@ -14886,22 +14886,17 @@ var yg = class {
|
|
|
14886
14886
|
onClick: e.clickFn
|
|
14887
14887
|
}, e.text)));
|
|
14888
14888
|
let a = function(t) {
|
|
14889
|
-
e.close();
|
|
14890
|
-
}
|
|
14889
|
+
t || e.close();
|
|
14890
|
+
};
|
|
14891
14891
|
return w(d, {
|
|
14892
14892
|
...e.boxProps.value,
|
|
14893
14893
|
modelValue: e.boxShow.value,
|
|
14894
14894
|
beforeClose: (t) => {
|
|
14895
|
-
e.boxOptions.closeIsConfirm ? ae.confirm("确认关闭?", "提示").then((e) => {
|
|
14896
|
-
o(a);
|
|
14897
|
-
}).catch((e) => {
|
|
14895
|
+
typeof e.boxOptions.beforeClose == "function" ? e.boxOptions.beforeClose(a) : e.boxOptions.closeIsConfirm ? ae.confirm("确认关闭?", "提示").then((e) => {
|
|
14898
14896
|
a();
|
|
14899
|
-
}) :
|
|
14900
|
-
},
|
|
14901
|
-
onClosed2(t) {
|
|
14902
|
-
e.close();
|
|
14897
|
+
}).catch((e) => {}) : a();
|
|
14903
14898
|
},
|
|
14904
|
-
onClosed: e.
|
|
14899
|
+
onClosed: () => e._destroyVm()
|
|
14905
14900
|
}, { default: () => t });
|
|
14906
14901
|
}
|
|
14907
14902
|
};
|
|
@@ -14912,7 +14907,10 @@ var yg = class {
|
|
|
14912
14907
|
r.appContext = this.WinVue._context, Ne(r, this.vmTargetElement), this.vmApp = r;
|
|
14913
14908
|
}
|
|
14914
14909
|
close() {
|
|
14915
|
-
this.boxShow
|
|
14910
|
+
this.boxShow.value ? this.boxShow.value = !1 : this._destroyVm();
|
|
14911
|
+
}
|
|
14912
|
+
_destroyVm() {
|
|
14913
|
+
this.vmApp && this.vmTargetElement && (Ne(null, this.vmTargetElement), document.body.removeChild(this.vmTargetElement), this.vmApp = null);
|
|
14916
14914
|
}
|
|
14917
14915
|
show() {
|
|
14918
14916
|
this.boxShow.value = !0;
|
|
@@ -14998,22 +14996,17 @@ var xg = class {
|
|
|
14998
14996
|
onClick: e.clickFn
|
|
14999
14997
|
}, e.text)));
|
|
15000
14998
|
let a = function(t) {
|
|
15001
|
-
e.close();
|
|
15002
|
-
}
|
|
14999
|
+
t || e.close();
|
|
15000
|
+
};
|
|
15003
15001
|
return w(f, {
|
|
15004
15002
|
...e.boxProps.value,
|
|
15005
15003
|
modelValue: e.boxShow.value,
|
|
15006
15004
|
beforeClose: (t) => {
|
|
15007
|
-
e.boxOptions.closeIsConfirm ? ae.confirm("确认关闭?", "提示").then((e) => {
|
|
15008
|
-
o(a);
|
|
15009
|
-
}).catch((e) => {
|
|
15005
|
+
typeof e.boxOptions.beforeClose == "function" ? e.boxOptions.beforeClose(a) : e.boxOptions.closeIsConfirm ? ae.confirm("确认关闭?", "提示").then((e) => {
|
|
15010
15006
|
a();
|
|
15011
|
-
}) :
|
|
15012
|
-
},
|
|
15013
|
-
onClosed2(e) {
|
|
15014
|
-
this.clearVm();
|
|
15007
|
+
}).catch((e) => {}) : a();
|
|
15015
15008
|
},
|
|
15016
|
-
onClosed:
|
|
15009
|
+
onClosed: () => e._destroyVm()
|
|
15017
15010
|
}, { default: () => t });
|
|
15018
15011
|
}
|
|
15019
15012
|
};
|
|
@@ -15024,7 +15017,10 @@ var xg = class {
|
|
|
15024
15017
|
r.appContext = this.WinVue._context, Ne(r, this.vmTargetElement), this.vmApp = r;
|
|
15025
15018
|
}
|
|
15026
15019
|
close() {
|
|
15027
|
-
this.boxShow.value = !1
|
|
15020
|
+
this.boxShow.value ? this.boxShow.value = !1 : this._destroyVm();
|
|
15021
|
+
}
|
|
15022
|
+
_destroyVm() {
|
|
15023
|
+
this.vmApp &&= (Ne(null, this.vmTargetElement), null);
|
|
15028
15024
|
}
|
|
15029
15025
|
show() {
|
|
15030
15026
|
this.boxShow.value = !0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@10yun/cv-pc-ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "cvjs-pc-ui组件",
|
|
6
6
|
"homepage": "http://cvjs.cn/cv-pc-ui",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@vitejs/plugin-vue": "^6.0.10",
|
|
85
85
|
"rollup-plugin-visualizer": "^7.1.1",
|
|
86
86
|
"vite": "8.3.5",
|
|
87
|
-
"vue-tsc": "^3.3.
|
|
87
|
+
"vue-tsc": "^3.3.14"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
90
|
"element-plus": "^2"
|
package/src/utils/value.js
CHANGED
|
@@ -12,6 +12,14 @@ export function content_to_value(valDef) {
|
|
|
12
12
|
return [];
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* 值归并:把「已有列表」与「本次新增」合成一维的值数组(ID 或 url)
|
|
17
|
+
* ⚠️ 数字 ID 必须收下:后端 filelog_id 是整型,而多值字段的 modelValue 全靠这里重算
|
|
18
|
+
* (删除走 updateValue(null, null) → array_to_value(localValue, null)),
|
|
19
|
+
* 原来只认 [object String] 会把整列数字 ID 静默丢光 → 抛出的逗号串变成 '' →
|
|
20
|
+
* 表现为「多值时删一张,值全部清空」;连续上传第二张也会丢(array2 只判 string)
|
|
21
|
+
* 统一转字符串输出,与 content_to_value 的 number 分支口径保持一致
|
|
22
|
+
*/
|
|
15
23
|
export function array_to_value(array1, array2) {
|
|
16
24
|
let newArr = [];
|
|
17
25
|
if (Array.isArray(array1) && array1.length > 0) {
|
|
@@ -20,7 +28,7 @@ export function array_to_value(array1, array2) {
|
|
|
20
28
|
if (Array.isArray(array2) && array2.length > 0) {
|
|
21
29
|
newArr.push(...array2);
|
|
22
30
|
}
|
|
23
|
-
if (typeof array2 == 'string') {
|
|
31
|
+
if (typeof array2 == 'string' || typeof array2 == 'number') {
|
|
24
32
|
newArr.push(array2);
|
|
25
33
|
}
|
|
26
34
|
let lastArr = [];
|
|
@@ -29,6 +37,8 @@ export function array_to_value(array1, array2) {
|
|
|
29
37
|
let newType = Object.prototype.toString.call(newItem);
|
|
30
38
|
if (newType === '[object String]') {
|
|
31
39
|
lastArr.push(newItem);
|
|
40
|
+
} else if (newType === '[object Number]') {
|
|
41
|
+
lastArr.push(String(newItem));
|
|
32
42
|
} else if (newType === '[object Object]') {
|
|
33
43
|
if (newItem.url) {
|
|
34
44
|
lastArr.push(newItem.url);
|