cnhis-design-vue 3.2.14-beta.21 → 3.2.14-beta.26

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 (222) hide show
  1. package/README.md +87 -87
  2. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  3. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  4. package/es/components/base-search/src/index.vue2.js +1 -1
  5. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  6. package/es/components/big-table/src/components/NoData.vue2.js +1 -1
  7. package/es/components/big-table/src/components/edit-form/edit-input.js +1 -1
  8. package/es/components/big-table/src/hooks/useNestTable.js +1 -1
  9. package/es/components/body-select/src/index.vue2.js +1 -1
  10. package/es/components/button-print/index.d.ts +4 -0
  11. package/es/components/button-print/src/ButtonPrint.vue.d.ts +4 -0
  12. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  13. package/es/components/button-print/src/components/EditFormat.vue2.js +1 -1
  14. package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
  15. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -0
  16. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  17. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  18. package/es/components/button-print/src/components/Preview.vue2.js +1 -1
  19. package/es/components/button-print/src/utils/dialog.js +1 -1
  20. package/es/components/button-print/src/utils/print.js +1 -1
  21. package/es/components/card-reader-sdk/src/components/readCardDialog.vue2.js +1 -1
  22. package/es/components/card-reader-sdk/src/utils/readHealthCard.js +1 -1
  23. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  24. package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
  25. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  26. package/es/components/classification/src/index.vue2.js +1 -1
  27. package/es/components/default-page/src/constants/index.js +1 -1
  28. package/es/components/default-page/src/index.vue2.js +1 -1
  29. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
  30. package/es/components/expand-field/src/components/FormItemPerson.vue2.js +1 -1
  31. package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
  32. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  33. package/es/components/expand-field/src/index.vue2.js +1 -1
  34. package/es/components/expand-field/src/utils/constant.js +1 -1
  35. package/es/components/fabric-chart/index.d.ts +19 -2
  36. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +19 -2
  37. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  38. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  39. package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +13 -0
  40. package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
  41. package/es/components/fabric-chart/src/components/useStyle.js +1 -1
  42. package/es/components/fabric-chart/src/constants/index.js +1 -1
  43. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  44. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +1 -0
  45. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  46. package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
  47. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  48. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +1 -0
  49. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  50. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  51. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  52. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  53. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  54. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  55. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  56. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +1 -0
  57. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  58. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +7 -1
  59. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  60. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
  61. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  62. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  63. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  64. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +1 -0
  65. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  66. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  67. package/es/components/fabric-chart/src/interface.d.ts +2 -0
  68. package/es/components/field-set/src/FieldColor.vue.d.ts +2 -2
  69. package/es/components/field-set/src/FieldColor.vue2.js +1 -1
  70. package/es/components/field-set/src/FieldFilter.vue.d.ts +2 -2
  71. package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
  72. package/es/components/field-set/src/FieldSet.vue.d.ts +2 -2
  73. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  74. package/es/components/field-set/src/TableStyle.vue2.js +1 -1
  75. package/es/components/field-set/src/components/condition.vue2.js +1 -1
  76. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
  77. package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
  78. package/es/components/field-set/src/components/table-row.vue.d.ts +2 -2
  79. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  80. package/es/components/field-set/src/constants/filter.js +1 -1
  81. package/es/components/field-set/src/constants/index.js +1 -1
  82. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  83. package/es/components/form-config/src/hooks/useLocale.js +1 -1
  84. package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
  85. package/es/components/form-render/src/components/renderer/switch.js +1 -1
  86. package/es/components/iho-chat/index.d.ts +20 -4
  87. package/es/components/iho-chat/src/Index.vue.d.ts +20 -4
  88. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  89. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  90. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  91. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  92. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +1 -0
  93. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  94. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +1 -1
  95. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  96. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  97. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  98. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  99. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  100. package/es/components/iho-chat/src/components/MessageTemplate.vue.d.ts +1 -1
  101. package/es/components/iho-chat/src/components/MessageTemplate.vue2.js +1 -1
  102. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  103. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  104. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  105. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  106. package/es/components/iho-chat/src/constants/index.d.ts +2 -1
  107. package/es/components/iho-chat/src/constants/index.js +1 -1
  108. package/es/components/iho-chat/src/hooks/useData.d.ts +3 -3
  109. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  110. package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -1
  111. package/es/components/iho-chat/src/utils/chatSock.js +1 -1
  112. package/es/components/iho-chat/src/utils/index.js +1 -1
  113. package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
  114. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  115. package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
  116. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
  117. package/es/components/index.css +1 -1
  118. package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
  119. package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
  120. package/es/components/map/src/Map.vue2.js +1 -1
  121. package/es/components/picture-clipper/src/PictureClipper.vue2.js +1 -1
  122. package/es/components/quick-search/src/index.vue2.js +1 -1
  123. package/es/components/recommend-search/src/components/BaseSearch.js +1 -1
  124. package/es/components/recommend-search/src/components/RecommendInput.vue2.js +1 -1
  125. package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +1 -1
  126. package/es/components/scale-view/index.d.ts +31 -0
  127. package/es/components/scale-view/src/ScaleView.vue.d.ts +13 -0
  128. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  129. package/es/components/scale-view/src/components/NoData.vue2.js +1 -1
  130. package/es/components/scale-view/src/components/composables/choose-common.js +1 -1
  131. package/es/components/scale-view/src/components/formitem/r-checkbox.d.ts +9 -0
  132. package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
  133. package/es/components/scale-view/src/components/formitem/r-input.d.ts +9 -0
  134. package/es/components/scale-view/src/components/formitem/r-input.js +1 -1
  135. package/es/components/scale-view/src/components/formitem/r-radio.d.ts +9 -0
  136. package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
  137. package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
  138. package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
  139. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  140. package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
  141. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
  142. package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
  143. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  144. package/es/components/scale-view/src/hooks/use-component.d.ts +72 -0
  145. package/es/components/scale-view/style/index.css +1 -1
  146. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  147. package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
  148. package/es/components/select-label/src/components/label-classify.vue2.js +1 -1
  149. package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -1
  150. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
  151. package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -1
  152. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  153. package/es/components/select-person/src/SelectPersonType.vue2.js +1 -1
  154. package/es/components/select-person/src/components/SearchOrgAndStaff.vue2.js +1 -1
  155. package/es/components/select-person/src/index.vue2.js +1 -1
  156. package/es/components/slider-tree/src/index.vue2.js +1 -1
  157. package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
  158. package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
  159. package/es/components/table-export-field/src/index.vue2.js +1 -1
  160. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue2.js +1 -1
  161. package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
  162. package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -1
  163. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -1
  164. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
  165. package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue2.js +1 -1
  166. package/es/components/table-filter/src/components/classify-filter/components/InputNumberGroup.vue2.js +1 -1
  167. package/es/components/table-filter/src/components/classify-filter/helpers/options.js +1 -1
  168. package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.js +1 -1
  169. package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
  170. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +1 -1
  171. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue2.js +1 -1
  172. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
  173. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +1 -1
  174. package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue2.js +1 -1
  175. package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue2.js +1 -1
  176. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue2.js +1 -1
  177. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
  178. package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
  179. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  180. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  181. package/es/components/template-render/src/components/index.d.ts +23 -23
  182. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  183. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
  184. package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
  185. package/es/shared/assets/img/ai__avatar.png.js +1 -1
  186. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  187. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  188. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  189. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  190. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  191. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  192. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  193. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  194. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  195. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  196. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  197. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  198. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  199. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  200. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  201. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  202. package/es/shared/assets/img/failure.png.js +1 -1
  203. package/es/shared/assets/img/logo.png.js +1 -1
  204. package/es/shared/assets/img/no-permission.png.js +1 -1
  205. package/es/shared/assets/img/nodata.png.js +1 -1
  206. package/es/shared/assets/img/notfound.png.js +1 -1
  207. package/es/shared/assets/img/qr.png.js +1 -1
  208. package/es/shared/assets/img/success.png.js +1 -1
  209. package/es/shared/assets/img/table_style_2.png.js +1 -1
  210. package/es/shared/assets/img/video.png.js +1 -1
  211. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  212. package/es/shared/assets/img/xb_big.png.js +1 -1
  213. package/es/shared/assets/img/xb_small.png.js +1 -1
  214. package/es/shared/package.json.js +1 -1
  215. package/package.json +2 -2
  216. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  217. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  218. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  219. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  220. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  221. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  222. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -2,7 +2,7 @@ import { InjectionKey } from 'vue';
2
2
  import { ChatSock } from '../utils/chatSock';
3
3
  import { AnyObject } from '../../../../shared/types';
4
4
  export declare const InjectionIChatData: InjectionKey<ReturnType<typeof initData>>;
5
- export declare function initData(props: AnyObject, emit: (event: 'template-click' | 'unread-message-update' | 'session-change', ...args: any[]) => void): {
5
+ export declare function initData(props: AnyObject, emit: (event: 'template-click' | 'unread-message-update' | 'session-change' | 'session-close', ...args: any[]) => void): {
6
6
  cssVars: import("vue").ComputedRef<AnyObject>;
7
7
  stompClient: import("vue").Ref<ChatSock | undefined>;
8
8
  state: {
@@ -45,7 +45,7 @@ export declare function initData(props: AnyObject, emit: (event: 'template-click
45
45
  setCurrentSessionItem: (item: AnyObject) => void;
46
46
  setUpdateSessionItem: (item: AnyObject) => void;
47
47
  setSessionList: (list: AnyObject[]) => void;
48
- emit: (event: 'template-click' | 'unread-message-update' | 'session-change', ...args: any[]) => void;
48
+ emit: (event: 'template-click' | 'unread-message-update' | 'session-change' | 'session-close', ...args: any[]) => void;
49
49
  };
50
50
  export declare const useData: () => {
51
51
  cssVars: import("vue").ComputedRef<AnyObject>;
@@ -90,5 +90,5 @@ export declare const useData: () => {
90
90
  setCurrentSessionItem: (item: AnyObject) => void;
91
91
  setUpdateSessionItem: (item: AnyObject) => void;
92
92
  setSessionList: (list: AnyObject[]) => void;
93
- emit: (event: 'template-click' | 'unread-message-update' | 'session-change', ...args: any[]) => void;
93
+ emit: (event: 'template-click' | 'unread-message-update' | 'session-change' | 'session-close', ...args: any[]) => void;
94
94
  };
@@ -1 +1 @@
1
- import{ref as e,computed as t,onBeforeUnmount as o}from"vue";import{useData as n}from"./useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as a}from"../constants/index.js";import"../api/index.js";import{formatSeconds as i}from"../utils/index.js";import l from"trtc-sdk-v5";function E(){const E={timer:null,seconds:0},{state:s,sendMessage:r}=n(),d=e(""),u=e(!0),m=e(!0),c=t((()=>s.currentAVMsg.chatMessageType===a.AUDIO)),R=t((()=>"call"===s.currentAVMsg.callMode)),T=t((()=>{var e,t;return c.value?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.130"))||"语音":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.131"))||"视频"})),v=l.create();function A(){d.value="00:00:00",E.timer&&clearInterval(E.timer),E.timer=null,E.seconds=0}return o((()=>{A()})),{state:s,sendMessage:r,trtc:v,timing:d,voiceOpen:u,videocamOpen:m,isAudio:c,isCall:R,startTimer:function(){A(),E.timer=setInterval((()=>{E.seconds++,d.value=i(E.seconds)}),1e3)},resetTimer:A,toggleAudio:async function(){await v.updateLocalAudio({mute:!u.value}),u.value=!u.value},toggleVideo:async function(){await v.updateLocalVideo({mute:!m.value}),m.value=!m.value},messageTypeText:T,time:E,installEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:n,handleRemoteVideoAvailable:a}){v.on(l.EVENT.ERROR,e),v.on(l.EVENT.REMOTE_USER_ENTER,t),v.on(l.EVENT.REMOTE_AUDIO_AVAILABLE,o),v.on(l.EVENT.REMOTE_USER_EXIT,n),c.value||v.on(l.EVENT.REMOTE_VIDEO_AVAILABLE,a)},uninstallEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:n,handleRemoteVideoAvailable:a}){v.off(l.EVENT.ERROR,e),v.off(l.EVENT.REMOTE_USER_ENTER,t),v.off(l.EVENT.REMOTE_AUDIO_AVAILABLE,o),v.off(l.EVENT.REMOTE_USER_EXIT,n),c.value||v.off(l.EVENT.REMOTE_VIDEO_AVAILABLE,a)}}}export{E as useVideo};
1
+ import{ref as e,computed as t,onBeforeUnmount as o}from"vue";import{useData as n}from"./useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as a}from"../constants/index.js";import"../api/index.js";import{formatSeconds as i}from"../utils/index.js";import"lodash-es";import l from"trtc-sdk-v5";function E(){const E={timer:null,seconds:0},{state:s,sendMessage:r}=n(),d=e(""),u=e(!0),m=e(!0),c=t((()=>s.currentAVMsg.chatMessageType===a.AUDIO)),R=t((()=>"call"===s.currentAVMsg.callMode)),T=t((()=>{var e,t;return c.value?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.130"))||"语音":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.131"))||"视频"})),v=l.create();function A(){d.value="00:00:00",E.timer&&clearInterval(E.timer),E.timer=null,E.seconds=0}return o((()=>{A()})),{state:s,sendMessage:r,trtc:v,timing:d,voiceOpen:u,videocamOpen:m,isAudio:c,isCall:R,startTimer:function(){A(),E.timer=setInterval((()=>{E.seconds++,d.value=i(E.seconds)}),1e3)},resetTimer:A,toggleAudio:async function(){await v.updateLocalAudio({mute:!u.value}),u.value=!u.value},toggleVideo:async function(){await v.updateLocalVideo({mute:!m.value}),m.value=!m.value},messageTypeText:T,time:E,installEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:n,handleRemoteVideoAvailable:a}){v.on(l.EVENT.ERROR,e),v.on(l.EVENT.REMOTE_USER_ENTER,t),v.on(l.EVENT.REMOTE_AUDIO_AVAILABLE,o),v.on(l.EVENT.REMOTE_USER_EXIT,n),c.value||v.on(l.EVENT.REMOTE_VIDEO_AVAILABLE,a)},uninstallEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:n,handleRemoteVideoAvailable:a}){v.off(l.EVENT.ERROR,e),v.off(l.EVENT.REMOTE_USER_ENTER,t),v.off(l.EVENT.REMOTE_AUDIO_AVAILABLE,o),v.off(l.EVENT.REMOTE_USER_EXIT,n),c.value||v.off(l.EVENT.REMOTE_VIDEO_AVAILABLE,a)}}}export{E as useVideo};
@@ -1 +1 @@
1
- import{onBeforeUnmount as e}from"vue";import{ChatSock as s}from"../utils/chatSock.js";import{CHAT_TYPE as t,SUBSCRIBE_MESSAGE_TYPE as n,AV_STATUS as o}from"../constants/index.js";import{readMessageApi as i}from"../api/index.js";import{isAudioOrVideoMessage as c}from"../utils/index.js";function r(r,a){const{stompClient:d,state:u,openSession:l,closeSession:p,setSessionList:h,setUpdateSessionItem:y,setCurrentSessionItem:S}=a,g=[];async function m(e,s){if(u.currentMsg=e,e.sessionKey===u.currentSessionItem.sessionKey)return u.isAppendMsg=!0,e.sender!==u.userInfo.id&&await i({chatType:s,messageIdSet:[e.id],receiver:u.userInfo.id,sender:e.sender}),void S({lastMessageSendTime:e.sendTime,lastMessage:e.content,sortTime:e.sendTime,unreadNum:0,lastSenderName:e.senderName});const t={lastMessageSendTime:e.sendTime,sortTime:e.sendTime,lastMessage:e.content,sessionKey:e.sessionKey,lastSenderName:e.senderName,sender:e.sender};y(t)}async function b({body:e,chatType:s}){try{const i=JSON.parse(e),{messageVo:r,sessionVo:a,chatAvStatusVo:l}=i;switch(i.event){case n.MESSAGE:c(r.content)?!u.showVideo&&!u.showMultipleVideo||r.content.avStatus!==o.IN_CALL?(u.currentMsg=r,Object.assign(u.currentAVMsg,{strRoomId:r.sessionKey,chatMessageType:r.content.chatMessageType,callMode:r.sender===u.userInfo.id?"call":"invite",currentMsg:r}),u.showVideo||u.showMultipleVideo?m(r,s):u.showVideo=!0):(d.value.send("/app/chat/send",{},JSON.stringify({chatType:t.SINGLE,receiver:r.sender,content:{chatMessageType:r.content.chatMessageType,avStatus:o.CALL_BUSY}})),console.log("用户忙!")):m(r,s);break;case n.RECALL_MESSAGE:break;case n.AV_STATUS:Object.assign(u.currentAVMsg,l,{callMode:l.sender===u.userInfo.id?"call":"invite",checkedIds:[]}),u.showVideo||u.showMultipleVideo?console.log("用户忙!"):u.showMultipleVideo=!0;break;case n.NEW_SESSION:if(s===t.GROUP)return;y(a);break;case n.JOIN_GROUP:if(s===t.GROUP)return;y(a),d.value.subscribe(`/topic/group/${a.receiver}`,(({body:e})=>b({body:e,chatType:t.GROUP})));case n.LEAVE_GROUP:}}catch(e){console.log(e)}}!function e(){const n={headers:{AccessToken:r.token,UserId:r.userId},heartbeatFn(){try{d.value.send("test")}catch(s){d.value.disconnect(),e()}},connectCb(){console.log("连接成功"),d.value.subscribe("/user/topic/single",(({body:e})=>b({body:e,chatType:t.SINGLE}))),d.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:n,currentUser:o,sessionVos:i}=s;if(Object.assign(u.userInfo,o,n),!(null==i?void 0:i.length))return;h(i),g.splice(0,g.length),g.push(...i.filter((e=>e.chatType===t.GROUP))),g.forEach((e=>{d.value.subscribe(`/topic/group/${e.receiver}`,(({body:e})=>b({body:e,chatType:t.GROUP})))})),function(){const e=u.sessionList.find((e=>e.sessionKey===r.defaultSessionKey));e&&l(e)}()}catch(e){console.log(e)}}))},errorCb(e,s){}};d.value=new s("/fdp-chat/websocket",n)}(),e((()=>{var e;null==(e=d.value)||e.disconnect()}))}export{r as useWebSocket};
1
+ import{onBeforeUnmount as e}from"vue";import{ChatSock as s}from"../utils/chatSock.js";import{CHAT_TYPE as t,SUBSCRIBE_MESSAGE_TYPE as n,AV_STATUS as o}from"../constants/index.js";import{readMessageApi as i}from"../api/index.js";import{isAudioOrVideoMessage as r}from"../utils/index.js";import{remove as a}from"lodash-es";function c(c,d){const{stompClient:l,state:u,openSession:p,closeSession:h,setSessionList:S,setUpdateSessionItem:y,setCurrentSessionItem:m}=d,g=[];async function b(e,s){if(u.currentMsg=e,e.sessionKey===u.currentSessionItem.sessionKey)return u.isAppendMsg=!0,e.sender!==u.userInfo.id&&await i({chatType:s,messageIdSet:[e.id],receiver:u.userInfo.id,sender:e.sender}),void m({lastMessageSendTime:e.sendTime,lastMessage:e.content,sortTime:e.sendTime,unreadNum:0,lastSenderName:e.senderName});const t={lastMessageSendTime:e.sendTime,sortTime:e.sendTime,lastMessage:e.content,sessionKey:e.sessionKey,lastSenderName:e.senderName,sender:e.sender};y(t)}async function f({body:e,chatType:s}){try{const i=JSON.parse(e),{messageVo:c,sessionVo:d,chatAvStatusVo:p}=i;switch(i.event){case n.MESSAGE:r(c.content)?!u.showVideo&&!u.showMultipleVideo||c.content.avStatus!==o.IN_CALL?(u.currentMsg=c,Object.assign(u.currentAVMsg,{strRoomId:c.sessionKey,chatMessageType:c.content.chatMessageType,callMode:c.sender===u.userInfo.id?"call":"invite",currentMsg:c}),u.showVideo||u.showMultipleVideo?b(c,s):u.showVideo=!0):(l.value.send("/app/chat/send",{},JSON.stringify({chatType:t.SINGLE,receiver:c.sender,content:{chatMessageType:c.content.chatMessageType,avStatus:o.CALL_BUSY}})),console.log("用户忙!")):b(c,s);break;case n.RECALL_MESSAGE:break;case n.AV_STATUS:Object.assign(u.currentAVMsg,p,{callMode:p.sender===u.userInfo.id?"call":"invite",checkedIds:[]}),u.showVideo||u.showMultipleVideo?console.log("用户忙!"):u.showMultipleVideo=!0;break;case n.NEW_SESSION:if(s===t.GROUP)return;y(d);break;case n.JOIN_GROUP:if(s===t.GROUP)return;y(d),l.value.subscribe(`/topic/group/${d.receiver}`,(({body:e})=>f({body:e,chatType:t.GROUP})));break;case n.LEAVE_GROUP:h(),a(u.sessionList,(e=>e.sessionKey===d.sessionKey));case n.DISABLE_SESSION:}}catch(e){console.log(e)}}!function e(){const n={headers:{AccessToken:c.token,UserId:c.userId},heartbeatFn(){try{l.value.send("test")}catch(s){l.value.disconnect(),e()}},connectCb(){console.log("连接成功"),l.value.subscribe("/user/topic/single",(({body:e})=>f({body:e,chatType:t.SINGLE}))),l.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:n,currentUser:o,sessionVos:i}=s;if(Object.assign(u.userInfo,o,n),!(null==i?void 0:i.length))return;S(i),g.splice(0,g.length),g.push(...i.filter((e=>e.chatType===t.GROUP))),g.forEach((e=>{l.value.subscribe(`/topic/group/${e.receiver}`,(({body:e})=>f({body:e,chatType:t.GROUP})))})),function(){const e=u.sessionList.find((e=>e.sessionKey===c.defaultSessionKey));e&&p(e)}()}catch(e){console.log(e)}}),{extraConfig:JSON.stringify(c.extraParams)})},errorCb(e,s){}};l.value=new s("/fdp-chat/websocket",n)}(),e((()=>{var e;null==(e=l.value)||e.disconnect()}))}export{c as useWebSocket};
@@ -1 +1 @@
1
- import t from"stompjs";import i from"sockjs-client/dist/sockjs.min.js";class s{constructor(t,i){this.reconnectionCount=0,this.options={},this.url="",this.url=t,this.options=i,this.connection()}connection(){if(!this.url)return;const s=new i(this.url);this.stompClient=t.over(s),this.stompClient.debug=null,this.stompClient.connect(this.options.headers||{},(()=>{const{connectCb:t}=this.options;t&&t(this.reconnectionCount>0),this.startHeartbeat(),this.subscribe(this.options.subscribeCbs),this.reconnectionCount=0}),(t=>{const i=this.reconnectionCount,{errorCb:s,reconnectMaxCount:e=60}=this.options;s&&s(t,i),i<=e&&this.reconnect()}))}disconnect(){var t;this.heartbeatTimer&&clearTimeout(this.heartbeatTimer),this.reconnectTimer&&clearTimeout(this.reconnectTimer),null==(t=this.stompClient)||t.disconnect(),this.stompClient=void 0}reconnect(){this.reconnectionCount++,this.disconnect(),this.reconnectTimer=setTimeout((()=>{this.connection()}),1e3)}subscribe(...t){const i=this.stompClient;if(i){if(1!==t.length||!Array.isArray(t[0]))return 2===t.length?i.subscribe(...t):void 0;t[0].forEach((t=>{this.subscribe(t.action,t.cb)}))}}startHeartbeat(){const t=this.options.heartbeatFn;if(!t)return;const i=this.options.heartbeatRate||1e4;this.heartbeatTimer=setTimeout((()=>{t(),this.startHeartbeat()}),i)}send(...t){var i;return null==(i=this.stompClient)?void 0:i.send(...t)}}export{s as ChatSock};
1
+ import t from"stompjs";import s from"sockjs-client/dist/sockjs.min.js";class i{constructor(t,s){this.reconnectionCount=0,this.options={},this.url="",this.url=t,this.options=s,this.connection()}connection(){if(!this.url)return;const i=new s(this.url);this.stompClient=t.over(i),this.stompClient.debug=null,this.stompClient.connect(this.options.headers||{},(()=>{const{connectCb:t}=this.options;t&&t(this.reconnectionCount>0),this.startHeartbeat(),this.subscribe(this.options.subscribeCbs),this.reconnectionCount=0}),(t=>{const s=this.reconnectionCount,{errorCb:i,reconnectMaxCount:e=60}=this.options;i&&i(t,s),s<=e&&this.reconnect()}))}disconnect(){var t;this.heartbeatTimer&&clearTimeout(this.heartbeatTimer),this.reconnectTimer&&clearTimeout(this.reconnectTimer),null==(t=this.stompClient)||t.disconnect(),this.stompClient=void 0}reconnect(){this.reconnectionCount++,this.disconnect(),this.reconnectTimer=setTimeout((()=>{this.connection()}),1e3)}subscribe(...t){const s=this.stompClient;if(s&&!(t.length<1))return 1===t.length&&Array.isArray(t[0])?void t[0].forEach((t=>{this.subscribe(t.action,t.cb)})):s.subscribe(...t)}startHeartbeat(){const t=this.options.heartbeatFn;if(!t)return;const s=this.options.heartbeatRate||1e4;this.heartbeatTimer=setTimeout((()=>{t(),this.startHeartbeat()}),s)}send(...t){var s;return null==(s=this.stompClient)?void 0:s.send(...t)}}export{i as ChatSock};
@@ -1 +1 @@
1
- import{isToday as e,format as t,isYesterday as n,startOfDay as r}from"date-fns";import{cloneDeep as o,isNumber as a,isNaN as i}from"lodash-es";import{MESSAGE_TYPE as s}from"../constants/index.js";import{emojis as c}from"./emoji.js";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{createDiscreteApi as u}from"naive-ui";const{message:d}=u(["message"]);function m(r){var o;const a=new Date(r);let i,s;if(e(a))i=s=t(a,"HH:mm");else{i=n(a)?(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.132"))||"昨天":t(a,"MM-dd");const e=a.getFullYear(),r=(new Date).getFullYear();s=t(a,e<r?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:i,msgTime:s,recordTime:function(r){var o,a;const i=new Date(r),s=Date.now()-i.getTime();if(s<6e4)return(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.133"))||"刚刚";if(s<36e5)return Math.ceil(s/1e3/60)+((null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.136"))||"分钟前");if(e(i))return"今天 "+t(i,"HH:mm");if(n(i))return"昨天 "+t(i,"HH:mm");{const e=i.getFullYear(),n=(new Date).getFullYear();return t(i,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}(r)}}function g(e){return o(e||[]).sort(((e,t)=>e.topping&&!t.topping?-1:!e.topping&&t.topping?1:new Date(t.sortTime).getTime()-new Date(e.sortTime).getTime()))}function p(e){if(!(null==e?void 0:e.msg))return"";const{chatMessageType:t="",msg:n=""}=e;let r=n.toString();if(t===s.BLEND){const e=r.match(/\[([^\]]+)\]/g);return null==e||e.forEach((e=>{const n=e.match(/\[([^\]]+)\]/);if(n&&n.length>1){const o=c.findEmoji(n[1]);o&&(r=r.replace(e,`<img data-msg=${n[1]} data-type=${t} class="emoji--min" src=${o} />`))}})),r}const o=e=>new RegExp("\\n*\\["+(e||"")+"(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)]\\n*","g");return r=r.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/@(\S+)(\s+?|$)/g,'@<a href="javascript:;">$1</a>$2').replace(o(),"<$1 $2>").replace(o("/"),"</$1>").replace(/\n/g,"<br>"),r}function f(e){var t;if(e&&a(+e)&&!i(+e)){const t=E(+e),n=t.split(":");let r=t;return 3===n.length&&"00"===n[0]&&(r=`${n[1]}:${n[2]}`),"通话时长 "+r}return(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.138"))||"已取消"}function w(e){var t;if(!e)return"";const{chatMessageType:n,msg:r,messageTemplate:o}=e,a=v(e)?f(r):"";switch(n){case s.TEXT:return p(e);case s.IMAGE:return"[图片]";case s.FILE:return"[文件]";case s.EMOJI:return`<img class="emoji--min" alt=${r} src=${c.findEmoji(r)}>`;case s.TEMPLATE:return null==(t=null==o?void 0:o.setting)?void 0:t.title;case s.VIDEO:return`[视频通话]${a}`;case s.AUDIO:return`[语音通话]${a}`;default:return"[消息]"}}function h(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){if(200===n.status){const e=window.URL.createObjectURL(n.response),r=document.createElement("a");r.href=e,r.download=t,r.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},n.send()}function y(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("HEAD",e,!0),r.onreadystatechange=()=>{var e;if(4===r.readyState&&200===r.status){let n=null!=(e=r.getResponseHeader("Content-Length"))?e:0;const o=+n;o>1048576?n=(o/1048576).toFixed(2)+"M":o>1024?n=(o/1024).toFixed(2)+"K":n+="B",t(n)}},r.send()}))}async function H(e){try{const t=await fetch(e),n=await t.blob();return new File([n],`${l()}.${n.type.split("/")[1]}`,{type:n.type})}catch(e){return}}function v(e){return e&&[s.AUDIO,s.VIDEO].includes(e.chatMessageType)}function E(e){const n=r(new Date);return n.setSeconds(e),t(n,"HH:mm:ss")}export{d as $message,H as base64ToFile,h as downloadFile,E as formatSeconds,m as formatTime,f as getAVTime,y as getFileSize,v as isAudioOrVideoMessage,g as listSort,w as simplifyMessage,p as transformMessage};
1
+ import{isToday as e,format as t,isYesterday as n,startOfDay as o}from"date-fns";import{cloneDeep as a,isNumber as r,isNaN as i}from"lodash-es";import{MESSAGE_TYPE as s}from"../constants/index.js";import{emojis as l}from"./emoji.js";import{uuidGenerator as c}from"../../../../shared/utils/index.js";import{createDiscreteApi as d}from"naive-ui";const{message:u}=d(["message"]);function g(o){var a;const r=new Date(o);let i,s;if(e(r))i=s=t(r,"HH:mm");else{i=n(r)?(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.135"))||"昨天":t(r,"MM-dd");const e=r.getFullYear(),o=(new Date).getFullYear();s=t(r,e<o?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:i,msgTime:s,recordTime:function(o){var a,r,i,s;const l=new Date(o),c=Date.now()-l.getTime();if(c<6e4)return(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.133"))||"刚刚";if(c<36e5)return Math.ceil(c/1e3/60)+((null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.136"))||"分钟前");if(e(l))return((null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.134"))||"今天")+t(l,"HH:mm");if(n(l))return((null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.135"))||"昨天")+t(l,"HH:mm");{const e=l.getFullYear(),n=(new Date).getFullYear();return t(l,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}(o)}}function m(e){return a(e||[]).sort(((e,t)=>e.topping&&!t.topping?-1:!e.topping&&t.topping?1:new Date(t.sortTime).getTime()-new Date(e.sortTime).getTime()))}function p(e){if(!(null==e?void 0:e.msg))return"";const{chatMessageType:t="",msg:n=""}=e;let o=n.toString();if(t===s.BLEND){const e=o.match(/\[([^\]]+)\]/g);return null==e||e.forEach((e=>{const n=e.match(/\[([^\]]+)\]/);if(n&&n.length>1){const a=l.findEmoji(n[1]);a&&(o=o.replace(e,`<img data-msg=${n[1]} data-type=${t} class="emoji--min" src=${a} />`))}})),o}const a=e=>new RegExp("\\n*\\["+(e||"")+"(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)]\\n*","g");return o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/@(\S+)(\s+?|$)/g,'@<a href="javascript:;">$1</a>$2').replace(a(),"<$1 $2>").replace(a("/"),"</$1>").replace(/\n/g,"<br>"),o}function w(e){var t,n;if(e&&r(+e)&&!i(+e)){const n=E(+e),o=n.split(":");let a=n;return 3===o.length&&"00"===o[0]&&(a=`${o[1]}:${o[2]}`),((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.137"))||"通话时长")+a}return(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.138"))||"已取消"}function f(e){var t;if(!e)return"";const{chatMessageType:n,msg:o,messageTemplate:a}=e,r=H(e)?w(o):"";switch(n){case s.TEXT:return p(e);case s.IMAGE:return"[图片]";case s.FILE:return"[文件]";case s.EMOJI:return`<img class="emoji--min" alt=${o} src=${l.findEmoji(o)}>`;case s.TEMPLATE:return null==(t=null==a?void 0:a.setting)?void 0:t.title;case s.VIDEO:return`[视频通话]${r}`;case s.AUDIO:return`[语音通话]${r}`;default:return"[消息]"}}function y(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){if(200===n.status){const e=window.URL.createObjectURL(n.response),o=document.createElement("a");o.href=e,o.download=t,o.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},n.send()}function h(e){return new Promise(((t,n)=>{const o=new XMLHttpRequest;o.open("HEAD",e,!0),o.onreadystatechange=()=>{var e;if(4===o.readyState&&200===o.status){let n=null!=(e=o.getResponseHeader("Content-Length"))?e:0;const a=+n;a>1048576?n=(a/1048576).toFixed(2)+"M":a>1024?n=(a/1024).toFixed(2)+"K":n+="B",t(n)}},o.send()}))}async function v(e){try{const t=await fetch(e),n=await t.blob();return new File([n],`${c()}.${n.type.split("/")[1]}`,{type:n.type})}catch(e){return}}function H(e){return e&&[s.AUDIO,s.VIDEO].includes(e.chatMessageType)}function E(e){const n=o(new Date);return n.setSeconds(e),t(n,"HH:mm:ss")}export{u as $message,v as base64ToFile,y as downloadFile,E as formatSeconds,g as formatTime,w as getAVTime,h as getFileSize,H as isAudioOrVideoMessage,m as listSort,f as simplifyMessage,p as transformMessage};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as a,computed as l,ref as o,onDeactivated as t,onMounted as u,resolveComponent as n,openBlock as i,createElementBlock as r,createVNode as c,unref as s,withCtx as v,normalizeStyle as d,createBlock as p,createCommentVNode as f,createElementVNode as m,createTextVNode as h,toDisplayString as g}from"vue";import{keywordMatcher as y}from"../../../../../shared/utils/index.js";import{NInput as w,NSpin as k,NPagination as x,NButtonGroup as b,NButton as S}from"naive-ui";import{useDebounceFn as _}from"@vueuse/core";import"date-fns";import{property as z,difference as C,union as I,isNumber as j,omit as D,isString as F}from"lodash-es";import{useFormRequest as L}from"../../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../../shared/hooks/useScrollLoading.js";import{InjectionIhoTableConfig as R,InjectionTableAsyncQueue as K}from"../../constants/index.js";import{getLowCodeFieldFromField as H,isVariableHeightTable as q}from"../../utils/index.js";const T={class:"iho-table__filterWrapper",style:{width:"300px"}},U={class:"iho-table__filterFooter"};var V=e({__name:"dynamicFilter",props:{payload:{type:Object,required:!0}},setup(e){var V,Y;const B=e,N=a("$xetable"),O=a(R),$=l((()=>z("optionInfo.dynamicOptionInfo")(H(B.payload.column)))),A=l((()=>z("optionInfo.list")(H(B.payload.column)))),E=l((()=>{var e,a;return null!=(a=null==(e=$.value)?void 0:e.valueKey)?a:"value"})),W=l((()=>{var e,a;return null!=(a=null==(e=$.value)?void 0:e.showKeys)?a:[]})),G=o([]),J=o(null!=(Y=null==(V=B.payload.column.filters)?void 0:V.reduce(((e,a)=>(a.checked&&e.push(a.value),e)),[]))?Y:[]),M=l({get:()=>J.value,async set(e){const a=C(G.value.map((e=>e[E.value])),e);J.value=I(C(J.value,a),e)}}),P=o();function Q(){P.value&&(M.value=P.value.getCheckboxRecords().map((e=>e[E.value])))}const X=o("");async function Z(){N&&(N.reactData.filterStore.visible=!1)}t(Z);const ee=o(24),ae=l((()=>{var e,a;if(!B.payload||!B.payload.column)return 10;const{filterCapacity:l}=null!=(a=null==(e=B.payload.column.editRender)?void 0:e.props)?a:{};return j(l)&&l>0?l:10})),le=l((()=>ae.value*ee.value+40));function oe(){var e,a,l,o;if(!B.payload||!N)return;if(N.reactData.filterStore.options,B.payload.column.filters=J.value.map((e=>({label:e,value:e,data:e,_checked:!0}))),N.reactData.filterStore.options=B.payload.column.filters,!q(N))return t();function t(){B.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(e=N.internalData.afterFullData)?void 0:e.length)?a:0)>(null!=(o=null==(l=O.value.scrollY)?void 0:l.gt)?o:100)&&(N.reactData.scrollYLoad=!0),t(),N.reactData.scrollYLoad=!1,Z()}function te(){var e;J.value=[],null==(e=P.value)||e.clearCheckboxRow()}const ue=o({page:1,total:0,pageSize:20}),ne=o(!1),ie=a(K),{getSearchRequestInfo:re}=L();function ce(e){ue.value.page=e,pe()}function se(e){ue.value.pageSize=e,ue.value.page=1,pe()}const ve=o([]),de=_((()=>ce(1)),500);async function pe(){var e,a,l;const o=H(B.payload.column);if(!o||!o.optionInfo)return;if(A.value){if(G.value=A.value.reduce(((e,a)=>(function(e){return!X.value||(null!=e.name?String(e.name).includes(X.value):null!=e.value?e.value===X.value:e.extraValue&&F(e.extraValue)?y(X.value,e.extraValue):void 0)}(a)&&e.push({...a,checked:J.value.includes(a[E.value])}),e)),[]),ve.value.length)return;return void(ve.value=[{field:"select",type:"checkbox",width:40},{field:"name",title:"选项"}])}if(!$.value||!ie)return;const t={...re(),params:{[null!=(a=null==(e=$.value.filterKeys)?void 0:e[0])?a:"keyword"]:X.value,wordbookId:$.value.dataSourceId,wordbookType:$.value.dataSourceType,fieldKeys:$.value.filterKeys,autograph:$.value.autograph,asyncCount:1,...D(ue.value,"total")},cache:!0,key:null==(l=B.payload.column)?void 0:l.field};ne.value=!0;try{const e=await ie.addAsync(t);if(G.value=e.map((e=>(e.checked=J.value.includes(e[E.value]),e))),ue.value={page:e.page,total:e.total,pageSize:e.pageSize},ve.value.length)return;ve.value=[{field:"select",type:"checkbox",width:40},...W.value.reduce(((a,l)=>{var o;const t=null==(o=e.fieldList)?void 0:o.find((e=>e.columnName===l));return t&&a.push({title:t.alias||t.name||"",field:t.columnName}),a}),[])]}finally{ne.value=!1}}return u(pe),(e,a)=>{const l=n("vxe-grid");return i(),r("section",T,[c(s(w),{value:X.value,"onUpdate:value":a[0]||(a[0]=e=>X.value=e),onInput:s(de)},null,8,["value","onInput"]),c(s(k),{show:ne.value},{default:v((()=>[c(l,{class:"iho-table__filterTable",ref_key:"tableRef",ref:P,data:G.value,columns:ve.value,size:"small",height:s(le),style:d({minHeight:s(le)+"px"}),"show-overflow":"title","row-config":{height:ee.value,isHover:!0},"checkbox-config":{trigger:"row",showHeader:!1,checkField:"checked",highlight:!0},"radio-config":{trigger:"row"},onCheckboxChange:Q},null,8,["data","columns","height","style","row-config"]),s($)?(i(),p(s(x),{key:0,style:{"margin-top":"8px"},page:ue.value.page,"onUpdate:page":ce,"page-sizes":[20,30,50],"page-size":ue.value.pageSize,"onUpdate:pageSize":se,"item-count":ue.value.total,"show-size-picker":"","page-slot":5,size:"small"},null,8,["page","page-size","item-count"])):f("v-if",!0)])),_:1},8,["show"]),m("footer",U,[m("section",null,[h(" 已选择 "),m("span",{style:d({color:"var(--c-primary-color)"})},g(J.value.length),5),h(" ")]),c(s(b),{size:"small"},{default:v((()=>[c(s(S),{onClick:te},{default:v((()=>[h("清空")])),_:1}),c(s(S),{onClick:Z},{default:v((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),c(s(S),{type:"primary",onClick:oe},{default:v((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])),_:1})])])}}});export{V as default};
1
+ import{defineComponent as e,inject as a,computed as l,ref as o,onDeactivated as t,onMounted as u,resolveComponent as n,openBlock as i,createElementBlock as r,createVNode as c,unref as s,withCtx as d,normalizeStyle as v,createBlock as p,createCommentVNode as f,createElementVNode as g,createTextVNode as m,toDisplayString as h}from"vue";import{keywordMatcher as y}from"../../../../../shared/utils/index.js";import{NInput as w,NSpin as k,NPagination as x,NButtonGroup as b,NButton as C}from"naive-ui";import{useDebounceFn as S}from"@vueuse/core";import"date-fns";import{property as _,difference as z,union as I,isNumber as L,omit as j,isString as D}from"lodash-es";import{useFormRequest as F}from"../../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../../shared/hooks/useScrollLoading.js";import{InjectionIhoTableConfig as R,InjectionTableAsyncQueue as B}from"../../constants/index.js";import{getLowCodeFieldFromField as K,isVariableHeightTable as H}from"../../utils/index.js";const q={class:"iho-table__filterWrapper",style:{width:"300px"}},T={class:"iho-table__filterFooter"};var U=e({__name:"dynamicFilter",props:{payload:{type:Object,required:!0}},setup(e){var U,V;const Y=e,N=a("$xetable"),O=a(R),$=l((()=>_("optionInfo.dynamicOptionInfo")(K(Y.payload.column)))),A=l((()=>_("optionInfo.list")(K(Y.payload.column)))),E=l((()=>{var e,a;return null!=(a=null==(e=$.value)?void 0:e.valueKey)?a:"value"})),W=l((()=>{var e,a;return null!=(a=null==(e=$.value)?void 0:e.showKeys)?a:[]})),G=o([]),J=o(null!=(V=null==(U=Y.payload.column.filters)?void 0:U.reduce(((e,a)=>(a.checked&&e.push(a.value),e)),[]))?V:[]),M=l({get:()=>J.value,async set(e){const a=z(G.value.map((e=>e[E.value])),e);J.value=I(z(J.value,a),e)}}),P=o();function Q(){P.value&&(M.value=P.value.getCheckboxRecords().map((e=>e[E.value])))}const X=o("");async function Z(){N&&(N.reactData.filterStore.visible=!1)}t(Z);const ee=o(24),ae=l((()=>{var e,a;if(!Y.payload||!Y.payload.column)return 10;const{filterCapacity:l}=null!=(a=null==(e=Y.payload.column.editRender)?void 0:e.props)?a:{};return L(l)&&l>0?l:10})),le=l((()=>ae.value*ee.value+40));function oe(){var e,a,l,o;if(!Y.payload||!N)return;if(N.reactData.filterStore.options,Y.payload.column.filters=J.value.map((e=>({label:e,value:e,data:e,_checked:!0}))),N.reactData.filterStore.options=Y.payload.column.filters,!H(N))return t();function t(){Y.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(e=N.internalData.afterFullData)?void 0:e.length)?a:0)>(null!=(o=null==(l=O.value.scrollY)?void 0:l.gt)?o:100)&&(N.reactData.scrollYLoad=!0),t(),N.reactData.scrollYLoad=!1,Z()}function te(){var e;J.value=[],null==(e=P.value)||e.clearCheckboxRow()}const ue=o({page:1,total:0,pageSize:20}),ne=o(!1),ie=a(B),{getSearchRequestInfo:re}=F();function ce(e){ue.value.page=e,pe()}function se(e){ue.value.pageSize=e,ue.value.page=1,pe()}const de=o([]),ve=S((()=>ce(1)),500);async function pe(){var e,a,l;const o=K(Y.payload.column);if(!o||!o.optionInfo)return;if(A.value){if(G.value=A.value.reduce(((e,a)=>(function(e){return!X.value||(null!=e.name?String(e.name).includes(X.value):null!=e.value?e.value===X.value:e.extraValue&&D(e.extraValue)?y(X.value,e.extraValue):void 0)}(a)&&e.push({...a,checked:J.value.includes(a[E.value])}),e)),[]),de.value.length)return;return void(de.value=[{field:"select",type:"checkbox",width:40},{field:"name",title:"选项"}])}if(!$.value||!ie)return;const t={...re(),params:{[null!=(a=null==(e=$.value.filterKeys)?void 0:e[0])?a:"keyword"]:X.value,wordbookId:$.value.dataSourceId,wordbookType:$.value.dataSourceType,fieldKeys:$.value.filterKeys,autograph:$.value.autograph,asyncCount:1,...j(ue.value,"total")},cache:!0,key:null==(l=Y.payload.column)?void 0:l.field};ne.value=!0;try{const e=await ie.addAsync(t);if(G.value=e.map((e=>(e.checked=J.value.includes(e[E.value]),e))),ue.value={page:e.page,total:e.total,pageSize:e.pageSize},de.value.length)return;de.value=[{field:"select",type:"checkbox",width:40},...W.value.reduce(((a,l)=>{var o;const t=null==(o=e.fieldList)?void 0:o.find((e=>e.columnName===l));return t&&a.push({title:t.alias||t.name||"",field:t.columnName}),a}),[])]}finally{ne.value=!1}}return u(pe),(e,a)=>{var l,o;const t=n("vxe-grid");return i(),r("section",q,[c(s(w),{value:X.value,"onUpdate:value":a[0]||(a[0]=e=>X.value=e),onInput:s(ve)},null,8,["value","onInput"]),c(s(k),{show:ne.value},{default:d((()=>[c(t,{class:"iho-table__filterTable",ref_key:"tableRef",ref:P,data:G.value,columns:de.value,size:"small",height:s(le),style:v({minHeight:s(le)+"px"}),"show-overflow":"title","row-config":{height:ee.value,isHover:!0},"checkbox-config":{trigger:"row",showHeader:!1,checkField:"checked",highlight:!0},"radio-config":{trigger:"row"},onCheckboxChange:Q},null,8,["data","columns","height","style","row-config"]),s($)?(i(),p(s(x),{key:0,style:{"margin-top":"8px"},page:ue.value.page,"onUpdate:page":ce,"page-sizes":[20,30,50],"page-size":ue.value.pageSize,"onUpdate:pageSize":se,"item-count":ue.value.total,"show-size-picker":"","page-slot":5,size:"small"},null,8,["page","page-size","item-count"])):f("v-if",!0)])),_:1},8,["show"]),g("footer",T,[g("section",null,[m((null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.39"))||"已选择"),g("span",{style:v({color:"var(--c-primary-color)"})},h(J.value.length),5),m((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.417"))||"项")]),c(s(b),{size:"small"},{default:d((()=>[c(s(C),{onClick:te},{default:d((()=>{var e;return[m((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.509"))||"清空")]})),_:1}),c(s(C),{onClick:Z},{default:d((()=>{var e;return[m((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.32"))||"取消")]})),_:1}),c(s(C),{type:"primary",onClick:oe},{default:d((()=>{var e;return[m((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.33"))||"确定")]})),_:1})])),_:1})])])}}});export{U as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,onMounted as n,toRaw as r,openBlock as i,createElementBlock as o,unref as v,createBlock as d,createCommentVNode as s,createVNode as c,isRef as p,withCtx as f,createTextVNode as m,createElementVNode as h,toDisplayString as y,mergeProps as _,normalizeProps as k,guardReactiveProps as b,Fragment as g,renderList as w,normalizeStyle as L}from"vue";import C from"../../../../../shared/components/CancelRadio/CancelRadio.js";import D from"../../../../../shared/components/SlotRender/SlotRender.js";import{keywordMatcher as F,widthAppend as R}from"../../../../../shared/utils/index.js";import{useVirtualList as S}from"@vueuse/core";import{isNumber as j,isString as I,isFunction as x,isEqual as U}from"lodash-es";import{NInput as W,NCheckbox as $,NSpin as E,NCheckboxGroup as O,NRadioGroup as Y,NButtonGroup as B,NButton as M}from"naive-ui";import{InjectionIhoTableConfig as P}from"../../constants/index.js";import{getLowCodeFieldFromField as V,isVariableHeightTable as q}from"../../utils/index.js";const z={class:"iho-table__filterWrapper"},A={key:1,class:"iho-table__filterCheckAllWrapper"},H={key:0,class:"iho-table__filterListItem"},N={class:"iho-table__filterListItem"},G=["title"],J=["title"],K={class:"iho-table__filterListItemContent"},Q={class:"iho-table__filterFooter"};var T=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const T=e,X=l("$xetable"),Z=l(P),ee=a((()=>V(T.payload.column)||{})),le=a((()=>{var e;return(null==(e=null==X?void 0:X.internalData)?void 0:e.afterFullData)||[]})),ae=a((()=>{var e;return!!(null==(e=T.payload)?void 0:e.column.filterMultiple)})),te=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=T.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),ue=a({get:()=>te.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){var l,a,t,u;if(!T.payload||!X)return;const n=X.reactData.filterStore.options||[];if(ae.value?(n.forEach((l=>l._checked=e.includes(l.value))),X.checkFilterOptions()):n.forEach((l=>l._checked=l.value===e[0])),!q(X))return r();function r(){T.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(l=X.internalData.afterFullData)?void 0:l.length)?a:0)>(null!=(u=null==(t=Z.value.scrollY)?void 0:t.gt)?u:100)&&(X.reactData.scrollYLoad=!0),r(),X.reactData.scrollYLoad=!1}}),ne=t([...ue.value]),re=t("");async function ie(){X&&(X.reactData.filterStore.visible=!1)}u(ie);const oe=a((()=>{var e,l;if(!T.payload||!T.payload.column)return 10;const{filterCapacity:a}=null!=(l=null==(e=T.payload.column.editRender)?void 0:e.props)?l:{};return j(a)&&a>0?a:10})),ve=a((()=>{var e;return null==(e=T.payload.column.editRender.props)?void 0:e.filterOptionsFilterMethod})),de=a((()=>re.value?te.value.filter((e=>ve.value?ve.value(re.value,e):!!`${e.label}`.includes(re.value)||(I(e.data)?F(re.value,e.data):void 0))):te.value)),{list:se,containerProps:ce,wrapperProps:pe}=S(de,{itemHeight:32,overscan:3}),fe=a({get:()=>!!de.value.length&&de.value.every((e=>ne.value.includes(e.value))),set(e){ne.value=e?[...new Set([...ne.value,...de.value.map((e=>e.value))])]:ne.value.filter((e=>de.value.every((l=>l.value!==e))))}}),me=a((()=>de.value.some((e=>ne.value.includes(e.value)))&&!fe.value)),he=a({get:()=>ne.value.length===te.value.length&&0!==te.value.length,set:e=>{ne.value=e?te.value.map((e=>e.value)):[]}}),ye=a((()=>!!ne.value.length&&!he.value)),_e=a((()=>({height:R(32*oe.value)})));function ke(){ue.value=ae.value?ne.value:U(ne.value[0],null)?[]:[ne.value[0]],ie()}function be(){ne.value=ae.value?[]:[null]}const ge=t(!1);return n((async()=>{var e;if(!X)return;const l=null==(e=T.payload.column.editRender.props)?void 0:e.onFilterShow;if(x(l))try{ge.value=!0,await l(T.payload);const{filterStore:e}=X.reactData;r(e.options)!==r(te.value)&&(e.options=te.value)}finally{ge.value=!1}})),(l,a)=>(i(),o("section",z,[v(te).length>5?(i(),d(v(W),{key:0,value:re.value,"onUpdate:value":a[0]||(a[0]=e=>re.value=e)},null,8,["value"])):s("v-if",!0),v(ae)?(i(),o("div",A,[v(te).length>5?(i(),o("div",H,[c(v($),{checked:v(fe),"onUpdate:checked":a[1]||(a[1]=e=>p(fe)?fe.value=e:null),indeterminate:v(me)},{default:f((()=>[m("全选当前")])),_:1},8,["checked","indeterminate"])])):s("v-if",!0),h("div",N,[c(v($),{checked:v(he),"onUpdate:checked":a[2]||(a[2]=e=>p(he)?he.value=e:null),indeterminate:v(ye)},{default:f((()=>[m(" 全选所有"+y(v(ee).showFilterFullNums?`(${v(le).length})`:""),1)])),_:1},8,["checked","indeterminate"])])])):s("v-if",!0),c(v(E),{show:ge.value},{default:f((()=>[v(ae)?(i(),d(v(O),{key:0,value:ne.value,"onUpdate:value":a[3]||(a[3]=e=>ne.value=e)},{default:f((()=>[h("section",_(v(ce),{style:v(_e),class:"iho-table__filterListWrapper"}),[h("section",k(b(v(pe))),[(i(!0),o(g,null,w(v(se),(l=>(i(),o("div",{class:"iho-table__filterListItem",key:l.data.value},[c(v($),{value:l.data.value},{default:f((()=>[h("div",{class:"iho-table__filterListItemContent",title:l.data.label},[v(ee).filterLabelRender?(i(),d(v(D),_({key:0,renderer:v(ee).filterLabelRender},e.payload,{option:l.data}),null,16,["renderer","option"])):(i(),o(g,{key:1},[m(y(l.data.label),1)],64))],8,G)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(i(),d(v(Y),{key:1,value:ne.value[0],"onUpdate:value":a[5]||(a[5]=e=>ne.value[0]=e)},{default:f((()=>[h("section",_(v(ce),{style:v(_e),class:"iho-table__filterListWrapper"}),[h("section",k(b(v(pe))),[(i(!0),o(g,null,w(v(se),(e=>(i(),o("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[c(v(C),{value:e.data.value,currentValue:ne.value[0],cancelable:"",onCancel:a[4]||(a[4]=e=>ne.value=[null])},{default:f((()=>[h("div",K,y(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,J)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),h("footer",Q,[h("section",null,[v(ae)?(i(),o(g,{key:0},[m(" 已选择 "),h("span",{style:L({color:"var(--c-primary-color)"})},y(ne.value.length),5),m(" ")],64)):s("v-if",!0)]),c(v(B),{size:"small"},{default:f((()=>[c(v(M),{onClick:be},{default:f((()=>[m("清空")])),_:1}),c(v(M),{onClick:ie},{default:f((()=>{var e;return[m((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),c(v(M),{type:"primary",onClick:ke},{default:f((()=>{var e;return[m((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])),_:1})])]))}});export{T as default};
1
+ import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,onMounted as n,toRaw as o,openBlock as i,createElementBlock as r,unref as v,createBlock as d,createCommentVNode as c,createVNode as s,isRef as p,withCtx as f,createTextVNode as m,createElementVNode as h,toDisplayString as y,mergeProps as _,normalizeProps as g,guardReactiveProps as w,Fragment as k,renderList as b,normalizeStyle as L}from"vue";import C from"../../../../../shared/components/CancelRadio/CancelRadio.js";import D from"../../../../../shared/components/SlotRender/SlotRender.js";import{keywordMatcher as F,widthAppend as R}from"../../../../../shared/utils/index.js";import{useVirtualList as S}from"@vueuse/core";import{isNumber as j,isString as I,isFunction as x,isEqual as B}from"lodash-es";import{NInput as U,NCheckbox as W,NSpin as $,NCheckboxGroup as E,NRadioGroup as O,NButtonGroup as Y,NButton as M}from"naive-ui";import{InjectionIhoTableConfig as P}from"../../constants/index.js";import{getLowCodeFieldFromField as V,isVariableHeightTable as q}from"../../utils/index.js";const z={class:"iho-table__filterWrapper"},A={key:1,class:"iho-table__filterCheckAllWrapper"},H={key:0,class:"iho-table__filterListItem"},N={class:"iho-table__filterListItem"},G=["title"],J=["title"],K={class:"iho-table__filterListItemContent"},Q={class:"iho-table__filterFooter"};var T=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const T=e,X=l("$xetable"),Z=l(P),ee=a((()=>V(T.payload.column)||{})),le=a((()=>{var e;return(null==(e=null==X?void 0:X.internalData)?void 0:e.afterFullData)||[]})),ae=a((()=>{var e;return!!(null==(e=T.payload)?void 0:e.column.filterMultiple)})),te=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=T.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),ue=a({get:()=>te.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){var l,a,t,u;if(!T.payload||!X)return;const n=X.reactData.filterStore.options||[];if(ae.value?(n.forEach((l=>l._checked=e.includes(l.value))),X.checkFilterOptions()):n.forEach((l=>l._checked=l.value===e[0])),!q(X))return o();function o(){T.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(l=X.internalData.afterFullData)?void 0:l.length)?a:0)>(null!=(u=null==(t=Z.value.scrollY)?void 0:t.gt)?u:100)&&(X.reactData.scrollYLoad=!0),o(),X.reactData.scrollYLoad=!1}}),ne=t([...ue.value]),oe=t("");async function ie(){X&&(X.reactData.filterStore.visible=!1)}u(ie);const re=a((()=>{var e,l;if(!T.payload||!T.payload.column)return 10;const{filterCapacity:a}=null!=(l=null==(e=T.payload.column.editRender)?void 0:e.props)?l:{};return j(a)&&a>0?a:10})),ve=a((()=>{var e;return null==(e=T.payload.column.editRender.props)?void 0:e.filterOptionsFilterMethod})),de=a((()=>oe.value?te.value.filter((e=>ve.value?ve.value(oe.value,e):!!`${e.label}`.includes(oe.value)||(I(e.data)?F(oe.value,e.data):void 0))):te.value)),{list:ce,containerProps:se,wrapperProps:pe}=S(de,{itemHeight:32,overscan:3}),fe=a({get:()=>!!de.value.length&&de.value.every((e=>ne.value.includes(e.value))),set(e){ne.value=e?[...new Set([...ne.value,...de.value.map((e=>e.value))])]:ne.value.filter((e=>de.value.every((l=>l.value!==e))))}}),me=a((()=>de.value.some((e=>ne.value.includes(e.value)))&&!fe.value)),he=a({get:()=>ne.value.length===te.value.length&&0!==te.value.length,set:e=>{ne.value=e?te.value.map((e=>e.value)):[]}}),ye=a((()=>!!ne.value.length&&!he.value)),_e=a((()=>({height:R(32*re.value)})));function ge(){ue.value=ae.value?ne.value:B(ne.value[0],null)?[]:[ne.value[0]],ie()}function we(){ne.value=ae.value?[]:[null]}const ke=t(!1);return n((async()=>{var e;if(!X)return;const l=null==(e=T.payload.column.editRender.props)?void 0:e.onFilterShow;if(x(l))try{ke.value=!0,await l(T.payload);const{filterStore:e}=X.reactData;o(e.options)!==o(te.value)&&(e.options=te.value)}finally{ke.value=!1}})),(l,a)=>{var t,u;return i(),r("section",z,[v(te).length>5?(i(),d(v(U),{key:0,value:oe.value,"onUpdate:value":a[0]||(a[0]=e=>oe.value=e)},null,8,["value"])):c("v-if",!0),v(ae)?(i(),r("div",A,[v(te).length>5?(i(),r("div",H,[s(v(W),{checked:v(fe),"onUpdate:checked":a[1]||(a[1]=e=>p(fe)?fe.value=e:null),indeterminate:v(me)},{default:f((()=>[m("全选当前")])),_:1},8,["checked","indeterminate"])])):c("v-if",!0),h("div",N,[s(v(W),{checked:v(he),"onUpdate:checked":a[2]||(a[2]=e=>p(he)?he.value=e:null),indeterminate:v(ye)},{default:f((()=>[m(" 全选所有"+y(v(ee).showFilterFullNums?`(${v(le).length})`:""),1)])),_:1},8,["checked","indeterminate"])])])):c("v-if",!0),s(v($),{show:ke.value},{default:f((()=>[v(ae)?(i(),d(v(E),{key:0,value:ne.value,"onUpdate:value":a[3]||(a[3]=e=>ne.value=e)},{default:f((()=>[h("section",_(v(se),{style:v(_e),class:"iho-table__filterListWrapper"}),[h("section",g(w(v(pe))),[(i(!0),r(k,null,b(v(ce),(l=>(i(),r("div",{class:"iho-table__filterListItem",key:l.data.value},[s(v(W),{value:l.data.value},{default:f((()=>[h("div",{class:"iho-table__filterListItemContent",title:l.data.label},[v(ee).filterLabelRender?(i(),d(v(D),_({key:0,renderer:v(ee).filterLabelRender},e.payload,{option:l.data}),null,16,["renderer","option"])):(i(),r(k,{key:1},[m(y(l.data.label),1)],64))],8,G)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(i(),d(v(O),{key:1,value:ne.value[0],"onUpdate:value":a[5]||(a[5]=e=>ne.value[0]=e)},{default:f((()=>[h("section",_(v(se),{style:v(_e),class:"iho-table__filterListWrapper"}),[h("section",g(w(v(pe))),[(i(!0),r(k,null,b(v(ce),(e=>(i(),r("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[s(v(C),{value:e.data.value,currentValue:ne.value[0],cancelable:"",onCancel:a[4]||(a[4]=e=>ne.value=[null])},{default:f((()=>[h("div",K,y(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,J)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),h("footer",Q,[h("section",null,[v(ae)?(i(),r(k,{key:0},[m((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.39"))||"已选择"),h("span",{style:L({color:"var(--c-primary-color)"})},y(ne.value.length),5),m((null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.417"))||"项")],64)):c("v-if",!0)]),s(v(Y),{size:"small"},{default:f((()=>[s(v(M),{onClick:we},{default:f((()=>{var e;return[m((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.509"))||"清空")]})),_:1}),s(v(M),{onClick:ie},{default:f((()=>{var e;return[m((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.32"))||"取消")]})),_:1}),s(v(M),{type:"primary",onClick:ge},{default:f((()=>{var e;return[m((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.33"))||"确定")]})),_:1})])),_:1})])])}}});export{T as default};
@@ -1 +1 @@
1
- import{defineComponent as a,ref as l,inject as e,openBlock as t,createBlock as n,unref as o,withCtx as u,createVNode as i,createTextVNode as r}from"vue";import{cloneDeep as d}from"lodash-es";import{NSpace as p,NInput as v,NButtonGroup as c,NButton as f}from"naive-ui";var s=a({__name:"filter",props:{payload:{type:Object,required:!0}},setup(a){var s;const m=a,y=l(d((null==(s=m.payload.column.filters)?void 0:s[0])||{}).data);function w(a){y.value=a}const g=e("$xetable");function _(){g&&(g.reactData.filterStore.visible=!1)}function C(){var a,l;const e=null==(a=m.payload.column.filters)?void 0:a[0];if(!e)return _();e.data=y.value,(null==(l=m.payload)?void 0:l.$panel)&&(m.payload.$panel.changeOption(null,!!y.value,e),m.payload.$panel.confirmFilter(new CustomEvent("click")))}return(a,l)=>(t(),n(o(p),{vertical:"",style:{padding:"8px 12px"}},{default:u((()=>[i(o(v),{clearable:"",value:y.value,"onUpdate:value":w},null,8,["value"]),i(o(p),{justify:"end"},{default:u((()=>[i(o(c),{size:"small"},{default:u((()=>[i(o(f),{onClick:_},{default:u((()=>{var a;return[r((null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.28"))||"取消")]})),_:1}),i(o(f),{type:"primary",onClick:C},{default:u((()=>{var a;return[r((null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.27"))||"确定")]})),_:1})])),_:1})])),_:1})])),_:1}))}});export{s as default};
1
+ import{defineComponent as a,ref as l,inject as e,openBlock as t,createBlock as n,unref as o,withCtx as u,createVNode as i,createTextVNode as r}from"vue";import{cloneDeep as d}from"lodash-es";import{NSpace as p,NInput as v,NButtonGroup as c,NButton as f}from"naive-ui";var s=a({__name:"filter",props:{payload:{type:Object,required:!0}},setup(a){var s;const m=a,y=l(d((null==(s=m.payload.column.filters)?void 0:s[0])||{}).data);function w(a){y.value=a}const g=e("$xetable");function _(){g&&(g.reactData.filterStore.visible=!1)}function C(){var a,l;const e=null==(a=m.payload.column.filters)?void 0:a[0];if(!e)return _();e.data=y.value,(null==(l=m.payload)?void 0:l.$panel)&&(m.payload.$panel.changeOption(null,!!y.value,e),m.payload.$panel.confirmFilter(new CustomEvent("click")))}return(a,l)=>(t(),n(o(p),{vertical:"",style:{padding:"8px 12px"}},{default:u((()=>[i(o(v),{clearable:"",value:y.value,"onUpdate:value":w},null,8,["value"]),i(o(p),{justify:"end"},{default:u((()=>[i(o(c),{size:"small"},{default:u((()=>[i(o(f),{onClick:_},{default:u((()=>{var a;return[r((null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.32"))||"取消")]})),_:1}),i(o(f),{type:"primary",onClick:C},{default:u((()=>{var a;return[r((null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.33"))||"确定")]})),_:1})])),_:1})])),_:1})])),_:1}))}});export{s as default};
@@ -1 +1 @@
1
- import{createVNode as e,mergeProps as o,defineComponent as l,computed as n}from"vue";import t from"../../../../../../shared/components/InputNumberSlash/InputNumberSlash.js";import{isNumber as r}from"lodash-es";import{NInputNumber as u}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as a}from"../../../constants/index.js";import{useAutoFocus as i}from"./hooks/useAutoFocus.js";import{IhoTableRenderHelper as s}from"../../../utils/index.js";import{defineTablePlugin as p}from"../../../hooks/useTablePlugin.js";const m=l({name:"IhoTableInputNumber",props:{value:[String,Number]},emits:["update:value"],setup(o,{emit:l}){const t=n({get:()=>r(o.value)?o.value:o.value&&r(+o.value)?+o.value:null,set(e){l("update:value",e)}});return()=>e(u,{value:t.value,"onUpdate:value":e=>t.value=e},null)}});function d(){const l="numberRendererPlugin";return p({name:l,vxe(l){l.renderer.add(a.NUMBER,{renderCell:s.createDefaultRenderCell(),renderEdit:s.createRenderEdit((({row:l,column:n,fieldItem:r,emitFormClick:u,emitFormChangeWithParams:a,$table:i})=>{var s;const{placeholder:p="请输入"}=r.componentProps||{};function d(e){const o=l[n.field];l[n.field]=e,a({oldValue:o})}const c={clearable:!0,placeholder:p,onBlur:()=>a({type:"blur",oldValue:l[n.field]}),onClick:u};return!0===r.allowSlash||"1"===r.allowSlash?e(t,o({value:l[n.field],onChange:d,onSelect:function(){i.internalData.isActivated=!0}},c,{whiteList:r.whiteList},r.componentProps,{popperProps:{...null==(s=r.componentProps)?void 0:s.popperProps,class:"iho-table_numberInputSlashPopper"}}),null):e(m,o({value:l[n.field],"onUpdate:value":d},c,r.componentProps),null)}))})},apply(e){i(e).bindAutoFocusConfig(l,a.NUMBER,".n-input__input-el",{focusType:"class"})}})}export{d as numberRendererPlugin};
1
+ import{createVNode as e,mergeProps as o,defineComponent as l,computed as n}from"vue";import t from"../../../../../../shared/components/InputNumberSlash/InputNumberSlash.js";import{isNumber as r}from"lodash-es";import{NInputNumber as a}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as u}from"../../../constants/index.js";import{useAutoFocus as i}from"./hooks/useAutoFocus.js";import{IhoTableRenderHelper as s}from"../../../utils/index.js";import{defineTablePlugin as p}from"../../../hooks/useTablePlugin.js";const m=l({name:"IhoTableInputNumber",props:{value:[String,Number]},emits:["update:value"],setup(o,{emit:l}){const t=n({get:()=>r(o.value)?o.value:o.value&&r(+o.value)?+o.value:null,set(e){l("update:value",e)}});return()=>e(a,{value:t.value,"onUpdate:value":e=>t.value=e},null)}});function d(){const l="numberRendererPlugin";return p({name:l,vxe(l){l.renderer.add(u.NUMBER,{renderCell:s.createDefaultRenderCell(),renderEdit:s.createRenderEdit((({row:l,column:n,fieldItem:r,emitFormClick:a,emitFormChangeWithParams:u,$table:i})=>{var s,p;const{placeholder:d=(null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.383"))||"请输入"}=r.componentProps||{};function c(e){const o=l[n.field];l[n.field]=e,u({oldValue:o})}const v={clearable:!0,placeholder:d,onBlur:()=>u({type:"blur",oldValue:l[n.field]}),onClick:a};return!0===r.allowSlash||"1"===r.allowSlash?e(t,o({value:l[n.field],onChange:c,onSelect:function(){i.internalData.isActivated=!0}},v,{whiteList:r.whiteList},r.componentProps,{popperProps:{...null==(p=r.componentProps)?void 0:p.popperProps,class:"iho-table_numberInputSlashPopper"}}),null):e(m,o({value:l[n.field],"onUpdate:value":c},v,r.componentProps),null)}))})},apply(e){i(e).bindAutoFocusConfig(l,u.NUMBER,".n-input__input-el",{focusType:"class"})}})}export{d as numberRendererPlugin};