bm-admin-ui 1.0.38-alpha → 1.0.40-alpha
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/es/components/__tests__/util/domHook.d.ts +6 -0
- package/es/components/feedback/index.js +2 -2
- package/es/components/float-table/index.js +36 -27
- package/es/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +4 -4
- package/es/components/form-create/index.js +215 -107
- package/es/components/form-designer/index.js +86 -47
- package/es/components/input-tags-display/index.js +30 -13
- package/es/components/input-tags-display/src/input-tags-display.vue.d.ts +9 -0
- package/es/components/over-tooltips/index.js +27 -20
- package/es/components/search-filter/index.js +18 -10
- package/es/components/select-all/index.js +17 -9
- package/es/components/shops-filter/index.js +19 -13
- package/es/components/staffs-selector/index.js +116 -82
- package/es/components/timeline/__tests__/index.test.d.ts +1 -0
- package/es/components/timeline/index.js +8 -7
- package/es/components/upload/__tests__/mock.d.ts +2 -0
- package/es/components/upload/__tests__/requests.d.ts +7 -0
- package/es/components/upload/__tests__/upload.test.d.ts +1 -0
- package/es/components/upload/index.js +115 -78
- package/index.esm.js +41000 -4676
- package/index.js +40999 -4675
- package/lib/components/__tests__/util/domHook.d.ts +6 -0
- package/lib/components/feedback/index.js +1 -1
- package/lib/components/float-table/index.js +36 -27
- package/lib/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +4 -4
- package/lib/components/form-create/index.js +214 -106
- package/lib/components/form-designer/index.js +86 -47
- package/lib/components/input-tags-display/index.js +30 -13
- package/lib/components/input-tags-display/src/input-tags-display.vue.d.ts +9 -0
- package/lib/components/over-tooltips/index.js +27 -20
- package/lib/components/search-filter/index.js +18 -10
- package/lib/components/select-all/index.js +17 -9
- package/lib/components/shops-filter/index.js +19 -13
- package/lib/components/staffs-selector/index.js +116 -82
- package/lib/components/timeline/__tests__/index.test.d.ts +1 -0
- package/lib/components/timeline/index.js +8 -7
- package/lib/components/upload/__tests__/mock.d.ts +2 -0
- package/lib/components/upload/__tests__/requests.d.ts +7 -0
- package/lib/components/upload/__tests__/upload.test.d.ts +1 -0
- package/lib/components/upload/index.js +115 -78
- package/package.json +1 -1
- package/theme-chalk/button.css +1 -1
- package/theme-chalk/feedback.css +1 -1
- package/theme-chalk/float-table.css +1 -1
- package/theme-chalk/floating-vue.css +1 -1
- package/theme-chalk/flow-designer.css +1 -1
- package/theme-chalk/form-create.css +1 -1
- package/theme-chalk/form-designer.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/input-tags-display.css +1 -1
- package/theme-chalk/modal.css +1 -1
- package/theme-chalk/over-tooltips.css +1 -1
- package/theme-chalk/search-filter.css +1 -1
- package/theme-chalk/select-all.css +1 -1
- package/theme-chalk/staffs-selector.css +1 -1
- package/theme-chalk/timeline.css +1 -1
- package/theme-chalk/upload.css +1 -1
- package/types/components/__tests__/util/domHook.d.ts +6 -0
- package/types/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +4 -4
- package/types/components/input-tags-display/src/input-tags-display.vue.d.ts +9 -0
- package/types/components/timeline/__tests__/index.test.d.ts +1 -0
- package/types/components/upload/__tests__/mock.d.ts +2 -0
- package/types/components/upload/__tests__/requests.d.ts +7 -0
- package/types/components/upload/__tests__/upload.test.d.ts +1 -0
|
@@ -129,39 +129,50 @@ const _sfc_main$3 = vue.defineComponent({
|
|
|
129
129
|
return data ? data.title : "\u672A\u77E5";
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
vue.watch(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
state.isFulfill = true;
|
|
139
|
-
else
|
|
140
|
-
state.isFulfill = false;
|
|
141
|
-
methods.setState();
|
|
142
|
-
emit("update:selected", list);
|
|
143
|
-
}, { deep: true });
|
|
144
|
-
vue.watch(() => state.departmentChecked, () => {
|
|
145
|
-
let flatMap = props.dataMap;
|
|
146
|
-
let curlistKeys = props.curlistKeys;
|
|
147
|
-
let hadselected = new Set(props.selected);
|
|
148
|
-
let curselect = new Set(state.departmentChecked);
|
|
149
|
-
for (let key of hadselected) {
|
|
150
|
-
if (curlistKeys.has(key) && (!curselect.has(key) || curselect.has(key) && curselect.has(flatMap.get(key)["parent"]))) {
|
|
151
|
-
hadselected.delete(key);
|
|
132
|
+
vue.watch(
|
|
133
|
+
() => state.listChecked,
|
|
134
|
+
() => {
|
|
135
|
+
let list = [];
|
|
136
|
+
for (let [key, value] of Object.entries(state.listChecked)) {
|
|
137
|
+
value && list.push(key);
|
|
152
138
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
139
|
+
if (props.limit > 0 && list.length >= props.limit)
|
|
140
|
+
state.isFulfill = true;
|
|
141
|
+
else
|
|
142
|
+
state.isFulfill = false;
|
|
143
|
+
methods.setState();
|
|
144
|
+
emit("update:selected", list);
|
|
145
|
+
},
|
|
146
|
+
{ deep: true }
|
|
147
|
+
);
|
|
148
|
+
vue.watch(
|
|
149
|
+
() => state.departmentChecked,
|
|
150
|
+
() => {
|
|
151
|
+
let flatMap = props.dataMap;
|
|
152
|
+
let curlistKeys = props.curlistKeys;
|
|
153
|
+
let hadselected = new Set(props.selected);
|
|
154
|
+
let curselect = new Set(state.departmentChecked);
|
|
155
|
+
for (let key of hadselected) {
|
|
156
|
+
if (curlistKeys.has(key) && (!curselect.has(key) || curselect.has(key) && curselect.has(flatMap.get(key)["parent"]))) {
|
|
157
|
+
hadselected.delete(key);
|
|
158
|
+
}
|
|
158
159
|
}
|
|
160
|
+
for (let key of curselect) {
|
|
161
|
+
let obj = flatMap.get(key);
|
|
162
|
+
if (obj && !curselect.has(obj["parent"])) {
|
|
163
|
+
hadselected.add(key);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
emit("update:selected", Array.from(hadselected));
|
|
167
|
+
},
|
|
168
|
+
{ deep: true }
|
|
169
|
+
);
|
|
170
|
+
vue.watch(
|
|
171
|
+
() => props.list,
|
|
172
|
+
() => {
|
|
173
|
+
!props.isTree && methods.setState();
|
|
159
174
|
}
|
|
160
|
-
|
|
161
|
-
}, { deep: true });
|
|
162
|
-
vue.watch(() => props.list, () => {
|
|
163
|
-
!props.isTree && methods.setState();
|
|
164
|
-
});
|
|
175
|
+
);
|
|
165
176
|
vue.onMounted(() => {
|
|
166
177
|
let list = props.selected;
|
|
167
178
|
list && list.forEach((key) => {
|
|
@@ -497,57 +508,73 @@ const _sfc_main$1 = vue.defineComponent({
|
|
|
497
508
|
return data ? data.title : "\u672A\u77E5";
|
|
498
509
|
}
|
|
499
510
|
};
|
|
500
|
-
vue.watch(
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
511
|
+
vue.watch(
|
|
512
|
+
() => departmentChecked,
|
|
513
|
+
() => {
|
|
514
|
+
let flatMap = props.dataMap;
|
|
515
|
+
let curlistKeys = props.curlistKeys;
|
|
516
|
+
let hadselected = new Set(props.selected);
|
|
517
|
+
let curselect = new Set(departmentChecked.value);
|
|
518
|
+
for (let key of hadselected) {
|
|
519
|
+
if (curlistKeys.has(key) && (!curselect.has(key) || curselect.has(key) && curselect.has(flatMap.get(key)["parent"]))) {
|
|
520
|
+
hadselected.delete(key);
|
|
521
|
+
}
|
|
508
522
|
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
523
|
+
for (let key of curselect) {
|
|
524
|
+
let obj = flatMap.get(key);
|
|
525
|
+
if (obj && !curselect.has(obj["parent"])) {
|
|
526
|
+
hadselected.add(key);
|
|
527
|
+
}
|
|
514
528
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
529
|
+
emit("update:selected", Array.from(hadselected));
|
|
530
|
+
},
|
|
531
|
+
{ deep: true }
|
|
532
|
+
);
|
|
533
|
+
vue.watch(
|
|
534
|
+
() => staffsChecked,
|
|
535
|
+
() => {
|
|
536
|
+
let set = new Set(props.selected.length ? props.selected : null);
|
|
537
|
+
for (let [key, value] of Object.entries(staffsChecked.value)) {
|
|
538
|
+
if (value) {
|
|
539
|
+
set.add(key);
|
|
540
|
+
} else {
|
|
541
|
+
set.has(key) && set.delete(key);
|
|
542
|
+
}
|
|
525
543
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
544
|
+
emit("update:selected", Array.from(set));
|
|
545
|
+
},
|
|
546
|
+
{ deep: true }
|
|
547
|
+
);
|
|
548
|
+
vue.watch(
|
|
549
|
+
() => shopChecked,
|
|
550
|
+
() => {
|
|
551
|
+
let set = new Set(props.selected.length ? props.selected : null);
|
|
552
|
+
for (let [key, value] of Object.entries(shopChecked.value)) {
|
|
553
|
+
if (value) {
|
|
554
|
+
set.add(key);
|
|
555
|
+
} else {
|
|
556
|
+
set.has(key) && set.delete(key);
|
|
557
|
+
}
|
|
536
558
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
559
|
+
emit("update:selected", Array.from(set));
|
|
560
|
+
},
|
|
561
|
+
{ deep: true }
|
|
562
|
+
);
|
|
563
|
+
vue.watch(
|
|
564
|
+
() => groupChecked,
|
|
565
|
+
() => {
|
|
566
|
+
let set = new Set(props.selected.length ? props.selected : null);
|
|
567
|
+
for (let [key, value] of Object.entries(groupChecked.value)) {
|
|
568
|
+
if (value) {
|
|
569
|
+
set.add(key);
|
|
570
|
+
} else {
|
|
571
|
+
set.has(key) && set.delete(key);
|
|
572
|
+
}
|
|
547
573
|
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
574
|
+
emit("update:selected", Array.from(set));
|
|
575
|
+
},
|
|
576
|
+
{ deep: true }
|
|
577
|
+
);
|
|
551
578
|
vue.onMounted(() => {
|
|
552
579
|
let list = props.selected;
|
|
553
580
|
list && list.forEach((key) => {
|
|
@@ -833,7 +860,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
833
860
|
if (["string", "number"].includes(typeof state.selected)) {
|
|
834
861
|
emit("update:select", [state.dataMap.get(state.selected)]);
|
|
835
862
|
} else if (state.selected instanceof Array) {
|
|
836
|
-
emit(
|
|
863
|
+
emit(
|
|
864
|
+
"update:select",
|
|
865
|
+
state.selected.map((item) => state.dataMap.get(item))
|
|
866
|
+
);
|
|
837
867
|
} else ;
|
|
838
868
|
state.list = [];
|
|
839
869
|
methods.modalCancel();
|
|
@@ -854,11 +884,15 @@ const _sfc_main = vue.defineComponent({
|
|
|
854
884
|
return 648;
|
|
855
885
|
})
|
|
856
886
|
});
|
|
857
|
-
vue.watch(
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
887
|
+
vue.watch(
|
|
888
|
+
() => props.visible,
|
|
889
|
+
(val) => {
|
|
890
|
+
if (val && props.immediateFetch) {
|
|
891
|
+
methods.fetch({});
|
|
892
|
+
}
|
|
893
|
+
},
|
|
894
|
+
{ immediate: true }
|
|
895
|
+
);
|
|
862
896
|
return {
|
|
863
897
|
...methods,
|
|
864
898
|
...vue.toRefs(state)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -38,17 +38,17 @@ function isPlainObject(o) {
|
|
|
38
38
|
return true;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
function t(){return t=Object.assign
|
|
41
|
+
function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);}return e},t.apply(this,arguments)}function r(e,t){if(null==e)return {};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}const n={silent:!1,logLevel:"warn"},i=["validator"],o=Object.prototype,a=o.toString,s=o.hasOwnProperty,u=/^\s*function (\w+)/;function l(e){var t;const r=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(r){const e=r.toString().match(u);return e?e[1]:""}return ""}const c=isPlainObject,f=e=>e;let d=f;if("production"!==process.env.NODE_ENV){const e="undefined"!=typeof console;d=e?function(e,t=n.logLevel){!1===n.silent&&console[t](`[VueTypes warn]: ${e}`);}:f;}const p=(e,t)=>s.call(e,t),y=Number.isInteger||function(e){return "number"==typeof e&&isFinite(e)&&Math.floor(e)===e},v=Array.isArray||function(e){return "[object Array]"===a.call(e)},h=e=>"[object Function]"===a.call(e),b=e=>c(e)&&p(e,"_vueTypes_name"),g=e=>c(e)&&(p(e,"type")||["_vueTypes_name","validator","default","required"].some(t=>p(e,t)));function O(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function m(e,t,r=!1){let n,i=!0,o="";n=c(e)?e:{type:e};const a=b(n)?n._vueTypes_name+" - ":"";if(g(n)&&null!==n.type){if(void 0===n.type||!0===n.type)return i;if(!n.required&&void 0===t)return i;v(n.type)?(i=n.type.some(e=>!0===m(e,t,!0)),o=n.type.map(e=>l(e)).join(" or ")):(o=l(n),i="Array"===o?v(t):"Object"===o?c(t):"String"===o||"Number"===o||"Boolean"===o||"Function"===o?function(e){if(null==e)return "";const t=e.constructor.toString().match(u);return t?t[1]:""}(t)===o:t instanceof n.type);}if(!i){const e=`${a}value "${t}" should be of type "${o}"`;return !1===r?(d(e),!1):e}if(p(n,"validator")&&h(n.validator)){const e=d,o=[];if(d=e=>{o.push(e);},i=n.validator(t),d=e,!i){const e=(o.length>1?"* ":"")+o.join("\n* ");return o.length=0,!1===r?(d(e),i):e}}return i}function j(e,t){const r=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?(p(this,"default")&&delete this.default,this):h(e)||!0===m(this,e,!0)?(this.default=v(e)?()=>[...e]:c(e)?()=>Object.assign({},e):e,this):(d(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:n}=r;return h(n)&&(r.validator=O(n,r)),r}function _(e,t){const r=j(e,t);return Object.defineProperty(r,"validate",{value(e){return h(this.validator)&&d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=O(e,this),this}})}function T(e,t,n){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach(r=>{t[r]=Object.getOwnPropertyDescriptor(e,r);}),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!c(n))return o;const{validator:a}=n,s=r(n,i);if(h(a)){let{validator:e}=o;e&&(e=null!==(l=(u=e).__original)&&void 0!==l?l:u),o.validator=O(e?function(t){return e.call(this,t)&&a.call(this,t)}:a,o);}var u,l;return Object.assign(o,s)}function $(e){return e.replace(/^(?!\s*$)/gm," ")}const w=()=>_("any",{}),P=()=>_("function",{type:Function}),x=()=>_("boolean",{type:Boolean}),E=()=>_("string",{type:String}),N=()=>_("number",{type:Number}),q=()=>_("array",{type:Array}),A=()=>_("object",{type:Object}),V=()=>j("integer",{type:Number,validator:e=>y(e)}),S=()=>j("symbol",{validator:e=>"symbol"==typeof e});function D(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return j(e.name||"<<anonymous function>>",{type:null,validator(r){const n=e(r);return n||d(`${this._vueTypes_name} - ${t}`),n}})}function L(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.join('", "')}".`,r=e.reduce((e,t)=>{if(null!=t){const r=t.constructor;-1===e.indexOf(r)&&e.push(r);}return e},[]);return j("oneOf",{type:r.length>0?r:void 0,validator(r){const n=-1!==e.indexOf(r);return n||d(t),n}})}function F(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,r=[];for(let n=0;n<e.length;n+=1){const i=e[n];if(g(i)){if(b(i)&&"oneOf"===i._vueTypes_name&&i.type){r=r.concat(i.type);continue}if(h(i.validator)&&(t=!0),!0===i.type||!i.type){d('oneOfType - invalid usage of "true" or "null" as types.');continue}r=r.concat(i.type);}else r.push(i);}r=r.filter((e,t)=>r.indexOf(e)===t);const n=r.length>0?r:null;return j("oneOfType",t?{type:n,validator(t){const r=[],n=e.some(e=>{const n=m(b(e)&&"oneOf"===e._vueTypes_name?e.type||null:e,t,!0);return "string"==typeof n&&r.push(n),!0===n});return n||d(`oneOfType - provided value does not match any of the ${r.length} passed-in validators:\n${$(r.join("\n"))}`),n}}:{type:n})}function Y(e){return j("arrayOf",{type:Array,validator(t){let r="";const n=t.every(t=>(r=m(e,t,!0),!0===r));return n||d(`arrayOf - value validation error:\n${$(r)}`),n}})}function B(e){return j("instanceOf",{type:e})}function I(e){return j("objectOf",{type:Object,validator(t){let r="";const n=Object.keys(t).every(n=>(r=m(e,t[n],!0),!0===r));return n||d(`objectOf - value validation error:\n${$(r)}`),n}})}function J(e){const t=Object.keys(e),r=t.filter(t=>{var r;return !(null===(r=e[t])||void 0===r||!r.required)}),n=j("shape",{type:Object,validator(n){if(!c(n))return !1;const i=Object.keys(n);if(r.length>0&&r.some(e=>-1===i.indexOf(e))){const e=r.filter(e=>-1===i.indexOf(e));return d(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return i.every(r=>{if(-1===t.indexOf(r))return !0===this._vueTypes_isLoose||(d(`shape - shape definition does not include a "${r}" property. Allowed keys: "${t.join('", "')}".`),!1);const i=m(e[r],n[r],!0);return "string"==typeof i&&d(`shape - "${r}" property validation error:\n ${$(i)}`),!0===i})}});return Object.defineProperty(n,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(n,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),n}const M=["name","validate","getter"],R=/*#__PURE__*/(()=>{var e;return (e=class{static get any(){return w()}static get func(){return P().def(this.defaults.func)}static get bool(){return x().def(this.defaults.bool)}static get string(){return E().def(this.defaults.string)}static get number(){return N().def(this.defaults.number)}static get array(){return q().def(this.defaults.array)}static get object(){return A().def(this.defaults.object)}static get integer(){return V().def(this.defaults.integer)}static get symbol(){return S()}static get nullable(){return {type:null}}static extend(e){if(v(e))return e.forEach(e=>this.extend(e)),this;const{name:t,validate:n=!1,getter:i=!1}=e,o=r(e,M);if(p(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:a}=o;if(b(a))return delete o.type,Object.defineProperty(this,t,i?{get:()=>T(t,a,o)}:{value(...e){const r=T(t,a,o);return r.validator&&(r.validator=r.validator.bind(r,...e)),r}});let s;return s=i?{get(){const e=Object.assign({},o);return n?_(t,e):j(t,e)},enumerable:!0}:{value(...e){const r=Object.assign({},o);let i;return i=n?_(t,r):j(t,r),r.validator&&(i.validator=r.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,s)}}).defaults={},e.sensibleDefaults=void 0,e.config=n,e.custom=D,e.oneOf=L,e.instanceOf=B,e.oneOfType=F,e.arrayOf=Y,e.objectOf=I,e.shape=J,e.utils={validate:(e,t)=>!0===m(t,e,!0),toType:(e,t,r=!1)=>r?_(e,t):j(e,t)},e})();function z(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){var r;return (r=class extends R{static get sensibleDefaults(){return t({},this.defaults)}static set sensibleDefaults(r){this.defaults=!1!==r?t({},!0!==r?r:e):{};}}).defaults=t({},e),r}class C extends(z()){}
|
|
42
42
|
|
|
43
43
|
const timelineProps = () => ({
|
|
44
|
-
mode:
|
|
45
|
-
size:
|
|
46
|
-
labelWidth:
|
|
44
|
+
mode: C.oneOf(['left', 'right']).def('left'),
|
|
45
|
+
size: C.oneOf(['normal', 'small']).def('normal'),
|
|
46
|
+
labelWidth: C.string.def(''),
|
|
47
47
|
});
|
|
48
48
|
const timelineItemProps = () => ({
|
|
49
|
-
color:
|
|
50
|
-
dot:
|
|
51
|
-
label:
|
|
49
|
+
color: C.oneOf(['blue', 'red', 'green', 'gray']).def('blue'),
|
|
50
|
+
dot: C.any.def(''),
|
|
51
|
+
label: C.any.def(''),
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
var _export_sfc = (sfc, props) => {
|
|
@@ -165,6 +165,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
165
165
|
});
|
|
166
166
|
var TimelineItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "timeline-item.vue"]]);
|
|
167
167
|
|
|
168
|
+
Timeline.Item = TimelineItem;
|
|
168
169
|
const BmTimeline = withInstall.withInstall(Timeline);
|
|
169
170
|
const BmTimelineItem = withInstall.withInstall(TimelineItem);
|
|
170
171
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -44,16 +44,19 @@ const _sfc_main$1 = {
|
|
|
44
44
|
isShow: false,
|
|
45
45
|
openShow: false
|
|
46
46
|
});
|
|
47
|
-
const observer = new IntersectionObserver(
|
|
48
|
-
entries
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
const observer = new IntersectionObserver(
|
|
48
|
+
(entries) => {
|
|
49
|
+
entries.forEach((item) => {
|
|
50
|
+
if (item.intersectionRatio > 0.3) {
|
|
51
|
+
observerDom();
|
|
52
|
+
observer.disconnect();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
threshold: 0.3
|
|
58
|
+
}
|
|
59
|
+
);
|
|
57
60
|
function observerDom() {
|
|
58
61
|
if (props.line === 1) {
|
|
59
62
|
if (mySelf.value.scrollWidth > mySelf.value.clientWidth) {
|
|
@@ -69,16 +72,20 @@ const _sfc_main$1 = {
|
|
|
69
72
|
observer.disconnect();
|
|
70
73
|
});
|
|
71
74
|
let mySelf = vue.ref();
|
|
72
|
-
vue.watch(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
mySelf.value && observer.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
vue.watch(
|
|
76
|
+
() => props.showAlways,
|
|
77
|
+
function(showAlways) {
|
|
78
|
+
if (showAlways)
|
|
79
|
+
state.openShow = showAlways;
|
|
80
|
+
mySelf.value && observer.unobserve(mySelf.value);
|
|
81
|
+
vue.nextTick(function() {
|
|
82
|
+
mySelf.value && observer.observe(mySelf.value);
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
immediate: true
|
|
87
|
+
}
|
|
88
|
+
);
|
|
82
89
|
const handleVisibleChange = (val) => {
|
|
83
90
|
state.isShow = !state.openShow ? false : val;
|
|
84
91
|
};
|
|
@@ -277,15 +284,25 @@ const _sfc_main = {
|
|
|
277
284
|
disabled: false,
|
|
278
285
|
async customRequest({ file, fileField, data }) {
|
|
279
286
|
if (file.size > state.extraConfigs.maxSize * 1024 * 1024) {
|
|
280
|
-
return methods.uploadError(
|
|
287
|
+
return methods.uploadError(
|
|
288
|
+
new Error(
|
|
289
|
+
props.customErrors?.maxSize || `\u4E0D\u80FD\u4E0A\u4F20\u5927\u4E8E${state.extraConfigs.maxSize}M\u7684\u6587\u4EF6`
|
|
290
|
+
)
|
|
291
|
+
);
|
|
281
292
|
}
|
|
282
293
|
if (Object.keys(state.fileList).length >= state.extraConfigs.maxCount) {
|
|
283
|
-
return methods.uploadError(
|
|
294
|
+
return methods.uploadError(
|
|
295
|
+
new Error(
|
|
296
|
+
props.customErrors?.maxCount || `\u4E0D\u80FD\u4E0A\u4F20\u591A\u4E8E${state.extraConfigs.maxCount}\u4E2A\u6587\u4EF6`
|
|
297
|
+
)
|
|
298
|
+
);
|
|
284
299
|
}
|
|
285
300
|
let name = file.name;
|
|
286
301
|
let fileFormat = name.split(".").pop();
|
|
287
302
|
if (!state.uploadConfigs.accept.includes(`.${fileFormat}`)) {
|
|
288
|
-
return methods.uploadError(
|
|
303
|
+
return methods.uploadError(
|
|
304
|
+
new Error(props.customErrors?.format || `\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`)
|
|
305
|
+
);
|
|
289
306
|
}
|
|
290
307
|
state.fileList[file.uid] = {
|
|
291
308
|
uid: file.uid,
|
|
@@ -382,7 +399,9 @@ const _sfc_main = {
|
|
|
382
399
|
async deleteFile(uid) {
|
|
383
400
|
let targetFile = state.fileList[uid];
|
|
384
401
|
delete state.fileList[uid];
|
|
385
|
-
const index = state.uploadedList.findIndex(
|
|
402
|
+
const index = state.uploadedList.findIndex(
|
|
403
|
+
(ele) => ele.url === targetFile.url
|
|
404
|
+
);
|
|
386
405
|
if (index !== -1) {
|
|
387
406
|
state.uploadedList.splice(index, 1);
|
|
388
407
|
}
|
|
@@ -448,64 +467,78 @@ const _sfc_main = {
|
|
|
448
467
|
}
|
|
449
468
|
},
|
|
450
469
|
handleReject(e) {
|
|
451
|
-
return methods.uploadError(
|
|
470
|
+
return methods.uploadError(
|
|
471
|
+
new Error(props.customErrors?.format || `\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`)
|
|
472
|
+
);
|
|
452
473
|
}
|
|
453
474
|
};
|
|
454
|
-
vue.watch(
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
475
|
+
vue.watch(
|
|
476
|
+
() => props.defaultList,
|
|
477
|
+
function(list) {
|
|
478
|
+
if (list?.length) {
|
|
479
|
+
list.forEach((item) => {
|
|
480
|
+
if (!item.uid) {
|
|
481
|
+
item.uid = utils.getuid();
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
list.forEach(function(item) {
|
|
485
|
+
let uid = item.uid || utils.getuid();
|
|
486
|
+
if (!item.url.includes("http") && !item.url.includes(CLOUND_PRE))
|
|
487
|
+
item.url = props.cloudReadUrl + item.url;
|
|
488
|
+
state.fileList[uid] = {
|
|
489
|
+
uid,
|
|
490
|
+
name: item.name,
|
|
491
|
+
url: item.url,
|
|
492
|
+
type: item.type || "png",
|
|
493
|
+
progress: 100,
|
|
494
|
+
isDoneDeloy: true
|
|
495
|
+
};
|
|
496
|
+
if (!state.uploadedList.find((item2) => item2.uid === uid)) {
|
|
497
|
+
state.uploadedList.push(item);
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
} else {
|
|
501
|
+
state.fileList = {};
|
|
502
|
+
state.uploadedList = [];
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
immediate: true
|
|
480
507
|
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
508
|
+
);
|
|
509
|
+
vue.watch(
|
|
510
|
+
[() => props.uploadProps, () => props.extraProps],
|
|
511
|
+
function([config, extra]) {
|
|
512
|
+
state.uploadConfigs = {
|
|
513
|
+
...state.uploadConfigs,
|
|
514
|
+
...config,
|
|
515
|
+
showUploadList: false
|
|
516
|
+
};
|
|
517
|
+
state.extraConfigs = {
|
|
518
|
+
...state.extraConfigs,
|
|
519
|
+
...extra
|
|
520
|
+
};
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
immediate: true,
|
|
524
|
+
deep: true
|
|
525
|
+
}
|
|
526
|
+
);
|
|
498
527
|
const uploadDisabled = vue.computed(() => {
|
|
499
528
|
if (props.uploadProps.disabled || Object.keys(state.fileList).length >= state.extraConfigs.maxCount) {
|
|
500
529
|
return true;
|
|
501
530
|
}
|
|
502
531
|
return false;
|
|
503
532
|
});
|
|
504
|
-
vue.watch(
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
533
|
+
vue.watch(
|
|
534
|
+
() => uploadDisabled.value,
|
|
535
|
+
(value) => {
|
|
536
|
+
emit("updateDisabledStatus", value);
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
immediate: true
|
|
540
|
+
}
|
|
541
|
+
);
|
|
509
542
|
const isUploading = vue.computed(() => {
|
|
510
543
|
let ret = false;
|
|
511
544
|
let fileList = state.fileList || {};
|
|
@@ -516,11 +549,15 @@ const _sfc_main = {
|
|
|
516
549
|
});
|
|
517
550
|
return ret;
|
|
518
551
|
});
|
|
519
|
-
vue.watch(
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
552
|
+
vue.watch(
|
|
553
|
+
() => isUploading.value,
|
|
554
|
+
(value) => {
|
|
555
|
+
emit("updateIsUploadingStatus", value);
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
immediate: true
|
|
559
|
+
}
|
|
560
|
+
);
|
|
524
561
|
return {
|
|
525
562
|
...vue.toRefs(state),
|
|
526
563
|
icons,
|