cnhis-design-vue 3.1.42-beta.57 → 3.1.42-beta.59

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.
Files changed (26) hide show
  1. package/README.md +87 -87
  2. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  3. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  4. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  6. package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
  7. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  8. package/es/components/form-render/src/types/index.d.ts +1 -1
  9. package/es/components/iho-table/index.d.ts +36 -36
  10. package/es/components/iho-table/src/IhoTable.vue.d.ts +36 -36
  11. package/es/components/iho-table/src/IhoTable.vue.js +1 -1
  12. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +1 -0
  13. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -1
  14. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -1
  15. package/es/components/iho-table/src/types/index.d.ts +1 -1
  16. package/es/components/scale-view/src/ScaleView.vue.js +1 -1
  17. package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
  18. package/es/components/select-person/index.d.ts +15 -7
  19. package/es/components/select-person/src/SelectPerson.vue.d.ts +9 -5
  20. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  21. package/es/env.d.ts +25 -25
  22. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  23. package/es/shared/utils/index.d.ts +3 -14
  24. package/es/shared/utils/index.js +1 -1
  25. package/es/shared/utils/tapable/index.d.ts +139 -0
  26. package/package.json +2 -2
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{isEqual as i,isArray as u,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import{NCascader as v}from"naive-ui";import"@vueuse/core";import"date-fns";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"@formily/reactive";import{connect as f,mapProps as y}from"@formily/vue";import"@vue/shared";import"./index.js";import"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as h,assignUpdateValue as j,traverseDependKey as k}from"../../utils/schema.js";const b=f(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:f,emit:y}){const j=t(),{field:b,title:C}=m(),g=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),S=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");return Array.isArray(t)&&t.length?t.map((e=>e[F.value])).slice(-1).join(""):null}catch(e){return null}}));function w(e,t,a){y("update:value",u(a)?a.map((function(e){return{...e,label:e[g.value],children:void 0,parent:void 0}})):null)}const A=l(p);async function H(t){e.filterable?await async function(){if(!e.urlConfig||j.value&&e.requestCache)return;const t=await A.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:C.value,cache:e.requestCache});function a(e,t){const l={[g.value]:e[g.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword};return u(e.children)&&(l.children=e.children.map((e=>a(e,t+1))),l.isLeaf=!e.children.length),l}j.value=t.map((e=>a(e,0)))}():await async function(t){if(r(e,t))return;const a=await A.addAsync(o(s(t),u(e),C.value,t));if(!a.length&&t)return t.isLeaf=!0,w(0,0,n(t)),void(E.value=!1);const l=a.map((e=>i(e,s(t))));function r(e,t){return!u(e)||!t&&j.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&k(a.dependKey,((e,t)=>{o[t]=r[e]})),{params:o,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function i(a,l){return{[g.value]:a[g.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function u(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:j.value=l}(t),await L()}const x=`form-render__cascade--menu-${l(d)}`;async function L(){await n();const e=document.querySelector(`.${x} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function q(e,t){if(!e||!t)return!1;const{keyword:a,[g.value]:l}=t;return s(a)?a.split(",").some((t=>t.includes(e))):!!s(l)&&l.includes(e)}const{injectValueValidate:B,injectValueWatchFromEmpty:K,injectValueBindKey:V}=c();K((()=>e.value),H),B((()=>e.value)),r((()=>e.urlConfig),(async(e,t)=>{i(e,t)||(j.value=null,await H())}));const E=t(!1);function O(e){E.value=!!e,e&&H()}const W=a((()=>j.value||e.options||[])),N=a((()=>!e.filterable)),P=V(S);return()=>o(v,{key:P.value,remote:N.value,filterable:e.filterable,"menu-props":{class:x,onClick:L},checkStrategy:"child",show:!!E.value,"onUpdate:show":O,value:S.value,filter:q,"onUpdate:value":w,labelField:g.value,valueField:F.value,options:W.value,onLoad:H,onFocus:h(b)},f)}}),y({dataSource:"options"},j));export{b as SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{isEqual as i,isArray as u,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import{NCascader as v}from"naive-ui";import"@vueuse/core";import"date-fns";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"@formily/reactive";import{connect as f,mapProps as y}from"@formily/vue";import"@vue/shared";import"./index.js";import"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as h,assignUpdateValue as j,traverseDependKey as k}from"../../utils/schema.js";const b=f(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:f,emit:y}){const j=t(),{field:b,title:C}=m(),g=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),S=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");return Array.isArray(t)&&t.length?t.map((e=>e[F.value])).slice(-1).join(""):null}catch(e){return null}}));function w(e,t,a){y("update:value",u(a)?a.map((function(e){return{...e,label:e[g.value],children:void 0,parent:void 0}})):null)}const A=l(p);async function H(t){e.filterable?await async function(){if(!e.urlConfig||j.value&&e.requestCache)return;const t=await A.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:C.value,cache:e.requestCache});function a(e,t){const l={[g.value]:e[g.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword};return u(e.children)&&(l.children=e.children.map((e=>a(e,t+1))),l.isLeaf=!e.children.length),l}j.value=t.map((e=>a(e,0)))}():await async function(t){if(r(e,t))return;const a=await A.addAsync(o(s(t),u(e),C.value,t));if(!a.length&&t)return t.isLeaf=!0,w(0,0,n(t)),void(E.value=!1);const l=a.map((e=>i(e,s(t))));function r(e,t){return!u(e)||!t&&j.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&k(a.dependKey,((e,t)=>{o[t]=r[e]})),{params:o,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function i(a,l){return{[g.value]:a[g.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function u(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:j.value=l}(t),await L()}const x=`form-render__cascade--menu-${l(d)}`;async function L(){await n();const e=document.querySelector(`.${x} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function q(e,t){if(!e||!t)return!1;const{keyword:a,[g.value]:l}=t,r=!!s(a)&&a.split(",").some((t=>t.includes(e))),o=!!s(l)&&l.includes(e);return r||o}const{injectValueValidate:B,injectValueWatchFromEmpty:K,injectValueBindKey:V}=c();K((()=>e.value),H),B((()=>e.value)),r((()=>e.urlConfig),(async(e,t)=>{i(e,t)||(j.value=null,await H())}));const E=t(!1);function O(e){E.value=!!e,e&&H()}const W=a((()=>j.value||e.options||[])),N=a((()=>!e.filterable)),P=V(S);return()=>o(v,{key:P.value,remote:N.value,filterable:e.filterable,"menu-props":{class:x,onClick:L},checkStrategy:"child",show:!!E.value,"onUpdate:show":O,value:S.value,filter:q,"onUpdate:value":w,labelField:g.value,valueField:F.value,options:W.value,onLoad:H,onFocus:h(b)},f)}}),y({dataSource:"options"},j));export{b as SEARCH_CASCADER};
@@ -89,7 +89,7 @@ export declare type FormBusinessFormatter = (payload: {
89
89
  }) => unknown;
90
90
  export declare namespace FormLowCodeReactions {
91
91
  type ConObj = {
92
- con: LOW_CODE_VALUE_RELATION & string;
92
+ con: LOW_CODE_VALUE_RELATION;
93
93
  field_key: string;
94
94
  value: unknown;
95
95
  };
@@ -282,7 +282,9 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
282
282
  } | undefined;
283
283
  autofocus?: string | undefined;
284
284
  autoselect?: boolean | undefined;
285
- defaultValue?: string | number | object | any[] | {
285
+ defaultValue?: string | number | object | any[] | ((params: {
286
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
287
+ }) => any) | {
286
288
  exec: (string: string) => RegExpExecArray | null;
287
289
  test: (string: string) => boolean;
288
290
  readonly source: string;
@@ -303,9 +305,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
303
305
  [Symbol.search]: (string: string) => number;
304
306
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
305
307
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
306
- } | ((params: {
307
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
308
- }) => any) | {
308
+ } | {
309
309
  toString: () => string;
310
310
  toDateString: () => string;
311
311
  toTimeString: () => string;
@@ -585,7 +585,9 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
585
585
  } | undefined;
586
586
  autofocus?: string | undefined;
587
587
  autoselect?: boolean | undefined;
588
- defaultValue?: string | number | object | any[] | {
588
+ defaultValue?: string | number | object | any[] | ((params: {
589
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
590
+ }) => any) | {
589
591
  exec: (string: string) => RegExpExecArray | null;
590
592
  test: (string: string) => boolean;
591
593
  readonly source: string;
@@ -606,9 +608,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
606
608
  [Symbol.search]: (string: string) => number;
607
609
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
608
610
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
609
- } | ((params: {
610
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
611
- }) => any) | {
611
+ } | {
612
612
  toString: () => string;
613
613
  toDateString: () => string;
614
614
  toTimeString: () => string;
@@ -1061,7 +1061,9 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
1061
1061
  } | undefined;
1062
1062
  autofocus?: string | undefined;
1063
1063
  autoselect?: boolean | undefined;
1064
- defaultValue?: string | number | object | any[] | {
1064
+ defaultValue?: string | number | object | any[] | ((params: {
1065
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
1066
+ }) => any) | {
1065
1067
  exec: (string: string) => RegExpExecArray | null;
1066
1068
  test: (string: string) => boolean;
1067
1069
  readonly source: string;
@@ -1082,9 +1084,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
1082
1084
  [Symbol.search]: (string: string) => number;
1083
1085
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
1084
1086
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
1085
- } | ((params: {
1086
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
1087
- }) => any) | {
1087
+ } | {
1088
1088
  toString: () => string;
1089
1089
  toDateString: () => string;
1090
1090
  toTimeString: () => string;
@@ -1420,7 +1420,9 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
1420
1420
  } | undefined;
1421
1421
  autofocus?: string | undefined;
1422
1422
  autoselect?: boolean | undefined;
1423
- defaultValue?: string | number | object | any[] | {
1423
+ defaultValue?: string | number | object | any[] | ((params: {
1424
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
1425
+ }) => any) | {
1424
1426
  exec: (string: string) => RegExpExecArray | null;
1425
1427
  test: (string: string) => boolean;
1426
1428
  readonly source: string;
@@ -1441,9 +1443,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
1441
1443
  [Symbol.search]: (string: string) => number;
1442
1444
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
1443
1445
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
1444
- } | ((params: {
1445
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
1446
- }) => any) | {
1446
+ } | {
1447
1447
  toString: () => string;
1448
1448
  toDateString: () => string;
1449
1449
  toTimeString: () => string;
@@ -2292,7 +2292,9 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
2292
2292
  } | undefined;
2293
2293
  autofocus?: string | undefined;
2294
2294
  autoselect?: boolean | undefined;
2295
- defaultValue?: string | number | object | any[] | {
2295
+ defaultValue?: string | number | object | any[] | ((params: {
2296
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
2297
+ }) => any) | {
2296
2298
  exec: (string: string) => RegExpExecArray | null;
2297
2299
  test: (string: string) => boolean;
2298
2300
  readonly source: string;
@@ -2313,9 +2315,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
2313
2315
  [Symbol.search]: (string: string) => number;
2314
2316
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
2315
2317
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
2316
- } | ((params: {
2317
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
2318
- }) => any) | {
2318
+ } | {
2319
2319
  toString: () => string;
2320
2320
  toDateString: () => string;
2321
2321
  toTimeString: () => string;
@@ -2754,7 +2754,9 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
2754
2754
  } | undefined;
2755
2755
  autofocus?: string | undefined;
2756
2756
  autoselect?: boolean | undefined;
2757
- defaultValue?: string | number | object | any[] | {
2757
+ defaultValue?: string | number | object | any[] | ((params: {
2758
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
2759
+ }) => any) | {
2758
2760
  exec: (string: string) => RegExpExecArray | null;
2759
2761
  test: (string: string) => boolean;
2760
2762
  readonly source: string;
@@ -2775,9 +2777,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
2775
2777
  [Symbol.search]: (string: string) => number;
2776
2778
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
2777
2779
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
2778
- } | ((params: {
2779
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
2780
- }) => any) | {
2780
+ } | {
2781
2781
  toString: () => string;
2782
2782
  toDateString: () => string;
2783
2783
  toTimeString: () => string;
@@ -3057,7 +3057,9 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
3057
3057
  } | undefined;
3058
3058
  autofocus?: string | undefined;
3059
3059
  autoselect?: boolean | undefined;
3060
- defaultValue?: string | number | object | any[] | {
3060
+ defaultValue?: string | number | object | any[] | ((params: {
3061
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
3062
+ }) => any) | {
3061
3063
  exec: (string: string) => RegExpExecArray | null;
3062
3064
  test: (string: string) => boolean;
3063
3065
  readonly source: string;
@@ -3078,9 +3080,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
3078
3080
  [Symbol.search]: (string: string) => number;
3079
3081
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
3080
3082
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
3081
- } | ((params: {
3082
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
3083
- }) => any) | {
3083
+ } | {
3084
3084
  toString: () => string;
3085
3085
  toDateString: () => string;
3086
3086
  toTimeString: () => string;
@@ -3533,7 +3533,9 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
3533
3533
  } | undefined;
3534
3534
  autofocus?: string | undefined;
3535
3535
  autoselect?: boolean | undefined;
3536
- defaultValue?: string | number | object | any[] | {
3536
+ defaultValue?: string | number | object | any[] | ((params: {
3537
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
3538
+ }) => any) | {
3537
3539
  exec: (string: string) => RegExpExecArray | null;
3538
3540
  test: (string: string) => boolean;
3539
3541
  readonly source: string;
@@ -3554,9 +3556,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
3554
3556
  [Symbol.search]: (string: string) => number;
3555
3557
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
3556
3558
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
3557
- } | ((params: {
3558
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
3559
- }) => any) | {
3559
+ } | {
3560
3560
  toString: () => string;
3561
3561
  toDateString: () => string;
3562
3562
  toTimeString: () => string;
@@ -3892,7 +3892,9 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
3892
3892
  } | undefined;
3893
3893
  autofocus?: string | undefined;
3894
3894
  autoselect?: boolean | undefined;
3895
- defaultValue?: string | number | object | any[] | {
3895
+ defaultValue?: string | number | object | any[] | ((params: {
3896
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
3897
+ }) => any) | {
3896
3898
  exec: (string: string) => RegExpExecArray | null;
3897
3899
  test: (string: string) => boolean;
3898
3900
  readonly source: string;
@@ -3913,9 +3915,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
3913
3915
  [Symbol.search]: (string: string) => number;
3914
3916
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
3915
3917
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
3916
- } | ((params: {
3917
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
3918
- }) => any) | {
3918
+ } | {
3919
3919
  toString: () => string;
3920
3920
  toDateString: () => string;
3921
3921
  toTimeString: () => string;
@@ -281,7 +281,9 @@ declare const _default: import("vue").DefineComponent<{
281
281
  } | undefined;
282
282
  autofocus?: string | undefined;
283
283
  autoselect?: boolean | undefined;
284
- defaultValue?: string | number | object | any[] | {
284
+ defaultValue?: string | number | object | any[] | ((params: {
285
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
286
+ }) => any) | {
285
287
  exec: (string: string) => RegExpExecArray | null;
286
288
  test: (string: string) => boolean;
287
289
  readonly source: string;
@@ -302,9 +304,7 @@ declare const _default: import("vue").DefineComponent<{
302
304
  [Symbol.search]: (string: string) => number;
303
305
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
304
306
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
305
- } | ((params: {
306
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
307
- }) => any) | {
307
+ } | {
308
308
  toString: () => string;
309
309
  toDateString: () => string;
310
310
  toTimeString: () => string;
@@ -584,7 +584,9 @@ declare const _default: import("vue").DefineComponent<{
584
584
  } | undefined;
585
585
  autofocus?: string | undefined;
586
586
  autoselect?: boolean | undefined;
587
- defaultValue?: string | number | object | any[] | {
587
+ defaultValue?: string | number | object | any[] | ((params: {
588
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
589
+ }) => any) | {
588
590
  exec: (string: string) => RegExpExecArray | null;
589
591
  test: (string: string) => boolean;
590
592
  readonly source: string;
@@ -605,9 +607,7 @@ declare const _default: import("vue").DefineComponent<{
605
607
  [Symbol.search]: (string: string) => number;
606
608
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
607
609
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
608
- } | ((params: {
609
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
610
- }) => any) | {
610
+ } | {
611
611
  toString: () => string;
612
612
  toDateString: () => string;
613
613
  toTimeString: () => string;
@@ -1060,7 +1060,9 @@ declare const _default: import("vue").DefineComponent<{
1060
1060
  } | undefined;
1061
1061
  autofocus?: string | undefined;
1062
1062
  autoselect?: boolean | undefined;
1063
- defaultValue?: string | number | object | any[] | {
1063
+ defaultValue?: string | number | object | any[] | ((params: {
1064
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
1065
+ }) => any) | {
1064
1066
  exec: (string: string) => RegExpExecArray | null;
1065
1067
  test: (string: string) => boolean;
1066
1068
  readonly source: string;
@@ -1081,9 +1083,7 @@ declare const _default: import("vue").DefineComponent<{
1081
1083
  [Symbol.search]: (string: string) => number;
1082
1084
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
1083
1085
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
1084
- } | ((params: {
1085
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
1086
- }) => any) | {
1086
+ } | {
1087
1087
  toString: () => string;
1088
1088
  toDateString: () => string;
1089
1089
  toTimeString: () => string;
@@ -1419,7 +1419,9 @@ declare const _default: import("vue").DefineComponent<{
1419
1419
  } | undefined;
1420
1420
  autofocus?: string | undefined;
1421
1421
  autoselect?: boolean | undefined;
1422
- defaultValue?: string | number | object | any[] | {
1422
+ defaultValue?: string | number | object | any[] | ((params: {
1423
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
1424
+ }) => any) | {
1423
1425
  exec: (string: string) => RegExpExecArray | null;
1424
1426
  test: (string: string) => boolean;
1425
1427
  readonly source: string;
@@ -1440,9 +1442,7 @@ declare const _default: import("vue").DefineComponent<{
1440
1442
  [Symbol.search]: (string: string) => number;
1441
1443
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
1442
1444
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
1443
- } | ((params: {
1444
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
1445
- }) => any) | {
1445
+ } | {
1446
1446
  toString: () => string;
1447
1447
  toDateString: () => string;
1448
1448
  toTimeString: () => string;
@@ -2291,7 +2291,9 @@ declare const _default: import("vue").DefineComponent<{
2291
2291
  } | undefined;
2292
2292
  autofocus?: string | undefined;
2293
2293
  autoselect?: boolean | undefined;
2294
- defaultValue?: string | number | object | any[] | {
2294
+ defaultValue?: string | number | object | any[] | ((params: {
2295
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
2296
+ }) => any) | {
2295
2297
  exec: (string: string) => RegExpExecArray | null;
2296
2298
  test: (string: string) => boolean;
2297
2299
  readonly source: string;
@@ -2312,9 +2314,7 @@ declare const _default: import("vue").DefineComponent<{
2312
2314
  [Symbol.search]: (string: string) => number;
2313
2315
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
2314
2316
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
2315
- } | ((params: {
2316
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
2317
- }) => any) | {
2317
+ } | {
2318
2318
  toString: () => string;
2319
2319
  toDateString: () => string;
2320
2320
  toTimeString: () => string;
@@ -2753,7 +2753,9 @@ declare const _default: import("vue").DefineComponent<{
2753
2753
  } | undefined;
2754
2754
  autofocus?: string | undefined;
2755
2755
  autoselect?: boolean | undefined;
2756
- defaultValue?: string | number | object | any[] | {
2756
+ defaultValue?: string | number | object | any[] | ((params: {
2757
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
2758
+ }) => any) | {
2757
2759
  exec: (string: string) => RegExpExecArray | null;
2758
2760
  test: (string: string) => boolean;
2759
2761
  readonly source: string;
@@ -2774,9 +2776,7 @@ declare const _default: import("vue").DefineComponent<{
2774
2776
  [Symbol.search]: (string: string) => number;
2775
2777
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
2776
2778
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
2777
- } | ((params: {
2778
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
2779
- }) => any) | {
2779
+ } | {
2780
2780
  toString: () => string;
2781
2781
  toDateString: () => string;
2782
2782
  toTimeString: () => string;
@@ -3056,7 +3056,9 @@ declare const _default: import("vue").DefineComponent<{
3056
3056
  } | undefined;
3057
3057
  autofocus?: string | undefined;
3058
3058
  autoselect?: boolean | undefined;
3059
- defaultValue?: string | number | object | any[] | {
3059
+ defaultValue?: string | number | object | any[] | ((params: {
3060
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
3061
+ }) => any) | {
3060
3062
  exec: (string: string) => RegExpExecArray | null;
3061
3063
  test: (string: string) => boolean;
3062
3064
  readonly source: string;
@@ -3077,9 +3079,7 @@ declare const _default: import("vue").DefineComponent<{
3077
3079
  [Symbol.search]: (string: string) => number;
3078
3080
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
3079
3081
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
3080
- } | ((params: {
3081
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
3082
- }) => any) | {
3082
+ } | {
3083
3083
  toString: () => string;
3084
3084
  toDateString: () => string;
3085
3085
  toTimeString: () => string;
@@ -3532,7 +3532,9 @@ declare const _default: import("vue").DefineComponent<{
3532
3532
  } | undefined;
3533
3533
  autofocus?: string | undefined;
3534
3534
  autoselect?: boolean | undefined;
3535
- defaultValue?: string | number | object | any[] | {
3535
+ defaultValue?: string | number | object | any[] | ((params: {
3536
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
3537
+ }) => any) | {
3536
3538
  exec: (string: string) => RegExpExecArray | null;
3537
3539
  test: (string: string) => boolean;
3538
3540
  readonly source: string;
@@ -3553,9 +3555,7 @@ declare const _default: import("vue").DefineComponent<{
3553
3555
  [Symbol.search]: (string: string) => number;
3554
3556
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
3555
3557
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
3556
- } | ((params: {
3557
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
3558
- }) => any) | {
3558
+ } | {
3559
3559
  toString: () => string;
3560
3560
  toDateString: () => string;
3561
3561
  toTimeString: () => string;
@@ -3891,7 +3891,9 @@ declare const _default: import("vue").DefineComponent<{
3891
3891
  } | undefined;
3892
3892
  autofocus?: string | undefined;
3893
3893
  autoselect?: boolean | undefined;
3894
- defaultValue?: string | number | object | any[] | {
3894
+ defaultValue?: string | number | object | any[] | ((params: {
3895
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
3896
+ }) => any) | {
3895
3897
  exec: (string: string) => RegExpExecArray | null;
3896
3898
  test: (string: string) => boolean;
3897
3899
  readonly source: string;
@@ -3912,9 +3914,7 @@ declare const _default: import("vue").DefineComponent<{
3912
3914
  [Symbol.search]: (string: string) => number;
3913
3915
  [Symbol.split]: (string: string, limit?: number | undefined) => string[];
3914
3916
  [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
3915
- } | ((params: {
3916
- column: import("vxe-table").VxeTableDefines.ColumnInfo;
3917
- }) => any) | {
3917
+ } | {
3918
3918
  toString: () => string;
3919
3919
  toDateString: () => string;
3920
3920
  toTimeString: () => string;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,provide as o,ref as a,watch as l,resolveComponent as s,openBlock as i,createElementBlock as n,unref as r,normalizeStyle as u,createBlock as c,resolveDynamicComponent as f,createElementVNode as d,createVNode as m,mergeProps as p,createSlots as v,renderList as b,withCtx as h,createCommentVNode as g,renderSlot as x}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as y}from"@vueuse/core";import"date-fns";import{isString as C,isFunction as j}from"lodash-es";import{widthAppend as D,uuidGenerator as $}from"../../../shared/utils/index.js";import{promiseTimeout as _}from"@vueuse/shared";import{VxeTableEventNameList as H,InjectionIhoTableEmits as T,InjectionIhoTableAnnotation as w,InjectionIhoTableUUID as A,InjectionIhoTableInstance as L,InjectionIhoTableConfig as R,InjectionIhoTableFieldList as E,InjectionIhoTableHandler as F}from"./constants/index.js";import{createTableHooks as I,applyTableConfigHooks as O,applyTableFieldHooks as S,createTableEventHandlers as W,createDomInsertComponent as q,createDataTransfer as z}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as B}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as G}from"./utils/index.js";import J from"../../../_virtual/plugin-vue_export-helper.js";const K=["id"];var M=J(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",...H],setup(e,{expose:H,emit:J}){var M,N;const P=e,Q=k({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),U=t((()=>{var e,t;const o=null!=(t=null==(e=P.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===o?"100%":C(o)&&(o.includes("calc")||o.endsWith("%"))?o:D(o)}})),V=B(),X=function(e,...t){J(e,...t);const o=r(te)[G(e)];j(o)&&o(...t),V.trigger(e,...t)};o(T,X);const Y=I();o(w,t((()=>P.annotation)));const Z=$();o(A,Z);const ee=a();o(L,ee);const te=a({uuid:null!=(N=null==(M=P.tableConfig)?void 0:M.uuid)?N:Z});o(R,te);const oe=y(ae,10);function ae(){te.value=O(Y,P.tableConfig,{$table:ee,emits:X}),te.value.uuid=Z}const le=a([]);o(E,le);const se=y(ie,10);function ie(){le.value=S(Y,P.fieldList,te.value,{$table:ee,emits:X})}const ne=z(Y,te,ee),re=a([]),ue=y(ce,10);async function ce(){var e;re.value=await ne(P.tableData),null==(e=ee.value)||e.recalculate(!0)}const fe={updateTableDataRef:ue,updateConfigRef:oe,updateFieldListRef:se};o(F,fe);const de=W({hooks:Y,config:te,$table:ee,context:fe,emits:X}),me=t((()=>({...te.value,...de})));l((()=>P.tableConfig),(()=>{oe(),se(),ue()}),{deep:!0}),l((()=>P.fieldList),(()=>{se(),ue()}),{deep:!0}),l([()=>P.tableData,()=>{var e;return null==(e=P.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=te.value.treeConfig)?void 0:e.expandAll)&&(await _(11),null==(t=ee.value)||t.setAllTreeExpand(!0))})),l((()=>[...P.tableData]),ue),ae(),ie(),ce();const{header:pe,footer:ve}=q(Y);return H({$table:ee,async loadData(e){var t;null==(t=ee.value)||t.loadData(await ne(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),...Y.exposeHooks.expose.call({},te,{$table:ee,emits:X})}),Y.setupHooks.setup.call(te,le,{$table:ee,emits:X}),(e,t)=>{const o=s("vxe-grid");return i(),n("section",{class:"iho-table",id:r(Z),style:u(r(Q))},[(i(),c(f(r(pe)))),d("section",{style:u(r(U))},[m(o,p({ref_key:"$table",ref:ee},r(me),{columns:le.value,data:re.value}),v({_:2},[b(e.$slots,((t,o)=>({name:o,fn:h((()=>[g(" 实际上所有的vxe-grid插槽都支持 "),x(e.$slots,o)]))})))]),1040,["columns","data"])],4),(i(),c(f(r(ve))))],12,K)}}}),[["__file","IhoTable.vue"]]);export{M as default};
1
+ import{defineComponent as e,computed as t,provide as a,ref as o,watch as l,resolveComponent as s,openBlock as n,createElementBlock as i,unref as r,normalizeStyle as u,createBlock as c,resolveDynamicComponent as f,createElementVNode as d,createVNode as m,mergeProps as p,createSlots as v,renderList as b,withCtx as h,createCommentVNode as g,renderSlot as x}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as y}from"@vueuse/core";import"date-fns";import{isString as C,isFunction as D}from"lodash-es";import{widthAppend as j,uuidGenerator as $}from"../../../shared/utils/index.js";import{promiseTimeout as _}from"@vueuse/shared";import{VxeTableEventNameList as H,InjectionIhoTableEmits as T,InjectionIhoTableAnnotation as w,InjectionIhoTableUUID as A,InjectionIhoTableInstance as L,InjectionIhoTableConfig as R,InjectionIhoTableFieldList as E,InjectionIhoTableHandler as F}from"./constants/index.js";import{createTableHooks as I,applyTableConfigHooks as O,applyTableFieldHooks as S,createTableEventHandlers as W,createDomInsertComponent as q,createDataTransfer as z}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as B}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as G}from"./utils/index.js";import J from"../../../_virtual/plugin-vue_export-helper.js";const K=["id"];var M=J(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",...H],setup(e,{expose:H,emit:J}){var M,N;const P=e,Q=k({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),U=t((()=>{var e,t;const a=null!=(t=null==(e=P.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===a?"100%":C(a)&&(a.includes("calc")||a.endsWith("%"))?a:j(a)}})),V=B(),X=function(e,...t){J(e,...t);const a=r(te)[G(e)];D(a)&&a(...t),V.trigger(e,...t)};a(T,X);const Y=I();a(w,t((()=>P.annotation)));const Z=$();a(A,Z);const ee=o();a(L,ee);const te=o({uuid:null!=(N=null==(M=P.tableConfig)?void 0:M.uuid)?N:Z});a(R,te);const ae=y(oe,10);function oe(){te.value=O(Y,P.tableConfig,{$table:ee,emits:X}),te.value.uuid=Z}const le=o([]);a(E,le);const se=y(ne,10);function ne(){le.value=S(Y,P.fieldList,te.value,{$table:ee,emits:X})}const ie=z(Y,te,ee),re=o([]),ue=y(ce,10);async function ce(){var e;re.value=await ie(P.tableData),null==(e=ee.value)||e.recalculate(!0)}const fe={updateTableDataRef:ue,updateConfigRef:ae,updateFieldListRef:se};a(F,fe);const de=W({hooks:Y,config:te,$table:ee,context:fe,emits:X}),me=t((()=>({...te.value,...de})));l((()=>P.tableConfig),(()=>{ae(),se(),ue()}),{deep:!0}),l((()=>P.fieldList),(()=>{se(),ue()}),{deep:!0}),l([()=>P.tableData,()=>{var e;return null==(e=P.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=te.value.treeConfig)?void 0:e.expandAll)&&(await _(11),null==(t=ee.value)||t.setAllTreeExpand(!0))})),l([()=>[...P.tableData],()=>{var e;return null==(e=P.tableData)?void 0:e.length}],ue),oe(),ne(),ce();const{header:pe,footer:ve}=q(Y);return H({$table:ee,async loadData(e){var t;null==(t=ee.value)||t.loadData(await ie(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),...Y.exposeHooks.expose.call({},te,{$table:ee,emits:X})}),Y.setupHooks.setup.call(te,le,{$table:ee,emits:X}),(e,t)=>{const a=s("vxe-grid");return n(),i("section",{class:"iho-table",id:r(Z),style:u(r(Q))},[(n(),c(f(r(pe)))),d("section",{style:u(r(U))},[m(a,p({ref_key:"$table",ref:ee},r(me),{columns:le.value,data:re.value}),v({_:2},[b(e.$slots,((t,a)=>({name:a,fn:h((()=>[g(" 实际上所有的vxe-grid插槽都支持 "),x(e.$slots,a)]))})))]),1040,["columns","data"])],4),(n(),c(f(r(ve))))],12,K)}}}),[["__file","IhoTable.vue"]]);export{M as default};
@@ -45,6 +45,7 @@ declare const _default: import("vue").DefineComponent<{
45
45
  emit: (event: "click" | "update:formattedValue", ...args: any[]) => void;
46
46
  formRef: import("vue").Ref<HTMLElement | null>;
47
47
  isShow: import("vue").Ref<boolean>;
48
+ timePickerRef: import("vue").Ref<any>;
48
49
  __formattedValue: import("vue").Ref<string | undefined>;
49
50
  oldValue: string | undefined;
50
51
  placeholder: any;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as t,ref as a,openBlock as l,createBlock as o,unref as r,mergeProps as u,withCtx as i,createVNode as m,isRef as n,createElementBlock as f,Fragment as d,renderList as s,createTextVNode as c,toDisplayString as p,createCommentVNode as v}from"vue";import{NPopover as _,NInput as h,NSpace as k,NScrollbar as y,NButton as V}from"naive-ui";import{useIhoTableFormEvent as w}from"../../../../utils/index.js";import{useAutoFocus as b}from"../hooks/useAutoFocus.js";import g from"../../../../../../time-picker/index.js";import{parse as j,isValid as C,format as F}from"date-fns";import x from"../../../../../../../_virtual/plugin-vue_export-helper.js";var q=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 q=e,O=t(),{emitFormChangeWithParams:A}=w(q),{formRef:H,isShow:R}=b(),S=a(q.formattedValue);let T=q.formattedValue;const{placeholder:U="请选择",valueFormat:z="HH:mm",shortcutOptions:B=[]}=O,D={placeholder:U,valueFormat:z,format:z};function E(e){S.value=e,T!==e&&(x("update:formattedValue",e),A({oldValue:T}),T=e)}function I(){const e=j(q.formattedValue||"",D.valueFormat.replace(/:/,""),new Date);if(C(e)){E(F(e,D.valueFormat))}}function K(e){var t;const{key:a}=e;"Enter"===a&&(null==(t=H.value)||t.blur(),R.value=!1)}return(t,a)=>(l(),o(r(_),u({show:r(R),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},t.$attrs,{onClickoutside:a[3]||(a[3]=()=>R.value=!1)}),{trigger:i((()=>[m(r(h),{ref_key:"formRef",ref:H,clearable:"",value:e.formattedValue,"onUpdate:value":a[0]||(a[0]=e=>n(formattedValue)?formattedValue.value=e:null),onClick:a[1]||(a[1]=()=>R.value=!0),onBlur:I,onKeyup:K},null,8,["value"])])),default:i((()=>[m(r(k),null,{default:i((()=>[m(r(g),u({show:"","formatted-value":S.value},r(D),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":E,onConfirm:a[2]||(a[2]=()=>R.value=!1)}),null,16,["formatted-value"]),m(r(y),{class:"iho-table__scrollbar"},{default:i((()=>[r(B).length?(l(),o(r(k),{key:0,vertical:"",wrap:!1},{default:i((()=>[(l(!0),f(d,null,s(r(B),(e=>(l(),o(r(V),{size:"tiny",key:e,onClick:t=>function(e){E(e),R.value=!1}(e)},{default:i((()=>[c(p(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):v("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}}),[["__file","editTime.vue"]]);export{q as default};
1
+ import{defineComponent as e,useAttrs as t,ref as l,watch as a,nextTick as o,openBlock as r,createBlock as u,unref as i,mergeProps as n,withCtx as m,createVNode as f,isRef as d,createElementBlock as c,Fragment as v,renderList as s,createTextVNode as p,toDisplayString as _,createCommentVNode as k}from"vue";import{NPopover as h,NInput as y,NSpace as w,NScrollbar as V,NButton as b}from"naive-ui";import{useIhoTableFormEvent as g}from"../../../../utils/index.js";import{useAutoFocus as j}from"../hooks/useAutoFocus.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as q,format as x}from"date-fns";import R from"../../../../../../../_virtual/plugin-vue_export-helper.js";var S=R(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:R}){const S=e,A=t(),{emitFormChangeWithParams:I}=g(S),{formRef:O,isShow:P}=j(),$=l(),E=l(S.formattedValue);let H=S.formattedValue;const{placeholder:T="请选择",valueFormat:U="HH:mm",shortcutOptions:z=[]}=A,B={placeholder:T,valueFormat:U,format:U};function D(e){E.value=e,H!==e&&(R("update:formattedValue",e),I({oldValue:H}),H=e)}function K(){const e=F(S.formattedValue||"",B.valueFormat.replace(/:/,""),new Date);if(q(e)){D(x(e,B.valueFormat))}}function N(e){var t;const{key:l}=e;"Enter"===l&&(null==(t=O.value)||t.blur(),P.value=!1)}return a((()=>P.value),(async e=>{var t,l,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(l=null==(t=$.value)?void 0:t.$timePicker)?void 0:l.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var t,l;return null==(l=null==(t=null==e?void 0:e.querySelector)?void 0:t.call(e,".n-time-picker-col__item--active"))?void 0:l.scrollIntoView()})))})),(t,l)=>(r(),u(i(h),n({show:i(P),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},t.$attrs,{onClickoutside:l[3]||(l[3]=()=>P.value=!1)}),{trigger:m((()=>[f(i(y),{ref_key:"formRef",ref:O,clearable:"",value:e.formattedValue,"onUpdate:value":l[0]||(l[0]=e=>d(formattedValue)?formattedValue.value=e:null),onClick:l[1]||(l[1]=()=>P.value=!0),onBlur:K,onKeyup:N},null,8,["value"])])),default:m((()=>[f(i(w),null,{default:m((()=>[f(i(C),n({ref_key:"timePickerRef",ref:$,show:"","formatted-value":E.value},i(B),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":D,onConfirm:l[2]||(l[2]=()=>P.value=!1)}),null,16,["formatted-value"]),f(i(V),{class:"iho-table__scrollbar"},{default:m((()=>[i(z).length?(r(),u(i(w),{key:0,vertical:"",wrap:!1},{default:m((()=>[(r(!0),c(v,null,s(i(z),(e=>(r(),u(i(b),{size:"tiny",key:e,onClick:t=>function(e){D(e),P.value=!1}(e)},{default:m((()=>[p(_(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):k("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}}),[["__file","editTime.vue"]]);export{S as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,ref as o,computed as l,provide as n,watch as r,onMounted as a,createVNode as s,h as i,unref as u,onBeforeUnmount as c,shallowReactive as d}from"vue";import{widthAppend as p,traverse as f}from"../../../../../shared/utils/index.js";import{doAnimation as m}from"../../../../../shared/utils/anime.js";import{useThrottleFn as h}from"@vueuse/core";import{promiseTimeout as g}from"@vueuse/shared";import{isFunction as v,isNumber as x,last as I,omit as b}from"lodash-es";import"../../../index.js";import{InjectionIhoTableUUID as w,WIDGET_TYPE as y}from"../../constants/index.js";import{useUUIDMap as T}from"../../utils/index.js";import{defineTablePlugin as R}from"../../hooks/useTablePlugin.js";class H{constructor(){this.records={},this.maxRecords=d(new Map)}set(e,t,o){if(this.records[e]||(this.records[e]={}),this.records[e][t]===o)return;this.records[e][t]=o;const l=Math.max(...Object.values(this.records[e]),0);this.maxRecords.get(e)!==l&&this.maxRecords.set(e,l)}getMax(e){return this.maxRecords.get(e)||0}}const{getItemFromUUID:D,removeItemFromUUID:M}=T((()=>new H),!0),{getItemFromUUID:S,removeItemFromUUID:U,setItemFromUUID:C}=T((()=>null)),{getItemFromUUID:$,removeItemFromUUID:E,setItemFromUUID:k}=T((()=>{})),F=e({props:{payload:{type:Object,required:!0}},setup(e){const u=t(w),c=t("$xetable"),d=o(),f=D(u),m=l((()=>e.payload.row[e.payload.column.field]));function h(){const{row:t,column:o}=e.payload,l=c.getRowSeq(t);if(!f||null==l||!d.value)return;const n=d.value.clientHeight;f.set(l,o.field,n)}n("updateCellHeight",h),r([()=>e.payload.rowIndex,()=>e.payload.column.field,m,()=>e.payload.column.renderWidth],(async()=>{await g(0),h()})),a((()=>{c&&!S(u)&&C(u,c),h()}));const I=l((()=>{var t,o,l,n;const r=null!=(o=null==(t=e.payload.column.editRender)?void 0:t.props)?o:{},a=null!=(n=null==(l=r.slots)?void 0:l.default)?n:r.slotFn;return v(a)?a:()=>m.value})),b=l((()=>{const t=e.payload.column.renderWidth;return x(t)&&t>0?p(t-20-2):""}));return()=>s("div",{ref:d,style:{padding:"7px 0",width:b.value}},[i(I.value,e.payload)])}});function j(e,t,{scrollTop:o=0}){var l,n;const{uuid:r,rowConfig:a={}}=t;if(!r)return;const s=D(r),{oSize:i=0,gt:c=100}=null!=(l=$(r))?l:{},{internalData:d,reactData:p}=e,{scrollYStore:f,elemStore:m,afterFullData:h,fullDataRowIdData:g}=d;if(c>h.length)return;const x=null!=(n=a.height)?n:36,b=m["main-body-wrapper"],w=b?u(b):null;let y=w?Math.max(8,Math.ceil(w.clientHeight/x)+2+i):8;const T=[0];let R=0;if(o&&h.find(((t,l)=>{const n=e.getRowSeq(t),r=(I(T)||0)+Math.max(x,s.getMax(n));if(T.push(r),r>o)return R=Math.max(0,l-i),y+=Math.min(R,i),!0})),R>0&&v(t.spanMethod)){const{spanMethod:o}=t,l={rowspan:1,colspan:1};for(;R>0;){if(!e.getColumns().some(((e,t)=>{const{rowspan:n,colspan:r}=o({column:e,columnIndex:t,$columnIndex:t,row:h[R],rowIndex:R,$rowIndex:R,_rowIndex:R,isHidden:!e.visible,fixed:e.fixed,type:e.type,visibleData:h})||l;if(0===n&&0===r)return R--,!0})))break}}const H=`${T[R]}px`,M=`${h.reduce(((t,o)=>{const l=e.getRowSeq(o);return t+Math.max(x,s.getMax(l))}),0)}px`;["main","left","right"].forEach((e=>{const t=m[`${e}-body-table`],l=t?u(t):null;l&&(l.style.marginTop=H,l.scrollTop=o),["header","body","footer"].forEach((t=>{const o=m[`${e}-${t}-ySpace`],l=o?u(o):null;l&&(l.style.height=M)}))}));const S=Math.min(h.length,R+y);if(f.startIndex===R&&f.endIndex===S)return;f.startIndex=R,f.endIndex=S;const U=h.slice(f.startIndex,f.endIndex);U.forEach(((t,o)=>{const l=e.getRowid(t),n=g[l];n&&(n.$index=o)})),p.tableData.length=0,p.tableData.push(...U)}const L=h(j,300);function Y(){const e="variableHeightRendererPlugin";return R({name:e,vxe(e){e.renderer.add(y.VARIABLE_HEIGHT,{renderCell:(e,t)=>s(F,{payload:t},null)})},apply(t){function o(e){const t=S(e.uuid);if(!t)return;e.scrollY={enabled:!1},t.reactData.scrollYLoad=!1;const o=function(e){const t=e.internalData.elemStore["main-body-wrapper"];return t?u(t):null}(t);o&&j(t,e,{scrollTop:o.scrollTop})}function l(e){if(!e.uuid)return;const t=$(e.uuid);t&&(e.scrollY=t),setTimeout((()=>o(e)),300)}t.dataHooks.dataStart.tap(e,l),t.eventHooks.onFilterChange.tap(e,((e,t)=>l(t))),t.eventHooks.onSortChange.tap(e,((e,t)=>l(t))),t.eventHooks.onToggleTreeExpand.tap(e,((e,t)=>l(t))),t.eventHooks.onResizableChange.tap(e,(async({column:e},t)=>{if(!e.editRender||!e.editRender.props)return;e.editRender.props.variableHeight&&l(t)})),t.eventHooks.onScroll.tap(e,h(((e,t)=>{if(e.isX)return;const{uuid:o}=t;if(!o)return;const l=S(o);l&&j(l,t,e)}),100,!0,!0)),t.fieldHooks.field.tap(e,(e=>{if(Reflect.get(e,"variableHeight")){const t=e.slots;e.slots=b(t,["default"]),e.editRender={...e.editRender,name:y.VARIABLE_HEIGHT};const o=e.className,l="variable-height";e.className=o?function(e){return v(o)?[o(e),l]:[o,l]}:l}return e})),t.fieldHooks.fieldList.tap(e,((e,t,{$table:l})=>(t.uuid&&f(e,((n,r)=>{var a,s,i;if((null==(a=n.editRender)?void 0:a.name)===y.VARIABLE_HEIGHT){const n=null!=(i=null==(s=t.rowConfig)?void 0:s.height)?i:36,a=D(t.uuid),c=t.cellStyle;if(t.cellStyle=function(e){const t={};if(e.column.fixed&&Reflect.get(e,"fixed")&&l.value){const o=Math.max(n,a.getMax(l.value.getRowSeq(e.row)));t.height=`${o}px`}return Object.assign(t,c?v(c)?c(e):c:null)},t.sortableConfig&&t.sortableConfig.enable){const e=t.sortableConfig.onEnd;t.sortableConfig.onEnd=function(o){const l=S(t.uuid);if(l){const{internalData:{elemStore:e}}=l,o=e["main-table-body"];o&&u(o)&&j(l,t,{scrollTop:u(o).scrollTop})}v(e)&&e(o)}}t.showOverflow="tooltip",f(e,(e=>{e.showOverflow="tooltip"})),t.scrollY={...t.scrollY,mode:"default"},t.onWheel=function(e){let t=null,o=0,l=!0;return function(n){if(!e.uuid)return;const r=S(e.uuid);if(!r)return;const{internalData:a}=r,{isHover:s}=e.rowConfig||{},{deltaX:i,deltaY:c}=n,{refTableLeftBody:d,refTableRightBody:p,refTableBody:f}=r.getRefMaps(),h=c,g=i,v=h<0,x=u(f),I=x?x.$el:null;if(!I)return;if(v?I.scrollTop<=0:I.scrollTop>=I.scrollHeight-I.clientHeight)return;const b=I.scrollTop+h,w=I.scrollLeft+g;if(b===a.lastScrollTop)return;n.preventDefault(),a.lastScrollTop=b,a.lastScrollLeft=w,a.lastScrollTime=Date.now(),s&&r.clearHoverRow();const y=d.value,T=p.value,R=y?y.$el:null,H=T?T.$el:null,D=Math.min(100,Math.abs(Math.floor(h/2)));l&&(o=I.scrollTop,l=!1),o+=D*(v?-1:1),t&&t(),t=m(I.scrollTop,o,400,(e=>{I.scrollTop=e,R&&(R.scrollTop=e),H&&(H.scrollTop=e)}),"easeOutCubic",(()=>{o=I.scrollTop,l=!0})),L(r,e,I)}}(t),setTimeout((()=>{k(t.uuid,t.scrollY),o(t)}),300),r()}})),e))),t.setupHooks.setup.tap(e,(e=>{c((()=>{e.value.uuid&&(M(e.value.uuid),U(e.value.uuid),E(e.value.uuid))}))}))}})}export{Y as variableHeightRendererPlugin};
1
+ import{defineComponent as e,inject as t,ref as o,computed as l,provide as n,watch as r,onMounted as a,createVNode as s,h as i,unref as u,onBeforeUnmount as d,shallowReactive as c}from"vue";import{widthAppend as p,traverse as f}from"../../../../../shared/utils/index.js";import{doAnimation as m}from"../../../../../shared/utils/anime.js";import{useThrottleFn as h}from"@vueuse/core";import{promiseTimeout as g}from"@vueuse/shared";import{isFunction as v,isNumber as x,last as I,omit as b}from"lodash-es";import"../../../index.js";import{InjectionIhoTableUUID as w,WIDGET_TYPE as y}from"../../constants/index.js";import{useUUIDMap as T}from"../../utils/index.js";import{defineTablePlugin as R}from"../../hooks/useTablePlugin.js";class H{constructor(){this.records={},this.maxRecords=c(new Map)}set(e,t,o){if(this.records[e]||(this.records[e]={}),this.records[e][t]===o)return;this.records[e][t]=o;const l=Math.max(...Object.values(this.records[e]),0);this.maxRecords.get(e)!==l&&this.maxRecords.set(e,l)}getMax(e){return this.maxRecords.get(e)||0}}const{getItemFromUUID:D,removeItemFromUUID:M}=T((()=>new H),!0),{getItemFromUUID:S,removeItemFromUUID:U,setItemFromUUID:C}=T((()=>null)),{getItemFromUUID:$,removeItemFromUUID:E,setItemFromUUID:k}=T((()=>{})),F=e({props:{payload:{type:Object,required:!0}},setup(e){const u=t(w),d=t("$xetable"),c=o(),f=D(u),m=l((()=>e.payload.row[e.payload.column.field]));function h(){const{row:t,column:o}=e.payload,l=d.getRowSeq(t);if(!f||null==l||!c.value)return;const n=c.value.clientHeight;f.set(l,o.field,n)}n("updateCellHeight",h),r([()=>e.payload.rowIndex,()=>e.payload.column.field,m,()=>e.payload.column.renderWidth],(async()=>{await g(0),h()})),a((()=>{d&&!S(u)&&C(u,d),h()}));const I=l((()=>{var t,o,l,n;const r=null!=(o=null==(t=e.payload.column.editRender)?void 0:t.props)?o:{},a=null!=(n=null==(l=r.slots)?void 0:l.default)?n:r.slotFn;return v(a)?a:()=>m.value})),b=l((()=>{const t=e.payload.column.renderWidth;return x(t)&&t>0?p(t-20-2):""}));return()=>s("div",{ref:c,style:{padding:"7px 0",width:b.value,overflow:"hidden"}},[i(I.value,e.payload)])}});function j(e,t,{scrollTop:o=0}){var l,n;const{uuid:r,rowConfig:a={}}=t;if(!r)return;const s=D(r),{oSize:i=0,gt:d=100}=null!=(l=$(r))?l:{},{internalData:c,reactData:p}=e,{scrollYStore:f,elemStore:m,afterFullData:h,fullDataRowIdData:g}=c;if(d>h.length)return;const x=null!=(n=a.height)?n:36,b=m["main-body-wrapper"],w=b?u(b):null;let y=w?Math.max(8,Math.ceil(w.clientHeight/x)+2+i):8;const T=[0];let R=0;if(o&&h.find(((t,l)=>{const n=e.getRowSeq(t),r=(I(T)||0)+Math.max(x,s.getMax(n));if(T.push(r),r>o)return R=Math.max(0,l-i),y+=Math.min(R,i),!0})),R>0&&v(t.spanMethod)){const{spanMethod:o}=t,l={rowspan:1,colspan:1};for(;R>0;){if(!e.getColumns().some(((e,t)=>{const{rowspan:n,colspan:r}=o({column:e,columnIndex:t,$columnIndex:t,row:h[R],rowIndex:R,$rowIndex:R,_rowIndex:R,isHidden:!e.visible,fixed:e.fixed,type:e.type,visibleData:h})||l;if(0===n&&0===r)return R--,!0})))break}}const H=`${T[R]}px`,M=`${h.reduce(((t,o)=>{const l=e.getRowSeq(o);return t+Math.max(x,s.getMax(l))}),0)}px`;["main","left","right"].forEach((e=>{const t=m[`${e}-body-table`],l=t?u(t):null;l&&(l.style.marginTop=H,l.scrollTop=o),["header","body","footer"].forEach((t=>{const o=m[`${e}-${t}-ySpace`],l=o?u(o):null;l&&(l.style.height=M)}))}));const S=Math.min(h.length,R+y);if(f.startIndex===R&&f.endIndex===S)return;f.startIndex=R,f.endIndex=S;const U=h.slice(f.startIndex,f.endIndex);U.forEach(((t,o)=>{const l=e.getRowid(t),n=g[l];n&&(n.$index=o)})),p.tableData.length=0,p.tableData.push(...U)}const L=h(j,300);function Y(){const e="variableHeightRendererPlugin";return R({name:e,vxe(e){e.renderer.add(y.VARIABLE_HEIGHT,{renderCell:(e,t)=>s(F,{payload:t},null)})},apply(t){function o(e){const t=S(e.uuid);if(!t)return;e.scrollY={enabled:!1},t.reactData.scrollYLoad=!1;const o=function(e){const t=e.internalData.elemStore["main-body-wrapper"];return t?u(t):null}(t);o&&j(t,e,{scrollTop:o.scrollTop})}function l(e){if(!e.uuid)return;const t=$(e.uuid);t&&(e.scrollY=t),setTimeout((()=>o(e)),300)}t.dataHooks.dataStart.tap(e,l),t.eventHooks.onFilterChange.tap(e,((e,t)=>l(t))),t.eventHooks.onSortChange.tap(e,((e,t)=>l(t))),t.eventHooks.onToggleTreeExpand.tap(e,((e,t)=>l(t))),t.eventHooks.onResizableChange.tap(e,(async({column:e},t)=>{if(!e.editRender||!e.editRender.props)return;e.editRender.props.variableHeight&&l(t)})),t.eventHooks.onScroll.tap(e,h(((e,t)=>{if(e.isX)return;const{uuid:o}=t;if(!o)return;const l=S(o);l&&j(l,t,e)}),100,!0,!0)),t.fieldHooks.field.tap(e,(e=>{if(Reflect.get(e,"variableHeight")){const t=e.slots;e.slots=b(t,["default"]),e.editRender={...e.editRender,name:y.VARIABLE_HEIGHT};const o=e.className,l="variable-height";e.className=o?function(e){return v(o)?[o(e),l]:[o,l]}:l}return e})),t.fieldHooks.fieldList.tap(e,((e,t,{$table:l})=>(t.uuid&&f(e,((n,r)=>{var a,s,i;if((null==(a=n.editRender)?void 0:a.name)===y.VARIABLE_HEIGHT){const n=null!=(i=null==(s=t.rowConfig)?void 0:s.height)?i:36,a=D(t.uuid),d=t.cellStyle;if(t.cellStyle=function(e){const t={};if(e.column.fixed&&Reflect.get(e,"fixed")&&l.value){const o=Math.max(n,a.getMax(l.value.getRowSeq(e.row)));t.height=`${o}px`}return Object.assign(t,d?v(d)?d(e):d:null)},t.sortableConfig&&t.sortableConfig.enable){const e=t.sortableConfig.onEnd;t.sortableConfig.onEnd=function(o){const l=S(t.uuid);if(l){const{internalData:{elemStore:e}}=l,o=e["main-table-body"];o&&u(o)&&j(l,t,{scrollTop:u(o).scrollTop})}v(e)&&e(o)}}t.showOverflow="tooltip",f(e,(e=>{e.showOverflow="tooltip"})),t.scrollY={...t.scrollY,mode:"default"},t.onWheel=function(e){let t=null,o=0,l=!0;return function(n){if(!e.uuid)return;const r=S(e.uuid);if(!r)return;const{internalData:a}=r,{isHover:s}=e.rowConfig||{},{deltaX:i,deltaY:d}=n,{refTableLeftBody:c,refTableRightBody:p,refTableBody:f}=r.getRefMaps(),h=d,g=i,v=h<0,x=u(f),I=x?x.$el:null;if(!I)return;if(v?I.scrollTop<=0:I.scrollTop>=I.scrollHeight-I.clientHeight)return;const b=I.scrollTop+h,w=I.scrollLeft+g;if(b===a.lastScrollTop)return;n.preventDefault(),a.lastScrollTop=b,a.lastScrollLeft=w,a.lastScrollTime=Date.now(),s&&r.clearHoverRow();const y=c.value,T=p.value,R=y?y.$el:null,H=T?T.$el:null,D=Math.min(100,Math.abs(Math.floor(h/2)));l&&(o=I.scrollTop,l=!1),o+=D*(v?-1:1),t&&t(),t=m(I.scrollTop,o,400,(e=>{I.scrollTop=e,R&&(R.scrollTop=e),H&&(H.scrollTop=e)}),"easeOutCubic",(()=>{o=I.scrollTop,l=!0})),L(r,e,I)}}(t),setTimeout((()=>{k(t.uuid,t.scrollY),o(t)}),300),r()}})),e))),t.setupHooks.setup.tap(e,(e=>{d((()=>{e.value.uuid&&(M(e.value.uuid),U(e.value.uuid),E(e.value.uuid))}))}))}})}export{Y as variableHeightRendererPlugin};
@@ -53,7 +53,7 @@ export declare namespace IhoTableLowCodeField {
53
53
  }>;
54
54
  type ColorAndIconItem = {
55
55
  condition?: {
56
- con: LOW_CODE_VALUE_RELATION | string;
56
+ con: LOW_CODE_VALUE_RELATION;
57
57
  value: unknown;
58
58
  field_key?: string;
59
59
  }[];
@@ -1 +1 @@
1
- import{defineComponent as e,reactive as t,ref as a,watch as o,nextTick as i,openBlock as l,createElementBlock as n,createCommentVNode as s,Fragment as r,unref as u,createBlock as c,mergeProps as p,createElementVNode as d,normalizeClass as m,normalizeStyle as v,createVNode as f,withCtx as g,renderList as y,toDisplayString as b,createTextVNode as k,resolveDynamicComponent as C,h as S}from"vue";import h from"./hooks/use-noData.js";import{getScaleViewState as w}from"./hooks/scaleview-state.js";import{ScaleViewComputed as E}from"./hooks/scaleview-computed.js";import{ScaleViewInit as _}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as A}from"./hooks/scaleview-submit.js";import{handleQueryParams as O,isCollection as j,isEvaluation as T}from"./utils/judge-types.js";import{useEvent as L}from"./hooks/use-event.js";import P from"./components/NoData.vue.js";import D from"./components/EvaluateCountdown.vue.js";import F from"./components/EvaluatePage.vue.js";import B from"./components/AnswerParse.vue.js";import N from"./components/ScaleScore.js";import{useDialog as x,useMessage as I,NForm as q,NFormItem as M,NButton as R}from"naive-ui";import K from"../../../_virtual/plugin-vue_export-helper.js";const V={class:"c-scale-view-block"},H=["innerHTML"],U={key:0,class:"required-text"},W={key:1,class:"evalute-label"},J=["onClick"],Y=d("i",{class:"scale-view-iconfont icon-scale-view-dengpao"},null,-1),X={key:1,class:"footer"};var G=K(e({__name:"ScaleView",props:{guageData:{type:Object,default:()=>({})},styleSetting:{type:Object,default:()=>({})},ids:{type:Object,default:()=>({guage_id:"",db_id:void 0})},params:{default:()=>({}),type:Object},noBtn:{type:[Boolean,String,Number],default:!1},hideBtn:{type:[Boolean,String,Number],default:!1},isLock:{type:[Boolean,String,Number],default:!1},type:{type:String,default:""},openType:{type:String,default:""},scaleApiConfig:{type:Object,default:()=>({})},getSelectOptions:{type:Function,default:()=>Promise.resolve([])},getSearchOptions:{type:Function,default:()=>Promise.resolve([])},getCascadeOptions:{type:Function,default:()=>Promise.resolve([])},getLabelList:{type:Function,default:()=>Promise.resolve([])},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},uploadPictureUrl:{type:String,default:""},uploadFileUrl:{type:String,default:""},ak:{type:String,default:"KP3BZ-OAC3W-PY6RY-OJ6DV-JYKN3-H6F72"},sourceType:{type:String,default:""},getChunkUploadConfig:{type:Function,default:()=>Promise.resolve({})}},emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:K,emit:G}){const Q=e,{ScaleViewState:Z}=w(),$=t(Z),z=x(),ee=I(),te=a(null),ae=a(null),{noDataState:oe,setNoData:ie,resetNodata:le}=h(),ne=O(),{showEvatip:se,isFormBoldOpen:re,scaleStyle:ue,handlePageClass:ce,isShowItem:pe,handleShowQuestionNumber:de,hasScore:me,isPreviewScale:ve,showEvaluateEntry:fe,showEvaluateCoundownPage:ge,showSaveBtn:ye,showEvaluateLabel:be,showAnswerParse:ke,propsConfig:Ce,evaluatePageProps:Se,evaluateCountdownProps:he,skipCover:we,scaleEdit:Ee}=E(Q,$,{query:ne}),{initForm:_e}=_(Q,$,G,{query:ne}),{submitMethod:Ae}=A(Q,$,G,{query:ne}),{nextLogicEvent:Oe,handleDynamicDataRelation:je}=L(Q,$);(()=>{let{id:e}=ne;e&&($.shareId=e)})();const Te=e=>{try{le(),_e(e)}catch(e){console.log(e,"--error"),$.spinning=!1,$.hasFrontAddress=!1,ie(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};o((()=>Q.ids),((e,t)=>{t?e.guage_id&&e.guage_id!=t.guage_id&&Te(e):e.guage_id&&Te(e)}),{immediate:!0}),o((()=>Q.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;$.form={},$.formArray=[];const t=JSON.parse(JSON.stringify(e));i((()=>{_e(t)}))}),{immediate:!0});const Le=e=>{$.showEvaluateSettingWrap=!1,$.showEvaluateCountdown=!!e,G("startWriteScale")},Pe=()=>{console.log("----closeEvaluateCountdown"),$.showEvaluateCountdown=!1,ve.value||($.banSubmit=!0,Ae(),z.warning({title:"温馨提示",content:"测评时间到了,结束测评!",maskClosable:!1,positiveText:"确定",onPositiveClick:()=>({})}))},De=e=>{z.warning({title:"提示",content:()=>S("div",{class:"evatip-container"},[S("span","答案解析:"),S("p",e)]),class:"c-evatip-dialog-wrap",showIcon:!1,positiveText:"确定",negativeText:"关闭",maskClosable:!1,onPositiveClick(){},onNegativeClick(){}})},Fe=(e,t,a)=>{console.log(e,"--val");let{choiceObj:o,isSetObj:i}=a||{};switch(t.type.includes("SELECT")||($.form[t.val_key]=e),t.type){case"SELECT":case"EVALUATE_SELECT":{let{value:a,list:o=[]}=e;$.form[t.val_key]=a,Oe(e,t,$.formArray),je(o,t,$.formArray)}break;case"RADIO_BLOCK":case"CHECKBOX_BLOCK":i&&($.choiceComObj[t.val_key]=o),Oe(e,t,$.formArray);break;case"EVALUATE_RADIO_BLOCK":case"EVALUATE_CHECKBOX_BLOCK":Oe(e,t,$.formArray);break;case"DATE":case"TIME":case"DATETIME":case"SEARCH_CASCADE":$.submitForm[t.val_key]=e}},Be=(e,t)=>{console.log(t),$.form[t.val_key]=e},Ne=e=>{if(!e||!e.length)return{labelStr:"",labels:[]};const t=e||[],a=[],o=[];return t.forEach((e=>{o.push(e),a.push(e.labelName)})),$.labelSelectedList=t,{labelStr:a.join(","),labels:o}},xe=()=>{var e;if(!$.formArray.find((e=>T(e.type))))return void Ie("确认要提交吗?");let{evaluateResultSetting:t}=$.config;if(!t||!Object.keys(t).length&&!fe.value||Ee.value)return void Ie("确认要结束测评吗?");if("formIframe"==Q.openType&&fe.value)return void G("submitNoRequest");let a="确定要提前结束测评吗?";if(ge.value&&(null==(e=te.value)?void 0:e.getCountdownObj)){const e=te.value.getCountdownObj(),{setAnswered:t,totalLen:o}=e;t<o?a="存在未作答的题目,确定要提前结束测评吗?":!(null==$?void 0:$.showEvaluateCountdown)&&(a="确认要结束测评吗?")}Ie(a)},Ie=e=>{z.warning({title:"温馨提示",content:()=>S("div",{style:{paddingLeft:"30px"}},e),positiveText:"确定",negativeText:"取消",maskClosable:!1,closable:!1,positiveButtonProps:{type:"primary"},onPositiveClick:async()=>{const e=await qe();G("onSubmit",e)},onNegativeClick(){}})},qe=()=>new Promise(((e,t)=>{var a;null==(a=ae.value)||a.validate((t=>{var a;if(t){console.log(t);let o=(null==(a=t[0])?void 0:a[0])||{},i=o.field,l=o.message,n=$.formArray.find((e=>e.databaseTitle===i));return n&&(i=n.title),ee.error(i+l),e(!1),!1}{const t=Ae();e(t)}}))})),Me=()=>{G("onCloseSetting")};return K({getScaleData:()=>({...$}),onSubmitForm:qe,cancel:Me}),(e,t)=>(l(),n("div",V,[s(' <template v-if="state.spinning">\r\n <n-spin :show="state.spinning" description="加载中"></n-spin>\r\n </template> '),$.spinning||$.hasFrontAddress?s("v-if",!0):(l(),n(r,{key:0},[u(oe).noData?(l(),c(P,{key:0,noDataImg:u(oe).noDataImg,noDataTip:u(oe).noDataTip},null,8,["noDataImg","noDataTip"])):(l(),n(r,{key:1},[u(fe)&&!u(we)?(l(),c(F,p({key:0},u(Se),{onWriteGuage:Le}),null,16)):(l(),n(r,{key:1},[u(ge)?(l(),c(D,p({key:0,ref_key:"countdownDom",ref:te},u(he),{onCloseEvaluateCountdown:Pe}),null,16)):s("v-if",!0),d("div",{class:m(["scale-container",{"scale-container-nopadding":u(ce),"scale-container-hasfooter":u(ye)}]),style:v(u(ue))},[u(me)?(l(),c(u(N),{key:0,config:$.config,maxScore:$.maxScore},null,8,["config","maxScore"])):s("v-if",!0),f(u(q),{ref_key:"formRef",ref:ae,model:$.form,rules:$.rules,"require-mark-placement":"left",class:"main"},{default:g((()=>[(l(!0),n(r,null,y($.formArray,((e,t)=>(l(),n(r,{key:(e.id||e.seq)+t},[u(pe)(e)?(l(),c(u(M),{key:0,path:e.val_key,"show-label":!u(j)(e.type),class:"c-scle-form-item"},{label:g((()=>[d("span",{class:m({"scale-label-required":u(re)(e)}),innerHTML:u(de)(e)},null,10,H),u(re)(e)?(l(),n("span",U,"(必填)")):s("v-if",!0),u(be)(e)?(l(),n("span",W,b(u(be)(e)),1)):s("v-if",!0),u(se)(e)?(l(),n("span",{key:2,class:"evalute-tip",onClick:t=>(async e=>{var t;if($.evatipMap[e.id])return void De($.evatipMap[e.id]);let a="getSubjectAnswer";const o=(null==(t=Q.scaleApiConfig)?void 0:t[a])||null;if(!o||"function"!=typeof o)return void ee.error(`${a} Is not a function`);let i=await o(e.id);i&&($.evatipMap[e.id]||($.evatipMap[e.id]=i,De(i)))})(e)},[Y,k(" 查看提示 ")],8,J)):s("v-if",!0)])),default:g((()=>[(l(),c(C(e.renderCom),p(u(Ce)(e,t),{key:(e.id||e.seq)+t,onScaleChange:Fe,onOnChange:t=>((e,t)=>{$.form[t.val_key]=Ne(e)})(t,e),onVodFileList:Be}),null,16,["onOnChange"])),u(ke)(e)?(l(),c(B,{key:0,item:e},null,8,["item"])):s("v-if",!0)])),_:2},1032,["path","show-label"])):s("v-if",!0)],64)))),128))])),_:1},8,["model","rules"])],6),u(ye)?(l(),n("div",X,[s(" 分享的链接 隐藏取消按钮 "),"guage"!==Q.sourceType?(l(),c(u(R),{key:0,onClick:Me},{default:g((()=>[k("取消")])),_:1})):s("v-if",!0),Q.isLock?s("v-if",!0):(l(),c(u(R),{key:1,onClick:xe,disabled:$.banSubmit,type:"primary"},{default:g((()=>[k("保存")])),_:1},8,["disabled"]))])):s("v-if",!0)],64))],64))],64))]))}}),[["__file","ScaleView.vue"]]);export{G as default};
1
+ import{defineComponent as e,reactive as t,ref as a,watch as o,nextTick as i,openBlock as l,createElementBlock as n,createCommentVNode as s,Fragment as r,unref as u,createBlock as c,mergeProps as p,createElementVNode as d,normalizeClass as m,normalizeStyle as v,createVNode as f,withCtx as g,renderList as y,toDisplayString as b,createTextVNode as k,resolveDynamicComponent as C,h as S}from"vue";import h from"./hooks/use-noData.js";import{getScaleViewState as w}from"./hooks/scaleview-state.js";import{ScaleViewComputed as E}from"./hooks/scaleview-computed.js";import{ScaleViewInit as _}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as A}from"./hooks/scaleview-submit.js";import{handleQueryParams as O,isCollection as j,isEvaluation as T}from"./utils/judge-types.js";import{useEvent as L}from"./hooks/use-event.js";import P from"./components/NoData.vue.js";import D from"./components/EvaluateCountdown.vue.js";import F from"./components/EvaluatePage.vue.js";import B from"./components/AnswerParse.vue.js";import N from"./components/ScaleScore.js";import{useDialog as x,useMessage as I,NForm as q,NFormItem as M,NButton as R}from"naive-ui";import K from"../../../_virtual/plugin-vue_export-helper.js";const V={class:"c-scale-view-block"},H=["innerHTML"],U={key:0,class:"required-text"},W={key:1,class:"evalute-label"},J=["onClick"],Y=d("i",{class:"scale-view-iconfont icon-scale-view-dengpao"},null,-1),X={key:1,class:"footer"};var G=K(e({__name:"ScaleView",props:{guageData:{type:Object,default:()=>({})},styleSetting:{type:Object,default:()=>({})},ids:{type:Object,default:()=>({guage_id:"",db_id:void 0})},params:{default:()=>({}),type:Object},noBtn:{type:[Boolean,String,Number],default:!1},hideBtn:{type:[Boolean,String,Number],default:!1},isLock:{type:[Boolean,String,Number],default:!1},type:{type:String,default:""},openType:{type:String,default:""},scaleApiConfig:{type:Object,default:()=>({})},getSelectOptions:{type:Function,default:()=>Promise.resolve([])},getSearchOptions:{type:Function,default:()=>Promise.resolve([])},getCascadeOptions:{type:Function,default:()=>Promise.resolve([])},getLabelList:{type:Function,default:()=>Promise.resolve([])},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},uploadPictureUrl:{type:String,default:""},uploadFileUrl:{type:String,default:""},ak:{type:String,default:"KP3BZ-OAC3W-PY6RY-OJ6DV-JYKN3-H6F72"},sourceType:{type:String,default:""},getChunkUploadConfig:{type:Function,default:()=>Promise.resolve({})}},emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:K,emit:G}){const Q=e,{ScaleViewState:Z}=w(),$=t(Z),z=x(),ee=I(),te=a(null),ae=a(null),{noDataState:oe,setNoData:ie,resetNodata:le}=h(),ne=O(),{showEvatip:se,isFormBoldOpen:re,scaleStyle:ue,handlePageClass:ce,isShowItem:pe,handleShowQuestionNumber:de,hasScore:me,isPreviewScale:ve,showEvaluateEntry:fe,showEvaluateCoundownPage:ge,showSaveBtn:ye,showEvaluateLabel:be,showAnswerParse:ke,propsConfig:Ce,evaluatePageProps:Se,evaluateCountdownProps:he,skipCover:we,scaleEdit:Ee}=E(Q,$,{query:ne}),{initForm:_e}=_(Q,$,G,{query:ne}),{submitMethod:Ae}=A(Q,$,G,{query:ne}),{nextLogicEvent:Oe,handleDynamicDataRelation:je}=L(Q,$);(()=>{let{id:e}=ne;e&&($.shareId=e)})();const Te=e=>{try{le(),_e(e)}catch(e){console.log(e,"--error"),$.spinning=!1,$.hasFrontAddress=!1,ie(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};o((()=>Q.ids),((e,t)=>{t?e.guage_id&&e.guage_id!=t.guage_id&&Te(e):e.guage_id&&Te(e)}),{immediate:!0}),o((()=>Q.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;$.form={},$.formArray=[];const t=JSON.parse(JSON.stringify(e));i((()=>{_e(t)}))}),{immediate:!0});const Le=e=>{$.showEvaluateSettingWrap=!1,$.showEvaluateCountdown=!!e,G("startWriteScale")},Pe=()=>{console.log("----closeEvaluateCountdown"),$.showEvaluateCountdown=!1,ve.value||($.banSubmit=!0,Ae(),z.warning({title:"温馨提示",content:"测评时间到了,结束测评!",maskClosable:!1,positiveText:"确定",onPositiveClick:()=>({})}))},De=e=>{z.warning({title:"提示",content:()=>S("div",{class:"evatip-container"},[S("span","答案解析:"),S("p",e)]),class:"c-evatip-dialog-wrap",showIcon:!1,positiveText:"确定",negativeText:"关闭",maskClosable:!1,onPositiveClick(){},onNegativeClick(){}})},Fe=(e,t,a)=>{console.log(e,"--val");let{choiceObj:o,isSetObj:i}=a||{};switch(t.type.includes("SELECT")||($.form[t.val_key]=e),t.type){case"SELECT":case"EVALUATE_SELECT":{let{value:a,list:o=[]}=e;$.form[t.val_key]=a,Oe(e,t,$.formArray),je(o,t,$.formArray)}break;case"RADIO_BLOCK":case"CHECKBOX_BLOCK":i&&($.choiceComObj[t.val_key]=o),Oe(e,t,$.formArray);break;case"EVALUATE_RADIO_BLOCK":case"EVALUATE_CHECKBOX_BLOCK":Oe(e,t,$.formArray);break;case"DATE":case"TIME":case"DATETIME":case"SEARCH_CASCADE":$.submitForm[t.val_key]=e}},Be=(e,t)=>{console.log(t),$.form[t.val_key]=e},Ne=e=>{if(!e||!e.length)return{labelStr:"",labels:[]};const t=e||[],a=[],o=[];return t.forEach((e=>{o.push(e),a.push(e.labelName)})),$.labelSelectedList=t,{labelStr:a.join(","),labels:o}},xe=()=>{var e;if(!$.formArray.find((e=>T(e.type))))return void Ie("确认要提交吗?");let{evaluateResultSetting:t}=$.config;if(!t||!Object.keys(t).length&&!fe.value||Ee.value)return void Ie("确认要结束测评吗?");if("formIframe"==Q.openType&&fe.value)return void G("submitNoRequest");let a="确定要提前结束测评吗?";if(ge.value&&(null==(e=te.value)?void 0:e.getCountdownObj)){const e=te.value.getCountdownObj(),{setAnswered:t,totalLen:o}=e;t<o?a="存在未作答的题目,确定要提前结束测评吗?":!(null==$?void 0:$.showEvaluateCountdown)&&(a="确认要结束测评吗?")}Ie(a)},Ie=e=>{z.warning({title:"温馨提示",content:()=>S("div",{style:{paddingLeft:"30px"}},e),positiveText:"确定",negativeText:"取消",maskClosable:!1,closable:!1,positiveButtonProps:{type:"primary"},onPositiveClick:async()=>{const e=await qe();G("onSubmit",e)},onNegativeClick(){}})},qe=()=>new Promise(((e,t)=>{var a;null==(a=ae.value)||a.validate((t=>{var a;if(t){console.log(t);let o=(null==(a=t[0])?void 0:a[0])||{},i=o.field,l=o.message,n=$.formArray.find((e=>e.databaseTitle===i));return n&&(i=n.title),ee.error(i+l),e(!1),!1}{const t=Ae();e(t)}}))})),Me=()=>{G("onCloseSetting")};return K({getScaleData:()=>({...$}),onSubmitForm:qe,cancel:Me}),(e,t)=>(l(),n("div",V,[s(' <template v-if="state.spinning">\n <n-spin :show="state.spinning" description="加载中"></n-spin>\n </template> '),$.spinning||$.hasFrontAddress?s("v-if",!0):(l(),n(r,{key:0},[u(oe).noData?(l(),c(P,{key:0,noDataImg:u(oe).noDataImg,noDataTip:u(oe).noDataTip},null,8,["noDataImg","noDataTip"])):(l(),n(r,{key:1},[u(fe)&&!u(we)?(l(),c(F,p({key:0},u(Se),{onWriteGuage:Le}),null,16)):(l(),n(r,{key:1},[u(ge)?(l(),c(D,p({key:0,ref_key:"countdownDom",ref:te},u(he),{onCloseEvaluateCountdown:Pe}),null,16)):s("v-if",!0),d("div",{class:m(["scale-container",{"scale-container-nopadding":u(ce),"scale-container-hasfooter":u(ye)}]),style:v(u(ue))},[u(me)?(l(),c(u(N),{key:0,config:$.config,maxScore:$.maxScore},null,8,["config","maxScore"])):s("v-if",!0),f(u(q),{ref_key:"formRef",ref:ae,model:$.form,rules:$.rules,"require-mark-placement":"left",class:"main"},{default:g((()=>[(l(!0),n(r,null,y($.formArray,((e,t)=>(l(),n(r,{key:(e.id||e.seq)+t},[u(pe)(e)?(l(),c(u(M),{key:0,path:e.val_key,"show-label":!u(j)(e.type),class:"c-scle-form-item"},{label:g((()=>[d("span",{class:m({"scale-label-required":u(re)(e)}),innerHTML:u(de)(e)},null,10,H),u(re)(e)?(l(),n("span",U,"(必填)")):s("v-if",!0),u(be)(e)?(l(),n("span",W,b(u(be)(e)),1)):s("v-if",!0),u(se)(e)?(l(),n("span",{key:2,class:"evalute-tip",onClick:t=>(async e=>{var t;if($.evatipMap[e.id])return void De($.evatipMap[e.id]);let a="getSubjectAnswer";const o=(null==(t=Q.scaleApiConfig)?void 0:t[a])||null;if(!o||"function"!=typeof o)return void ee.error(`${a} Is not a function`);let i=await o(e.id);i&&($.evatipMap[e.id]||($.evatipMap[e.id]=i,De(i)))})(e)},[Y,k(" 查看提示 ")],8,J)):s("v-if",!0)])),default:g((()=>[(l(),c(C(e.renderCom),p(u(Ce)(e,t),{key:(e.id||e.seq)+t,onScaleChange:Fe,onOnChange:t=>((e,t)=>{$.form[t.val_key]=Ne(e)})(t,e),onVodFileList:Be}),null,16,["onOnChange"])),u(ke)(e)?(l(),c(B,{key:0,item:e},null,8,["item"])):s("v-if",!0)])),_:2},1032,["path","show-label"])):s("v-if",!0)],64)))),128))])),_:1},8,["model","rules"])],6),u(ye)?(l(),n("div",X,[s(" 分享的链接 隐藏取消按钮 "),"guage"!==Q.sourceType?(l(),c(u(R),{key:0,onClick:Me},{default:g((()=>[k("取消")])),_:1})):s("v-if",!0),Q.isLock?s("v-if",!0):(l(),c(u(R),{key:1,onClick:xe,disabled:$.banSubmit,type:"primary"},{default:g((()=>[k("保存")])),_:1},8,["disabled"]))])):s("v-if",!0)],64))],64))],64))]))}}),[["__file","ScaleView.vue"]]);export{G as default};