cnhis-design-vue 3.2.8-release.1 → 3.2.8-release.2

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 (104) hide show
  1. package/es/components/ai-chat/index.d.ts +75 -0
  2. package/es/components/ai-chat/index.js +1 -0
  3. package/es/components/ai-chat/src/Index.vue.d.ts +77 -0
  4. package/es/components/ai-chat/src/Index.vue.js +1 -0
  5. package/es/components/ai-chat/src/Index.vue2.js +1 -0
  6. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +14 -0
  7. package/es/components/ai-chat/src/components/ChatFooter.vue.js +1 -0
  8. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -0
  9. package/es/components/ai-chat/src/components/ChatMain.d.ts +8 -0
  10. package/es/components/ai-chat/src/components/ChatMain.js +1 -0
  11. package/es/components/ai-chat/src/types/index.d.ts +20 -0
  12. package/es/components/ai-chat/src/types/index.js +1 -0
  13. package/es/components/ai-chat/style/index.css +1 -0
  14. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  15. package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -1
  16. package/es/components/button-print/index.d.ts +38 -0
  17. package/es/components/button-print/src/ButtonPrint.vue.d.ts +38 -0
  18. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  19. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +17 -0
  20. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  21. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
  22. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  23. package/es/components/button-print/src/utils/print.js +1 -1
  24. package/es/components/button-print/style/index.css +1 -1
  25. package/es/components/calendar/src/Calendar.vue2.js +1 -1
  26. package/es/components/callback/src/components/render/popupMaps.d.ts +3 -2
  27. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  28. package/es/components/field-set/src/FieldColor.vue.d.ts +10 -1
  29. package/es/components/field-set/src/FieldFilter.vue.d.ts +10 -1
  30. package/es/components/field-set/src/FieldSet.vue.d.ts +21 -2
  31. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  32. package/es/components/field-set/src/components/condition.vue2.js +1 -1
  33. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
  34. package/es/components/field-set/src/components/table-row.vue.d.ts +10 -1
  35. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  36. package/es/components/field-set/src/utils/index.d.ts +1 -1
  37. package/es/components/field-set/src/utils/index.js +1 -1
  38. package/es/components/form-config/index.d.ts +6 -4
  39. package/es/components/form-config/src/FormConfig.vue.d.ts +6 -4
  40. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  41. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +3 -2
  42. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -2
  43. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  44. package/es/components/form-render/index.d.ts +3 -2
  45. package/es/components/form-render/src/FormRender.vue.d.ts +2 -1
  46. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  47. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +3 -2
  48. package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
  49. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  50. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
  51. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  52. package/es/components/form-render/src/components/renderer/select.js +1 -1
  53. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  54. package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
  55. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  56. package/es/components/form-render/src/types/index.d.ts +1 -0
  57. package/es/components/guide/src/renderer.js +1 -1
  58. package/es/components/iho-chat/index.d.ts +3 -0
  59. package/es/components/iho-chat/src/Index.vue.d.ts +3 -0
  60. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  61. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  62. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  63. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +4 -0
  64. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  65. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  66. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  67. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  68. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
  69. package/es/components/iho-chat/style/index.css +1 -1
  70. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  71. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
  72. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +1 -1
  73. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  74. package/es/components/index.css +1 -1
  75. package/es/components/index.d.ts +2 -1
  76. package/es/components/index.js +1 -1
  77. package/es/components/info-header/index.d.ts +6 -4
  78. package/es/components/info-header/src/InfoHeader.vue.d.ts +6 -4
  79. package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
  80. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +3 -2
  81. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +3 -2
  82. package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
  83. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  84. package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -1
  85. package/es/components/shortcut-setter/index.d.ts +3 -2
  86. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +3 -2
  87. package/es/components/shortcut-setter/src/ShortcutSetter.vue2.js +1 -1
  88. package/es/components/step-notice/src/StepNotice.vue2.js +1 -1
  89. package/es/components/step-notice/src/hooks/useTheme.js +1 -1
  90. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  91. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  92. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  93. package/es/shared/assets/img/ai__avatar.png.js +1 -0
  94. package/es/shared/hooks/index.d.ts +1 -0
  95. package/es/shared/hooks/index.js +1 -1
  96. package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -1
  97. package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
  98. package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -1
  99. package/es/shared/hooks/useFormRequest/index.js +1 -1
  100. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  101. package/es/shared/package.json.js +1 -1
  102. package/package.json +2 -2
  103. /package/es/{components/iho-chat/src → shared}/hooks/useScrollLoading.d.ts +0 -0
  104. /package/es/{components/iho-chat/src → shared}/hooks/useScrollLoading.js +0 -0
@@ -1 +1 @@
1
- import{ref as e,createVNode as t,createTextVNode as l}from"vue";import"../../utils/index.js";import{NTooltip as n,NIcon as r,NButton as o,NTag as a}from"naive-ui";import"@vueuse/core";import"date-fns";import{isString as i,isArray as u}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import{searchContentMatcher as s}from"./useSearchContent.js";import{HelpCircleSharp as c}from"@vicons/ionicons5";function p(p,{labelKey:v,valueKey:m,showKey:d,searchContent:f,valueRef:y}){const h=e("");return{renderLabel:function(e){var l;const o=e[v.value];if(!o||!i(o))return"";const a=null!=(l=e.title)?l:o,u=f.value?s(f.value,o):null,p=u?t("section",{title:a},[u.map(((e,l)=>0!==l&&e?t("span",{style:{color:l%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):t("span",{title:a},[o]);return e.desc?t("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[p,e.desc?t(n,null,{trigger:()=>t(r,{component:c},null),default:()=>e.desc}):null]):p},renderSelectAll:function(e){return[t(o,{quaternary:!0,type:"primary",size:"tiny",onClick:()=>e(!0)},{default:()=>[l("全选")]}),t(o,{quaternary:!0,type:"primary",size:"tiny",onClick:()=>e(!1)},{default:()=>[l("清空")]})]},renderTag:function({option:e,handleClose:l}){var n;const r=null!=(n=d.value&&e[d.value])?n:e[v.value];if(!p.multiple)return h.value=r,r;h.value="";const o=u(y.value)?y.value.findIndex((t=>t===e[m.value])):-1;return p.deletable?t(a,{closable:!0,onClose:e=>{e.stopPropagation(),l()}},{default:()=>t("span",{title:r},[r])}):`${r} ${o>=0&&o===y.value.length-1?"":";"}`},titleRef:h}}export{p as useSelectRenders};
1
+ import{ref as e,createVNode as t,createTextVNode as l}from"vue";import"../../utils/index.js";import{NTooltip as n,NIcon as r,NButton as o,NTag as a}from"naive-ui";import"@vueuse/core";import"date-fns";import{isString as i,isArray as u}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import{searchContentMatcher as s}from"./useSearchContent.js";import{HelpCircleSharp as c}from"@vicons/ionicons5";import"../useScrollLoading.js";function p(p,{labelKey:v,valueKey:m,showKey:d,searchContent:f,valueRef:y}){const g=e("");return{renderLabel:function(e){var l;const o=e[v.value];if(!o||!i(o))return"";const a=null!=(l=e.title)?l:o,u=f.value?s(f.value,o):null,p=u?t("section",{title:a},[u.map(((e,l)=>0!==l&&e?t("span",{style:{color:l%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):t("span",{title:a},[o]);return e.desc?t("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[p,e.desc?t(n,null,{trigger:()=>t(r,{component:c},null),default:()=>e.desc}):null]):p},renderSelectAll:function(e){return[t(o,{quaternary:!0,type:"primary",size:"tiny",onClick:()=>e(!0)},{default:()=>[l("全选")]}),t(o,{quaternary:!0,type:"primary",size:"tiny",onClick:()=>e(!1)},{default:()=>[l("清空")]})]},renderTag:function({option:e,handleClose:l}){var n;const r=null!=(n=d.value&&e[d.value])?n:e[v.value];if(!p.multiple)return g.value=r,r;g.value="";const o=u(y.value)?y.value.findIndex((t=>t===e[m.value])):-1;return p.deletable?t(a,{closable:!0,onClose:e=>{e.stopPropagation(),l()}},{default:()=>t("span",{title:r},[r])}):`${r} ${o>=0&&o===y.value.length-1?"":";"}`},titleRef:g}}export{p as useSelectRenders};
@@ -1 +1 @@
1
- import{isObject as e,isPromise as t}from"@vue/shared";import{uuidGenerator as r}from"../../utils/index.js";import{unref as n}from"vue";import"naive-ui";import"@vueuse/core";import"date-fns";import{AsyncQueue as s}from"../useAsyncQueue/index.js";import{cloneDeep as o,isFunction as a}from"lodash-es";import"@vueuse/shared";import"../selectHooks/useSearchContent.js";import"@vicons/ionicons5";let u=null;const i={method:"post",url:"",primaryKeyUrl:"",mergeUrl:""},c={url:{get:"/fdp-api/fdp/aiRec/search",post:"/fdp-api/fdp/aiRec/sendBehaviorData",delete:"/fdp-api/fdp/aiRec/delete"},getRecommendIds:()=>({})};function l(){return{getHttpInstance:function(){return u},registGlobHttpInstance:function(e){u=e},registGlobRecommendInfo:function(e){Object.assign(c,e)},registGlobSearchInfo:function(e){Object.assign(i,e)},getSearchRequestInfo:function(){return{...i}},getRecommendRequestInfo:function(){return o(c)}}}function f(o,u){const{getHttpInstance:i}=l();let c=null;return{create:function(l=3,f){const m=new s({name:"FormRenderAsyncQueue",uniqueData:u.value,parallelism:l,async processor({key:r,mergeUrl:s,method:u="post",cache:p,params:d,url:h,payload:R},g,y){var w,b,q,v;const S=null!=(w=n(o))?w:i();if(!S)return console.log("before use http feature, you should regist http instance by useFormRequest.registGlobHttpInstance()"),g(),void y();try{let n;if(f&&a(f.beforeRequest)&&(d=null!=(b=f.beforeRequest(r,d,R))?b:{}),s){(!c||Object.keys(c.waitingRequestParams).length>=10)&&(c=function(e,t,r,n,s){const o=new Promise(((s,a)=>{n.parallelism=1e3,setTimeout((async()=>{try{s(await e[r](t,o.waitingRequestParams))}catch(e){a(e)}}),10)})).finally((()=>{c=null,n.parallelism=s}));return o.waitingRequestParams={},o}(S,s,u,m,l)),c.waitingRequestParams[r]=d;const t=await c;n=e(t)?{...t,map:null!=(v=null==(q=t.map)?void 0:q[r])?v:{rows:[]}}:{}}else n=await S[u](h,d);f&&a(f.afterRequest)&&(n=f.afterRequest(r,n,R),t(n)&&(n=await n)),g(void 0,Array.isArray(n)?n:[]),!p&&y()}catch(e){g(new Error(`Request error => ${e}`)),y()}},getKey:({url:e,method:t="post",cache:n,params:s})=>n?e+t+JSON.stringify(s||{}):r()});return m}}}function m(t){if(!e(t))throw t;return r=t,Reflect.has(r,"map")&&Reflect.has(r,"result")?function(e){const{result:t,map:r}=e;if("SUCCESS"!==t)throw e;return r.rows}(t):function(e){return Reflect.has(e,"result")&&Reflect.has(e,"obj")}(t)?function(t){const{obj:r,result:n}=t;if("SUCCESS"!==n||!e(r))throw t;return Object.entries(r).reduce(((e,[t,r])=>(r.forEach((r=>e.push({...r,type:t}))),e)),[])}(t):function(e){return Reflect.has(e,"data")&&Reflect.has(e,"success")}(t)?function(e){const{data:t,success:r}=e;if(!r)throw e;return t}(t):[];var r}export{m as presetRequestHandler,f as useFormAsyncQueue,l as useFormRequest};
1
+ import{isObject as e,isPromise as t}from"@vue/shared";import{uuidGenerator as r}from"../../utils/index.js";import{unref as n}from"vue";import"naive-ui";import"@vueuse/core";import"date-fns";import{AsyncQueue as s}from"../useAsyncQueue/index.js";import{cloneDeep as o,isFunction as a}from"lodash-es";import"@vueuse/shared";import"../selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../useScrollLoading.js";let i=null;const u={method:"post",url:"",primaryKeyUrl:"",mergeUrl:""},c={url:{get:"/fdp-api/fdp/aiRec/search",post:"/fdp-api/fdp/aiRec/sendBehaviorData",delete:"/fdp-api/fdp/aiRec/delete"},getRecommendIds:()=>({})};function l(){return{getHttpInstance:function(){return i},registGlobHttpInstance:function(e){i=e},registGlobRecommendInfo:function(e){Object.assign(c,e)},registGlobSearchInfo:function(e){Object.assign(u,e)},getSearchRequestInfo:function(){return{...u}},getRecommendRequestInfo:function(){return o(c)}}}function f(o,i){const{getHttpInstance:u}=l();let c=null;return{create:function(l=3,f){const m=new s({name:"FormRenderAsyncQueue",uniqueData:i.value,parallelism:l,async processor({key:r,mergeUrl:s,method:i="post",cache:p,params:d,url:h,payload:R},g,y){var w,b,q,v;const S=null!=(w=n(o))?w:u();if(!S)return console.log("before use http feature, you should regist http instance by useFormRequest.registGlobHttpInstance()"),g(),void y();try{let n;if(f&&a(f.beforeRequest)&&(d=null!=(b=f.beforeRequest(r,d,R))?b:{}),s){(!c||Object.keys(c.waitingRequestParams).length>=10)&&(c=function(e,t,r,n,s){const o=new Promise(((s,a)=>{n.parallelism=1e3,setTimeout((async()=>{try{s(await e[r](t,o.waitingRequestParams))}catch(e){a(e)}}),10)})).finally((()=>{c=null,n.parallelism=s}));return o.waitingRequestParams={},o}(S,s,i,m,l)),c.waitingRequestParams[r]=d;const t=await c;n=e(t)?{...t,map:null!=(v=null==(q=t.map)?void 0:q[r])?v:{rows:[]}}:{}}else n=await S[i](h,d);f&&a(f.afterRequest)&&(n=f.afterRequest(r,n,R),t(n)&&(n=await n)),g(void 0,Array.isArray(n)?n:[]),!p&&y()}catch(e){g(new Error(`Request error => ${e}`)),y()}},getKey:({url:e,method:t="post",cache:n,params:s})=>n?e+t+JSON.stringify(s||{}):r()});return m}}}function m(t){if(!e(t))throw t;return r=t,Reflect.has(r,"map")&&Reflect.has(r,"result")?function(e){const{result:t,map:r}=e;if("SUCCESS"!==t)throw e;return r.rows}(t):function(e){return Reflect.has(e,"result")&&Reflect.has(e,"obj")}(t)?function(t){const{obj:r,result:n}=t;if("SUCCESS"!==n||!e(r))throw t;return Object.entries(r).reduce(((e,[t,r])=>(r.forEach((r=>e.push({...r,type:t}))),e)),[])}(t):function(e){return Reflect.has(e,"data")&&Reflect.has(e,"success")}(t)?function(e){const{data:t,success:r}=e;if(!r)throw e;return t}(t):[];var r}export{m as presetRequestHandler,f as useFormAsyncQueue,l as useFormRequest};
@@ -1 +1 @@
1
- import{deepOmit as e}from"../utils/index.js";import"naive-ui";import{computed as t,ref as r,watch as n,unref as i}from"vue";import"@vueuse/core";import"date-fns";import{isEqual as o,noop as a,isString as l,isNumber as u,isEmpty as s,isFunction as c,cloneDeep as d,omit as v,isArray as p}from"lodash-es";import{useFormRequest as h}from"./useFormRequest/index.js";import"@vueuse/shared";import"./selectHooks/useSearchContent.js";import"@vicons/ionicons5";function y(y,f,{asyncQueue:m,fieldKey:k,getRequestPayload:g=a}){const b=t({get:()=>y.value,set(e){o(e,y.value)||f("update:value",e)}}),w=r(!1),_=r([]),O=t((()=>{var e,t,r;return null!=(r=null==(t=null==(e=y.wordbook)?void 0:e.show_key)?void 0:t[0])?r:y.labelField})),L=t((()=>{var e,t;return null!=(t=null==(e=y.wordbook)?void 0:e.value_key)?t:y.valueField})),j=t((()=>{var e,t;return null==(t=null==(e=y.wordbook)?void 0:e.render_key)?void 0:t[0]})),C=t((()=>{var e;return(null==(e=y.wordbook)?void 0:e.level_num)||1/0})),K=function(e,t,r){return{transformListToChildren(e){if(!e.length)return[];const t=[(e=d(e))[0]];let r=e[0];for(let t=1;t<e.length;t++){const n=e[t];n&&(r.children=[n],n.parent=r,r=n)}return[e,t]},getNodeDepth(e){let t=1,r=e.parent;for(;r;)t++,r=r.parent;return t},enrichChildOption(e,t,r){return{...e,parent:t,isLeaf:this.getNodeDepth(t)+1>=r}},enrichKeywordOption:(e,n)=>(e.__keyword=!!n,e.isLeaf=!!n,n&&r.value&&e[r.value]&&(e[t.value]=e[r.value]),e),sortOptionWithIdList:(t,r)=>r.map((r=>t.find((t=>t[e.value]===r)))),generateOptionWithIdList(t,r,n){let i=t[0];return{options:r.reduce(((e,r,a)=>{const l=o(t,r);return 0===a?(i=l,[l]):(Object.assign(l,{parent:i,isLeaf:a+1>=n}),i.children=[l],i=l,e)}),[]),lastOption:i};function o(t,r){return t.find((t=>t[e.value]===r))}},parseLinkFromString2List:e=>e.split("_").filter((e=>e)),isClickNodeCheckbox:e=>e&&!e.__keyword&&e.isLeaf,createConfigObject:(t,r,n)=>r?t.conObj||[]:n?[{con:"EQ",is_compare_field:!1,field_key:t.level_key,value:n[e.value]}]:t.conObjFirstLevel||[],createOptionValue(e){const t=[];let r=e;for(;r;)t.unshift(v(r,["parent","isLeaf","__keyword","children"])),r=r.parent;return t},shouldInitOptionList:(t,r,n)=>p(t)&&!s(t)&&t.every((t=>t[e.value]))&&!r&&!n}}(L,O,j),{getSearchRequestInfo:I}=h(),N=r(150),R=r();async function x(t,r,n,o=!0){var a,d;if(N.value=r&&(null==(a=R.value)?void 0:a.getWidth())||150,K.shouldInitOptionList(b.value,t,r)){const[e,t]=K.transformListToChildren(b.value),r=e[Math.max(0,e.length-2)];if(b.value.length>1){_.value=t;const r=e[Math.max(0,e.length-2)];return await x(r,void 0,!1,!1),r}if(null==(d=_.value)?void 0:d.length)return r}try{return K.isClickNodeCheckbox(t)?v(t):t?t.__keyword?async function(){var r;if(!l(t.id_link))return Promise.reject(`id_link isn't string "${t.id_link}"`);const o=K.parseLinkFromString2List(t.id_link);u(C.value)&&C.value!==1/0&&o.splice(C.value);const a=await async function(e){if(!I().primaryKeyUrl)return[];try{return await m.addAsync(t(y.wordbook,y.autograph,e,i(k)))}catch(e){l(e)&&console.error(e)}function t(e,t,r,n){const i=I();return{key:n,params:{autograph:t,tableId:e.id,primaryKeyValue:r.join(","),page:1},...i,url:i.primaryKeyUrl,cache:y.requestCache,payload:{field:{},labelKey:O.value,valueKey:L.value}}}}(o);if(!a)return Promise.reject("fetchPrimaryKeyValue failed");const{lastOption:c,options:d}=K.generateOptionWithIdList(a,o,C.value);o.length<C.value&&(n&&(isNaN(+y.checkAbleLevel)||o.length>=+y.checkAbleLevel)?c&&(c.children=[]):await x(c));if(s(null==c?void 0:c.children))return b.value=e(K.sortOptionWithIdList(a,o),["parent","children"]),w.value=!1,Promise.reject("lastOption.children is empty");return _.value=d,null==(r=R.value)||r.setCursor(c),c}():async function(){const e=await m.addAsync(p(y.wordbook,y.autograph,t,i(k)));if(!e.length)return o?v(t):Promise.reject("childrenList is empty");t.children=e.map((e=>K.enrichChildOption(e,t,C.value)))}():async function(){var e;const n=await m.addAsync(p(y.wordbook,y.autograph,t,i(k)));_.value=n.map((e=>K.enrichKeywordOption(e,r))),r&&(null==(e=R.value)||e.setCursor(_.value[0]))}()}catch(e){l(e)&&console.error(e)}function v(e){return b.value=K.createOptionValue(e),w.value=!1,Promise.reject("update value success, no need to continue")}function p(e,t,n,i){const o={autograph:()=>t,wordbookId:"id",wordbookType:"type",fieldKeys:()=>e.search_key?JSON.stringify(e.search_key):void 0,conObj:()=>JSON.stringify(K.createConfigObject(e,r,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>r,page:()=>1},a=Object.entries(o).reduce(((t,[r,n])=>(t[r]=l(n)?e[n]:c(n)?n():void 0,t)),{});return{...I(),params:a,key:i,cache:y.requestCache,payload:{...g(),labelKey:O.value,valueKey:L.value}}}}return n((()=>y.wordbook),((e,t)=>{o(e,t)||(_.value=[],e&&(b.value||!y.lazyRequest)&&x())}),{immediate:!0}),{valueRef:b,labelKey:O,valueKey:L,optionsRef:_,showRef:w,fetchData:x,menuWidth:N,searchCascaderRef:R}}export{y as useLevelSearchCascader};
1
+ import{deepOmit as e}from"../utils/index.js";import"naive-ui";import{computed as t,ref as r,watch as n,unref as i}from"vue";import"@vueuse/core";import"date-fns";import{isEqual as o,noop as a,isString as l,isNumber as u,isEmpty as s,isFunction as c,cloneDeep as d,omit as v,isArray as p}from"lodash-es";import{useFormRequest as h}from"./useFormRequest/index.js";import"@vueuse/shared";import"./selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"./useScrollLoading.js";function y(y,f,{asyncQueue:m,fieldKey:k,getRequestPayload:g=a}){const b=t({get:()=>y.value,set(e){o(e,y.value)||f("update:value",e)}}),w=r(!1),_=r([]),O=t((()=>{var e,t,r;return null!=(r=null==(t=null==(e=y.wordbook)?void 0:e.show_key)?void 0:t[0])?r:y.labelField})),L=t((()=>{var e,t;return null!=(t=null==(e=y.wordbook)?void 0:e.value_key)?t:y.valueField})),j=t((()=>{var e,t;return null==(t=null==(e=y.wordbook)?void 0:e.render_key)?void 0:t[0]})),C=t((()=>{var e;return(null==(e=y.wordbook)?void 0:e.level_num)||1/0})),K=function(e,t,r){return{transformListToChildren(e){if(!e.length)return[];const t=[(e=d(e))[0]];let r=e[0];for(let t=1;t<e.length;t++){const n=e[t];n&&(r.children=[n],n.parent=r,r=n)}return[e,t]},getNodeDepth(e){let t=1,r=e.parent;for(;r;)t++,r=r.parent;return t},enrichChildOption(e,t,r){return{...e,parent:t,isLeaf:this.getNodeDepth(t)+1>=r}},enrichKeywordOption:(e,n)=>(e.__keyword=!!n,e.isLeaf=!!n,n&&r.value&&e[r.value]&&(e[t.value]=e[r.value]),e),sortOptionWithIdList:(t,r)=>r.map((r=>t.find((t=>t[e.value]===r)))),generateOptionWithIdList(t,r,n){let i=t[0];return{options:r.reduce(((e,r,a)=>{const l=o(t,r);return 0===a?(i=l,[l]):(Object.assign(l,{parent:i,isLeaf:a+1>=n}),i.children=[l],i=l,e)}),[]),lastOption:i};function o(t,r){return t.find((t=>t[e.value]===r))}},parseLinkFromString2List:e=>e.split("_").filter((e=>e)),isClickNodeCheckbox:e=>e&&!e.__keyword&&e.isLeaf,createConfigObject:(t,r,n)=>r?t.conObj||[]:n?[{con:"EQ",is_compare_field:!1,field_key:t.level_key,value:n[e.value]}]:t.conObjFirstLevel||[],createOptionValue(e){const t=[];let r=e;for(;r;)t.unshift(v(r,["parent","isLeaf","__keyword","children"])),r=r.parent;return t},shouldInitOptionList:(t,r,n)=>p(t)&&!s(t)&&t.every((t=>t[e.value]))&&!r&&!n}}(L,O,j),{getSearchRequestInfo:I}=h(),N=r(150),R=r();async function x(t,r,n,o=!0){var a,d;if(N.value=r&&(null==(a=R.value)?void 0:a.getWidth())||150,K.shouldInitOptionList(b.value,t,r)){const[e,t]=K.transformListToChildren(b.value),r=e[Math.max(0,e.length-2)];if(b.value.length>1){_.value=t;const r=e[Math.max(0,e.length-2)];return await x(r,void 0,!1,!1),r}if(null==(d=_.value)?void 0:d.length)return r}try{return K.isClickNodeCheckbox(t)?v(t):t?t.__keyword?async function(){var r;if(!l(t.id_link))return Promise.reject(`id_link isn't string "${t.id_link}"`);const o=K.parseLinkFromString2List(t.id_link);u(C.value)&&C.value!==1/0&&o.splice(C.value);const a=await async function(e){if(!I().primaryKeyUrl)return[];try{return await m.addAsync(t(y.wordbook,y.autograph,e,i(k)))}catch(e){l(e)&&console.error(e)}function t(e,t,r,n){const i=I();return{key:n,params:{autograph:t,tableId:e.id,primaryKeyValue:r.join(","),page:1},...i,url:i.primaryKeyUrl,cache:y.requestCache,payload:{field:{},labelKey:O.value,valueKey:L.value}}}}(o);if(!a)return Promise.reject("fetchPrimaryKeyValue failed");const{lastOption:c,options:d}=K.generateOptionWithIdList(a,o,C.value);o.length<C.value&&(n&&(isNaN(+y.checkAbleLevel)||o.length>=+y.checkAbleLevel)?c&&(c.children=[]):await x(c));if(s(null==c?void 0:c.children))return b.value=e(K.sortOptionWithIdList(a,o),["parent","children"]),w.value=!1,Promise.reject("lastOption.children is empty");return _.value=d,null==(r=R.value)||r.setCursor(c),c}():async function(){const e=await m.addAsync(p(y.wordbook,y.autograph,t,i(k)));if(!e.length)return o?v(t):Promise.reject("childrenList is empty");t.children=e.map((e=>K.enrichChildOption(e,t,C.value)))}():async function(){var e;const n=await m.addAsync(p(y.wordbook,y.autograph,t,i(k)));_.value=n.map((e=>K.enrichKeywordOption(e,r))),r&&(null==(e=R.value)||e.setCursor(_.value[0]))}()}catch(e){l(e)&&console.error(e)}function v(e){return b.value=K.createOptionValue(e),w.value=!1,Promise.reject("update value success, no need to continue")}function p(e,t,n,i){const o={autograph:()=>t,wordbookId:"id",wordbookType:"type",fieldKeys:()=>e.search_key?JSON.stringify(e.search_key):void 0,conObj:()=>JSON.stringify(K.createConfigObject(e,r,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>r,page:()=>1},a=Object.entries(o).reduce(((t,[r,n])=>(t[r]=l(n)?e[n]:c(n)?n():void 0,t)),{});return{...I(),params:a,key:i,cache:y.requestCache,payload:{...g(),labelKey:O.value,valueKey:L.value}}}}return n((()=>y.wordbook),((e,t)=>{o(e,t)||(_.value=[],e&&(b.value||!y.lazyRequest)&&x())}),{immediate:!0}),{valueRef:b,labelKey:O,valueKey:L,optionsRef:_,showRef:w,fetchData:x,menuWidth:N,searchCascaderRef:R}}export{y as useLevelSearchCascader};
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",s="3.2.8-release.1",i="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.8-release.1",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,i as main,e as name,n as peerDependencies,s as version};
1
+ var e="@cnhis-design-vue/shared",s="3.2.8-release.2",i="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.8-release.2",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,i as main,e as name,n as peerDependencies,s as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.2.8-release.1",
3
+ "version": "3.2.8-release.2",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -72,5 +72,5 @@
72
72
  "iOS 7",
73
73
  "last 3 iOS versions"
74
74
  ],
75
- "gitHead": "d3eace90488f1321109345c168757edff2c2d4f6"
75
+ "gitHead": "e69d31a16e5f7e00636ded4d9d4504b6f8b6156b"
76
76
  }