@ibiz-template/vue3-components 0.7.41-alpha.17 → 0.7.41-alpha.19
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.
- package/dist/chart-q7pMKjYo.js +1 -0
- package/dist/ibiz-markdown-editor-e33m6ees.js +1 -0
- package/dist/index-BoV5htv9.js +11 -0
- package/dist/{index-swminiXb.js → index-Bt6TkADL.js} +1 -1
- package/dist/{index-AOFxMmyX.js → index-K6B-Odyq.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/map-chart-user-NYROZ-6g.js +1 -0
- package/dist/wang-editor-exnzt_I1.js +1 -0
- package/dist/{xlsx-util-jYyM8alm.js → xlsx-util-fuTLwrKA.js} +1 -1
- package/es/common/control-navigation/provider/calendar-navigation.provider.mjs +3 -1
- package/es/common/control-navigation/provider/index.mjs +1 -1
- package/es/common/control-navigation/provider/map-navigation.provider.d.ts +8 -2
- package/es/common/control-navigation/provider/map-navigation.provider.mjs +20 -1
- package/es/common/map-chart-user/map-chart-user.css +1 -1
- package/es/common/map-chart-user/map-chart-user.d.ts +11 -1
- package/es/common/map-chart-user/map-chart-user.mjs +82 -6
- package/es/common/map-chart-user/map-chart-user.util.d.ts +2 -0
- package/es/common/map-chart-user/map-chart-user.util.mjs +54 -3
- package/es/common/map-chart-user/map-user-manager.d.ts +2 -0
- package/es/common/map-chart-user/map-user-manager.mjs +46 -10
- package/es/control/calendar/components/calendar-daily/calendar-daily.css +1 -1
- package/es/control/calendar/components/calendar-daily/calendar-daily.mjs +30 -43
- package/es/control/calendar/components/calendar-daily/use-calendar-daily.d.ts +6 -2
- package/es/control/calendar/components/calendar-daily/use-calendar-daily.mjs +37 -4
- package/es/control/calendar/components/calendar-user/calendar-user.css +1 -1
- package/es/control/calendar/components/calendar-user/calendar-user.mjs +1 -0
- package/es/control/calendar/components/calendar-week/calendar-week.css +1 -1
- package/es/control/calendar/components/calendar-week/calendar-week.mjs +30 -45
- package/es/control/calendar/components/calendar-week/use-calendar-week.d.ts +6 -2
- package/es/control/calendar/components/calendar-week/use-calendar-week.mjs +37 -4
- package/es/control/calendar/components/custom-calendar/custom-calendar.css +1 -1
- package/es/control/calendar/components/util/index.mjs +1 -1
- package/es/control/calendar/components/util/util.d.ts +30 -2
- package/es/control/calendar/components/util/util.mjs +32 -2
- package/es/control/chart/chart.mjs +1 -0
- package/es/control/dashboard/portlet/menu-portlet/app-menu-portlet/app-menu-portlet.css +1 -1
- package/es/control/data-view/data-view.d.ts +1 -1
- package/es/control/data-view/index.d.ts +1 -1
- package/es/control/drtab/drtab-control.util.mjs +1 -1
- package/es/control/drtab/drtab.controller.d.ts +5 -0
- package/es/control/drtab/drtab.controller.mjs +19 -0
- package/es/control/drtab/flow-drtab.css +1 -1
- package/es/control/drtab/flow-drtab.mjs +18 -5
- package/es/control/exp-bar/render-util.mjs +1 -12
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.mjs +8 -4
- package/es/control/form/form-detail/form-tab-panel/form-tab-panel.css +1 -1
- package/es/control/form/form-detail/form-tab-panel/form-tab-panel.mjs +2 -1
- package/es/control/gantt/gantt.css +1 -1
- package/es/control/gantt/gantt.d.ts +4 -2
- package/es/control/gantt/gantt.mjs +130 -5
- package/es/control/gantt/index.d.ts +4 -2
- package/es/control/grid/grid/grid.d.ts +1 -1
- package/es/control/grid/grid/index.d.ts +1 -1
- package/es/control/grid/grid-column/grid-field-column/attachment-column/attachment-column.mjs +11 -2
- package/es/control/grid/grid-column/grid-field-column/attachment-column/file-util.d.ts +1 -1
- package/es/control/grid/grid-column/grid-field-column/attachment-column/file-util.mjs +39 -24
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.css +1 -1
- package/es/control/grid/virtualized-table/index.d.ts +1 -1
- package/es/control/grid/virtualized-table/virtualized-table.d.ts +1 -1
- package/es/control/kanban/index.d.ts +1 -1
- package/es/control/kanban/kanban.d.ts +1 -1
- package/es/control/list/index.d.ts +1 -1
- package/es/control/list/list.d.ts +1 -1
- package/es/control/list/list.mjs +1 -1
- package/es/control/map/map.mjs +1 -1
- package/es/control/tree/index.d.ts +1 -1
- package/es/control/tree/tree.d.ts +5 -5
- package/es/control/tree/tree.mjs +5 -13
- package/es/control/tree-grid/index.d.ts +7 -1
- package/es/control/tree-grid/tree-grid.d.ts +7 -1
- package/es/control/tree-grid/tree-grid.mjs +62 -55
- package/es/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-edit-column/all-edit.mjs +3 -1
- package/es/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.css +1 -1
- package/es/control/tree-grid-ex/tree-grid-ex.css +1 -1
- package/es/control/tree-grid-ex/tree-grid-ex.mjs +32 -28
- package/es/editor/carousel/ibiz-carousel/ibiz-carousel.d.ts +2 -75
- package/es/editor/carousel/ibiz-carousel/ibiz-carousel.mjs +24 -12
- package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +17 -1
- package/es/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.mjs +4 -2
- package/es/editor/html/wang-editor/wang-editor.mjs +29 -7
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.d.ts +3 -0
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +36 -5
- package/es/editor/upload/use/use-iview-upload.d.ts +0 -1
- package/es/editor/upload/use/use-iview-upload.mjs +50 -25
- package/es/index.mjs +1 -0
- package/es/locale/en/index.d.ts +9 -0
- package/es/locale/en/index.mjs +4 -0
- package/es/locale/zh-CN/index.d.ts +9 -0
- package/es/locale/zh-CN/index.mjs +4 -0
- package/es/panel-component/app-extend-menu/bottom-side-menu/bottom-side-menu.d.ts +1 -1
- package/es/panel-component/app-extend-menu/left-side-menu/left-side-menu.d.ts +1 -1
- package/es/panel-component/app-extend-menu/right-side-menu/right-side-menu.d.ts +1 -1
- package/es/panel-component/app-extend-menu/top-side-menu/top-side-menu.d.ts +1 -1
- package/es/panel-component/app-switch/app-switch.controller.mjs +4 -1
- package/es/panel-component/app-switch/app-switch.d.ts +1 -1
- package/es/panel-component/auth-userinfo/auth-userinfo.controller.d.ts +31 -0
- package/es/panel-component/auth-userinfo/auth-userinfo.controller.mjs +51 -0
- package/es/panel-component/auth-userinfo/auth-userinfo.css +1 -1
- package/es/panel-component/auth-userinfo/auth-userinfo.d.ts +7 -4
- package/es/panel-component/auth-userinfo/auth-userinfo.mjs +20 -5
- package/es/panel-component/auth-userinfo/auth-userinfo.provider.d.ts +2 -1
- package/es/panel-component/auth-userinfo/auth-userinfo.provider.mjs +2 -2
- package/es/panel-component/auth-userinfo/index.d.ts +4 -3
- package/es/panel-component/global-search/global-search.controller.d.ts +10 -3
- package/es/panel-component/global-search/global-search.controller.mjs +39 -18
- package/es/panel-component/global-search/global-search.d.ts +3 -1
- package/es/panel-component/global-search/global-search.mjs +8 -1
- package/es/panel-component/global-search/index.d.ts +1 -0
- package/es/panel-component/index-blank-placeholder/index-blank-placeholder.controller.mjs +0 -2
- package/es/panel-component/nav-breadcrumb/index.d.ts +1 -0
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.controller.d.ts +8 -1
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.controller.mjs +64 -18
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.css +1 -1
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.d.ts +3 -1
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.mjs +14 -3
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.service.d.ts +1 -1
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.service.mjs +5 -6
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.state.d.ts +8 -0
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.state.mjs +6 -0
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.util.d.ts +26 -1
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.util.mjs +50 -6
- package/es/panel-component/panel-app-title/panel-app-title.controller.mjs +5 -2
- package/es/panel-component/panel-app-title/panel-app-title.d.ts +1 -0
- package/es/panel-component/panel-app-title/panel-app-title.mjs +6 -0
- package/es/panel-component/panel-index-view-search/index.d.ts +4 -3
- package/es/panel-component/panel-index-view-search/panel-index-view-search.controller.d.ts +31 -0
- package/es/panel-component/panel-index-view-search/panel-index-view-search.controller.mjs +51 -0
- package/es/panel-component/panel-index-view-search/panel-index-view-search.d.ts +8 -5
- package/es/panel-component/panel-index-view-search/panel-index-view-search.mjs +17 -3
- package/es/panel-component/panel-index-view-search/panel-index-view-search.provider.d.ts +2 -1
- package/es/panel-component/panel-index-view-search/panel-index-view-search.provider.mjs +2 -2
- package/es/panel-component/panel-tab-panel/panel-tab-panel.mjs +2 -2
- package/es/panel-component/user-action/user-action.d.ts +1 -1
- package/es/panel-component/user-message/async-action/async-data-export/async-data-export.d.ts +1 -0
- package/es/panel-component/user-message/async-action/async-data-export/async-data-export.mjs +3 -1
- package/es/panel-component/view-msg-pos/view-msg-pos.d.ts +2 -1
- package/es/util/app-modal/app-modal-component.css +1 -1
- package/es/util/app-modal/app-modal-component.d.ts +6 -1
- package/es/util/app-modal/app-modal-component.mjs +45 -4
- package/es/util/fullscreen/fullscreen-util.mjs +1 -1
- package/es/util/icon/icon.d.ts +3 -0
- package/es/util/icon/icon.mjs +25 -0
- package/es/util/index.d.ts +1 -0
- package/es/util/index.mjs +1 -0
- package/es/view-engine/calendar-exp-view.engine.d.ts +6 -7
- package/es/view-engine/calendar-exp-view.engine.mjs +6 -24
- package/es/view-engine/edit-view.engine.d.ts +11 -0
- package/es/view-engine/edit-view.engine.mjs +12 -0
- package/es/view-engine/login-view.engine.d.ts +11 -1
- package/es/view-engine/login-view.engine.mjs +9 -5
- package/es/view-engine/mpickup-view-engine.d.ts +8 -1
- package/es/view-engine/mpickup-view-engine.mjs +14 -8
- package/es/view-engine/pickup-view.engine.d.ts +8 -1
- package/es/view-engine/pickup-view.engine.mjs +15 -0
- package/lib/common/control-navigation/provider/calendar-navigation.provider.cjs +3 -1
- package/lib/common/control-navigation/provider/index.cjs +1 -1
- package/lib/common/control-navigation/provider/map-navigation.provider.cjs +20 -1
- package/lib/common/map-chart-user/map-chart-user.cjs +81 -5
- package/lib/common/map-chart-user/map-chart-user.css +1 -1
- package/lib/common/map-chart-user/map-chart-user.util.cjs +54 -3
- package/lib/common/map-chart-user/map-user-manager.cjs +46 -10
- package/lib/control/calendar/components/calendar-daily/calendar-daily.cjs +29 -42
- package/lib/control/calendar/components/calendar-daily/calendar-daily.css +1 -1
- package/lib/control/calendar/components/calendar-daily/use-calendar-daily.cjs +35 -2
- package/lib/control/calendar/components/calendar-user/calendar-user.cjs +1 -0
- package/lib/control/calendar/components/calendar-user/calendar-user.css +1 -1
- package/lib/control/calendar/components/calendar-week/calendar-week.cjs +29 -44
- package/lib/control/calendar/components/calendar-week/calendar-week.css +1 -1
- package/lib/control/calendar/components/calendar-week/use-calendar-week.cjs +35 -2
- package/lib/control/calendar/components/custom-calendar/custom-calendar.css +1 -1
- package/lib/control/calendar/components/util/index.cjs +4 -0
- package/lib/control/calendar/components/util/util.cjs +34 -0
- package/lib/control/chart/chart.cjs +1 -0
- package/lib/control/dashboard/portlet/menu-portlet/app-menu-portlet/app-menu-portlet.css +1 -1
- package/lib/control/drtab/drtab-control.util.cjs +1 -1
- package/lib/control/drtab/drtab.controller.cjs +19 -0
- package/lib/control/drtab/flow-drtab.cjs +17 -4
- package/lib/control/drtab/flow-drtab.css +1 -1
- package/lib/control/exp-bar/render-util.cjs +1 -12
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.cjs +7 -3
- package/lib/control/form/form-detail/form-tab-panel/form-tab-panel.cjs +2 -1
- package/lib/control/form/form-detail/form-tab-panel/form-tab-panel.css +1 -1
- package/lib/control/gantt/gantt.cjs +129 -4
- package/lib/control/gantt/gantt.css +1 -1
- package/lib/control/grid/grid-column/grid-field-column/attachment-column/attachment-column.cjs +11 -2
- package/lib/control/grid/grid-column/grid-field-column/attachment-column/file-util.cjs +39 -24
- package/lib/control/grid/grid-column/grid-field-column/grid-field-column.css +1 -1
- package/lib/control/list/list.cjs +1 -1
- package/lib/control/map/map.cjs +1 -1
- package/lib/control/tree/tree.cjs +5 -13
- package/lib/control/tree-grid/tree-grid.cjs +62 -55
- package/lib/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-edit-column/all-edit.cjs +3 -1
- package/lib/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.css +1 -1
- package/lib/control/tree-grid-ex/tree-grid-ex.cjs +32 -28
- package/lib/control/tree-grid-ex/tree-grid-ex.css +1 -1
- package/lib/editor/carousel/ibiz-carousel/ibiz-carousel.cjs +24 -12
- package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +17 -1
- package/lib/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.cjs +4 -2
- package/lib/editor/html/wang-editor/wang-editor.cjs +29 -7
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +36 -5
- package/lib/editor/upload/use/use-iview-upload.cjs +50 -25
- package/lib/index.cjs +3 -0
- package/lib/locale/en/index.cjs +4 -0
- package/lib/locale/zh-CN/index.cjs +4 -0
- package/lib/panel-component/app-switch/app-switch.controller.cjs +4 -1
- package/lib/panel-component/auth-userinfo/auth-userinfo.cjs +20 -5
- package/lib/panel-component/auth-userinfo/auth-userinfo.controller.cjs +53 -0
- package/lib/panel-component/auth-userinfo/auth-userinfo.css +1 -1
- package/lib/panel-component/auth-userinfo/auth-userinfo.provider.cjs +2 -2
- package/lib/panel-component/global-search/global-search.cjs +8 -1
- package/lib/panel-component/global-search/global-search.controller.cjs +39 -18
- package/lib/panel-component/index-blank-placeholder/index-blank-placeholder.controller.cjs +0 -2
- package/lib/panel-component/nav-breadcrumb/nav-breadcrumb.cjs +14 -3
- package/lib/panel-component/nav-breadcrumb/nav-breadcrumb.controller.cjs +63 -17
- package/lib/panel-component/nav-breadcrumb/nav-breadcrumb.css +1 -1
- package/lib/panel-component/nav-breadcrumb/nav-breadcrumb.service.cjs +4 -5
- package/lib/panel-component/nav-breadcrumb/nav-breadcrumb.state.cjs +6 -0
- package/lib/panel-component/nav-breadcrumb/nav-breadcrumb.util.cjs +52 -5
- package/lib/panel-component/panel-app-title/panel-app-title.cjs +6 -0
- package/lib/panel-component/panel-app-title/panel-app-title.controller.cjs +5 -2
- package/lib/panel-component/panel-index-view-search/panel-index-view-search.cjs +16 -2
- package/lib/panel-component/panel-index-view-search/panel-index-view-search.controller.cjs +53 -0
- package/lib/panel-component/panel-index-view-search/panel-index-view-search.provider.cjs +2 -2
- package/lib/panel-component/panel-tab-panel/panel-tab-panel.cjs +2 -2
- package/lib/panel-component/user-message/async-action/async-data-export/async-data-export.cjs +3 -1
- package/lib/util/app-modal/app-modal-component.cjs +43 -2
- package/lib/util/app-modal/app-modal-component.css +1 -1
- package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
- package/lib/util/icon/icon.cjs +28 -0
- package/lib/util/index.cjs +3 -0
- package/lib/view-engine/calendar-exp-view.engine.cjs +6 -24
- package/lib/view-engine/edit-view.engine.cjs +12 -0
- package/lib/view-engine/login-view.engine.cjs +9 -5
- package/lib/view-engine/mpickup-view-engine.cjs +14 -8
- package/lib/view-engine/pickup-view.engine.cjs +15 -0
- package/package.json +6 -6
- package/dist/chart-8QfxarWf.js +0 -1
- package/dist/ibiz-markdown-editor-0VHzFa2l.js +0 -1
- package/dist/index-t1aZ8OJE.js +0 -11
- package/dist/map-chart-user-xOSZGbF2.js +0 -1
- package/dist/wang-editor-Y8puaTx2.js +0 -1
- package/es/editor/upload/use/use-ibiz-upload.d.ts +0 -95
- package/es/editor/upload/use/use-ibiz-upload.mjs +0 -170
- package/lib/editor/upload/use/use-ibiz-upload.cjs +0 -175
- /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.17_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.18_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
- /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.17_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.18_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["vue","ramda","@ibiz-template/vue3-util","@ibiz-template/runtime","echarts","@ibiz-template/core"],(function(e){"use strict";var t,a,o,r,n,s,i,c,l,u,d,m,p,f;return{setters:[function(e){t=e.ref,a=e.onMounted,o=e.onUnmounted,r=e.defineComponent,n=e.computed,s=e.createVNode},function(e){i=e.mergeDeepLeft,c=e.mergeDeepWithKey,l=e.isNil},function(e){u=e.useNamespace},function(e){d=e.MapController},function(e){m=e.init,p=e.registerMap},function(e){f=e.listenJSEvent}],execute:function(){const v={strAreaCode:!1,visualMap:{text:[ibiz.i18n.t("component.mapChart.high"),ibiz.i18n.t("component.mapChart.low")],min:0,max:100,rangeColor:["#90d1e7","#fff600","#ff5200"]},areaColor:"#87cefa",areaBorderColor:"#FFF",hoverAreaColor:"#fbdb2f",pointSymbol:"pin",jsonBaseUrl:"".concat(ibiz.env.assetsUrl,"/json/map"),defaultAreaCode:1e5},y=(e,t,a=[],o=[])=>"area"===t?o.find((t=>t._id===e)):"point"===t?a.find((t=>t._id===e)):void 0,b=e=>{let t=e;const a=window.getComputedStyle(document.documentElement);return a&&(t=a.getPropertyValue(e)||t),t},h=e=>{const{pointSymbol:t}=e,a=u("map-chart-user"),o=b(a.cssVarName("color-danger")),r=b(a.cssVarName("font-size-header-4"));return{type:"scatter",coordinateSystem:"geo",symbol:t,symbolSize:Number(r.slice(0,2)),visualMap:!1,itemStyle:{color:o}}},g=(e,t)=>{const a={},o=u("map-chart-user"),r=b(o.cssVarName("color-text-1")),n=b(o.cssVarName("font-size-regular"));return a.label={show:!0,color:r,fontSize:Number(n.slice(0,2)),textShadowBlur:0,formatter:a=>{if(!a.data)return;const o=y(a.data._id,"point",e,t);return null==o?void 0:o._text},position:"left",offset:[10,-15]},a.tooltip={formatter:a=>{if(!a.data)return;const r=y(a.data._id,"point",e,t);return'<div style="color:'.concat(r._color,";background: ").concat(r._bgcolor,'" class="').concat(r._className," ").concat(o.e("popper"),'">').concat(null==r?void 0:r._tooltip,"</div>")},padding:0},a.data=e.map((e=>{let t;return e._symbol&&(t="image://".concat(e._symbol)),{_id:e._id,symbol:t,value:[Number(e._longitude),Number(e._latitude)],visualMap:!1}})),a},C=e=>{const{areaColor:t,areaBorderColor:a,hoverAreaColor:o}=e;return{type:"map",nameProperty:"adcodeStr",itemStyle:{areaColor:t,borderColor:a,borderWidth:2},emphasis:{itemStyle:{areaColor:o}}}},N=(e,t,a,o=[])=>{const r={},n=u("map-chart-user"),s=b(n.cssVarName("color-text-1")),i=b(n.cssVarName("font-size-regular"));return r.map=e,r.label={show:!0,color:s,fontSize:Number(i.slice(0,2)),formatter:e=>o.cityNames[e.name]},r.tooltip={formatter:e=>{if(!e.data)return;const o=y(e.data._id,"area",t,a);return'<div style="color:'.concat(o._color,";background: ").concat(o._bgcolor,'" class="').concat(o._className," ").concat(n.e("popper"),'">').concat(null==o?void 0:o._tooltip,"</div>")},padding:0},r.data=a.map((e=>({name:"".concat(e._areaCode),value:e._value,_id:e._id,deData:e}))),r.select={disabled:!0},r};function z(e,r,n){const s=new Map,i=t(""),c=t([]);let l;const u=t();let d;const v=async t=>{e.options=t,await e.evt.emit("onBeforeUpdate",{data:t}),l.setOption(t,!0)},b=async e=>{if(s.has(e))return;const t=await async function(e,t){return(await ibiz.net.axios({url:"".concat(e,"/").concat(t,".json")})).data}(r.value.jsonBaseUrl,e);s.set(e,(e=>{const t={cityNames:{},noChild:1===e.features.length};return e.features.forEach((e=>{const{adcode:a,name:o}=e.properties;t.cityNames[a]=o})),t})(t)),p(e,t)},h=()=>s.get(i.value),g=()=>{if(i.value){const e=n(i.value);v(e),l.resize()}},C=async(t,a,o=!1)=>{o||e.onMapChange(a);const r="".concat(t);s.has(r)||await b(r),e.state.mapInfo=h(),i.value=r,c.value.push(r),g()},N=f(window,"resize",(()=>{l&&l.resize()}));return a((()=>{l=m(u.value),e.chart=l,u.value&&ResizeObserver&&(d=new ResizeObserver((()=>{null==l||l.resize()})),d.observe(u.value)),l.on("click",(t=>{if("series"===t.componentType){if("scatter"===t.seriesType){if(!t.data)return;const{pointData:a,areaData:o}=e.state,r=y(t.data._id,"point",a,o);return void(r&&e.onPointClick(r))}if("map"===t.seriesType){const a=r.value.strAreaCode?"".concat(t.name):Number(t.name);e.state.areaCode=a;const{pointData:o,areaData:n,enabledDrillDown:s}=e.state;if(t.data){const a=y(t.data._id,"area",o,n);a&&e.onAreaClick(a)}t.name!==i.value&&s&&C(t.name,a)}}})),l.on("mouseover",(function(t){if(e.evt.emit("onMouseOver",{data:t}),"series"===t.componentType&&"scatter"===t.seriesType){const e=t.dataIndex,a=l.getOption(),o=a.series[t.seriesIndex].data,r=a.series[t.seriesIndex].symbolSize;o[e].symbolSize=r+10,v(a)}})),l.on("mouseout",(function(t){if(e.evt.emit("onMouseOut",{data:t}),"series"===t.componentType&&"scatter"===t.seriesType){const e=t.dataIndex,a=l.getOption();delete a.series[t.seriesIndex].data[e].symbolSize,v(a)}}))})),o((()=>{N(),null==d||d.disconnect()})),{chartRef:u,historyNames:c,currentName:i,changeMap:C,getCityInfo:h,goBack:async()=>{if(c.value.length>1){c.value.pop();const t=c.value.pop(),a=r.value.strAreaCode?"".concat(t):Number(t);e.state.areaCode=a,await e.evt.emit("onBackClick",void 0),C(t,a)}},refresh:g}}const _=r({name:"IBizMapChartUser",props:{areaData:{type:Array},pointData:{type:Array},options:{type:Object,default:()=>({})},controller:{type:d,required:!0}},setup(e){const t=u("map-chart-user"),o=e.controller;let r=v;if(o.controlParams.defaultopts){const e=JSON.parse(o.controlParams.defaultopts);r=i(e,r)}const s=n((()=>c(((e,t,a)=>l(a)?t:a),r,e.options))),{chartRef:d,historyNames:m,changeMap:p,getCityInfo:f,goBack:y}=z(e.controller,s,(t=>{const a=e.areaData||[],o=e.pointData||[],r=(()=>{const e=u("map-chart-user"),t=b(e.cssVarName("color-text-1")),a=b(e.cssVarName("font-size-regular")),o=b(e.cssVarName("color-bg-0"));return{trigger:"item",textStyle:{color:t,fontSize:Number(a.slice(0,2))},backgroundColor:o,borderWidth:0,extraCssText:"backdrop-filter: blur(3px);"}})(),n=(e=>{const{visualMap:t}=e;return{min:t.min,max:t.max,text:t.text,realtime:!1,hoverLink:!1,inRange:{color:t.rangeColor}}})(s.value),i=f(),c={...h(s.value),...g(o,a)};return{geo:{map:t},tooltip:r,visualMap:n,series:[{...C(s.value),...N(t,o,a,i)},c]}}));return a((()=>{const e=s.value.defaultAreaCode,t=o.state.strAreaCode?"".concat(e):Number(e);o.state.areaCode=t,p(e,t,!0)})),{ns:t,chartRef:d,historyNames:m,goBack:y}},render(){return s("div",{class:this.ns.b()},[s("div",{class:this.ns.e("chart"),ref:"chartRef"},null),this.historyNames.length>1&&s("div",{class:this.ns.e("goback"),onClick:()=>{this.goBack()}},[ibiz.i18n.t("app.return")])])}});e({IBizMapChartUser:_,default:_})}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["vue","@wangeditor/editor-for-vue","qx-util","ramda","@ibiz-template/vue3-util","@ibiz-template/core","@ibiz-template/runtime","element-plus","./index-t1aZ8OJE.js","lodash-es","@floating-ui/dom","interactjs","dayjs","qs","vuedraggable","@wangeditor/editor","vue-router","@ibiz-template/devtool","axios","dayjs/plugin/customParseFormat","vue-i18n","@ibiz-template/model-helper"],(function(e,t){"use strict";var a,l,o,n,i,s,r,c,u,d,m,p,v,f,h,b,g,y,S,C,w,E,T,I,U;return{setters:[function(e){a=e.defineComponent,l=e.ref,o=e.shallowRef,n=e.watch,i=e.onBeforeUnmount,s=e.onMounted,r=e.nextTick,c=e.onUnmounted,u=e.createVNode,d=e.resolveComponent},function(e){m=e.Toolbar,p=e.Editor},function(e){v=e.createUUID},function(e){f=e.isNil},function(e){h=e.getHtmlProps,b=e.getEditorEmits,g=e.useNamespace,y=e.useUIStore},function(e){S=e.awaitTimeout,C=e.StringUtil,w=e.IBizContext},function(e){E=e.UIActionUtil,T=e.SysUIActionTag},function(e){I=e.ElMessageBox},function(e){U=e.c},null,null,null,null,null,null,null,null,null,null,null,null,null],execute:function(){e("default",a({name:"IBizHtml",props:h(),emits:b(),setup(e,{emit:a}){const d=g("html"),h=e.controller,b=l(),x=l({});let A=null,z=0;const F=l(),P=o(),k=l(""),R=ibiz.util.file.getUploadHeaders(),D=l({...R}),O=l(""),H=l(""),N=l(!0),M=l(!1),B=l(!1),L=l(!1),V=l(!1),j=h.model;j.editorParams&&(j.editorParams.enableEdit&&(M.value=!0,B.value=!0,N.value=h.toBoolean(j.editorParams.enableEdit)&&!e.readonly&&!e.disabled),j.editorParams.enableedit&&(M.value=!0,B.value=!0,N.value=h.toBoolean(j.editorParams.enableedit)&&!e.readonly&&!e.disabled),j.editorParams.enableFullScreen&&(L.value=h.toBoolean(j.editorParams.enableFullScreen)),j.editorParams.enablefullscreen&&(L.value=h.toBoolean(j.editorParams.enablefullscreen))),e.readonly&&(M.value=!1,B.value=!0),n((()=>e.data),(e=>{if(e){const t={...h.editorParams};t.uploadparams&&(t.uploadParams=JSON.parse(t.uploadparams)),t.exportparams&&(t.exportParams=JSON.parse(t.exportparams));const a=ibiz.util.file.calcFileUpDownUrl(h.context,h.params,e,t);O.value=a.uploadUrl,H.value=a.downloadUrl}}),{immediate:!0,deep:!0});const q=(e,t)=>{if(t)return!0},J=e=>e,K={excludeKeys:["group-video","emotion"],insertKeys:{index:60,keys:h.chatCompletion?["emoji","|","aichart"]:["emoji"]}},Q={placeholder:h.placeHolder,readOnly:M.value?B.value:e.readonly,MENU_CONF:{uploadImage:{server:O.value,fieldName:"file",maxFileSize:10485760,maxNumberOfFiles:10,allowedFileTypes:[],headers:D.value,withCredentials:!0,onBeforeUpload:e=>e,onProgress(e){console.log("progress",e)},onSuccess(e,t){console.log("".concat(e.name," 上传成功"),t)},onFailed(e,t){console.log("".concat(e.name," 上传失败"),t)},onError(e,t,a){console.log("".concat(e.name," 上传出错"),t,a)},async customInsert(e,t){t(H.value.replace("%fileId%",e.id),e.filename,"")}},insertLink:{checkLink:q,parseLinkUrl:J},editLink:{checkLink:q,parseLinkUrl:J}}};let _;i((()=>{const e=P.value;null!=e&&e.destroy()}));const G=l=>{P.value=l,h.onCreated(P.value),l.setHtml(k.value),l.on("aiClick",(()=>{(async()=>{const l=h.model.appDataEntityId;if(!l||!h.deACMode)return;const{contentToolbarItems:o,footerToolbarItems:n,questionToolbarItems:i,otherToolbarItems:s}=U(h.deACMode),{zIndex:r}=y(),c=r.increment(),u=await t.import("@ibiz-template-plugin/ai-chat");_=u.chat||u.default.chat;let d,m="";_.create({containerOptions:{zIndex:c},chatOptions:{caption:h.deACMode.logicName,context:{...h.context},params:{...h.params,srfactag:h.deACMode.codeName},appDataEntityId:l,contentToolbarItems:o,footerToolbarItems:n,questionToolbarItems:i,otherToolbarItems:s,appendCurData:"true"===h.editorParams.srfaiappendcurdata?e.data:void 0,appendCurContent:h.editorParams.srfaiappendcurcontent?C.fill(h.editorParams.srfaiappendcurcontent,h.context,h.params,e.data):void 0,question:async(e,t,a,l,o)=>{m=v(),d=new AbortController;const n=await ibiz.hub.getApp(t.srfappid).deService.getService(t,l.appDataEntityId);try{await n.aiChatSse((t=>{if(20===t.actionstate&&t.actionresult)e.addMessage({messageid:m,state:t.actionstate,type:"DEFAULT",role:"ASSISTANT",content:t.actionresult});else if(30===t.actionstate&&t.actionresult){const a=JSON.parse(t.actionresult).choices;a&&a.length>0&&e.replaceMessage({messageid:m,state:t.actionstate,type:"DEFAULT",role:"ASSISTANT",content:a[0].content||""})}else 40===t.actionstate&&e.replaceMessage({messageid:m,state:t.actionstate,type:"ERROR",role:"ASSISTANT",content:t.actionresult})}),d,t,a,{messages:o})}catch(t){e.replaceMessage({messageid:m,state:40,type:"ERROR",role:"ASSISTANT",content:t.message||ibiz.i18n.t("app.aiError")}),null==d||d.abort()}finally{return e.completeMessage(m,!0),!0}},abortQuestion:async e=>{null==d||d.abort(),await e.stopMessage({messageid:m,state:30,type:"DEFAULT",role:"ASSISTANT",content:""}),await e.completeMessage(m,!0)},action:(e,t)=>{"backfill"===e&&(M.value?k.value=t.realcontent||"":a("change",t.realcontent))},history:async(e,t,a)=>{const l=await ibiz.hub.getApp(e.srfappid).deService.getService(e,a.appDataEntityId),o=a.appendCurData?a.appendCurData:{},n=await l.aiChatHistory(e,t,o);if(n.data&&Array.isArray(n.data)){let e;n.data.forEach((t=>{if("TOOL"===t.role)e&&t.content&&_.aiChat.updateRecommendPrompt(e,t.content);else{const a={messageid:v(),state:30,type:"DEFAULT",role:t.role,content:t.content,completed:!0};e=a,_.aiChat.addMessage(a)}}))}return!0},recommendPrompt:async(e,t,a)=>{const l=await ibiz.hub.getApp(e.srfappid).deService.getService(e,a.appDataEntityId),o=await l.aiChatRecommendPrompt(e,t,a.message);if(o.ok&&o.data){const e=o.data.choices;return e&&e.length>0?e[0]:null}return null},uploader:{onUpload:async(e,t,a)=>{const l=ibiz.util.file.calcFileUpDownUrl((null==a?void 0:a.context)||h.context,(null==a?void 0:a.params)||h.params,{}),o=ibiz.util.file.getUploadHeaders(),n=new FormData;return n.append("file",e),(await ibiz.net.axios({url:l.uploadUrl,method:"post",headers:o,data:n,onUploadProgress:e=>{const a=e.loaded/e.total*100;t(a)}})).data}},extendToolbarClick:async(e,t,a,l,o)=>{var n,i;const s=await E.exec(t.id,{view:h.view,ctrl:h.ctrl,context:w.create(a),params:l,data:[o],event:e},t.appId);if(s.closeView)h.view.closeView({ok:!0});else if(s.refresh)switch(s.refreshMode){case 1:h.view.callUIAction(T.REFRESH);break;case 2:null==(n=h.view.parentView)||n.callUIAction(T.REFRESH);break;case 3:null==(i=h.view.getTopView())||i.callUIAction(T.REFRESH)}return s}}})})()}))},W=t=>{const l=t.getHtml(),o="<p><br></p>"===l?"":l;o===e.value||""===o&&f(e.value)||!M.value&&t.isFocused()&&a("change",o)},X=e=>{},Y=e=>{a("focus")},Z=e=>{a("blur")},$=(e,t)=>{alert("【".concat(ibiz.i18n.t("editor.html.wangEditor.customTips"),"】").concat(t," - ").concat(e))},ee=(e,t,a)=>{a(!0)},te=()=>{const e=P.value;null!=e&&e.disable()},ae=()=>{const e=P.value;null!=e&&e.enable()};s((()=>{n((()=>e.value),((t,a)=>{t===a||"string"!=typeof e.value&&null!=t||r(null==t?()=>{k.value=""}:()=>{k.value=t})}),{immediate:!0}),n((()=>e.disabled),((e,t)=>{e!==t&&(!0===e?te():ae())}),{immediate:!0})}));const le=()=>{B.value=!B.value,B.value?te():(ae(),P.value.focus(),(()=>{var t,a;if(e.value){const l=e.value.indexOf("</p>");if(l>=0){const e=null==(t=P.value.selection.anchor)?void 0:t.offset,o=null==(a=P.value.selection.anchor)?void 0:a.path;0===e&&o.length>0&&0===o[0]&&P.value.move(l-3)}}})())},oe=()=>{V.value=!V.value,r((()=>{B.value?te():(ae(),P.value.focus())}))};return s((()=>{S(0,(()=>{if(b.value&&F.value){const e=b.value.offsetHeight;A=new ResizeObserver((t=>{const a=t[0].contentRect.height;if(a!==z){const l={height:"".concat(e-t[0].contentRect.height+(0!==a?300:0),"px")};x.value=d.cssVarBlock(l),z=a}})),A.observe(F.value.selector)}}))})),c((()=>{h.onDestroyed(),A&&A.disconnect(),_&&_.close()})),{ns:d,editorRef:P,mode:"default",valueHtml:k,toolbarConfig:K,editorConfig:Q,handleCreated:G,handleChange:W,handleDestroyed:X,handleFocus:Y,handleBlur:Z,customAlert:$,customPaste:ee,insertText:e=>{const t=P.value;null!=t&&t.insertText(e)},printHtml:()=>{const e=P.value;null!=e&&console.log(e.getHtml())},disable:te,enable:ae,renderHeaserToolbar:()=>M.value||L.value?u("div",{class:d.b("custom-toolbar")},[M.value&&N.value&&B.value?u("i",{class:"fa fa-edit","aria-hidden":"true",title:ibiz.i18n.t("editor.html.enableedit"),onClick:()=>le()},null):null,L.value?V.value?u("i",{class:"fa fa-compress","aria-hidden":"true",title:ibiz.i18n.t("editor.html.reduce"),onClick:()=>oe()},null):u("i",{class:"fa fa-expand","aria-hidden":"true",title:ibiz.i18n.t("editor.html.expand"),onClick:()=>oe()},null):null]):null,renderEditorContent:()=>u("div",{class:d.b("content"),ref:"htmlContent",style:x.value},[u(m,{ref:"toolbarRef",editor:P.value,"default-config":K,mode:"default",class:d.b("toolbar")},null),u(p,{class:[d.b("editor"),d.is("readonly",B.value)],modelValue:k.value,"onUpdate:modelValue":e=>k.value=e,"default-config":Q,mode:"default",onOnCreated:G,onOnChange:W,onOnDestroyed:X,onOnFocus:Y,onOnBlur:Z,oncustomAlert:$,oncustomPaste:ee},null)]),renderFooter:()=>M.value?u("div",{class:[d.b("footer"),{[d.b("footer-dialog")]:V.value}]},[u("div",{class:d.be("footer","cancel"),onClick:()=>{e.value!==k.value?I({title:ibiz.i18n.t("editor.common.confirmCancel"),type:"warning",customClass:d.b("message"),message:u("div",{class:d.be("message","message-content")},[u("p",null,[ibiz.i18n.t("editor.common.confirmCancelPrompt")]),u("p",{class:d.bem("message","message-content","message-tip")},[ibiz.i18n.t("editor.common.cancelEditPrompt")])]),showCancelButton:!0,cancelButtonClass:d.be("message","message-cancel"),confirmButtonClass:d.be("message","message-comfire")}).then((()=>{k.value=e.value||"",le()})).catch((()=>{P.value.focus()})):le()}},[ibiz.i18n.t("app.cancel")]),u("div",{class:d.be("footer","save"),onClick:()=>(()=>{B.value=!0,P.value.disable();const e=k.value;a("change",e),V.value&&(V.value=!1)})()},[ibiz.i18n.t("app.save")])]):null,htmlContent:b,hasEnableEdit:M,cssVars:x,toolbarRef:F,isFullScreen:V,readonlyState:B,changeFullScreenState:oe}},render(){return this.isFullScreen?u(d("el-dialog"),{modelValue:this.isFullScreen,"onUpdate:modelValue":e=>this.isFullScreen=e,width:"80%",top:"10vh",class:this.ns.b("dialog-full-screen"),onClose:()=>this.changeFullScreenState()},{default:()=>[u("div",{class:[this.ns.b(),{[this.ns.b("editor-readonly")]:this.readonlyState}]},[this.renderHeaserToolbar(),this.renderEditorContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null])]}):u("div",{class:[this.ns.b(),{[this.ns.b("editor-readonly")]:this.readonlyState},this.ns.is("show-ai",!0)]},[this.renderHeaserToolbar(),this.renderEditorContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null])}}))}}}));
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
import { UploadEditorController } from '../upload-editor.controller';
|
|
3
|
-
export type FileInfo = {
|
|
4
|
-
name: string;
|
|
5
|
-
id: string;
|
|
6
|
-
status?: 'uploading' | 'finished' | 'fail' | 'cancel';
|
|
7
|
-
percentage?: number;
|
|
8
|
-
url?: string;
|
|
9
|
-
/**
|
|
10
|
-
* 文件名(不带后缀)
|
|
11
|
-
*/
|
|
12
|
-
fileName?: string;
|
|
13
|
-
/**
|
|
14
|
-
* 文件类型(拓展名)
|
|
15
|
-
*/
|
|
16
|
-
fileExt?: string;
|
|
17
|
-
/**
|
|
18
|
-
* 是否是图片
|
|
19
|
-
*/
|
|
20
|
-
isImage?: boolean;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* 格式化文件信息
|
|
24
|
-
*
|
|
25
|
-
* @author lxm
|
|
26
|
-
* @date 2022-11-18 15:11:38
|
|
27
|
-
* @param {FileInfo} file
|
|
28
|
-
*/
|
|
29
|
-
export declare function formatFileInfo(file: FileInfo, downloadUrl: string): FileInfo;
|
|
30
|
-
/**
|
|
31
|
-
* 文件上传组件初始化,解析props并得到downloadUrl、uploadUrl、fileList
|
|
32
|
-
*
|
|
33
|
-
* @author lxm
|
|
34
|
-
* @date 2022-11-21 10:11:01
|
|
35
|
-
* @export
|
|
36
|
-
* @param {{
|
|
37
|
-
* data: Ref<IData>;
|
|
38
|
-
* value: Ref<string>;
|
|
39
|
-
* controller: Ref<UploadEditorController>;
|
|
40
|
-
* }} props
|
|
41
|
-
* @returns {*}
|
|
42
|
-
*/
|
|
43
|
-
export declare function useIBizUploadInit(props: {
|
|
44
|
-
data: Ref<IData>;
|
|
45
|
-
value: Ref<string | undefined>;
|
|
46
|
-
controller: Ref<UploadEditorController>;
|
|
47
|
-
}): {
|
|
48
|
-
downloadUrl: Ref<string>;
|
|
49
|
-
uploadUrl: Ref<string>;
|
|
50
|
-
valueList: Ref<FileInfo[]>;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* 使用文件上传功能,传递外部已存在的文件集合,上传下载基础路径
|
|
54
|
-
*
|
|
55
|
-
* @author lxm
|
|
56
|
-
* @date 2022-11-21 10:11:01
|
|
57
|
-
* @export
|
|
58
|
-
* @param {{
|
|
59
|
-
* downloadUrl: Ref<string>;
|
|
60
|
-
* uploadUrl: Ref<string>;
|
|
61
|
-
* value: Ref<
|
|
62
|
-
* {
|
|
63
|
-
* name: string;
|
|
64
|
-
* id: string;
|
|
65
|
-
* url?: string;
|
|
66
|
-
* }[]
|
|
67
|
-
* >;
|
|
68
|
-
* }} opts
|
|
69
|
-
* @returns {*}
|
|
70
|
-
*/
|
|
71
|
-
export declare function useIBizUpload(opts: {
|
|
72
|
-
downloadUrl: Ref<string>;
|
|
73
|
-
uploadUrl: Ref<string>;
|
|
74
|
-
value: Ref<{
|
|
75
|
-
name: string;
|
|
76
|
-
id: string;
|
|
77
|
-
url?: string;
|
|
78
|
-
}[]>;
|
|
79
|
-
multiple?: boolean;
|
|
80
|
-
accept?: string;
|
|
81
|
-
}): {
|
|
82
|
-
selectFile: () => void;
|
|
83
|
-
fileList: Ref<{
|
|
84
|
-
name: string;
|
|
85
|
-
id: string;
|
|
86
|
-
status?: 'uploading' | 'finished' | 'fail' | 'cancel' | undefined;
|
|
87
|
-
percentage?: number | undefined;
|
|
88
|
-
url?: string | undefined;
|
|
89
|
-
fileName?: string | undefined;
|
|
90
|
-
fileExt?: string | undefined;
|
|
91
|
-
isImage?: boolean | undefined;
|
|
92
|
-
}[]>;
|
|
93
|
-
uploadState: Ref<'loading' | 'undo' | 'done'>;
|
|
94
|
-
};
|
|
95
|
-
export declare function openImagePreview(file: FileInfo): Promise<void>;
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { isImage, uploadFile } from '@ibiz-template/core';
|
|
2
|
-
import { ref, watch } from 'vue';
|
|
3
|
-
|
|
4
|
-
"use strict";
|
|
5
|
-
function formatFileInfo(file, downloadUrl) {
|
|
6
|
-
file.url = downloadUrl.replace("%fileId%", file.id);
|
|
7
|
-
if (!file.status) {
|
|
8
|
-
file.status = "finished";
|
|
9
|
-
}
|
|
10
|
-
if (!file.fileName) {
|
|
11
|
-
const index = file.name.lastIndexOf(".");
|
|
12
|
-
file.fileName = file.name.substring(0, index);
|
|
13
|
-
file.fileExt = file.name.substring(index);
|
|
14
|
-
file.isImage = isImage(file.name);
|
|
15
|
-
}
|
|
16
|
-
return file;
|
|
17
|
-
}
|
|
18
|
-
function useIBizUploadInit(props) {
|
|
19
|
-
const uploadUrl = ref("");
|
|
20
|
-
const downloadUrl = ref("");
|
|
21
|
-
const valueList = ref([]);
|
|
22
|
-
watch(
|
|
23
|
-
props.data,
|
|
24
|
-
(newVal) => {
|
|
25
|
-
if (newVal) {
|
|
26
|
-
const urls = ibiz.util.file.calcFileUpDownUrl(
|
|
27
|
-
props.controller.value.context,
|
|
28
|
-
props.controller.value.params,
|
|
29
|
-
newVal,
|
|
30
|
-
props.controller.value.editorParams
|
|
31
|
-
);
|
|
32
|
-
uploadUrl.value = urls.uploadUrl;
|
|
33
|
-
downloadUrl.value = urls.downloadUrl;
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{ immediate: true, deep: true }
|
|
37
|
-
);
|
|
38
|
-
watch(
|
|
39
|
-
props.value,
|
|
40
|
-
(newVal) => {
|
|
41
|
-
valueList.value = !newVal ? [] : JSON.parse(newVal);
|
|
42
|
-
if (valueList.value.length && downloadUrl.value) {
|
|
43
|
-
valueList.value.forEach((file) => {
|
|
44
|
-
formatFileInfo(file, downloadUrl.value);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
{ immediate: true }
|
|
49
|
-
);
|
|
50
|
-
watch(
|
|
51
|
-
downloadUrl,
|
|
52
|
-
(newVal) => {
|
|
53
|
-
if (newVal && valueList.value.length) {
|
|
54
|
-
valueList.value.forEach((file) => {
|
|
55
|
-
formatFileInfo(file, newVal);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
{ immediate: true }
|
|
60
|
-
);
|
|
61
|
-
return {
|
|
62
|
-
downloadUrl,
|
|
63
|
-
uploadUrl,
|
|
64
|
-
valueList
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function useIBizUpload(opts) {
|
|
68
|
-
const uploadState = ref("undo");
|
|
69
|
-
const fileList = ref([]);
|
|
70
|
-
const { downloadUrl, value, uploadUrl } = opts;
|
|
71
|
-
watch(
|
|
72
|
-
value,
|
|
73
|
-
(newVal) => {
|
|
74
|
-
if (newVal.length > 0) {
|
|
75
|
-
fileList.value = [];
|
|
76
|
-
newVal.forEach((item) => {
|
|
77
|
-
fileList.value.push(formatFileInfo(item, downloadUrl.value));
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
immediate: true,
|
|
83
|
-
deep: true
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
const beforeUpload = (fileData, files) => {
|
|
87
|
-
files.forEach((file) => {
|
|
88
|
-
fileList.value.push({
|
|
89
|
-
name: file.name,
|
|
90
|
-
status: file.status,
|
|
91
|
-
percentage: file.percentage,
|
|
92
|
-
id: file.uid,
|
|
93
|
-
url: ""
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
return true;
|
|
97
|
-
};
|
|
98
|
-
const onProgress = (files) => {
|
|
99
|
-
files.forEach((file) => {
|
|
100
|
-
fileList.value.find((item) => {
|
|
101
|
-
if (item.id === file.uid) {
|
|
102
|
-
item.percentage = file.percentage;
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
return false;
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
const onSuccess = (resultFiles, res) => {
|
|
110
|
-
resultFiles.forEach((file) => {
|
|
111
|
-
fileList.value.find((item) => {
|
|
112
|
-
if (item.id === file.uid) {
|
|
113
|
-
item.status = file.status;
|
|
114
|
-
item.id = res.data.fileid || res.data.id;
|
|
115
|
-
item.name = res.data.filename || res.data.name;
|
|
116
|
-
formatFileInfo(item, downloadUrl.value);
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
|
-
return false;
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
const onError = (resultFiles, error) => {
|
|
124
|
-
resultFiles.forEach((file) => {
|
|
125
|
-
fileList.value.find((item) => {
|
|
126
|
-
if (item.id === file.uid) {
|
|
127
|
-
item.status = file.status;
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
return false;
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
console.error(error);
|
|
134
|
-
};
|
|
135
|
-
const onFinish = (_resultFiles) => {
|
|
136
|
-
fileList.value = fileList.value.filter((file) => file.status === "finished");
|
|
137
|
-
uploadState.value = "done";
|
|
138
|
-
};
|
|
139
|
-
const selectFile = () => {
|
|
140
|
-
uploadFile({
|
|
141
|
-
multiple: opts.multiple,
|
|
142
|
-
accept: opts.accept,
|
|
143
|
-
uploadUrl: uploadUrl.value,
|
|
144
|
-
beforeUpload,
|
|
145
|
-
progress: onProgress,
|
|
146
|
-
success: onSuccess,
|
|
147
|
-
error: onError,
|
|
148
|
-
finish: onFinish
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
return {
|
|
152
|
-
selectFile,
|
|
153
|
-
fileList,
|
|
154
|
-
uploadState
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
function openImagePreview(file) {
|
|
158
|
-
return ibiz.overlay.modal(
|
|
159
|
-
"ImagePreview",
|
|
160
|
-
{ file },
|
|
161
|
-
{
|
|
162
|
-
width: "auto",
|
|
163
|
-
height: "auto",
|
|
164
|
-
placement: "center",
|
|
165
|
-
modalClass: "ibiz-image-preview-modal"
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export { formatFileInfo, openImagePreview, useIBizUpload, useIBizUploadInit };
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var core = require('@ibiz-template/core');
|
|
4
|
-
var vue = require('vue');
|
|
5
|
-
|
|
6
|
-
"use strict";
|
|
7
|
-
function formatFileInfo(file, downloadUrl) {
|
|
8
|
-
file.url = downloadUrl.replace("%fileId%", file.id);
|
|
9
|
-
if (!file.status) {
|
|
10
|
-
file.status = "finished";
|
|
11
|
-
}
|
|
12
|
-
if (!file.fileName) {
|
|
13
|
-
const index = file.name.lastIndexOf(".");
|
|
14
|
-
file.fileName = file.name.substring(0, index);
|
|
15
|
-
file.fileExt = file.name.substring(index);
|
|
16
|
-
file.isImage = core.isImage(file.name);
|
|
17
|
-
}
|
|
18
|
-
return file;
|
|
19
|
-
}
|
|
20
|
-
function useIBizUploadInit(props) {
|
|
21
|
-
const uploadUrl = vue.ref("");
|
|
22
|
-
const downloadUrl = vue.ref("");
|
|
23
|
-
const valueList = vue.ref([]);
|
|
24
|
-
vue.watch(
|
|
25
|
-
props.data,
|
|
26
|
-
(newVal) => {
|
|
27
|
-
if (newVal) {
|
|
28
|
-
const urls = ibiz.util.file.calcFileUpDownUrl(
|
|
29
|
-
props.controller.value.context,
|
|
30
|
-
props.controller.value.params,
|
|
31
|
-
newVal,
|
|
32
|
-
props.controller.value.editorParams
|
|
33
|
-
);
|
|
34
|
-
uploadUrl.value = urls.uploadUrl;
|
|
35
|
-
downloadUrl.value = urls.downloadUrl;
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{ immediate: true, deep: true }
|
|
39
|
-
);
|
|
40
|
-
vue.watch(
|
|
41
|
-
props.value,
|
|
42
|
-
(newVal) => {
|
|
43
|
-
valueList.value = !newVal ? [] : JSON.parse(newVal);
|
|
44
|
-
if (valueList.value.length && downloadUrl.value) {
|
|
45
|
-
valueList.value.forEach((file) => {
|
|
46
|
-
formatFileInfo(file, downloadUrl.value);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{ immediate: true }
|
|
51
|
-
);
|
|
52
|
-
vue.watch(
|
|
53
|
-
downloadUrl,
|
|
54
|
-
(newVal) => {
|
|
55
|
-
if (newVal && valueList.value.length) {
|
|
56
|
-
valueList.value.forEach((file) => {
|
|
57
|
-
formatFileInfo(file, newVal);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
{ immediate: true }
|
|
62
|
-
);
|
|
63
|
-
return {
|
|
64
|
-
downloadUrl,
|
|
65
|
-
uploadUrl,
|
|
66
|
-
valueList
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function useIBizUpload(opts) {
|
|
70
|
-
const uploadState = vue.ref("undo");
|
|
71
|
-
const fileList = vue.ref([]);
|
|
72
|
-
const { downloadUrl, value, uploadUrl } = opts;
|
|
73
|
-
vue.watch(
|
|
74
|
-
value,
|
|
75
|
-
(newVal) => {
|
|
76
|
-
if (newVal.length > 0) {
|
|
77
|
-
fileList.value = [];
|
|
78
|
-
newVal.forEach((item) => {
|
|
79
|
-
fileList.value.push(formatFileInfo(item, downloadUrl.value));
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
immediate: true,
|
|
85
|
-
deep: true
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
const beforeUpload = (fileData, files) => {
|
|
89
|
-
files.forEach((file) => {
|
|
90
|
-
fileList.value.push({
|
|
91
|
-
name: file.name,
|
|
92
|
-
status: file.status,
|
|
93
|
-
percentage: file.percentage,
|
|
94
|
-
id: file.uid,
|
|
95
|
-
url: ""
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
return true;
|
|
99
|
-
};
|
|
100
|
-
const onProgress = (files) => {
|
|
101
|
-
files.forEach((file) => {
|
|
102
|
-
fileList.value.find((item) => {
|
|
103
|
-
if (item.id === file.uid) {
|
|
104
|
-
item.percentage = file.percentage;
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
return false;
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
const onSuccess = (resultFiles, res) => {
|
|
112
|
-
resultFiles.forEach((file) => {
|
|
113
|
-
fileList.value.find((item) => {
|
|
114
|
-
if (item.id === file.uid) {
|
|
115
|
-
item.status = file.status;
|
|
116
|
-
item.id = res.data.fileid || res.data.id;
|
|
117
|
-
item.name = res.data.filename || res.data.name;
|
|
118
|
-
formatFileInfo(item, downloadUrl.value);
|
|
119
|
-
return true;
|
|
120
|
-
}
|
|
121
|
-
return false;
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
};
|
|
125
|
-
const onError = (resultFiles, error) => {
|
|
126
|
-
resultFiles.forEach((file) => {
|
|
127
|
-
fileList.value.find((item) => {
|
|
128
|
-
if (item.id === file.uid) {
|
|
129
|
-
item.status = file.status;
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
return false;
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
console.error(error);
|
|
136
|
-
};
|
|
137
|
-
const onFinish = (_resultFiles) => {
|
|
138
|
-
fileList.value = fileList.value.filter((file) => file.status === "finished");
|
|
139
|
-
uploadState.value = "done";
|
|
140
|
-
};
|
|
141
|
-
const selectFile = () => {
|
|
142
|
-
core.uploadFile({
|
|
143
|
-
multiple: opts.multiple,
|
|
144
|
-
accept: opts.accept,
|
|
145
|
-
uploadUrl: uploadUrl.value,
|
|
146
|
-
beforeUpload,
|
|
147
|
-
progress: onProgress,
|
|
148
|
-
success: onSuccess,
|
|
149
|
-
error: onError,
|
|
150
|
-
finish: onFinish
|
|
151
|
-
});
|
|
152
|
-
};
|
|
153
|
-
return {
|
|
154
|
-
selectFile,
|
|
155
|
-
fileList,
|
|
156
|
-
uploadState
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
function openImagePreview(file) {
|
|
160
|
-
return ibiz.overlay.modal(
|
|
161
|
-
"ImagePreview",
|
|
162
|
-
{ file },
|
|
163
|
-
{
|
|
164
|
-
width: "auto",
|
|
165
|
-
height: "auto",
|
|
166
|
-
placement: "center",
|
|
167
|
-
modalClass: "ibiz-image-preview-modal"
|
|
168
|
-
}
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
exports.formatFileInfo = formatFileInfo;
|
|
173
|
-
exports.openImagePreview = openImagePreview;
|
|
174
|
-
exports.useIBizUpload = useIBizUpload;
|
|
175
|
-
exports.useIBizUploadInit = useIBizUploadInit;
|