cnhis-design-vue 3.1.43 → 3.1.44-beta.1
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/base-search/index.d.ts +1 -0
- package/es/components/base-search/src/index.vue.d.ts +1 -0
- package/es/components/form-config/index.d.ts +5 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +5 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -0
- package/es/components/form-render/src/components/renderer/combination.d.ts +10 -1
- package/es/components/form-render/src/components/renderer/combination.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -0
- package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +15 -12
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -1
- package/es/components/iho-table/src/plugins/rowDragPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +1 -1
- package/es/components/quick-search/index.d.ts +1 -0
- package/es/components/quick-search/src/index.vue.d.ts +1 -0
- package/es/components/shortcut-setter/index.d.ts +1 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/render-widget/components/Date.vue.d.ts +39 -1
- package/es/components/table-filter/src/components/render-widget/components/Date.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRange.vue.d.ts +41 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRange.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/Select.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/Select.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +81 -3
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.d.ts +1 -0
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -24,6 +24,7 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
24
24
|
};
|
|
25
25
|
isRender: (cfg: import("..").ISearchType) => any;
|
|
26
26
|
getRenderSearchConObj: (cfg: import("..").ISearchType) => {
|
|
27
|
+
widgetType: any;
|
|
27
28
|
field_key: string;
|
|
28
29
|
con: string | undefined;
|
|
29
30
|
value: any[] | null;
|
|
@@ -184,6 +184,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
184
184
|
requestCache?: boolean | undefined;
|
|
185
185
|
maxGroupNum?: number | undefined;
|
|
186
186
|
jsonCombination?: boolean | undefined;
|
|
187
|
+
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
187
188
|
children?: any[] | undefined;
|
|
188
189
|
properties?: any[] | undefined;
|
|
189
190
|
componentProps?: import("../../../es/shared/types").AnyObject | undefined;
|
|
@@ -1895,6 +1896,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1895
1896
|
requestCache?: boolean | undefined;
|
|
1896
1897
|
maxGroupNum?: number | undefined;
|
|
1897
1898
|
jsonCombination?: boolean | undefined;
|
|
1899
|
+
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
1898
1900
|
children?: any[] | undefined;
|
|
1899
1901
|
properties?: any[] | undefined;
|
|
1900
1902
|
componentProps?: import("../../../es/shared/types").AnyObject | undefined;
|
|
@@ -4551,6 +4553,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
4551
4553
|
requestCache?: boolean | undefined;
|
|
4552
4554
|
maxGroupNum?: number | undefined;
|
|
4553
4555
|
jsonCombination?: boolean | undefined;
|
|
4556
|
+
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
4554
4557
|
children?: any[] | undefined;
|
|
4555
4558
|
properties?: any[] | undefined;
|
|
4556
4559
|
componentProps?: import("../../../es/shared/types").AnyObject | undefined;
|
|
@@ -6274,6 +6277,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
6274
6277
|
requestCache?: boolean | undefined;
|
|
6275
6278
|
maxGroupNum?: number | undefined;
|
|
6276
6279
|
jsonCombination?: boolean | undefined;
|
|
6280
|
+
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
6277
6281
|
children?: any[] | undefined;
|
|
6278
6282
|
properties?: any[] | undefined;
|
|
6279
6283
|
componentProps?: import("../../../es/shared/types").AnyObject | undefined;
|
|
@@ -7969,6 +7973,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
7969
7973
|
requestCache?: boolean | undefined;
|
|
7970
7974
|
maxGroupNum?: number | undefined;
|
|
7971
7975
|
jsonCombination?: boolean | undefined;
|
|
7976
|
+
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
7972
7977
|
children?: any[] | undefined;
|
|
7973
7978
|
properties?: any[] | undefined;
|
|
7974
7979
|
componentProps?: import("../../../es/shared/types").AnyObject | undefined;
|
|
@@ -186,6 +186,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
186
186
|
requestCache?: boolean | undefined;
|
|
187
187
|
maxGroupNum?: number | undefined;
|
|
188
188
|
jsonCombination?: boolean | undefined;
|
|
189
|
+
combinationItemDeletable?: boolean | import("../../../../es/components/form-render").CombinationItemDeletableFn | undefined;
|
|
189
190
|
children?: any[] | undefined;
|
|
190
191
|
properties?: any[] | undefined;
|
|
191
192
|
componentProps?: import("../../../../es/shared/types").AnyObject | undefined;
|
|
@@ -1897,6 +1898,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1897
1898
|
requestCache?: boolean | undefined;
|
|
1898
1899
|
maxGroupNum?: number | undefined;
|
|
1899
1900
|
jsonCombination?: boolean | undefined;
|
|
1901
|
+
combinationItemDeletable?: boolean | import("../../../../es/components/form-render").CombinationItemDeletableFn | undefined;
|
|
1900
1902
|
children?: any[] | undefined;
|
|
1901
1903
|
properties?: any[] | undefined;
|
|
1902
1904
|
componentProps?: import("../../../../es/shared/types").AnyObject | undefined;
|
|
@@ -4553,6 +4555,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4553
4555
|
requestCache?: boolean | undefined;
|
|
4554
4556
|
maxGroupNum?: number | undefined;
|
|
4555
4557
|
jsonCombination?: boolean | undefined;
|
|
4558
|
+
combinationItemDeletable?: boolean | import("../../../../es/components/form-render").CombinationItemDeletableFn | undefined;
|
|
4556
4559
|
children?: any[] | undefined;
|
|
4557
4560
|
properties?: any[] | undefined;
|
|
4558
4561
|
componentProps?: import("../../../../es/shared/types").AnyObject | undefined;
|
|
@@ -6276,6 +6279,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6276
6279
|
requestCache?: boolean | undefined;
|
|
6277
6280
|
maxGroupNum?: number | undefined;
|
|
6278
6281
|
jsonCombination?: boolean | undefined;
|
|
6282
|
+
combinationItemDeletable?: boolean | import("../../../../es/components/form-render").CombinationItemDeletableFn | undefined;
|
|
6279
6283
|
children?: any[] | undefined;
|
|
6280
6284
|
properties?: any[] | undefined;
|
|
6281
6285
|
componentProps?: import("../../../../es/shared/types").AnyObject | undefined;
|
|
@@ -7971,6 +7975,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7971
7975
|
requestCache?: boolean | undefined;
|
|
7972
7976
|
maxGroupNum?: number | undefined;
|
|
7973
7977
|
jsonCombination?: boolean | undefined;
|
|
7978
|
+
combinationItemDeletable?: boolean | import("../../../../es/components/form-render").CombinationItemDeletableFn | undefined;
|
|
7974
7979
|
children?: any[] | undefined;
|
|
7975
7980
|
properties?: any[] | undefined;
|
|
7976
7981
|
componentProps?: import("../../../../es/shared/types").AnyObject | undefined;
|
|
@@ -149,6 +149,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
149
149
|
requestCache?: boolean | undefined;
|
|
150
150
|
maxGroupNum?: number | undefined;
|
|
151
151
|
jsonCombination?: boolean | undefined;
|
|
152
|
+
combinationItemDeletable?: boolean | import("../../../../../es/components/form-render").CombinationItemDeletableFn | undefined;
|
|
152
153
|
children?: any[] | undefined;
|
|
153
154
|
properties?: any[] | undefined;
|
|
154
155
|
componentProps?: import("../../../../../es/shared/types").AnyObject | undefined;
|
|
@@ -1872,6 +1873,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1872
1873
|
requestCache?: boolean | undefined;
|
|
1873
1874
|
maxGroupNum?: number | undefined;
|
|
1874
1875
|
jsonCombination?: boolean | undefined;
|
|
1876
|
+
combinationItemDeletable?: boolean | import("../../../../../es/components/form-render").CombinationItemDeletableFn | undefined;
|
|
1875
1877
|
children?: any[] | undefined;
|
|
1876
1878
|
properties?: any[] | undefined;
|
|
1877
1879
|
componentProps?: import("../../../../../es/shared/types").AnyObject | undefined;
|
|
@@ -3567,6 +3569,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3567
3569
|
requestCache?: boolean | undefined;
|
|
3568
3570
|
maxGroupNum?: number | undefined;
|
|
3569
3571
|
jsonCombination?: boolean | undefined;
|
|
3572
|
+
combinationItemDeletable?: boolean | import("../../../../../es/components/form-render").CombinationItemDeletableFn | undefined;
|
|
3570
3573
|
children?: any[] | undefined;
|
|
3571
3574
|
properties?: any[] | undefined;
|
|
3572
3575
|
componentProps?: import("../../../../../es/shared/types").AnyObject | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import { FieldItem } from '../../../../../../es/components/form-render';
|
|
2
|
+
import { CombinationItemDeletableFn, FieldItem } from '../../../../../../es/components/form-render';
|
|
3
3
|
export declare const COMBINATION: import("vue").DefineComponent<{
|
|
4
4
|
title: {
|
|
5
5
|
type: StringConstructor;
|
|
@@ -18,6 +18,10 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
18
18
|
type: PropType<() => FieldItem[]>;
|
|
19
19
|
default: () => never[];
|
|
20
20
|
};
|
|
21
|
+
combinationItemDeletable: {
|
|
22
|
+
type: PropType<boolean | CombinationItemDeletableFn>;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
21
25
|
onInput: {};
|
|
22
26
|
onBlur: {};
|
|
23
27
|
onChange: {};
|
|
@@ -39,6 +43,10 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
39
43
|
type: PropType<() => FieldItem[]>;
|
|
40
44
|
default: () => never[];
|
|
41
45
|
};
|
|
46
|
+
combinationItemDeletable: {
|
|
47
|
+
type: PropType<boolean | CombinationItemDeletableFn>;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
42
50
|
onInput: {};
|
|
43
51
|
onBlur: {};
|
|
44
52
|
onChange: {};
|
|
@@ -47,5 +55,6 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
47
55
|
}, {
|
|
48
56
|
disabled: boolean;
|
|
49
57
|
title: string;
|
|
58
|
+
combinationItemDeletable: boolean | CombinationItemDeletableFn;
|
|
50
59
|
getProperties: () => FieldItem[];
|
|
51
60
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,watch as
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,watch as a,inject as i,onBeforeUnmount as r,createVNode as n}from"vue";import{isObjectField as m}from"@formily/core";import{autorun as l}from"@formily/reactive";import{RecursionField as u,connect as s}from"@formily/vue";import{AddCircleOutline as c,RemoveCircle as p}from"@vicons/ionicons5";import{isNumber as d,isArray as f,isFunction as v,range as b}from"lodash-es";import{NButton as y,NIcon as x}from"naive-ui";import"../../../index.js";import{InjectionBusinessCollector as h}from"../../constants/index.js";import"../../utils/index.js";import{useFormField as _}from"../../hooks/useFormField.js";import{useFieldListAdaptor as j}from"../../hooks/useFieldListAdaptor.js";import{createObjSchema as C}from"../../utils/schema.js";const F=s(e({name:"FormCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},disabled:{type:Boolean},getProperties:{type:Function,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e){const{field:s,fieldKey:F}=_(),g=o(1),k=t((()=>d(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));function I(){g.value++}a((()=>e.value),(e=>{f(e)&&(g.value=Math.min(Math.max(e.length,1),k.value))}),{immediate:!0});const N=i(h),{schemaAdaptor:D}=j(N),G=o([]);return r(l((()=>{f(s.value.value)&&(G.value=s.value.value.map(((o,t)=>v(e.combinationItemDeletable)?e.combinationItemDeletable(o||{},t):e.combinationItemDeletable)))}))),()=>n("section",{class:"form-render__combination"},[n("header",{class:"form-render__combinationHeader"},[n("div",{class:"form-render__combinationHeaderText"},[e.title]),n(y,{onClick:I,text:!0,style:{"--n-text-color":"var(--c-primary-color)"},disabled:g.value>=k.value||e.disabled},{icon:()=>n(x,{component:c},null),default:()=>"新增"})]),b(g.value).map(((o,t)=>n("section",{class:"form-render__combinationContent"},[n(u,{schema:C(D(e.getProperties())),name:t},null),n(y,{text:!0,disabled:!G.value[t],type:"error",class:"form-render__combinationClose",onClick:()=>async function(e){if(g.value>1)g.value--,await s.value.remove(e);else{const o=s.value.query(`${F.value}.${e}`).take();if(!o||!m(o))return;await o.reset()}}(t)},{icon:()=>n(x,{component:p},null)})])))])}}));export{F as COMBINATION};
|
|
@@ -10,6 +10,7 @@ export declare const FORM_ITEM: import("vue").DefineComponent<{
|
|
|
10
10
|
suffixFields: {
|
|
11
11
|
type: PropType<string[]>;
|
|
12
12
|
};
|
|
13
|
+
labelRender: FunctionConstructor;
|
|
13
14
|
annotation: {};
|
|
14
15
|
fieldItem: {};
|
|
15
16
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -23,6 +24,7 @@ export declare const FORM_ITEM: import("vue").DefineComponent<{
|
|
|
23
24
|
suffixFields: {
|
|
24
25
|
type: PropType<string[]>;
|
|
25
26
|
};
|
|
27
|
+
labelRender: FunctionConstructor;
|
|
26
28
|
annotation: {};
|
|
27
29
|
fieldItem: {};
|
|
28
30
|
}>>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as r,computed as o,ref as
|
|
1
|
+
import{defineComponent as e,inject as r,computed as o,ref as l,onUnmounted as t,createVNode as i,mergeProps as a}from"vue";import{arrayed as s,widthAppend as n}from"../../../../../shared/utils/index.js";import{isVoidField as m}from"@formily/core";import{observe as u,autorun as d}from"@formily/reactive";import{connect as f,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isArray as c,isString as y,isFunction as _}from"lodash-es";import{NFormItem as b}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import x from"../tooltipMessage.vue.js";import{InjectionFormUUID as j,InjectionFormGraph as I,InjectionAnnotation as k}from"../../constants/index.js";import{useComplexOptionsSpan as F}from"../../hooks/useComplexOptions.js";import{dotEscape as h}from"../../utils/schema.js";import{useFormField as R}from"../../hooks/useFormField.js";import{validateMessageParser as L}from"../../utils/index.js";const q=f(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},fieldItem:{}},setup(e,{slots:s}){const{field:f,fieldKey:p,fieldAddress:y}=R(),L=r(j),q=o((()=>h(`${L}-${y.value}`))),K=l(!1);if(m(f.value)&&c(e.suffixFields)){const o=r(I);t(u(o,v((()=>{m(f.value)&&c(e.suffixFields)&&(K.value=e.suffixFields.some((e=>{const r=f.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else t(d((()=>{K.value=Reflect.get(f.value,"required")})));const S=r(k),A=o({get(){var r,o;return null!=(o=null==(r=S.value)?void 0:r[e.propertyKey])?o:""},set(r){S.value={property:e.propertyKey,value:r}}});const E=o((()=>S.value&&!1!==e.annotation)),V=o((()=>e.label&&" "!==e.label)),$=o((()=>{let r=0;return E.value&&(r+=18),e.remark&&(r+=18),r}));function w(){return V.value?i("section",{class:"form-render__formItemLabel"},[i("span",{class:"form-render__formItemLabel--text",style:{marginRight:n($.value)}},[_(e.labelRender)?e.labelRender(e.label):e.label]),$.value?i("section",{class:"form-render__formItemLabel--operation"},[e.remark?i("div",{class:"form-render__formItemLabel--tooltip"},[i(x,{message:e.remark},null)]):null,E.value?i(g,{class:"form-render__formItemLabel--annotation",modelValue:A.value,"onUpdate:modelValue":e=>A.value=e},null):null]):null]):null}const{getSpan:C}=F();return()=>i(b,a({class:"form-render__formItem",style:{"--form-item-column":C(L,f.value.address,!1)+e.span}},{id:q.value,uuid:L,"widget-type":f.value.componentType,"field-key":h(p.value),"field-address":h(y.value),required:K.value}),{...s,label:w})}}),p({title:"label"},((e,r)=>{const o=m(r)?void 0:s(r.selfErrors).length?function(e,r){if(!y(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>L(e,r))).join(",");return L(r.defined_error_msg,r)}(s(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:o,"validation-status":o?"error":void 0}})));export{q as FORM_ITEM};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(d){const{createValidatorSchema:u}=l(),x=e=>{var t;const n={name:e.val_key,type:null!=(t=e.fieldType)?t:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable"};e.reactions&&(n["x-reactions"]=e.reactions),e.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o(e,["reactions"]),span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const r=u(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},f=e=>{var o;const t=x(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(t,e):e.autograph&&m(t,e);const i=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:i,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),i&&(t.type="array"),t},_=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),m(o,e),o},h=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},g=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),
|
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(d){const{createValidatorSchema:u}=l(),x=e=>{var t;const n={name:e.val_key,type:null!=(t=e.fieldType)?t:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable"};e.reactions&&(n["x-reactions"]=e.reactions),e.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o(e,["reactions"]),span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const r=u(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},f=e=>{var o;const t=x(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(t,e):e.autograph&&m(t,e);const i=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:i,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),i&&(t.type="array"),t},_=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),m(o,e),o},h=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},g=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),b=new Map([["LINEBAR",g],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=x(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",f],["REMOTE_SEARCH",f],["DATE",e=>{const o=x(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),o}],["SEARCH_CASCADER",e=>{var o;const t=x(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=x(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,getProperties:()=>e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",_],["CHECKBOX",_],["SWITCH",e=>{const o=x(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=x(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?C(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),y=e=>{if(e.suffixConfig)return v(e);return(b.get(e.html_type)||h)(e)},v=o=>{if(!o.suffixConfig)return y(o);const t=e(o.suffixConfig),n=[{...o,is_show:"1",hide_title:"1",suffixConfig:void 0}].concat(t.map((e=>({...e,hide_title:"1",is_show:"1"})))),r=x(o);return Object.assign(r,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:2*(o.elem_width||3)},"x-decorator-props":{...r["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:C(n)}),r},{FieldNormalizeWaterfallHook:O}=s();function C(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=O.call(t(o))).validate)?void 0:a.obj_type;return p&&d&&d.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(g(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(y(o),s):(n=null,e[i(o)]=r(y(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function i(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:C}}export{d as useFieldListAdaptor};
|
|
@@ -88,6 +88,7 @@ export declare type FormWordbook = Partial<{
|
|
|
88
88
|
conObj: AnyObject[];
|
|
89
89
|
conObjFirstLevel: AnyObject[];
|
|
90
90
|
}>;
|
|
91
|
+
export declare type CombinationItemDeletableFn = (itemData: AnyObject, index: number) => boolean;
|
|
91
92
|
export declare type FieldItem = {
|
|
92
93
|
val_key: string;
|
|
93
94
|
html_type: HtmlType;
|
|
@@ -137,6 +138,7 @@ export declare type FieldItem = {
|
|
|
137
138
|
requestCache: boolean;
|
|
138
139
|
maxGroupNum: number;
|
|
139
140
|
jsonCombination: boolean;
|
|
141
|
+
combinationItemDeletable: boolean | CombinationItemDeletableFn;
|
|
140
142
|
children: FieldItem[];
|
|
141
143
|
properties: FieldItem[];
|
|
142
144
|
componentProps: AnyObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{unref as e}from"vue";import{promiseTimeout as n}from"@vueuse/shared";import"../../../index.js";import{useSessionStorage as t}from"@vueuse/core";import{isString as o,trim as i,isEmpty as r,isEqual as l,isFunction as u}from"lodash-es";import{selectOptionsMap as d}from"../rendererPlugins/editableWidgets/hooks/useSelectOption.js";import{IhoTableUtils as a}from"../../utils/index.js";import{EDITABLE_WIDGET_TYPE as s}from"../../constants/index.js";import{parse as c,isValid as p,compareDesc as f}from"date-fns";import{defineTablePlugin as m}from"../../hooks/useTablePlugin.js";function v(){const v="keyboardEventPlugin",g=t("ihoTableClipData","");return m({name:v,apply(t){function m(n,t,m,v,w){var b,y;if(!(null==(b=null==m?void 0:m.keyboardConfig)?void 0:b.isClip))return;const{row:C,column:R}=t.getSelectedCell()||t.getEditRecord()||{};if(!C||!R||!E(R,s.SELECT)&&e(g)===C[R.field])return;const x=m.uuid&&E(R,s.SELECT)&&d.get(m.uuid)[R.field],T=C[R.field];if("copy"===n){const e=(null==(y=(x||[]).filter((e=>T.includes(e.value))))?void 0:y.map((e=>e.label)).join(","))||T;g.value=e}else{if(o(e(g))&&(g.value=i(e(g)||"")),!e(g)||!function(e){var n;const t=null==(n=e.editRender)?void 0:n.props;return t&&Object.keys(s).includes(a.getCellType(t))}(R)||C.$__SEPARATE||!function(e,n,t,o){var i,r;const{beforeEditMethod:l}=n.editConfig||{},d={rowIndex:null!=(i=e.getRowIndex(t))?i:0,columnIndex:null!=(r=e.getColumnIndex(o))?r:0};return!l||u(l)&&l({row:t,column:o,...d,$table:e,$grid:void 0})}(t,m,C,R))return;if(E(R,s.DATE)&&function(n,t){var i;const r=null==(i=n.editRender)?void 0:i.props,l=e(g)||"";return!p(new Date(l))||o(r.connectField)&&t[r.connectField]&&(r.isStartDate&&f(new Date(l),new Date(t[r.connectField]))<0||r.isEndDate&&f(new Date(l),new Date(t[r.connectField]))>0)}(R,C))return;if(E(R,s.NUMBER)&&!/^-?\d*\.?\d+$/.test((e(g)||"").toString()))return;if(E(R,s.TIME)&&function(n){var t,o;const i=e(g)||"",r=null==(t=n.editRender)?void 0:t.props,l=c(i,(null==(o=null==r?void 0:r.componentProps)?void 0:o.valueFormat)||"HH:mm",new Date);return!p(l)}(R))return;let n=e(g)||"";if(x&&!r(x)){const e=x.filter((e=>n.split(",").includes(e.label))).map((e=>e.value));if(r(e))return;if(function(e){var n,t;const o=null==(n=e.editRender)?void 0:n.props;return E(e,s.SELECT)&&(null==(t=o.componentProps)?void 0:t.multiple)}(R)){if(l(T,e))return;n=e}else{if(e.includes(T))return;n=e[0]}}C[R.field]=n,v("formChange",{column:R,row:C,oldValue:T,value:n,index:t.getRowIndex(C)}),E(R,s.SEPARATE)&&(null==w||w())}}function E(e,n){var t;const o=null==(t=e.editRender)?void 0:t.props;return o&&a.getCellType(o)===n}t.eventHooks.onCopy.tap(v,(({$table:e},n,{emits:t})=>m("copy",e,n,t))),t.eventHooks.onPaste.tap(v,(({$table:e},n,{emits:t,updateTableDataRef:o})=>m("paste",e,n,t,o))),t.eventHooks.onKeydown.tap(v,(async({$event:e,$table:t},o,{emits:i})=>{await n(0);const{row:r,column:l}=t.getSelectedCell()||t.getEditRecord()||{};if(!r||!l)return;i("keyboard",{key:e.key,index:t.getRowIndex(r),value:r[l.field],row:r,column:l})}))}})}export{v as keyboardEventPlugin};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Func } from '../../../../../../../../es/shared/types';
|
|
1
|
+
import { Func, AnyObject } from '../../../../../../../../es/shared/types';
|
|
2
2
|
import { type PropType } from 'vue';
|
|
3
3
|
import { VxeTableDefines } from 'vxe-table';
|
|
4
|
-
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
5
4
|
declare const _default: import("vue").DefineComponent<{
|
|
6
5
|
value: {
|
|
7
6
|
type: StringConstructor;
|
|
@@ -44,8 +43,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
43
|
emitFormChangeWithParams: (params?: AnyObject) => void;
|
|
45
44
|
emit: (event: "update:value", ...args: any[]) => void;
|
|
46
45
|
formRef: import("vue").Ref<any>;
|
|
47
|
-
formattedValue:
|
|
48
|
-
|
|
46
|
+
formattedValue: import("vue").WritableComputedRef<string | undefined>;
|
|
47
|
+
formatConfig: import("vue").ComputedRef<{
|
|
48
|
+
valueFormat: string;
|
|
49
|
+
format: string;
|
|
50
|
+
timePickerProps: {
|
|
51
|
+
format: string | undefined;
|
|
52
|
+
};
|
|
53
|
+
}>;
|
|
49
54
|
isStartDate: any;
|
|
50
55
|
isEndDate: any;
|
|
51
56
|
connectField: string;
|
|
@@ -56,15 +61,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
61
|
isMinuteDisabled: (minute: number) => boolean;
|
|
57
62
|
isSecondDisabled: (second: number) => boolean;
|
|
58
63
|
};
|
|
59
|
-
customDateDisabledDecorator: (customDateDisabled?: Func) => ((ts: number) => any) | null;
|
|
60
|
-
formatConfig: import("vue").ComputedRef<{
|
|
61
|
-
valueFormat: string;
|
|
62
|
-
format: string;
|
|
63
|
-
timePickerProps: {
|
|
64
|
-
format: string | undefined;
|
|
65
|
-
};
|
|
66
|
-
}>;
|
|
67
64
|
dateConfig: AnyObject;
|
|
65
|
+
customDateDisabledDecorator: (customDateDisabled?: Func) => ((ts: number) => any) | null;
|
|
66
|
+
getDetailTime: (date: Date) => {
|
|
67
|
+
h: number;
|
|
68
|
+
m: number;
|
|
69
|
+
s: number;
|
|
70
|
+
};
|
|
68
71
|
DatePicker: import("../../../../../../../../es/shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
|
69
72
|
updateUnchangedValue: {
|
|
70
73
|
type: BooleanConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as r,computed as i,
|
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as r,computed as i,onMounted as l,openBlock as a,createBlock as o,unref as u,mergeProps as n,isRef as s}from"vue";import{generateTimeFormat as d}from"../../../../../../../shared/utils/index.js";import{isFunction as m}from"lodash-es";import{useIhoTableFormEvent as p}from"../../../../utils/index.js";import c from"../../../../../../date-picker/index.js";import v from"../../../../../../../_virtual/plugin-vue_export-helper.js";var f=v(e({__name:"editDate",props:{value:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:value"],setup(e,{emit:v}){const f=e,w=t(),{emitFormChangeWithParams:D}=p(f),y=r(),g=i({get:()=>f.value,set(e){const t=f.value;t!==e&&(v("update:value",e),D({oldValue:t}))}}),b=i((()=>{const e=w.valueFormat||"yyyy-MM-dd HH:mm:ss";return{valueFormat:e,format:e,timePickerProps:{format:d(e)}}})),{isStartDate:h=!1,isEndDate:$=!1}=w,T=w.connectField||"",_=(e,t)=>h&&T?e>t:!(!$||!T)&&e<t,j=e=>{const t=new Date(f.row[T]),r=new Date(e),{h:i,m:l,s:a}=k(t),o=(e,t,r,i)=>!($&&r>i)&&(!(h&&r<i)&&_(e,t));return{isHourDisabled:t=>{if(!f.row[T])return!1;const l=new Date(`${f.row[T].split(" ")[0]} 00:00:00`).getTime(),{m:a,s:u}=k(r);return o(t,i,e-60*t*60*1e3-60*a*1e3-1e3*u,l)},isMinuteDisabled:t=>{if(!f.row[T])return!1;const a=new Date(`${f.row[T].split(" ")[0]} ${i}:00:00`).getTime(),{s:u}=k(r);return o(t,l,e-60*t*1e3-1e3*u,a)},isSecondDisabled:t=>{if(!f.row[T])return!1;const r=new Date(`${f.row[T].split(" ")[0]} ${i}:${l}:00`).getTime();return o(t,a,e-1e3*t,r)}}},x={type:w.type||"datetime",clearable:!0,placeholder:w.placeholder||"请选择",...w,...b.value,isDateDisabled:S(w.isDateDisabled)||(e=>!!f.row[T]&&_(e,$?new Date(`${f.row[T].split(" ")[0]} 00:00:00`).getTime():new Date(f.row[T]).getTime()))};function S(e){return m(e)?t=>e(t,f.row):null}function k(e){return{h:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}return x.type.includes("time")&&(x.isTimeDisabled=S(w.isTimeDisabled)||j),l((()=>{var e,t,r,i,l,a,o;return null==(o=null==(l=null==(r=null==(t=null==(e=y.value)?void 0:e.$datePicker)?void 0:t.inputInstRef)?void 0:(i=r.$el).querySelector)?void 0:(a=l.call(i,"input")).select)?void 0:o.call(a)})),(e,t)=>(a(),o(u(c),n({ref_key:"formRef",ref:y},u(x),{"formatted-value":u(g),"onUpdate:formatted-value":t[0]||(t[0]=e=>s(g)?g.value=e:null)}),null,16,["formatted-value"]))}}),[["__file","editDate.vue"]]);export{f as default};
|
|
@@ -46,7 +46,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
46
46
|
formRef: import("vue").Ref<HTMLElement | null>;
|
|
47
47
|
isShow: import("vue").Ref<boolean>;
|
|
48
48
|
timePickerRef: import("vue").Ref<any>;
|
|
49
|
-
|
|
49
|
+
inputValue: import("vue").Ref<any>;
|
|
50
50
|
__formattedValue: import("vue").Ref<any>;
|
|
51
51
|
oldValue: string | undefined;
|
|
52
52
|
placeholder: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as l,ref as t,watch as a,nextTick as o,openBlock as r,createBlock as u,unref as i,mergeProps as n,withCtx as m,createVNode as c,createElementBlock as v,Fragment as d,renderList as f,createTextVNode as s,toDisplayString as p,createCommentVNode as _}from"vue";import{NPopover as k,NInput as h,NSpace as y,NScrollbar as w,NButton as g}from"naive-ui";import{useIhoTableFormEvent as b}from"../../../../utils/index.js";import{useAutoFocus as V}from"../hooks/useAutoFocus.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as j,format as q}from"date-fns";import x from"../../../../../../../_virtual/plugin-vue_export-helper.js";var R=x(e({__name:"editTime",props:{formattedValue:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:formattedValue","click"],setup(e,{emit:x}){const R=e,S=l(),{emitFormChangeWithParams:A}=b(R),{formRef:I,isShow:O}=V(),P=t(),$=t(),E=t();let H=R.formattedValue;const{placeholder:T="请选择",valueFormat:U="HH:mm",shortcutOptions:z=[]}=S,D={placeholder:T,valueFormat:U,format:U};function K(e){E.value=e,H!==e&&(x("update:formattedValue",e),A({oldValue:H}),H=e)}function N(){[D.valueFormat.replace(/:/,""),D.valueFormat].some((e=>{const l=F($.value||"",e,new Date);if(j(l)){return K(q(l,D.valueFormat)),!0}}))}function W(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=I.value)||l.blur(),O.value=!1)}return a((()=>R.formattedValue),(e=>{$.value=e,E.value=e}),{immediate:!0}),a((()=>O.value),(async e=>{var l,t,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(t=null==(l=P.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(e,l)=>(r(),u(i(k),n({show:i(O),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},e.$attrs,{onClickoutside:l[3]||(l[3]=()=>O.value=!1)}),{trigger:m((()=>[c(i(h),{ref_key:"formRef",ref:I,clearable:"",value:$.value,"onUpdate:value":l[0]||(l[0]=e=>$.value=e),onClick:l[1]||(l[1]=()=>O.value=!0),onChange:N,onKeydown:W},null,8,["value"])])),default:m((()=>[c(i(y),null,{default:m((()=>[c(i(C),n({ref_key:"timePickerRef",ref:P,show:"","formatted-value":E.value},i(D),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":K,onConfirm:l[2]||(l[2]=()=>O.value=!1)}),null,16,["formatted-value"]),c(i(w),{class:"iho-table__scrollbar"},{default:m((()=>[i(z).length?(r(),u(i(y),{key:0,vertical:"",wrap:!1},{default:m((()=>[(r(!0),v(d,null,f(i(z),(e=>(r(),u(i(g),{size:"tiny",key:e,onClick:l=>function(e){K(e),O.value=!1}(e)},{default:m((()=>[s(p(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):_("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}}),[["__file","editTime.vue"]]);export{R as default};
|
|
1
|
+
import{defineComponent as e,useAttrs as l,ref as t,watch as a,nextTick as o,openBlock as r,createBlock as u,unref as i,mergeProps as n,withCtx as m,createVNode as c,createElementBlock as v,Fragment as d,renderList as f,createTextVNode as s,toDisplayString as p,createCommentVNode as _}from"vue";import{NPopover as k,NInput as h,NSpace as y,NScrollbar as w,NButton as g}from"naive-ui";import{useIhoTableFormEvent as b}from"../../../../utils/index.js";import{useAutoFocus as V}from"../hooks/useAutoFocus.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as j,format as q}from"date-fns";import x from"../../../../../../../_virtual/plugin-vue_export-helper.js";var R=x(e({__name:"editTime",props:{formattedValue:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:formattedValue","click"],setup(e,{emit:x}){const R=e,S=l(),{emitFormChangeWithParams:A}=b(R),{formRef:I,isShow:O}=V(),P=t(),$=t(),E=t();let H=R.formattedValue;const{placeholder:T="请选择",valueFormat:U="HH:mm",shortcutOptions:z=[]}=S,D={placeholder:T,valueFormat:U,format:U};function K(e){E.value=e,H!==e&&(x("update:formattedValue",e),A({oldValue:H}),H=e)}function N(){[D.valueFormat.replace(/:/,""),D.valueFormat].some((e=>{const l=F(($.value||"").trim(),e,new Date);if(j(l)){return K(q(l,D.valueFormat)),!0}}))}function W(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=I.value)||l.blur(),O.value=!1)}return a((()=>R.formattedValue),(e=>{$.value=e,E.value=e}),{immediate:!0}),a((()=>O.value),(async e=>{var l,t,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(t=null==(l=P.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(e,l)=>(r(),u(i(k),n({show:i(O),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},e.$attrs,{onClickoutside:l[3]||(l[3]=()=>O.value=!1)}),{trigger:m((()=>[c(i(h),{ref_key:"formRef",ref:I,clearable:"",value:$.value,"onUpdate:value":l[0]||(l[0]=e=>$.value=e),onClick:l[1]||(l[1]=()=>O.value=!0),onChange:N,onKeydown:W},null,8,["value"])])),default:m((()=>[c(i(y),null,{default:m((()=>[c(i(C),n({ref_key:"timePickerRef",ref:P,show:"","formatted-value":E.value},i(D),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":K,onConfirm:l[2]||(l[2]=()=>O.value=!1)}),null,16,["formatted-value"]),c(i(w),{class:"iho-table__scrollbar"},{default:m((()=>[i(z).length?(r(),u(i(y),{key:0,vertical:"",wrap:!1},{default:m((()=>[(r(!0),v(d,null,f(i(z),(e=>(r(),u(i(g),{size:"tiny",key:e,onClick:l=>function(e){K(e),O.value=!1}(e)},{default:m((()=>[s(p(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):_("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}}),[["__file","editTime.vue"]]);export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{promiseTimeout as e}from"@vueuse/shared";import{isFunction as l,cloneDeep as n}from"lodash-es";import{nextTick as o,onBeforeUnmount as t}from"vue";import"../../../index.js";import i from"sortablejs";import d from"xe-utils";import{defineTablePlugin as r}from"../../hooks/useTablePlugin.js";function a(){const n="rowDragPlugin",d=new Map;return r({name:n,apply(r){r.fieldHooks.fieldEnd.tapPromise(n,(async(n,{$table:t,emits:r})=>{const{uuid:a}=n,s=n.sortableConfig||{};a&&s.enable&&!d.get(a)&&(await o(),async function n(o=0){if(o>2)return;const c=function(){var e,l,n,o,i,d,r,a,u,s;const c=null==(o=null==(n=null==(l=null==(e=t.value)?void 0:e.$el)?void 0:l.querySelector)?void 0:n.call(l,".vxe-table--body"))?void 0:o.scrollWidth,v=(null==(r=null==(d=null==(i=t.value)?void 0:i.$el)?void 0:d.querySelector)?void 0:r.call(d,".vxe-table.is--scroll-x"))?".fixed-left--wrapper>.vxe-table--body tbody":".body--wrapper>.vxe-table--body tbody";return c?null==(s=null==(u=null==(a=t.value)?void 0:a.$el)?void 0:u.querySelector)?void 0:s.call(u,v):null}();if(c){const e=i.create(c,{handle:".col--seq",...s,onEnd:e=>{var n,o,i,d,a,c,v;const{oldIndex:f=0,newIndex:x=0}=e,p={oldIndex:f,newIndex:x},{virtualY:b}=(null==(n=t.value)?void 0:n.getScroll())||{};if(b){const e=(null==(d=null==(i=null==(o=t.value)?void 0:o.getTableData())?void 0:i.tableData)?void 0:d[f])||{},l=null!=(v=null!=(c=e.__currentIndex)?c:null==(a=t.value)?void 0:a.getVTRowIndex(e))?v:0,n=l+(x-f);e.__currentIndex=n,p.oldIndex=l,p.newIndex=n}const
|
|
1
|
+
import{promiseTimeout as e}from"@vueuse/shared";import{isFunction as l,cloneDeep as n}from"lodash-es";import{nextTick as o,onBeforeUnmount as t}from"vue";import"../../../index.js";import i from"sortablejs";import d from"xe-utils";import{defineTablePlugin as r}from"../../hooks/useTablePlugin.js";function a(){const n="rowDragPlugin",d=new Map;return r({name:n,apply(r){r.fieldHooks.fieldEnd.tapPromise(n,(async(n,{$table:t,emits:r})=>{const{uuid:a}=n,s=n.sortableConfig||{};a&&s.enable&&!d.get(a)&&(await o(),async function n(o=0){if(o>2)return;const c=function(){var e,l,n,o,i,d,r,a,u,s;const c=null==(o=null==(n=null==(l=null==(e=t.value)?void 0:e.$el)?void 0:l.querySelector)?void 0:n.call(l,".vxe-table--body"))?void 0:o.scrollWidth,v=(null==(r=null==(d=null==(i=t.value)?void 0:i.$el)?void 0:d.querySelector)?void 0:r.call(d,".vxe-table.is--scroll-x"))?".fixed-left--wrapper>.vxe-table--body tbody":".body--wrapper>.vxe-table--body tbody";return c?null==(s=null==(u=null==(a=t.value)?void 0:a.$el)?void 0:u.querySelector)?void 0:s.call(u,v):null}();if(c){const e=i.create(c,{handle:".col--seq",...s,onEnd:e=>{var n,o,i,d,a,c,v;const{oldIndex:f=0,newIndex:x=0}=e,p={oldIndex:f,newIndex:x},{virtualY:b}=(null==(n=t.value)?void 0:n.getScroll())||{};if(b){const e=(null==(d=null==(i=null==(o=t.value)?void 0:o.getTableData())?void 0:i.tableData)?void 0:d[f])||{},l=null!=(v=null!=(c=e.__currentIndex)?c:null==(a=t.value)?void 0:a.getVTRowIndex(e))?v:0,n=l+(x-f);e.__currentIndex=n,p.oldIndex=l,p.newIndex=n}const y={...e,...p,...u(e,p,t.value)};r("rowDrag",y),l(s.onEnd)&&s.onEnd(y)}});return d.set(a,e)}await e(100),n(++o)}())})),r.setupHooks.setup.tap(n,(e=>{t((()=>{var l,n;const o=null==(l=e.value)?void 0:l.uuid;o&&d.has(o)&&(null==(n=d.get(o))||n.destroy(),d.delete(o))}))}))}})}function u(e,l,o){var t;const i=null==(t=null==o?void 0:o.getTableData())?void 0:t.fullData,r=o.treeConfig&&o.treeConfig.transform?function(e,l){var o,t,i,r,a;const{oldIndex:u=0,newIndex:s=0}=e,c={children:"childrenList"},{fullData:v,tableData:f}=l.getTableData(),x=null==f?void 0:f[u],p=null==f?void 0:f[s-1],b=n(v),y=d.findTree(b,(e=>e.__id===x.__id),c);if(p){const e=null==(t=null==(o=l.$el)?void 0:o.querySelector)?void 0:t.call(o,".body--wrapper>.vxe-table--body tbody"),n=null==(r=null==(i=l.$el)?void 0:i.querySelector)?void 0:r.call(i,".fixed-left--wrapper>.vxe-table--body tbody"),v=d.findTree(b,(e=>e.__id===p.__id),c);if(d.findTree(x[c.children],(e=>e.__id===p.__id),c)){const l=e.children[u],o=e.children[s];return e.insertBefore(o,l),null==(a=null==n?void 0:n.insertBefore)||a.call(n,n.children[s],n.children[u]),console.log("不允许自己给自己拖动"),b}const f=y.items.splice(y.index,1)[0];l.isTreeExpandByRow(p)?p[c.children].splice(0,0,f):v.items.splice(v.index+(y.index<v.index?0:1),0,f)}else{const e=y.items.splice(y.index,1)[0];b.unshift(e)}return b}(e,o):function(e,l){var o;const{oldIndex:t=0,newIndex:i=0}=e,d=n((null==(o=null==l?void 0:l.getTableData())?void 0:o.fullData)||[]),r=d.splice(t,1)[0];return d.splice(i,0,r),d}(l,o);return{oldData:i,newData:r}}export{a as rowDragPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{traverse as e,uuidGenerator as t,DMZ as r}from"../../../../../shared/utils/index.js";import{isArray as n,isFunction as i}from"lodash-es";import{onBeforeUnmount as
|
|
1
|
+
import{traverse as e,uuidGenerator as t,DMZ as r}from"../../../../../shared/utils/index.js";import{isArray as n,isFunction as i,isEmpty as o}from"lodash-es";import{onBeforeUnmount as s}from"vue";import"../../../index.js";import{HIGHEST_PRIORITY as d,IHO_TABLE_TREE_TYPE as a}from"../../constants/index.js";import{isTransformTreeType as l}from"../../utils/index.js";import{defineTablePlugin as f}from"../../hooks/useTablePlugin.js";function u(){const u="virtualTreePlugin",p=new Map;return f({name:u,apply(f){f.configHooks.treeConfig.tap({name:u,stage:d},((e,t)=>l(t)?Object.assign({transform:!0,expandAll:!0,reserve:!0,children:"childrenList",rowField:"__id"},e):e)),f.dataHooks.data.tap(u,((r,i,o)=>{if(!i.treeConfig)return;const{transform:s,rowField:d="__id",parentField:a="parentId",children:f="childrenList"}=i.treeConfig;function u(e){e[d]=e[d]||e.theUniqueKey||t()}l(i)&&s&&(u(r),n(r[f])&&e(r[f],((e,t,r)=>{r&&(e[a]=r[d]),o.insertAfter(e),u(e)}),f,r))})),f.fieldHooks.fieldList.tap(u,((e,t)=>{if(!t.treeConfig)return e;const{transform:n}=t.treeConfig||r;if(!l(t)||!n||!t.uuid)return e;const i=e.filter((e=>!1!==e.visible));let o=i.findIndex((e=>e.treeNode));~o||i.some(((e,t)=>{if(!e.type)return o=t,e.treeNode=!0}));const s=i.length-o-i.filter((e=>"right"===e.fixed)).length;return p.set(t.uuid,{index:o,colspan:s}),e})),f.configHooks.treeConfig.tap(u,((e,t)=>{if(!e)return e;const{transform:r,parentField:n="parentId",hasChild:s="hasChild",children:d="childrenList"}=e;if(i(t.spanMethod)||!r||`${t.isTree}`!==a.TRANSFORM_WITH_SPAN_METHOD)return e;const l=Object.freeze({rowspan:0,colspan:0});return t.spanMethod=({row:e,column:r,$columnIndex:i})=>{const a=p.get(t.uuid);if(a&&(Reflect.has(e,s)?e[s]:!e[n])&&!o(e[d]))return r.treeNode?{rowspan:1,colspan:a.colspan}:"right"!==r.fixed&&i>=a.index?l:void 0},e})),f.setupHooks.setup.tap(u,(e=>{s((()=>{var t;(null==(t=e.value)?void 0:t.uuid)&&p.delete(e.value.uuid)}))}))}})}export{u as virtualTreePlugin};
|
|
@@ -29,6 +29,7 @@ declare const CQuickSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
29
29
|
handlerInitSearchItem(arr: import("..").ISearchType[]): void;
|
|
30
30
|
};
|
|
31
31
|
getRenderSearchConObj: (cfg: import("..").ISearchType) => {
|
|
32
|
+
widgetType: any;
|
|
32
33
|
field_key: string;
|
|
33
34
|
con: string | undefined;
|
|
34
35
|
value: any[] | null;
|
|
@@ -162,6 +162,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
162
162
|
requestCache?: boolean | undefined;
|
|
163
163
|
maxGroupNum?: number | undefined;
|
|
164
164
|
jsonCombination?: boolean | undefined;
|
|
165
|
+
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
165
166
|
children?: any[] | undefined;
|
|
166
167
|
properties?: any[] | undefined;
|
|
167
168
|
componentProps?: import("../../../es/shared/types").AnyObject | undefined;
|
|
@@ -164,6 +164,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
164
164
|
requestCache?: boolean | undefined;
|
|
165
165
|
maxGroupNum?: number | undefined;
|
|
166
166
|
jsonCombination?: boolean | undefined;
|
|
167
|
+
combinationItemDeletable?: boolean | import("../../../../es/components/form-render").CombinationItemDeletableFn | undefined;
|
|
167
168
|
children?: any[] | undefined;
|
|
168
169
|
properties?: any[] | undefined;
|
|
169
170
|
componentProps?: import("../../../../es/shared/types").AnyObject | undefined;
|
|
@@ -50,7 +50,45 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
50
50
|
valueCp: import("vue").Ref<any>;
|
|
51
51
|
dateFormat: import("vue").ComputedRef<string>;
|
|
52
52
|
handleChange: (val: any) => void;
|
|
53
|
-
|
|
53
|
+
CDatePicker: import("../../../../..").SFCWithInstall<import("vue").DefineComponent<{
|
|
54
|
+
updateUnchangedValue: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
};
|
|
57
|
+
onConfirm: {
|
|
58
|
+
type: FunctionConstructor;
|
|
59
|
+
};
|
|
60
|
+
}, {
|
|
61
|
+
attrs: {
|
|
62
|
+
[x: string]: unknown;
|
|
63
|
+
};
|
|
64
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
65
|
+
updateUnchangedValue: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
};
|
|
68
|
+
onConfirm: {
|
|
69
|
+
type: FunctionConstructor;
|
|
70
|
+
};
|
|
71
|
+
}>> & {}>>;
|
|
72
|
+
datePickerRef: import("vue").Ref<import("../../../../..").AnyObject | null>;
|
|
73
|
+
panelInstRef: import("vue").Ref<null>;
|
|
74
|
+
isDateTime: import("vue").ComputedRef<boolean>;
|
|
75
|
+
formatRef: import("vue").ComputedRef<string>;
|
|
76
|
+
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
|
77
|
+
focus: () => any;
|
|
78
|
+
blur: () => any;
|
|
79
|
+
onUpdateShow: (show: boolean) => void;
|
|
80
|
+
onConfirm: (...args: any[]) => void;
|
|
81
|
+
NDatePicker: any;
|
|
82
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
83
|
+
updateUnchangedValue: {
|
|
84
|
+
type: BooleanConstructor;
|
|
85
|
+
};
|
|
86
|
+
onConfirm: {
|
|
87
|
+
type: FunctionConstructor;
|
|
88
|
+
};
|
|
89
|
+
}>>, {
|
|
90
|
+
updateUnchangedValue: boolean;
|
|
91
|
+
}>>;
|
|
54
92
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
55
93
|
type: {
|
|
56
94
|
type: PropType<ITypeDate>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as a,computed as t,watch as l,openBlock as r,createBlock as u,unref as o}from"vue";import
|
|
1
|
+
import{defineComponent as e,ref as a,computed as t,watch as l,openBlock as r,createBlock as u,unref as o}from"vue";import p from"../../../../../date-picker/index.js";import m from"moment";import{isString as d}from"lodash-es";import v from"../../../../../../_virtual/plugin-vue_export-helper.js";var i=v(e({__name:"Date",props:{type:{type:String,default:"date"},clearable:{type:Boolean,default:!1},valueFormat:{type:String,default:"yyyy-MM-dd"},placeholder:{type:String,default:"请输入"},value:{type:String,default:""}},emits:["update:value"],setup(e,{emit:v}){const i=e,n=a(),c=t((()=>{let e="";switch(i.type){case"date":e="YYYY-MM-DD";break;case"datetime":e="YYYY-MM-DD HH:mm:ss"}return e}));function f(e){n.value=e;const a=e?m(e).format(c.value):e;v("update:value",a)}return l((()=>i.value),(e=>{e&&d(e)?n.value=m(e).valueOf():n.value=null}),{immediate:!0}),(a,t)=>(r(),u(o(p),{type:e.type,clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.placeholder,value:n.value,"onUpdate:value":f},null,8,["type","clearable","valueFormat","placeholder","value"]))}}),[["__file","Date.vue"]]);export{i as default};
|
package/es/components/table-filter/src/components/render-widget/components/DateRange.vue.d.ts
CHANGED
|
@@ -73,8 +73,48 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
73
73
|
initData: () => void;
|
|
74
74
|
handleRadioClick: (value: string) => void;
|
|
75
75
|
handleChange: (val: any, type: 'start' | 'end') => void;
|
|
76
|
-
|
|
76
|
+
isStartDateDisabled: (ts: number) => boolean;
|
|
77
|
+
isEndDateDisabled: (ts: number) => boolean;
|
|
77
78
|
NButton: any;
|
|
79
|
+
CDatePicker: import("../../../../..").SFCWithInstall<import("vue").DefineComponent<{
|
|
80
|
+
updateUnchangedValue: {
|
|
81
|
+
type: BooleanConstructor;
|
|
82
|
+
};
|
|
83
|
+
onConfirm: {
|
|
84
|
+
type: FunctionConstructor;
|
|
85
|
+
};
|
|
86
|
+
}, {
|
|
87
|
+
attrs: {
|
|
88
|
+
[x: string]: unknown;
|
|
89
|
+
};
|
|
90
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
91
|
+
updateUnchangedValue: {
|
|
92
|
+
type: BooleanConstructor;
|
|
93
|
+
};
|
|
94
|
+
onConfirm: {
|
|
95
|
+
type: FunctionConstructor;
|
|
96
|
+
};
|
|
97
|
+
}>> & {}>>;
|
|
98
|
+
datePickerRef: import("vue").Ref<import("../../../../..").AnyObject | null>;
|
|
99
|
+
panelInstRef: import("vue").Ref<null>;
|
|
100
|
+
isDateTime: import("vue").ComputedRef<boolean>;
|
|
101
|
+
formatRef: import("vue").ComputedRef<string>;
|
|
102
|
+
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
|
103
|
+
focus: () => any;
|
|
104
|
+
blur: () => any;
|
|
105
|
+
onUpdateShow: (show: boolean) => void;
|
|
106
|
+
onConfirm: (...args: any[]) => void;
|
|
107
|
+
NDatePicker: any;
|
|
108
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
109
|
+
updateUnchangedValue: {
|
|
110
|
+
type: BooleanConstructor;
|
|
111
|
+
};
|
|
112
|
+
onConfirm: {
|
|
113
|
+
type: FunctionConstructor;
|
|
114
|
+
};
|
|
115
|
+
}>>, {
|
|
116
|
+
updateUnchangedValue: boolean;
|
|
117
|
+
}>>;
|
|
78
118
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
79
119
|
type: {
|
|
80
120
|
type: PropType<ITypeDate>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as u,createElementBlock as r,Fragment as
|
|
1
|
+
import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as u,createElementBlock as r,Fragment as i,renderList as v,normalizeClass as d,toDisplayString as o,createCommentVNode as n,createVNode as s,unref as c,withCtx as p,createTextVNode as m,createElementVNode as f}from"vue";import{NButton as y}from"naive-ui";import h from"../../../../../date-picker/index.js";import b from"moment";import{isString as g}from"lodash-es";import{getAllDateRangeInfo as k}from"../helpers/presetValToTimestamp.js";import Y from"../../../../../../_virtual/plugin-vue_export-helper.js";const F={class:"render-widget-date-range"},_={key:0,class:"radio-date-group"},D=["onClick"],M={key:1,class:"date-detail-range"},x=f("span",{class:"divider"},null,-1);var S=Y(e({__name:"DateRange",props:{type:{type:String,default:"date"},filterExplicit:{type:Number,default:1},clearable:{type:Boolean,default:!1},valueFormat:{type:String,default:"yyyy-MM-dd"},startPlaceholder:{type:String,default:"起始"},endPlaceholder:{type:String,default:"截止"},value:{type:String,default:""}},emits:["update:value"],setup(e,{emit:f}){const Y=e,S=a([]),w=a(!0),P=a(""),j=a(),C=a(),E=l((()=>{let e="";switch(Y.type){case"date":e="YYYY-MM-DD";break;case"datetime":e="YYYY-MM-DD HH:mm:ss"}return e})),H=l((()=>{let e="";switch(Y.type){case"date":e="选择日期";break;case"datetime":e="选择时间"}return e}));function O(e,a){switch(a){case"start":j.value=e;break;case"end":C.value=e}const l=j.value?b(j.value).format(E.value):null,t=C.value?b(C.value).format(E.value):null;f("update:value",l||t?`${null!=l?l:""} ~ ${null!=t?t:""}`:"")}function R(e){return!!C.value&&e>C.value}function T(e){return!!j.value&&e<j.value}return t((()=>Y.value),(e=>{if(e&&g(e)&&e.includes("~")){const[a,l]=e.split("~");return a.trim()&&(j.value=b(a.trim()).valueOf()),void(l.trim()&&(C.value=b(l.trim()).valueOf()))}j.value=C.value=null,P.value=""}),{immediate:!0}),function(){const e=k(E.value);S.value=e}(),(a,l)=>(u(),r("div",F,[0===e.filterExplicit?(u(),r(i,{key:0},[w.value?n("v-if",!0):(u(),r("div",_,[(u(!0),r(i,null,v(S.value,(e=>(u(),r("span",{key:e.value,class:d(["radio-date-item",P.value===e.value?"radio-date-item-active":""]),onClick:a=>{return l=e.value,P.value===l?P.value="":P.value=l,void(P.value&&f("update:value",P.value));var l}},o(e.label),11,D)))),128))])),s(c(y),{secondary:"",class:d(w.value?"select-date-right":"select-date-left"),onClick:l[0]||(l[0]=e=>w.value=!w.value)},{default:p((()=>[m(o(c(H)),1)])),_:1},8,["class"])],64)):n("v-if",!0),w.value?(u(),r("div",M,[s(c(h),{type:e.type,"default-time":"00:00:00",clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.startPlaceholder,value:j.value,"is-date-disabled":R,"onUpdate:value":l[1]||(l[1]=e=>O(e,"start"))},null,8,["type","clearable","valueFormat","placeholder","value"]),x,s(c(h),{type:e.type,"default-time":"23:59:59",clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.endPlaceholder,value:C.value,"is-date-disabled":T,"onUpdate:value":l[2]||(l[2]=e=>O(e,"end"))},null,8,["type","clearable","valueFormat","placeholder","value"])])):n("v-if",!0)]))}}),[["__file","DateRange.vue"]]);export{S as default};
|
package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,watch as
|
|
1
|
+
import{defineComponent as e,ref as l,watch as t,openBlock as u,createBlock as r,unref as a,withCtx as i,createVNode as n,createElementVNode as p}from"vue";import{NInputGroup as o,NInputNumber as d}from"naive-ui";import{isString as m}from"lodash-es";import s from"../../../../../../_virtual/plugin-vue_export-helper.js";const v=p("span",{class:"divider"}," ~ ",-1);var c=s(e({__name:"InputNumberGroup",props:{startPlaceholder:{type:String,default:"请输入"},endPlaceholder:{type:String,default:"请输入"},value:{type:String,default:""}},emits:["update:value"],setup(e,{emit:p}){const s=e,c=l(),h=l();function f(e,l){var t,u;let r="";switch(l){case"startNumber":r=`${null!=e?e:""} ~ ${null!=(t=h.value)?t:""}`;break;case"endNumber":r=`${null!=(u=c.value)?u:""} ~ ${null!=e?e:""}`}const a=r.split(" ~ ").some((e=>e.trim()));p("update:value",a?r:"")}return t((()=>s.value),(e=>{if(c.value=h.value=null,e&&m(e)&&e.includes("~")){const[l,t]=e.split("~");return l.trim()&&(c.value=Number(l.trim())),void(t.trim()&&(h.value=Number(t.trim())))}}),{immediate:!0}),(l,t)=>(u(),r(a(o),{class:"render-widget-input-number-group"},{default:i((()=>[n(a(d),{style:{minWidth:"88px"},placeholder:e.startPlaceholder,value:c.value,"onUpdate:value":t[0]||(t[0]=e=>f(e,"startNumber"))},null,8,["placeholder","value"]),v,n(a(d),{style:{minWidth:"88px"},placeholder:e.endPlaceholder,value:h.value,"onUpdate:value":t[1]||(t[1]=e=>f(e,"endNumber"))},null,8,["placeholder","value"])])),_:1}))}}),[["__file","InputNumberGroup.vue"]]);export{c as default};
|
|
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
26
26
|
selectOptions: import("vue").Ref<any[]>;
|
|
27
27
|
isRemote: import("vue").Ref<boolean>;
|
|
28
28
|
isLoading: import("vue").Ref<boolean>;
|
|
29
|
-
valueCp: import("vue").WritableComputedRef<
|
|
29
|
+
valueCp: import("vue").WritableComputedRef<unknown>;
|
|
30
30
|
searchOptions: (keyword: string) => Promise<any>;
|
|
31
31
|
_handleSearch: (query: string) => Promise<void>;
|
|
32
32
|
handleSearch: (query: string) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as a,ref as t,computed as n,openBlock as l,createBlock as i,unref as o,mergeProps as
|
|
1
|
+
import{defineComponent as e,useAttrs as a,ref as t,computed as n,openBlock as l,createBlock as i,unref as o,mergeProps as r,isRef as u,h as s}from"vue";import{NSelect as c,NTag as p}from"naive-ui";import{useDebounceFn as v}from"@vueuse/core";import d from"../../../hooks/useMixins.js";import f from"../../../../../../_virtual/plugin-vue_export-helper.js";var y=f(e({__name:"Select",props:{value:{type:[Array,String,Number]},filterApiConfig:{type:Object}},emits:["update:value","changeInitState"],setup(e,{emit:f}){const y=e,{handleGetConfigApi:m}=d(),g=a(),h=t([]),b=t(!1),w=t(!1),A=n({set(e){const a=Array.isArray(e)?e:e?[e]:null;f("update:value",a)},get(){if(Array.isArray(y.value)&&y.value.length>0){const{multiple:e}=g;return e||1!=y.value.length?y.value:y.value[0]}return y.value}});async function I(e){try{if(g.dynamicOptionInfo){const{autograph:a,dataSourceId:t,dataSourceType:n,filterKeys:l,showKeys:i,valueKey:o}=g.dynamicOptionInfo;let r={wordbookId:t,autograph:a,wordbookType:n,fieldKeys:l,keyword:e,page:1};w.value=!0;let u=await m(r,"requestDynamicSelect",{},y.filterApiConfig);if(u){const{fieldList:e,rows:a}=u,t=a.map((e=>({...e,label:e[i[0]],value:e[o]})));return h.value=t,t}}}catch(e){console.log(e)}finally{w.value=!1}}const S=v((async e=>{await async function(e){const{manualMapping:a}=g;if(!a){const a=e.trim();await I(a)}}(e)}),300);async function C(){const{manualMapping:e,dynamicOptionInfo:a,valueList:t}=g;if(e&&Array.isArray(t))return b.value=!1,void(h.value=t.map((({value:e,label:a})=>({value:e,label:a}))));Object.keys(a).length>0&&y.filterApiConfig&&(b.value=!0,await I(""))}function O(e){const{manualMapping:a}=g;if(a)return s("div",e.label);const{showKeys:t=[]}=g.dynamicOptionInfo;return g.dynamicOptionInfo&&t.length>0?s("div",{class:"select-widget-dynamic-option"},t.map((a=>s("span",{class:"select-widget-dynamic-item"},e[a])))):s("div",e.label)}function _({option:e,handleClose:a}){const{multiple:t}=g;return t?s(p,{style:{padding:"0 8px"},closable:!0,onClose:e=>{e.stopPropagation(),a()}},{default:()=>s("div",e.label)}):s("div",e.label)}return async function(){const{manualMapping:e,defValue:a,defValueUnit:t,_frontId:n,isInit:l}=g;await C();const i=Array.isArray(y.value)?y.value.length>0:y.value;if(!l&&!i){if(e)return f("update:value",a),void f("changeInitState",n,!0);if(t)switch(t){case"FIRST":{const e=h.value[0];f("update:value",[e.value]),f("changeInitState",n,!0);break}}}}(),(e,a)=>(l(),i(o(c),r(o(g),{value:o(A),"onUpdate:value":a[0]||(a[0]=e=>u(A)?A.value=e:null),loading:w.value,options:h.value,remote:b.value,"render-label":O,"render-tag":_,onSearch:o(S),onClear:C}),null,16,["value","loading","options","remote","onSearch"]))}}),[["__file","Select.vue"]]);export{y as default};
|
|
@@ -44,7 +44,7 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
44
44
|
selectOptions: import("vue").Ref<any[]>;
|
|
45
45
|
isRemote: import("vue").Ref<boolean>;
|
|
46
46
|
isLoading: import("vue").Ref<boolean>;
|
|
47
|
-
valueCp: import("vue").WritableComputedRef<
|
|
47
|
+
valueCp: import("vue").WritableComputedRef<unknown>;
|
|
48
48
|
searchOptions: (keyword: string) => Promise<any>;
|
|
49
49
|
_handleSearch: (query: string) => Promise<void>;
|
|
50
50
|
handleSearch: (query: string) => Promise<void>;
|
|
@@ -134,7 +134,45 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
134
134
|
valueCp: import("vue").Ref<any>;
|
|
135
135
|
dateFormat: import("vue").ComputedRef<string>;
|
|
136
136
|
handleChange: (val: any) => void;
|
|
137
|
-
|
|
137
|
+
CDatePicker: import("../../../..").SFCWithInstall<import("vue").DefineComponent<{
|
|
138
|
+
updateUnchangedValue: {
|
|
139
|
+
type: BooleanConstructor;
|
|
140
|
+
};
|
|
141
|
+
onConfirm: {
|
|
142
|
+
type: FunctionConstructor;
|
|
143
|
+
};
|
|
144
|
+
}, {
|
|
145
|
+
attrs: {
|
|
146
|
+
[x: string]: unknown;
|
|
147
|
+
};
|
|
148
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
149
|
+
updateUnchangedValue: {
|
|
150
|
+
type: BooleanConstructor;
|
|
151
|
+
};
|
|
152
|
+
onConfirm: {
|
|
153
|
+
type: FunctionConstructor;
|
|
154
|
+
};
|
|
155
|
+
}>> & {}>>;
|
|
156
|
+
datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
|
|
157
|
+
panelInstRef: import("vue").Ref<null>;
|
|
158
|
+
isDateTime: import("vue").ComputedRef<boolean>;
|
|
159
|
+
formatRef: import("vue").ComputedRef<string>;
|
|
160
|
+
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
|
161
|
+
focus: () => any;
|
|
162
|
+
blur: () => any;
|
|
163
|
+
onUpdateShow: (show: boolean) => void;
|
|
164
|
+
onConfirm: (...args: any[]) => void;
|
|
165
|
+
NDatePicker: any;
|
|
166
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
167
|
+
updateUnchangedValue: {
|
|
168
|
+
type: BooleanConstructor;
|
|
169
|
+
};
|
|
170
|
+
onConfirm: {
|
|
171
|
+
type: FunctionConstructor;
|
|
172
|
+
};
|
|
173
|
+
}>>, {
|
|
174
|
+
updateUnchangedValue: boolean;
|
|
175
|
+
}>>;
|
|
138
176
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
139
177
|
type: {
|
|
140
178
|
type: import("vue").PropType<"date" | "datetime">;
|
|
@@ -251,8 +289,48 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
251
289
|
initData: () => void;
|
|
252
290
|
handleRadioClick: (value: string) => void;
|
|
253
291
|
handleChange: (val: any, type: "end" | "start") => void;
|
|
254
|
-
|
|
292
|
+
isStartDateDisabled: (ts: number) => boolean;
|
|
293
|
+
isEndDateDisabled: (ts: number) => boolean;
|
|
255
294
|
NButton: any;
|
|
295
|
+
CDatePicker: import("../../../..").SFCWithInstall<import("vue").DefineComponent<{
|
|
296
|
+
updateUnchangedValue: {
|
|
297
|
+
type: BooleanConstructor;
|
|
298
|
+
};
|
|
299
|
+
onConfirm: {
|
|
300
|
+
type: FunctionConstructor;
|
|
301
|
+
};
|
|
302
|
+
}, {
|
|
303
|
+
attrs: {
|
|
304
|
+
[x: string]: unknown;
|
|
305
|
+
};
|
|
306
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
307
|
+
updateUnchangedValue: {
|
|
308
|
+
type: BooleanConstructor;
|
|
309
|
+
};
|
|
310
|
+
onConfirm: {
|
|
311
|
+
type: FunctionConstructor;
|
|
312
|
+
};
|
|
313
|
+
}>> & {}>>;
|
|
314
|
+
datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
|
|
315
|
+
panelInstRef: import("vue").Ref<null>;
|
|
316
|
+
isDateTime: import("vue").ComputedRef<boolean>;
|
|
317
|
+
formatRef: import("vue").ComputedRef<string>;
|
|
318
|
+
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
|
319
|
+
focus: () => any;
|
|
320
|
+
blur: () => any;
|
|
321
|
+
onUpdateShow: (show: boolean) => void;
|
|
322
|
+
onConfirm: (...args: any[]) => void;
|
|
323
|
+
NDatePicker: any;
|
|
324
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
325
|
+
updateUnchangedValue: {
|
|
326
|
+
type: BooleanConstructor;
|
|
327
|
+
};
|
|
328
|
+
onConfirm: {
|
|
329
|
+
type: FunctionConstructor;
|
|
330
|
+
};
|
|
331
|
+
}>>, {
|
|
332
|
+
updateUnchangedValue: boolean;
|
|
333
|
+
}>>;
|
|
256
334
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
257
335
|
type: {
|
|
258
336
|
type: import("vue").PropType<"date" | "datetime">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WidgetOptionEnums as e,WidgetTypeEnums as t}from"../types/enums.js";import{presetValToTimestamp as i}from"../components/render-widget/helpers/presetValToTimestamp.js";import{DatePresetValEnums as n}from"../components/render-widget/enums.js";const l={[e.RADIO]:"0",[e.MULTIPLE]:"1",[e.ALL]:"0",[e.SELECT_TIME]:"1",[e.PAST_TIME]:"2",[e.FUTURE_TIME]:"3"};function a(){return{transformData:function(i){return i.map((i=>{var n,a;const{optionInfo:o={list:[],manualMapping:!0,dynamicOptionInfo:{}},type:u,defaultValue:r,optionType:s,filterExplicit:p,rangeFilter:d}=i,c={},
|
|
1
|
+
import{WidgetOptionEnums as e,WidgetTypeEnums as t}from"../types/enums.js";import{presetValToTimestamp as i}from"../components/render-widget/helpers/presetValToTimestamp.js";import{DatePresetValEnums as n}from"../components/render-widget/enums.js";const l={[e.RADIO]:"0",[e.MULTIPLE]:"1",[e.ALL]:"0",[e.SELECT_TIME]:"1",[e.PAST_TIME]:"2",[e.FUTURE_TIME]:"3"};function a(){return{transformData:function(i){return i.map((i=>{var n,a;const{optionInfo:o={list:[],manualMapping:!0,dynamicOptionInfo:{}},type:u,defaultValue:r,optionType:s,filterExplicit:p,rangeFilter:d}=i,c={},E={title:(m=i).title,alias:m.customTitle,isShowSearch:m.isShowSearch?1:0,filterExplicit:m.filterExplicit?1:0,explicitRequired:m.explicitRequired?1:0,advanceOptionSetting:m.optionType?l[m.optionType]:"",placeholder:m.remark,advanceColWidth:m.width};var m;let f,T,v=u;p?(f=u===t.SELECT&&s===e.MULTIPLE?null==r?void 0:r.valueList:null==(n=null==r?void 0:r.valueList)?void 0:n[0],T=null==r?void 0:r.unit):u===t.SELECT&&(null==o?void 0:o.list)&&(null==o?void 0:o.list.length)<10&&(v="CHECKBOX_GROUP"),d&&(u===t.INPUT_NUMBER&&(v="INPUTNUMBER_RANGE"),u===t.DATE&&(v="DATE_RANGE"),u===t.DATE_TIME&&(v="DATETIME_RANGE"));const g={isRender:!0,isInit:!1,widgetType:v,valueList:null==(a=null==o?void 0:o.list)?void 0:a.map((({name:e,value:t})=>({value:t,label:e}))),defaultValue:f,defValueUnit:T,multiple:s===e.MULTIPLE,manualMapping:null==o?void 0:o.manualMapping,dynamicOptionInfo:null==o?void 0:o.dynamicOptionInfo};return{...E,fieldType:i.dataType,columnName:i.name,settingObj:c,setting:JSON.stringify(c),widgetCfg:g,rangeFilter:d}}))},getCacheDef:function(e,i){const{widgetType:n,widgetCfg:l}=e;return n!==t.SELECT&&n!==t.CHECKBOX_GROUP||!l.multiple?i[0]:i},transformClassifyChild:function(e){const t={};return e&&e.length>0&&e.forEach((e=>{const l=e.field_key,a=e.value&&e.value.length>1?e.value:e.value.toString();if(t[l]=a,e.unit&&e.unit!==n.CUSTOM){const n=i(e.unit,"YYYY-MM-DD HH:mm:ss");t[l]=n}})),t},transformParams:function(e){const i={},n=[t.SELECT];return e&&e.length>0&&e.forEach((e=>{const t=e.field_key,l=n.includes(e.widgetType)||e.value&&e.value.length>1?e.value:e.value.toString();i[t]=l})),i}}}export{a as default};
|
|
@@ -4,6 +4,7 @@ export default function (): {
|
|
|
4
4
|
getDefValByRenderWidget: (cfg: ISearchType) => any;
|
|
5
5
|
initRenderWidgetCfg: (cfg: ISearchType) => any;
|
|
6
6
|
getRenderSearchConObj: (cfg: ISearchType) => {
|
|
7
|
+
widgetType: any;
|
|
7
8
|
field_key: string;
|
|
8
9
|
con: string | undefined;
|
|
9
10
|
value: any[] | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WidgetCfgMaps as e}from"../components/render-widget/widgetCfgMaps.js";import{DatePresetValEnums as
|
|
1
|
+
import{WidgetCfgMaps as e}from"../components/render-widget/widgetCfgMaps.js";import{DatePresetValEnums as t}from"../components/render-widget/enums.js";import{WidgetTypeEnums as n}from"../types/enums.js";const r=[n.CHECKBOX_GROUP,n.DATE_RANGE,n.DATETIME_RANGE];function i(){function i(e){var t;return null==(t=e.widgetCfg)?void 0:t.isRender}function u(t){const{rangeFilter:n}=t,{widgetType:r,defaultValue:i,defValueUnit:u}=t.widgetCfg||{},l=e.get(r);let o;if(l){const{setDefaultValue:e}=l;e&&!n&&(o=e(i,u))}return o}return{isRender:i,getDefValByRenderWidget:u,initRenderWidgetCfg:function(e){const t=i(e);if(!t)return t;const{widgetType:n}=e.widgetCfg||{};return e._frontId||(e._frontId="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))),e.isRender=t,e.widgetType=n,e.con="EQ",r.includes(n)&&(e._isBlock=!0),e.value=u(e),t},getRenderSearchConObj:function(e){if(!i(e))return null;const{columnName:r,con:u,value:l,widgetType:o}=e;let d=null;[n.DATE,n.DATE_TIME].includes(o)&&(d=t.CUSTOM);const f=Array.isArray(l)?l:l?[l]:[];return{widgetType:o,field_key:r,con:u,value:f.length>0?f:null,unit:d}},getDefValByRenderConObj:function(e,t){if(!i(t))return null;const{widgetType:r,multiple:u}=t.widgetCfg||{},{value:l}=e;return r!==n.SELECT&&r!==n.CHECKBOX_GROUP||!u?Array.isArray(l)?l[0]:l:Array.isArray(l)?l:l?[l]:[]},isExistDefValByRenderWidget:function(e){const{defaultValue:t,defValueUnit:n}=e.widgetCfg||{};return!(!t&&!n)},resetRenderWidgetValue:function(e){const t=i(e);return t?(e.value=null,t):t}}}export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.44-beta.1",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.44-beta.1",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.44-beta.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"iOS 7",
|
|
62
62
|
"last 3 iOS versions"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "927adec22164092ff81df53c819705f208aa14fd"
|
|
65
65
|
}
|