cnhis-design-vue 3.2.13-release.0 → 3.2.14-beta.6

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 (59) hide show
  1. package/es/components/ai-chat/index.d.ts +3 -4
  2. package/es/components/ai-chat/src/Index.vue.d.ts +3 -4
  3. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  4. package/es/components/ai-chat/src/components/ChatBI.vue.d.ts +101 -0
  5. package/es/components/ai-chat/src/components/ChatBI.vue.js +1 -0
  6. package/es/components/ai-chat/src/components/ChatBI.vue2.js +1 -0
  7. package/es/components/ai-chat/src/components/ChatCard.d.ts +13 -0
  8. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  9. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +2 -3
  10. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  11. package/es/components/ai-chat/src/components/ChatMain.d.ts +1 -1
  12. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  13. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  14. package/es/components/ai-chat/src/utils/index.d.ts +1 -0
  15. package/es/components/ai-chat/src/utils/index.js +1 -0
  16. package/es/components/ai-chat/style/index.css +1 -1
  17. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  18. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  19. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
  21. package/es/components/fabric-chart/src/utils/index.d.ts +1 -0
  22. package/es/components/fabric-chart/src/utils/index.js +1 -1
  23. package/es/components/form-config/index.d.ts +9 -110
  24. package/es/components/form-config/index.js +1 -1
  25. package/es/components/form-config/src/FormConfig.vue.d.ts +9 -110
  26. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  27. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +2 -0
  28. package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -1
  29. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +4 -2
  30. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  31. package/es/components/form-config/src/components/renderer/ComplexNode.vue.d.ts +2 -1
  32. package/es/components/form-config/src/components/renderer/ComplexNode.vue2.js +1 -1
  33. package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -1
  34. package/es/components/form-config/src/constants/index.d.ts +2 -11
  35. package/es/components/form-config/src/constants/index.js +1 -1
  36. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  37. package/es/components/form-config/src/hooks/useLocale.d.ts +52 -0
  38. package/es/components/form-config/src/hooks/useLocale.js +1 -0
  39. package/es/components/form-config/src/types/index.d.ts +1 -0
  40. package/es/components/form-config/src/utils/index.d.ts +1 -0
  41. package/es/components/form-config/src/utils/index.js +1 -1
  42. package/es/components/form-render/src/utils/index.js +1 -1
  43. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  44. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  45. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +20 -0
  46. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  47. package/es/components/iho-table/src/types/index.d.ts +4 -0
  48. package/es/components/iho-table/style/index.css +1 -1
  49. package/es/components/index.css +1 -1
  50. package/es/components/index.js +1 -1
  51. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  52. package/es/env.d.ts +25 -25
  53. package/es/shared/package.json.js +1 -1
  54. package/es/shared/types/index.d.ts +3 -0
  55. package/es/shared/utils/index.d.ts +1 -0
  56. package/es/shared/utils/index.js +1 -1
  57. package/package.json +2 -2
  58. package/es/components/form-config/src/components/FormConfigEventSetting.vue.js +0 -1
  59. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +0 -1
@@ -1 +1 @@
1
- import{defineComponent as e,provide as o,ref as t,computed as r,toRaw as a,openBlock as i,createElementBlock as s,mergeProps as l,unref as n,createElementVNode as m,createVNode as u,isRef as f,withCtx as d,createBlock as c,createCommentVNode as p,createTextVNode as v}from"vue";import{useTheme as g}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as h,cloneDeep as _,isFunction as y}from"lodash-es";import"@vue/shared";import{uuidGenerator as x,traverse as j}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NSelect as k,NSpace as C}from"naive-ui";import{useVersion as L}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import F from"../../../shared/components/VueDraggable/src/vuedraggable.js";import V from"./components/FormConfigCreator.vue.js";import b from"./components/FormConfigDragDisplay.vue.js";import w from"./components/FormConfigEdit.vue.js";import M from"./components/FormConfigEventSetting.vue.js";import R from"./components/FormConfigMaterialItem.js";import{useDataNormalize as D}from"./hooks/useDataNormalize.js";import{InjectionFormConfigProps as E,InjectionFormConfigEmit as H,InjectionFieldList as S,InjectionMaterialList as I,InjectionLowCodeReactions as U,InjectionActiveFieldItem as O,FORM_CONFIG_GROUP as P}from"./constants/index.js";import{fieldItemNormalize as T}from"./utils/index.js";import{useSortableConfig as z}from"./hooks/useSortalbeConfig.js";import"./hooks/useConfigurationField.js";const A=["id"],B={class:"form-config__material"},N=m("header",{class:"form-config__materialHeader"},"物料区",-1),W={class:"form-config__displayWrapper"},q={class:"form-config__displayHeader"},G={class:"form-config__config"},J=m("header",{class:"form-config__configHeader"},"配置区",-1),K={class:"form-config__configContent"};var Q=e({__name:"FormConfig",props:{maxHeight:{type:String},fieldVisitor:{type:Object},textFormatter:{type:Function},formRenderRef:{type:Object},extraMaterialList:{type:[Array,Function]},showLowCodeReactions:Boolean,formProps:{type:Object},beforeMove:{type:Function}},emits:["addItem","removeItem","reactionsValidateFailure"],setup(e,{expose:Q,emit:X}){const Y=e;o(E,Y),o(H,X);const Z=x(),$=g(),ee=t([]);o(S,ee);const oe=t([]);o(I,oe);const te=t([]);function re(e){ee.value.some((o=>o.key===e.key))||ee.value.push(e)}o(U,te);const ae=(e,o)=>y(Y.textFormatter)?Y.textFormatter(e,o):o,ie=t();o(O,ie);const se=t(),{transform:le,inverseTransform:ne}=D(Y),me=r({get:()=>null,set(e){if(!e)return;const o=fe.value.find((o=>o.key===e));o&&(o.__extra=!0,T(o),oe.value.push(o),X("addItem",o))}}),ue=t([]),fe=r((()=>{if(!h(ue.value))return[];const e=[];return j([...oe.value,...ee.value],(o=>e.push(o.key))),ue.value.filter((o=>!e.find((e=>e===o.key))))}));async function de(){Y.extraMaterialList&&!ue.value.length&&(ue.value=y(Y.extraMaterialList)?await Y.extraMaterialList():Y.extraMaterialList)}return Q({loadData({fieldList:e,lowCodeReactions:o=[]}){let t=[],r=[];e.forEach((e=>{return!1===(o=_(a(e))).show?r.push(o):t.push(o),void T(o);var o})),ee.value=le(t),oe.value=r,te.value=o,ie.value=void 0},validate(){var e;return null==(e=se.value)?void 0:e.validate()},getData:(e=!1)=>({fieldList:ne(_(a(ee.value)),e,{show:!0}),materialList:ne(_(a(oe.value)),e,{show:!1}),lowCodeReactions:_(a(te.value))}),clearExtraList(){ue.value=[]}}),(o,t)=>(i(),s("section",l({class:"form-config",style:{"--max-height":e.maxHeight,...n($)},id:n(Z)},n(L)()),[m("section",B,[N,u(n(F),l(z({fieldList:ee,materialList:oe,hooks:{beforeMove:Y.beforeMove}}),{class:"form-config__materialContent",modelValue:n(oe),"onUpdate:modelValue":t[0]||(t[0]=e=>f(oe)?oe.value=e:null)}),{item:d((({element:e})=>[u(n(R),{"form-config-item":e,"text-formatter":ae,"material-List":n(oe)},null,8,["form-config-item","material-List"])])),_:1},16,["modelValue"]),e.extraMaterialList?(i(),c(n(k),{key:0,class:"form-config__materialExtraList",filterable:"",value:n(me),"onUpdate:value":t[1]||(t[1]=e=>f(me)?me.value=e:null),placeholder:"请选择额外物料",options:n(fe),"label-field":"name","value-field":"key",onFocus:de},null,8,["value","options"])):p("v-if",!0)]),m("section",W,[m("header",q,[v(" 布局区 "),u(n(C),null,{default:d((()=>[e.showLowCodeReactions?(i(),c(M,{key:0,modelValue:te.value,"onUpdate:modelValue":t[2]||(t[2]=e=>te.value=e),onValidateFailure:t[3]||(t[3]=e=>X("reactionsValidateFailure",e))},null,8,["modelValue"])):p("v-if",!0),u(V,{onSubmit:re})])),_:1})]),u(b,{class:"form-config__displayContent",group:n(P),"text-formatter":ae,modelValue:n(ee),"onUpdate:modelValue":t[4]||(t[4]=e=>f(ee)?ee.value=e:null)},null,8,["group","modelValue"])]),m("section",G,[J,m("section",K,[u(w,{ref_key:"formConfigEditRef",ref:se,uuid:n(Z),"bind-form-render-ref":e.formRenderRef,"form-props":e.formProps},null,8,["uuid","bind-form-render-ref","form-props"])])])],16,A))}});export{Q as default};
1
+ import{defineComponent as e,provide as o,ref as t,computed as r,toRaw as a,openBlock as i,createElementBlock as s,mergeProps as l,unref as n,createElementVNode as m,toDisplayString as f,createVNode as u,isRef as c,withCtx as d,createBlock as p,createCommentVNode as v,createTextVNode as g}from"vue";import{useTheme as h}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as _,cloneDeep as y,isFunction as x}from"lodash-es";import"@vue/shared";import{uuidGenerator as j,traverse as k}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NSelect as L,NSpace as C}from"naive-ui";import{useVersion as b}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{useFormConfigLocale as F}from"./hooks/useLocale.js";import M from"../../../shared/components/VueDraggable/src/vuedraggable.js";import R from"./components/FormConfigCreator.vue.js";import V from"./components/FormConfigDragDisplay.vue.js";import w from"./components/FormConfigEdit.vue.js";import D from"./components/FormConfigMaterialItem.js";import{useDataNormalize as H}from"./hooks/useDataNormalize.js";import{InjectionFormConfigProps as A,InjectionFormConfigEmit as E,InjectionFieldList as S,InjectionMaterialList as I,InjectionLowCodeReactions as O,InjectionActiveFieldItem as P,FORM_CONFIG_GROUP as U}from"./constants/index.js";import{fieldItemNormalize as T}from"./utils/index.js";import{useSortableConfig as z}from"./hooks/useSortalbeConfig.js";import"./hooks/useConfigurationField.js";const N=["id"],W={class:"form-config__material"},q={class:"form-config__materialHeader"},B={class:"form-config__displayWrapper"},G={class:"form-config__displayHeader"},J={class:"form-config__config"},K={class:"form-config__configHeader"},Q={class:"form-config__configContent"};var X=e({__name:"FormConfig",props:{maxHeight:{type:String},fieldVisitor:{type:Object},textFormatter:{type:Function},formRenderRef:{type:Object},extraMaterialList:{type:[Array,Function]},formProps:{type:Object},beforeMove:{type:Function}},emits:["addItem","removeItem"],setup(e,{expose:X,emit:Y}){const Z=e;o(A,Z),o(E,Y);const $=j(),ee=h(),oe=t([]);o(S,oe);const te=t([]);o(I,te);const re=t([]);function ae(e){oe.value.some((o=>o.key===e.key))||oe.value.push(e)}o(O,re);const ie=(e,o)=>x(Z.textFormatter)?Z.textFormatter(e,o):o,se=t();o(P,se);const le=t(),{transform:ne,inverseTransform:me}=H(Z),fe=r({get:()=>null,set(e){if(!e)return;const o=ce.value.find((o=>o.key===e));o&&(o.__extra=!0,T(o),te.value.push(o),Y("addItem",o))}}),ue=t([]),ce=r((()=>{if(!_(ue.value))return[];const e=[];return k([...te.value,...oe.value],(o=>e.push(o.key))),ue.value.filter((o=>!e.find((e=>e===o.key))))}));async function de(){Z.extraMaterialList&&!ue.value.length&&(ue.value=x(Z.extraMaterialList)?await Z.extraMaterialList():Z.extraMaterialList)}return X({loadData({fieldList:e,lowCodeReactions:o=[]}){let t=[],r=[];e.forEach((e=>{return!1===(o=y(a(e))).show?r.push(o):t.push(o),void T(o);var o})),oe.value=ne(t),te.value=r,re.value=o,se.value=void 0},validate(){var e;return null==(e=le.value)?void 0:e.validate()},getData:(e=!1)=>({fieldList:me(y(a(oe.value)),e,{show:!0}),materialList:me(y(a(te.value)),e,{show:!1}),lowCodeReactions:y(a(re.value))}),clearExtraList(){ue.value=[]}}),(o,t)=>(i(),s("section",l({class:"form-config",style:{"--max-height":e.maxHeight,...n(ee)},id:n($)},n(b)()),[m("section",W,[m("header",q,f(n(F)("materialArea")),1),u(n(M),l(z({fieldList:oe,materialList:te,hooks:{beforeMove:Z.beforeMove}}),{class:"form-config__materialContent",modelValue:n(te),"onUpdate:modelValue":t[0]||(t[0]=e=>c(te)?te.value=e:null)}),{item:d((({element:e})=>[u(n(D),{"form-config-item":e,"text-formatter":ie,"material-List":n(te)},null,8,["form-config-item","material-List"])])),_:1},16,["modelValue"]),e.extraMaterialList?(i(),p(n(L),{key:0,class:"form-config__materialExtraList",filterable:"",value:n(fe),"onUpdate:value":t[1]||(t[1]=e=>c(fe)?fe.value=e:null),placeholder:n(F)("materialArea.createMaterialPlaceholder"),options:n(ce),"label-field":"name","value-field":"key",onFocus:de},null,8,["value","placeholder","options"])):v("v-if",!0)]),m("section",B,[m("header",G,[g(f(n(F)("layoutArea"))+" ",1),u(n(C),null,{default:d((()=>[v("\t\t\t\t\t<form-config-event-setting"),v('\t\t\t\t\t\tv-if="showLowCodeReactions"'),v('\t\t\t\t\t\tv-model="lowCodeReactionsRef"'),v("\t\t\t\t\t\t@validate-failure=\"e => emit('reactionsValidateFailure', e)\""),v("\t\t\t\t\t/>"),u(R,{onSubmit:ae})])),_:1})]),u(V,{class:"form-config__displayContent",group:n(U),"text-formatter":ie,modelValue:n(oe),"onUpdate:modelValue":t[2]||(t[2]=e=>c(oe)?oe.value=e:null)},null,8,["group","modelValue"])]),m("section",J,[m("header",K,f(n(F)("configArea")),1),m("section",Q,[u(w,{ref_key:"formConfigEditRef",ref:le,uuid:n($),"bind-form-render-ref":e.formRenderRef,"form-props":e.formProps},null,8,["uuid","bind-form-render-ref","form-props"])])])],16,N))}});export{X as default};
@@ -1,3 +1,4 @@
1
+ import { useFormConfigLocale } from '../../../../components/form-config/src/hooks/useLocale';
1
2
  import { FieldItem, FormRenderExpose } from '../../../../components/form-render';
2
3
  import { AnyObject, FormConfigItem } from '../../..';
3
4
  declare const _default: import("vue").DefineComponent<{}, {
@@ -14,6 +15,7 @@ declare const _default: import("vue").DefineComponent<{}, {
14
15
  NButton: any;
15
16
  NButtonGroup: any;
16
17
  NPopconfirm: any;
18
+ useFormConfigLocale: typeof useFormConfigLocale;
17
19
  CFormRender: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{}, {
18
20
  formRenderRef: import("vue").Ref<FormRenderExpose | undefined>;
19
21
  key: import("vue").Ref<number>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as i,openBlock as t,createBlock as l,unref as o,withCtx as a,createVNode as r,createTextVNode as n}from"vue";import{pick as s}from"lodash-es";import{NButtonGroup as d,NPopconfirm as m,NButton as u}from"naive-ui";import{EditAbleField as f}from"../constants/index.js";import{useConfigurationField as _}from"../hooks/useConfigurationField.js";import"../../../index.js";import L from"../../../form-render/index.js";var c=e({__name:"FormConfigCreator",emits:{submit:e=>e},setup(e,{emit:c}){const p=_().generateFieldListByKeys([f.NAME,f.LAYOUT_WIDTH_ENUM,f.NOTES,f.DEFAULT_EXPAND,f.FOLD]),h=i(),E=i(),w={defaultExpand:!0,fold:!0,layoutWidthEnum:"ALL_LINE"};async function y(e,i,t){if(!t)return;await t.validate();const l=t.getFormValues();c("submit",{layoutWidthEnum:"ALL_LINE",...l,type:e,key:l.name,...i,__new:!0})}return(e,i)=>(t(),l(o(d),{size:"small"},{default:a((()=>[r(o(m),{width:"200px","show-icon":!1,"show-arrow":!1,to:"body",onPositiveClick:i[0]||(i[0]=e=>y("NEWLINE",{},E.value))},{trigger:a((()=>[r(o(u),null,{default:a((()=>[n("新建分行符")])),_:1})])),default:a((()=>[r(o(L),{column:12,ref_key:"lineBreakFormRef",ref:E,"initial-data":o(s)(w,["layoutWidthEnum"]),size:"small","label-width":"auto","label-placement":"left",fieldList:o(p).slice(0,1)},null,8,["initial-data","fieldList"])])),_:1}),r(o(m),{width:"300px","show-icon":!1,"show-arrow":!1,to:"body",onPositiveClick:i[1]||(i[1]=e=>y("LINE_BAR",{children:[]},h.value))},{trigger:a((()=>[r(o(u),null,{default:a((()=>[n("新建分线栏")])),_:1})])),default:a((()=>[r(o(L),{column:12,ref_key:"linebarFormRef",ref:h,"initial-data":w,size:"small","label-width":"auto","label-placement":"left",fieldList:o(p)},null,8,["fieldList"])])),_:1})])),_:1}))}});export{c as default};
1
+ import{defineComponent as e,ref as t,openBlock as i,createBlock as a,unref as o,withCtx as l,createVNode as n,createTextVNode as r,toDisplayString as s}from"vue";import{pick as u}from"lodash-es";import{NButtonGroup as m,NPopconfirm as f,NButton as d}from"naive-ui";import{EditAbleField as c}from"../constants/index.js";import{useConfigurationField as p}from"../hooks/useConfigurationField.js";import{useFormConfigLocale as v}from"../hooks/useLocale.js";import"../../../index.js";import g from"../../../form-render/index.js";var L=e({__name:"FormConfigCreator",emits:{submit:e=>e},setup(e,{emit:L}){const _=p().generateFieldListByKeys([c.NAME,c.LAYOUT_WIDTH_ENUM,c.NOTES,c.DEFAULT_EXPAND,c.FOLD]);Object.assign(_[0],{html_type:"INPUT",is_null:"0"});const h=t(),x=t(),y={defaultExpand:!0,fold:!0,layoutWidthEnum:"ALL_LINE"};async function E(e,t,i){if(!i)return;await i.validate();const a=i.getFormValues();L("submit",{layoutWidthEnum:"ALL_LINE",...a,type:e,key:a.name,...t,__new:!0})}return(e,t)=>(i(),a(o(m),{size:"small"},{default:l((()=>[n(o(f),{width:"300px","show-icon":!1,"show-arrow":!1,to:"body","positive-text":o(v)("configArea.positiveBtn"),"negative-text":o(v)("configArea.negativeBtn"),onPositiveClick:t[0]||(t[0]=e=>E("NEWLINE",{},x.value))},{trigger:l((()=>[n(o(d),null,{default:l((()=>[r(s(o(v)("layoutArea.createLinebreak")),1)])),_:1})])),default:l((()=>[n(o(g),{column:12,ref_key:"lineBreakFormRef",ref:x,"initial-data":o(u)(y,["layoutWidthEnum"]),size:"small","label-width":"auto","label-placement":"left",fieldList:o(_).slice(0,1)},null,8,["initial-data","fieldList"])])),_:1},8,["positive-text","negative-text"]),n(o(f),{width:"300px","show-icon":!1,"show-arrow":!1,to:"body","positive-text":o(v)("configArea.positiveBtn"),"negative-text":o(v)("configArea.negativeBtn"),onPositiveClick:t[1]||(t[1]=e=>E("LINE_BAR",{children:[]},h.value))},{trigger:l((()=>[n(o(d),null,{default:l((()=>[r(s(o(v)("layoutArea.createLinebar")),1)])),_:1})])),default:l((()=>[n(o(g),{column:12,ref_key:"linebarFormRef",ref:h,"initial-data":y,size:"small","label-width":"auto","label-placement":"left",fieldList:o(_)},null,8,["fieldList"])])),_:1},8,["positive-text","negative-text"])])),_:1}))}});export{L as default};
@@ -1,5 +1,6 @@
1
1
  import { AnyObject } from '../../../../shared/types';
2
2
  import { PropType } from 'vue';
3
+ import { useFormConfigLocale } from '../../../../components/form-config/src/hooks/useLocale';
3
4
  import { FieldItem, FieldVisitor, FormChangePayload, FormRenderExpose } from '../../../../components/form-render';
4
5
  import { FormConfigItem } from '../../../../components/index';
5
6
  declare const _default: import("vue").DefineComponent<{
@@ -457,6 +458,7 @@ declare const _default: import("vue").DefineComponent<{
457
458
  layoutWidthEnum?: import("../../../../components/index").FormConfigWidth | undefined;
458
459
  type?: string | undefined;
459
460
  name?: string | undefined;
461
+ alias?: string | undefined;
460
462
  show?: boolean | undefined;
461
463
  defaultValue?: any;
462
464
  defaultExpand?: boolean | undefined;
@@ -473,6 +475,7 @@ declare const _default: import("vue").DefineComponent<{
473
475
  layoutWidthEnum: import("../../../../components/index").FormConfigWidth;
474
476
  type: string;
475
477
  name: string;
478
+ alias?: string | undefined;
476
479
  show?: boolean | undefined;
477
480
  defaultValue?: any;
478
481
  defaultExpand?: boolean | undefined;
@@ -932,8 +935,6 @@ declare const _default: import("vue").DefineComponent<{
932
935
  __extra?: boolean | undefined;
933
936
  }>;
934
937
  generateFieldListByFormConfigItem: (formConfigItem: FormConfigItem, fieldItem?: FieldItem | undefined) => FieldItem[];
935
- showModal: import("vue").Ref<boolean>;
936
- onPositiveClick: () => Promise<void>;
937
938
  prevOldField: null;
938
939
  onFormChange: ({ fieldKey, value }: FormChangePayload) => void;
939
940
  createLabelRender: (originOptions?: AnyObject[]) => (label: string) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
@@ -1159,6 +1160,7 @@ declare const _default: import("vue").DefineComponent<{
1159
1160
  }[]>;
1160
1161
  onOptionModalCancel: () => void;
1161
1162
  onOptionModalConfirm: () => void;
1163
+ useFormConfigLocale: typeof useFormConfigLocale;
1162
1164
  NModal: any;
1163
1165
  NSpace: any;
1164
1166
  NInput: any;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as l,ref as t,inject as a,watch as i,toRaw as o,openBlock as n,createElementBlock as u,Fragment as s,createVNode as r,unref as v,mergeProps as d,withCtx as p,createElementVNode as c,renderList as f,toDisplayString as m,nextTick as g,h}from"vue";import{cloneDeep as y,isEmpty as x,isArray as b}from"lodash-es";import{InjectionActiveFieldItem as k,EditAbleField as w}from"../constants/index.js";import"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{findFieldItemByKey as j}from"../utils/index.js";import"@vicons/ionicons5";import{NModal as F,NInput as C,NSpace as L,NButton as _}from"naive-ui";import"../../../../shared/utils/index.js";import{useConfigurationField as R}from"../hooks/useConfigurationField.js";import"../../../index.js";import A from"../../../form-render/index.js";const U={style:{"padding-top":"8px"}},P={style:{width:"100%","text-align":"left"}},E=c("thead",null,[c("tr",null,[c("th",null,"值"),c("th",null,"原始文本"),c("th",null,"调整后文本")])],-1);var D=e({__name:"FormConfigEdit",props:{uuid:{type:String,required:!0},bindFormRenderRef:{type:Object},formProps:{type:Object}},setup(e,{expose:D}){const I=e;l((()=>`#${I.uuid} .form-config__config`));const O=t(),V=a(k),q=t([]),z=t({}),{generateFieldListByFormConfigItem:B}=R(),K=t(!1);async function N(){var e;V.value=S,await g(),null==(e=O.value)||e.validate()}let S=null;function T({fieldKey:e,value:l}){V.value&&(V.value[e]=l)}i(V,(async(e,l)=>{var t,a,i;if(!e)return q.value=[];if(l&&e!==S)try{await(null==(t=O.value)?void 0:t.validate())}catch(e){return K.value=!0}S=e,z.value={editable:!0,show:!0,...y(o(e))};const n=null==(a=I.bindFormRenderRef)?void 0:a.getFieldList();q.value=B(e,j(n,e.key)),null==(i=O.value)||i.reload()}),{immediate:!0});const $={"*"({field:e}){if(e.val_key!==w.DEFAULT_VALUE)return;const l=e.option;var t,a;e.option=(t=e.option,b(t)?t.map((e=>{var l;const t=null==(l=V.value.optionAliasList)?void 0:l.find((l=>l.value===e.value));return t?{...e,text:t.text}:e})):t),e.decoratorProps={labelRender:(a=l,e=>{const l=h("span",{},e);return x(a)?l:h("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},[l,h(_,{text:!0,type:"primary",onClick(){var e;G.value=!0,H.value=y(a),x(null==(e=V.value)?void 0:e.optionAliasList)||H.value.forEach((e=>{const l=V.value.optionAliasList.find((l=>l.value===e.value));l&&(e.alias=l.text)}))}},{default:()=>"修改选项文本"})])})}}},G=t(!1),H=t([]);function J(){G.value=!1,H.value=[]}function M(){var e;G.value=!1,V.value.optionAliasList=H.value.reduce(((e,l)=>(l.alias&&e.push({value:l.value,text:l.alias}),e)),[]),H.value=[],z.value={editable:!0,show:!0,...y(o(V.value))},null==(e=O.value)||e.reload()}return D({validate(){var e;return null==(e=O.value)?void 0:e.validate()}}),(l,t)=>(n(),u(s,null,[r(v(A),d({size:"small"},e.formProps,{column:12,ref_key:"formRenderRef",ref:O,onFormChange:T,"field-visitor":$,"field-list":q.value,"initial-data":z.value}),null,16,["field-list","initial-data"]),r(v(F),{show:K.value,"onUpdate:show":t[0]||(t[0]=e=>K.value=e),preset:"dialog",to:"body","close-on-esc":!1,"mask-closable":!1,closable:!1,title:"存在填写错误的字段","positive-text":"继续编辑",onPositiveClick:N},null,8,["show","to"]),r(v(F),{show:G.value,"onUpdate:show":t[1]||(t[1]=e=>G.value=e),preset:"dialog",to:"body","close-on-esc":!1,"mask-closable":!1,title:"修改选项文本","positive-text":"确定","negative-text":"取消",onNegativeClick:J,onPositiveClick:M},{default:p((()=>[c("section",U,[c("table",P,[E,c("tbody",null,[(n(!0),u(s,null,f(H.value,(e=>(n(),u("tr",{key:e.value},[c("td",null,m(e.value),1),c("td",null,m(e.text),1),c("td",null,[r(v(C),{value:e.alias,"onUpdate:value":l=>e.alias=l},null,8,["value","onUpdate:value"])])])))),128))])]),r(v(L),{vertical:""})])])),_:1},8,["show","to"])],64))}});export{D as default};
1
+ import{defineComponent as e,computed as t,ref as l,inject as i,watch as o,toRaw as a,openBlock as n,createElementBlock as r,Fragment as s,createVNode as u,unref as d,mergeProps as v,createCommentVNode as p,withCtx as f,createElementVNode as c,toDisplayString as m,renderList as g,h as x}from"vue";import{cloneDeep as y,isEmpty as h,isArray as b}from"lodash-es";import{InjectionActiveFieldItem as k,EditAbleField as A}from"../constants/index.js";import"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{findFieldItemByKey as j}from"../utils/index.js";import"@vicons/ionicons5";import{NModal as w,NInput as F,NSpace as L,NButton as C}from"naive-ui";import"../../../../shared/utils/index.js";import{useConfigurationField as O}from"../hooks/useConfigurationField.js";import{useFormConfigLocale as _}from"../hooks/useLocale.js";import"../../../index.js";import R from"../../../form-render/index.js";const P={style:{"padding-top":"8px"}},T={style:{width:"100%","text-align":"left"}};var U=e({__name:"FormConfigEdit",props:{uuid:{type:String,required:!0},bindFormRenderRef:{type:Object},formProps:{type:Object}},setup(e,{expose:U}){const E=e;t((()=>`#${E.uuid} .form-config__config`));const B=l(),N=i(k),D=l([]),I=l({}),{generateFieldListByFormConfigItem:S}=O();function V({fieldKey:e,value:t}){N.value&&(N.value[e]=t)}o(N,(async(e,t)=>{var l,i;if(!e)return D.value=[];I.value={editable:!0,show:!0,...y(a(e))};const o=null==(l=E.bindFormRenderRef)?void 0:l.getFieldList();D.value=S(e,j(o,e.key)),null==(i=B.value)||i.reload()}),{immediate:!0});const q={"*"({field:e}){if(e.val_key!==A.DEFAULT_VALUE)return;const t=e.option;var l,i;e.option=(l=e.option,b(l)?l.map((e=>{var t;const l=null==(t=N.value.optionAliasList)?void 0:t.find((t=>t.value===e.value));return l?{...e,text:l.text}:e})):l),e.decoratorProps={labelRender:(i=t,e=>{const t=x("span",{},e);return h(i)?t:x("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},[t,x(C,{text:!0,type:"primary",onClick(){var e;z.value=!0,K.value=y(i),h(null==(e=N.value)?void 0:e.optionAliasList)||K.value.forEach((e=>{const t=N.value.optionAliasList.find((t=>t.value===e.value));t&&(e.alias=t.text)}))}},{default:()=>_("configArea.modifyOptionTitle")})])})}}},z=l(!1),K=l([]);function M(){z.value=!1,K.value=[]}function $(){var e;z.value=!1,N.value.optionAliasList=K.value.reduce(((e,t)=>(t.alias&&e.push({value:t.value,text:t.alias}),e)),[]),K.value=[],I.value={editable:!0,show:!0,...y(a(N.value))},null==(e=B.value)||e.reload()}return U({validate(){var e;return null==(e=B.value)?void 0:e.validate()}}),(t,l)=>(n(),r(s,null,[u(d(R),v({size:"small"},e.formProps,{column:12,ref_key:"formRenderRef",ref:B,onFormChange:V,"field-visitor":q,"field-list":D.value,"initial-data":I.value}),null,16,["field-list","initial-data"]),p("\t<n-modal"),p('\t\tv-model:show="showModal"'),p('\t\tpreset="dialog"'),p('\t\tto="body"'),p('\t\t:to="wrapperSelector"'),p('\t\t:close-on-esc="false"'),p('\t\t:mask-closable="false"'),p('\t\t:closable="false"'),p('\t\ttitle="存在填写错误的字段"'),p('\t\tpositive-text="继续编辑"'),p('\t\t@positive-click="onPositiveClick"'),p("\t/>"),u(d(w),{show:z.value,"onUpdate:show":l[0]||(l[0]=e=>z.value=e),preset:"dialog",to:"body","close-on-esc":!1,"mask-closable":!1,title:d(_)("configArea.modifyOptionTitle"),"positive-text":d(_)("configArea.positiveBtn"),"negative-text":d(_)("configArea.negativeBtn"),onNegativeClick:M,onPositiveClick:$},{default:f((()=>[c("section",P,[c("table",T,[c("thead",null,[c("tr",null,[c("th",null,m(d(_)("configArea.modifyOptionName")),1),c("th",null,m(d(_)("configArea.modifyOptionOriginText")),1),c("th",null,m(d(_)("configArea.modifyOptionNewText")),1)])]),c("tbody",null,[(n(!0),r(s,null,g(K.value,(e=>(n(),r("tr",{key:e.value},[c("td",null,m(e.value),1),c("td",null,m(e.text),1),c("td",null,[u(d(F),{value:e.alias,"onUpdate:value":t=>e.alias=t},null,8,["value","onUpdate:value"])])])))),128))])]),u(d(L),{vertical:""})])])),_:1},8,["show","to","title","positive-text","negative-text"])],64))}});export{U as default};
@@ -1,6 +1,6 @@
1
1
  import { PropType } from 'vue';
2
2
  import { FormConfigItem, FormConfigTextFormatter } from '../../../../../components/form-config';
3
- import { bindHover } from '../../../../../components/form-config/src/utils';
3
+ import { bindHover, getFormConfigTitle } from '../../../../../components/form-config/src/utils';
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  formConfigItem: {
6
6
  type: PropType<FormConfigItem>;
@@ -162,6 +162,7 @@ declare const _default: import("vue").DefineComponent<{
162
162
  };
163
163
  }>>, {}>;
164
164
  bindHover: typeof bindHover;
165
+ getFormConfigTitle: typeof getFormConfigTitle;
165
166
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
166
167
  formConfigItem: {
167
168
  type: PropType<FormConfigItem>;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as o,computed as r,openBlock as t,createElementBlock as m,normalizeClass as a,unref as i,createElementVNode as f,mergeProps as n,withModifiers as d,createTextVNode as l,toDisplayString as s,createVNode as c}from"vue";import g from"../FormConfigDragDisplay.vue.js";import p from"./CloseButton.vue.js";import{InjectionActiveFieldItem as u}from"../../constants/index.js";import{bindHover as C}from"../../utils/index.js";const I=["data-type","data-key","data-required","data-extra"],x=["onClick"];var y=e({__name:"ComplexNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0}},setup(e){const y=e,_=o(u);function v(){_.value=y.formConfigItem}const k=r((()=>[{"is-active--text":_.value===y.formConfigItem},"form-config__renderer--complexHeader"])),q=r((()=>["form-config__renderer--complex form-config__renderer",{"is-active--shadow":_.value===y.formConfigItem}]));return(o,r)=>(t(),m("section",{class:a(i(q)),"data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra},[f("header",n(i(C)(e.formConfigItem),{class:i(k),onClick:d(v,["stop"])}),[l(s(y.formConfigItem.name)+" ",1),c(p,{"form-config-item":e.formConfigItem},null,8,["form-config-item"])],16,x),c(g,n(o.$props,{modelValue:e.formConfigItem.children,"onUpdate:modelValue":r[0]||(r[0]=o=>e.formConfigItem.children=o),class:"form-config__renderer--complex--grid","data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra}),null,16,["modelValue","data-type","data-key","data-required","data-extra"])],10,I))}});export{y as default};
1
+ import{defineComponent as e,inject as o,computed as r,openBlock as t,createElementBlock as m,normalizeClass as a,unref as i,createElementVNode as f,mergeProps as n,withModifiers as d,createTextVNode as l,toDisplayString as s,createVNode as c}from"vue";import g from"../FormConfigDragDisplay.vue.js";import p from"./CloseButton.vue.js";import{InjectionActiveFieldItem as u}from"../../constants/index.js";import{bindHover as C,getFormConfigTitle as I}from"../../utils/index.js";const x=["data-type","data-key","data-required","data-extra"],y=["onClick"];var _=e({__name:"ComplexNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0}},setup(e){const _=e,v=o(u);function k(){v.value=_.formConfigItem}const q=r((()=>[{"is-active--text":v.value===_.formConfigItem},"form-config__renderer--complexHeader"])),j=r((()=>["form-config__renderer--complex form-config__renderer",{"is-active--shadow":v.value===_.formConfigItem}]));return(o,r)=>(t(),m("section",{class:a(i(j)),"data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra},[f("header",n(i(C)(e.formConfigItem),{class:i(q),onClick:d(k,["stop"])}),[l(s(i(I)(_.formConfigItem))+" ",1),c(p,{"form-config-item":e.formConfigItem},null,8,["form-config-item"])],16,y),c(g,n(o.$props,{modelValue:e.formConfigItem.children,"onUpdate:modelValue":r[0]||(r[0]=o=>e.formConfigItem.children=o),class:"form-config__renderer--complex--grid","data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra}),null,16,["modelValue","data-type","data-key","data-required","data-extra"])],10,x))}});export{_ as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,computed as o,openBlock as r,createElementBlock as i,mergeProps as f,unref as m,withModifiers as n,createVNode as a,normalizeClass as l,withCtx as d,createTextVNode as u,toDisplayString as s,renderSlot as C,createBlock as g,createCommentVNode as c}from"vue";import{NEllipsis as p}from"naive-ui";import I from"./CloseButton.vue.js";import{InjectionActiveFieldItem as _,WidgetTextMap as v}from"../../constants/index.js";import{bindHover as y}from"../../utils/index.js";const x=["onClick","data-type","data-key","data-required","data-extra"];var k=e({__name:"DefaultNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0},showCloseButton:{type:Boolean,default:!0},allowClick:{type:Boolean,default:!0}},setup(e){const k=e,q=t(_);function B(){k.allowClick&&(q.value=k.formConfigItem)}const b=o((()=>["form-config__renderer--default",{"is-required":k.formConfigItem.required}])),j=o((()=>{var e;return[{"is-active":q.value===k.formConfigItem,"is-disabled":w.value,"is-extra":null==(e=k.formConfigItem)?void 0:e.__extra},"form-config__renderer","form-config__renderer--defaultWrapper"]})),w=o((()=>!1===k.formConfigItem.editable)),$=o((()=>{const e=v.get(k.formConfigItem.type);return k.textFormatter(k.formConfigItem,`${k.formConfigItem.name}${e?`(${e})`:""}`)})),h=o((()=>k.showCloseButton&&(!k.formConfigItem.required&&!k.formConfigItem.__isCombinationChild||k.formConfigItem.__extra)));return(t,o)=>(r(),i("div",f(m(y)(e.formConfigItem),{onClick:n(B,["stop"]),class:m(j),"data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra}),[a(m(p),{class:l(m(b))},{default:d((()=>[u(s(m($)),1)])),_:1},8,["class"]),C(t.$slots,"default"),m(h)?(r(),g(I,{key:0,"form-config-item":e.formConfigItem},null,8,["form-config-item"])):c("v-if",!0)],16,x))}});export{k as default};
1
+ import{defineComponent as e,inject as o,computed as t,openBlock as r,createElementBlock as i,mergeProps as f,unref as m,withModifiers as n,createVNode as a,normalizeClass as l,withCtx as d,createTextVNode as u,toDisplayString as s,renderSlot as C,createBlock as g,createCommentVNode as c}from"vue";import{NEllipsis as p}from"naive-ui";import I from"./CloseButton.vue.js";import{InjectionActiveFieldItem as _,getWidgetText as v}from"../../constants/index.js";import{getFormConfigTitle as y,bindHover as x}from"../../utils/index.js";const k=["onClick","data-type","data-key","data-required","data-extra"];var q=e({__name:"DefaultNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0},showCloseButton:{type:Boolean,default:!0},allowClick:{type:Boolean,default:!0}},setup(e){const q=e,B=o(_);function b(){q.allowClick&&(B.value=q.formConfigItem)}const j=t((()=>["form-config__renderer--default",{"is-required":q.formConfigItem.required}])),w=t((()=>{var e;return[{"is-active":B.value===q.formConfigItem,"is-disabled":$.value,"is-extra":null==(e=q.formConfigItem)?void 0:e.__extra},"form-config__renderer","form-config__renderer--defaultWrapper"]})),$=t((()=>!1===q.formConfigItem.editable)),h=t((()=>{const e=v(q.formConfigItem.type);return q.textFormatter(q.formConfigItem,`${y(q.formConfigItem)}${e?`(${e})`:""}`)})),F=t((()=>q.showCloseButton&&(!q.formConfigItem.required&&!q.formConfigItem.__isCombinationChild||q.formConfigItem.__extra)));return(o,t)=>(r(),i("div",f(m(x)(e.formConfigItem),{onClick:n(b,["stop"]),class:m(w),"data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra}),[a(m(p),{class:l(m(j))},{default:d((()=>[u(s(m(h)),1)])),_:1},8,["class"]),C(o.$slots,"default"),m(F)?(r(),g(I,{key:0,"form-config-item":e.formConfigItem},null,8,["form-config-item"])):c("v-if",!0)],16,k))}});export{q as default};
@@ -1,10 +1,11 @@
1
1
  import { AnyObject, LowCodeTypes, UndefinedAble } from '../../../../shared/types';
2
2
  import { InjectionKey, Ref } from 'vue';
3
3
  import { FormConfigItem } from '../../../../components/form-config';
4
- export declare const WidgetTextMap: Map<string, string>;
4
+ export declare function getWidgetText(type: string): string;
5
5
  export declare enum EditAbleField {
6
6
  KEY = "key",
7
7
  NAME = "name",
8
+ ALIAS = "alias",
8
9
  NOTES = "notes",
9
10
  DEFAULT_VALUE = "defaultValue",
10
11
  LAYOUT_WIDTH_ENUM = "layoutWidthEnum",
@@ -30,51 +31,41 @@ export declare function rowsOptionConfig(): {
30
31
  };
31
32
  export declare function isShowOptionConfig(): {
32
33
  open: {
33
- describe: string;
34
34
  value: boolean;
35
35
  };
36
36
  close: {
37
- describe: string;
38
37
  value: boolean;
39
38
  };
40
39
  };
41
40
  export declare function isNotFoldOptionConfig(): {
42
41
  open: {
43
- describe: string;
44
42
  value: boolean;
45
43
  };
46
44
  close: {
47
- describe: string;
48
45
  value: boolean;
49
46
  };
50
47
  };
51
48
  export declare function isEditOptionConfig(): {
52
49
  open: {
53
- describe: string;
54
50
  value: boolean;
55
51
  };
56
52
  close: {
57
- describe: string;
58
53
  value: boolean;
59
54
  };
60
55
  };
61
56
  export declare function isNullOptionConfig(): {
62
57
  open: {
63
- describe: string;
64
58
  value: boolean;
65
59
  };
66
60
  close: {
67
- describe: string;
68
61
  value: boolean;
69
62
  };
70
63
  };
71
64
  export declare function isVisibleOptionConfig(): {
72
65
  open: {
73
- describe: string;
74
66
  value: boolean;
75
67
  };
76
68
  close: {
77
- describe: string;
78
69
  value: boolean;
79
70
  };
80
71
  };
@@ -1 +1 @@
1
- import{range as e}from"lodash-es";const l=new Map([["LINE_BAR","分线栏"],["NEWLINE","分行符"]]);var a=(e=>(e.KEY="key",e.NAME="name",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialHigh",e))(a||{});function i(){return{option:[{text:"整行",value:"ALL_LINE"},{text:"半行",value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function t(){return{option:e(1,11).map((e=>({text:`${e}行`,value:e})))}}function u(){return{open:{describe:"默认展开",value:!0},close:{describe:"默认收起",value:!1}}}function d(){return{open:{describe:"可折叠",value:!0},close:{describe:"不可折叠",value:!1}}}function n(){return{open:{describe:"可编辑",value:!0},close:{describe:"不可编辑",value:!1}}}function o(){return{open:{describe:"必填",value:!0},close:{describe:"不必填",value:!1}}}function E(){return{open:{describe:"显示",value:!0},close:{describe:"隐藏",value:!1}}}const r={EQ:"NEQ",NEQ:"EQ",CL:"NC",NC:"CL",NULL:"NOT_NULL",NOT_NULL:"NULL",BIG:"LESSEQ",BIGEQ:"LESS",LESS:"BIGEQ",LESSEQ:"BIG"},b=[{value:"EQ",label:"等于"},{value:"NEQ",label:"不等于"},{value:"CL",label:"包含"},{value:"NC",label:"不包含"},{value:"NULL",label:"为空"},{value:"NOT_NULL",label:"不为空"},{value:"BIG",label:"大于"},{value:"BIGEQ",label:"大于等于"},{value:"LESS",label:"小于"},{value:"LESSEQ",label:"小于等于"}],v={showField:"hideField",hideField:"showField",requiredField:"notRequiredField",notRequiredField:"requiredField",enabledField:"disabledField",disabledField:"enabledField"},L=[{value:"showField",label:"显示字段"},{value:"hideField",label:"隐藏字段"},{value:"requiredField",label:"必填字段"},{value:"notRequiredField",label:"非必填字段"},{value:"enabledField",label:"启用字段"},{value:"disabledField",label:"禁用字段"}],c="__display",s=Symbol("InjectionFieldList"),F=Symbol("InjectionMaterialList"),N=Symbol("InjectionLowCodeReactions"),I=Symbol("InjectionActiveFieldItem"),S=Symbol("InjectionFormConfigEmit"),_=Symbol("InjectionFormConfigProps");export{a as EditAbleField,c as FORM_CONFIG_GROUP,I as InjectionActiveFieldItem,s as InjectionFieldList,S as InjectionFormConfigEmit,_ as InjectionFormConfigProps,N as InjectionLowCodeReactions,F as InjectionMaterialList,l as WidgetTextMap,r as conditionOppositeMap,b as conditionTypeOptions,v as connectionTypeOppositeMap,L as connectionTypeOptions,n as isEditOptionConfig,d as isNotFoldOptionConfig,o as isNullOptionConfig,u as isShowOptionConfig,E as isVisibleOptionConfig,t as rowsOptionConfig,i as widgetWidthOptionConfig};
1
+ import{range as e}from"lodash-es";import{useFormConfigLocale as l}from"../hooks/useLocale.js";function a(e){return new Map([["LINE_BAR",l("layoutArea.linebar")],["NEWLINE",l("layoutArea.linebreak")]]).get(e)||""}var i=(e=>(e.KEY="key",e.NAME="name",e.ALIAS="alias",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialHigh",e))(i||{});function t(){return{option:[{text:l("configArea.fullLine"),value:"ALL_LINE"},{text:l("configArea.halfLine"),value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function u(){return{option:e(1,11).map((e=>({text:`${e}`,value:e})))}}function o(){return{open:{value:!0},close:{value:!1}}}function n(){return{open:{value:!0},close:{value:!1}}}function E(){return{open:{value:!0},close:{value:!1}}}function d(){return{open:{value:!0},close:{value:!1}}}function r(){return{open:{value:!0},close:{value:!1}}}const L={EQ:"NEQ",NEQ:"EQ",CL:"NC",NC:"CL",NULL:"NOT_NULL",NOT_NULL:"NULL",BIG:"LESSEQ",BIGEQ:"LESS",LESS:"BIGEQ",LESSEQ:"BIG"},v=[{value:"EQ",label:"等于"},{value:"NEQ",label:"不等于"},{value:"CL",label:"包含"},{value:"NC",label:"不包含"},{value:"NULL",label:"为空"},{value:"NOT_NULL",label:"不为空"},{value:"BIG",label:"大于"},{value:"BIGEQ",label:"大于等于"},{value:"LESS",label:"小于"},{value:"LESSEQ",label:"小于等于"}],b={showField:"hideField",hideField:"showField",requiredField:"notRequiredField",notRequiredField:"requiredField",enabledField:"disabledField",disabledField:"enabledField"},F=[{value:"showField",label:"显示字段"},{value:"hideField",label:"隐藏字段"},{value:"requiredField",label:"必填字段"},{value:"notRequiredField",label:"非必填字段"},{value:"enabledField",label:"启用字段"},{value:"disabledField",label:"禁用字段"}],N="__display",c=Symbol("InjectionFieldList"),s=Symbol("InjectionMaterialList"),I=Symbol("InjectionLowCodeReactions"),S=Symbol("InjectionActiveFieldItem"),f=Symbol("InjectionFormConfigEmit"),_=Symbol("InjectionFormConfigProps");export{i as EditAbleField,N as FORM_CONFIG_GROUP,S as InjectionActiveFieldItem,c as InjectionFieldList,f as InjectionFormConfigEmit,_ as InjectionFormConfigProps,I as InjectionLowCodeReactions,s as InjectionMaterialList,L as conditionOppositeMap,v as conditionTypeOptions,b as connectionTypeOppositeMap,F as connectionTypeOptions,a as getWidgetText,E as isEditOptionConfig,n as isNotFoldOptionConfig,d as isNullOptionConfig,o as isShowOptionConfig,r as isVisibleOptionConfig,u as rowsOptionConfig,t as widgetWidthOptionConfig};
@@ -1 +1 @@
1
- import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as a,isNotFoldOptionConfig as o,isEditOptionConfig as _,isNullOptionConfig as n,isVisibleOptionConfig as m,rowsOptionConfig as r}from"../constants/index.js";import"../../../form-render/index.js";import{useFieldNormalize as s}from"../../../form-render/src/hooks/useFieldNormalize.js";const{FieldNormalizeWaterfallHook:d}=s();function E(){const s=new Map([[l.KEY,e=>({alias:"字段",elem_width:6,html_type:"TEXT",content:null==e?void 0:e.key,decoratorProps:{labelPlacement:"left"}})],[l.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[l.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT",is_empty:"0"})],[l.DEFAULT_VALUE,(l,i)=>{const a=d.call(Object.assign({},null==l?void 0:l.originalSetting,i),{});return{alias:"默认值",elem_width:6,html_type:"INPUT",is_empty:"0",componentProps:e(a.componentProps,["class","style","disabled"]),...t(a,["html_type","validate","option","multi_select","multi_select_value","wordbook","open","close","date_format","step_length","urlConfig","autograph","defined_error_msg","free_entry","validator","allowSlash","is_allow_check_mid","allow_check_mid_level"])}}],[l.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...i()})],[l.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",is_empty:"0",validate:{max_length:30}})],[l.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,...a()})],[l.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,...o()})],[l.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",..._()})],[l.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",requiredReminderContent:null==e?void 0:e.requiredReminderContent,...n()})],[l.SHOW,e=>({alias:"是否显示",html_type:"SWITCH",elem_width:6,is_show:(null==e?void 0:e.__isCombinationChild)?"1":"0",...m()})],[l.ROWS,()=>({alias:"高度",elem_width:6,remark:"默认为3行高度,可调整为1-10行高度",default_val:3,is_empty:"0",html_type:"SELECT",...r()})]]);function E(e,t,l){return e.map((e=>{var i,a;return{...null!=(a=null==(i=s.get(e))?void 0:i(t,l))?a:{},val_key:e}}))}const p=new Map([["LINE_BAR",[l.KEY,l.NAME,l.LAYOUT_WIDTH_ENUM,l.NOTES,l.DEFAULT_EXPAND,l.FOLD]],["NEWLINE",[l.KEY,l.NAME]],...["COMPLEX","COMBINATION"].map((e=>[e,[l.KEY,l.NAME,l.LAYOUT_WIDTH_ENUM]]))]),h=[l.KEY,l.NAME,l.DEFAULT_VALUE,l.LAYOUT_WIDTH_ENUM,l.DESC,l.NOTES,l.EDITABLE,l.REQUIRED,l.SHOW];return{generateFieldListByKeys:E,generateFieldListByFormConfigItem:function(e,t){var i;const a=p.get(e.type)||h;return"TEXTAREA"===(t?t.html_type:null==(i=e.originalSetting)?void 0:i.html_type)&&a.splice(3,0,l.ROWS),E(a,e,t)}}}export{E as useConfigurationField};
1
+ import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as a,isNotFoldOptionConfig as o,isEditOptionConfig as r,isNullOptionConfig as n,isVisibleOptionConfig as s,rowsOptionConfig as _}from"../constants/index.js";import{useFormConfigLocale as m}from"./useLocale.js";import"../../../form-render/index.js";import{useFieldNormalize as d}from"../../../form-render/src/hooks/useFieldNormalize.js";const{FieldNormalizeWaterfallHook:E}=d();function A(){const d=new Map([[l.KEY,e=>({alias:m("configArea.field"),elem_width:6,html_type:"TEXT",content:null==e?void 0:e.key,decoratorProps:{labelPlacement:"left"}})],[l.ALIAS,()=>({alias:m("configArea.alias"),elem_width:6,default_val:"",html_type:"INPUT"})],[l.NAME,()=>({alias:m("configArea.name"),elem_width:6,html_type:"TEXT",decoratorProps:{labelPlacement:"left"}})],[l.NOTES,()=>({alias:m("configArea.tips"),elem_width:6,html_type:"INPUT",is_empty:"0"})],[l.DEFAULT_VALUE,(l,i)=>{const a=E.call(Object.assign({},null==l?void 0:l.originalSetting,i),{});return{alias:m("configArea.defaultValue"),elem_width:6,html_type:"INPUT",is_empty:"0",componentProps:e(a.componentProps,["class","style","disabled"]),...t(a,["html_type","validate","option","multi_select","multi_select_value","wordbook","open","close","date_format","step_length","urlConfig","autograph","defined_error_msg","free_entry","validator","allowSlash","is_allow_check_mid","allow_check_mid_level"])}}],[l.LAYOUT_WIDTH_ENUM,()=>({alias:m("configArea.width"),fieldType:"number",html_type:"SELECT",elem_width:6,...i()})],[l.DESC,()=>({alias:m("configArea.describeText"),elem_width:6,html_type:"INPUT",is_empty:"0",validate:{max_length:30}})],[l.DEFAULT_EXPAND,()=>({alias:m("configArea.isExpand"),html_type:"SWITCH",elem_width:6,...a()})],[l.FOLD,()=>({alias:m("configArea.isFoldAble"),html_type:"SWITCH",elem_width:6,...o()})],[l.EDITABLE,e=>({alias:m("configArea.isEditable"),html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",...r()})],[l.REQUIRED,e=>({alias:m("configArea.isRequired"),html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",requiredReminderContent:null==e?void 0:e.requiredReminderContent,...n()})],[l.SHOW,e=>({alias:m("configArea.isShow"),html_type:"SWITCH",elem_width:6,is_show:(null==e?void 0:e.__isCombinationChild)?"1":"0",...s()})],[l.ROWS,()=>({alias:m("configArea.rowsHeight"),elem_width:6,remark:m("configArea.rowsTips"),default_val:3,is_empty:"0",html_type:"SELECT",..._()})]]);function A(e,t,l){return e.map((e=>{var i,a;return{...null!=(a=null==(i=d.get(e))?void 0:i(t,l))?a:{},val_key:e}}))}const p=new Map([["LINE_BAR",[l.KEY,l.NAME,l.ALIAS,l.LAYOUT_WIDTH_ENUM,l.NOTES,l.DEFAULT_EXPAND,l.FOLD]],["NEWLINE",[l.KEY,l.NAME,l.ALIAS]],...["COMPLEX","COMBINATION"].map((e=>[e,[l.KEY,l.NAME,l.ALIAS,l.LAYOUT_WIDTH_ENUM]]))]),c=[l.KEY,l.NAME,l.ALIAS,l.DEFAULT_VALUE,l.LAYOUT_WIDTH_ENUM,l.DESC,l.NOTES,l.EDITABLE,l.REQUIRED,l.SHOW];return{generateFieldListByKeys:A,generateFieldListByFormConfigItem:function(e,t){var i;const a=p.get(e.type)||c;return"TEXTAREA"===(t?t.html_type:null==(i=e.originalSetting)?void 0:i.html_type)&&a.splice(3,0,l.ROWS),A(a,e,t)}}}export{A as useConfigurationField};
@@ -0,0 +1,52 @@
1
+ import { DeepPartial } from '../../../../shared/types';
2
+ declare const formConfigLocale: {
3
+ materialArea: {
4
+ areaName: string;
5
+ createMaterialPlaceholder: string;
6
+ toString: () => string;
7
+ };
8
+ layoutArea: {
9
+ areaName: string;
10
+ linebreak: string;
11
+ linebar: string;
12
+ createLinebreak: string;
13
+ createLinebar: string;
14
+ toString: () => string;
15
+ };
16
+ configArea: {
17
+ areaName: string;
18
+ field: string;
19
+ name: string;
20
+ alias: string;
21
+ defaultValue: string;
22
+ width: string;
23
+ describeText: string;
24
+ tips: string;
25
+ isRequired: string;
26
+ isEditable: string;
27
+ isExpand: string;
28
+ isFoldAble: string;
29
+ isShow: string;
30
+ modifyOptionTitle: string;
31
+ modifyOptionName: string;
32
+ modifyOptionOriginText: string;
33
+ modifyOptionNewText: string;
34
+ rowsHeight: string;
35
+ rowsTips: string;
36
+ positiveBtn: string;
37
+ negativeBtn: string;
38
+ fullLine: string;
39
+ halfLine: string;
40
+ toString: () => string;
41
+ };
42
+ };
43
+ type FormConfigLocale = typeof formConfigLocale;
44
+ type Join<K, P> = K extends string | number ? (P extends string | number ? `${K}.${P}` : never) : never;
45
+ type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...0[]];
46
+ type Leaves<T, D extends number = 1> = [D] extends [never] ? never : T extends object ? {
47
+ [K in keyof T]: K extends string | number ? `${K}` | Join<K, Leaves<T[K], Prev[D]>> : never;
48
+ }[keyof T] : '';
49
+ type FormConfigLocaleKeys = Leaves<FormConfigLocale>;
50
+ export declare function registFormConfigLocale(locale: DeepPartial<FormConfigLocale>): void;
51
+ export declare function useFormConfigLocale(key: FormConfigLocaleKeys): string;
52
+ export {};
@@ -0,0 +1 @@
1
+ import{deepMerge as e}from"../../../../shared/utils/index.js";import{property as i}from"lodash-es";import{reactive as a}from"vue";const t=a({materialArea:{areaName:"物料区",createMaterialPlaceholder:"请选择额外物料",toString(){return this.areaName}},layoutArea:{areaName:"布局区",linebreak:"分行符",linebar:"分线栏",createLinebreak:"新建分行符",createLinebar:"新建分线栏",toString(){return this.areaName}},configArea:{areaName:"配置区",field:"字段",name:"名称",alias:"别名",defaultValue:"默认值",width:"宽度",describeText:"说明文本",tips:"问号提示",isRequired:"是否必填",isEditable:"是否可编辑",isExpand:"是否默认展开",isFoldAble:"是否可折叠",isShow:"是否显示",modifyOptionTitle:"修改选项文本",modifyOptionName:"值",modifyOptionOriginText:"原文本",modifyOptionNewText:"调整后文本",rowsHeight:"高度",rowsTips:"默认为3行高度,可调整为1-10行高度",positiveBtn:"确定",negativeBtn:"取消",fullLine:"整行",halfLine:"半行",toString(){return this.areaName}}});function r(i){e(t,i),console.log(t)}function o(e){const a=i(e)(t);return a?a+"":""}export{r as registFormConfigLocale,o as useFormConfigLocale};
@@ -28,6 +28,7 @@ export type FormConfigItem = {
28
28
  type: FormConfigType;
29
29
  name: string;
30
30
  } & Partial<{
31
+ alias: string;
31
32
  show: boolean;
32
33
  defaultValue: any;
33
34
  defaultExpand: boolean;
@@ -9,3 +9,4 @@ export declare function bindHover(formConfigItem: FormConfigItem): {
9
9
  };
10
10
  export declare function findFieldItemByKey(fieldList: Nullable<FieldItem[]>, key: string): FieldItem | undefined;
11
11
  export declare function fieldItemNormalize(item: FormConfigItem): void;
12
+ export declare function getFormConfigTitle(field: FormConfigItem): string;
@@ -1 +1 @@
1
- import{traverse as e}from"../../../../shared/utils/index.js";import{isArray as n}from"lodash-es";import{ref as r}from"vue";function i(e){return{ALL_LINE:24,HALF_LINE:12,FIVE_SIX:20,TWO_THREE:16,ONE_THREE:8,THREE_FOUR:18,ONE_FOUR:6,ONE_SIX:4,ONE_EIGHT:3}[e]||24}const o=r();function t(e){return{onMouseenter:()=>o.value=e,onMouseleave:()=>o.value=void 0,"is-hovering":o.value===e}}function l(r,i){if(!n(r)||!r.length)return;let o;return e(r,((e,n)=>{(null==e?void 0:e.val_key)===i&&(o=e,n())}),["children","properties"]),o}function u(e){"LINE_BAR"===e.type&&(e.children=[]),"COMBINATION"===e.type&&n(e.children)&&e.children.length&&e.children.forEach((e=>{e.__isCombinationChild=!0}))}export{t as bindHover,u as fieldItemNormalize,l as findFieldItemByKey,i as layoutWidthEnum2Column};
1
+ import{traverse as e}from"../../../../shared/utils/index.js";import{isArray as n}from"lodash-es";import{ref as r}from"vue";function i(e){return{ALL_LINE:24,HALF_LINE:12,FIVE_SIX:20,TWO_THREE:16,ONE_THREE:8,THREE_FOUR:18,ONE_FOUR:6,ONE_SIX:4,ONE_EIGHT:3}[e]||24}const o=r();function t(e){return{onMouseenter:()=>o.value=e,onMouseleave:()=>o.value=void 0,"is-hovering":o.value===e}}function l(r,i){if(!n(r)||!r.length)return;let o;return e(r,((e,n)=>{(null==e?void 0:e.val_key)===i&&(o=e,n())}),["children","properties"]),o}function u(e){"LINE_BAR"===e.type&&(e.children=[]),"COMBINATION"===e.type&&n(e.children)&&e.children.length&&e.children.forEach((e=>{e.__isCombinationChild=!0}))}function E(e){return e.alias||e.name}export{t as bindHover,u as fieldItemNormalize,l as findFieldItemByKey,E as getFormConfigTitle,i as layoutWidthEnum2Column};
@@ -1 +1 @@
1
- import{inject as e,provide as t,computed as n,createVNode as r,Fragment as o}from"vue";import{traverse as i,arrayed as u}from"../../../../shared/utils/index.js";import{isGeneralField as c}from"@formily/core";import{Path as s}from"@formily/path";import{HelpCircleSharp as f}from"@vicons/ionicons5";import{isObject as l}from"@vue/shared";import{useMemoize as a}from"@vueuse/core";import{isString as p,isFunction as d,omit as E,castArray as T,flattenDeep as h}from"lodash-es";import{NTooltip as m,NIcon as x}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as y}from"../constants/index.js";export{businessDateParser,isForeignerID,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./business.js";function R(e){console.warn(`[FormRender]: ${e}`)}function g(e){return"1"===e||!0===e||1===e}function v(e){return"0"===e||!1===e||0===e}function I(e,t,n=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function e(t,r){r.forEach((r=>{l(r)&&(null!=c(r)&&null==t[i(r)]&&s.setIn(t,i(r),c(r)),n.forEach((n=>{r[n]&&(t[i(r)]||(t[i(r)]={}),e(t[i(r)],u(r[n])))})))}))}(e,t),e;function i(e){return e[r]}function c(e){return e[o]}}function A(n,r){let o=e(n,null);return o||(o=r(),t(n,o)),o}function D(e){return e&&p(e)?+e:e}function P(e,t,n){if(l(e)&&!d(e)){const n={};return Object.entries(e).forEach((([e,r])=>{d(r)&&(n[e]=()=>r(t))})),n}return{default:()=>d(e)?e(t):n?n(e):[e]}}function W(e,t){return n((()=>{const n={};return e.prefix&&(n.prefix=()=>r(o,null,[P(e.prefix,e,t).default()])),e.suffix&&(n.suffix=()=>r(o,null,[P(e.suffix,e,t).default()])),n}))}function _(e,t){return p(e)&&e?e.replace(/\$\{([^}]*)}/g,(function(e,n){const r=n.split("||");for(const e of r){const n=t[e.trim()];if(n)return n}return""})):""}function G(e){return e.reduce(((e,t)=>(p(t.extendKey)&&t.extendKey&&e.push(t),j(t)&&e.push(...G(t.children||[])),e)),[])}function S(e,t){const n=G(e);if(!n.length)return t;const r={},o=new Map;return Object.entries(t).forEach((([e,i])=>{const u=n.find((t=>t.val_key===e));if(!u)return r[e]=i;const{val_key:c,extendKey:s}=u,f=o.get(s)||{};o.set(s,f),f[c]=t[c]})),[...o.entries()].forEach((([e,t])=>{r[e]=JSON.stringify(t)})),r}function $(e,t){const n=G(e);if(!n.length)return t;const r=a((e=>{try{return l(t[e])?t[e]:JSON.parse(t[e])||{}}catch(e){return{}}})),o=E(t,n.map((e=>e.extendKey)));return n.forEach((({val_key:e,extendKey:t})=>{Reflect.has(o,e)||(o[e]=r(t)[e])})),o}function b(e){return e&&y.includes(e)}function j(e){return b(c(e)?e.componentType:e.html_type)}function w(e,t){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[e,t.desc?r(m,null,{trigger:()=>r(x,{component:f},null),default:()=>t.desc}):null])}function K(e,t){return s.parse(e.startsWith(".")?e:`.${e}`,t).toString()}function X(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">")}function k(e,t){return e.reduce(((e,n)=>(t(n)||(e.push(n),n.properties&&(n.properties=k(n.properties,t)),n.children&&(n.children=k(n.children,t))),e)),[])}function C(e,t){let n=null;return i(e,((e,r)=>{t(e)&&(n=e,r())}),["children","properties"]),n}var F=function(e){return e[e.PREPARE=0]="PREPARE",e[e.TEXT=1]="TEXT",e[e.WIDGET_START=2]="WIDGET_START",e[e.WIDGET=3]="WIDGET",e}(F||{});function O(e){const t=[...e],n=[];let r=F.PREPARE,o="";function i(e){switch(r=e,r){case F.PREPARE:case F.WIDGET_START:case F.WIDGET:o=""}}function u(e="text",t=o){n.push({type:e,content:t})}function c(){const e=n.pop();e&&("text"===e.type?o=e.content:n.push(e))}return t.forEach(((e,n)=>{const s=n===t.length-1;switch(r){case F.PREPARE:return"#"===e?(i(F.WIDGET_START),void(s&&u())):(i(F.TEXT),o=e,void(s&&u()));case F.TEXT:return"#"===e?void(s?(o+=e,u()):(u(),i(F.WIDGET_START))):(o+=e,void(s&&u()));case F.WIDGET_START:return"{"!==e||s?(c(),i(F.TEXT),o+=`#${e}`,void(s&&u())):void i(F.WIDGET);case F.WIDGET:return"}"===e?(u("widget"),void i(F.PREPARE)):"#"===e?(c(),u(),i(F.WIDGET_START),o+=`#${e}`,void(s&&u())):(o+=e,void(s&&u("text",`#{${o}`)))}})),n}function N(e,t){let n=T(e);return t.forEach((({from:e,to:t})=>{n.forEach(((r,o)=>{p(r)&&(n[o]=r.split(e).map(((e,n,r)=>[e,n<r.length-1?t:null])))})),n=h(n)})),n}function B(e){return"Enter"===e.code||"NumpadEnter"===e.code}export{k as FieldListFilter,S as combineExtendKey,W as createInputSlot,P as createSlot,X as editorUnescape,C as findItemByValCondition,R as formRenderLog,K as getAbsoluteKey,A as injectOrProvide,B as isEnter,v as isNegative,j as isNestedFieldType,b as isNestedType,g as isPositive,I as mergeDeepProperties,O as parseEnhanceText,D as parseNumberFromMaybeString,w as renderDescOption,N as replace2Any,$ as splitExtendKey,_ as validateMessageParser};
1
+ import{inject as e,provide as t,computed as n,createVNode as r,Fragment as o}from"vue";import{traverse as i,arrayed as u}from"../../../../shared/utils/index.js";import{isGeneralField as c}from"@formily/core";import{Path as s}from"@formily/path";import{HelpCircleSharp as f}from"@vicons/ionicons5";import{isObject as l}from"@vue/shared";import{useMemoize as a}from"@vueuse/core";import{isString as p,isFunction as d,omit as E,castArray as T,flattenDeep as h}from"lodash-es";import{NTooltip as m,NIcon as x}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as g}from"../constants/index.js";export{businessDateParser,isForeignerID,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./business.js";function y(e){console.warn(`[FormRender]: ${e}`)}function R(e){return"1"===e||!0===e||1===e}function v(e){return"0"===e||!1===e||0===e}function I(e,t,n=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function e(t,r){r.forEach((r=>{l(r)&&(null!=c(r)&&null==t[i(r)]&&s.setIn(t,i(r),c(r)),n.forEach((n=>{r[n]&&(t[i(r)]||(t[i(r)]={}),e(t[i(r)],u(r[n])))})))}))}(e,t),e;function i(e){return e[r]}function c(e){return e[o]}}function A(n,r){let o=e(n,null);return o||(o=r(),t(n,o)),o}function D(e){return e&&p(e)?+e:e}function P(e,t,n){if(l(e)&&!d(e)){const n={};return Object.entries(e).forEach((([e,r])=>{d(r)&&(n[e]=()=>r(t))})),n}return{default:()=>d(e)?e(t):n?n(e):[e]}}function W(e,t){return n((()=>{const n={};return e.prefix&&(n.prefix=()=>r(o,null,[P(e.prefix,e,t).default()])),e.suffix&&(n.suffix=()=>r(o,null,[P(e.suffix,e,t).default()])),n}))}function _(e,t){return p(e)&&e?e.replace(/\$\{([^}]*)}/g,(function(e,n){const r=n.split("||");for(const e of r){const n=t[e.trim()];if(n)return n}return""})):""}function G(e){return e.reduce(((e,t)=>(p(t.extendKey)&&t.extendKey&&e.push(t),j(t)&&e.push(...G(t.children||[])),e)),[])}function S(e,t){const n=G(e);if(!n.length)return t;const r={},o=new Map;return Object.entries(t).forEach((([e,i])=>{const u=n.find((t=>t.val_key===e));if(!u)return r[e]=i;const{val_key:c,extendKey:f}=u,l=o.get(f)||{};o.set(f,l);const a=s.getIn(t,e);null!=a&&s.setIn(l,c,a)})),[...o.entries()].forEach((([e,t])=>{r[e]=JSON.stringify(t)})),r}function $(e,t){const n=G(e);if(!n.length)return t;const r=a((e=>{try{return l(t[e])?t[e]:JSON.parse(t[e])||{}}catch(e){return{}}})),o=E(t,n.map((e=>e.extendKey)));return n.forEach((({val_key:e,extendKey:t})=>{Reflect.has(o,e)||(o[e]=r(t)[e])})),o}function b(e){return e&&g.includes(e)}function j(e){return b(c(e)?e.componentType:e.html_type)}function w(e,t){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[e,t.desc?r(m,null,{trigger:()=>r(x,{component:f},null),default:()=>t.desc}):null])}function K(e,t){return s.parse(e.startsWith(".")?e:`.${e}`,t).toString()}function X(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">")}function k(e,t){return e.reduce(((e,n)=>(t(n)||(e.push(n),n.properties&&(n.properties=k(n.properties,t)),n.children&&(n.children=k(n.children,t))),e)),[])}function C(e,t){let n=null;return i(e,((e,r)=>{t(e)&&(n=e,r())}),["children","properties"]),n}var F=function(e){return e[e.PREPARE=0]="PREPARE",e[e.TEXT=1]="TEXT",e[e.WIDGET_START=2]="WIDGET_START",e[e.WIDGET=3]="WIDGET",e}(F||{});function O(e){const t=[...e],n=[];let r=F.PREPARE,o="";function i(e){switch(r=e,r){case F.PREPARE:case F.WIDGET_START:case F.WIDGET:o=""}}function u(e="text",t=o){n.push({type:e,content:t})}function c(){const e=n.pop();e&&("text"===e.type?o=e.content:n.push(e))}return t.forEach(((e,n)=>{const s=n===t.length-1;switch(r){case F.PREPARE:return"#"===e?(i(F.WIDGET_START),void(s&&u())):(i(F.TEXT),o=e,void(s&&u()));case F.TEXT:return"#"===e?void(s?(o+=e,u()):(u(),i(F.WIDGET_START))):(o+=e,void(s&&u()));case F.WIDGET_START:return"{"!==e||s?(c(),i(F.TEXT),o+=`#${e}`,void(s&&u())):void i(F.WIDGET);case F.WIDGET:return"}"===e?(u("widget"),void i(F.PREPARE)):"#"===e?(c(),u(),i(F.WIDGET_START),o+=`#${e}`,void(s&&u())):(o+=e,void(s&&u("text",`#{${o}`)))}})),n}function N(e,t){let n=T(e);return t.forEach((({from:e,to:t})=>{n.forEach(((r,o)=>{p(r)&&(n[o]=r.split(e).map(((e,n,r)=>[e,n<r.length-1?t:null])))})),n=h(n)})),n}function B(e){return"Enter"===e.code||"NumpadEnter"===e.code}export{k as FieldListFilter,S as combineExtendKey,W as createInputSlot,P as createSlot,X as editorUnescape,C as findItemByValCondition,y as formRenderLog,K as getAbsoluteKey,A as injectOrProvide,B as isEnter,v as isNegative,j as isNestedFieldType,b as isNestedType,R as isPositive,I as mergeDeepProperties,O as parseEnhanceText,D as parseNumberFromMaybeString,w as renderDescOption,N as replace2Any,$ as splitExtendKey,_ as validateMessageParser};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as o,createElementBlock as i,normalizeClass as r,unref as a,normalizeStyle as c,createVNode as l,withCtx as u,Fragment as m,renderList as p,toDisplayString as d,createCommentVNode as f,createBlock as g,createElementVNode as v,createTextVNode as y,withModifiers as h,nextTick as T}from"vue";import{NImageGroup as M,NButton as k,NAvatar as _,NImage as x,NIcon as I,NSpace as C,NButtonGroup as w,NTooltip as S}from"naive-ui";import{format as j}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as L}from"../api/index.js";import{useState as b}from"../hooks/useState.js";import{useSession as A}from"../hooks/useSession.js";import{MESSAGE_TYPE as z}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as H,simplifyMessage as D,getAVTime as R,downloadFile as N}from"../utils/index.js";import{first as O,last as P,toString as q}from"lodash-es";import B from"./PersonProfile.vue.js";import J from"./MessageTemplate.vue.js";import{emojis as W}from"../utils/emoji.js";import U from"./ContextMenu.js";import X from"./ChatAdd.vue.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as F,VideocamOutline as G,DocumentSharp as K,ChatbubbleEllipsesOutline as Y,EllipsisHorizontal as $,ArrowDownSharp as Q}from"@vicons/ionicons5";import{useScrollLoading as V}from"../../../../shared/hooks/useScrollLoading.js";const Z={key:0,class:"tip-text"},ee={key:1,class:"tip-text"},te={key:2,class:"message-box"},ne={key:0,class:"content-box"},se={class:"name-box"},oe=["data-time"],ie=["onContextmenu"],re={key:0,class:"reference-content"},ae=["innerHTML"],ce=["src"],le=["innerHTML"],ue=["innerHTML"],me={style:{"margin-left":"8px"}},pe={class:"size"};var de=e({__name:"ChatMain",setup(e){const de=t(),{state:fe,setMsgList:ge,relayMessage:ve}=b(),{setCurrentSessionItem:ye,isGroupChat:he}=A(fe),Te=t(),Me=t(!1),ke=t({left:0,top:0}),_e=t(),xe=t(),Ie={page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")},Ce=n((()=>({"--c-tip-top":he.value?"1px":"-20px","--c-tip-gap":he.value?"10px":"0px"})));function we({nodes:e}){var t,n;const{_ctx:s}=null==(t=e.download)?void 0:t.children,o=s?null==(n=null==s?void 0:s.proxy)?void 0:n.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,l(S,null,{trigger:()=>l(I,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:Q,onClick:()=>o&&N(o,"img")},null),default:()=>"下载"}),e.close]}async function Se(){try{if(!Ie.hasMore)return;Ie.page++;const e=await E({sessionKey:fe.currentSessionItem.sessionKey,page:Ie.page,lastSendTime:Ie.lastSendTime});if(!Array.isArray(e)||0===e.length)return Ie.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=O(e).id;Ie.lastSendTime=P(e).sendTime,ge(Ie.page>1?[...fe.msgList,...e]:e),1===Ie.page&&fe.currentSessionItem.unreadNum&&(await L({chatType:fe.currentSessionItem.chatType,messageIdSet:[t],receiver:fe.userInfo.id,sender:fe.currentSessionItem.receiver}),ye({unreadNum:0}))}catch(e){console.log(e)}}async function je(e,t){_e.value=t,async function(e){var t,n,s,o,i,r;Me.value=!0,await T();const{clientX:a,clientY:c}=e,{width:l=0,height:u=0,left:m=0,top:p=0}=(null==(t=de.value)?void 0:t.getBoundingClientRect())||{},d=null!=(o=null==(s=null==(n=Te.value)?void 0:n.$el)?void 0:s.getBoundingClientRect().height)?o:220,f=null!=(r=null==(i=de.value)?void 0:i.scrollTop)?r:0,g=5,v={};a<=m+l/2?v.left=a-m+g+"px":v.right=m+l-a-g+"px";c-p<d/2?v.top=f+g+"px":p+u-c<=d/2?v.bottom=Math.abs(f)+g+"px":v.top=f+c-p-d/2+"px";ke.value=v}(e)}function Ee(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==z.TEMPLATE||!!n}function Le(e){const{chatMessageType:t}=e.content;return e.sender===fe.userInfo.id&&Date.now()-new Date(e.sendTime).getTime()<864e5&&[z.TEXT,z.EMOJI].includes(t)}function be(e){const{chatMessageType:t,msg:n=""}=e.content;if(t===z.BLEND){const e=q(n).match(/<img[^>]*>/gi);return!e||!e.length}return t&&[z.TEXT,z.EMOJI].includes(t)}function Ae(e){const{chatMessageType:t,msg:n=""}=e.content,s=q(n).match(/<img[^>]*>/gi);return t===z.BLEND&&s&&s.length}function ze(e,t){var n,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===z.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function He(e){var t,n;const{chatMessageType:s,messageTemplate:o}=e;return s===z.TEMPLATE&&3==(null==(n=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:n.id)}function De(e,t){var n;const s=new Date(e.sendTime).getTime(),o=null==(n=fe.msgList[t+1])?void 0:n.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}function Re(e){fe.currentReferenceMsg=e,fe.currentReferenceMsg.content.referenceContent=null,Object.assign(fe.currentReferenceMsg,{chatType:fe.currentSessionItem.chatType,receiver:fe.currentSessionItem.receiver,receiverAvatar:fe.currentSessionItem.avatar,receiverName:fe.currentSessionItem.name})}function Ne(e,t){var n;"reply"!==e?"relay"===e&&(null==(n=xe.value)||n.click()):Re(t)}function Oe(e,t){const n=fe.msgList.find((e=>e.id===_e.value));ve({checkedIds:e,remark:t,content:n.content})}return V(de,(()=>{Se()}),"top",(()=>{Me.value=!1})),s((()=>fe.id),(e=>{e&&(fe.currentReferenceMsg=null,Object.assign(Ie,{page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")}),Se())}),{immediate:!0}),s((()=>fe.isAppendMsg),(e=>{e&&(ge([fe.currentMsg,...fe.msgList]),async function(){var e;null==(e=de.value)||e.scrollTo({top:0,behavior:"auto"})}(),fe.isAppendMsg=!1)}),{immediate:!0}),(e,t)=>(o(),i("div",{class:r(["chat-main",{"home-bg":!a(fe).id}]),ref_key:"chatMainRef",ref:de,style:c(a(Ce))},[l(a(M),{"show-toolbar-tooltip":"","render-toolbar":we},{default:u((()=>[(o(!0),i(m,null,p(a(fe).msgList,((e,t)=>(o(),i(m,{key:e.id},[Ee(e)?(o(),i("div",{key:0,class:r(["message-item",{"message-item--mine":e.sender==a(fe).userInfo.id}])},[De(e,t)?(o(),i("p",Z,d(e.__sendTime),1)):f("v-if",!0),ze(e,"system")||"WITHDRAWN"===e.status?(o(),i(m,{key:1},[ze(e,"system")?(o(),g(J,{key:0,data:e},null,8,["data"])):f("v-if",!0),"WITHDRAWN"===e.status?(o(),i("p",ee,[v("span",null,d(e.sender==a(fe).userInfo.id?"你":e.senderName)+"撤回了一条消息",1),Le(e)?(o(),g(a(k),{key:0,size:"tiny",style:{color:"var(--c-primary-color)","margin-left":"5px"},text:"",onClick:()=>function(e){fe.currentReEditMsg=e}(e)},{default:u((()=>[y(" 重新编辑 ")])),_:2},1032,["onClick"])):f("v-if",!0)])):f("v-if",!0)],64)):(o(),i("div",te,[l(B,{"user-id":e.sender,placement:e.sender==a(fe).userInfo.id?"left":"right"},{trigger:u((()=>[l(a(_),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id","placement"]),e.content?(o(),i("div",ne,[v("div",se,[v("span",{class:"name","data-time":e.__time},d(a(he)?e.senderName:""),9,oe)]),v("div",{class:r(["content",{emoji:e.content.chatMessageType===a(z).EMOJI&&!e.content.referenceContent,template:e.content.chatMessageType===a(z).TEMPLATE,"template--3":He(e.content),"audio-video":a(H)(e.content),file:e.content.chatMessageType===a(z).FILE}]),onContextmenu:h((t=>je(t,e.id)),["prevent"])},[be(e)?(o(),i(m,{key:0},[e.content.referenceContent?(o(),i("div",re,[v("span",null,d(e.content.referenceContent.senderName)+":",1),v("pre",{innerHTML:a(D)(e.content.referenceContent.content)},null,8,ae)])):f("v-if",!0),e.content.chatMessageType===a(z).EMOJI?(o(),i("img",{key:1,class:r([e.content.referenceContent?"emoji--min":"emoji--big"]),src:a(W).findEmoji(e.__content)},null,10,ce)):(o(),i("pre",{key:2,innerHTML:e.__content},null,8,le))],64)):f("v-if",!0),Ae(e)?(o(),i("pre",{key:1,innerHTML:e.__content},null,8,ue)):f("v-if",!0),ze(e,"template")?(o(),g(J,{key:2,data:e},null,8,["data"])):f("v-if",!0),e.content.chatMessageType===a(z).IMAGE?(o(),g(a(x),{key:3,width:"240",src:e.__content},null,8,["src"])):f("v-if",!0),a(H)(e.content)?(o(),i(m,{key:4},[l(a(I),{class:r({"is-audio":e.content.chatMessageType===a(z).AUDIO}),component:e.content.chatMessageType===a(z).AUDIO?a(F):a(G)},null,8,["class","component"]),v("span",me,d(a(R)(e.__content)),1)],64)):f("v-if",!0),e.content.chatMessageType===a(z).FILE?(o(),g(a(C),{key:5,"wrap-item":!1},{default:u((()=>[l(a(I),{class:"icon-file",size:"40",component:a(K)},null,8,["component"]),l(a(C),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[v("span",null,d(e.__content),1),v("span",pe,d(e.__size),1)])),_:2},1024)])),_:2},1024)):f("v-if",!0),l(a(w),{class:"quick-menu"},{default:u((()=>[a(H)(e.content)?f("v-if",!0):(o(),i(m,{key:0},[f(' <n-button quaternary size="tiny">\n\t\t\t\t\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class="chat--iconfont chat--icon-face" />\n\t\t\t\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t\t\t\t</n-button> '),l(a(k),{quaternary:"",size:"tiny",onClick:()=>Re(e)},{icon:u((()=>[l(a(I),{size:"17",component:a(Y)},null,8,["component"])])),_:2},1032,["onClick"])],64)),l(a(k),{quaternary:"",size:"tiny",onClick:t=>je(t,e.id)},{icon:u((()=>[l(a(I),{size:"14",component:a($)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,ie)])):f("v-if",!0)]))],2)):f("v-if",!0)],64)))),128))])),_:1}),l(a(U),{ref_key:"contextmenuRef",ref:Te,show:Me.value,"onUpdate:show":t[0]||(t[0]=e=>Me.value=e),position:ke.value,"msg-id":_e.value,onSelect:Ne},null,8,["show","position","msg-id"]),l(X,{title:"转发消息",mode:"relay",onComfirm:Oe},{trigger:u((()=>[v("span",{style:{display:"none"},ref_key:"relayTriggerRef",ref:xe},"转发",512)])),_:1})],6))}});export{de as default};
1
+ import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as o,createElementBlock as i,normalizeClass as r,unref as a,normalizeStyle as c,createVNode as l,withCtx as u,Fragment as m,renderList as p,toDisplayString as d,createCommentVNode as f,createBlock as g,createElementVNode as v,createTextVNode as y,withModifiers as h,nextTick as T}from"vue";import{NImageGroup as M,NButton as k,NAvatar as _,NImage as x,NIcon as I,NSpace as C,NButtonGroup as w,NTooltip as S}from"naive-ui";import{format as j}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as L}from"../api/index.js";import{useState as b}from"../hooks/useState.js";import{useSession as A}from"../hooks/useSession.js";import{MESSAGE_TYPE as z}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as H,simplifyMessage as D,getAVTime as R,downloadFile as N}from"../utils/index.js";import{first as O,last as P,toString as q}from"lodash-es";import B from"./PersonProfile.vue.js";import J from"./MessageTemplate.vue.js";import{emojis as W}from"../utils/emoji.js";import U from"./ContextMenu.js";import X from"./ChatAdd.vue.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as F,VideocamOutline as G,DocumentSharp as K,ChatbubbleEllipsesOutline as Y,EllipsisHorizontal as $,ArrowDownSharp as Q}from"@vicons/ionicons5";import{useScrollLoading as V}from"../../../../shared/hooks/useScrollLoading.js";const Z={key:0,class:"tip-text"},ee={key:1,class:"tip-text"},te={key:2,class:"message-box"},ne={key:0,class:"content-box"},se={class:"name-box"},oe=["data-time"],ie=["onContextmenu"],re={key:0,class:"reference-content"},ae=["innerHTML"],ce=["src"],le=["innerHTML"],ue=["innerHTML"],me={style:{"margin-left":"8px"}},pe={class:"size"};var de=e({__name:"ChatMain",setup(e){const de=t(),{state:fe,setMsgList:ge,relayMessage:ve}=b(),{setCurrentSessionItem:ye,isGroupChat:he}=A(fe),Te=t(),Me=t(!1),ke=t({left:0,top:0}),_e=t(),xe=t(),Ie={page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")},Ce=n((()=>({"--c-tip-top":he.value?"1px":"-20px","--c-tip-gap":he.value?"10px":"0px"})));function we({nodes:e}){var t,n;const{_ctx:s}=null==(t=e.download)?void 0:t.children,o=s?null==(n=null==s?void 0:s.proxy)?void 0:n.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,l(S,null,{trigger:()=>l(I,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:Q,onClick:()=>o&&N(o,"img")},null),default:()=>"下载"}),e.close]}async function Se(){try{if(!Ie.hasMore)return;Ie.page++;const e=await E({sessionKey:fe.currentSessionItem.sessionKey,page:Ie.page,lastSendTime:Ie.lastSendTime});if(!Array.isArray(e)||0===e.length)return Ie.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=O(e).id;Ie.lastSendTime=P(e).sendTime,ge(Ie.page>1?[...fe.msgList,...e]:e),1===Ie.page&&fe.currentSessionItem.unreadNum&&(await L({chatType:fe.currentSessionItem.chatType,messageIdSet:[t],receiver:fe.userInfo.id,sender:fe.currentSessionItem.receiver}),ye({unreadNum:0}))}catch(e){console.log(e)}}async function je(e,t){_e.value=t,async function(e){var t,n,s,o,i,r;Me.value=!0,await T();const{clientX:a,clientY:c}=e,{width:l=0,height:u=0,left:m=0,top:p=0}=(null==(t=de.value)?void 0:t.getBoundingClientRect())||{},d=null!=(o=null==(s=null==(n=Te.value)?void 0:n.$el)?void 0:s.getBoundingClientRect().height)?o:220,f=null!=(r=null==(i=de.value)?void 0:i.scrollTop)?r:0,g=5,v={};a<=m+l/2?v.left=a-m+g+"px":v.right=m+l-a-g+"px";c-p<d/2?v.top=f+g+"px":p+u-c<=d/2?v.bottom=Math.abs(f)+g+"px":v.top=f+c-p-d/2+"px";ke.value=v}(e)}function Ee(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==z.TEMPLATE||!!n}function Le(e){const{chatMessageType:t}=e.content;return e.sender===fe.userInfo.id&&Date.now()-new Date(e.sendTime).getTime()<864e5&&[z.TEXT,z.EMOJI].includes(t)}function be(e){const{chatMessageType:t,msg:n=""}=e.content;if(t===z.BLEND){const e=q(n).match(/<img[^>]*>/gi);return!e||!e.length}return t&&[z.TEXT,z.EMOJI].includes(t)}function Ae(e){const{chatMessageType:t,msg:n=""}=e.content,s=q(n).match(/<img[^>]*>/gi);return t===z.BLEND&&s&&s.length}function ze(e,t){var n,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===z.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function He(e){var t,n;const{chatMessageType:s,messageTemplate:o}=e;return s===z.TEMPLATE&&3==(null==(n=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:n.id)}function De(e,t){var n;const s=new Date(e.sendTime).getTime(),o=null==(n=fe.msgList[t+1])?void 0:n.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}function Re(e){fe.currentReferenceMsg=e,fe.currentReferenceMsg.content.referenceContent=null,Object.assign(fe.currentReferenceMsg,{chatType:fe.currentSessionItem.chatType,receiver:fe.currentSessionItem.receiver,receiverAvatar:fe.currentSessionItem.avatar,receiverName:fe.currentSessionItem.name})}function Ne(e,t){var n;"reply"!==e?"relay"===e&&(null==(n=xe.value)||n.click()):Re(t)}function Oe(e,t){const n=fe.msgList.find((e=>e.id===_e.value));ve({checkedIds:e,remark:t,content:n.content})}return V(de,(()=>{Se()}),"top",(()=>{Me.value=!1})),s((()=>fe.id),(e=>{e&&(fe.currentReferenceMsg=null,Object.assign(Ie,{page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")}),Se())}),{immediate:!0}),s((()=>fe.isAppendMsg),(e=>{e&&(ge([fe.currentMsg,...fe.msgList]),async function(){var e;null==(e=de.value)||e.scrollTo({top:0,behavior:"auto"})}(),fe.isAppendMsg=!1)}),{immediate:!0}),(e,t)=>(o(),i("div",{class:r(["chat-main",{"home-bg":!a(fe).id}]),ref_key:"chatMainRef",ref:de,style:c(a(Ce))},[l(a(M),{"show-toolbar-tooltip":"","render-toolbar":we},{default:u((()=>[(o(!0),i(m,null,p(a(fe).msgList,((e,t)=>(o(),i(m,{key:e.id},[Ee(e)?(o(),i("div",{key:0,class:r(["message-item",{"message-item--mine":e.sender==a(fe).userInfo.id}])},[De(e,t)?(o(),i("p",Z,d(e.__sendTime),1)):f("v-if",!0),ze(e,"system")||"WITHDRAWN"===e.status?(o(),i(m,{key:1},[ze(e,"system")?(o(),g(J,{key:0,data:e},null,8,["data"])):f("v-if",!0),"WITHDRAWN"===e.status?(o(),i("p",ee,[v("span",null,d(e.sender==a(fe).userInfo.id?"你":e.senderName)+"撤回了一条消息",1),Le(e)?(o(),g(a(k),{key:0,size:"tiny",style:{color:"var(--c-primary-color)","margin-left":"5px"},text:"",onClick:()=>function(e){fe.currentReEditMsg=e}(e)},{default:u((()=>[y(" 重新编辑 ")])),_:2},1032,["onClick"])):f("v-if",!0)])):f("v-if",!0)],64)):(o(),i("div",te,[l(B,{"user-id":e.sender,placement:e.sender==a(fe).userInfo.id?"left":"right"},{trigger:u((()=>[l(a(_),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id","placement"]),e.content?(o(),i("div",ne,[v("div",se,[v("span",{class:"name","data-time":e.__time},d(a(he)?e.senderName:""),9,oe)]),v("div",{class:r(["content",{emoji:e.content.chatMessageType===a(z).EMOJI&&!e.content.referenceContent,template:e.content.chatMessageType===a(z).TEMPLATE,"template--3":He(e.content),"audio-video":a(H)(e.content),file:e.content.chatMessageType===a(z).FILE}]),onContextmenu:h((t=>je(t,e.id)),["prevent"])},[be(e)?(o(),i(m,{key:0},[e.content.referenceContent?(o(),i("div",re,[v("span",null,d(e.content.referenceContent.senderName)+":",1),v("pre",{innerHTML:a(D)(e.content.referenceContent.content)},null,8,ae)])):f("v-if",!0),e.content.chatMessageType===a(z).EMOJI?(o(),i("img",{key:1,class:r([e.content.referenceContent?"emoji--min":"emoji--big"]),src:a(W).findEmoji(e.__content)},null,10,ce)):(o(),i("pre",{key:2,innerHTML:e.__content},null,8,le))],64)):f("v-if",!0),Ae(e)?(o(),i("pre",{key:1,innerHTML:e.__content},null,8,ue)):f("v-if",!0),ze(e,"template")?(o(),g(J,{key:2,data:e},null,8,["data"])):f("v-if",!0),e.content.chatMessageType===a(z).IMAGE?(o(),g(a(x),{key:3,width:"240",src:e.__content},null,8,["src"])):f("v-if",!0),a(H)(e.content)?(o(),i(m,{key:4},[l(a(I),{class:r({"is-audio":e.content.chatMessageType===a(z).AUDIO}),component:e.content.chatMessageType===a(z).AUDIO?a(F):a(G)},null,8,["class","component"]),v("span",me,d(a(R)(e.__content)),1)],64)):f("v-if",!0),e.content.chatMessageType===a(z).FILE?(o(),g(a(C),{key:5,"wrap-item":!1},{default:u((()=>[l(a(I),{class:"icon-file",size:"40",component:a(K)},null,8,["component"]),l(a(C),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[v("span",null,d(e.__content),1),v("span",pe,d(e.__size),1)])),_:2},1024)])),_:2},1024)):f("v-if",!0),l(a(w),{class:"quick-menu"},{default:u((()=>[a(H)(e.content)?f("v-if",!0):(o(),i(m,{key:0},[f(' <n-button quaternary size="tiny">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class="chat--iconfont chat--icon-face" />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t\t\t\t</n-button> '),l(a(k),{quaternary:"",size:"tiny",onClick:()=>Re(e)},{icon:u((()=>[l(a(I),{size:"17",component:a(Y)},null,8,["component"])])),_:2},1032,["onClick"])],64)),l(a(k),{quaternary:"",size:"tiny",onClick:t=>je(t,e.id)},{icon:u((()=>[l(a(I),{size:"14",component:a($)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,ie)])):f("v-if",!0)]))],2)):f("v-if",!0)],64)))),128))])),_:1}),l(a(U),{ref_key:"contextmenuRef",ref:Te,show:Me.value,"onUpdate:show":t[0]||(t[0]=e=>Me.value=e),position:ke.value,"msg-id":_e.value,onSelect:Ne},null,8,["show","position","msg-id"]),l(X,{title:"转发消息",mode:"relay",onComfirm:Oe},{trigger:u((()=>[v("span",{style:{display:"none"},ref_key:"relayTriggerRef",ref:xe},"转发",512)])),_:1})],6))}});export{de as default};
@@ -1 +1 @@
1
- import{defineComponent as t,ref as e,reactive as a,computed as o,openBlock as l,createBlock as n,unref as s,withCtx as r,renderSlot as i,createElementBlock as c,Fragment as u,withDirectives as d,createElementVNode as p,createVNode as m,createCommentVNode as v,toDisplayString as f,createTextVNode as g,renderList as y,vShow as k}from"vue";import{NPopover as h,NAvatar as b,NButton as w,NIcon as j}from"naive-ui";import{ChatbubbleEllipses as C,EyeOffOutline as I,EyeOutline as _,Close as x}from"@vicons/ionicons5";import{useState as z}from"../hooks/useState.js";import{useSession as N}from"../hooks/useSession.js";import{CHAT_TYPE as S}from"../constants/index.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import{openSessionApi as $,getUserDetailApi as D}from"../api/index.js";const E={class:"person-profile-main"},L={class:"left"},P={class:"profile"},q={class:"profile__text"},B={class:"right"},G={class:"right__content"},O={class:"label"},T={class:"content"};var U=t({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:U}){const A=t,{state:F}=z(),{openSession:H}=N(F),J=e(!1),K=e(!1),M=e(!1),Q=a({}),R=[{label:"机构",value:"",key:"orgName"},{label:"姓名",value:"",key:"name"},{label:"归属科室",value:"",key:"deptName"},{label:"业务科室",value:"",key:"businessDeptNames"},{label:"手机号",value:"",key:"phone"},{label:"岗位",value:"",key:"post"},{label:"工号",value:"",key:"jobId"},{label:"性别",value:"",key:"orgName"}],V=o((()=>(Q.id&&R.forEach((t=>{const{key:e}=t;t.value=Q[e]})),R)));async function W(){J.value=!1;let t=F.sessionList.find((t=>t.receiver===A.userId));if(!t)try{t=await $({chatType:S.SINGLE,receiver:A.userId,sender:F.userInfo.id})}catch(t){console.log("error :>> ",t)}t&&H(t),U("close")}async function X(t){if(!t)return;const e=await D({userId:A.userId});(null==e?void 0:e.id)?Object.assign(Q,e):Q.id=""}function Y(t){const{key:e,value:a}=t;return"phone"!==e||M.value?a:(a||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}return(e,a)=>(l(),n(s(h),{raw:"",class:"person-profile-wrapper",show:J.value,"onUpdate:show":[a[3]||(a[3]=t=>J.value=t),X],trigger:t.disabled?"manual":"click","show-arrow":!1,to:"body",shift:""},{trigger:r((()=>[i(e.$slots,"trigger")])),default:r((()=>[Q.id?(l(),c(u,{key:0},[d(p("div",E,[p("div",L,[p("div",P,[m(s(b),{src:Q.avatar,bordered:"",round:"",size:100,onClickCapture:a[0]||(a[0]=t=>K.value=!0)},null,8,["src"]),v(' <n-upload abstract accept="image/*" @change="onChange">\n\t\t\t\t\t\t\t<n-upload-trigger #="{ handleClick }" abstract>\n\t\t\t\t\t\t\t\t<n-button\n\t\t\t\t\t\t\t\t\tcircle\n\t\t\t\t\t\t\t\t\tsecondary\n\t\t\t\t\t\t\t\t\tclass="edit-avatar"\n\t\t\t\t\t\t\t\t\tv-show="userDetail.id === state.userInfo.id"\n\t\t\t\t\t\t\t\t\t@click="handleClick"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t\t<n-icon size="16" color="#666666" :component="Camera" />\n\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t</n-button>\n\t\t\t\t\t\t\t</n-upload-trigger>\n\t\t\t\t\t\t</n-upload> '),p("div",q,[p("h4",null,f(Q.name),1),p("p",null,f(Q.orgName),1)]),m(s(w),{strong:"",secondary:"",onClick:W},{default:r((()=>[m(s(j),{size:"13",color:"#666666",component:s(C),style:{"margin-right":"6px"}},null,8,["component"]),g(" 发消息 ")])),_:1})])]),p("div",B,[p("div",G,[(l(!0),c(u,null,y(s(V),((t,e)=>(l(),c("div",{class:"info-item",key:e},[p("span",O,f(t.label),1),p("div",T,[p("span",null,f(Y(t)),1),"phone"===t.key&&Y(t)?(l(),n(s(j),{key:0,size:"16",color:"#666666",component:M.value?s(I):s(_),style:{"margin-left":"10px"},onClick:a[1]||(a[1]=t=>M.value=!M.value)},null,8,["component"])):v("v-if",!0)])])))),128))])])],512),[[k,!K.value]]),d(p("div",{class:"large-avatar",onClick:a[2]||(a[2]=t=>K.value=!1)},[m(s(w),{circle:"",size:"small",secondary:""},{icon:r((()=>[m(s(j),{size:24,component:s(x),color:"#fff"},null,8,["component"])])),_:1}),m(s(b),{size:310,round:"",src:Q.avatar},null,8,["src"])],512),[[k,K.value]])],64)):v("v-if",!0)])),_:3},8,["show","trigger"]))}});export{U as default};
1
+ import{defineComponent as t,ref as e,reactive as a,computed as o,openBlock as l,createBlock as r,unref as n,withCtx as s,renderSlot as i,createElementBlock as c,Fragment as u,withDirectives as d,createElementVNode as p,createVNode as m,createCommentVNode as v,toDisplayString as f,createTextVNode as g,renderList as y,vShow as k}from"vue";import{NPopover as h,NAvatar as b,NButton as w,NIcon as j}from"naive-ui";import{ChatbubbleEllipses as C,EyeOffOutline as I,EyeOutline as _,Close as x}from"@vicons/ionicons5";import{useState as z}from"../hooks/useState.js";import{useSession as N}from"../hooks/useSession.js";import{CHAT_TYPE as S}from"../constants/index.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import{openSessionApi as $,getUserDetailApi as D}from"../api/index.js";const E={class:"person-profile-main"},L={class:"left"},P={class:"profile"},q={class:"profile__text"},B={class:"right"},G={class:"right__content"},O={class:"label"},T={class:"content"};var U=t({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:U}){const A=t,{state:F}=z(),{openSession:H}=N(F),J=e(!1),K=e(!1),M=e(!1),Q=a({}),R=[{label:"机构",value:"",key:"orgName"},{label:"姓名",value:"",key:"name"},{label:"归属科室",value:"",key:"deptName"},{label:"业务科室",value:"",key:"businessDeptNames"},{label:"手机号",value:"",key:"phone"},{label:"岗位",value:"",key:"post"},{label:"工号",value:"",key:"jobId"},{label:"性别",value:"",key:"orgName"}],V=o((()=>(Q.id&&R.forEach((t=>{const{key:e}=t;t.value=Q[e]})),R)));async function W(){J.value=!1;let t=F.sessionList.find((t=>t.receiver===A.userId));if(!t)try{t=await $({chatType:S.SINGLE,receiver:A.userId,sender:F.userInfo.id})}catch(t){console.log("error :>> ",t)}t&&H(t),U("close")}async function X(t){if(!t)return;const e=await D({userId:A.userId});(null==e?void 0:e.id)?Object.assign(Q,e):Q.id=""}function Y(t){const{key:e,value:a}=t;return"phone"!==e||M.value?a:(a||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}return(e,a)=>(l(),r(n(h),{raw:"",class:"person-profile-wrapper",show:J.value,"onUpdate:show":[a[3]||(a[3]=t=>J.value=t),X],trigger:t.disabled?"manual":"click","show-arrow":!1,to:"body",shift:""},{trigger:s((()=>[i(e.$slots,"trigger")])),default:s((()=>[Q.id?(l(),c(u,{key:0},[d(p("div",E,[p("div",L,[p("div",P,[m(n(b),{src:Q.avatar,bordered:"",round:"",size:100,onClickCapture:a[0]||(a[0]=t=>K.value=!0)},null,8,["src"]),v(' <n-upload abstract accept="image/*" @change="onChange">\r\n\t\t\t\t\t\t\t<n-upload-trigger #="{ handleClick }" abstract>\r\n\t\t\t\t\t\t\t\t<n-button\r\n\t\t\t\t\t\t\t\t\tcircle\r\n\t\t\t\t\t\t\t\t\tsecondary\r\n\t\t\t\t\t\t\t\t\tclass="edit-avatar"\r\n\t\t\t\t\t\t\t\t\tv-show="userDetail.id === state.userInfo.id"\r\n\t\t\t\t\t\t\t\t\t@click="handleClick"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t\t\t<n-icon size="16" color="#666666" :component="Camera" />\r\n\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t</n-button>\r\n\t\t\t\t\t\t\t</n-upload-trigger>\r\n\t\t\t\t\t\t</n-upload> '),p("div",q,[p("h4",null,f(Q.name),1),p("p",null,f(Q.orgName),1)]),m(n(w),{strong:"",secondary:"",onClick:W},{default:s((()=>[m(n(j),{size:"13",color:"#666666",component:n(C),style:{"margin-right":"6px"}},null,8,["component"]),g(" 发消息 ")])),_:1})])]),p("div",B,[p("div",G,[(l(!0),c(u,null,y(n(V),((t,e)=>(l(),c("div",{class:"info-item",key:e},[p("span",O,f(t.label),1),p("div",T,[p("span",null,f(Y(t)),1),"phone"===t.key&&Y(t)?(l(),r(n(j),{key:0,size:"16",color:"#666666",component:M.value?n(I):n(_),style:{"margin-left":"10px"},onClick:a[1]||(a[1]=t=>M.value=!M.value)},null,8,["component"])):v("v-if",!0)])])))),128))])])],512),[[k,!K.value]]),d(p("div",{class:"large-avatar",onClick:a[2]||(a[2]=t=>K.value=!1)},[m(n(w),{circle:"",size:"small",secondary:""},{icon:s((()=>[m(n(j),{size:24,component:n(x),color:"#fff"},null,8,["component"])])),_:1}),m(n(b),{size:310,round:"",src:Q.avatar},null,8,["src"])],512),[[k,K.value]])],64)):v("v-if",!0)])),_:3},8,["show","trigger"]))}});export{U as default};
@@ -1,5 +1,6 @@
1
1
  import { CSSProperties, PropType } from 'vue';
2
2
  import { VxeColumnPropTypes, VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from 'vxe-table';
3
+ import { LowCodeTableFieldItem } from '../../../../../components/iho-table';
3
4
  declare const _default: import("vue").DefineComponent<{
4
5
  payload: {
5
6
  type: PropType<VxeColumnPropTypes.FilterSlotParams>;
@@ -14,6 +15,8 @@ declare const _default: import("vue").DefineComponent<{
14
15
  }>> & {}>>;
15
16
  $table: (VxeTableConstructor & VxeTablePrivateMethods & VxeTableMethods) | undefined;
16
17
  tableConfig: import("vue").Ref<import("../../../../../components/iho-table").IhoTableConfig>;
18
+ lowCodeField: import("vue").ComputedRef<Partial<LowCodeTableFieldItem>>;
19
+ tableFullData: import("vue").ComputedRef<any[]>;
17
20
  multipleRef: import("vue").ComputedRef<boolean>;
18
21
  optionsRef: import("vue").ComputedRef<import("vxe-table").VxeTableDefines.FilterOption[] & VxeColumnPropTypes.Filter[]>;
19
22
  checkedRef: import("vue").WritableComputedRef<string[]>;
@@ -54,6 +57,23 @@ declare const _default: import("vue").DefineComponent<{
54
57
  }>>, {
55
58
  cancelable: boolean;
56
59
  }>;
60
+ SlotRender: import("vue").DefineComponent<{
61
+ renderer: {
62
+ type: PropType<string | import("vue").Component | import("../../../../../shared/types").AnyFn>;
63
+ required: true;
64
+ };
65
+ rootSlots: {
66
+ type: PropType<Record<string, import("../../../../../shared/types").AnyFn>>;
67
+ };
68
+ }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
69
+ renderer: {
70
+ type: PropType<string | import("vue").Component | import("../../../../../shared/types").AnyFn>;
71
+ required: true;
72
+ };
73
+ rootSlots: {
74
+ type: PropType<Record<string, import("../../../../../shared/types").AnyFn>>;
75
+ };
76
+ }>>, {}>;
57
77
  NButton: any;
58
78
  NButtonGroup: any;
59
79
  NCheckbox: any;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,onMounted as i,toRaw as n,openBlock as o,createElementBlock as r,unref as v,createBlock as s,createCommentVNode as c,createElementVNode as d,createVNode as p,isRef as f,withCtx as h,mergeProps as m,normalizeProps as _,guardReactiveProps as y,Fragment as b,renderList as k,toDisplayString as g,createTextVNode as C,normalizeStyle as L}from"vue";import w from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{keywordMatcher as D,widthAppend as F}from"../../../../../shared/utils/index.js";import{useVirtualList as I}from"@vueuse/core";import{isNumber as j,isString as x,isFunction as R,isEqual as S}from"lodash-es";import{NInput as U,NCheckbox as W,NSpin as E,NCheckboxGroup as O,NRadioGroup as Y,NButtonGroup as $,NButton as M}from"naive-ui";import{InjectionIhoTableConfig as P}from"../../constants/index.js";import{isVariableHeightTable as V}from"../../utils/index.js";const q={class:"iho-table__filterWrapper"},z={key:1,class:"iho-table__filterCheckAllWrapper"},A={class:"iho-table__filterListItem"},H={class:"iho-table__filterListItem"},B=["title"],G=["title"],J={class:"iho-table__filterListItemContent"},K={class:"iho-table__filterFooter"};var N=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const N=e,Q=l("$xetable"),T=l(P),X=a((()=>{var e;return!!(null==(e=N.payload)?void 0:e.column.filterMultiple)})),Z=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=N.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),ee=a({get:()=>Z.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){var l,a,t,u;if(!N.payload||!Q)return;const i=Q.reactData.filterStore.options||[];if(X.value?(i.forEach((l=>l._checked=e.includes(l.value))),Q.checkFilterOptions()):i.forEach((l=>l._checked=l.value===e[0])),!V(Q))return n();function n(){N.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(l=Q.internalData.afterFullData)?void 0:l.length)?a:0)>(null!=(u=null==(t=T.value.scrollY)?void 0:t.gt)?u:100)&&(Q.reactData.scrollYLoad=!0),n(),Q.reactData.scrollYLoad=!1}}),le=t([...ee.value]),ae=t("");async function te(){Q&&(Q.reactData.filterStore.visible=!1)}u(te);const ue=a((()=>{var e,l;if(!N.payload||!N.payload.column)return 10;const{filterCapacity:a}=null!=(l=null==(e=N.payload.column.editRender)?void 0:e.props)?l:{};return j(a)&&a>0?a:10})),ie=a((()=>{var e;return null==(e=N.payload.column.editRender.props)?void 0:e.filterOptionsFilterMethod})),ne=a((()=>ae.value?Z.value.filter((e=>ie.value?ie.value(ae.value,e):!!`${e.label}`.includes(ae.value)||(x(e.data)?D(ae.value,e.data):void 0))):Z.value)),{list:oe,containerProps:re,wrapperProps:ve}=I(ne,{itemHeight:32,overscan:3}),se=a({get:()=>!!ne.value.length&&ne.value.every((e=>le.value.includes(e.value))),set(e){le.value=e?[...new Set([...le.value,...ne.value.map((e=>e.value))])]:le.value.filter((e=>ne.value.every((l=>l.value!==e))))}}),ce=a((()=>ne.value.some((e=>le.value.includes(e.value)))&&!se.value)),de=a({get:()=>le.value.length===Z.value.length&&0!==Z.value.length,set:e=>{le.value=e?Z.value.map((e=>e.value)):[]}}),pe=a((()=>!!le.value.length&&!de.value)),fe=a((()=>({height:F(32*ue.value)})));function he(){ee.value=X.value?le.value:S(le.value[0],null)?[]:[le.value[0]],te()}function me(){le.value=X.value?[]:[null]}const _e=t(!1);return i((async()=>{var e;if(!Q)return;const l=null==(e=N.payload.column.editRender.props)?void 0:e.onFilterShow;if(R(l))try{_e.value=!0,await l(N.payload);const{filterStore:e}=Q.reactData;n(e.options)!==n(Z.value)&&(e.options=Z.value)}finally{_e.value=!1}})),(e,l)=>(o(),r("section",q,[v(Z).length>5?(o(),s(v(U),{key:0,value:ae.value,"onUpdate:value":l[0]||(l[0]=e=>ae.value=e)},null,8,["value"])):c("v-if",!0),v(X)?(o(),r("div",z,[d("div",A,[p(v(W),{label:"全选当前",checked:v(se),"onUpdate:checked":l[1]||(l[1]=e=>f(se)?se.value=e:null),indeterminate:v(ce)},null,8,["checked","indeterminate"])]),d("div",H,[p(v(W),{label:"全选所有",checked:v(de),"onUpdate:checked":l[2]||(l[2]=e=>f(de)?de.value=e:null),indeterminate:v(pe)},null,8,["checked","indeterminate"])])])):c("v-if",!0),p(v(E),{show:_e.value},{default:h((()=>[v(X)?(o(),s(v(O),{key:0,value:le.value,"onUpdate:value":l[3]||(l[3]=e=>le.value=e)},{default:h((()=>[d("section",m(v(re),{style:v(fe),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(ve))),[(o(!0),r(b,null,k(v(oe),(e=>(o(),r("div",{class:"iho-table__filterListItem",key:e.data.value},[p(v(W),{value:e.data.value},{default:h((()=>[d("div",{class:"iho-table__filterListItemContent",title:e.data.label},g(e.data.label),9,B)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(o(),s(v(Y),{key:1,value:le.value[0],"onUpdate:value":l[5]||(l[5]=e=>le.value[0]=e)},{default:h((()=>[d("section",m(v(re),{style:v(fe),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(ve))),[(o(!0),r(b,null,k(v(oe),(e=>(o(),r("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[p(v(w),{value:e.data.value,currentValue:le.value[0],cancelable:"",onCancel:l[4]||(l[4]=e=>le.value=[null])},{default:h((()=>[d("div",J,g(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,G)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),d("footer",K,[d("section",null,[v(X)?(o(),r(b,{key:0},[C(" 已选择 "),d("span",{style:L({color:"var(--c-primary-color)"})},g(le.value.length),5),C(" 项 ")],64)):c("v-if",!0)]),p(v($),{size:"small"},{default:h((()=>[p(v(M),{onClick:me},{default:h((()=>[C("清空")])),_:1}),p(v(M),{onClick:te},{default:h((()=>[C("取消")])),_:1}),p(v(M),{type:"primary",onClick:he},{default:h((()=>[C("确定")])),_:1})])),_:1})])]))}});export{N as default};
1
+ import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,onMounted as r,toRaw as i,openBlock as n,createElementBlock as o,unref as v,createBlock as s,createCommentVNode as d,createVNode as c,isRef as p,withCtx as f,createTextVNode as m,createElementVNode as h,toDisplayString as y,mergeProps as _,normalizeProps as k,guardReactiveProps as b,Fragment as g,renderList as L,normalizeStyle as C}from"vue";import D from"../../../../../shared/components/CancelRadio/CancelRadio.js";import F from"../../../../../shared/components/SlotRender/SlotRender.js";import{keywordMatcher as R,widthAppend as w}from"../../../../../shared/utils/index.js";import{useVirtualList as S}from"@vueuse/core";import{isNumber as j,isString as I,isFunction as x,isEqual as U}from"lodash-es";import{NInput as W,NCheckbox as $,NSpin as E,NCheckboxGroup as O,NRadioGroup as Y,NButtonGroup as M,NButton as P}from"naive-ui";import{InjectionIhoTableConfig as V}from"../../constants/index.js";import{getLowCodeFieldFromField as q,isVariableHeightTable as z}from"../../utils/index.js";const A={class:"iho-table__filterWrapper"},H={key:1,class:"iho-table__filterCheckAllWrapper"},N={key:0,class:"iho-table__filterListItem"},B={class:"iho-table__filterListItem"},G=["title"],J=["title"],K={class:"iho-table__filterListItemContent"},Q={class:"iho-table__filterFooter"};var T=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const T=e,X=l("$xetable"),Z=l(V),ee=a((()=>q(T.payload.column)||{})),le=a((()=>{var e;return(null==(e=null==X?void 0:X.internalData)?void 0:e.afterFullData)||[]})),ae=a((()=>{var e;return!!(null==(e=T.payload)?void 0:e.column.filterMultiple)})),te=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=T.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),ue=a({get:()=>te.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){var l,a,t,u;if(!T.payload||!X)return;const r=X.reactData.filterStore.options||[];if(ae.value?(r.forEach((l=>l._checked=e.includes(l.value))),X.checkFilterOptions()):r.forEach((l=>l._checked=l.value===e[0])),!z(X))return i();function i(){T.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(l=X.internalData.afterFullData)?void 0:l.length)?a:0)>(null!=(u=null==(t=Z.value.scrollY)?void 0:t.gt)?u:100)&&(X.reactData.scrollYLoad=!0),i(),X.reactData.scrollYLoad=!1}}),re=t([...ue.value]),ie=t("");async function ne(){X&&(X.reactData.filterStore.visible=!1)}u(ne);const oe=a((()=>{var e,l;if(!T.payload||!T.payload.column)return 10;const{filterCapacity:a}=null!=(l=null==(e=T.payload.column.editRender)?void 0:e.props)?l:{};return j(a)&&a>0?a:10})),ve=a((()=>{var e;return null==(e=T.payload.column.editRender.props)?void 0:e.filterOptionsFilterMethod})),se=a((()=>ie.value?te.value.filter((e=>ve.value?ve.value(ie.value,e):!!`${e.label}`.includes(ie.value)||(I(e.data)?R(ie.value,e.data):void 0))):te.value)),{list:de,containerProps:ce,wrapperProps:pe}=S(se,{itemHeight:32,overscan:3}),fe=a({get:()=>!!se.value.length&&se.value.every((e=>re.value.includes(e.value))),set(e){re.value=e?[...new Set([...re.value,...se.value.map((e=>e.value))])]:re.value.filter((e=>se.value.every((l=>l.value!==e))))}}),me=a((()=>se.value.some((e=>re.value.includes(e.value)))&&!fe.value)),he=a({get:()=>re.value.length===te.value.length&&0!==te.value.length,set:e=>{re.value=e?te.value.map((e=>e.value)):[]}}),ye=a((()=>!!re.value.length&&!he.value)),_e=a((()=>({height:w(32*oe.value)})));function ke(){ue.value=ae.value?re.value:U(re.value[0],null)?[]:[re.value[0]],ne()}function be(){re.value=ae.value?[]:[null]}const ge=t(!1);return r((async()=>{var e;if(!X)return;const l=null==(e=T.payload.column.editRender.props)?void 0:e.onFilterShow;if(x(l))try{ge.value=!0,await l(T.payload);const{filterStore:e}=X.reactData;i(e.options)!==i(te.value)&&(e.options=te.value)}finally{ge.value=!1}})),(l,a)=>(n(),o("section",A,[v(te).length>5?(n(),s(v(W),{key:0,value:ie.value,"onUpdate:value":a[0]||(a[0]=e=>ie.value=e)},null,8,["value"])):d("v-if",!0),v(ae)?(n(),o("div",H,[v(te).length>5?(n(),o("div",N,[c(v($),{checked:v(fe),"onUpdate:checked":a[1]||(a[1]=e=>p(fe)?fe.value=e:null),indeterminate:v(me)},{default:f((()=>[m("全选当前")])),_:1},8,["checked","indeterminate"])])):d("v-if",!0),h("div",B,[c(v($),{checked:v(he),"onUpdate:checked":a[2]||(a[2]=e=>p(he)?he.value=e:null),indeterminate:v(ye)},{default:f((()=>[m(" 全选所有"+y(v(ee).showFilterFullNums?`(${v(le).length})`:""),1)])),_:1},8,["checked","indeterminate"])])])):d("v-if",!0),c(v(E),{show:ge.value},{default:f((()=>[v(ae)?(n(),s(v(O),{key:0,value:re.value,"onUpdate:value":a[3]||(a[3]=e=>re.value=e)},{default:f((()=>[h("section",_(v(ce),{style:v(_e),class:"iho-table__filterListWrapper"}),[h("section",k(b(v(pe))),[(n(!0),o(g,null,L(v(de),(l=>(n(),o("div",{class:"iho-table__filterListItem",key:l.data.value},[c(v($),{value:l.data.value},{default:f((()=>[h("div",{class:"iho-table__filterListItemContent",title:l.data.label},[v(ee).filterLabelRender?(n(),s(v(F),_({key:0,renderer:v(ee).filterLabelRender},e.payload,{option:l.data}),null,16,["renderer","option"])):(n(),o(g,{key:1},[m(y(l.data.label),1)],64))],8,G)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(n(),s(v(Y),{key:1,value:re.value[0],"onUpdate:value":a[5]||(a[5]=e=>re.value[0]=e)},{default:f((()=>[h("section",_(v(ce),{style:v(_e),class:"iho-table__filterListWrapper"}),[h("section",k(b(v(pe))),[(n(!0),o(g,null,L(v(de),(e=>(n(),o("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[c(v(D),{value:e.data.value,currentValue:re.value[0],cancelable:"",onCancel:a[4]||(a[4]=e=>re.value=[null])},{default:f((()=>[h("div",K,y(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,J)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),h("footer",Q,[h("section",null,[v(ae)?(n(),o(g,{key:0},[m(" 已选择 "),h("span",{style:C({color:"var(--c-primary-color)"})},y(re.value.length),5),m(" 项 ")],64)):d("v-if",!0)]),c(v(M),{size:"small"},{default:f((()=>[c(v(P),{onClick:be},{default:f((()=>[m("清空")])),_:1}),c(v(P),{onClick:ne},{default:f((()=>[m("取消")])),_:1}),c(v(P),{type:"primary",onClick:ke},{default:f((()=>[m("确定")])),_:1})])),_:1})])]))}});export{T as default};