cnhis-design-vue 3.1.42-release.4 → 3.1.42-release.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 (151) hide show
  1. package/README.md +87 -87
  2. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  3. package/es/components/big-table/src/components/edit-form/edit-select-table.d.ts +1 -1
  4. package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
  5. package/es/components/big-table/src/hooks/useEvent.js +1 -1
  6. package/es/components/big-table/src/hooks/useFormat.js +1 -1
  7. package/es/components/big-table/src/hooks/useNestTable.js +1 -1
  8. package/es/components/big-table/src/hooks/useTableParse.js +1 -1
  9. package/es/components/big-table/src/utils.d.ts +11 -1
  10. package/es/components/big-table/src/utils.js +1 -1
  11. package/es/components/button-print/index.d.ts +28 -3
  12. package/es/components/button-print/src/ButtonPrint.vue.d.ts +28 -4
  13. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  14. package/es/components/button-print/src/utils/print.js +1 -1
  15. package/es/components/form-config/index.d.ts +48 -7
  16. package/es/components/form-config/src/FormConfig.vue.d.ts +48 -7
  17. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +14 -1
  18. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +26 -4
  19. package/es/components/form-config/src/constants/index.d.ts +8 -1
  20. package/es/components/form-config/src/constants/index.js +1 -1
  21. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  22. package/es/components/form-render/index.d.ts +14 -1
  23. package/es/components/form-render/src/FormRender.vue.d.ts +14 -1
  24. package/es/components/form-render/src/FormRender.vue.js +1 -1
  25. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +14 -1
  26. package/es/components/form-render/src/components/renderer/date.d.ts +4 -0
  27. package/es/components/form-render/src/components/renderer/date.js +1 -1
  28. package/es/components/form-render/src/components/renderer/searchCascade.d.ts +18 -0
  29. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  30. package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -0
  31. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  32. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  33. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  34. package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
  35. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  36. package/es/components/form-render/src/types/fieldItem.d.ts +8 -1
  37. package/es/components/form-render/src/types/index.d.ts +2 -2
  38. package/es/components/form-render/style/index.css +1 -1
  39. package/es/components/iho-table/index.d.ts +17 -3
  40. package/es/components/iho-table/src/IhoTable.vue.d.ts +17 -3
  41. package/es/components/iho-table/src/IhoTable.vue.js +1 -1
  42. package/es/components/iho-table/src/constants/index.d.ts +3 -2
  43. package/es/components/iho-table/src/constants/index.js +1 -1
  44. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +2 -2
  45. package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +19 -19
  46. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +60 -237
  47. package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.d.ts +1 -4
  48. package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.d.ts +4 -16
  49. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.d.ts +2 -2
  50. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.js +1 -1
  51. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  52. package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.js +1 -1
  53. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -1
  54. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +48 -0
  55. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.js +1 -0
  56. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.d.ts +1 -0
  57. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.js +1 -0
  58. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  59. package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
  60. package/es/components/iho-table/src/plugins/index.js +1 -1
  61. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
  62. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +25 -3
  63. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  64. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  65. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +2 -1
  66. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +1 -0
  67. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -1
  68. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +1 -1
  69. package/es/components/iho-table/src/plugins/rowDragPlugin/index.d.ts +1 -0
  70. package/es/components/iho-table/src/plugins/rowDragPlugin/index.js +1 -0
  71. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -1
  72. package/es/components/iho-table/src/types/index.d.ts +21 -2
  73. package/es/components/iho-table/src/types/pluginType.d.ts +13 -26
  74. package/es/components/iho-table/src/utils/index.d.ts +5 -3
  75. package/es/components/iho-table/src/utils/index.js +1 -1
  76. package/es/components/iho-table/style/index.css +1 -1
  77. package/es/components/index.css +1 -1
  78. package/es/components/index.d.ts +1 -0
  79. package/es/components/info-header/index.d.ts +29 -2
  80. package/es/components/info-header/src/InfoHeader.vue.d.ts +29 -2
  81. package/es/components/info-header/src/InfoHeader.vue.js +1 -1
  82. package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.js +1 -1
  83. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +14 -1
  84. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +15 -1
  85. package/es/components/info-header/src/components/patientInfo/index.vue.js +1 -1
  86. package/es/components/info-header/style/index.css +1 -1
  87. package/es/components/scale-view/index.d.ts +9 -130
  88. package/es/components/scale-view/index.js +1 -1
  89. package/es/components/scale-view/src/ScaleView.vue.d.ts +8 -130
  90. package/es/components/scale-view/src/ScaleView.vue.js +1 -1
  91. package/es/components/scale-view/src/components/AnswerParse.vue.d.ts +1 -43
  92. package/es/components/scale-view/src/components/AnswerParse.vue.js +1 -1
  93. package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +0 -42
  94. package/es/components/scale-view/src/components/EvaluateCountdown.vue.js +1 -1
  95. package/es/components/scale-view/src/components/formitem/r-address.js +1 -1
  96. package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
  97. package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
  98. package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
  99. package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
  100. package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +4 -4
  101. package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
  102. package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
  103. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  104. package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
  105. package/es/components/scale-view/src/hooks/scaleview-submit.d.ts +5 -1
  106. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  107. package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
  108. package/es/components/scale-view/src/hooks/use-evaluate.js +1 -1
  109. package/es/components/scale-view/src/hooks/use-event.js +1 -1
  110. package/es/components/scale-view/src/types/index.d.ts +7 -0
  111. package/es/components/scale-view/src/types/index.js +1 -0
  112. package/es/components/scale-view/style/index.css +1 -1
  113. package/es/components/scale-view/style/scale-view-iconfont.ttf +0 -0
  114. package/es/components/search-cascader/index.d.ts +12 -1
  115. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +12 -1
  116. package/es/components/search-cascader/src/SearchCascader.vue.js +1 -1
  117. package/es/components/search-cascader/src/components/SearchMenu.d.ts +8 -1
  118. package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
  119. package/es/components/search-cascader/src/constants/index.d.ts +1 -0
  120. package/es/components/search-cascader/src/constants/index.js +1 -1
  121. package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
  122. package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
  123. package/es/components/select-person/index.d.ts +57 -9
  124. package/es/components/select-person/src/SearchMultiple.vue.d.ts +125 -0
  125. package/es/components/select-person/src/SelectPerson.vue.d.ts +43 -7
  126. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  127. package/es/components/select-person/src/utils/index.js +1 -1
  128. package/es/components/select-person/style/index.css +1 -1
  129. package/es/components/shortcut-setter/index.d.ts +18 -2
  130. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +18 -2
  131. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.js +1 -1
  132. package/es/env.d.ts +25 -24
  133. package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
  134. package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.js +1 -1
  135. package/es/shared/package.json.js +1 -0
  136. package/es/shared/utils/anime.d.ts +1 -1
  137. package/es/shared/utils/anime.js +1 -1
  138. package/es/shared/utils/index.d.ts +3 -14
  139. package/es/shared/utils/index.js +1 -1
  140. package/es/shared/utils/vexutils.d.ts +2 -2
  141. package/es/shared/utils/vexutils.js +1 -1
  142. package/es/shared/utils/vexutilsExpand.d.ts +254 -0
  143. package/es/shared/utils/vexutilsExpand.js +1 -0
  144. package/package.json +2 -2
  145. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  146. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  147. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  148. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  149. package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
  150. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  151. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1 +1 @@
1
- import{handleQueryParams as e,getQueryVariable as t}from"../utils/judge-types.js";import a from"./use-noData.js";import n from"xe-utils";import"moment";import{componentMap as i}from"./use-component.js";import{useEvent as l}from"./use-event.js";import{ScaleViewComputed as s}from"./scaleview-computed.js";import{ScaleViewValidate as r}from"./scaleview-validate.js";import{useDialog as o}from"naive-ui";const u=(u,v,c,f)=>{const d=o(),{setNoData:m}=a(),{hasEvaluateResultSetting:p,hasparamsEvaluate:g,hasDefault:S,formKey:C}=s(u,v,f),{formatRules:E}=r(u,v,f),{nextLogicEvent:O}=l(u,v),A=e=>{const t=null==e?void 0:e.evaluateStartTime;t&&!n.isValidDate(new Date(t))&&n.isValidDate(new Date(Number(t)))&&(e.evaluateStartTime=Number(t))},y=()=>{var t;if(!p.value)return!!S.value&&("evaluateResultSetting"in v.config||(v.config.evaluateResultSetting={}),(t=>{let a=e();g.value&&(a=v.paramsEvaluate),a.evaname&&(t.evaluateName=a.evaname),a.evadesc&&(t.evaluateExplain=a.evadesc),a.evast&&(t.evaluateStartTime=a.evast),a.evadur&&(t.evaluateTime=a.evadur),a.evaan&&("true"===a.evaan||a.evaan,t.evaluateAnswer=a.evaan),A(t)})(v.config.evaluateResultSetting),v.showEvaluatePage=!0,void(v.showEvaluateCountdownWrap=!0));const{evaluateResultSetting:a={}}=v.config;if(!a||!Object.keys(a).length)return;v.showEvaluateCountdownWrap=!0;const{evaluateStartTime:i}=a,{evaluateName:l}=(null==(t=v.originConfig)?void 0:t.evaluateResultSetting)||{};if(i)return!(!n.isValidDate(new Date(i))&&!l)&&void(v.showEvaluatePage=!0);v.showEvaluatePage=!0},h=(e,t)=>{const a=e.find((e=>t===e.value));return a?a.key:t},R=(e,t)=>{if(["RADIO_BLOCK","CHECKBOX_BLOCK"].includes(t)&&e&&(e&&n.isJSON(e)&&(e=JSON.parse(e)),e.length))return!0},L=t=>{var a,i;if(!t||!t.length)return;const l=e();if((null==u?void 0:u.noBtn)||(null==l?void 0:l.noBtn))return;const s=t.find((e=>"FRONT_ADDRESS"===e.type));if(!s||!Object.keys(s).length)return;let r;if(s.setting&&n.isJSON(s.setting)&&(r=JSON.parse(s.setting)),!r||!Object.keys(r).length)return;if(1==(null==l?void 0:l.redirect)||1==(null==(a=u.params)?void 0:a.redirect)||3==l.isEdit||3==(null==(i=u.params)?void 0:i.isEdit))return;const{frontAddress:o}=r;if(o){const e=window.location.href;let t="?";o.includes("?")&&(t="&");return`${o}${t}redirect_url=${encodeURIComponent(e)}`}},N=e=>{const t=["evaname","evadesc","evast","evadur","evaan"],a={};for(const n in e){const i=e[n];t.includes(n)&&i&&(a[n]=i)}return a},b=t=>{if(!t||!Object.keys(t).length)return;let a=e()||{};g.value&&(a=v.paramsEvaluate);const n={evaluateName:"evaname",evaluateExplain:"evadesc",evaluateStartTime:"evast",evaluateTime:"evadur",evaluateAnswer:"evaan"};for(const e in t){const i=t[e];if(i&&"evaluateAnswer"!=e&&"string"==typeof i&&i.includes("${")){const n=i.replace(/\$\{([^}]+)\}/g,((e,t)=>{let n;return t.startsWith("form.")&&(n=a[t.split(".")[1]]),n||""}));t[e]=n}else{let i=a[n[e]];"evaluateAnswer"==e&&(i="true"===i||1==i),a[n[e]]&&(t[e]=i)}}if(S.value){const e={evaname:"evaluateName",evadesc:"evaluateExplain",evast:"evaluateStartTime",evadur:"evaluateTime",evaan:"evaluateAnswer"};["evaname","evadesc","evast","evadur","evaan"].forEach((n=>{const i=e[n];if(!t[i]){let e=a[n];"evaan"==n&&(e="true"===e||1==e),a[n]&&(t[i]=e)}}))}A(t)},T=e=>{let t=1;return e.map((a=>{const l=C(a);(l||"").replace(/\n/g,""),a.showTitle=a.title,a.val_key=l,a.renderCom=i[a.type],a.isShow=!0,Object.keys(a).forEach((e=>{n.isJSON(a[e])&&"LOCATION"!=a.type&&(a[e]=JSON.parse(a[e]))}));var s;return["LINEBAR","TITLE","PROMPT","IMGCARD","RICH_TEXT"].indexOf(a.type)<0&&!a.hide&&(a.softcode=t++),("SELECT"==(s=a.type)||"RADIO_BLOCK"==s||"CHECKBOX_BLOCK"==s||"SEARCH_CASCADE"==s||"EVALUATE_RADIO_BLOCK"==s||"EVALUATE_CHECKBOX_BLOCK"==s||"EVALUATE_SELECT"==s)&&(((e,t)=>{R(e,t)&&e.forEach(((e,t)=>{"other"!==e.key&&(e.key=t+1),(e.prefix||e.suffix)&&(e.value=e.prefix||e.suffix)}))})(a.options,a.type),"SEARCH_CASCADE"!=a.type&&(a.dbValue?O(a.dbValue,a,e):a.setting.defaultValue&&O(a.setting.defaultValue,a,e))),a})).map((t=>(((e,t)=>{const a=n.isString(t.relationLogic)?JSON.parse(t.relationLogic):t.relationLogic,{condition:i}=a||{};i&&i.length&&(i.forEach((t=>{const a=e.find((e=>e.seq==t.subject_seq));if(!a)return;if(!R(a.options,a.type))return;let n=t.value;Array.isArray(n)?(n=n.map((e=>h(a.options,e))),t.value=n):t.value=h(a.options,n)})),t.relationLogic=a)})(e,t),(e=>{const{nextLogic:t,options:a,type:n}=e||{};if(!t||!R(a,n))return;const{condition:i}=t||{};i&&i.length&&i.forEach((e=>{let t=e.value;Array.isArray(t)?(t=t.map((e=>h(a,e))),e.value=t):e.value=h(a,t)}))})(t),"CHECKBOX_BLOCK"===t.type&&t.dbValue&&!Array.isArray(t.dbValue)&&"customList"===u.type&&(t.dbValue=t.dbValue.split(",").filter((e=>!!e))),t)))},w=e=>{const a={};let i;return e.forEach((e=>{var l,s,r,o;const c=e.val_key,{type:f}=e;let d;if(e.dbValue)d=e.dbValue;else if(3==(null==(l=e.setting)?void 0:l.defValType)){const a=null==(r=null==(s=e.setting)?void 0:s.outDefaultValue)?void 0:r.urlKey;if(a){const n=a.split(",");if(n.length>1){const e=n.map((e=>{const a=t(e,v,u.params);return a?decodeURIComponent(a):null})).filter(Boolean);e.length&&(d=e)}else{let a=t(n[0],v,u.params);a&&(a=decodeURIComponent(a),d="CHECKBOX_BLOCK"==e.type?a.split():a)}}}switch(f){case"LOCATION":a[c]=d||"";break;case"SEARCH_CASCADE":case"UPFILE":case"UPPICTURE":a[c]=d||[];break;case"ADDRESS":a[c]=d||"",v.defaultAddress=d||{};break;case"LABEL":a[c]=d||{},n.isObject(d)?v.labelSelectedList=(null==d?void 0:d.labels)||[]:Array.isArray(d)?v.labelSelectedList=d:v.labelSelectedList=[];break;case"TITLE":a[c]=e.title;break;case"IMGCARD":a[c]=(null==(o=e.setting)?void 0:o.imgUrl)||"";break;case"CHECKBOX_BLOCK":d&&!Array.isArray(d)&&"customList"===u.type?a[c]=d.split(",").filter((e=>!!e)):(i=d||e.setting.defaultValue,n.isJSON(i)&&(i=JSON.parse(i)),a[c]=i);break;default:i=d||e.setting.defaultValue,n.isJSON(i)&&(i=JSON.parse(i)),a[c]=i}})),a};return{initForm:e=>{var t;let{list:a=[],map:i={},isFinished:l=!1}=e;const s=L(a);if(s)return void(window.location.href=s);if(i.maxScore&&(v.maxScore=i.maxScore),v.isFinished=l,e.isNotFilled)return v.spinning=!1,v.hasFrontAddress=!1,void m(!0,"未查询到量表填写记录");if(e.isLackCustomer&&d.info({title:"已设置填写次数限制",content:"请在包含用户信息的环境中打开此量表",maskClosable:!1,onPositiveClick(){c("onCloseSetting")}}),v.config=i,"evaluateResultConfig"in i&&n.isJSON(i.evaluateResultConfig)&&(v.config.evaluateResultConfig=JSON.parse(i.evaluateResultConfig)),"evaluateResultSetting"in i&&n.isJSON(i.evaluateResultSetting)&&(v.config.evaluateResultSetting=JSON.parse(i.evaluateResultSetting),(null==(t=v.config)?void 0:t.randomId)&&v.config.evaluateResultSetting&&(v.config.evaluateResultSetting.evaluateName=v.config.name,v.config.evaluateResultSetting.evaluateExplain=v.config.remark)),v.originConfig=JSON.parse(JSON.stringify(v.config)),u.params&&Object.keys(u.params).length){const e=N(u.params);e&&Object.keys(e).length&&(v.paramsEvaluate=e)}b(v.config.evaluateResultSetting),y(),v.defaultFormArray=JSON.parse(JSON.stringify(a));const r=v.filterArr;a=a.filter((e=>!r.includes(e.type))),v.formArray=T(a||[]),v.form=w(v.formArray),v.rules=E(v.formArray),v.fontSize=e.fontSize,v.spinning=!1,v.hasFrontAddress=!1}}};export{u as ScaleViewInit};
1
+ import{handleQueryParams as e,getQueryVariable as t}from"../utils/judge-types.js";import a from"./use-noData.js";import"xe-utils";import"moment";import i from"../../../../shared/utils/vexutilsExpand.js";import{componentMap as n}from"./use-component.js";import{useEvent as l}from"./use-event.js";import{ScaleViewComputed as s}from"./scaleview-computed.js";import{ScaleViewValidate as r}from"./scaleview-validate.js";import{useDialog as o}from"naive-ui";const u=(u,v,c,f)=>{const d=o(),{setNoData:m}=a(),{hasEvaluateResultSetting:p,hasparamsEvaluate:g,hasDefault:S,formKey:E}=s(u,v,f),{formatRules:C}=r(u,v,f),{nextLogicEvent:O}=l(u,v),A=e=>{const t=null==e?void 0:e.evaluateStartTime;t&&!i.isValidDate(new Date(t))&&i.isValidDate(new Date(Number(t)))&&(e.evaluateStartTime=Number(t))},y=()=>{var t;if(!p.value)return!!S.value&&("evaluateResultSetting"in v.config||(v.config.evaluateResultSetting={}),(t=>{let a=e();g.value&&(a=v.paramsEvaluate),a.evaname&&(t.evaluateName=a.evaname),a.evadesc&&(t.evaluateExplain=a.evadesc),a.evast&&(t.evaluateStartTime=a.evast),a.evadur&&(t.evaluateTime=a.evadur),a.evaan&&("true"===a.evaan||a.evaan,t.evaluateAnswer=a.evaan),A(t)})(v.config.evaluateResultSetting),v.showEvaluatePage=!0,void(v.showEvaluateCountdownWrap=!0));const{evaluateResultSetting:a={}}=v.config;if(!a||!Object.keys(a).length)return;v.showEvaluateCountdownWrap=!0;const{evaluateStartTime:n}=a,{evaluateName:l}=(null==(t=v.originConfig)?void 0:t.evaluateResultSetting)||{};if(n)return!(!i.isValidDate(new Date(n))&&!l)&&void(v.showEvaluatePage=!0);v.showEvaluatePage=!0},h=(e,t)=>{const a=e.find((e=>t===e.value));return a?a.key:t},R=(e,t)=>{if(["RADIO_BLOCK","CHECKBOX_BLOCK"].includes(t)&&e&&(e&&i.isJSON(e)&&(e=JSON.parse(e)),e.length))return!0},L=t=>{var a,n;if(!t||!t.length)return;const l=e();if((null==u?void 0:u.noBtn)||(null==l?void 0:l.noBtn))return;const s=t.find((e=>"FRONT_ADDRESS"===e.type));if(!s||!Object.keys(s).length)return;let r;if(s.setting&&i.isJSON(s.setting)&&(r=JSON.parse(s.setting)),!r||!Object.keys(r).length)return;if(1==(null==l?void 0:l.redirect)||1==(null==(a=u.params)?void 0:a.redirect)||3==l.isEdit||3==(null==(n=u.params)?void 0:n.isEdit))return;const{frontAddress:o}=r;if(o){const e=window.location.href;let t="?";o.includes("?")&&(t="&");return`${o}${t}redirect_url=${encodeURIComponent(e)}`}},N=e=>{const t=["evaname","evadesc","evast","evadur","evaan"],a={};for(const i in e){const n=e[i];t.includes(i)&&n&&(a[i]=n)}return a},b=t=>{if(!t||!Object.keys(t).length)return;let a=e()||{};g.value&&(a=v.paramsEvaluate);const i={evaluateName:"evaname",evaluateExplain:"evadesc",evaluateStartTime:"evast",evaluateTime:"evadur",evaluateAnswer:"evaan"};for(const e in t){const n=t[e];if(n&&"evaluateAnswer"!=e&&"string"==typeof n&&n.includes("${")){const i=n.replace(/\$\{([^}]+)\}/g,((e,t)=>{let i;return t.startsWith("form.")&&(i=a[t.split(".")[1]]),i||""}));t[e]=i}else{let n=a[i[e]];"evaluateAnswer"==e&&(n="true"===n||1==n),a[i[e]]&&(t[e]=n)}}if(S.value){const e={evaname:"evaluateName",evadesc:"evaluateExplain",evast:"evaluateStartTime",evadur:"evaluateTime",evaan:"evaluateAnswer"};["evaname","evadesc","evast","evadur","evaan"].forEach((i=>{const n=e[i];if(!t[n]){let e=a[i];"evaan"==i&&(e="true"===e||1==e),a[i]&&(t[n]=e)}}))}A(t)},T=e=>{let t=1;return e.map((a=>{const l=E(a);(l||"").replace(/\n/g,""),a.showTitle=a.title,a.val_key=l,a.renderCom=n[a.type],a.isShow=!0,Object.keys(a).forEach((e=>{i.isJSON(a[e])&&"LOCATION"!=a.type&&(a[e]=JSON.parse(a[e]))}));var s;return["LINEBAR","TITLE","PROMPT","IMGCARD","RICH_TEXT"].indexOf(a.type)<0&&!a.hide&&(a.softcode=t++),("SELECT"==(s=a.type)||"RADIO_BLOCK"==s||"CHECKBOX_BLOCK"==s||"SEARCH_CASCADE"==s||"EVALUATE_RADIO_BLOCK"==s||"EVALUATE_CHECKBOX_BLOCK"==s||"EVALUATE_SELECT"==s)&&(((e,t)=>{R(e,t)&&e.forEach(((e,t)=>{"other"!==e.key&&(e.key=t+1),(e.prefix||e.suffix)&&(e.value=e.prefix||e.suffix)}))})(a.options,a.type),"SEARCH_CASCADE"!=a.type&&(a.dbValue?O(a.dbValue,a,e):a.setting.defaultValue&&O(a.setting.defaultValue,a,e))),a})).map((t=>(((e,t)=>{const a=i.isString(t.relationLogic)?JSON.parse(t.relationLogic):t.relationLogic,{condition:n}=a||{};n&&n.length&&(n.forEach((t=>{const a=e.find((e=>e.seq==t.subject_seq));if(!a)return;if(!R(a.options,a.type))return;let i=t.value;Array.isArray(i)?(i=i.map((e=>h(a.options,e))),t.value=i):t.value=h(a.options,i)})),t.relationLogic=a)})(e,t),(e=>{const{nextLogic:t,options:a,type:i}=e||{};if(!t||!R(a,i))return;const{condition:n}=t||{};n&&n.length&&n.forEach((e=>{let t=e.value;Array.isArray(t)?(t=t.map((e=>h(a,e))),e.value=t):e.value=h(a,t)}))})(t),"CHECKBOX_BLOCK"===t.type&&t.dbValue&&!Array.isArray(t.dbValue)&&"customList"===u.type&&(t.dbValue=t.dbValue.split(",").filter((e=>!!e))),t)))},w=e=>{const a={};let n;return e.forEach((e=>{var l,s,r,o;const c=e.val_key,{type:f}=e;let d;if(e.dbValue)d=e.dbValue;else if(3==(null==(l=e.setting)?void 0:l.defValType)){const a=null==(r=null==(s=e.setting)?void 0:s.outDefaultValue)?void 0:r.urlKey;if(a){const i=a.split(",");if(i.length>1){const e=i.map((e=>{const a=t(e,v,u.params);return a?decodeURIComponent(a):null})).filter(Boolean);e.length&&(d=e)}else{let a=t(i[0],v,u.params);a&&(a=decodeURIComponent(a),d="CHECKBOX_BLOCK"==e.type?a.split():a)}}}switch(f){case"LOCATION":a[c]=d||"";break;case"SEARCH_CASCADE":case"UPFILE":case"UPPICTURE":a[c]=d||[];break;case"ADDRESS":a[c]=d||"",v.defaultAddress=d||{};break;case"LABEL":a[c]=d||{},i.isObject(d)?v.labelSelectedList=(null==d?void 0:d.labels)||[]:Array.isArray(d)?v.labelSelectedList=d:v.labelSelectedList=[];break;case"TITLE":a[c]=e.title;break;case"IMGCARD":a[c]=(null==(o=e.setting)?void 0:o.imgUrl)||"";break;case"CHECKBOX_BLOCK":d&&!Array.isArray(d)&&"customList"===u.type?a[c]=d.split(",").filter((e=>!!e)):(n=d||e.setting.defaultValue,i.isJSON(n)&&(n=JSON.parse(n)),a[c]=n);break;default:n=d||e.setting.defaultValue,i.isJSON(n)&&(n=JSON.parse(n)),a[c]=n}})),a};return{initForm:e=>{var t;let{list:a=[],map:n={},isFinished:l=!1}=e;const s=L(a);if(s)return void(window.location.href=s);if(n.maxScore&&(v.maxScore=n.maxScore),v.isFinished=l,e.isNotFilled)return v.spinning=!1,v.hasFrontAddress=!1,void m(!0,"未查询到量表填写记录");if(e.isLackCustomer&&d.info({title:"已设置填写次数限制",content:"请在包含用户信息的环境中打开此量表",maskClosable:!1,onPositiveClick(){c("onCloseSetting")}}),v.config=n,"evaluateResultConfig"in n&&i.isJSON(n.evaluateResultConfig)&&(v.config.evaluateResultConfig=JSON.parse(n.evaluateResultConfig)),"evaluateResultSetting"in n&&i.isJSON(n.evaluateResultSetting)&&(v.config.evaluateResultSetting=JSON.parse(n.evaluateResultSetting),(null==(t=v.config)?void 0:t.randomId)&&v.config.evaluateResultSetting&&(v.config.evaluateResultSetting.evaluateName=v.config.name,v.config.evaluateResultSetting.evaluateExplain=v.config.remark)),v.originConfig=JSON.parse(JSON.stringify(v.config)),u.params&&Object.keys(u.params).length){const e=N(u.params);e&&Object.keys(e).length&&(v.paramsEvaluate=e)}b(v.config.evaluateResultSetting),y(),v.defaultFormArray=JSON.parse(JSON.stringify(a));const r=v.filterArr;a=a.filter((e=>!r.includes(e.type))),v.formArray=T(a||[]),v.form=w(v.formArray),v.rules=C(v.formArray),v.fontSize=e.fontSize,v.spinning=!1,v.hasFrontAddress=!1}}};export{u as ScaleViewInit};
@@ -1,3 +1,7 @@
1
1
  export declare const ScaleViewSubmit: (props: any, state: any, emit: any, config: any) => {
2
- submitMethod: () => void;
2
+ submitMethod: () => {
3
+ params: any;
4
+ hasCallbackItem: any;
5
+ isCallback: boolean;
6
+ };
3
7
  };
@@ -1 +1 @@
1
- import{isOnlyOptions as t,getQueryVariable as e}from"../utils/judge-types.js";import i from"xe-utils";import s from"moment";import{ScaleViewComputed as r}from"./scaleview-computed.js";const o=(o,n,a,f)=>{const{showEvent:p,formKey:m}=r(o,n,f),d=()=>{const e=Object.assign({},n.form,n.submitForm),i={};if(!Object.keys(e).length)return{};for(const r in e){const a=n.formArray.find((t=>m(t)==r));if(r&&a){let f;if(a&&a.databaseTitle&&(f=a.databaseTitle),"customList"==o.type&&a&&a.setting&&1!=a.setting.startToStop&&e[r]&&"DATETIME"==a.type&&(a.setting&&"time"==a.setting.dateType&&e[r]&&(e[r]=s().format("YYYY-MM-DD ")+e[r]),a.setting&&"date"==a.setting.dateType&&e[r]&&(e[r]=s(e[r]).format("YYYY-MM-DD ")+s().format("HH:mm:ss"))),i[f||r]=e[r]?e[r]:null,t(a.type)){const{options:t}=a,s=a.val_key,o=n.choiceComObj[s],f=e[r];if("RADIO_BLOCK"===a.type&&f&&(i[s]=c(f,t,o)),"CHECKBOX_BLOCK"===a.type&&(null==f?void 0:f.length)){const e=u(f,t,o);i[s]=e}}}else i[r]=e[r]}return console.log("res",i),i},u=(t,e,i)=>{const s=[];let r,o=0;for(;o<t.length;o++){r=t[o];const n=e.find(((t,e)=>e+1===r));if(n&&!n.prefix&&!n.suffix){s.push(n.value);continue}const a=c(r,e,i);s.push(a)}return s},c=(t,e,i)=>{const{othersText:s,optionsPreSuffixObj:r={}}=i||{};if("other"===t)return s||"其他";const o=e.find(((e,i)=>i+1===t));if(!o)return;if(!o.prefix&&!o.suffix)return o.value;let n=r[t]||"";return o.prefix?n=o.prefix+n:n+=o.suffix,n};return{submitMethod:()=>{const t=n.defaultFormArray.find((t=>"SPREAD_PARAMS"===t.type));if(t){i.isJSON(t.setting)&&(t.setting=JSON.parse(t.setting));const s=m(t);n.submitForm[s]=t.setting.spreadParams.domains.map((t=>{const i={};return"1"==t.valueType?i[t.name]=t.value:"2"==t.valueType&&(i[t.name]=e(t.value,n,o.params)),i}))}const s=n.defaultFormArray.find((t=>"CHECKBOX_BLOCK"==t.type));s&&Array.isArray(n.form[s.title])&&"customList"===o.type&&(n.form[s.title]=n.form[s.title].join(","));const r=d();let f;if("customList"===o.type)f={definedListId:o.ids.guage_id,dbId:o.ids.db_id,scoreJson:JSON.stringify(r)};else{const{guageId:t,randomId:e}=n.config;f=Object.assign(o.params,{guageId:t,scoreJson:JSON.stringify(r),randomId:e})}n.shareId&&(f.shareId=n.shareId);const u=n.defaultFormArray.find((t=>"SUCCESS_TIP"===t.type));if(u){const t=i.isJSON(u.setting)?JSON.parse(u.setting):u.setting;f.tipSetting=JSON.stringify({tipMode:t.tipMode,tipType:t.tipType,tipText:t.tipText,tipApi:t.tipApi})}const c=n.defaultFormArray.find((t=>"CALLBACK_INTERFACE"===t.type));let l=!1;c&&(l=p(c,!0)),a("onSubmit",f,c,l)}}};export{o as ScaleViewSubmit};
1
+ import{isOnlyOptions as t,getQueryVariable as e}from"../utils/judge-types.js";import"xe-utils";import i from"moment";import s from"../../../../shared/utils/vexutilsExpand.js";import{ScaleViewComputed as r}from"./scaleview-computed.js";const n=(n,o,a,f)=>{const{showEvent:p,formKey:m}=r(n,o,f),d=()=>{const e=Object.assign({},o.form,o.submitForm),s={};if(!Object.keys(e).length)return{};for(const r in e){const a=o.formArray.find((t=>m(t)==r));if(r&&a){let f;if(a&&a.databaseTitle&&(f=a.databaseTitle),"customList"==n.type&&a&&a.setting&&1!=a.setting.startToStop&&e[r]&&"DATETIME"==a.type&&(a.setting&&"time"==a.setting.dateType&&e[r]&&(e[r]=i().format("YYYY-MM-DD ")+e[r]),a.setting&&"date"==a.setting.dateType&&e[r]&&(e[r]=i(e[r]).format("YYYY-MM-DD ")+i().format("HH:mm:ss"))),s[f||r]=e[r]?e[r]:null,t(a.type)){const{options:t}=a,i=a.val_key,n=o.choiceComObj[i],f=e[r];if("RADIO_BLOCK"===a.type&&f&&(s[i]=l(f,t,n)),"CHECKBOX_BLOCK"===a.type&&(null==f?void 0:f.length)){const e=u(f,t,n);s[i]=e}}}else s[r]=e[r]}return s},u=(t,e,i)=>{const s=[];let r,n=0;for(;n<t.length;n++){r=t[n];const o=e.find(((t,e)=>e+1===r));if(o&&!o.prefix&&!o.suffix){s.push(o.value);continue}const a=l(r,e,i);s.push(a)}return s},l=(t,e,i)=>{const{othersText:s,optionsPreSuffixObj:r={}}=i||{};if("other"===t)return s||"其他";const n=e.find(((e,i)=>i+1===t));if(!n)return;if(!n.prefix&&!n.suffix)return n.value;let o=r[t]||"";return n.prefix?o=n.prefix+o:o+=n.suffix,o};return{submitMethod:()=>{const t=o.defaultFormArray.find((t=>"SPREAD_PARAMS"===t.type));if(t){s.isJSON(t.setting)&&(t.setting=JSON.parse(t.setting));const i=m(t);o.submitForm[i]=t.setting.spreadParams.domains.map((t=>{const i={};return"1"==t.valueType?i[t.name]=t.value:"2"==t.valueType&&(i[t.name]=e(t.value,o,n.params)),i}))}const i=o.defaultFormArray.find((t=>"CHECKBOX_BLOCK"==t.type));i&&Array.isArray(o.form[i.title])&&"customList"===n.type&&(o.form[i.title]=o.form[i.title].join(","));const r=d();let a;if("customList"===n.type)a={definedListId:n.ids.guage_id,dbId:n.ids.db_id,scoreJson:JSON.stringify(r)};else{const{guageId:t,randomId:e}=o.config;a=Object.assign(n.params,{guageId:t,scoreJson:JSON.stringify(r),randomId:e})}o.shareId&&(a.shareId=o.shareId);const f=o.defaultFormArray.find((t=>"SUCCESS_TIP"===t.type));if(f){const t=s.isJSON(f.setting)?JSON.parse(f.setting):f.setting;a.tipSetting=JSON.stringify({tipMode:t.tipMode,tipType:t.tipType,tipText:t.tipText,tipApi:t.tipApi})}const u=o.defaultFormArray.find((t=>"CALLBACK_INTERFACE"===t.type));let l=!1;u&&(l=p(u,!0));return{params:a,hasCallbackItem:u,isCallback:l}}}};export{n as ScaleViewSubmit};
@@ -1 +1 @@
1
- import e from"xe-utils";import"moment";import{ScaleViewComputed as r}from"./scaleview-computed.js";const t=(t,i,n)=>{const{formKey:s}=r(t,i,n),o=(e,r)=>{let{address:t}=r||{};return!!t||new Error("必填")},l=(e,r)=>{if(!r||!Object.keys(r).length)return new Error("必填");let{labelStr:t,labels:i=[]}=r;return!(!t||!i.length)||new Error("必填")},a=(e,r)=>{let t=(i=r,Object.prototype.toString.call(i));var i;if("[object Object]"==t){if(r&&Object.keys(r).length)return!0}else if("[object Array]"==t){if(r&&r.length)return!0}else if("[object Number]"==t){if(r||0===r)return!0}else if(r)return!0;return new Error("必填")},u=["LABEL","ADDRESS"];return{formatRules:r=>{const n={};return r.forEach((r=>{let c=r.val_key;if(n[c]=[],r.required&&!u.includes(r.type)&&n[c].push({required:r.required,message:"必填",trigger:"change",validator:a}),"MOBILE"==r.type&&r.validation)n[c].push({pattern:/^1[3456789]\d{9}$/,message:"格式错误",trigger:"blur"});else if("ID_CARD"==r.type&&r.validation)n[c].push({pattern:/^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9]|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}))$/,message:"格式错误",trigger:"blur"});else if("ADDRESS"==r.type&&r.required)(r=>{let t={addressType:"province-city-district-address"};return t=e.isJSON(r.setting)?JSON.parse(r.setting):r.setting,t.addressType.includes("address")})(r)&&n[c].push({validator:o,trigger:"change"});else if("LABEL"==r.type&&r.required)n[c].push({validator:l,trigger:"change"});else if("DATETIME"==r.type&&"customList"==t.type){let t=(r=>{let t=r.setting;return e.isJSON(t)&&(t=JSON.parse(t)),t.dateMaxType})(r);if(!t)return;let i={1:"checkDateMaxCur",2:"checkDateMaxSet",3:"checkDateMaxOther"};n[c].push({validator:(e,n)=>i[t](e,n,r),trigger:"change"})}else"RADIO_BLOCK"===r.type?(i.choiceComObj[s(r)]={},n[c].push({validator:(e,t)=>((e,r,t)=>{if(!r)return!0;let{options:n}=t;if(!n.length||"other"===r)return!0;const o=s(t);let{optionsPreSuffixObj:l={}}=i.choiceComObj[o]||{},a=n.find(((e,t)=>t+1===r));if(!a||a.importability)return!0;if((a.prefix||a.suffix)&&!l[r])return new Error("请完善选项");return!0})(0,t,r),trigger:["change","blur"]})):"CHECKBOX_BLOCK"===r.type&&(i.choiceComObj[s(r)]={},n[c].push({validator:(e,t)=>((e,r,t)=>{if(!r||!r.length)return!0;let{options:n}=t;if(!n.length)return!0;let o,l=0,a=r.length;const u=s(t);let{optionsPreSuffixObj:c={}}=i.choiceComObj[u]||{};for(;l<a;l++){if(o=r[l],"other"===o)continue;let e=n.find(((e,r)=>r+1===o));if(e&&!e.importability&&(e.prefix||e.suffix)&&!c[o])return new Error("请完善选项")}return!0})(0,t,r),trigger:["change","blur"]}))})),n}}};export{t as ScaleViewValidate};
1
+ import"xe-utils";import"moment";import e from"../../../../shared/utils/vexutilsExpand.js";import{ScaleViewComputed as r}from"./scaleview-computed.js";const t=(t,i,n)=>{const{formKey:s}=r(t,i,n),o=(e,r)=>{let{address:t}=r||{};return!!t||new Error("必填")},l=(e,r)=>{if(!r||!Object.keys(r).length)return new Error("必填");let{labelStr:t,labels:i=[]}=r;return!(!t||!i.length)||new Error("必填")},a=(e,r)=>{let t=(i=r,Object.prototype.toString.call(i));var i;if("[object Object]"==t){if(r&&Object.keys(r).length)return!0}else if("[object Array]"==t){if(r&&r.length)return!0}else if("[object Number]"==t){if(r||0===r)return!0}else if(r)return!0;return new Error("必填")},u=["LABEL","ADDRESS"];return{formatRules:r=>{const n={};return r.forEach((r=>{let c=r.val_key;if(n[c]=[],r.required&&!u.includes(r.type)&&n[c].push({required:r.required,message:"必填",trigger:"change",validator:a}),"MOBILE"==r.type&&r.validation)n[c].push({pattern:/^1[3456789]\d{9}$/,message:"格式错误",trigger:"blur"});else if("ID_CARD"==r.type&&r.validation)n[c].push({pattern:/^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9]|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}))$/,message:"格式错误",trigger:"blur"});else if("ADDRESS"==r.type&&r.required)(r=>{let t={addressType:"province-city-district-address"};return t=e.isJSON(r.setting)?JSON.parse(r.setting):r.setting,t.addressType.includes("address")})(r)&&n[c].push({validator:o,trigger:"change"});else if("LABEL"==r.type&&r.required)n[c].push({validator:l,trigger:"change"});else if("DATETIME"==r.type&&"customList"==t.type){let t=(r=>{let t=r.setting;return e.isJSON(t)&&(t=JSON.parse(t)),t.dateMaxType})(r);if(!t)return;let i={1:"checkDateMaxCur",2:"checkDateMaxSet",3:"checkDateMaxOther"};n[c].push({validator:(e,n)=>i[t](e,n,r),trigger:"change"})}else"RADIO_BLOCK"===r.type?(i.choiceComObj[s(r)]={},n[c].push({validator:(e,t)=>((e,r,t)=>{if(!r)return!0;let{options:n}=t;if(!n.length||"other"===r)return!0;const o=s(t);let{optionsPreSuffixObj:l={}}=i.choiceComObj[o]||{},a=n.find(((e,t)=>t+1===r));if(!a||a.importability)return!0;if((a.prefix||a.suffix)&&!l[r])return new Error("请完善选项");return!0})(0,t,r),trigger:["change","blur"]})):"CHECKBOX_BLOCK"===r.type&&(i.choiceComObj[s(r)]={},n[c].push({validator:(e,t)=>((e,r,t)=>{if(!r||!r.length)return!0;let{options:n}=t;if(!n.length)return!0;let o,l=0,a=r.length;const u=s(t);let{optionsPreSuffixObj:c={}}=i.choiceComObj[u]||{};for(;l<a;l++){if(o=r[l],"other"===o)continue;let e=n.find(((e,r)=>r+1===o));if(e&&!e.importability&&(e.prefix||e.suffix)&&!c[o])return new Error("请完善选项")}return!0})(0,t,r),trigger:["change","blur"]}))})),n}}};export{t as ScaleViewValidate};
@@ -1 +1 @@
1
- import{reactive as e,computed as t,onMounted as u,onUnmounted as n}from"vue";import a from"moment";import r from"xe-utils";const i=(i,l,o)=>{const{emit:v}=o,s=e({totalLen:0,timer:null,countdownStr:"",isTimeOut:!1,countdownRed:!1,filterArr:["LINEBAR","TITLE","CALLBACK_INTERFACE","SPREAD_PARAMS","REDIRECT","FRONT_ADDRESS","PROMPT","IMGCARD","RETURN_PATH","RICH_TEXT","SUCCESS_TIP"]}),m=t((()=>{var e;return null==(e=i.evaluateResultSetting)?void 0:e.evaluateStartTime})),d=t((()=>{const e=new Date(m.value);return!!r.isValidDate(e)&&e})),T=t((()=>{const{evaluateTime:e}=i.evaluateResultSetting;return+e})),c=t((()=>{if(!f.value)return!1;if(!T.value)return!1;const e=a(m.value).add(T.value,"minutes").valueOf();return l.curTime>=e||i.isFinished})),S=t((()=>c.value||l.banStart?"测评已结束":"开始测评")),R=t((()=>d.value&&!s.isTimeOut||c.value)),f=t((()=>!(!m.value||!d.value))),w=t((()=>{if(!m.value)return T.value;if(!T.value)return!1;if(d.value)return!0;const e=a(m.value).add(T.value,"minutes").valueOf();return l.curTime<e}));u((()=>{g()})),n((()=>{g()}));const E=e=>{g();const t=e-(new Date).getTime();if(t<=0)return s.countdownStr="00:00:00",s.isTimeOut=!0,void("countdown"==l.source&&v("closeEvaluateCountdown"));t<=9e5&&!s.countdownRed&&(s.countdownRed=!0);let u=parseInt(String(t/1e3/60/60/24))+"",n=parseInt(String(t/1e3/60/60%24)),a=parseInt(String(t/1e3/60%60)),r=parseInt(String(t/1e3%60));u&&(u+=":"),n=n>9?n+":":"0"+n+":",a=a>9?a+":":"0"+a+":",r=r>9?r:"0"+r,s.countdownStr=`${u}${n}${a}${r}`,s.timer=setTimeout((function(){E(e)}),1e3)},g=()=>{s.timer&&clearTimeout(s.timer),s.countdownRed=!1};return{evaluateState:s,evaluateStartTime:m,getEvaluateStartTime:d,getEvaluateText:S,showCountdown:w,showRange:f,getTotalLen:()=>{var e;const t=null==(e=i.formArray)?void 0:e.filter((e=>!s.filterArr.includes(e.type)&&!e.hide));t&&t.length&&(s.totalLen=t.length)},countdown:E,clearTimer:g,disabledEvaluate:R,isBanStart:()=>{if(!m.value||!T.value)return!1;if(!d.value)return!1;const e=a(m.value).add(T.value,"minutes").valueOf();return(new Date).getTime()>=e},getEvaluateTime:T}};export{i as useEvaluate};
1
+ import{reactive as e,computed as t,onMounted as u,onUnmounted as n}from"vue";import a from"moment";import"xe-utils";import r from"../../../../shared/utils/vexutilsExpand.js";const i=(i,l,o)=>{const{emit:v}=o,s=e({totalLen:0,timer:null,countdownStr:"",isTimeOut:!1,countdownRed:!1,filterArr:["LINEBAR","TITLE","CALLBACK_INTERFACE","SPREAD_PARAMS","REDIRECT","FRONT_ADDRESS","PROMPT","IMGCARD","RETURN_PATH","RICH_TEXT","SUCCESS_TIP"]}),m=t((()=>{var e;return null==(e=i.evaluateResultSetting)?void 0:e.evaluateStartTime})),d=t((()=>{const e=new Date(m.value);return!!r.isValidDate(e)&&e})),T=t((()=>{const{evaluateTime:e}=i.evaluateResultSetting;return+e})),c=t((()=>{if(!f.value)return!1;if(!T.value)return!1;const e=a(m.value).add(T.value,"minutes").valueOf();return l.curTime>=e||i.isFinished})),S=t((()=>c.value||l.banStart?"测评已结束":"开始测评")),R=t((()=>d.value&&!s.isTimeOut||c.value)),f=t((()=>!(!m.value||!d.value))),E=t((()=>{if(!m.value)return T.value;if(!T.value)return!1;if(d.value)return!0;const e=a(m.value).add(T.value,"minutes").valueOf();return l.curTime<e}));u((()=>{g()})),n((()=>{g()}));const w=e=>{g();const t=e-(new Date).getTime();if(t<=0)return s.countdownStr="00:00:00",s.isTimeOut=!0,void("countdown"==l.source&&v("closeEvaluateCountdown"));t<=9e5&&!s.countdownRed&&(s.countdownRed=!0);let u=parseInt(String(t/1e3/60/60/24))+"",n=parseInt(String(t/1e3/60/60%24)),a=parseInt(String(t/1e3/60%60)),r=parseInt(String(t/1e3%60));u&&(u+=":"),n=n>9?n+":":"0"+n+":",a=a>9?a+":":"0"+a+":",r=r>9?r:"0"+r,s.countdownStr=`${u}${n}${a}${r}`,s.timer=setTimeout((function(){w(e)}),1e3)},g=()=>{s.timer&&clearTimeout(s.timer),s.countdownRed=!1};return{evaluateState:s,evaluateStartTime:m,getEvaluateStartTime:d,getEvaluateText:S,showCountdown:E,showRange:f,getTotalLen:()=>{var e;const t=null==(e=i.formArray)?void 0:e.filter((e=>!s.filterArr.includes(e.type)&&!e.hide));t&&t.length&&(s.totalLen=t.length)},countdown:w,clearTimer:g,disabledEvaluate:R,isBanStart:()=>{if(!m.value||!T.value)return!1;if(!d.value)return!1;const e=a(m.value).add(T.value,"minutes").valueOf();return(new Date).getTime()>=e},getEvaluateTime:T}};export{i as useEvaluate};
@@ -1 +1 @@
1
- import e from"xe-utils";import"moment";const t=(t,i)=>{const n=e=>e.databaseTitle||e.title;return{nextLogicEvent:(t,o,s=[],l)=>{const{nextLogic:r,seq:c}=o;if(r&&r.next_logic_is&&r.condition.length){let _=9999,a=0;l||(_=((e=[])=>{const t=e.map((e=>"end"==e.next_subject?9999:+(e.next_subject||9999)));return Math.max.call(null,...t)})(r.condition),a=((e,t)=>{const{seq:o}=e;let s,l=t.map((e=>!!(e.seq>o&&e.isShow&&e.__isLogic__)&&e)),r=0,c=0,_=l.length;for(;c<_;c++){s=l[c];let e=i.form[n(s)];if(!e)continue;if(Array.isArray(e)&&!e.length)continue;const{nextLogic:t,seq:o,__isLogic__:_,__lastSeq__:a}=s;if(t.next_logic_is&&t.condition.length&&a){r=a;break}}return r})(o,s)),r.condition.some((n=>{const{value:l,next_subject:f}=n,m="end"==f?9999:f;if(a&&a>c&&a<_&&(_=a),"condition"==r.next_logic){let e=!1;if(e=Array.isArray(t)?t.includes(l):t===l,o.__isLogic__=e,o.__lastSeq__=c+1,e)return s.forEach((e=>{if(e.seq>c&&e.seq<m){e.isShow=!1;const t=e.val_key;i.form[t]&&(i.form[t]="")}else e.seq>=m&&e.seq<_&&(e.isShow=!0)})),!0;s.forEach((e=>{e.seq>c&&e.seq<m&&(e.isShow=!0)}))}else if("uncondition"==r.next_logic){let n=e.isEmpty(t);o.__isLogic__=!n,o.__lastSeq__=c+1,s.forEach((e=>{const t=e.val_key;e.seq>c&&e.seq<m&&(e.isShow=n,n||i.form[t]&&(i.form[t]=""))}))}}))}},handleDynamicDataRelation:(e,t,n)=>{let{targetSource:o}=t;if(!o||!Object.keys(o).length)return;if(!o.target_id)return;let{relationParam:s=[]}=o;s.length&&s.forEach((t=>{let o=n.find((e=>e.seq===t.relationElement));const s=o.val_key;if(o)if(e.length){let n=e.map((e=>e[t.relationField]||"/"))||"";i.form[s]=n.join(",")}else i.form[s]=""}))}}};export{t as useEvent};
1
+ import"xe-utils";import"moment";import e from"../../../../shared/utils/vexutilsExpand.js";const t=(t,i)=>{const n=e=>e.databaseTitle||e.title;return{nextLogicEvent:(t,o,s=[],l)=>{const{nextLogic:r,seq:c}=o;if(r&&r.next_logic_is&&r.condition.length){let _=9999,a=0;l||(_=((e=[])=>{const t=e.map((e=>"end"==e.next_subject?9999:+(e.next_subject||9999)));return Math.max.call(null,...t)})(r.condition),a=((e,t)=>{const{seq:o}=e;let s,l=t.map((e=>!!(e.seq>o&&e.isShow&&e.__isLogic__)&&e)),r=0,c=0,_=l.length;for(;c<_;c++){s=l[c];let e=i.form[n(s)];if(!e)continue;if(Array.isArray(e)&&!e.length)continue;const{nextLogic:t,seq:o,__isLogic__:_,__lastSeq__:a}=s;if(t.next_logic_is&&t.condition.length&&a){r=a;break}}return r})(o,s)),r.condition.some((n=>{const{value:l,next_subject:f}=n,m="end"==f?9999:f;if(a&&a>c&&a<_&&(_=a),"condition"==r.next_logic){let e=!1;if(e=Array.isArray(t)?t.includes(l):t===l,o.__isLogic__=e,o.__lastSeq__=c+1,e)return s.forEach((e=>{if(e.seq>c&&e.seq<m){e.isShow=!1;const t=e.val_key;i.form[t]&&(i.form[t]="")}else e.seq>=m&&e.seq<_&&(e.isShow=!0)})),!0;s.forEach((e=>{e.seq>c&&e.seq<m&&(e.isShow=!0)}))}else if("uncondition"==r.next_logic){let n=e.isEmpty(t);o.__isLogic__=!n,o.__lastSeq__=c+1,s.forEach((e=>{const t=e.val_key;e.seq>c&&e.seq<m&&(e.isShow=n,n||i.form[t]&&(i.form[t]=""))}))}}))}},handleDynamicDataRelation:(e,t,n)=>{let{targetSource:o}=t;if(!o||!Object.keys(o).length)return;if(!o.target_id)return;let{relationParam:s=[]}=o;s.length&&s.forEach((t=>{let o=n.find((e=>e.seq===t.relationElement));const s=o.val_key;if(o)if(e.length){let n=e.map((e=>e[t.relationField]||"/"))||"";i.form[s]=n.join(",")}else i.form[s]=""}))}}};export{t as useEvent};
@@ -0,0 +1,7 @@
1
+ import { AnyObject } from '../../../../../es/shared/types';
2
+ export declare type FormSaveType = {
3
+ hasCallbackItem: any;
4
+ isCallback: boolean;
5
+ params: AnyObject;
6
+ [key: string]: any;
7
+ };
@@ -1 +1 @@
1
- .c-choice-wrap{display:flex;flex-wrap:wrap;width:100%}.c-choice-wrap .n-radio-input{height:14px;width:14px}.c-choice-wrap .scale-choice-img-wrap{background:#fff;border:1px solid #d5d5d5;border-radius:4px;display:inline-block;height:62px;margin-right:16px;min-width:74px;position:relative;width:74px}.c-choice-wrap .scale-choice-img-wrap:hover .scale-preview-wrap{display:flex}.c-choice-wrap .scale-choice-img-wrap>img{height:100%;object-fit:cover;width:100%}.c-choice-wrap .scale-choice-img-wrap .scale-preview-wrap{align-items:center;background:rgba(0,0,0,.75);border-radius:8px;bottom:0;display:none;font-size:20px;justify-content:center;left:0;position:absolute;right:0;top:0}.c-choice-wrap .scale-choice-img-wrap .scale-preview-wrap i.anticon{color:#fff;margin:0}.c-choice-wrap .presuffix-wrap{align-items:center;display:inline-flex;white-space:normal;width:100%}.c-choice-wrap .n-input{border-bottom:1px solid #d9d9d9;flex:1;max-width:300px}.c-choice-wrap .choose-other{flex:1}.c-choice-wrap .other-span{word-break:break-all}.c-choice-wrap.choice-wrap-1 label{width:100%}.c-choice-wrap.choice-wrap-1 label .n-input{max-width:300px}.c-choice-wrap.choice-wrap-2 label{width:50%}.c-choice-wrap.choice-wrap-3 label{width:33%}.c-choice-wrap.choice-wrap-4 label{width:25%}.c-choice-wrap label{align-items:center;display:inline-flex;margin:4px 0}.c-choice-wrap label .n-radio__label{align-items:center;display:inline-flex;flex:1;white-space:normal}.c-choice-wrap>.n-checkbox{align-items:center;display:inline-flex;margin:4px 0}.c-choice-wrap>.n-checkbox .n-checkbox__label{align-items:center;display:inline-flex;flex:1;white-space:normal}.c-choice-wrap.choice-wrap-1 .n-checkbox{width:100%}.c-choice-wrap.choice-wrap-1 .n-checkbox .n-input{max-width:300px}.c-choice-wrap.choice-wrap-2 .n-checkbox{width:50%}.c-choice-wrap.choice-wrap-3 .n-checkbox{width:33%}.c-choice-wrap.choice-wrap-4 .n-checkbox{width:25%}.c-scale{box-sizing:border-box;color:rgba(0,0,0,.65);height:100%;overflow:hidden;padding-bottom:50px;padding-top:4px;position:relative;text-align:left;width:100%}.c-scale.c-scale-nobtn{padding-bottom:4px}.c-scale .scale-container{box-sizing:border-box;height:100%;overflow-y:auto;padding-bottom:10px;transform-origin:0 0;width:100%}.c-scale .scale-container.scale-container-nopadding{display:flex;flex-direction:column;height:100%}.c-scale .scale-container.scale-container-hasfooter{flex:1}.c-scale .scale-container::-webkit-scrollbar{background-color:#f5f5f5;height:6px;width:10px}.c-scale .scale-container::-webkit-scrollbar-track{background-color:#f2f2f2;border-radius:10px}.c-scale .scale-container::-webkit-scrollbar-thumb{background-color:#dbdcdc;border-radius:10px}.c-scale .no-data-tip{height:100%;width:100%}.c-scale .lb-title{text-align:center}.c-scale .map-container{cursor:pointer}.c-scale .linebar-div{margin-top:24px;text-align:center;width:100%}.c-scale .linebar-div .n-divider{margin-top:4px}.c-scale .my-prompt{background-color:#fff;border-radius:4px;box-shadow:0 5px 13px rgba(0,0,0,.14);padding:10px}.c-scale .img-card{width:100%}.main{box-sizing:border-box}.main .scale-label-required{font-weight:700}.main .required-text{color:#e02828;font-weight:700}.main .score-i{word-break:keep-all}.main .evalute-label{background:rgba(45,122,255,.1);border:1px solid rgba(45,122,255,.5);border-radius:4px;color:#2d7aff;display:inline-block;font-size:12px;height:20px;line-height:20px;margin-left:4px;padding:0 5px}.main .evalute-tip{background:rgba(255,194,0,.15);border-radius:2px;color:#fe9626;cursor:pointer;display:inline-block;margin-left:8px;padding:0 5px}.footer{align-items:center;background:#fff;border-top:1px solid #e8e8e8;box-sizing:border-box;display:flex;flex-basis:50px;height:50px;width:100%}.footer .n-button+.n-button{margin-left:8px}.rich-text-content{word-break:break-all}.rich-text-content p{margin-bottom:0}.rich-text-content img{max-width:100%}.n-dialog.n-modal.c-evatip-dialog-wrap{max-height:unset;overflow-y:hidden;padding:0;width:494px!important}.n-dialog.n-modal.c-evatip-dialog-wrap .n-dialog__title{border-bottom:1px solid #e8e8e8;font-weight:600;height:52px;line-height:52px;padding-left:16px}.n-dialog.n-modal.c-evatip-dialog-wrap .n-base-icon{color:#666;margin:0;position:absolute}.n-dialog.n-modal.c-evatip-dialog-wrap .n-dialog__content{margin:0}.n-dialog.n-modal.c-evatip-dialog-wrap .evatip-container{color:#2e2e2e;font-size:16px;max-height:60vh;min-height:100px;overflow-y:auto;padding:26px 16px}.n-dialog.n-modal.c-evatip-dialog-wrap .evatip-container p{border:1px solid hsla(0,0%,84%,.6);border-radius:4px;font-size:14px;margin-bottom:0;margin-top:12px;padding:16px}.n-dialog.n-modal.c-evatip-dialog-wrap .n-dialog__action{border-top:1px solid #e8e8e8;box-sizing:border-box;display:block;padding:10px 16px;text-align:right;width:100%}.c-answerParse{background:hsla(0,64%,98%,.6);border-radius:8px;color:#2e2e2e;margin-bottom:12px;margin-top:6px;padding:16px}.c-answerParse .answer-res-wrap{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px}.c-answerParse .answer-res-wrap .answer-res{align-items:center;background:#f06f64;border-radius:18px;color:#fff;display:inline-flex;font-weight:700;line-height:36px;padding:0 18px}.c-answerParse .answer-res-wrap .answer-res svg{font-size:16px;margin-right:8px}.c-answerParse .answer-res-wrap .answer-score{color:#2e2e2e;font-size:14px;font-weight:600}.c-answerParse .correct-answer{line-height:20px;margin-bottom:16px}.c-answerParse .correct-answer p{display:inline-block;font-weight:700}.c-answerParse .correct-answer span{color:#91c850;font-size:16px;word-break:break-all}.c-answerParse .answer-key{line-height:20px}.c-answerParse .answer-key p{font-weight:700;line-height:20px;margin-bottom:16px}.c-answerParse .answer-key span{word-break:break-all}.c-answerParse.answerParse-success{background:rgba(234,251,228,.6)}.c-answerParse.answerParse-success .answer-res{background:#91c850}.c-evaluateCountdown{background:#f2f2f4;border-radius:8px;color:#212121;min-width:166px;padding:8px 12px;position:absolute;right:0;text-align:center;top:0;z-index:1}.c-evaluateCountdown.evaluateCountdown-hasTime:hover{background:#f1f1f4;padding:8px 32px}.c-evaluateCountdown.evaluateCountdown-hasTime:hover .countdown{font-size:26px;line-height:40px}.c-evaluateCountdown.evaluateCountdown-hasTime:hover .countdown span{line-height:unset}.c-evaluateCountdown.evaluateCountdown-hasTime:hover .countdown svg{display:none}.c-evaluateCountdown.evaluateCountdown-hasTime:hover .answered-wrap{display:block}.c-evaluateCountdown.evaluateCountdown-hasTime .answered-wrap{display:none}.c-evaluateCountdown .countdown{align-content:center;color:#000;display:flex;font-size:14px;justify-content:center}.c-evaluateCountdown .countdown span{line-height:18px}.c-evaluateCountdown .countdown svg{color:#969696;font-size:16px;margin-left:8px}.c-evaluateCountdown .countdown.countdown-red{color:#ff1818}.c-evaluateCountdown .answered-wrap span{color:#2d7aff}.c-evaluate-page{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.c-evaluate-page .evaluate-container{border:1px solid #e0e0e0;border-radius:15px;padding:45px 32px;text-align:center;width:620px}.c-evaluate-page .evaluate-container .evaluate-name{color:#212121;font-size:20px;line-height:28px;margin-bottom:10px;max-height:88px;overflow-y:auto;word-break:break-all}.c-evaluate-page .evaluate-container .evaluate-explain{background:#f2f2f4;border-radius:8px;margin-bottom:24px;overflow:hidden;padding:12px 22px 12px 30px;text-align:left}.c-evaluate-page .evaluate-container .evaluate-explain>div{max-height:206px;overflow-y:auto;padding-right:8px;word-break:break-all}.c-evaluate-page .evaluate-container .evaluate-score{display:flex;margin-bottom:24px}.c-evaluate-page .evaluate-container .evaluate-score li+li{border-left:1px solid hsla(0,0%,84%,.6)}.c-evaluate-page .evaluate-container .evaluate-score li{flex:1}.c-evaluate-page .evaluate-container .evaluate-score li div{color:#000;font-size:36px;line-height:50px}.c-evaluate-page .evaluate-container .evaluate-score li span{color:rgba(0,0,0,.6);font-size:14px;line-height:20px}.c-evaluate-page .evaluate-container .evaluate-time-range{color:#000;font-size:14px;line-height:20px;margin-bottom:20px}.c-evaluate-page .evaluate-container .evaluate-btn{border-radius:8px;color:#fff;font-size:18px;height:unset;padding:16px 0;text-align:center;width:380px}.c-totalScore-warp{background:#f2f2f4;border-radius:6px;color:#666;font-size:14px;font-weight:400;margin-bottom:16px;padding:16px}.c-totalScore-warp div+div{margin-top:4px}.c-totalScore-warp span{color:#090909;font-weight:500}.c-totalScore-warp .score-result{color:#2d7aff}.c-sign-wrap .sigan-content-wrap{display:flex;flex-wrap:wrap}.c-sign-wrap .sigan-content-wrap .sign-item{border:1px solid #d5d5d5;border-radius:4px;box-sizing:border-box;height:96px;margin-right:16px;overflow:hidden;position:relative;width:200px}.c-sign-wrap .sigan-content-wrap .sign-item>img{height:100%;width:100%}.c-sign-wrap .sigan-content-wrap .sign-item:hover>div{display:flex}.c-sign-wrap .sigan-content-wrap .sign-item>div{align-items:center;background:rgba(0,0,0,.8);border-radius:4px;bottom:0;display:none;justify-content:center;left:0;position:absolute;right:0;top:0}.c-sign-wrap .sigan-content-wrap .sign-item>div .n-icon{color:#fff;cursor:pointer;font-size:18px}.c-sign-wrap .sigan-content-wrap .sign-item>div .n-icon+.n-icon{margin-left:20px}.c-sign-wrap .sigan-content-wrap .add-sign-wrap{align-items:center;background:#fafafa;border:1px dashed #d5d5d5;border-radius:4px;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;height:96px;justify-content:center;width:200px}.c-sign-wrap .sigan-content-wrap .add-sign-wrap .svg-icon{color:#000;font-size:32px}.c-sign-wrap .sigan-content-wrap .add-sign-wrap span,.sign-com-wrap>span{color:#585858}.sign-com-wrap .sign-canvas{border:1px solid hsla(0,0%,84%,.6);border-radius:4px;margin-top:16px}.c-scale li,.c-scale ul{list-style:none;margin:0;padding:0}.c-scale .n-input{text-align:left;width:100%}.c-scale .n-form-item{--n-label-height:unset!important}.c-scale .c-scle-form-item>.n-form-item-blank{display:block}.no-data-tip{align-items:center;color:#333;display:flex;flex-direction:column;font-size:22px;height:100%;justify-content:center;width:100%}.no-data-tip>img{max-width:70%;width:260px}.no-data-tip>p{color:rgba(0,0,0,.8);font-size:16px;margin-bottom:0;margin-top:12px}.no-data-tip>span{color:rgba(0,0,0,.4);font-size:14px;margin-top:6px}.c-scale-address{max-width:500px}.c-scale-address .field-row{display:flex;overflow:hidden;width:100%}.c-scale-address .field-row .n-select{flex:1;padding:0 5px 5px 0;width:100%}.c-scale-address .field-row .n-select:last-child{padding-right:0}.c-scale-collection,.c-scale-collection .img-card{width:100%}.c-scale-collection.scale-collection-title{text-align:center}.c-scale-collection.scale-collection-title h1{font-weight:500}.c-scale-collection.prompt-message{background-color:#fff;border-radius:4px;box-shadow:0 5px 13px rgba(0,0,0,.14);color:#666;padding:10px;position:relative}.c-scale-collection.prompt-message.is-weak{color:#999}.c-scale-collection.prompt-message.is-strong{color:#ff1818;padding:8px 8px 8px 35px}.c-scale-collection.prompt-message .prompt-icon{font-size:18px;left:8px;position:absolute;top:8px}.c-scale-collection.prompt-message .prompt-message-content{font-size:14px;line-height:16px;word-break:break-all}.c-time-range{align-items:center;display:flex}.c-map-container{cursor:pointer;width:100%}.c-map-container .n-input.map-input .n-input__prefix{transform:rotate(180deg)}.c-map-container .n-input.map-input .n-input__prefix .n-icon{color:rgba(0,0,0,.65)}.c-map-container .n-input.map-input.n-input--disabled .n-input__input-el{background-color:#fff;color:rgba(0,0,0,.65);cursor:pointer}.c-scale-map-modal .n-card__content{overflow:hidden}.c-scale-upload{width:100%}.c-scale-upload .n-upload-file-list{display:flex}.c-scale-upload .n-upload-file-list .n-upload-file .n-upload-file-info .n-upload-file-info__action.n-upload-file-info__action--image-card-type{background:rgba(0,0,0,.5);box-sizing:border-box}.c-scale-upload .n-upload-file-list .n-upload-file .n-upload-file-info .n-upload-file-info__action.n-upload-file-info__action--image-card-type span.n-button__icon{color:#fff}.c-scale-upload .n-upload-file-list .n-upload-trigger.n-upload-trigger--image-card{background-color:#fafafa;border-color:#d5d5d5;height:184px;width:184px}.c-scale-upload .n-upload-file-list .n-upload-file.n-upload-file--image-card-type{background-color:#fafafa;border-color:#d5d5d5;height:184px;padding:8px;width:184px}.c-scale-upload .n-upload-file-list .n-upload-file.n-upload-file--image-card-type .n-image{height:100%}.c-scale-upload .n-upload-file-list .n-upload-file.n-upload-file--image-card-type img{object-fit:cover!important}.c-scale-upload .upload-img-wrap{align-items:center;display:flex;flex-direction:column}.c-scale-upload .dragger-upload-text{align-items:center;display:flex}.c-scale-upload.scale-upload-file .n-upload-dragger{padding:16px 0}.c-scale-upload.scale-upload-file .n-upload{--n-item-disabled-opacity:1!important;opacity:1!important}.c-scale-upload.scale-upload-file .dragger-upload-text{color:rgba(0,0,0,.65)}.c-scale-upload.scale-upload-file .n-upload-file-list{display:flex;flex-direction:column;width:100%}.c-scale-upload.scale-upload-file .n-upload-file-list .n-upload-file{width:100%}.c-scale-upload.scale-upload-file .n-upload-trigger{background:#fafafa;border-color:#d5d5d5;width:100%}.text-over-tooltip-components{display:inline-block;max-width:98%}.text-over-tooltip-components .ellipsis{color:#35393c;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-over-tooltip-components .ellipsis i{font-style:normal;white-space:nowrap;word-break:keep-all}.text-over-tooltip-components .fs20{color:green;font-size:20px;font-weight:600;line-height:22px}.text-over-tooltip-components .fs12{color:orange;font-size:12px;font-weight:400;line-height:14px}.c-scale-modal-container.n-dialog{display:flex;flex-direction:column;height:60vh}.c-scale-modal-container.n-dialog.n-modal{min-width:560px;padding:0;width:50vw}.c-scale-modal-container.n-dialog .n-dialog__title{background:#fff;border-bottom:1px solid #e8e8e8;border-radius:8px 8px 0 0;box-sizing:border-box;height:52px;line-height:52px;padding:14px 16px}.c-scale-modal-container.n-dialog .n-dialog__title .n-dialog__title-content{align-items:center;color:#000;display:flex;font-size:16px;height:100%;justify-content:space-between;overflow:hidden;width:100%}.c-scale-modal-container.n-dialog .n-dialog__title .n-dialog__title-content .modal-title-drag{flex:1}.c-scale-modal-container.n-dialog .n-dialog__title .n-dialog__title-content .svg-wrap{right:16px}.c-scale-modal-container.n-dialog .n-dialog__title .n-dialog__title-content .svg-wrap svg{cursor:pointer;font-size:14px}.c-scale-modal-container.n-dialog .n-dialog__title .n-dialog__title-content .svg-wrap svg+svg{margin-left:16px}.c-scale-modal-container.n-dialog .n-dialog__content{height:100%;margin:0;overflow:hidden;padding:16px}.c-scale-modal-container.n-dialog .n-dialog__action{background:transparent;border-radius:0 0 8px 8px;border-top:1px solid #e8e8e8;box-sizing:border-box;height:52px;padding:10px 16px;text-align:right}
1
+ @font-face{font-family:scale-view-iconfont;src:url(scale-view-iconfont.ttf?t=1682489008262) format("truetype")}.scale-view-iconfont{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:scale-view-iconfont!important;font-size:14px;font-style:normal}.icon-scale-view-menzhenyishengzhanxitongtubiaoguanbi:before{content:"\e76e"}.icon-scale-view-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-scale-view-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.icon-scale-view-shijian:before{content:"\e8c5"}.icon-scale-view-qianming:before{content:"\e6ca"}.icon-scale-view-cuo:before{content:"\e6e5"}.icon-scale-view-dui:before{content:"\e7c8"}.icon-scale-view-dengpao:before{content:"\e719"}.c-scale-view-block .c-choice-wrap{display:flex;flex-wrap:wrap;width:100%}.c-scale-view-block .c-choice-wrap .n-radio-input{height:14px;width:14px}.c-scale-view-block .c-choice-wrap .scale-choice-img-wrap{background:#fff;border:1px solid #d5d5d5;border-radius:4px;display:inline-block;height:62px;margin-right:16px;min-width:74px;position:relative;width:74px}.c-scale-view-block .c-choice-wrap .scale-choice-img-wrap:hover .scale-preview-wrap{display:flex}.c-scale-view-block .c-choice-wrap .scale-choice-img-wrap>img{height:100%;object-fit:cover;width:100%}.c-scale-view-block .c-choice-wrap .scale-choice-img-wrap .scale-preview-wrap{align-items:center;background:rgba(0,0,0,.75);border-radius:8px;bottom:0;display:none;font-size:20px;justify-content:center;left:0;position:absolute;right:0;top:0}.c-scale-view-block .c-choice-wrap .scale-choice-img-wrap .scale-preview-wrap i.anticon{color:#fff;margin:0}.c-scale-view-block .c-choice-wrap .presuffix-wrap{align-items:center;display:inline-flex;white-space:normal;width:100%}.c-scale-view-block .c-choice-wrap .n-input{border-bottom:1px solid #d9d9d9;flex:1;max-width:300px}.c-scale-view-block .c-choice-wrap .choose-other{flex:1}.c-scale-view-block .c-choice-wrap .other-span{word-break:break-all}.c-scale-view-block .c-choice-wrap.choice-wrap-1 label{width:100%}.c-scale-view-block .c-choice-wrap.choice-wrap-1 label .n-input{max-width:300px}.c-scale-view-block .c-choice-wrap.choice-wrap-2 label{width:50%}.c-scale-view-block .c-choice-wrap.choice-wrap-3 label{width:33%}.c-scale-view-block .c-choice-wrap.choice-wrap-4 label{width:25%}.c-scale-view-block .c-choice-wrap label{align-items:center;display:inline-flex;margin:4px 0}.c-scale-view-block .c-choice-wrap label .n-radio__label{align-items:center;display:inline-flex;flex:1;white-space:normal}.c-scale-view-block .c-choice-wrap>.n-checkbox{align-items:center;display:inline-flex;margin:4px 0}.c-scale-view-block .c-choice-wrap>.n-checkbox .n-checkbox__label{align-items:center;display:inline-flex;flex:1;white-space:normal}.c-scale-view-block .c-choice-wrap.choice-wrap-1 .n-checkbox{width:100%}.c-scale-view-block .c-choice-wrap.choice-wrap-1 .n-checkbox .n-input{max-width:300px}.c-scale-view-block .c-choice-wrap.choice-wrap-2 .n-checkbox{width:50%}.c-scale-view-block .c-choice-wrap.choice-wrap-3 .n-checkbox{width:33%}.c-scale-view-block .c-choice-wrap.choice-wrap-4 .n-checkbox{width:25%}.c-scale-view-block{box-sizing:border-box;color:rgba(0,0,0,.65);display:flex;flex-direction:column;height:100%;overflow:hidden;padding-top:4px;position:relative;text-align:left;width:100%}.c-scale-view-block .scale-container{box-sizing:border-box;height:100%;overflow-y:auto;transform-origin:0 0;width:100%}.c-scale-view-block .scale-container.scale-container-nopadding{display:flex;flex-direction:column;height:100%}.c-scale-view-block .scale-container.scale-container-hasfooter{flex:1}.c-scale-view-block .scale-container::-webkit-scrollbar{background-color:#f5f5f5;height:6px;width:10px}.c-scale-view-block .scale-container::-webkit-scrollbar-track{background-color:#f2f2f2;border-radius:10px}.c-scale-view-block .scale-container::-webkit-scrollbar-thumb{background-color:#dbdcdc;border-radius:10px}.c-scale-view-block .lb-title{text-align:center}.c-scale-view-block .map-container{cursor:pointer}.c-scale-view-block .linebar-div{margin-top:24px;text-align:center;width:100%}.c-scale-view-block .linebar-div .n-divider{margin-top:4px}.c-scale-view-block .my-prompt{background-color:#fff;border-radius:4px;box-shadow:0 5px 13px rgba(0,0,0,.14);padding:10px}.c-scale-view-block .img-card{width:100%}.c-scale-view-block .main{box-sizing:border-box}.c-scale-view-block .main .scale-label-required{font-weight:700}.c-scale-view-block .main .required-text{color:#e02828;font-weight:700}.c-scale-view-block .main .score-i{word-break:keep-all}.c-scale-view-block .main .evalute-label{background:rgba(45,122,255,.1);border:1px solid rgba(45,122,255,.5);border-radius:4px;color:#2d7aff;display:inline-block;font-size:12px;height:20px;line-height:20px;margin-left:4px;padding:0 5px}.c-scale-view-block .main .evalute-tip{background:rgba(255,194,0,.15);border-radius:2px;color:#fe9626;cursor:pointer;display:inline-block;margin-left:8px;padding:0 5px}.c-scale-view-block .footer{align-items:center;background:#fff;border-top:1px solid #e8e8e8;box-sizing:border-box;display:flex;flex-basis:50px;height:50px;width:100%}.c-scale-view-block .footer .n-button+.n-button{margin-left:8px}.n-dialog.n-modal.c-evatip-dialog-wrap{max-height:unset;overflow-y:hidden;padding:0;width:494px!important}.n-dialog.n-modal.c-evatip-dialog-wrap .n-dialog__title{border-bottom:1px solid #e8e8e8;font-weight:600;height:52px;line-height:52px;padding-left:16px}.n-dialog.n-modal.c-evatip-dialog-wrap .n-base-icon{color:#666;margin:0;position:absolute}.n-dialog.n-modal.c-evatip-dialog-wrap .n-dialog__content{margin:0}.n-dialog.n-modal.c-evatip-dialog-wrap .evatip-container{color:#2e2e2e;font-size:16px;max-height:60vh;min-height:100px;overflow-y:auto;padding:26px 16px}.n-dialog.n-modal.c-evatip-dialog-wrap .evatip-container p{border:1px solid hsla(0,0%,84%,.6);border-radius:4px;font-size:14px;margin-bottom:0;margin-top:12px;padding:16px}.n-dialog.n-modal.c-evatip-dialog-wrap .n-dialog__action{border-top:1px solid #e8e8e8;box-sizing:border-box;display:block;padding:10px 16px;text-align:right;width:100%}.c-scale-view-block .c-answerParse{background:hsla(0,64%,98%,.6);border-radius:8px;color:#2e2e2e;margin-bottom:12px;margin-top:6px;padding:16px}.c-scale-view-block .c-answerParse .answer-res-wrap{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px}.c-scale-view-block .c-answerParse .answer-res-wrap .answer-res{align-items:center;background:#f06f64;border-radius:18px;color:#fff;display:inline-flex;font-weight:700;line-height:36px;padding:0 18px}.c-scale-view-block .c-answerParse .answer-res-wrap .answer-res svg{font-size:16px;margin-right:8px}.c-scale-view-block .c-answerParse .answer-res-wrap .answer-score{color:#2e2e2e;font-size:14px;font-weight:600}.c-scale-view-block .c-answerParse .correct-answer{line-height:20px;margin-bottom:16px}.c-scale-view-block .c-answerParse .correct-answer p{display:inline-block;font-weight:700}.c-scale-view-block .c-answerParse .correct-answer span{color:#91c850;font-size:16px;word-break:break-all}.c-scale-view-block .c-answerParse .answer-key{line-height:20px}.c-scale-view-block .c-answerParse .answer-key p{font-weight:700;line-height:20px;margin-bottom:16px}.c-scale-view-block .c-answerParse .answer-key span{word-break:break-all}.c-scale-view-block .c-answerParse.answerParse-success{background:rgba(234,251,228,.6)}.c-scale-view-block .c-answerParse.answerParse-success .answer-res{background:#91c850}.c-scale-view-block .c-evaluateCountdown{background:#f2f2f4;border-radius:8px;color:#212121;min-width:166px;padding:8px 12px;position:absolute;right:0;text-align:center;top:0;z-index:1}.c-scale-view-block .c-evaluateCountdown.evaluateCountdown-hasTime:hover{background:#f1f1f4;padding:8px 32px}.c-scale-view-block .c-evaluateCountdown.evaluateCountdown-hasTime:hover .countdown{font-size:26px;line-height:40px}.c-scale-view-block .c-evaluateCountdown.evaluateCountdown-hasTime:hover .countdown span{line-height:unset}.c-scale-view-block .c-evaluateCountdown.evaluateCountdown-hasTime:hover .countdown svg{display:none}.c-scale-view-block .c-evaluateCountdown.evaluateCountdown-hasTime:hover .answered-wrap{display:block}.c-scale-view-block .c-evaluateCountdown.evaluateCountdown-hasTime .answered-wrap{display:none}.c-scale-view-block .c-evaluateCountdown .countdown{align-content:center;color:#000;display:flex;font-size:14px;justify-content:center}.c-scale-view-block .c-evaluateCountdown .countdown span{line-height:18px}.c-scale-view-block .c-evaluateCountdown .countdown svg{color:#969696;font-size:16px;margin-left:8px}.c-scale-view-block .c-evaluateCountdown .countdown.countdown-red{color:#ff1818}.c-scale-view-block .c-evaluateCountdown .answered-wrap span{color:#2d7aff}.c-scale-view-block .c-evaluate-page{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.c-scale-view-block .c-evaluate-page .evaluate-container{border:1px solid #e0e0e0;border-radius:15px;padding:45px 32px;text-align:center;width:620px}.c-scale-view-block .c-evaluate-page .evaluate-container .evaluate-name{color:#212121;font-size:20px;line-height:28px;margin-bottom:10px;max-height:88px;overflow-y:auto;word-break:break-all}.c-scale-view-block .c-evaluate-page .evaluate-container .evaluate-explain{background:#f2f2f4;border-radius:8px;margin-bottom:24px;overflow:hidden;padding:12px 22px 12px 30px;text-align:left}.c-scale-view-block .c-evaluate-page .evaluate-container .evaluate-explain>div{max-height:206px;overflow-y:auto;padding-right:8px;word-break:break-all}.c-scale-view-block .c-evaluate-page .evaluate-container .evaluate-score{display:flex;margin-bottom:24px}.c-scale-view-block .c-evaluate-page .evaluate-container .evaluate-score li+li{border-left:1px solid hsla(0,0%,84%,.6)}.c-scale-view-block .c-evaluate-page .evaluate-container .evaluate-score li{flex:1}.c-scale-view-block .c-evaluate-page .evaluate-container .evaluate-score li div{color:#000;font-size:36px;line-height:50px}.c-scale-view-block .c-evaluate-page .evaluate-container .evaluate-score li span{color:rgba(0,0,0,.6);font-size:14px;line-height:20px}.c-scale-view-block .c-evaluate-page .evaluate-container .evaluate-time-range{color:#000;font-size:14px;line-height:20px;margin-bottom:20px}.c-scale-view-block .c-evaluate-page .evaluate-container .evaluate-btn{border-radius:8px;color:#fff;font-size:18px;height:unset;padding:16px 0;text-align:center;width:380px}.c-scale-view-block .c-totalScore-warp{background:#f2f2f4;border-radius:6px;color:#666;font-size:14px;font-weight:400;margin-bottom:16px;padding:16px}.c-scale-view-block .c-totalScore-warp div+div{margin-top:4px}.c-scale-view-block .c-totalScore-warp span{color:#090909;font-weight:500}.c-scale-view-block .c-totalScore-warp .score-result{color:#2d7aff}.c-scale-view-block .c-sign-wrap .sigan-content-wrap{display:flex;flex-wrap:wrap}.c-scale-view-block .c-sign-wrap .sigan-content-wrap .sign-item{border:1px solid #d5d5d5;border-radius:4px;box-sizing:border-box;height:96px;margin-right:16px;overflow:hidden;position:relative;width:200px}.c-scale-view-block .c-sign-wrap .sigan-content-wrap .sign-item>img{height:100%;width:100%}.c-scale-view-block .c-sign-wrap .sigan-content-wrap .sign-item:hover>div{display:flex}.c-scale-view-block .c-sign-wrap .sigan-content-wrap .sign-item>div{align-items:center;background:rgba(0,0,0,.8);border-radius:4px;bottom:0;display:none;justify-content:center;left:0;position:absolute;right:0;top:0}.c-scale-view-block .c-sign-wrap .sigan-content-wrap .sign-item>div .n-icon{color:#fff;cursor:pointer;font-size:18px}.c-scale-view-block .c-sign-wrap .sigan-content-wrap .sign-item>div .n-icon+.n-icon{margin-left:20px}.c-scale-view-block .c-sign-wrap .sigan-content-wrap .add-sign-wrap{align-items:center;background:#fafafa;border:1px dashed #d5d5d5;border-radius:4px;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;height:96px;justify-content:center;width:200px}.c-scale-view-block .c-sign-wrap .sigan-content-wrap .add-sign-wrap .scale-view-iconfont{color:#000;font-size:32px}.c-scale-view-block .c-sign-wrap .sigan-content-wrap .add-sign-wrap span,.c-scale-view-block .sign-com-wrap>span{color:#585858}.c-scale-view-block .sign-com-wrap .sign-canvas{border:1px solid hsla(0,0%,84%,.6);border-radius:4px;margin-top:16px}.c-scale-view-block li,.c-scale-view-block ul{list-style:none;margin:0;padding:0}.c-scale-view-block .n-input{text-align:left;width:100%}.c-scale-view-block .n-form-item{--n-label-height:unset!important}.c-scale-view-block .c-scle-form-item>.n-form-item-blank{display:block}.c-scale-view-block .no-data-tip{align-items:center;color:#333;display:flex;flex-direction:column;font-size:22px;height:100%;justify-content:center;width:100%}.c-scale-view-block .no-data-tip>img{max-width:70%;width:260px}.c-scale-view-block .no-data-tip>p{color:rgba(0,0,0,.8);font-size:16px;margin-bottom:0;margin-top:12px}.c-scale-view-block .no-data-tip>span{color:rgba(0,0,0,.4);font-size:14px;margin-top:6px}.c-scale-view-block .c-scale-address{max-width:500px}.c-scale-view-block .c-scale-address .field-row{display:flex;overflow:hidden;width:100%}.c-scale-view-block .c-scale-address .field-row .n-select{flex:1;padding:0 5px 5px 0;width:100%}.c-scale-view-block .c-scale-address .field-row .n-select:last-child{padding-right:0}.c-scale-view-block .c-scale-collection,.c-scale-view-block .c-scale-collection .img-card{width:100%}.c-scale-view-block .c-scale-collection.scale-collection-title{text-align:center}.c-scale-view-block .c-scale-collection.scale-collection-title h1{font-weight:500}.c-scale-view-block .c-scale-collection.prompt-message{background-color:#fff;border-radius:4px;box-shadow:0 5px 13px rgba(0,0,0,.14);color:#666;padding:10px;position:relative}.c-scale-view-block .c-scale-collection.prompt-message.is-weak{color:#999}.c-scale-view-block .c-scale-collection.prompt-message.is-strong{color:#ff1818;padding:8px 8px 8px 35px}.c-scale-view-block .c-scale-collection.prompt-message .prompt-icon{font-size:18px;left:8px;position:absolute;top:8px}.c-scale-view-block .c-scale-collection.prompt-message .prompt-message-content{font-size:14px;line-height:16px;word-break:break-all}.c-scale-view-block .c-time-range{align-items:center;display:flex}.c-scale-view-block .c-map-container{cursor:pointer;width:100%}.c-scale-view-block .c-map-container .n-input.map-input .n-input__prefix{transform:rotate(180deg)}.c-scale-view-block .c-map-container .n-input.map-input .n-input__prefix .n-icon{color:rgba(0,0,0,.65)}.c-scale-view-block .c-map-container .n-input.map-input.n-input--disabled .n-input__input-el{background-color:#fff;color:rgba(0,0,0,.65);cursor:pointer}.c-scale-view-block .c-scale-upload{width:100%}.c-scale-view-block .c-scale-upload .n-upload-file-list{display:flex}.c-scale-view-block .c-scale-upload .n-upload-file-list .n-upload-file .n-upload-file-info .n-upload-file-info__action.n-upload-file-info__action--image-card-type{background:rgba(0,0,0,.5);box-sizing:border-box}.c-scale-view-block .c-scale-upload .n-upload-file-list .n-upload-file .n-upload-file-info .n-upload-file-info__action.n-upload-file-info__action--image-card-type span.n-button__icon{color:#fff}.c-scale-view-block .c-scale-upload .n-upload-file-list .n-upload-trigger.n-upload-trigger--image-card{background-color:#fafafa;border-color:#d5d5d5;height:184px;width:184px}.c-scale-view-block .c-scale-upload .n-upload-file-list .n-upload-file.n-upload-file--image-card-type{background-color:#fafafa;border-color:#d5d5d5;height:184px;padding:8px;width:184px}.c-scale-view-block .c-scale-upload .n-upload-file-list .n-upload-file.n-upload-file--image-card-type .n-image{height:100%}.c-scale-view-block .c-scale-upload .n-upload-file-list .n-upload-file.n-upload-file--image-card-type img{object-fit:cover!important}.c-scale-view-block .c-scale-upload .upload-img-wrap{align-items:center;display:flex;flex-direction:column}.c-scale-view-block .c-scale-upload .dragger-upload-text{align-items:center;display:flex}.c-scale-view-block .c-scale-upload.scale-upload-file .n-upload-dragger{padding:16px 0}.c-scale-view-block .c-scale-upload.scale-upload-file .n-upload{--n-item-disabled-opacity:1!important;opacity:1!important}.c-scale-view-block .c-scale-upload.scale-upload-file .dragger-upload-text{color:rgba(0,0,0,.65)}.c-scale-view-block .c-scale-upload.scale-upload-file .n-upload-file-list{display:flex;flex-direction:column;width:100%}.c-scale-view-block .c-scale-upload.scale-upload-file .n-upload-file-list .n-upload-file{width:100%}.c-scale-view-block .c-scale-upload.scale-upload-file .n-upload-trigger{background:#fafafa;border-color:#d5d5d5;width:100%}.c-scale-view-block .text-over-tooltip-components{display:inline-block;max-width:98%}.c-scale-view-block .text-over-tooltip-components .ellipsis{color:#35393c;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-scale-view-block .text-over-tooltip-components .ellipsis i{font-style:normal;white-space:nowrap;word-break:keep-all}.c-scale-view-block .text-over-tooltip-components .fs20{color:green;font-size:20px;font-weight:600;line-height:22px}.c-scale-view-block .text-over-tooltip-components .fs12{color:orange;font-size:12px;font-weight:400;line-height:14px}.c-scale-map-modal .n-card__content{overflow:hidden}.c-scale-modal-container.n-dialog{display:flex;flex-direction:column;height:60vh}.c-scale-modal-container.n-dialog.n-modal{min-width:560px;padding:0;width:50vw}.c-scale-modal-container.n-dialog .n-dialog__title{background:#fff;border-bottom:1px solid #e8e8e8;border-radius:8px 8px 0 0;box-sizing:border-box;height:52px;line-height:52px;padding:14px 16px}.c-scale-modal-container.n-dialog .n-dialog__title .n-dialog__title-content{align-items:center;color:#000;display:flex;font-size:16px;height:100%;justify-content:space-between;overflow:hidden;width:100%}.c-scale-modal-container.n-dialog .n-dialog__title .n-dialog__title-content .modal-title-drag{flex:1}.c-scale-modal-container.n-dialog .n-dialog__title .n-dialog__title-content .svg-wrap{right:16px}.c-scale-modal-container.n-dialog .n-dialog__title .n-dialog__title-content .svg-wrap svg{cursor:pointer;font-size:14px}.c-scale-modal-container.n-dialog .n-dialog__title .n-dialog__title-content .svg-wrap svg+svg{margin-left:16px}.c-scale-modal-container.n-dialog .n-dialog__content{height:100%;margin:0;overflow:hidden;padding:16px}.c-scale-modal-container.n-dialog .n-dialog__action{background:transparent;border-radius:0 0 8px 8px;border-top:1px solid #e8e8e8;box-sizing:border-box;height:52px;padding:10px 16px;text-align:right}
@@ -101,9 +101,11 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
101
101
  emitValue: (value: string | import("../../../es/shared/types").AnyObject[]) => void;
102
102
  onClear: () => void;
103
103
  onClick: (evt: Event) => void;
104
+ onKeydown: (evt: KeyboardEvent) => void;
104
105
  cssVariable: {
105
106
  '--menu-width': number;
106
107
  };
108
+ eventBus: import("../../../es/shared/types").AnyObject;
107
109
  uuid: string;
108
110
  show: import("vue").Ref<boolean> | import("vue").WritableComputedRef<boolean>;
109
111
  patternContent: import("vue").Ref<string>;
@@ -114,11 +116,13 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
114
116
  inputRef: import("vue").Ref<any>;
115
117
  popoverRef: import("vue").Ref<any>;
116
118
  currentNode: import("vue").Ref<import("../../../es/shared/types").AnyObject | undefined>;
119
+ cursorNode: import("vue").Ref<import("../../../es/shared/types").AnyObject | undefined>;
117
120
  loadingNode: import("vue").Ref<import("../../../es/shared/types").Nullable<import("../../../es/shared/types").AnyObject>>;
118
121
  search: (payload?: {
119
122
  type: "search" | "update";
120
123
  node: import("../../../es/shared/types").AnyObject;
121
124
  } | undefined, keyword?: string | undefined) => Promise<void>;
125
+ changeCursorNode: (node: import("../../../es/shared/types").AnyObject) => void;
122
126
  NInput: any;
123
127
  NPopover: any;
124
128
  SearchMenu: import("vue").DefineComponent<{
@@ -141,7 +145,10 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
141
145
  currentNode: {
142
146
  type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
143
147
  };
144
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "nodeClick"[], "nodeClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
148
+ cursorNode: {
149
+ type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
150
+ };
151
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("nodeClick" | "changeCursor")[], "nodeClick" | "changeCursor", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
145
152
  childKey: {
146
153
  type: StringConstructor;
147
154
  default: string;
@@ -161,8 +168,12 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
161
168
  currentNode: {
162
169
  type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
163
170
  };
171
+ cursorNode: {
172
+ type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
173
+ };
164
174
  }>> & {
165
175
  onNodeClick?: ((...args: any[]) => any) | undefined;
176
+ onChangeCursor?: ((...args: any[]) => any) | undefined;
166
177
  }, {
167
178
  options: import("../../../es/shared/types").AnyObject[];
168
179
  valueKey: string;
@@ -103,9 +103,11 @@ declare const _default: import("vue").DefineComponent<{
103
103
  emitValue: (value: ValueType) => void;
104
104
  onClear: () => void;
105
105
  onClick: (evt: Event) => void;
106
+ onKeydown: (evt: KeyboardEvent) => void;
106
107
  cssVariable: {
107
108
  '--menu-width': number;
108
109
  };
110
+ eventBus: AnyObject;
109
111
  uuid: string;
110
112
  show: import("vue").Ref<boolean> | import("vue").WritableComputedRef<boolean>;
111
113
  patternContent: import("vue").Ref<string>;
@@ -116,11 +118,13 @@ declare const _default: import("vue").DefineComponent<{
116
118
  inputRef: import("vue").Ref<any>;
117
119
  popoverRef: import("vue").Ref<any>;
118
120
  currentNode: import("vue").Ref<AnyObject | undefined>;
121
+ cursorNode: import("vue").Ref<AnyObject | undefined>;
119
122
  loadingNode: import("vue").Ref<Nullable<AnyObject>>;
120
123
  search: (payload?: {
121
124
  type: 'search' | 'update';
122
125
  node: AnyObject;
123
126
  }, keyword?: string) => Promise<void>;
127
+ changeCursorNode: (node: AnyObject) => void;
124
128
  NInput: any;
125
129
  NPopover: any;
126
130
  SearchMenu: import("vue").DefineComponent<{
@@ -143,7 +147,10 @@ declare const _default: import("vue").DefineComponent<{
143
147
  currentNode: {
144
148
  type: PropType<AnyObject>;
145
149
  };
146
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "nodeClick"[], "nodeClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
150
+ cursorNode: {
151
+ type: PropType<AnyObject>;
152
+ };
153
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("nodeClick" | "changeCursor")[], "nodeClick" | "changeCursor", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
147
154
  childKey: {
148
155
  type: StringConstructor;
149
156
  default: string;
@@ -163,8 +170,12 @@ declare const _default: import("vue").DefineComponent<{
163
170
  currentNode: {
164
171
  type: PropType<AnyObject>;
165
172
  };
173
+ cursorNode: {
174
+ type: PropType<AnyObject>;
175
+ };
166
176
  }>> & {
167
177
  onNodeClick?: ((...args: any[]) => any) | undefined;
178
+ onChangeCursor?: ((...args: any[]) => any) | undefined;
168
179
  }, {
169
180
  options: AnyObject[];
170
181
  valueKey: string;
@@ -1 +1 @@
1
- import{defineComponent as e,provide as a,computed as l,ref as t,nextTick as r,openBlock as o,createBlock as u,unref as n,isRef as s,normalizeStyle as i,withCtx as c,createVNode as p,withKeys as v,createElementVNode as d,renderSlot as f}from"vue";import{uuidGenerator as y}from"../../../shared/utils/index.js";import{NOOP as h}from"@vue/shared";import{useVModel as m,onClickOutside as b,useDebounceFn as g}from"@vueuse/core";import{isString as w,isArray as k,isFunction as S,isObject as _}from"lodash-es";import{NPopover as K,NInput as C}from"naive-ui";import{InjectionSearchCascaderCheckAbleLevel as j,InjectionSearchCascaderLoadingNode as N,InjectionSearchCascaderValue as P}from"./constants/index.js";import{useCssVariable as x}from"./hooks/useCssVariable.js";import{SearchMenu as A}from"./components/SearchMenu.js";import V from"../../../_virtual/plugin-vue_export-helper.js";const F=["id"];var L=V(e({__name:"SearchCascader",props:{value:{type:[String,Array]},show:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},childKey:{type:String,default:"children"},placeholder:{type:String,default:"请选择"},editPlaceholder:{type:String,default:"请输入关键字进行搜索"},options:{type:Array,default:()=>[]},search:{type:Function},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},checkAbleLevel:{type:[Number,String],default:"last"},beforeSetValue:{type:Function}},emits:["update:value","focus","update:show"],setup(e,{emit:V}){const L=e;function U(){var e;e=[],Promise.resolve(S(L.beforeSetValue)?L.beforeSetValue(e):e).then((e=>V("update:value",e)),h)}function B(e){var a;"INPUT"===(null==(a=e.target)?void 0:a.tagName)&&function(){if(I.value)return;I.value=!0,M.value="",J()}()}const R=x(),E=y(),I=m(L,"show",V);a(j,l((()=>L.checkAbleLevel)));const M=t(""),T=l({get:()=>I.value?M.value:w(L.value)?L.value:k(L.value)?L.value.reduce(((e,a,l)=>0===l?a[L.labelKey]:e+" / "+a[L.labelKey]),""):"",set(e){M.value=e,J(void 0,e)}});function $(e){V("focus",e)}async function q(){var e;I.value=!1,null==(e=z.value)||e.blur()}const z=t();b(z,(e=>{var a;if(!I.value)return;const l=e;if(!l.target)return q();!function(e){let a=!1,l=e;for(;l;){if(l.id===E){a=!0;break}l=l.parentElement}return a}(l.target)?q():null==(a=z.value)||a.focus()}));const D=t(),G=t(),H=t(null);a(N,H),a(P,l((()=>L.value)));const J=g((async(e,a)=>{var l;const{type:t,node:o}=e||{};try{if("update"===t)return void(S(L.search)&&L.search({...o,isLeaf:!0}));H.value=o;const e=await(S(L.search)&&L.search(o,a));G.value=_(e)?e:o}finally{H.value=null,await r(),null==(l=D.value)||l.syncPosition()}}),400);return(a,l)=>(o(),u(n(K),{class:"search-cascader",trigger:"manual",show:n(I),"onUpdate:show":l[1]||(l[1]=e=>s(I)?I.value=e:null),"show-arrow":!1,placement:"bottom-start",style:i(n(R)),width:e.options.length?void 0:"trigger",ref_key:"popoverRef",ref:D},{trigger:c((()=>[p(n(C),{class:"search-cascader__input",placeholder:n(I)?e.editPlaceholder:e.placeholder,clearable:e.clearable,onClear:U,value:n(T),"onUpdate:value":l[0]||(l[0]=e=>s(T)?T.value=e:null),ref_key:"inputRef",ref:z,onFocus:$,onClick:B,onKeydown:v(B,["enter"])},null,8,["placeholder","clearable","value","onKeydown"])])),default:c((()=>[d("section",{id:n(E)},[p(n(A),{"label-key":e.labelKey,"value-key":e.valueKey,options:e.options,onNodeClick:n(J),"current-node":G.value},{empty:c((()=>[f(a.$slots,"empty")])),_:3},8,["label-key","value-key","options","onNodeClick","current-node"])],8,F)])),_:3},8,["show","style","width"]))}}),[["__file","SearchCascader.vue"]]);export{L as default};
1
+ import{defineComponent as e,provide as a,computed as l,ref as t,nextTick as r,watch as o,openBlock as u,createBlock as n,unref as s,isRef as i,normalizeStyle as c,withCtx as v,createVNode as d,createElementVNode as p,renderSlot as f}from"vue";import{uuidGenerator as y}from"../../../shared/utils/index.js";import{NOOP as h}from"@vue/shared";import{useDebounceFn as m,useEventBus as g,useVModel as b,onClickOutside as w}from"@vueuse/core";import{isString as k,isArray as S,isFunction as _,isObject as K}from"lodash-es";import{NPopover as C,NInput as N}from"naive-ui";import{InjectionSearchCascaderCheckAbleLevel as P,InjectionKeyboardEventBus as j,InjectionSearchCascaderLoadingNode as x,InjectionSearchCascaderValue as A}from"./constants/index.js";import{useCssVariable as U}from"./hooks/useCssVariable.js";import{SearchMenu as V}from"./components/SearchMenu.js";import F from"../../../_virtual/plugin-vue_export-helper.js";const L=["id"];var B=F(e({__name:"SearchCascader",props:{value:{type:[String,Array]},show:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},childKey:{type:String,default:"children"},placeholder:{type:String,default:"请选择"},editPlaceholder:{type:String,default:"请输入关键字进行搜索"},options:{type:Array,default:()=>[]},search:{type:Function},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},checkAbleLevel:{type:[Number,String],default:"last"},beforeSetValue:{type:Function}},emits:["update:value","focus","update:show"],setup(e,{emit:F}){const B=e;function E(){var e;e=[],Promise.resolve(_(B.beforeSetValue)?B.beforeSetValue(e):e).then((e=>F("update:value",e)),h)}function I(e){var a;"INPUT"===(null==(a=e.target)?void 0:a.tagName)&&H()}const R=m((e=>{var a;"INPUT"!==(null==(a=e.target)?void 0:a.tagName)||"Enter"!==e.code||q.value?M.emit(e.key):H()}),50),T=U(),M=g("cascaderKeydown"),$=y(),q=b(B,"show",F);a(P,l((()=>B.checkAbleLevel))),a(j,M);const z=t(""),D=l({get:()=>q.value?z.value:k(B.value)?B.value:S(B.value)?B.value.reduce(((e,a,l)=>0===l?a[B.labelKey]:e+" / "+a[B.labelKey]),""):"",set(e){z.value=e,Z(void 0,e)}});function G(e){F("focus",e)}function H(){q.value||(q.value=!0,z.value="",Z())}async function J(){var e;q.value=!1,null==(e=O.value)||e.blur()}const O=t();w(O,(e=>{var a;if(!q.value)return;const l=e;if(!l.target)return J();!function(e){let a=!1,l=e;for(;l;){if(l.id===$){a=!0;break}l=l.parentElement}return a}(l.target)?J():null==(a=O.value)||a.focus()}));const Q=t(),W=t(),X=t(),Y=t(null);a(x,Y),a(A,l((()=>B.value)));const Z=m((async(e,a)=>{var l;const{type:t,node:o}=e||{};try{if("update"===t)return void(_(B.search)&&B.search({...o,isLeaf:!0}));Y.value=o;const e=await(_(B.search)&&B.search(o,a));W.value=K(e)?e:o}finally{Y.value=null,await r(),null==(l=Q.value)||l.syncPosition()}}),400),ee=e=>{X.value=e};return o((()=>B.show),(e=>{e&&(X.value={})})),(a,l)=>(u(),n(s(C),{class:"search-cascader",trigger:"manual",show:s(q),"onUpdate:show":l[1]||(l[1]=e=>i(q)?q.value=e:null),"show-arrow":!1,placement:"bottom-start",style:c(s(T)),width:e.options.length?void 0:"trigger",ref_key:"popoverRef",ref:Q},{trigger:v((()=>[d(s(N),{class:"search-cascader__input",placeholder:s(q)?e.editPlaceholder:e.placeholder,clearable:e.clearable,onClear:E,value:s(D),"onUpdate:value":l[0]||(l[0]=e=>i(D)?D.value=e:null),ref_key:"inputRef",ref:O,onFocus:G,onClick:I,onKeydown:s(R)},null,8,["placeholder","clearable","value","onKeydown"])])),default:v((()=>[p("section",{id:s($)},[d(s(V),{"label-key":e.labelKey,"value-key":e.valueKey,options:e.options,onNodeClick:s(Z),onChangeCursor:ee,"current-node":W.value,"cursor-node":X.value},{empty:v((()=>[f(a.$slots,"empty")])),_:3},8,["label-key","value-key","options","onNodeClick","current-node","cursor-node"])],8,L)])),_:3},8,["show","style","width"]))}}),[["__file","SearchCascader.vue"]]);export{B as default};
@@ -20,7 +20,10 @@ export declare const SearchMenu: import("vue").DefineComponent<{
20
20
  currentNode: {
21
21
  type: PropType<AnyObject>;
22
22
  };
23
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "nodeClick"[], "nodeClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
23
+ cursorNode: {
24
+ type: PropType<AnyObject>;
25
+ };
26
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("nodeClick" | "changeCursor")[], "nodeClick" | "changeCursor", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
24
27
  childKey: {
25
28
  type: StringConstructor;
26
29
  default: string;
@@ -40,8 +43,12 @@ export declare const SearchMenu: import("vue").DefineComponent<{
40
43
  currentNode: {
41
44
  type: PropType<AnyObject>;
42
45
  };
46
+ cursorNode: {
47
+ type: PropType<AnyObject>;
48
+ };
43
49
  }>> & {
44
50
  onNodeClick?: ((...args: any[]) => any) | undefined;
51
+ onChangeCursor?: ((...args: any[]) => any) | undefined;
45
52
  }, {
46
53
  options: AnyObject[];
47
54
  valueKey: string;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,inject as a,createVNode as l,withModifiers as r,ref as n,createTextVNode as o}from"vue";import{traverse as i}from"../../../../shared/utils/index.js";import{Reload as s,ChevronForward as u}from"@vicons/ionicons5";import{NOOP as c}from"@vue/shared";import{useVirtualList as p}from"@vueuse/core";import{isNumber as d,isArray as v,isEqual as y,isString as f,isFunction as m}from"lodash-es";import{NCheckbox as h}from"naive-ui";import{InjectionSearchCascaderLoadingNode as K,InjectionSearchCascaderValue as b,InjectionSearchCascaderCheckAbleLevel as _}from"../constants/index.js";const k=e({props:{options:{type:Array,default:()=>[]},activeNodes:{type:Array,default:()=>[]},level:{type:Number,required:!0},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"}},emits:["nodeClick"],setup(e,{emit:n}){const o=t((()=>e.options)),{list:i,containerProps:m,wrapperProps:k}=p(o,{itemHeight:32,overscan:5}),g=a(K),C=a(b),N=a(_),S=t((()=>d(N.value)&&N.value<=e.level));function x(t){const a=function(e){const t=[e];let a=e;for(;a.parent;)a=a.parent,t.unshift(a);return t}(t);if(v(C.value))return y(l(a,e.valueKey),l(C.value,e.valueKey));if(f(C.value)){const t=C.value.split("/").map((e=>e.trim()));return y(t,l(a,e.labelKey))}return!1;function l(e,t){return e.map((e=>e[t]))}}return()=>l("div",{class:"search-cascader__optionWrapper",ref:m.ref,style:m.style,onScroll:m.onScroll},[l("div",{style:k.value.style},[i.value.map((t=>{return l("div",{class:["search-cascader__option",{"search-cascader__option--active":(a=t.data,null==(o=e.activeNodes)?void 0:o.includes(a))}],onClick:()=>n("nodeClick",{type:"search",node:t.data}),title:t.data[e.labelKey]},[l("div",{class:"search-cascader__optionText"},[S.value?l(h,{style:{marginRight:"8px"},checked:x(t.data),onClick:r(c,["stop"]),onUpdateChecked:e=>e&&function(e){n("nodeClick",{type:"update",node:e})}(t.data)},null):null,t.data[e.labelKey]]),g.value===t.data?l(s,{class:"rotate"},null):t.data.isLeaf?null:l(u,null,null)]);var a,o}))])])}}),g=e({props:{childKey:{type:String,default:"children"},options:{type:Array,default:()=>[]},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},currentNode:{type:Object}},emits:["nodeClick"],setup(e,{slots:t,emit:a}){const r=n([]);function s(t,n){return l(k,{level:n+1,labelKey:e.labelKey,valueKey:e.valueKey,activeNodes:r.value,onNodeClick:e=>a("nodeClick",e),options:t},null)}function u(t){let a=!1;return i(t,((t,l)=>{t===e.currentNode&&(a=!0,l())}),["children"]),a}function c(){if(!v(e.options)||!e.currentNode)return[];const t=[e.options];let a=e.options;for(r.value.length=0;v(a);){const l=a.find(u);if(!l)break;r.value.push(l),a=l[e.childKey],t.push(a)}return t}return()=>l("section",{class:"search-cascader__menuWrapper"},[v(e.options)&&e.options.length?e.currentNode?c().map(s):s(e.options,0):l("section",{class:"search-cascader__emptyWrapper"},[m(t.empty)?t.empty():l("section",null,[o("empty")])])])}});export{g as SearchMenu};
1
+ import{defineComponent as e,computed as r,inject as t,createVNode as o,withModifiers as n,ref as a,createTextVNode as l}from"vue";import{traverse as c}from"../../../../shared/utils/index.js";import{Reload as s,ChevronForward as u}from"@vicons/ionicons5";import{NOOP as i}from"@vue/shared";import{useVirtualList as d}from"@vueuse/core";import{isNumber as p,isArray as f,isEqual as v,isString as y,isFunction as h}from"lodash-es";import{NCheckbox as m}from"naive-ui";import{InjectionSearchCascaderLoadingNode as g,InjectionSearchCascaderValue as N,InjectionSearchCascaderCheckAbleLevel as C,InjectionKeyboardEventBus as b}from"../constants/index.js";const k=e({props:{options:{type:Array,default:()=>[]},activeNodes:{type:Array,default:()=>[]},level:{type:Number,required:!0},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},cursorNode:{type:Object,default:()=>({})}},emits:["nodeClick","changeCursor"],setup(e,{emit:a}){const l=r((()=>e.options)),{list:c,containerProps:h,wrapperProps:k}=d(l,{itemHeight:32,overscan:5}),K=t(g),_=t(N),x=t(C),A=t(b),S=r((()=>p(x.value)&&x.value<=e.level));function j(e){return Object.keys(e).length<=0}function w(r){return e.cursorNode==r}function I(r){const t=function(e){const r=[e];let t=e;for(;t.parent;)t=t.parent,r.unshift(t);return r}(r);if(f(_.value))return v(o(t,e.valueKey),o(_.value,e.valueKey));if(y(_.value)){const r=_.value.split("/").map((e=>e.trim()));return v(r,o(t,e.labelKey))}return!1;function o(e,r){return e.map((e=>e[r]))}}function O(e){const r=h.ref.value;if(r){const t=32*e-(null==r?void 0:r.clientHeight);r.scrollTo(0,t>0?t:0)}}return A.on((function(r){function t(){return S.value?a("nodeClick",{type:"update",node:e.cursorNode}):a("nodeClick",{type:"search",node:e.cursorNode})}if("ArrowUp"===r){if(j(e.cursorNode))return;const r=l.value.findIndex((r=>r===e.cursorNode));if(r>=0){const e=0===r?l.value.length-1:r-1,t=l.value[e];a("changeCursor",t),O(e+3)}}if("ArrowRight"===r){if(j(e.cursorNode))return;a("nodeClick",{type:"search",node:e.cursorNode}),a("changeCursor",{})}if("ArrowDown"===r){if(j(e.cursorNode))return a("changeCursor",l.value[0]);const r=l.value.findIndex((r=>r===e.cursorNode));if(r>=0){const e=r>=l.value.length-1?0:r+1,t=l.value[e];a("changeCursor",t),O(e+1)}}if("ArrowLeft"===r&&e.activeNodes.length){const r=e.activeNodes.slice(-1);a("changeCursor",r[0])}" "===r&&t(),"Enter"===r&&t()})),()=>o("div",{class:"search-cascader__optionWrapper",ref:h.ref,style:h.style,onScroll:h.onScroll},[o("div",{style:k.value.style},[c.value.map((r=>{return o("div",{class:["search-cascader__option",{"search-cascader__option--active":(t=r.data,(null==(l=e.activeNodes)?void 0:l.includes(t))||w(r.data))}],onClick:()=>a("nodeClick",{type:"search",node:r.data}),title:r.data[e.labelKey]},[o("div",{class:"search-cascader__optionText"},[S.value?o(m,{style:{marginRight:"8px"},checked:I(r.data),onClick:n(i,["stop"]),onUpdateChecked:e=>e&&function(e){a("nodeClick",{type:"update",node:e})}(r.data)},null):null,r.data[e.labelKey]]),K.value===r.data?o(s,{class:"rotate"},null):r.data.isLeaf?null:o(u,null,null)]);var t,l}))])])}}),K=e({props:{childKey:{type:String,default:"children"},options:{type:Array,default:()=>[]},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},currentNode:{type:Object},cursorNode:{type:Object}},emits:["nodeClick","changeCursor"],setup(e,{slots:r,emit:t}){const n=a([]);function s(r,a){return o(k,{level:a+1,labelKey:e.labelKey,valueKey:e.valueKey,activeNodes:n.value,onNodeClick:e=>t("nodeClick",e),onChangeCursor:e=>t("changeCursor",e),options:r,cursorNode:e.cursorNode},null)}function u(r){let t=!1;return c(r,((r,o)=>{r===e.currentNode&&(t=!0,o())}),["children"]),t}function i(){if(!f(e.options)||!e.currentNode)return[];const r=[e.options];let t=e.options;for(n.value.length=0;f(t);){const o=t.find(u);if(!o)break;n.value.push(o),t=o[e.childKey],r.push(t)}if(e.cursorNode){const t=r.findIndex((r=>r.findIndex((r=>r===e.cursorNode))>=0));if(t>=0){const e=r.slice(0,t+1);return n.value.splice(t,r.length),e}}return r}return()=>o("section",{class:"search-cascader__menuWrapper"},[f(e.options)&&e.options.length?e.currentNode?i().map(s):s(e.options,0):o("section",{class:"search-cascader__emptyWrapper"},[h(r.empty)?r.empty():o("section",null,[l("empty")])])])}});export{K as SearchMenu};
@@ -3,3 +3,4 @@ import { ComputedRef, InjectionKey, Ref } from 'vue';
3
3
  export declare const InjectionSearchCascaderLoadingNode: InjectionKey<Ref<Nullable<AnyObject>>>;
4
4
  export declare const InjectionSearchCascaderValue: InjectionKey<ComputedRef<AnyObject[] | string>>;
5
5
  export declare const InjectionSearchCascaderCheckAbleLevel: InjectionKey<ComputedRef<'last' | number>>;
6
+ export declare const InjectionKeyboardEventBus: InjectionKey<AnyObject>;
@@ -1 +1 @@
1
- const e=Symbol("InjectionSearchCascaderLoadingNode "),a=Symbol("InjectionSearchCascaderValue "),c=Symbol("InjectionSearchCascaderCheckAbleLevel");export{c as InjectionSearchCascaderCheckAbleLevel,e as InjectionSearchCascaderLoadingNode,a as InjectionSearchCascaderValue};
1
+ const e=Symbol("InjectionSearchCascaderLoadingNode "),o=Symbol("InjectionSearchCascaderValue "),a=Symbol("InjectionSearchCascaderCheckAbleLevel"),c=Symbol("InjectionKeyboardEventBus");export{c as InjectionKeyboardEventBus,a as InjectionSearchCascaderCheckAbleLevel,e as InjectionSearchCascaderLoadingNode,o as InjectionSearchCascaderValue};
@@ -1 +1 @@
1
- import{defineComponent as t,ref as e,reactive as l,computed as a,watch as i,openBlock as n,createElementBlock as s,unref as d,createCommentVNode as o,withDirectives as r,createElementVNode as c,normalizeClass as b,createVNode as u,withCtx as p,Fragment as f,renderList as h,createBlock as y,createTextVNode as v,toDisplayString as m,vShow as g,nextTick as C}from"vue";import{useMessage as L,NAnchor as I,NAnchorLink as S}from"naive-ui";import E from"./components/label-classify.vue.js";import{handleLabelColor as w}from"../../../shared/utils/vexutils.js";import x from"../../../_virtual/plugin-vue_export-helper.js";import A from"xe-utils";const O={key:0,class:"label-disable-wrap"},K=[c("p",{class:"label-disable-title"},"无可选标签",-1),c("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],j={style:{height:"100%"}},k={class:"label-wrap"},T=["id"],_={class:"edit-label-type"};var B=x(t({__name:"LabelFormContent",props:{item:{default:()=>({})},isEdit:{type:Boolean,default:!0},isLock:{type:Boolean,default:!1},labelSelectedList:null,isChangeWindow:{type:Boolean},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},labelOptions:null,sourceType:{default:""},explicit:{type:Boolean,default:!1}},emits:["explicitOnChange","change","updateLabelData"],setup(t,{expose:x,emit:B}){const D=t,F=L(),V=e(null),P=l({editLabelItem:{},inited:!1,labelSelectedEdit:[],labelAnchorKey:"",cacheAnchorKey:"",labelConfig:{}});let N=e(0);const W=a((()=>{if(!P.inited)return!1;let t=P.labelConfig;return!t||Object.keys(t).every((e=>!t[e].itemList))})),$=a((()=>{let t=[].concat(...P.labelSelectedEdit,...D.labelSelectedList);return J(t,"labelId")})),q=a((()=>{const t=$.value||[];return Array.isArray(t)?t.map((t=>t.labelId)):[]})),J=(t,e)=>{let l={};return t.reduce(((t,a)=>(!l[a[e]]&&(l[a[e]]=t.push(a)),t)),[])},R=()=>{if(P.labelSelectedEdit=$.value,"object"==typeof P.labelConfig){Object.keys(P.labelConfig||{}).forEach((t=>{var e;let l=(null==(e=P.labelConfig[t])?void 0:e.itemList)||[];l.length&&l.forEach((t=>{q.value.includes(t.labelId)&&(t.isSelect=!0)}))}))}},z=(t,e)=>{if(!t)return;let l=Object.keys(t)||[];if(!l.length)return;let a=t[l[0]].curKey;if(e&&"string"==typeof e){let[i]=e.split("~"),n=l.find((e=>t[e]&&t[e].curKey&&t[e].curKey.includes(i)));n&&(a=t[n].curKey)}a&&Y(a)},G=(t,e)=>{e.showAdd=!0;const l=t.target.nextElementSibling;C((()=>{var t;null==(t=null==l?void 0:l.firstChild)||t.focus()}))},H=(t,e)=>{setTimeout((()=>{e.addVal?Q(e):e.showAdd=!1}),150)},M=(t,e)=>{e.addVal="",e.showAdd=!1},Q=async t=>{var e;if(!!t.itemList.filter((t=>!(t.isPublic&&1==t.isPublic))).find((e=>e.labelName===t.addVal)))return F.error("标签名称重复!"),!1;let l="";l=(null==(e=t.itemList)?void 0:e.length)?t.itemList[0].parentColor||t.parentColor||"":(null==t?void 0:t.parentColor)||"";const a={type:t.typeId,name:t.addVal,parentColor:l},{status:i}=await D.saveLabelItem(a,t);i&&(F.success("添加成功!"),B("updateLabelData"),t.showAdd=!1)},U=(t,e,l,a)=>{var i;const n=l.itemList,s=l.multipleChoice;let d=(null==(i=P.labelSelectedEdit)?void 0:i.length)&&A.clone(P.labelSelectedEdit,!0)||[];if(t){if(d.some((t=>t.labelId==e.labelId)))return;if(2==s){const{typeId:t,labelId:l}=e;d=d.filter((e=>e.typeId!==t)),n.forEach((t=>{t.labelId!==l&&(t.isSelect=!1)}))}d.push(e)}else{const t=d.findIndex((t=>t.labelId==e.labelId));-1!=t&&d.splice(t,1)}P.labelSelectedEdit=[...d],N.value++,D.explicit&&B("explicitOnChange",[...P.labelSelectedEdit])},X=async t=>{const{status:e}=await D.deleteLabel(t,D.item);if(e){F.success("删除成功!");for(const e in P.labelConfig){const l=P.labelConfig[e].itemList.findIndex((e=>e.labelId==t.labelId));-1!=l&&P.labelConfig[e].itemList.splice(l,1)}const e=P.labelSelectedEdit||[],l=D.labelSelectedList||[];if(e&&e.length){const l=e.findIndex((e=>e.labelId==t.labelId));-1!=l&&e.splice(l,1)}if(l&&l.length){const e=l.findIndex((e=>e.labelId==t.labelId));-1!=e&&l.splice(e,1),B("change",[...l],D.item)}B("updateLabelData")}else F.warning("删除失败")},Y=t=>{t&&setTimeout((()=>{let e,l="#"+t;e=V.value.querySelector("a[href='"+l+"']"),e&&e.click(),P.labelAnchorKey=t}),32)},Z=t=>{t.preventDefault()},tt=t=>{if(!t)return;let e=t.slice(1);P.cacheAnchorKey=e},et=()=>{var t;return null==(t=V.value)?void 0:t.querySelector(".right-label-wrap")};return i((()=>D.labelOptions),(t=>{t&&(()=>{var t;if(D.isLock)return;const e=JSON.parse(JSON.stringify(D.labelOptions));for(let l in e){let a=(null==(t=e[l])?void 0:t.typeId)||"";Object.assign(e[l],{curKey:`${l}_${a}}`})}P.labelConfig=e,C((()=>{let t;R(),D.explicit&&P.inited&&(t=P.labelAnchorKey),z(P.labelConfig,t),P.inited=!0}))})()}),{immediate:!0,deep:!0}),x({resetShowAdd:()=>{let{labelObj:t}=P.editLabelItem;if(t&&Object.keys(t).length)for(let e in t){let l=t[e];Object.assign(l,{showAdd:!1})}},handleLabelForm:t=>{t([...P.labelSelectedEdit||[]])},handleResetOptions:()=>{},hanldeSetLabelItem:(t,e)=>{if("object"==typeof P.labelConfig){Object.keys(P.labelConfig||{}).forEach((l=>{var a;let i=(null==(a=P.labelConfig[l])?void 0:a.itemList)||[];i.length&&i.forEach((l=>{t==l.labelId&&(l.isSelect=e)}))}))}if(!1===e&&Array.isArray(P.labelSelectedEdit)){const e=P.labelSelectedEdit.findIndex((e=>e.labelId==t));-1!=e&&P.labelSelectedEdit.splice(e,1)}}}),(e,l)=>(n(),s("div",{class:"c-label-form-content",ref_key:"labelFormContent",ref:V},[d(W)?(n(),s("div",O,K)):o("v-if",!0),r(c("div",j,[c("div",k,[o(" 表单内嵌打开标签组件的样式 "),o(' <div v-if="explicit" class="explicit-continer">\n\t\t\t\t\t<n-tabs :value="state.labelAnchorKey" type="card" @change="labelAnchorTabsOnChange" tab-position="top">\n\t\t\t\t\t\t<template v-for="(v, i) in state.labelConfig">\n\t\t\t\t\t\t\t<n-tab-pane :name="v.curKey">\n\t\t\t\t\t\t\t\t<span slot="tab">\n\t\t\t\t\t\t\t\t\t{{ i }}\n\t\t\t\t\t\t\t\t\t<span class="edit-label-type">({{ v.multipleChoice == 2 ? \'单\' : \'多\' }}选)</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<div class="explicit-label-wrap left-label-wrap">\n\t\t\t\t\t\t\t\t\t<div class="edit-label-content">\n\t\t\t\t\t\t\t\t\t\t<labelClassify\n\t\t\t\t\t\t\t\t\t\t\t:classifyItem="v"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelChange="handleLabelChange"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelColor="handleLabelColor"\n\t\t\t\t\t\t\t\t\t\t\t:handleDelLabel="handleDelLabel"\n\t\t\t\t\t\t\t\t\t\t\t:hanldeBlur="hanldeBlur"\n\t\t\t\t\t\t\t\t\t\t\t:handleAddLabel="handleAddLabel"\n\t\t\t\t\t\t\t\t\t\t\t:clearaddVal="clearaddVal"\n\t\t\t\t\t\t\t\t\t\t\t:isEdit="isEdit"\n\t\t\t\t\t\t\t\t\t\t\t:sourceType="sourceType"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</n-tab-pane>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</n-tabs>\n\t\t\t\t</div> '),o("\n\t\t\t\t\t普通标签样式\n\t\t\t\t\tv-else\n\t\t\t\t\texplicit\n\t\t\t\t "),c("div",{class:b(["left-label-wrap",{"total-left-label-wrap":t.isChangeWindow}])},[u(d(I),{"offset-target":et,type:"block",onClick:Z,onChange:tt},{default:p((()=>[(n(!0),s(f,null,h(P.labelConfig,((t,e)=>(n(),y(d(S),{href:`#${t.curKey}`,title:String(e)},null,8,["href","title"])))),256))])),_:1})],2),o(' v-if="!explicit" '),c("div",{class:b(["right-label-wrap",{"total-right-label-wrap":t.isChangeWindow}])},[(n(!0),s(f,null,h(P.labelConfig,((e,l)=>(n(),s("div",{key:l,class:"edit-label-content"},[c("div",{class:"edit-label",id:e.curKey},[v(m(l)+" ",1),c("span",_,"("+m(2==e.multipleChoice?"单":"多")+"选)",1)],8,T),u(E,{classifyItem:e,handleLabelChange:U,handleLabelColor:d(w),handleDelLabel:X,hanldeBlur:H,handleAddLabel:G,clearaddVal:M,isEdit:t.isEdit,sourceType:t.sourceType},null,8,["classifyItem","handleLabelColor","isEdit","sourceType"])])))),128))],2)])],512),[[g,!d(W)]])],512))}}),[["__file","LabelFormContent.vue"]]);export{B as default};
1
+ import{defineComponent as t,ref as e,reactive as l,computed as a,watch as i,openBlock as n,createElementBlock as s,unref as r,createCommentVNode as d,withDirectives as o,createElementVNode as c,normalizeClass as b,createVNode as u,withCtx as p,Fragment as f,renderList as h,createBlock as y,createTextVNode as v,toDisplayString as m,vShow as g,nextTick as C}from"vue";import{useMessage as L,NAnchor as I,NAnchorLink as S}from"naive-ui";import E from"./components/label-classify.vue.js";import{handleLabelColor as w}from"../../../shared/utils/vexutils.js";import x from"../../../_virtual/plugin-vue_export-helper.js";import A from"../../../shared/utils/vexutilsExpand.js";const O={key:0,class:"label-disable-wrap"},j=[c("p",{class:"label-disable-title"},"无可选标签",-1),c("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],K={style:{height:"100%"}},k={class:"label-wrap"},T=["id"],_={class:"edit-label-type"};var B=x(t({__name:"LabelFormContent",props:{item:{default:()=>({})},isEdit:{type:Boolean,default:!0},isLock:{type:Boolean,default:!1},labelSelectedList:null,isChangeWindow:{type:Boolean},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},labelOptions:null,sourceType:{default:""},explicit:{type:Boolean,default:!1}},emits:["explicitOnChange","change","updateLabelData"],setup(t,{expose:x,emit:B}){const D=t,F=L(),V=e(null),P=l({editLabelItem:{},inited:!1,labelSelectedEdit:[],labelAnchorKey:"",cacheAnchorKey:"",labelConfig:{}});let N=e(0);const W=a((()=>{if(!P.inited)return!1;let t=P.labelConfig;return!t||Object.keys(t).every((e=>!t[e].itemList))})),$=a((()=>{let t=[].concat(...P.labelSelectedEdit,...D.labelSelectedList);return J(t,"labelId")})),q=a((()=>{const t=$.value||[];return Array.isArray(t)?t.map((t=>t.labelId)):[]})),J=(t,e)=>{let l={};return t.reduce(((t,a)=>(!l[a[e]]&&(l[a[e]]=t.push(a)),t)),[])},R=()=>{if(P.labelSelectedEdit=$.value,"object"==typeof P.labelConfig){Object.keys(P.labelConfig||{}).forEach((t=>{var e;let l=(null==(e=P.labelConfig[t])?void 0:e.itemList)||[];l.length&&l.forEach((t=>{q.value.includes(t.labelId)&&(t.isSelect=!0)}))}))}},z=(t,e)=>{if(!t)return;let l=Object.keys(t)||[];if(!l.length)return;let a=t[l[0]].curKey;if(e&&"string"==typeof e){let[i]=e.split("~"),n=l.find((e=>t[e]&&t[e].curKey&&t[e].curKey.includes(i)));n&&(a=t[n].curKey)}a&&Y(a)},G=(t,e)=>{e.showAdd=!0;const l=t.target.nextElementSibling;C((()=>{var t;null==(t=null==l?void 0:l.firstChild)||t.focus()}))},H=(t,e)=>{setTimeout((()=>{e.addVal?Q(e):e.showAdd=!1}),150)},M=(t,e)=>{e.addVal="",e.showAdd=!1},Q=async t=>{var e;if(!!t.itemList.filter((t=>!(t.isPublic&&1==t.isPublic))).find((e=>e.labelName===t.addVal)))return F.error("标签名称重复!"),!1;let l="";l=(null==(e=t.itemList)?void 0:e.length)?t.itemList[0].parentColor||t.parentColor||"":(null==t?void 0:t.parentColor)||"";const a={type:t.typeId,name:t.addVal,parentColor:l},{status:i}=await D.saveLabelItem(a,t);i&&(F.success("添加成功!"),B("updateLabelData"),t.showAdd=!1)},U=(t,e,l,a)=>{var i;const n=l.itemList,s=l.multipleChoice;let r=(null==(i=P.labelSelectedEdit)?void 0:i.length)&&A.clone(P.labelSelectedEdit,!0)||[];if(t){if(r.some((t=>t.labelId==e.labelId)))return;if(2==s){const{typeId:t,labelId:l}=e;r=r.filter((e=>e.typeId!==t)),n.forEach((t=>{t.labelId!==l&&(t.isSelect=!1)}))}r.push(e)}else{const t=r.findIndex((t=>t.labelId==e.labelId));-1!=t&&r.splice(t,1)}P.labelSelectedEdit=[...r],N.value++,D.explicit&&B("explicitOnChange",[...P.labelSelectedEdit])},X=async t=>{const{status:e}=await D.deleteLabel(t,D.item);if(e){F.success("删除成功!");for(const e in P.labelConfig){const l=P.labelConfig[e].itemList.findIndex((e=>e.labelId==t.labelId));-1!=l&&P.labelConfig[e].itemList.splice(l,1)}const e=P.labelSelectedEdit||[],l=D.labelSelectedList||[];if(e&&e.length){const l=e.findIndex((e=>e.labelId==t.labelId));-1!=l&&e.splice(l,1)}if(l&&l.length){const e=l.findIndex((e=>e.labelId==t.labelId));-1!=e&&l.splice(e,1),B("change",[...l],D.item)}B("updateLabelData")}else F.warning("删除失败")},Y=t=>{t&&setTimeout((()=>{let e,l="#"+t;e=V.value.querySelector("a[href='"+l+"']"),e&&e.click(),P.labelAnchorKey=t}),32)},Z=t=>{t.preventDefault()},tt=t=>{if(!t)return;let e=t.slice(1);P.cacheAnchorKey=e},et=()=>{var t;return null==(t=V.value)?void 0:t.querySelector(".right-label-wrap")};return i((()=>D.labelOptions),(t=>{t&&(()=>{var t;if(D.isLock)return;const e=JSON.parse(JSON.stringify(D.labelOptions));for(let l in e){let a=(null==(t=e[l])?void 0:t.typeId)||"";Object.assign(e[l],{curKey:`${l}_${a}}`})}P.labelConfig=e,C((()=>{let t;R(),D.explicit&&P.inited&&(t=P.labelAnchorKey),z(P.labelConfig,t),P.inited=!0}))})()}),{immediate:!0,deep:!0}),x({resetShowAdd:()=>{let{labelObj:t}=P.editLabelItem;if(t&&Object.keys(t).length)for(let e in t){let l=t[e];Object.assign(l,{showAdd:!1})}},handleLabelForm:t=>{t([...P.labelSelectedEdit||[]])},handleResetOptions:()=>{},hanldeSetLabelItem:(t,e)=>{if("object"==typeof P.labelConfig){Object.keys(P.labelConfig||{}).forEach((l=>{var a;let i=(null==(a=P.labelConfig[l])?void 0:a.itemList)||[];i.length&&i.forEach((l=>{t==l.labelId&&(l.isSelect=e)}))}))}if(!1===e&&Array.isArray(P.labelSelectedEdit)){const e=P.labelSelectedEdit.findIndex((e=>e.labelId==t));-1!=e&&P.labelSelectedEdit.splice(e,1)}}}),(e,l)=>(n(),s("div",{class:"c-label-form-content",ref_key:"labelFormContent",ref:V},[r(W)?(n(),s("div",O,j)):d("v-if",!0),o(c("div",K,[c("div",k,[d(" 表单内嵌打开标签组件的样式 "),d(' <div v-if="explicit" class="explicit-continer">\r\n\t\t\t\t\t<n-tabs :value="state.labelAnchorKey" type="card" @change="labelAnchorTabsOnChange" tab-position="top">\r\n\t\t\t\t\t\t<template v-for="(v, i) in state.labelConfig">\r\n\t\t\t\t\t\t\t<n-tab-pane :name="v.curKey">\r\n\t\t\t\t\t\t\t\t<span slot="tab">\r\n\t\t\t\t\t\t\t\t\t{{ i }}\r\n\t\t\t\t\t\t\t\t\t<span class="edit-label-type">({{ v.multipleChoice == 2 ? \'单\' : \'多\' }}选)</span>\r\n\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t<div class="explicit-label-wrap left-label-wrap">\r\n\t\t\t\t\t\t\t\t\t<div class="edit-label-content">\r\n\t\t\t\t\t\t\t\t\t\t<labelClassify\r\n\t\t\t\t\t\t\t\t\t\t\t:classifyItem="v"\r\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelChange="handleLabelChange"\r\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelColor="handleLabelColor"\r\n\t\t\t\t\t\t\t\t\t\t\t:handleDelLabel="handleDelLabel"\r\n\t\t\t\t\t\t\t\t\t\t\t:hanldeBlur="hanldeBlur"\r\n\t\t\t\t\t\t\t\t\t\t\t:handleAddLabel="handleAddLabel"\r\n\t\t\t\t\t\t\t\t\t\t\t:clearaddVal="clearaddVal"\r\n\t\t\t\t\t\t\t\t\t\t\t:isEdit="isEdit"\r\n\t\t\t\t\t\t\t\t\t\t\t:sourceType="sourceType"\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</n-tab-pane>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</n-tabs>\r\n\t\t\t\t</div> '),d("\r\n\t\t\t\t\t普通标签样式\r\n\t\t\t\t\tv-else\r\n\t\t\t\t\texplicit\r\n\t\t\t\t "),c("div",{class:b(["left-label-wrap",{"total-left-label-wrap":t.isChangeWindow}])},[u(r(I),{"offset-target":et,type:"block",onClick:Z,onChange:tt},{default:p((()=>[(n(!0),s(f,null,h(P.labelConfig,((t,e)=>(n(),y(r(S),{href:`#${t.curKey}`,title:String(e)},null,8,["href","title"])))),256))])),_:1})],2),d(' v-if="!explicit" '),c("div",{class:b(["right-label-wrap",{"total-right-label-wrap":t.isChangeWindow}])},[(n(!0),s(f,null,h(P.labelConfig,((e,l)=>(n(),s("div",{key:l,class:"edit-label-content"},[c("div",{class:"edit-label",id:e.curKey},[v(m(l)+" ",1),c("span",_,"("+m(2==e.multipleChoice?"单":"多")+"选)",1)],8,T),u(E,{classifyItem:e,handleLabelChange:U,handleLabelColor:r(w),handleDelLabel:X,hanldeBlur:H,handleAddLabel:G,clearaddVal:M,isEdit:t.isEdit,sourceType:t.sourceType},null,8,["classifyItem","handleLabelColor","isEdit","sourceType"])])))),128))],2)])],512),[[g,!r(W)]])],512))}}),[["__file","LabelFormContent.vue"]]);export{B as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,reactive as t,computed as a,onMounted as i,watch as o,openBlock as s,createElementBlock as n,Fragment as d,createElementVNode as c,createBlock as b,unref as m,withCtx as r,renderList as p,normalizeStyle as u,createVNode as L,toDisplayString as y,withDirectives as h,normalizeClass as C,createTextVNode as f,vShow as g,createCommentVNode as v,mergeProps as I,nextTick as w}from"vue";import{NSpace as x,NTag as S,NTooltip as k,NIcon as O,NModal as N}from"naive-ui";import{AddCircleOutline as j}from"@vicons/ionicons5";import W from"./LabelFormContent.vue.js";import{handleLabelColor as P}from"../../../shared/utils/vexutils.js";import _ from"xe-utils";const B={class:"c-select-label"},A=c("span",null,"常用",-1),E={key:2,class:"outexplicit"},H=c("span",null,"选择标签",-1),z={class:"svg-wrap"};var F=e({__name:"SelectLabel",props:{selectedList:{type:Array,default:()=>[]},item:{type:Object,default:()=>({})},isDetail:{type:Boolean,default:!1},isLock:{type:Boolean,default:!1},sourceType:{type:String,default:""},explicit:{type:Boolean,default:!1},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},queryCommonlabels:{type:Function,default:()=>Promise.resolve({data:{}})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})}},emits:["onChange"],setup(e,{emit:F}){const V=e,T=l(null),U=t({labelVisible:!1,editLabelItem:{},labelSelectedList:[],labelSelectedEdit:[],inited:!1,isChangeWindow:!1,modalWidth:"763px",modalHeight:"404px",maxHeight:"404px",commonLabelList:[],multipleChoiceConfig:{}});const D=a((()=>{const e=(null==V?void 0:V.item)||{};return(1==e.is_edit||e.isShow)&&!V.isDetail})),$=(e,l)=>{e.length&&e.forEach((e=>{let t=l.some((l=>l.labelId==e.labelId));e.isSelect=t}))},q=(e,l)=>{let t=U.multipleChoiceConfig,a=U.labelSelectedList||[];if(e){if(a.some((e=>e.labelId==l.labelId)))return;"2"==t[l.typeId]&&(a=a.filter((e=>e.typeId!==l.typeId))),a.push(l)}else{const e=a.findIndex((e=>e.labelId==l.labelId));-1!=e&&a.splice(e,1)}F("onChange",[...a]),U.labelSelectedList=a},J=e=>{V.isLock||(V.explicit||"init"===e||(U.labelVisible=!0),M(V.item))},R=()=>{var e;V.explicit||(null==(e=T.value)||e.resetShowAdd(),U.editLabelItem.showAdd=!1,U.editLabelItem={},U.inited=!1,U.modalWidth="763px",U.modalHeight="404px",U.maxHeight="404px",U.isChangeWindow=!1,U.labelVisible=!1)},K=()=>{U.isChangeWindow=!U.isChangeWindow;let e=document.body.clientHeight;U.modalWidth="763px"===U.modalWidth?"100%":"763px",U.modalHeight="404px"===U.modalHeight?e-110+"px":"404px",U.maxHeight="auto"===U.modalHeight?"404px":"none"},G=()=>{var e;null==(e=T.value)||e.handleLabelForm((e=>{F("onChange",[...e]),U.labelSelectedList=e,$(U.commonLabelList,e),R()}))},M=async(e,l)=>{const{rows:t,results:a}=await V.getLabelList(e,{update:l}),i=t||[],o={},s=`${e.val_key}_${e.name}`,n=l?[...U.labelSelectedEdit||[]]:[...U.labelSelectedList||[]];i.forEach((e=>{e.cacheKey=s,e.isSelect=!1,o[e.typeName]?o[e.typeName].itemList.push({...e}):o[e.typeName]={itemList:[{...e}],showAdd:!1,addVal:"",typeName:e.typeName,typeId:e.typeId}})),a&&(e.labelObj=o,e.labelList=i),l&&(U.labelSelectedEdit=n),U.editLabelItem=e,Q(a)},Q=e=>{if(!e)return!1;let l=Object.keys(e),t={},a=(e.typeList||[]).reduce(((e,l)=>(t[l.typeId]=l.multipleChoice,e[l.typeName]={multipleChoice:l.multipleChoice,parentColor:l.parentColor,allowCreateByPersonal:l.allowCreateByPersonal},e)),{});V.explicit&&(U.multipleChoiceConfig=t),l.forEach((l=>{var t,i,o,s,n,d,c;"typeList"!==l&&("emptyTypes"!==l?_.isPlainObject(e[l])?U.editLabelItem.labelObj[l]?(U.editLabelItem.labelObj[l].isNoAdd=!0,U.editLabelItem.labelObj[l].multipleChoice=null==(i=a[l])?void 0:i.multipleChoice,U.editLabelItem.labelObj[l].allowCreateByPersonal=null==(o=a[l])?void 0:o.allowCreateByPersonal,U.editLabelItem.labelObj[l].parentColor=null==(s=a[l])?void 0:s.parentColor):U.editLabelItem.labelObj[l]={addVal:"",showAdd:!1,itemList:!1,typeId:"",typeName:l,allowCreateByPersonal:null==(t=a[l])?void 0:t.allowCreateByPersonal,...a[l]||{}}:(U.editLabelItem.labelObj[l].multipleChoice=null==(n=a[l])?void 0:n.multipleChoice,U.editLabelItem.labelObj[l].allowCreateByPersonal=null==(d=a[l])?void 0:d.allowCreateByPersonal,U.editLabelItem.labelObj[l].parentColor=null==(c=a[l])?void 0:c.parentColor):e[l].forEach((e=>{U.editLabelItem.labelObj[e.typeName]={addVal:"",showAdd:!1,itemList:[],typeId:e.typeId,typeName:e.typeName,allowCreateByPersonal:e.allowCreateByPersonal,...a[e.typeName]||{}}})))}))},X=()=>{M(V.item,!0)},Y=()=>{G()},Z=(e,l)=>{V.explicit&&w((()=>{var t;null==(t=T.value)||t.hanldeSetLabelItem(e,l)}))};return i((()=>{V.explicit?J():(async e=>{const{rows:l,results:t}=await V.getLabelList(e);if(!t)return!1;let a=(t.typeList||[]).reduce(((e,l)=>(e[l.typeId]=l.multipleChoice,e)),{});U.multipleChoiceConfig=a})(V.item)})),o((()=>V.selectedList),(e=>{if(e){let l=Array.isArray(e)?e:[];U.labelSelectedList=JSON.parse(JSON.stringify(l)),$(U.commonLabelList,U.labelSelectedList)}}),{immediate:!0,deep:!0}),o((()=>{var e;return null==(e=V.item)?void 0:e.label_type}),(e=>{e&&"form"==V.sourceType&&(async e=>{var l;let{data:t={}}=await V.queryCommonlabels(e)||{};if("SUCCESS"!==t.result)return;let a=(null==(l=t.map)?void 0:l.rows)||[];$(a,U.labelSelectedList),U.commonLabelList=a})(e)}),{immediate:!0,deep:!0}),(l,t)=>(s(),n(d,null,[c("div",B,[e.explicit?v("v-if",!0):(s(),b(m(x),{key:0,align:"center"},{default:r((()=>[(s(!0),n(d,null,p(U.labelSelectedList,(e=>(s(),b(m(S),{bordered:!1,key:e.labelId,style:u(m(P)(e,!0)),closable:m(D),onClose:l=>(e=>{const l=U.labelSelectedList||[],t=l.findIndex((l=>l.labelId==e.labelId));-1!=t&&l.splice(t,1),F("onChange",[...l]),U.labelSelectedList=l,Z(e.labelId,!1)})(e),size:"small"},{default:r((()=>[L(m(k),{placement:"top-start"},{trigger:r((()=>[c("span",null,y(e.labelName),1)])),default:r((()=>[c("span",null,y(e.labelName),1)])),_:2},1024)])),_:2},1032,["style","closable","onClose"])))),128)),e.explicit?v("v-if",!0):h((s(),n("span",{key:0,class:C(["form-add-icon form-add-icon-label",{disable:e.isLock}]),onClick:J},[L(m(O),{class:"add-icon",component:m(j)},null,8,["component"]),f(" 新增 ")],2)),[[g,m(D)]])])),_:1})),"form"==e.sourceType&&U.commonLabelList.length&&m(D)&&!e.explicit?(s(),b(m(x),{key:1,align:"center",class:"common-label"},{default:r((()=>[A,(s(!0),n(d,null,p(U.commonLabelList,((e,l)=>(s(),b(m(S),{checkable:"",checked:e.isSelect,"onUpdate:checked":l=>function(e,l){l.isSelect=e,q(e,l)}(l,e),key:l,style:u(m(P)(e)),size:"small"},{default:r((()=>[L(m(k),{placement:"top-start"},{trigger:r((()=>[c("span",null,y(e.labelName),1)])),default:r((()=>[c("span",null,y(e.labelName),1)])),_:2},1024)])),_:2},1032,["checked","onUpdate:checked","style"])))),128))])),_:1})):v("v-if",!0),e.explicit&&m(D)?(s(),n("div",E,[L(W,I(l.$attrs,{ref_key:"labelFormContentRef",ref:T,explicit:e.explicit,labelSelectedList:U.labelSelectedList,isChangeWindow:U.isChangeWindow,labelOptions:U.editLabelItem.labelObj,deleteLabel:e.deleteLabel,saveLabelItem:e.saveLabelItem,onUpdateLabelData:X,onExplicitOnChange:Y}),null,16,["explicit","labelSelectedList","isChangeWindow","labelOptions","deleteLabel","saveLabelItem"])])):v("v-if",!0)]),v(" 弹窗 "),L(m(N),{preset:"dialog",class:C(["label-form-modal-wrap modal-wrap standard-modal standard-modal-white",{"modal-screen":U.isChangeWindow}]),show:U.labelVisible,"onUpdate:show":t[0]||(t[0]=e=>U.labelVisible=e),onPositiveClick:G,onNegativeClick:R,onClose:R,"mask-closable":!1,"close-on-esc":!1,"show-icon":!1,"negative-text":"取消","positive-text":"确定",style:u({width:U.modalWidth})},{header:r((()=>[H,c("div",z,[c("i",{onClick:K,class:C(["iconfont-select-label",U.isChangeWindow?"icon-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-select-label-menzhenyishengzhanxitongtubiaozuidahua"])},null,2)])])),default:r((()=>[L(W,I(l.$attrs,{ref_key:"labelFormContentRef",ref:T,labelSelectedList:U.labelSelectedList,isChangeWindow:U.isChangeWindow,labelOptions:U.editLabelItem.labelObj,sourceType:e.sourceType,deleteLabel:e.deleteLabel,saveLabelItem:e.saveLabelItem,onUpdateLabelData:X}),null,16,["labelSelectedList","isChangeWindow","labelOptions","sourceType","deleteLabel","saveLabelItem"])])),_:1},8,["show","class","style"])],64))}});export{F as default};
1
+ import{defineComponent as e,ref as l,reactive as t,computed as a,onMounted as i,watch as o,openBlock as s,createElementBlock as n,Fragment as d,createElementVNode as c,createBlock as b,unref as m,withCtx as r,renderList as p,normalizeStyle as u,createVNode as L,toDisplayString as h,withDirectives as y,normalizeClass as C,createTextVNode as f,vShow as g,createCommentVNode as v,mergeProps as I,nextTick as w}from"vue";import{NSpace as x,NTag as S,NTooltip as k,NIcon as O,NModal as j}from"naive-ui";import{AddCircleOutline as N}from"@vicons/ionicons5";import W from"./LabelFormContent.vue.js";import{handleLabelColor as P}from"../../../shared/utils/vexutils.js";import _ from"../../../shared/utils/vexutilsExpand.js";const B={class:"c-select-label"},E=c("span",null,"常用",-1),A={key:2,class:"outexplicit"},H=c("span",null,"选择标签",-1),z={class:"svg-wrap"};var F=e({__name:"SelectLabel",props:{selectedList:{type:Array,default:()=>[]},item:{type:Object,default:()=>({})},isDetail:{type:Boolean,default:!1},isLock:{type:Boolean,default:!1},sourceType:{type:String,default:""},explicit:{type:Boolean,default:!1},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},queryCommonlabels:{type:Function,default:()=>Promise.resolve({data:{}})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})}},emits:["onChange"],setup(e,{emit:F}){const V=e,T=l(null),U=t({labelVisible:!1,editLabelItem:{},labelSelectedList:[],labelSelectedEdit:[],inited:!1,isChangeWindow:!1,modalWidth:"763px",modalHeight:"404px",maxHeight:"404px",commonLabelList:[],multipleChoiceConfig:{}});const D=a((()=>{const e=(null==V?void 0:V.item)||{};return(1==e.is_edit||e.isShow)&&!V.isDetail})),$=(e,l)=>{e.length&&e.forEach((e=>{let t=l.some((l=>l.labelId==e.labelId));e.isSelect=t}))},q=(e,l)=>{let t=U.multipleChoiceConfig,a=U.labelSelectedList||[];if(e){if(a.some((e=>e.labelId==l.labelId)))return;"2"==t[l.typeId]&&(a=a.filter((e=>e.typeId!==l.typeId))),a.push(l)}else{const e=a.findIndex((e=>e.labelId==l.labelId));-1!=e&&a.splice(e,1)}F("onChange",[...a]),U.labelSelectedList=a},J=e=>{V.isLock||(V.explicit||"init"===e||(U.labelVisible=!0),M(V.item))},R=()=>{var e;V.explicit||(null==(e=T.value)||e.resetShowAdd(),U.editLabelItem.showAdd=!1,U.editLabelItem={},U.inited=!1,U.modalWidth="763px",U.modalHeight="404px",U.maxHeight="404px",U.isChangeWindow=!1,U.labelVisible=!1)},K=()=>{U.isChangeWindow=!U.isChangeWindow;let e=document.body.clientHeight;U.modalWidth="763px"===U.modalWidth?"100%":"763px",U.modalHeight="404px"===U.modalHeight?e-110+"px":"404px",U.maxHeight="auto"===U.modalHeight?"404px":"none"},G=()=>{var e;null==(e=T.value)||e.handleLabelForm((e=>{F("onChange",[...e]),U.labelSelectedList=e,$(U.commonLabelList,e),R()}))},M=async(e,l)=>{const{rows:t,results:a}=await V.getLabelList(e,{update:l}),i=t||[],o={},s=`${e.val_key}_${e.name}`,n=l?[...U.labelSelectedEdit||[]]:[...U.labelSelectedList||[]];i.forEach((e=>{e.cacheKey=s,e.isSelect=!1,o[e.typeName]?o[e.typeName].itemList.push({...e}):o[e.typeName]={itemList:[{...e}],showAdd:!1,addVal:"",typeName:e.typeName,typeId:e.typeId}})),a&&(e.labelObj=o,e.labelList=i),l&&(U.labelSelectedEdit=n),U.editLabelItem=e,Q(a)},Q=e=>{if(!e)return!1;let l=Object.keys(e),t={},a=(e.typeList||[]).reduce(((e,l)=>(t[l.typeId]=l.multipleChoice,e[l.typeName]={multipleChoice:l.multipleChoice,parentColor:l.parentColor,allowCreateByPersonal:l.allowCreateByPersonal},e)),{});V.explicit&&(U.multipleChoiceConfig=t),l.forEach((l=>{var t,i,o,s,n,d,c;"typeList"!==l&&("emptyTypes"!==l?_.isPlainObject(e[l])?U.editLabelItem.labelObj[l]?(U.editLabelItem.labelObj[l].isNoAdd=!0,U.editLabelItem.labelObj[l].multipleChoice=null==(i=a[l])?void 0:i.multipleChoice,U.editLabelItem.labelObj[l].allowCreateByPersonal=null==(o=a[l])?void 0:o.allowCreateByPersonal,U.editLabelItem.labelObj[l].parentColor=null==(s=a[l])?void 0:s.parentColor):U.editLabelItem.labelObj[l]={addVal:"",showAdd:!1,itemList:!1,typeId:"",typeName:l,allowCreateByPersonal:null==(t=a[l])?void 0:t.allowCreateByPersonal,...a[l]||{}}:(U.editLabelItem.labelObj[l].multipleChoice=null==(n=a[l])?void 0:n.multipleChoice,U.editLabelItem.labelObj[l].allowCreateByPersonal=null==(d=a[l])?void 0:d.allowCreateByPersonal,U.editLabelItem.labelObj[l].parentColor=null==(c=a[l])?void 0:c.parentColor):e[l].forEach((e=>{U.editLabelItem.labelObj[e.typeName]={addVal:"",showAdd:!1,itemList:[],typeId:e.typeId,typeName:e.typeName,allowCreateByPersonal:e.allowCreateByPersonal,...a[e.typeName]||{}}})))}))},X=()=>{M(V.item,!0)},Y=()=>{G()},Z=(e,l)=>{V.explicit&&w((()=>{var t;null==(t=T.value)||t.hanldeSetLabelItem(e,l)}))};return i((()=>{V.explicit?J():(async e=>{const{rows:l,results:t}=await V.getLabelList(e);if(!t)return!1;let a=(t.typeList||[]).reduce(((e,l)=>(e[l.typeId]=l.multipleChoice,e)),{});U.multipleChoiceConfig=a})(V.item)})),o((()=>V.selectedList),(e=>{if(e){let l=Array.isArray(e)?e:[];U.labelSelectedList=JSON.parse(JSON.stringify(l)),$(U.commonLabelList,U.labelSelectedList)}}),{immediate:!0,deep:!0}),o((()=>{var e;return null==(e=V.item)?void 0:e.label_type}),(e=>{e&&"form"==V.sourceType&&(async e=>{var l;let{data:t={}}=await V.queryCommonlabels(e)||{};if("SUCCESS"!==t.result)return;let a=(null==(l=t.map)?void 0:l.rows)||[];$(a,U.labelSelectedList),U.commonLabelList=a})(e)}),{immediate:!0,deep:!0}),(l,t)=>(s(),n(d,null,[c("div",B,[e.explicit?v("v-if",!0):(s(),b(m(x),{key:0,align:"center"},{default:r((()=>[(s(!0),n(d,null,p(U.labelSelectedList,(e=>(s(),b(m(S),{bordered:!1,key:e.labelId,style:u(m(P)(e,!0)),closable:m(D),onClose:l=>(e=>{const l=U.labelSelectedList||[],t=l.findIndex((l=>l.labelId==e.labelId));-1!=t&&l.splice(t,1),F("onChange",[...l]),U.labelSelectedList=l,Z(e.labelId,!1)})(e),size:"small"},{default:r((()=>[L(m(k),{placement:"top-start"},{trigger:r((()=>[c("span",null,h(e.labelName),1)])),default:r((()=>[c("span",null,h(e.labelName),1)])),_:2},1024)])),_:2},1032,["style","closable","onClose"])))),128)),e.explicit?v("v-if",!0):y((s(),n("span",{key:0,class:C(["form-add-icon form-add-icon-label",{disable:e.isLock}]),onClick:J},[L(m(O),{class:"add-icon",component:m(N)},null,8,["component"]),f(" 新增 ")],2)),[[g,m(D)]])])),_:1})),"form"==e.sourceType&&U.commonLabelList.length&&m(D)&&!e.explicit?(s(),b(m(x),{key:1,align:"center",class:"common-label"},{default:r((()=>[E,(s(!0),n(d,null,p(U.commonLabelList,((e,l)=>(s(),b(m(S),{checkable:"",checked:e.isSelect,"onUpdate:checked":l=>function(e,l){l.isSelect=e,q(e,l)}(l,e),key:l,style:u(m(P)(e)),size:"small"},{default:r((()=>[L(m(k),{placement:"top-start"},{trigger:r((()=>[c("span",null,h(e.labelName),1)])),default:r((()=>[c("span",null,h(e.labelName),1)])),_:2},1024)])),_:2},1032,["checked","onUpdate:checked","style"])))),128))])),_:1})):v("v-if",!0),e.explicit&&m(D)?(s(),n("div",A,[L(W,I(l.$attrs,{ref_key:"labelFormContentRef",ref:T,explicit:e.explicit,labelSelectedList:U.labelSelectedList,isChangeWindow:U.isChangeWindow,labelOptions:U.editLabelItem.labelObj,deleteLabel:e.deleteLabel,saveLabelItem:e.saveLabelItem,onUpdateLabelData:X,onExplicitOnChange:Y}),null,16,["explicit","labelSelectedList","isChangeWindow","labelOptions","deleteLabel","saveLabelItem"])])):v("v-if",!0)]),v(" 弹窗 "),L(m(j),{preset:"dialog",class:C(["label-form-modal-wrap modal-wrap standard-modal standard-modal-white",{"modal-screen":U.isChangeWindow}]),show:U.labelVisible,"onUpdate:show":t[0]||(t[0]=e=>U.labelVisible=e),onPositiveClick:G,onNegativeClick:R,onClose:R,"mask-closable":!1,"close-on-esc":!1,"show-icon":!1,"negative-text":"取消","positive-text":"确定",style:u({width:U.modalWidth})},{header:r((()=>[H,c("div",z,[c("i",{onClick:K,class:C(["iconfont-select-label",U.isChangeWindow?"icon-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-select-label-menzhenyishengzhanxitongtubiaozuidahua"])},null,2)])])),default:r((()=>[L(W,I(l.$attrs,{ref_key:"labelFormContentRef",ref:T,labelSelectedList:U.labelSelectedList,isChangeWindow:U.isChangeWindow,labelOptions:U.editLabelItem.labelObj,sourceType:e.sourceType,deleteLabel:e.deleteLabel,saveLabelItem:e.saveLabelItem,onUpdateLabelData:X}),null,16,["labelSelectedList","isChangeWindow","labelOptions","sourceType","deleteLabel","saveLabelItem"])])),_:1},8,["show","class","style"])],64))}});export{F as default};