cnhis-design-vue 3.1.44-beta.0 → 3.1.44-beta.10
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/base-search/src/index.vue.js +1 -1
- package/es/components/base-search/style/index.css +1 -1
- package/es/components/classification/index.d.ts +6 -2
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +6 -2
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +6 -2
- package/es/components/classification/src/index.vue.d.ts +6 -2
- package/es/components/fabric-chart/index.d.ts +4 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +4 -2
- package/es/components/fabric-chart/src/FabricChart.vue.js +1 -1
- package/es/components/fabric-chart/src/hooks/useBirthProcess.d.ts +2 -2
- package/es/components/fabric-chart/src/hooks/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCenter.d.ts +3 -3
- package/es/components/fabric-chart/src/hooks/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.d.ts +2 -4
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
- package/es/components/fabric-chart/src/hooks/useLeft.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/useRight.js +1 -1
- package/es/components/fabric-chart/src/hooks/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useTop.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useTop.js +1 -1
- package/es/components/fabric-chart/src/utils/utils.d.ts +2 -0
- package/es/components/fabric-chart/src/utils/utils.js +1 -1
- 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/levelSearchCascader.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useNuiThemeOverrides.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -0
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-select-label/index.d.ts +15 -4
- package/es/components/iho-select-label/src/LabelFormContent.vue.d.ts +5 -2
- package/es/components/iho-select-label/src/SelectLabel.vue.d.ts +10 -2
- package/es/components/iho-select-label/src/SelectLabel.vue.js +1 -1
- package/es/components/iho-select-label/src/components/label-classify.vue.d.ts +5 -2
- package/es/components/iho-select-label/src/components/label-classify.vue.js +1 -1
- package/es/components/iho-select-label/style/index.css +1 -1
- package/es/components/iho-table/src/IhoTable.vue.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/index.css +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/quick-search/style/index.css +1 -1
- package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
- package/es/components/search-cascader/style/index.css +1 -1
- 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/classify-filter/ValueCfg.vue.d.ts +6 -2
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +6 -2
- package/es/components/table-filter/src/components/render-widget/basicData.js +1 -1
- 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 → DateRangeInner.vue.d.ts} +42 -15
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +141 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.js +1 -0
- 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/Label.vue.d.ts +70 -0
- package/es/components/table-filter/src/components/render-widget/components/Label.vue.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/Select.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectLabel.vue.d.ts +56 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectLabel.vue.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +5 -2
- package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
- package/es/components/table-filter/src/components/render-widget/enums.d.ts +28 -7
- package/es/components/table-filter/src/components/render-widget/enums.js +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.d.ts +1 -0
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +1 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +377 -16
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
- package/es/components/table-filter/src/directive/resize.d.ts +4 -0
- package/es/components/table-filter/src/directive/resize.js +1 -0
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +1 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/tool/resizeSensor.d.ts +16 -0
- package/es/components/table-filter/src/tool/resizeSensor.js +1 -0
- package/es/components/table-filter/src/types/enums.d.ts +6 -2
- package/es/components/table-filter/src/types/enums.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +14 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/table-filter/src/components/render-widget/components/DateRange.vue.js +0 -1
|
@@ -12,3 +12,5 @@ export declare function isOneLine(type: string): boolean;
|
|
|
12
12
|
export declare function setOtherType(title: string, type: string): string;
|
|
13
13
|
export declare function getType(type: string): string;
|
|
14
14
|
export declare function isValidValue(value: number | string): boolean;
|
|
15
|
+
export declare function isOverlapPoint(pointObj1: any, pointObj2: any): boolean;
|
|
16
|
+
export declare function getFloorNumber(value: number, n?: number): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isNull as n}from"lodash-es";function
|
|
1
|
+
import{isNull as n}from"lodash-es";function t(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function e(n,t){const e={};for(const u in n)t.map((n=>n.type)).includes(u)||(e[u]=n[u]);return e}function u(n,t){const e=t.findIndex((t=>new Date(t.time).getTime()>new Date(n).getTime()));return~e?e:t.length}function r(n){return["temperature","pulse"].includes(n)}function o(n,t){return n.includes("心率")?"pulse_other":t}function i(n){return n.includes("_other")?n.split("_")[0]:n}function l(t){return!Number.isNaN(+t)&&!n(t)}function c(n,t){return f(n.left,1)===f(t.left,1)&&f(n.top,1)===f(t.top,1)}function f(n,t=100){return Math.floor(n*t)/t}export{e as deleteProperty,f as getFloorNumber,u as getIndex,i as getType,t as isEffectiveNode,r as isOneLine,c as isOverlapPoint,l as isValidValue,o as setOtherType};
|
|
@@ -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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as r,computed as t,inject as o,watch as a,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as i,isString as l,isEmpty as s,isFunction as c,omit as d}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as p}from"../../constants/index.js";import{useCommonInjection as
|
|
1
|
+
import{defineComponent as e,ref as r,computed as t,inject as o,watch as a,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as i,isString as l,isEmpty as s,isFunction as c,omit as d}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as p}from"../../constants/index.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{formRenderLog as f}from"../../utils/index.js";import{connect as m,mapProps as y}from"@formily/vue";import h from"../../../../search-cascader/index.js";import k from"../../../../../shared/components/no-data/NoData.vue.js";import{createVisitedSetter as j,assignUpdateValue as _}from"../../utils/schema.js";import{useFormField as w}from"../../hooks/useFormField.js";import{useFormRequest as b}from"../../hooks/useFormRequest.js";const g=m(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:m}){const y=u(e,"value",m),_=r(!1),g=r([]),{field:F,fieldKey:K}=w(),O=t((()=>{var r,t,o;return null!=(o=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?o:e.labelField})),q=t((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),S=t((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),x=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),C=o(p),{getSearchRequestInfo:L}=b();async function V(r,t){try{if(r&&!r.__keyword&&r.isLeaf)return o(r);if(null==r?void 0:r.__keyword){if(!l(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e)),o=await async function(r){if(!L().primaryKeyUrl)return[];try{return await C.addAsync(t(e.wordbook,e.autograph,r,K.value))}catch(e){l(e)&&f(e)}function t(r,t,o,a){const n=L();return{key:a,params:{autograph:t,tableId:r.id,primaryKeyValue:o.join(","),page:1},...n,url:n.primaryKeyUrl,cache:e.requestCache}}}(t);if(!o)return Promise.reject();const{lastOption:a,options:n}=function(e,r){let t=e[0];return{options:r.reduce(((r,a,n)=>{const u=o(e,a);return 0===n?(t=u,[u]):(Object.assign(u,{parent:t,isLeaf:n+1>=x.value}),t.children=[u],t=u,r)}),[]),lastOption:t};function o(e,r){return e.find((e=>e[q.value]===r))}}(o,t);return await V(a),s(a.children)?(y.value=function(e,r){return r.map((r=>e.find((e=>e[q.value]===r))))}(o,t),_.value=!1,Promise.reject()):(g.value=n,a)}{const n=await C.addAsync(function(r,o,a,n,u){const i={autograph:()=>o,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[q.value]}]:e.conObjFirstLevel||[]}(r,t,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},s=Object.entries(i).reduce(((e,[t,o])=>(e[t]=l(o)?r[o]:c(o)?o():void 0,e)),{});return{...L(),params:s,key:u,cache:e.requestCache}}(e.wordbook,e.autograph,F.value,r,K.value));if(r){if(!n.length)return o(r);r.children=n.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:a(r)+1>=t}}(e,r,x.value)))}else g.value=n.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[O.value]=e[S.value||O.value]||e[O.value]);return e}(e,t)))}}catch(e){l(e)&&f(e)}function o(e){return y.value=function(e){const r=[];let t=e;for(;t;)r.unshift(d(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),_.value=!1,Promise.reject()}function a(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}a((()=>e.wordbook),((r,t)=>{i(r,t)||(g.value=[],r&&(y.value||!e.lazyRequest)&&V())}),{immediate:!0});const{injectValueValidate:A,injectValueWatchFromEmpty:I,injectValueBindKey:P}=v();I(y,V),A(y);const R=P(y);return()=>n(h,{value:y.value,"onUpdate:value":e=>y.value=e,show:_.value,"onUpdate:show":e=>_.value=e,options:g.value,key:R.value,labelKey:O.value,valueKey:q.value,search:V,onFocus:j(F)},{empty:()=>n(k,null,null)})}}),y({dataSource:"options"},_));export{g as LEVEL_SEARCH_CASCADER};
|
|
@@ -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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(){return{nuiThemeOverrides:{common:{inputColorDisabled:"
|
|
1
|
+
function e(){return{nuiThemeOverrides:{common:{inputColorDisabled:"#F5F5F5",textColorDisabled:"#000000",placeholderColorDisabled:"#000000",borderColor:"#D5D5D5",errorColor:"#DE1919",placeholderColor:"rgba(0,0,0,0.4)"},Input:{paddingMedium:"8px",paddingSmall:"8px",paddingLarge:"8px",paddingTiny:"8px"},InternalSelection:{paddingSingle:"8px",paddingMultiple:"2px"},Form:{feedbackHeightMedium:"16px",feedbackHeightLarge:"16px",feedbackHeightSmall:"16px",feedbackFontSizeLarge:"12px",feedbackFontSizeMedium:"12px",feedbackFontSizeSmall:"12px",feedbackPadding:"0px"}}}}export{e as useNuiThemeOverrides};
|
|
@@ -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
|
-
.annotation-edit{align-items:center;color:var(--c-primary-color);cursor:pointer;display:inline-flex;font-size:16px;user-select:none}.annotation-edit.is-active{color:var(--c-primary-color);filter:hue-rotate(140deg)}.annotation-edit__icon{align-items:center;display:inline-flex}.annotation-edit__textarea{min-width:200px}.annotation-edit__footer{align-items:center;display:flex;flex-wrap:nowrap;gap:8px;justify-content:space-between;opacity:.5}.annotation-edit__footer>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.annotation-edit__footer>div:first-of-type{min-width:30%}.recommend-search__menu{min-height:100px}.recommend-search__menuRecommendList{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}.recommend-search__menuRecommendList .n-tag{cursor:pointer}.recommend-search__recentRecommend{margin-bottom:8px}.recommend-search__recentRecommend>header{align-items:center;color:rgba(0,0,0,.4);display:flex;justify-content:space-between}.recommend-search__recentRecommend>header .n-icon:hover{color:rgba(0,0,0,.6);cursor:pointer}.recommend-search__commonRecommend{margin-bottom:8px}.recommend-search__commonRecommend>header{align-items:center;color:rgba(0,0,0,.4);display:flex;justify-content:space-between}.recommend-search__commonRecommend>header .n-icon:hover{color:rgba(0,0,0,.6);cursor:pointer}.recommend-search__option{align-items:center;border-radius:4px;cursor:pointer;display:flex;height:32px;justify-content:space-between;padding:0 8px}.recommend-search__optionText{max-width:calc(100% - 24px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.recommend-search__option.is-active{color:var(--n-color)!important}.recommend-search__option.is-active .n-icon{font-size:20px}.recommend-search__option:hover{background:rgba(0,0,0,.03)}.recommend-search__optionContainer{margin:-8px -10px}.recommend-search__empty{align-items:center;color:rgba(0,0,0,.3);display:flex;height:100px;justify-content:center}.search-cascader__menuWrapper{display:flex;flex-wrap:nowrap;margin:-8px -14px}.search-cascader__input input{cursor:pointer!important}.search-cascader__option{align-items:center;border-radius:4px;box-sizing:border-box;display:flex;height:32px;justify-content:space-between;padding:0 8px 0 16px;width:
|
|
1
|
+
.annotation-edit{align-items:center;color:var(--c-primary-color);cursor:pointer;display:inline-flex;font-size:16px;user-select:none}.annotation-edit.is-active{color:var(--c-primary-color);filter:hue-rotate(140deg)}.annotation-edit__icon{align-items:center;display:inline-flex}.annotation-edit__textarea{min-width:200px}.annotation-edit__footer{align-items:center;display:flex;flex-wrap:nowrap;gap:8px;justify-content:space-between;opacity:.5}.annotation-edit__footer>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.annotation-edit__footer>div:first-of-type{min-width:30%}.recommend-search__menu{min-height:100px}.recommend-search__menuRecommendList{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}.recommend-search__menuRecommendList .n-tag{cursor:pointer}.recommend-search__recentRecommend{margin-bottom:8px}.recommend-search__recentRecommend>header{align-items:center;color:rgba(0,0,0,.4);display:flex;justify-content:space-between}.recommend-search__recentRecommend>header .n-icon:hover{color:rgba(0,0,0,.6);cursor:pointer}.recommend-search__commonRecommend{margin-bottom:8px}.recommend-search__commonRecommend>header{align-items:center;color:rgba(0,0,0,.4);display:flex;justify-content:space-between}.recommend-search__commonRecommend>header .n-icon:hover{color:rgba(0,0,0,.6);cursor:pointer}.recommend-search__option{align-items:center;border-radius:4px;cursor:pointer;display:flex;height:32px;justify-content:space-between;padding:0 8px}.recommend-search__optionText{max-width:calc(100% - 24px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.recommend-search__option.is-active{color:var(--n-color)!important}.recommend-search__option.is-active .n-icon{font-size:20px}.recommend-search__option:hover{background:rgba(0,0,0,.03)}.recommend-search__optionContainer{margin:-8px -10px}.recommend-search__empty{align-items:center;color:rgba(0,0,0,.3);display:flex;height:100px;justify-content:center}.search-cascader__menuWrapper{display:flex;flex-wrap:nowrap;margin:-8px -14px}.search-cascader__input input{cursor:pointer!important}.search-cascader__option{align-items:center;border-radius:4px;box-sizing:border-box;display:flex;height:32px;justify-content:space-between;min-width:100%;padding:0 8px 0 16px;width:fit-content}.search-cascader__option--active{background:#f8f8f8}.search-cascader__option:hover{background:#f5f5f5;cursor:pointer}.search-cascader__optionWrapper{background:#fff;height:256px;overflow-x:auto;width:calc(var(--menu-width)*1px)}.search-cascader__optionWrapper:not(:last-of-type){border:solid #e5e5e5;border-width:0 1px 0 0}.search-cascader__optionText{white-space:nowrap}.search-cascader__option svg{color:#bfbfbf;flex-shrink:0;font-size:12px;width:20px}.search-cascader__option svg.rotate{animation:rotate 1s linear infinite}.search-cascader__emptyWrapper{align-items:center;background:#fff;box-sizing:border-box;display:flex;height:300px;justify-content:center;padding:16px;width:100%}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.form-render__wrapper{align-items:start;display:grid!important;gap:0 16px;grid-template-columns:repeat(var(--column),minmax(0,1fr));max-height:var(--form-height);overflow-y:auto;position:relative}.form-render__formItem{grid-column:span min(var(--column),var(--form-item-column)) /span min(var(--column),var(--form-item-column))}.form-render__formItem .n-date-picker,.form-render__formItem .n-input-number{width:100%}.form-render__formItemLabel{align-items:center;display:inline-flex;justify-content:space-between;position:relative}.form-render__formItemLabel--operation{align-items:center;display:flex;gap:2px;position:absolute;right:0;top:50%;transform:translateY(-50%)}.form-render__formItemLabel--tooltip{font-size:0;line-height:1;width:16px}.form-render__formItemLabel--text{white-space:nowrap}.form-render__formItem .n-form-item-label{display:inline-flex}.form-render__formItem .n-form-item-label [annotation-hover-show=true]{visibility:hidden}.form-render__formItem .n-form-item-label:hover [annotation-hover-show=true]{visibility:visible}.form-render__linebar{grid-column:span min(var(--column),var(--column)) /span min(var(--column),var(--column))}.form-render__linebarHeader{align-items:center;background:#f2f2f2;border-radius:4px;cursor:pointer;display:flex;font-size:14px;font-weight:600;height:32px;justify-content:space-between;margin-bottom:8px;padding:0 16px}.form-render__linebarHeader>svg{color:rgba(33,33,33,.4);width:14px}.form-render__linebarHeaderTitle{align-items:center;display:flex;font-size:15px;gap:4px;vertical-align:middle}.form-render__linebarHeaderTitle svg{height:16px;transform:translateY(-1px)}.form-render__linebarHeader--disabled{cursor:auto}.form-render__linebarItem{align-items:start;display:grid!important;gap:0 16px;grid-template-columns:repeat(var(--column),minmax(0,1fr))}.form-render__linebreaks{grid-column:span min(var(--column),var(--form-item-column)) /span min(var(--column),var(--form-item-column))}.form-render__inputGroup{align-items:flex-start;display:flex;grid-column:span min(var(--column),var(--column)) /span min(var(--column),var(--column))}.form-render__inputGroup>div{flex:1}.form-render__inputGroup>div:not(:last-of-type) .n-base-selection__border,.form-render__inputGroup>div:not(:last-of-type) .n-input__border{border-bottom-right-radius:0;border-right:0;border-top-right-radius:0}.form-render__inputGroup>div:last-of-type .n-base-selection__border,.form-render__inputGroup>div:last-of-type .n-input__border{border-bottom-left-radius:0;border-top-left-radius:0}.form-render__inputGroup .n-form-item--left-labelled:not(:first-of-type)>label{display:none}.form-render__combination{width:100%}.form-render__combinationHeader{display:flex;gap:12px}.form-render__combinationHeader>h3{font-size:16px;font-weight:700;margin:0;padding:0}.form-render__combinationHeader .n-button__icon{font-size:14px;margin:0 2px 0 0}.form-render__combinationHeaderText{font-size:16px;font-weight:500}.form-render__combinationClose{font-size:16px;height:14px;position:absolute;right:5px;top:5px;width:14px}.form-render__combinationContentJson{position:relative}.form-render__combinationContent{align-items:start;display:grid!important;gap:0 16px;grid-template-columns:repeat(var(--column),minmax(0,1fr));position:relative}.form-render__complex{width:100%}.form-render__complexContent--grid{align-items:start;display:grid!important;gap:0 16px;grid-template-columns:repeat(var(--column),minmax(0,1fr))}.form-render__complexContent--flex{display:flex!important;gap:0 8px}.form-render__selectMenu .n-scrollbar-rail__scrollbar{display:none!important}.form-render__selectMenu .n-virtual-list::-webkit-scrollbar,.form-render__selectMenu .n-virtual-list::-webkit-scrollbar-thumb{display:unset!important;height:6px;width:6px}.form-render__selectMenu .n-virtual-list::-webkit-scrollbar-thumb{background:#bfbfbf;border-radius:4px}.form-render__selectMenu .v-vl-items{min-width:100%;width:max-content}.form-render__selectOption .n-base-select-option__content{overflow:visible!important;text-overflow:unset!important;word-break:keep-all!important}.form-render__labelField{align-items:start;display:grid!important;display:inline-grid!important;gap:0 16px;grid-template-columns:repeat(var(--column),minmax(0,1fr));grid-template-columns:repeat(var(--column),auto)!important;margin-left:16px}.form-render__labelField .n-form-item{display:inline-grid}.form-render__labelField label.n-form-item-label.n-form-item-label--left-mark{align-items:center}.form-render__labelField .n-checkbox[aria-checked=false] .n-checkbox-box{background-color:transparent}.form-render__labelField .n-checkbox[aria-checked=false] .n-checkbox-icon .check-icon{opacity:0}.form-render__labelField .n-checkbox[aria-checked=false] .n-checkbox-box__border{border:var(--n-border)}.form-render .form-render__formItem .n-checkbox,.form-render .form-render__formItem .n-radio{align-items:center}.form-render .form-render__formItem .n-radio-input{left:auto;right:auto}.form-render .form-render__formItem .n-checkbox-group>.n-space:not([vertical-space=true]),.form-render .form-render__formItem .n-radio-group>.n-space:not([vertical-space=true]){align-items:center!important}.form-render .form-render__formItem .n-checkbox__label{align-items:center;display:inline-flex}.form-render--no-border .n-input{border-radius:0}.form-render--no-border .n-input__border,.form-render--no-border .n-input__state-border{border-width:0!important}.form-render--no-border .n-input:hover .n-input__state-border{border-bottom-width:1px!important}.form-render--no-border .n-input--focus{border-radius:0}.form-render--no-border .n-input--focus .n-input__state-border{border-bottom-width:1px!important;box-shadow:none!important}.form-render--no-border .n-base-selection--active .n-base-selection__state-border,.form-render--no-border .n-base-selection--focus .n-base-selection__state-border,.form-render--no-border .n-base-selection:hover .n-base-selection__state-border,.form-render--no-border .n-base-selection__border,.form-render--no-border .n-base-selection__state-border{border-width:0!important;box-shadow:none!important}.form-render--underline .n-input{border-radius:0}.form-render--underline .n-input__border,.form-render--underline .n-input__state-border{border-left-width:0!important;border-right-width:0!important;border-top-width:0!important}.form-render--underline .n-input--focus{border-radius:0}.form-render--underline .n-input--focus .n-input__state-border{box-shadow:none!important}.form-render--underline .n-base-selection--active .n-base-selection__state-border,.form-render--underline .n-base-selection--focus .n-base-selection__state-border,.form-render--underline .n-base-selection:hover .n-base-selection__state-border,.form-render--underline .n-base-selection__border,.form-render--underline .n-base-selection__state-border{border-left-width:0!important;border-right-width:0!important;border-top-width:0!important;box-shadow:none!important}
|
|
@@ -41,6 +41,11 @@ declare const IhoSelectLabel: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
41
41
|
maxHeight: string;
|
|
42
42
|
};
|
|
43
43
|
closeTag: (selectItem: import("./src/types").ISelectLabelItemType) => void;
|
|
44
|
+
formatActiveStyle: (activeItem: import("./src/types").ISelectLabelItemType) => {
|
|
45
|
+
background: string;
|
|
46
|
+
color: string;
|
|
47
|
+
borderColor: string;
|
|
48
|
+
};
|
|
44
49
|
handleEditLabel: () => void;
|
|
45
50
|
handleLabelCancel: () => void;
|
|
46
51
|
changeModalWindow: () => void;
|
|
@@ -119,6 +124,7 @@ declare const IhoSelectLabel: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
119
124
|
default: () => {};
|
|
120
125
|
};
|
|
121
126
|
}, {
|
|
127
|
+
baseActiveColor: string;
|
|
122
128
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
123
129
|
categoryItem: {
|
|
124
130
|
type: import("vue").PropType<import("./src/types").ICategoryLabelItemType>;
|
|
@@ -141,9 +147,11 @@ declare const IhoSelectLabel: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
141
147
|
showCheck: (label: import("./src/types").IhoTabLabelItemType) => boolean;
|
|
142
148
|
onHandleLabelChange: (isSelect?: boolean | undefined, item?: import("./src/types").IhoTabLabelItemType | undefined, categoryItem?: import("./src/types").ICategoryLabelItemType | undefined) => void;
|
|
143
149
|
formatStyle: (item: any) => {
|
|
144
|
-
background?: undefined;
|
|
145
|
-
} | {
|
|
146
150
|
background: any;
|
|
151
|
+
borderColor: any;
|
|
152
|
+
} | {
|
|
153
|
+
background?: undefined;
|
|
154
|
+
borderColor?: undefined;
|
|
147
155
|
};
|
|
148
156
|
NTag: any;
|
|
149
157
|
NTooltip: any;
|
|
@@ -277,6 +285,7 @@ declare const IhoLabelFormContent: SFCWithInstall<import("vue").DefineComponent<
|
|
|
277
285
|
default: () => {};
|
|
278
286
|
};
|
|
279
287
|
}, {
|
|
288
|
+
baseActiveColor: string;
|
|
280
289
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
281
290
|
categoryItem: {
|
|
282
291
|
type: import("vue").PropType<import("./src/types").ICategoryLabelItemType>;
|
|
@@ -299,9 +308,11 @@ declare const IhoLabelFormContent: SFCWithInstall<import("vue").DefineComponent<
|
|
|
299
308
|
showCheck: (label: import("./src/types").IhoTabLabelItemType) => boolean;
|
|
300
309
|
onHandleLabelChange: (isSelect?: boolean | undefined, item?: import("./src/types").IhoTabLabelItemType | undefined, categoryItem?: import("./src/types").ICategoryLabelItemType | undefined) => void;
|
|
301
310
|
formatStyle: (item: any) => {
|
|
302
|
-
background?: undefined;
|
|
303
|
-
} | {
|
|
304
311
|
background: any;
|
|
312
|
+
borderColor: any;
|
|
313
|
+
} | {
|
|
314
|
+
background?: undefined;
|
|
315
|
+
borderColor?: undefined;
|
|
305
316
|
};
|
|
306
317
|
NTag: any;
|
|
307
318
|
NTooltip: any;
|
|
@@ -67,6 +67,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
67
67
|
default: () => {};
|
|
68
68
|
};
|
|
69
69
|
}, {
|
|
70
|
+
baseActiveColor: string;
|
|
70
71
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
71
72
|
categoryItem: {
|
|
72
73
|
type: PropType<ICategoryLabelItemType>;
|
|
@@ -89,9 +90,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
89
90
|
showCheck: (label: import("../../../../es/components/iho-select-label/src/types").IhoTabLabelItemType) => boolean;
|
|
90
91
|
onHandleLabelChange: (isSelect?: boolean | undefined, item?: import("../../../../es/components/iho-select-label/src/types").IhoTabLabelItemType | undefined, categoryItem?: ICategoryLabelItemType | undefined) => void;
|
|
91
92
|
formatStyle: (item: any) => {
|
|
92
|
-
background?: undefined;
|
|
93
|
-
} | {
|
|
94
93
|
background: any;
|
|
94
|
+
borderColor: any;
|
|
95
|
+
} | {
|
|
96
|
+
background?: undefined;
|
|
97
|
+
borderColor?: undefined;
|
|
95
98
|
};
|
|
96
99
|
NTag: any;
|
|
97
100
|
NTooltip: any;
|
|
@@ -41,6 +41,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
41
|
maxHeight: string;
|
|
42
42
|
};
|
|
43
43
|
closeTag: (selectItem: ISelectLabelItemType) => void;
|
|
44
|
+
formatActiveStyle: (activeItem: ISelectLabelItemType) => {
|
|
45
|
+
background: string;
|
|
46
|
+
color: string;
|
|
47
|
+
borderColor: string;
|
|
48
|
+
};
|
|
44
49
|
handleEditLabel: () => void;
|
|
45
50
|
handleLabelCancel: () => void;
|
|
46
51
|
changeModalWindow: () => void;
|
|
@@ -119,6 +124,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
119
124
|
default: () => {};
|
|
120
125
|
};
|
|
121
126
|
}, {
|
|
127
|
+
baseActiveColor: string;
|
|
122
128
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
123
129
|
categoryItem: {
|
|
124
130
|
type: PropType<ICategoryLabelItemType>;
|
|
@@ -141,9 +147,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
141
147
|
showCheck: (label: import("../../../../es/components/iho-select-label/src/types").IhoTabLabelItemType) => boolean;
|
|
142
148
|
onHandleLabelChange: (isSelect?: boolean | undefined, item?: import("../../../../es/components/iho-select-label/src/types").IhoTabLabelItemType | undefined, categoryItem?: ICategoryLabelItemType | undefined) => void;
|
|
143
149
|
formatStyle: (item: any) => {
|
|
144
|
-
background?: undefined;
|
|
145
|
-
} | {
|
|
146
150
|
background: any;
|
|
151
|
+
borderColor: any;
|
|
152
|
+
} | {
|
|
153
|
+
background?: undefined;
|
|
154
|
+
borderColor?: undefined;
|
|
147
155
|
};
|
|
148
156
|
NTag: any;
|
|
149
157
|
NTooltip: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,reactive as i,watch as a,openBlock as t,createElementBlock as o,Fragment as n,createElementVNode as s,createBlock as d,unref as c,withCtx as r,renderList as p,
|
|
1
|
+
import{defineComponent as e,ref as l,reactive as i,watch as a,openBlock as t,createElementBlock as o,Fragment as n,createElementVNode as s,createBlock as d,unref as c,withCtx as r,renderList as p,normalizeStyle as h,createVNode as g,toDisplayString as u,createTextVNode as m,createCommentVNode as x,normalizeClass as b}from"vue";import{NSpace as f,NTag as C,NTooltip as y,NIcon as v,NModal as w}from"naive-ui";import{AddCircleOutline as L}from"@vicons/ionicons5";import W from"./LabelFormContent.vue.js";import k from"../../../_virtual/plugin-vue_export-helper.js";const _={class:"c-iho-select-label"},H={key:1,class:"outexplicit"},z=s("span",null,"选择标签",-1),S={class:"svg-wrap"};var V=k(e({__name:"SelectLabel",props:{selectedList:{type:Array,default:()=>[]},categoryList:{type:Array,default:()=>[]},explicit:{type:Boolean,default:!1}},emits:["onChange"],setup(e,{emit:k}){const V=e,A=l(null),F=l(),I=i({labelVisible:!1,isChangeWindow:!1,modalWidth:"763px",modalHeight:"404px",maxHeight:"404px"}),O=()=>{V.explicit||(I.labelVisible=!0)},N=()=>{V.explicit||(I.modalWidth="763px",I.modalHeight="404px",I.maxHeight="404px",I.isChangeWindow=!1,I.labelVisible=!1)},j=()=>{I.isChangeWindow=!I.isChangeWindow;let e=document.body.clientHeight;I.modalWidth="763px"===I.modalWidth?"100%":"763px",I.modalHeight="404px"===I.modalHeight?e-110+"px":"404px",I.maxHeight="auto"===I.modalHeight?"404px":"none"},E=()=>{var e;null==(e=A.value)||e.handleLabelForm((e=>{k("onChange",[...e]),F.value=e,N()}))},J=()=>{E()};return a((()=>V.selectedList),(e=>{if(e){let l=Array.isArray(e)?e:[];F.value=JSON.parse(JSON.stringify(l))}}),{immediate:!0,deep:!0}),(l,i)=>(t(),o(n,null,[s("div",_,[e.explicit?x("v-if",!0):(t(),d(c(f),{key:0,align:"center"},{default:r((()=>[(t(!0),o(n,null,p(F.value,(e=>{return t(),d(c(C),{bordered:!1,key:`${e.classifyId}-${e.labelCode}`,class:"select-label-active",style:h((l=e,{background:l.backgroundColor,color:"#fff",borderColor:l.backgroundColor})),size:"small",closable:"",onClose:l=>(e=>{const l=F.value||[],i=l.findIndex((l=>l.classifyId==e.classifyId&&l.labelCode==e.labelCode));i>-1&&l.splice(i,1),F.value=l,k("onChange",[...l])})(e)},{default:r((()=>[g(c(y),{placement:"top-start",duration:0},{trigger:r((()=>[s("span",null,u(e.labelShowText),1)])),default:r((()=>[s("span",null,u(e.labelShowText),1)])),_:2},1024)])),_:2},1032,["style","onClose"]);var l})),128)),e.explicit?x("v-if",!0):(t(),o("span",{key:0,class:"form-add-icon form-add-icon-label",onClick:O},[g(c(v),{class:"add-icon",component:c(L)},null,8,["component"]),m(" 新增 ")]))])),_:1})),e.explicit?(t(),o("div",H,[g(W,{ref_key:"labelFormContentRef",ref:A,categoryList:e.categoryList,selectedList:e.selectedList,isChangeWindow:I.isChangeWindow,explicit:e.explicit,onExplicitOnChange:J},null,8,["categoryList","selectedList","isChangeWindow","explicit"])])):x("v-if",!0)]),x(" 弹窗 "),g(c(w),{preset:"dialog",class:b(["label-form-modal-wrap modal-wrap standard-modal standard-modal-white",{"modal-screen":I.isChangeWindow}]),show:I.labelVisible,"onUpdate:show":i[0]||(i[0]=e=>I.labelVisible=e),onPositiveClick:E,onNegativeClick:N,onClose:N,"mask-closable":!1,"close-on-esc":!1,"show-icon":!1,"negative-text":"取消","positive-text":"确定",style:h({width:I.modalWidth})},{header:r((()=>[z,s("div",S,[s("i",{onClick:j,class:b(["iconfont-select-label",I.isChangeWindow?"icon-iho-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-iho-select-label-menzhenyishengzhanxitongtubiaozuidahua"])},null,2)])])),default:r((()=>[g(W,{ref_key:"labelFormContentRef",ref:A,categoryList:e.categoryList,selectedList:F.value,isChangeWindow:I.isChangeWindow,explicit:e.explicit,onExplicitOnChange:J},null,8,["categoryList","selectedList","isChangeWindow","explicit"])])),_:1},8,["show","class","style"])],64))}}),[["__file","SelectLabel.vue"]]);export{V as default};
|
|
@@ -14,6 +14,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
14
|
default: () => {};
|
|
15
15
|
};
|
|
16
16
|
}, {
|
|
17
|
+
baseActiveColor: string;
|
|
17
18
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
18
19
|
categoryItem: {
|
|
19
20
|
type: PropType<ICategoryLabelItemType>;
|
|
@@ -36,9 +37,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
37
|
showCheck: (label: IhoTabLabelItemType) => boolean;
|
|
37
38
|
onHandleLabelChange: (isSelect?: boolean, item?: IhoTabLabelItemType, categoryItem?: ICategoryLabelItemType) => void;
|
|
38
39
|
formatStyle: (item: any) => {
|
|
39
|
-
background?: undefined;
|
|
40
|
-
} | {
|
|
41
40
|
background: any;
|
|
41
|
+
borderColor: any;
|
|
42
|
+
} | {
|
|
43
|
+
background?: undefined;
|
|
44
|
+
borderColor?: undefined;
|
|
42
45
|
};
|
|
43
46
|
NTag: any;
|
|
44
47
|
NTooltip: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,openBlock as a,createElementBlock as t,unref as
|
|
1
|
+
import{defineComponent as e,ref as l,openBlock as a,createElementBlock as t,unref as o,Fragment as s,renderList as c,createBlock as d,normalizeStyle as r,withCtx as n,createVNode as i,createElementVNode as u,toDisplayString as b}from"vue";import{NTag as p,NTooltip as y}from"naive-ui";import f from"../../../../_virtual/plugin-vue_export-helper.js";const g={class:"edit-content"},h={key:0,class:"label-disable-wrap"},m=[u("p",{class:"label-disable-title"},"无可选标签",-1),u("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],k={key:1,class:"label-content"};var v=f(e({__name:"label-classify",props:{categoryItem:{type:Object,default:()=>({})},selectedList:{type:Array,default:()=>[]},handleLabelChange:{type:Function,default:()=>({})}},setup(e){var f;const v=e,C="rgb(85, 133, 245)";let _=l((null==(f=v.categoryItem)?void 0:f.labelList)||[]);const I=e=>v.selectedList.findIndex((l=>l.classifyId===v.categoryItem.classifyId&&l.labelCode===e.labelCode))>-1;function x(e){return I(e)?{background:e.backgroundColor||C,borderColor:e.backgroundColor||C}:{}}return(l,f)=>(a(),t("div",g,[o(_)&&0!==o(_).length?(a(),t("div",k,[(a(!0),t(s,null,c(o(_),(l=>(a(),d(o(p),{checkable:"",checked:I(l),"onUpdate:checked":a=>((e,l,a)=>{v.handleLabelChange(e,l,a)})(a,l,e.categoryItem),key:l.labelCode,style:r(x(l))},{default:n((()=>[i(o(y),{placement:"top-start",duration:0},{trigger:n((()=>[u("span",null,b(l.labelShowText),1)])),default:n((()=>[u("span",null,b(l.labelShowText),1)])),_:2},1024)])),_:2},1032,["checked","onUpdate:checked","style"])))),128))])):(a(),t("div",h,m))]))}}),[["__file","label-classify.vue"]]);export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@font-face{font-family:iho-select-label-iconfont;src:url(iho-select-label-iconfont.ttf) format("truetype")}.iconfont-select-label{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iho-select-label-iconfont!important;font-size:14px;font-style:normal}.icon-iho-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-iho-select-label-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.c-iho-select-label .form-add-icon-label{align-items:center;color:#2d7aff;cursor:pointer;display:inline-flex;vertical-align:middle}.c-iho-select-label .n-tag{border:1px solid #e0e0e6;margin:0 8px 0 0;max-width:108px}.c-iho-select-label .n-tag .n-base-icon{color:#fff}.c-iho-select-label .n-tag .n-tag__content{align-items:center;display:inline-block;line-height:20px;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-iho-
|
|
1
|
+
@font-face{font-family:iho-select-label-iconfont;src:url(iho-select-label-iconfont.ttf) format("truetype")}.iconfont-select-label{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iho-select-label-iconfont!important;font-size:14px;font-style:normal}.icon-iho-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-iho-select-label-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.c-iho-select-label .form-add-icon-label{align-items:center;color:#2d7aff;cursor:pointer;display:inline-flex;vertical-align:middle}.c-iho-select-label .n-tag{border:1px solid #e0e0e6;margin:0 8px 0 0;max-width:108px}.c-iho-select-label .n-tag .n-base-icon{color:#fff}.c-iho-select-label .n-tag .n-tag__content{align-items:center;display:inline-block;line-height:20px;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-iho-label-form-content{border-bottom:1px solid #e8e8e8;border-top:1px solid #e8e8e8;height:100%;width:100%}.c-iho-label-form-content .label-wrap{display:flex;height:100%;width:100%}.c-iho-label-form-content .label-wrap .left-label-wrap{border-right:1px solid #e8e8e8;max-height:404px;width:140px}.c-iho-label-form-content .label-wrap .left-label-wrap.total-left-label-wrap{height:calc(100vh - 109px);max-height:calc(100vh - 109px)}.c-iho-label-form-content .label-wrap .left-label-wrap.explicit-label-wrap{height:auto;overflow:hidden;overflow-y:auto;width:100%}.c-iho-label-form-content .label-wrap .left-label-wrap .n-anchor.n-anchor--block .n-anchor-link{font-size:14px;padding:10px 8px}.c-iho-label-form-content .label-wrap .left-label-wrap .n-anchor.n-anchor--block .n-anchor-link.n-anchor-link--active{background-color:#f2f2f2}.c-iho-label-form-content .label-wrap .right-label-wrap{flex:1;max-height:404px;overflow-y:auto}.c-iho-label-form-content .label-wrap .right-label-wrap.total-right-label-wrap{max-height:calc(100vh - 109px)}.c-iho-label-form-content .edit-label-type{font-size:12px;margin-left:4px}.c-iho-label-form-content .edit-label-content{margin-top:10px;padding:0 14px}.c-iho-label-form-content .edit-label-content .edit-content{margin-top:8px;width:100%}.c-iho-label-form-content .edit-label-content .edit-content .n-tag{border:1px solid #e0e0e6;margin:0 8px 8px 0;max-width:108px;text-align:center}.c-iho-label-form-content .edit-label-content .edit-content .n-tag .n-tag__content{align-items:center;display:inline-flex}.c-iho-label-form-content .edit-label-content .edit-content .n-tag .n-tag__content span{display:inline-block;height:100%;line-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:80px}.n-dialog__title .svg-wrap{margin:0 0 0 auto}.n-dialog__title .svg-wrap i{cursor:pointer;font-size:16px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,provide as o,ref as a,watch as l,resolveComponent as n,openBlock as s,createElementBlock as r,unref as i,normalizeStyle as u,createBlock as
|
|
1
|
+
import{defineComponent as e,computed as t,provide as o,ref as a,watch as l,resolveComponent as n,openBlock as s,createElementBlock as r,unref as i,normalizeStyle as u,createBlock as d,resolveDynamicComponent as c,createElementVNode as f,createVNode as m,mergeProps as v,createSlots as p,renderList as b,withCtx as h,createCommentVNode as g,renderSlot as x,normalizeProps as k,guardReactiveProps as y}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as D}from"@vueuse/core";import"date-fns";import{isString as $,isFunction as j,pick as _}from"lodash-es";import{widthAppend as w,uuidGenerator as I}from"../../../shared/utils/index.js";import{promiseTimeout as H}from"@vueuse/shared";import{VxeTableEventNameList as T,InjectionIhoTableEmits as A,InjectionIhoTableAnnotation as L,InjectionIhoTableUUID as R,InjectionIhoTableInstance as E,InjectionIhoTableConfig as F,InjectionIhoTableFieldList as O,InjectionIhoTableHandler as S}from"./constants/index.js";import{createTableHooks as W,applyTableConfigHooks as q,applyTableFieldHooks as z,createTableEventHandlers as B,createDomInsertComponent as G,createDataTransfer as J}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as K}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as M}from"./utils/index.js";import N from"../../../_virtual/plugin-vue_export-helper.js";const P=["id"];var Q=N(e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...T],setup(e,{expose:T,emit:N}){var Q,U;const V=e,X=C({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),Y=t((()=>{var e,t;const o=null!=(t=null==(e=V.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===o?"100%":$(o)&&(o.includes("calc")||o.endsWith("%"))?o:w(o)}})),Z=K(),ee=function(e,...t){N(e,...t);const o=i(le)[M(e)];j(o)&&o(...t),Z.trigger(e,...t)};o(A,ee);const te=W();o(L,t((()=>V.annotation)));const oe=I();o(R,oe);const ae=a();o(E,ae);const le=a({uuid:null!=(U=null==(Q=V.tableConfig)?void 0:Q.uuid)?U:oe});o(F,le);const ne=D(se,10);function se(){le.value=q(te,V.tableConfig,{$table:ae,emits:ee}),le.value.uuid=oe}const re=a([]);o(O,re);const ie=D(ue,10);function ue(){re.value=z(te,V.fieldList,le.value,{$table:ae,emits:ee})}const de=J(te,le,ae),ce=a([]);async function fe(){var e;ce.value=await de(V.tableData),null==(e=ae.value)||e.recalculate(!0)}const me={updateTableDataRef:D(fe,10),updateConfigRef:ne,updateFieldListRef:ie};o(S,me);const ve=B({hooks:te,config:le,$table:ae,context:me,emits:ee}),pe=t((()=>({...le.value,...ve})));let be=!1,he=!1,ge=!1;const xe=D((()=>{be&&se(),he&&ue(),ge&&fe(),be=!1,he=!1,ge=!1}),10);l((()=>V.tableConfig),(()=>{be=!0,he=!0,ge=!0,xe()}),{deep:!0}),l((()=>V.fieldList),(()=>{he=!0,ge=!0,xe()}),{deep:!0}),l([()=>[...V.tableData],()=>{var e;return null==(e=V.tableData)?void 0:e.length}],(()=>{ge=!0,xe()})),l([()=>V.tableData,()=>{var e;return null==(e=V.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=le.value.treeConfig)?void 0:e.expandAll)&&(await H(11),null==(t=ae.value)||t.setAllTreeExpand(!0))})),se(),ue(),fe();const{header:ke,footer:ye}=G(te);function Ce(e){return _(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return T({$table:ae,async loadData(e){var t;null==(t=ae.value)||t.loadData(await de(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=ae.value)||e.loadColumn([]),null==(t=ae.value)||t.loadData([]),se(),ue(),fe()},...te.exposeHooks.expose.call({},le,{$table:ae,emits:ee})}),te.setupHooks.setup.call(le,re,{$table:ae,emits:ee}),(e,t)=>{const o=n("vxe-grid");return s(),r("section",{class:"iho-table",id:i(oe),style:u(i(X))},[(s(),d(c(i(ke)))),f("section",{style:u(i(Y))},[m(o,v({ref_key:"$table",ref:ae},i(pe),{columns:re.value,data:ce.value}),p({_:2},[b(e.$slots,((t,o)=>({name:o,fn:h((t=>[g(" 实际上所有的vxe-grid插槽都支持 "),x(e.$slots,o,k(y(Ce(t))))]))})))]),1040,["columns","data"])],4),(s(),d(c(i(ye))))],12,P)}}}),[["__file","IhoTable.vue"]]);export{Q as default};
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,mergeProps as
|
|
1
|
+
import{createVNode as e,mergeProps as t}from"vue";import{NInput as r}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as n}from"../../../constants/index.js";import{IhoTableRenderHelper as o}from"../../../utils/index.js";import{defineTablePlugin as i}from"../../../hooks/useTablePlugin.js";function a(){return i({name:"inputRendererPlugins",vxe(i){let a="";i.renderer.add(n.INPUT,{renderCell:o.createDefaultRenderCell(),renderEdit:o.createRenderEdit((({fieldItem:n,row:o,rowIndex:i,column:l,emitFormChangeWithParams:d,emitFormClick:m,$table:u})=>[e(r,t({value:o[l.field],"onUpdate:value":e=>o[l.field]=e},n.componentProps,{onChange:()=>{d({oldValue:a})},onClick:m,onFocus:()=>a=o[l.field],onKeydown:async e=>{if("Enter"!==e.key)return;const{fullData:t}=u.getTableData();if(t.length!==i+1)return;const{editStore:{actived:r}={}}=u.reactData;if(r&&r.row){const t=r.args;await u.clearEdit(),u.handleSelected(t,e)}}}),null)]))})}})}export{a as inputRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n,l,u=[]){const a=n[l.columnName];return Array.isArray(a)?a.map((n=>i(n))).join(","):i(a);function i(n){return l=r(u)||[],(null==(a=null==l?void 0:l.find((r=>r.value==n)))?void 0:a.label)
|
|
1
|
+
function n(n,l,u=[]){const a=n[l.columnName];return Array.isArray(a)?a.map((n=>i(n))).join(","):i(a);function i(n){return l=r(u)||[],null!=(i=null==(a=null==l?void 0:l.find((r=>r.value==n)))?void 0:a.label)?i:n;var l,a,i}}function r(n){return Array.isArray(n)&&!n.length?null:n}export{r as getArray,n as getDefaultValue};
|