@robot-admin/naive-ui-components 0.11.7 → 0.11.8
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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/README_EN.md +1 -1
- package/dist/C_Map.css +3 -3
- package/dist/C_Map2.cjs +1 -1
- package/dist/C_Map2.js +1 -1
- package/dist/C_VtableGantt.css +19 -19
- package/dist/C_VtableGantt2.cjs +1 -1
- package/dist/C_VtableGantt2.js +1 -1
- package/dist/constants2.d.cts +1 -1
- package/dist/constants2.d.ts +1 -1
- package/dist/constants3.d.cts +2 -2
- package/dist/constants3.d.ts +2 -2
- package/dist/constants4.d.cts +4 -4
- package/dist/constants4.d.ts +4 -4
- package/dist/constants5.d.cts +4 -4
- package/dist/constants5.d.ts +4 -4
- package/dist/index.vue.d.cts +1 -1
- package/dist/index.vue.d.ts +1 -1
- package/dist/index10.vue.d.cts +2 -2
- package/dist/index10.vue.d.ts +3 -3
- package/dist/index11.vue.d.cts +3 -3
- package/dist/index11.vue.d.ts +2 -2
- package/dist/index12.vue.d.cts +2 -2
- package/dist/index12.vue.d.ts +1 -1
- package/dist/index13.vue.d.cts +1 -1
- package/dist/index13.vue.d.ts +1 -1
- package/dist/index14.vue.d.cts +1 -1
- package/dist/index14.vue.d.ts +4 -4
- package/dist/index15.vue.d.cts +4 -4
- package/dist/index16.vue.d.ts +1 -1
- package/dist/index17.vue.d.cts +1 -1
- package/dist/index17.vue.d.ts +2 -2
- package/dist/index18.vue.d.cts +2 -2
- package/dist/index18.vue.d.ts +3 -3
- package/dist/index19.vue.d.cts +2 -2
- package/dist/index19.vue.d.ts +2 -2
- package/dist/index2.vue.d.cts +4 -4
- package/dist/index2.vue.d.ts +4 -4
- package/dist/index21.vue.d.cts +1 -1
- package/dist/index21.vue.d.ts +1 -1
- package/dist/index22.vue.d.cts +2 -2
- package/dist/index22.vue.d.ts +2 -2
- package/dist/index24.vue.d.cts +4 -4
- package/dist/index24.vue.d.ts +4 -4
- package/dist/index25.vue.d.cts +1 -1
- package/dist/index25.vue.d.ts +1 -1
- package/dist/index26.vue.d.cts +3 -3
- package/dist/index26.vue.d.ts +3 -3
- package/dist/index27.vue.d.cts +2 -2
- package/dist/index27.vue.d.ts +2 -2
- package/dist/index3.vue.d.cts +2 -2
- package/dist/index3.vue.d.ts +2 -2
- package/dist/index4.vue.d.cts +3 -3
- package/dist/index4.vue.d.ts +3 -3
- package/dist/index5.vue.d.cts +3 -3
- package/dist/index9.vue.d.ts +2 -2
- package/dist/mapUtils.d.cts +3 -3
- package/dist/mapUtils.d.ts +3 -3
- package/dist/style.css +22 -22
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +5 -5
- package/dist/useCollapsePanel.d.ts +5 -5
- package/dist/useCropperCore.d.cts +9 -9
- package/dist/useCropperCore.d.ts +9 -9
- package/dist/useDraggableLayout.d.cts +2 -2
- package/dist/useDraggableLayout.d.ts +2 -2
- package/dist/useDynamicFormState.d.cts +2 -2
- package/dist/useDynamicFormState.d.ts +2 -2
- package/dist/useEdgeInteraction.d.cts +3 -3
- package/dist/useEdgeInteraction.d.ts +3 -3
- package/dist/useInfiniteScroll.d.cts +2 -2
- package/dist/useInfiniteScroll.d.ts +2 -2
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useSearchState.d.cts +5 -5
- package/dist/useSearchState.d.ts +5 -5
- package/dist/useSignatureHistory.d.cts +4 -4
- package/dist/useSignatureHistory.d.ts +4 -4
- package/dist/useSplitResize.d.cts +10 -10
- package/dist/useSplitResize.d.ts +10 -10
- package/dist/useTableQuery.d.cts +1 -1
- package/dist/useTableQuery.d.ts +1 -1
- package/dist/useTimeSelection.d.cts +3 -3
- package/dist/useTimeSelection.d.ts +3 -3
- package/dist/useTreeOperations.d.cts +6 -6
- package/dist/useTreeOperations.d.ts +6 -6
- package/dist/useWorkflowValidation.d.cts +5 -5
- package/dist/useWorkflowValidation.d.ts +5 -5
- package/dist/verification.d.cts +3 -3
- package/dist/verification.d.ts +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @robot-admin/naive-ui-components
|
|
2
2
|
|
|
3
|
+
## 0.11.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 修复 `C_Map` 在 Vite 深层按需加载、未整体预构建组件库时的 Leaflet CommonJS/ESM 互操作错误;组件同时兼容命名空间和 `default` 导出,并在 API 形态异常时返回明确错误。同步关闭 `C_VtableGantt` 在组件快速卸载或配置连续变化时的异步初始化竞态,避免向已经失效的容器创建实例。
|
|
8
|
+
|
|
3
9
|
## 0.11.7
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -248,7 +248,7 @@ import '@robot-admin/naive-ui-components/C_Table/base.css'
|
|
|
248
248
|
</template>
|
|
249
249
|
```
|
|
250
250
|
|
|
251
|
-
组件实例提供 `getMap()`、`refresh()` 和 `fitToMarkers()
|
|
251
|
+
组件实例提供 `getMap()`、`refresh()` 和 `fitToMarkers()`,适合标签页显示、容器尺寸变化和业务图层扩展。OpenStreetMap 模式会在组件内部兼容 Leaflet 的 ESM 命名空间和 CommonJS `default` 形态,宿主无需为正确性配置整包预构建。使用 `map-type="amap"` 时必须提供 `amap-key`;2021-12-02 之后申请的 Key 还必须按[高德官方安全密钥说明](https://lbs.amap.com/api/javascript-api-v2/guide/abc/jscode)配置 `:amap-security-config="{ serviceHost: '/_AMapService' }"`(生产推荐,由服务端代理保管安全密钥),或仅在开发环境传 `{ securityJsCode: '...' }`。安全配置会在 SDK 脚本加载前写入,并拒绝同页混用不同 Key。宿主应用还需在 CSP 的 `script-src` 中允许 `https://webapi.amap.com`,同时在高德控制台配置域名白名单和配额限制。
|
|
252
252
|
|
|
253
253
|
`C_Date`、`C_Time`、`C_Menu`、`C_FormSearch` 均支持标准 `v-model`。组件可直接放在没有 `NMessageProvider` / `NDialogProvider` 的页面;如需统一提示、确认和文案,可在安装时传入 `feedback`、`locale`、`form` 与 `table.defaults`。
|
|
254
254
|
|
package/README_EN.md
CHANGED
|
@@ -189,7 +189,7 @@ const { bindings } = useTableQuery<UserRow, { keyword: string }>({
|
|
|
189
189
|
</template>
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
The exposed instance provides `getMap()`, `refresh()`, and `fitToMarkers()` for tab visibility changes, container resizes, and custom business layers. `map-type="amap"` requires `amap-key`; keys created after 2021-12-02 also require `:amap-security-config="{ serviceHost: '/_AMapService' }"` (recommended in production so the server proxy retains the security secret), or `{ securityJsCode: '...' }` for development only, as described by the [official AMap security guidance](https://lbs.amap.com/api/javascript-api-v2/guide/abc/jscode). The config is installed before the SDK script and conflicting keys on one page are rejected. The host CSP must also allow `https://webapi.amap.com` in `script-src`, with domain allowlists and quotas enforced in the AMap console.
|
|
192
|
+
The exposed instance provides `getMap()`, `refresh()`, and `fitToMarkers()` for tab visibility changes, container resizes, and custom business layers. OpenStreetMap mode normalizes both the Leaflet ESM namespace and CommonJS `default` shape internally, so hosts do not need whole-package prebundling for correctness. `map-type="amap"` requires `amap-key`; keys created after 2021-12-02 also require `:amap-security-config="{ serviceHost: '/_AMapService' }"` (recommended in production so the server proxy retains the security secret), or `{ securityJsCode: '...' }` for development only, as described by the [official AMap security guidance](https://lbs.amap.com/api/javascript-api-v2/guide/abc/jscode). The config is installed before the SDK script and conflicting keys on one page are rejected. The host CSP must also allow `https://webapi.amap.com` in `script-src`, with domain allowlists and quotas enforced in the AMap console.
|
|
193
193
|
|
|
194
194
|
`C_Date`, `C_Time`, `C_Menu`, and `C_FormSearch` support standard `v-model`. Message/dialog providers are optional; application-wide feedback, locale, form defaults, and `table.defaults` can be supplied through plugin options.
|
|
195
195
|
|
package/dist/C_Map.css
CHANGED
|
@@ -660,7 +660,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
662
|
|
|
663
|
-
/* unplugin-vue-components disabled */.c-map[data-v-
|
|
663
|
+
/* unplugin-vue-components disabled */.c-map[data-v-13a71151] {
|
|
664
664
|
position: relative;
|
|
665
665
|
width: 100%;
|
|
666
666
|
min-height: 300px;
|
|
@@ -668,13 +668,13 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
|
668
668
|
border-radius: var(--c-radius-sm, 4px);
|
|
669
669
|
overflow: hidden;
|
|
670
670
|
}
|
|
671
|
-
.c-map .map-container[data-v-
|
|
671
|
+
.c-map .map-container[data-v-13a71151] {
|
|
672
672
|
width: 100%;
|
|
673
673
|
height: 100%;
|
|
674
674
|
border-radius: inherit;
|
|
675
675
|
overflow: hidden;
|
|
676
676
|
}
|
|
677
|
-
.c-map .map-loading[data-v-
|
|
677
|
+
.c-map .map-loading[data-v-13a71151] {
|
|
678
678
|
position: absolute;
|
|
679
679
|
top: 0;
|
|
680
680
|
left: 0;
|
package/dist/C_Map2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./export-helper.cjs`);let t=require(`vue`),n=require(`naive-ui`);const r=[{label:`OpenStreetMap`,value:`osm`},{label:`高德地图`,value:`amap`}],i={height:`400px`,center:[39.9042,116.4074],zoom:10,mapType:`osm`},a={url:`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,attribution:`© OpenStreetMap contributors`,maxZoom:19,minZoom:1,tileSize:256,detectRetina:!0},o={apiUrl:`https://webapi.amap.com/maps?v=2.0&key=`,note:`高德地图需要API Key,如需使用请申请:https://lbs.amap.com/api/javascript-api/guide/create/`},s=15e3;let c=null,l=null;function u(e){if(!e)return;let t=e.serviceHost?.trim(),n=e.securityJsCode?.trim();if(t&&n)throw Error(`高德地图安全配置只能选择 serviceHost 或 securityJsCode`);if(t){if(!t.endsWith(`/_AMapService`))throw Error(`高德地图 serviceHost 必须以 /_AMapService 结尾`);return{serviceHost:t}}if(n)return{securityJsCode:n};throw Error(`高德地图安全配置不能为空`)}const d=e=>{if(e)return e;if(typeof window>`u`||typeof document>`u`)throw Error(`高德地图 API 只能在浏览器环境加载`);return{clearTimeout:window.clearTimeout.bind(window),document,host:window,setTimeout:window.setTimeout.bind(window)}},f=(e,t,n)=>{let r=e.trim();if(!r)throw Error(`高德地图 API Key 不能为空`);let i=u(t);return{identity:JSON.stringify([r,i]),normalizedKey:r,normalizedSecurityConfig:i,platform:d(n)}};function p(e,t=s,n,r){let i;try{i=f(e,n,r)}catch(e){return Promise.reject(e)}let{identity:a,normalizedKey:u,normalizedSecurityConfig:d}=i,{clearTimeout:p,document:m,host:h,setTimeout:g}=i.platform;return l&&l!==a?Promise.reject(Error(`同一页面不能使用不同的高德地图 Key 或安全配置`)):h.AMap?Promise.resolve(h.AMap):c||(l=a,d&&(h._AMapSecurityConfig={...d}),c=new Promise((e,n)=>{let r=m.querySelector(`script[data-c-map-amap="true"]`),i=r||m.createElement(`script`),a=!1,d=Number.isFinite(t)&&t>0?t:s,f=()=>{p(b),i.removeEventListener(`load`,v),i.removeEventListener(`error`,y)},_=e=>{a||(a=!0,f(),i.remove(),c=null,l=null,n(e))},v=()=>{if(!a){if(!h.AMap){_(Error(`高德地图 API 加载完成但未找到全局对象`));return}a=!0,f(),e(h.AMap)}},y=()=>_(Error(`高德地图 API 加载失败`)),b=g(()=>_(Error(`高德地图 API 加载超时(${d}ms)`)),d);i.addEventListener(`load`,v,{once:!0}),i.addEventListener(`error`,y,{once:!0}),!r&&(i.async=!0,i.dataset.cMapAmap=`true`,i.src=`${o.apiUrl}${encodeURIComponent(u)}`,m.head.appendChild(i))}),c)}function m(e){if(!e||e.length!==2)return!1;let[t,n]=e;return Number.isFinite(t)&&Number.isFinite(n)&&t>=-90&&t<=90&&n>=-180&&n<=180}function
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./export-helper.cjs`);let t=require(`vue`),n=require(`naive-ui`);const r=[{label:`OpenStreetMap`,value:`osm`},{label:`高德地图`,value:`amap`}],i={height:`400px`,center:[39.9042,116.4074],zoom:10,mapType:`osm`},a={url:`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,attribution:`© OpenStreetMap contributors`,maxZoom:19,minZoom:1,tileSize:256,detectRetina:!0},o={apiUrl:`https://webapi.amap.com/maps?v=2.0&key=`,note:`高德地图需要API Key,如需使用请申请:https://lbs.amap.com/api/javascript-api/guide/create/`},s=15e3;let c=null,l=null;function u(e){if(!e)return;let t=e.serviceHost?.trim(),n=e.securityJsCode?.trim();if(t&&n)throw Error(`高德地图安全配置只能选择 serviceHost 或 securityJsCode`);if(t){if(!t.endsWith(`/_AMapService`))throw Error(`高德地图 serviceHost 必须以 /_AMapService 结尾`);return{serviceHost:t}}if(n)return{securityJsCode:n};throw Error(`高德地图安全配置不能为空`)}const d=e=>{if(e)return e;if(typeof window>`u`||typeof document>`u`)throw Error(`高德地图 API 只能在浏览器环境加载`);return{clearTimeout:window.clearTimeout.bind(window),document,host:window,setTimeout:window.setTimeout.bind(window)}},f=(e,t,n)=>{let r=e.trim();if(!r)throw Error(`高德地图 API Key 不能为空`);let i=u(t);return{identity:JSON.stringify([r,i]),normalizedKey:r,normalizedSecurityConfig:i,platform:d(n)}};function p(e,t=s,n,r){let i;try{i=f(e,n,r)}catch(e){return Promise.reject(e)}let{identity:a,normalizedKey:u,normalizedSecurityConfig:d}=i,{clearTimeout:p,document:m,host:h,setTimeout:g}=i.platform;return l&&l!==a?Promise.reject(Error(`同一页面不能使用不同的高德地图 Key 或安全配置`)):h.AMap?Promise.resolve(h.AMap):c||(l=a,d&&(h._AMapSecurityConfig={...d}),c=new Promise((e,n)=>{let r=m.querySelector(`script[data-c-map-amap="true"]`),i=r||m.createElement(`script`),a=!1,d=Number.isFinite(t)&&t>0?t:s,f=()=>{p(b),i.removeEventListener(`load`,v),i.removeEventListener(`error`,y)},_=e=>{a||(a=!0,f(),i.remove(),c=null,l=null,n(e))},v=()=>{if(!a){if(!h.AMap){_(Error(`高德地图 API 加载完成但未找到全局对象`));return}a=!0,f(),e(h.AMap)}},y=()=>_(Error(`高德地图 API 加载失败`)),b=g(()=>_(Error(`高德地图 API 加载超时(${d}ms)`)),d);i.addEventListener(`load`,v,{once:!0}),i.addEventListener(`error`,y,{once:!0}),!r&&(i.async=!0,i.dataset.cMapAmap=`true`,i.src=`${o.apiUrl}${encodeURIComponent(u)}`,m.head.appendChild(i))}),c)}const m=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.map==`function`&&typeof t.marker==`function`&&typeof t.tileLayer==`function`},h=e=>{if(m(e))return e;let t=e&&typeof e==`object`?e.default:void 0;if(m(t))return t;throw Error(`Leaflet 模块加载失败:未找到 map、marker 和 tileLayer API`)},g=async()=>h(await import(`leaflet`));function _(e){if(!e||e.length!==2)return!1;let[t,n]=e;return Number.isFinite(t)&&Number.isFinite(n)&&t>=-90&&t<=90&&n>=-180&&n<=180}function v(e){return[e[1],e[0]]}function y(e){return e.filter(e=>_([e.lat,e.lng]))}function b(e,t=a.minZoom,n=a.maxZoom){return Number.isFinite(e)?Math.min(Math.max(e,t),n):i.zoom}function x(e={}){let{url:t,...n}={...a,...e};return{url:t,options:n}}const S=[`aria-label`,`aria-busy`],C={key:0,class:`map-loading`,role:`status`,"aria-live":`polite`,"aria-label":`地图加载中`},w=(0,t.defineComponent)({name:`C_Map`,__name:`index`,props:{ariaLabel:{default:`地图`},height:{default:i.height},center:{default:()=>[...i.center]},zoom:{default:i.zoom},markers:{default:()=>[]},mapType:{default:i.mapType},amapKey:{default:``},amapSecurityConfig:{},amapLoadTimeout:{default:15e3},amapOptions:{default:()=>({})},tileConfig:{default:()=>({})},zoomControl:{type:Boolean,default:!0},preferCanvas:{type:Boolean,default:!0},fitMarkersOnInit:{type:Boolean,default:!1}},emits:[`ready`,`markerClick`,`error`],setup(e,{expose:r,emit:i}){let a=e,o=i,s=(0,t.ref)(),c=(0,t.ref)(!0),l=null,u=null,d=[],f=null,m=null,h=[],w=[],T=0,E=!1,D=e=>e instanceof Error?e:Error(String(e)),O=()=>{d.forEach(e=>e.remove()),d=[]},k=()=>{w.forEach(e=>e.close?.()),w=[],h.forEach(e=>e.setMap?.(null)),h=[]},A=()=>{O(),k(),u?.remove(),m?.destroy(),u=null,m=null,s.value?.replaceChildren()},j=()=>{let e=++T;return A(),c.value=!0,e},M=e=>!E&&e===T,N=()=>{if(_(a.center))return a.center;throw Error(`地图中心坐标无效,应使用 [纬度, 经度] 且处于合法范围`)},P=(e,t)=>{M(e)&&(A(),c.value=!1,o(`error`,D(t)))},F=()=>{let e=l,t=u;!t||!e||a.mapType!==`osm`||(O(),y(a.markers).forEach(n=>{let r=e.marker([n.lat,n.lng]);if(n.popup){let e=document.createElement(`span`);e.textContent=n.popup,r.bindPopup(e)}r.on(`click`,e=>{o(`markerClick`,n,e)}),r.addTo(t),d.push(r)}))},I=()=>{let e=f,t=m;!t||!e||a.mapType!==`amap`||(k(),y(a.markers).forEach(n=>{let r=new e.Marker({position:v([n.lat,n.lng]),title:n.title||n.popup||``});if(n.popup){let i=document.createElement(`span`);i.textContent=n.popup;let a=new e.InfoWindow({content:i,offset:new e.Pixel(0,-30)});w.push(a),r.on(`click`,e=>{a.open(t,r.getPosition()),o(`markerClick`,n,e)})}else r.on(`click`,e=>o(`markerClick`,n,e));r.setMap(t),h.push(r)}))},L=()=>u||m,R=()=>{u?.invalidateSize({reset:!0,pan:!1}),m?.resize?.()},z=(e={})=>{let t=y(a.markers);if(t.length===0)return!1;if(u){let n=t.map(e=>[e.lat,e.lng]);return u.fitBounds(n,{maxZoom:e.maxZoom,padding:e.padding}),!0}if(m&&h.length>0){let[t=0,n=0]=e.padding||[];return m.setFitView?.(h,!1,[n,t,n,t],e.maxZoom),!0}return!1},B=async()=>{if(!s.value)return;let e=j();try{let n=await g();if(!M(e)||!s.value)return;l=n;let{url:r,options:i}=x(a.tileConfig),d=b(a.zoom,i.minZoom,i.maxZoom);if(u=n.map(s.value,{center:N(),zoom:d,zoomControl:a.zoomControl,preferCanvas:a.preferCanvas}),n.tileLayer(r,i).addTo(u),F(),a.fitMarkersOnInit&&z(),await(0,t.nextTick)(),requestAnimationFrame(()=>{M(e)&&R()}),!M(e)||!u)return;c.value=!1,o(`ready`,u)}catch(t){P(e,t)}},V=async()=>{if(!s.value)return;let e=j();try{let t=await p(a.amapKey,a.amapLoadTimeout,a.amapSecurityConfig);if(!M(e)||!s.value)return;f=t,m=new t.Map(s.value,{...a.amapOptions,zoom:b(a.zoom,1,20),center:v(N())}),I(),a.fitMarkersOnInit&&z(),c.value=!1,o(`ready`,m)}catch(t){P(e,t)}},H=async()=>{a.mapType===`amap`?await V():await B()};return(0,t.watch)(()=>a.markers,()=>{a.mapType===`osm`?F():I()},{deep:!0}),(0,t.watch)([()=>a.mapType,()=>a.amapKey,()=>a.amapSecurityConfig,()=>a.amapLoadTimeout,()=>a.amapOptions,()=>a.tileConfig,()=>a.zoomControl,()=>a.preferCanvas],()=>void H(),{deep:!0}),(0,t.watch)([()=>a.center,()=>a.zoom],()=>{if(!_(a.center)){o(`error`,Error(`地图中心坐标无效,应使用 [纬度, 经度]`));return}u?.setView(a.center,b(a.zoom)),m?.setCenter(v(a.center)),m?.setZoom(b(a.zoom,1,20))},{deep:!0}),(0,t.onMounted)(async()=>{await(0,t.nextTick)(),await H()}),(0,t.onUnmounted)(()=>{E=!0,T+=1,A()}),r({fitToMarkers:z,getMap:L,refresh:R}),(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`c-map`,role:`region`,"aria-label":e.ariaLabel,"aria-busy":c.value},[(0,t.createElementVNode)(`div`,{ref_key:`mapContainer`,ref:s,class:`map-container`,style:(0,t.normalizeStyle)({height:e.height})},null,4),c.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,C,[(0,t.createVNode)((0,t.unref)(n.NSpin),{size:`large`})])):(0,t.createCommentVNode)(`v-if`,!0)],8,S))}});var T=e.t(w,[[`__scopeId`,`data-v-13a71151`]]);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return T}});
|
package/dist/C_Map2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./export-helper.js";import{createCommentVNode as t,createElementBlock as n,createElementVNode as r,createVNode as i,defineComponent as a,nextTick as o,normalizeStyle as s,onMounted as c,onUnmounted as l,openBlock as u,ref as d,unref as f,watch as p}from"vue";import{NSpin as m}from"naive-ui";const h=[{label:`OpenStreetMap`,value:`osm`},{label:`高德地图`,value:`amap`}],g={height:`400px`,center:[39.9042,116.4074],zoom:10,mapType:`osm`},_={url:`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,attribution:`© OpenStreetMap contributors`,maxZoom:19,minZoom:1,tileSize:256,detectRetina:!0},v={apiUrl:`https://webapi.amap.com/maps?v=2.0&key=`,note:`高德地图需要API Key,如需使用请申请:https://lbs.amap.com/api/javascript-api/guide/create/`},y=15e3;let b=null,x=null;function S(e){if(!e)return;let t=e.serviceHost?.trim(),n=e.securityJsCode?.trim();if(t&&n)throw Error(`高德地图安全配置只能选择 serviceHost 或 securityJsCode`);if(t){if(!t.endsWith(`/_AMapService`))throw Error(`高德地图 serviceHost 必须以 /_AMapService 结尾`);return{serviceHost:t}}if(n)return{securityJsCode:n};throw Error(`高德地图安全配置不能为空`)}const C=e=>{if(e)return e;if(typeof window>`u`||typeof document>`u`)throw Error(`高德地图 API 只能在浏览器环境加载`);return{clearTimeout:window.clearTimeout.bind(window),document,host:window,setTimeout:window.setTimeout.bind(window)}},w=(e,t,n)=>{let r=e.trim();if(!r)throw Error(`高德地图 API Key 不能为空`);let i=S(t);return{identity:JSON.stringify([r,i]),normalizedKey:r,normalizedSecurityConfig:i,platform:C(n)}};function T(e,t=y,n,r){let i;try{i=w(e,n,r)}catch(e){return Promise.reject(e)}let{identity:a,normalizedKey:o,normalizedSecurityConfig:s}=i,{clearTimeout:c,document:l,host:u,setTimeout:d}=i.platform;return x&&x!==a?Promise.reject(Error(`同一页面不能使用不同的高德地图 Key 或安全配置`)):u.AMap?Promise.resolve(u.AMap):b||(x=a,s&&(u._AMapSecurityConfig={...s}),b=new Promise((e,n)=>{let r=l.querySelector(`script[data-c-map-amap="true"]`),i=r||l.createElement(`script`),a=!1,s=Number.isFinite(t)&&t>0?t:y,f=()=>{c(g),i.removeEventListener(`load`,m),i.removeEventListener(`error`,h)},p=e=>{a||(a=!0,f(),i.remove(),b=null,x=null,n(e))},m=()=>{if(!a){if(!u.AMap){p(Error(`高德地图 API 加载完成但未找到全局对象`));return}a=!0,f(),e(u.AMap)}},h=()=>p(Error(`高德地图 API 加载失败`)),g=d(()=>p(Error(`高德地图 API 加载超时(${s}ms)`)),s);i.addEventListener(`load`,m,{once:!0}),i.addEventListener(`error`,h,{once:!0}),!r&&(i.async=!0,i.dataset.cMapAmap=`true`,i.src=`${v.apiUrl}${encodeURIComponent(o)}`,l.head.appendChild(i))}),b)}function E(e){if(!e||e.length!==2)return!1;let[t,n]=e;return Number.isFinite(t)&&Number.isFinite(n)&&t>=-90&&t<=90&&n>=-180&&n<=180}function
|
|
1
|
+
import{t as e}from"./export-helper.js";import{createCommentVNode as t,createElementBlock as n,createElementVNode as r,createVNode as i,defineComponent as a,nextTick as o,normalizeStyle as s,onMounted as c,onUnmounted as l,openBlock as u,ref as d,unref as f,watch as p}from"vue";import{NSpin as m}from"naive-ui";const h=[{label:`OpenStreetMap`,value:`osm`},{label:`高德地图`,value:`amap`}],g={height:`400px`,center:[39.9042,116.4074],zoom:10,mapType:`osm`},_={url:`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,attribution:`© OpenStreetMap contributors`,maxZoom:19,minZoom:1,tileSize:256,detectRetina:!0},v={apiUrl:`https://webapi.amap.com/maps?v=2.0&key=`,note:`高德地图需要API Key,如需使用请申请:https://lbs.amap.com/api/javascript-api/guide/create/`},y=15e3;let b=null,x=null;function S(e){if(!e)return;let t=e.serviceHost?.trim(),n=e.securityJsCode?.trim();if(t&&n)throw Error(`高德地图安全配置只能选择 serviceHost 或 securityJsCode`);if(t){if(!t.endsWith(`/_AMapService`))throw Error(`高德地图 serviceHost 必须以 /_AMapService 结尾`);return{serviceHost:t}}if(n)return{securityJsCode:n};throw Error(`高德地图安全配置不能为空`)}const C=e=>{if(e)return e;if(typeof window>`u`||typeof document>`u`)throw Error(`高德地图 API 只能在浏览器环境加载`);return{clearTimeout:window.clearTimeout.bind(window),document,host:window,setTimeout:window.setTimeout.bind(window)}},w=(e,t,n)=>{let r=e.trim();if(!r)throw Error(`高德地图 API Key 不能为空`);let i=S(t);return{identity:JSON.stringify([r,i]),normalizedKey:r,normalizedSecurityConfig:i,platform:C(n)}};function T(e,t=y,n,r){let i;try{i=w(e,n,r)}catch(e){return Promise.reject(e)}let{identity:a,normalizedKey:o,normalizedSecurityConfig:s}=i,{clearTimeout:c,document:l,host:u,setTimeout:d}=i.platform;return x&&x!==a?Promise.reject(Error(`同一页面不能使用不同的高德地图 Key 或安全配置`)):u.AMap?Promise.resolve(u.AMap):b||(x=a,s&&(u._AMapSecurityConfig={...s}),b=new Promise((e,n)=>{let r=l.querySelector(`script[data-c-map-amap="true"]`),i=r||l.createElement(`script`),a=!1,s=Number.isFinite(t)&&t>0?t:y,f=()=>{c(g),i.removeEventListener(`load`,m),i.removeEventListener(`error`,h)},p=e=>{a||(a=!0,f(),i.remove(),b=null,x=null,n(e))},m=()=>{if(!a){if(!u.AMap){p(Error(`高德地图 API 加载完成但未找到全局对象`));return}a=!0,f(),e(u.AMap)}},h=()=>p(Error(`高德地图 API 加载失败`)),g=d(()=>p(Error(`高德地图 API 加载超时(${s}ms)`)),s);i.addEventListener(`load`,m,{once:!0}),i.addEventListener(`error`,h,{once:!0}),!r&&(i.async=!0,i.dataset.cMapAmap=`true`,i.src=`${v.apiUrl}${encodeURIComponent(o)}`,l.head.appendChild(i))}),b)}const E=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.map==`function`&&typeof t.marker==`function`&&typeof t.tileLayer==`function`},D=e=>{if(E(e))return e;let t=e&&typeof e==`object`?e.default:void 0;if(E(t))return t;throw Error(`Leaflet 模块加载失败:未找到 map、marker 和 tileLayer API`)},O=async()=>D(await import(`leaflet`));function k(e){if(!e||e.length!==2)return!1;let[t,n]=e;return Number.isFinite(t)&&Number.isFinite(n)&&t>=-90&&t<=90&&n>=-180&&n<=180}function A(e){return[e[1],e[0]]}function j(e){return e.filter(e=>k([e.lat,e.lng]))}function M(e,t=_.minZoom,n=_.maxZoom){return Number.isFinite(e)?Math.min(Math.max(e,t),n):g.zoom}function N(e={}){let{url:t,...n}={..._,...e};return{url:t,options:n}}const P=[`aria-label`,`aria-busy`],F={key:0,class:`map-loading`,role:`status`,"aria-live":`polite`,"aria-label":`地图加载中`};var I=e(a({name:`C_Map`,__name:`index`,props:{ariaLabel:{default:`地图`},height:{default:g.height},center:{default:()=>[...g.center]},zoom:{default:g.zoom},markers:{default:()=>[]},mapType:{default:g.mapType},amapKey:{default:``},amapSecurityConfig:{},amapLoadTimeout:{default:15e3},amapOptions:{default:()=>({})},tileConfig:{default:()=>({})},zoomControl:{type:Boolean,default:!0},preferCanvas:{type:Boolean,default:!0},fitMarkersOnInit:{type:Boolean,default:!1}},emits:[`ready`,`markerClick`,`error`],setup(e,{expose:a,emit:h}){let g=e,_=h,v=d(),y=d(!0),b=null,x=null,S=[],C=null,w=null,E=[],D=[],I=0,L=!1,R=e=>e instanceof Error?e:Error(String(e)),z=()=>{S.forEach(e=>e.remove()),S=[]},B=()=>{D.forEach(e=>e.close?.()),D=[],E.forEach(e=>e.setMap?.(null)),E=[]},V=()=>{z(),B(),x?.remove(),w?.destroy(),x=null,w=null,v.value?.replaceChildren()},H=()=>{let e=++I;return V(),y.value=!0,e},U=e=>!L&&e===I,W=()=>{if(k(g.center))return g.center;throw Error(`地图中心坐标无效,应使用 [纬度, 经度] 且处于合法范围`)},G=(e,t)=>{U(e)&&(V(),y.value=!1,_(`error`,R(t)))},K=()=>{let e=b,t=x;!t||!e||g.mapType!==`osm`||(z(),j(g.markers).forEach(n=>{let r=e.marker([n.lat,n.lng]);if(n.popup){let e=document.createElement(`span`);e.textContent=n.popup,r.bindPopup(e)}r.on(`click`,e=>{_(`markerClick`,n,e)}),r.addTo(t),S.push(r)}))},q=()=>{let e=C,t=w;!t||!e||g.mapType!==`amap`||(B(),j(g.markers).forEach(n=>{let r=new e.Marker({position:A([n.lat,n.lng]),title:n.title||n.popup||``});if(n.popup){let i=document.createElement(`span`);i.textContent=n.popup;let a=new e.InfoWindow({content:i,offset:new e.Pixel(0,-30)});D.push(a),r.on(`click`,e=>{a.open(t,r.getPosition()),_(`markerClick`,n,e)})}else r.on(`click`,e=>_(`markerClick`,n,e));r.setMap(t),E.push(r)}))},J=()=>x||w,Y=()=>{x?.invalidateSize({reset:!0,pan:!1}),w?.resize?.()},X=(e={})=>{let t=j(g.markers);if(t.length===0)return!1;if(x){let n=t.map(e=>[e.lat,e.lng]);return x.fitBounds(n,{maxZoom:e.maxZoom,padding:e.padding}),!0}if(w&&E.length>0){let[t=0,n=0]=e.padding||[];return w.setFitView?.(E,!1,[n,t,n,t],e.maxZoom),!0}return!1},Z=async()=>{if(!v.value)return;let e=H();try{let t=await O();if(!U(e)||!v.value)return;b=t;let{url:n,options:r}=N(g.tileConfig),i=M(g.zoom,r.minZoom,r.maxZoom);if(x=t.map(v.value,{center:W(),zoom:i,zoomControl:g.zoomControl,preferCanvas:g.preferCanvas}),t.tileLayer(n,r).addTo(x),K(),g.fitMarkersOnInit&&X(),await o(),requestAnimationFrame(()=>{U(e)&&Y()}),!U(e)||!x)return;y.value=!1,_(`ready`,x)}catch(t){G(e,t)}},Q=async()=>{if(!v.value)return;let e=H();try{let t=await T(g.amapKey,g.amapLoadTimeout,g.amapSecurityConfig);if(!U(e)||!v.value)return;C=t,w=new t.Map(v.value,{...g.amapOptions,zoom:M(g.zoom,1,20),center:A(W())}),q(),g.fitMarkersOnInit&&X(),y.value=!1,_(`ready`,w)}catch(t){G(e,t)}},$=async()=>{g.mapType===`amap`?await Q():await Z()};return p(()=>g.markers,()=>{g.mapType===`osm`?K():q()},{deep:!0}),p([()=>g.mapType,()=>g.amapKey,()=>g.amapSecurityConfig,()=>g.amapLoadTimeout,()=>g.amapOptions,()=>g.tileConfig,()=>g.zoomControl,()=>g.preferCanvas],()=>void $(),{deep:!0}),p([()=>g.center,()=>g.zoom],()=>{if(!k(g.center)){_(`error`,Error(`地图中心坐标无效,应使用 [纬度, 经度]`));return}x?.setView(g.center,M(g.zoom)),w?.setCenter(A(g.center)),w?.setZoom(M(g.zoom,1,20))},{deep:!0}),c(async()=>{await o(),await $()}),l(()=>{L=!0,I+=1,V()}),a({fitToMarkers:X,getMap:J,refresh:Y}),(a,o)=>(u(),n(`div`,{class:`c-map`,role:`region`,"aria-label":e.ariaLabel,"aria-busy":y.value},[r(`div`,{ref_key:`mapContainer`,ref:v,class:`map-container`,style:s({height:e.height})},null,4),y.value?(u(),n(`div`,F,[i(f(m),{size:`large`})])):t(`v-if`,!0)],8,P))}}),[[`__scopeId`,`data-v-13a71151`]]);export{N as a,h as c,M as i,_ as l,j as n,A as o,k as r,g as s,I as t};
|
package/dist/C_VtableGantt.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* unplugin-vue-components disabled *//* 甘特图组件样式 */
|
|
2
|
-
.c-vtable-gantt-wrapper[data-v-
|
|
2
|
+
.c-vtable-gantt-wrapper[data-v-cadc6c9b] {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
border: 1px solid var(--c-border, #e1e4e8);
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
|
9
9
|
height: 100%;
|
|
10
10
|
}
|
|
11
|
-
.c-vtable-gantt-wrapper .gantt-toolbar[data-v-
|
|
11
|
+
.c-vtable-gantt-wrapper .gantt-toolbar[data-v-cadc6c9b] {
|
|
12
12
|
display: flex;
|
|
13
13
|
justify-content: space-between;
|
|
14
14
|
align-items: center;
|
|
@@ -17,75 +17,75 @@
|
|
|
17
17
|
min-height: 48px;
|
|
18
18
|
flex-shrink: 0;
|
|
19
19
|
}
|
|
20
|
-
.c-vtable-gantt-wrapper .gantt-toolbar .toolbar-left .gantt-title[data-v-
|
|
20
|
+
.c-vtable-gantt-wrapper .gantt-toolbar .toolbar-left .gantt-title[data-v-cadc6c9b] {
|
|
21
21
|
font-size: 16px;
|
|
22
22
|
font-weight: 600;
|
|
23
23
|
color: var(--c-text-1, #333);
|
|
24
24
|
}
|
|
25
|
-
.c-vtable-gantt-wrapper .gantt-toolbar .toolbar-right[data-v-
|
|
25
|
+
.c-vtable-gantt-wrapper .gantt-toolbar .toolbar-right[data-v-cadc6c9b] {
|
|
26
26
|
display: flex;
|
|
27
27
|
gap: 8px;
|
|
28
28
|
align-items: center;
|
|
29
29
|
}
|
|
30
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
30
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] {
|
|
31
31
|
flex: 1;
|
|
32
32
|
position: relative;
|
|
33
33
|
min-height: 400px;
|
|
34
34
|
overflow: hidden;
|
|
35
35
|
/* 确保甘特图组件完全填充容器 */
|
|
36
36
|
}
|
|
37
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
37
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] > * {
|
|
38
38
|
width: 100%;
|
|
39
39
|
height: 100%;
|
|
40
40
|
}
|
|
41
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
41
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] {
|
|
42
42
|
/* 确保甘特图内部组件正确填充 */
|
|
43
43
|
}
|
|
44
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
44
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] .vtable-gantt {
|
|
45
45
|
width: 100% !important;
|
|
46
46
|
height: 100% !important;
|
|
47
47
|
overflow: hidden;
|
|
48
48
|
}
|
|
49
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
49
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] .vtable-gantt * {
|
|
50
50
|
backface-visibility: hidden;
|
|
51
51
|
transform: translateZ(0);
|
|
52
52
|
-webkit-font-smoothing: subpixel-antialiased;
|
|
53
53
|
}
|
|
54
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
54
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] {
|
|
55
55
|
/* 防止内部表格自动调整高度 */
|
|
56
56
|
}
|
|
57
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
57
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] .vtable-gantt-table {
|
|
58
58
|
height: 100% !important;
|
|
59
59
|
box-sizing: border-box;
|
|
60
60
|
}
|
|
61
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
61
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] {
|
|
62
62
|
/* 防止拖动时底部色块闪烁 */
|
|
63
63
|
}
|
|
64
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
64
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] .vtable-gantt-chart {
|
|
65
65
|
position: relative;
|
|
66
66
|
overflow: hidden;
|
|
67
67
|
will-change: transform;
|
|
68
68
|
transform: translateZ(0);
|
|
69
69
|
}
|
|
70
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
70
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] {
|
|
71
71
|
/* 针对拖动元素的优化 */
|
|
72
72
|
}
|
|
73
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
73
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] .vtable-gantt-task {
|
|
74
74
|
backface-visibility: hidden;
|
|
75
75
|
transform: translateZ(0);
|
|
76
76
|
}
|
|
77
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
77
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] .vtable-gantt-task.dragging {
|
|
78
78
|
z-index: 1000;
|
|
79
79
|
pointer-events: none;
|
|
80
80
|
}
|
|
81
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
81
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] {
|
|
82
82
|
/* 防止拖动时底部区域的重绘闪烁 */
|
|
83
83
|
}
|
|
84
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
84
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] .vtable-gantt-chart-container {
|
|
85
85
|
position: relative;
|
|
86
86
|
overflow: hidden;
|
|
87
87
|
}
|
|
88
|
-
.c-vtable-gantt-wrapper .gantt-container[data-v-
|
|
88
|
+
.c-vtable-gantt-wrapper .gantt-container[data-v-cadc6c9b] .vtable-gantt-chart-container::after {
|
|
89
89
|
content: "";
|
|
90
90
|
position: absolute;
|
|
91
91
|
bottom: 0;
|
package/dist/C_VtableGantt2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`naive-ui`);const i={headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:1,fontSize:14,fontWeight:`bold`},bodyStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:[1,0,1,0],fontSize:13}},a={basic:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:220,tree:!0},{field:`start`,title:`开始时间`,width:120},{field:`end`,title:`结束时间`,width:120},{field:`progress`,title:`进度`,width:80}],tableWidth:420,minTableWidth:300,theme:i},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`#e1e4e8`,cornerRadius:6},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:2}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:18,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:4,borderLineWidth:0},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:1,fillColor:`#ffd666`,width:12}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:12,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},project:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:200,tree:!0,editor:`input`},{field:`start`,title:`开始时间`,width:120,editor:`date-input`},{field:`end`,title:`结束时间`,width:120,editor:`date-input`},{field:`priority`,title:`优先级`,width:80,editor:`input`},{field:`progress`,title:`进度%`,width:80,editor:`input`}],tableWidth:480,minTableWidth:350,maxTableWidth:800,theme:i,hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(24, 144, 255, 0.3)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:12,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:6,borderLineWidth:0}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,startOfWeek:`monday`,format:e=>`第${e.dateIndex}周`,style:{fontSize:13,fontWeight:`bold`,textAlign:`center`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11,textAlign:`center`}}]},rowSeriesNumber:{title:`序号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},timeline:{overscrollBehavior:`none`,headerRowHeight:45,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`事件名称`,width:250,tree:!0},{field:`start`,title:`时间`,width:150}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...i.headerStyle},bodyStyle:i.bodyStyle}},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`rgba(128, 128, 128, 0.3)`,cornerRadius:4},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:22,barColor:`#722ed1`,completedBarColor:`#b37feb`,cornerRadius:8,borderLineWidth:0}},timelineHeader:{colWidth:60,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},milestone:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:38,taskListTable:{columns:[{field:`title`,title:`里程碑`,width:200,tree:!0},{field:`start`,title:`目标日期`,width:120},{field:`priority`,title:`重要性`,width:100}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...i.headerStyle,borderColor:`#ffa940`},bodyStyle:{...i.bodyStyle,borderColor:`#ffa940`}}},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#ffa940`,cornerRadius:6},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`},horizontalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`}},taskBar:{startDateField:`start`,endDateField:`start`,labelText:`{title}`,labelTextStyle:{fontSize:12,fontWeight:`bold`},barStyle:{width:0,barColor:`transparent`},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:2,fillColor:`#ffd666`,width:16}},timelineHeader:{colWidth:80,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},official:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`title`,width:180,sort:!0,tree:!0,editor:`input`},{field:`start`,title:`start`,width:120,sort:!0,editor:`date-input`},{field:`end`,title:`end`,width:120,sort:!0,editor:`date-input`},{field:`priority`,title:`priority`,width:80,sort:!0,editor:`input`},{field:`progress`,title:`progress`,width:80,sort:!0,editor:`input`}],tableWidth:460,minTableWidth:350,maxTableWidth:800,theme:{headerStyle:{...i.headerStyle,fontSize:18,color:`red`},bodyStyle:{...i.bodyStyle,fontSize:16,color:`#4D4D4D`}},hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3},horizontalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(99, 144, 0, 0.4)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:16,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#ee8800`,completedBarColor:`#91e8e0`,cornerRadius:8,borderLineWidth:1,borderColor:`black`},milestoneStyle:{borderColor:`red`,borderLineWidth:1,fillColor:`green`,width:15}},timelineHeader:{backgroundColor:`#EEF1F5`,colWidth:60,horizontalLine:{lineWidth:1,lineColor:`#e1e4e8`},verticalLine:{lineWidth:1,lineColor:`#e1e4e8`},scales:[{unit:`week`,step:1,startOfWeek:`sunday`,format:e=>`Week ${e.dateIndex}`,style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`,textStick:!0}},{unit:`day`,step:1,format:e=>e.dateIndex.toString(),style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`}}]},markLine:[{date:`2024-07-28`,style:{lineWidth:1,lineColor:`blue`,lineDash:[8,4]}},{date:`2024-08-17`,style:{lineWidth:2,lineColor:`red`,lineDash:[8,4]}}],rowSeriesNumber:{title:`行号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}}},o={class:`c-vtable-gantt-wrapper`},s={key:0,class:`gantt-toolbar`},c={class:`toolbar-left`},l={class:`gantt-title`},u={class:`toolbar-right`},d=(0,n.defineComponent)({name:`C_VtableGantt`,__name:`index`,props:{data:{default:()=>[]},options:{default:()=>({})},preset:{default:`basic`},height:{default:`600px`},title:{default:``},showToolbar:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},theme:{default:`light`}},emits:[`ganttCreated`,`taskClick`,`taskChange`],setup(t,{expose:i,emit:d}){let f=t,p=d,m=(0,n.ref)(),h=(0,n.ref)(),g=(0,n.ref)(!1),_=(0,n.computed)(()=>typeof f.height==`number`?`${f.height}px`:f.height),v=(e,t,n=new WeakMap)=>y(e)?y(t)?n.has(t)?n.get(t):x(e,t,n):e:t,y=e=>typeof e==`object`&&!!e,b=e=>e instanceof Date||e instanceof RegExp,x=(e,t,n)=>{let r=Array.isArray(e)?[...e]:{...e};n.set(t,r);for(let i in t){if(!t.hasOwnProperty(i))continue;let a=t[i];r[i]=y(a)&&!Array.isArray(a)&&!b(a)?v(e[i]||{},a,n):a}return r},S=e=>e.map(e=>({...e,title:e.title||`任务${e.id}`,children:e.children?S(e.children):void 0})),C=e=>({underlayBackgroundColor:e?`#1e1e1e`:`#ffffff`,timelineHeaderBg:e?`#2d2d2d`:`#EEF1F5`,gridBg:e?`#1e1e1e`:`#ffffff`,lineColor:e?`rgba(255, 255, 255, 0.1)`:`rgba(128, 128, 128, 0.2)`,textColor:e?`#ffffff`:`#000000`}),w=(e,t)=>({...e,backgroundColor:t.timelineHeaderBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor},scales:e?.scales?.map(e=>({...e,style:{...e.style,color:t.textColor}}))}),T=(e,t)=>({...e,backgroundColor:t.gridBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor}}),E=(e,t,n,r)=>({...e,records:t,underlayBackgroundColor:r.underlayBackgroundColor,taskListTable:{...e.taskListTable,theme:n},timelineHeader:w(e.timelineHeader,r),grid:T(e.grid,r)}),D=e=>{e.on(`click_cell`,e=>{let{record:t,event:n}=e||{};t&&p(`taskClick`,t,n)}),e.on(`change_data`,e=>{let{record:t,changes:n}=e||{};t&&n&&p(`taskChange`,t,n)})},O=async()=>{if(m.value)try{let{Gantt:e}=await import(`@visactor/vtable-gantt`),{themes:t}=await import(`@visactor/vtable`),n=f.theme===`dark`,r=v(a[f.preset]||a.basic,f.options),i=S(f.data||[]);h.value&&h.value.release();let o=E(r,i,n?t.DARK:t.DEFAULT,C(n));h.value=new e(m.value,o),D(h.value),p(`ganttCreated`,h.value)}catch(e){console.error(`甘特图初始化失败:`,e)}},k=async()=>{if(m.value)try{document.fullscreenElement?(await document.exitFullscreen(),g.value=!1):(await m.value.requestFullscreen(),g.value=!0),setTimeout(()=>h.value?.resize?.(),100)}catch(e){console.warn(`全屏切换失败:`,e),g.value=!g.value,(0,n.nextTick)(()=>h.value?.resize?.())}},A=()=>{g.value=!!document.fullscreenElement,(0,n.nextTick)(()=>h.value?.resize?.())},j=e=>{if(h.value&&e)try{h.value.setRecords(S(e))}catch(e){console.warn(`更新数据失败:`,e)}},M=e=>{if(h.value&&e)try{h.value.updateOption(e)}catch(e){console.warn(`更新配置失败:`,e)}},N=()=>{if(h.value)try{h.value.release()}catch(e){console.warn(`销毁甘特图失败:`,e)}finally{h.value=void 0}};return(0,n.watch)(()=>f.data,e=>{e&&h.value&&j(e)},{deep:!0}),(0,n.watch)(()=>[f.options,f.preset],()=>(0,n.nextTick)(()=>O()),{deep:!0}),(0,n.watch)(()=>f.theme,()=>(0,n.nextTick)(()=>O())),(0,n.onMounted)(()=>{document.addEventListener(`fullscreenchange`,A),(0,n.nextTick)(()=>setTimeout(()=>O(),100))}),(0,n.onUnmounted)(()=>{document.removeEventListener(`fullscreenchange`,A),N()}),i({ganttInstance:h,updateData:j,updateOptions:M,toggleFullscreen:k}),(i,a)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,o,[t.showToolbar?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,s,[(0,n.createElementVNode)(`div`,c,[(0,n.createElementVNode)(`span`,l,(0,n.toDisplayString)(t.title||`甘特图`),1)]),(0,n.createElementVNode)(`div`,u,[t.showFullscreenButton?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NButton),{key:0,size:`small`,onClick:k},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:g.value?`carbon:minimize`:`carbon:maximize`,size:16,color:`currentColor`},null,8,[`name`])]),default:(0,n.withCtx)(()=>[(0,n.createTextVNode)(` `+(0,n.toDisplayString)(g.value?`退出全屏`:`全屏`),1)]),_:1})):(0,n.createCommentVNode)(`v-if`,!0)])])):(0,n.createCommentVNode)(`v-if`,!0),(0,n.createElementVNode)(`div`,{ref_key:`ganttContainerRef`,ref:m,class:`gantt-container`,style:(0,n.normalizeStyle)({height:_.value})},null,4)]))}});var f=t.t(d,[[`__scopeId`,`data-v-1fc4d705`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`naive-ui`);const i={headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:1,fontSize:14,fontWeight:`bold`},bodyStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:[1,0,1,0],fontSize:13}},a={basic:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:220,tree:!0},{field:`start`,title:`开始时间`,width:120},{field:`end`,title:`结束时间`,width:120},{field:`progress`,title:`进度`,width:80}],tableWidth:420,minTableWidth:300,theme:i},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`#e1e4e8`,cornerRadius:6},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:2}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:18,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:4,borderLineWidth:0},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:1,fillColor:`#ffd666`,width:12}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:12,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},project:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:200,tree:!0,editor:`input`},{field:`start`,title:`开始时间`,width:120,editor:`date-input`},{field:`end`,title:`结束时间`,width:120,editor:`date-input`},{field:`priority`,title:`优先级`,width:80,editor:`input`},{field:`progress`,title:`进度%`,width:80,editor:`input`}],tableWidth:480,minTableWidth:350,maxTableWidth:800,theme:i,hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(24, 144, 255, 0.3)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:12,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:6,borderLineWidth:0}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,startOfWeek:`monday`,format:e=>`第${e.dateIndex}周`,style:{fontSize:13,fontWeight:`bold`,textAlign:`center`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11,textAlign:`center`}}]},rowSeriesNumber:{title:`序号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},timeline:{overscrollBehavior:`none`,headerRowHeight:45,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`事件名称`,width:250,tree:!0},{field:`start`,title:`时间`,width:150}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...i.headerStyle},bodyStyle:i.bodyStyle}},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`rgba(128, 128, 128, 0.3)`,cornerRadius:4},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:22,barColor:`#722ed1`,completedBarColor:`#b37feb`,cornerRadius:8,borderLineWidth:0}},timelineHeader:{colWidth:60,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},milestone:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:38,taskListTable:{columns:[{field:`title`,title:`里程碑`,width:200,tree:!0},{field:`start`,title:`目标日期`,width:120},{field:`priority`,title:`重要性`,width:100}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...i.headerStyle,borderColor:`#ffa940`},bodyStyle:{...i.bodyStyle,borderColor:`#ffa940`}}},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#ffa940`,cornerRadius:6},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`},horizontalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`}},taskBar:{startDateField:`start`,endDateField:`start`,labelText:`{title}`,labelTextStyle:{fontSize:12,fontWeight:`bold`},barStyle:{width:0,barColor:`transparent`},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:2,fillColor:`#ffd666`,width:16}},timelineHeader:{colWidth:80,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},official:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`title`,width:180,sort:!0,tree:!0,editor:`input`},{field:`start`,title:`start`,width:120,sort:!0,editor:`date-input`},{field:`end`,title:`end`,width:120,sort:!0,editor:`date-input`},{field:`priority`,title:`priority`,width:80,sort:!0,editor:`input`},{field:`progress`,title:`progress`,width:80,sort:!0,editor:`input`}],tableWidth:460,minTableWidth:350,maxTableWidth:800,theme:{headerStyle:{...i.headerStyle,fontSize:18,color:`red`},bodyStyle:{...i.bodyStyle,fontSize:16,color:`#4D4D4D`}},hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3},horizontalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(99, 144, 0, 0.4)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:16,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#ee8800`,completedBarColor:`#91e8e0`,cornerRadius:8,borderLineWidth:1,borderColor:`black`},milestoneStyle:{borderColor:`red`,borderLineWidth:1,fillColor:`green`,width:15}},timelineHeader:{backgroundColor:`#EEF1F5`,colWidth:60,horizontalLine:{lineWidth:1,lineColor:`#e1e4e8`},verticalLine:{lineWidth:1,lineColor:`#e1e4e8`},scales:[{unit:`week`,step:1,startOfWeek:`sunday`,format:e=>`Week ${e.dateIndex}`,style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`,textStick:!0}},{unit:`day`,step:1,format:e=>e.dateIndex.toString(),style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`}}]},markLine:[{date:`2024-07-28`,style:{lineWidth:1,lineColor:`blue`,lineDash:[8,4]}},{date:`2024-08-17`,style:{lineWidth:2,lineColor:`red`,lineDash:[8,4]}}],rowSeriesNumber:{title:`行号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}}},o={class:`c-vtable-gantt-wrapper`},s={key:0,class:`gantt-toolbar`},c={class:`toolbar-left`},l={class:`gantt-title`},u={class:`toolbar-right`},d=(0,n.defineComponent)({name:`C_VtableGantt`,__name:`index`,props:{data:{default:()=>[]},options:{default:()=>({})},preset:{default:`basic`},height:{default:`600px`},title:{default:``},showToolbar:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},theme:{default:`light`}},emits:[`ganttCreated`,`taskClick`,`taskChange`],setup(t,{expose:i,emit:d}){let f=t,p=d,m=(0,n.ref)(),h=(0,n.ref)(),g=(0,n.ref)(!1),_=0,v,y=!1,b=(0,n.computed)(()=>typeof f.height==`number`?`${f.height}px`:f.height),x=(e,t)=>!y&&e===_&&m.value===t,S=(e,t,n=new WeakMap)=>C(e)?C(t)?n.has(t)?n.get(t):T(e,t,n):e:t,C=e=>typeof e==`object`&&!!e,w=e=>e instanceof Date||e instanceof RegExp,T=(e,t,n)=>{let r=Array.isArray(e)?[...e]:{...e};n.set(t,r);for(let i in t){if(!t.hasOwnProperty(i))continue;let a=t[i];r[i]=C(a)&&!Array.isArray(a)&&!w(a)?S(e[i]||{},a,n):a}return r},E=e=>e.map(e=>({...e,title:e.title||`任务${e.id}`,children:e.children?E(e.children):void 0})),D=e=>({underlayBackgroundColor:e?`#1e1e1e`:`#ffffff`,timelineHeaderBg:e?`#2d2d2d`:`#EEF1F5`,gridBg:e?`#1e1e1e`:`#ffffff`,lineColor:e?`rgba(255, 255, 255, 0.1)`:`rgba(128, 128, 128, 0.2)`,textColor:e?`#ffffff`:`#000000`}),O=(e,t)=>({...e,backgroundColor:t.timelineHeaderBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor},scales:e?.scales?.map(e=>({...e,style:{...e.style,color:t.textColor}}))}),k=(e,t)=>({...e,backgroundColor:t.gridBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor}}),A=(e,t,n,r)=>({...e,records:t,underlayBackgroundColor:r.underlayBackgroundColor,taskListTable:{...e.taskListTable,theme:n},timelineHeader:O(e.timelineHeader,r),grid:k(e.grid,r)}),j=e=>{e.on(`click_cell`,e=>{let{record:t,event:n}=e||{};t&&p(`taskClick`,t,n)}),e.on(`change_data`,e=>{let{record:t,changes:n}=e||{};t&&n&&p(`taskChange`,t,n)})},M=async()=>{let e=m.value;if(!e||y)return;let t=++_;try{let{Gantt:n}=await import(`@visactor/vtable-gantt`),{themes:r}=await import(`@visactor/vtable`);if(!x(t,e))return;let i=f.theme===`dark`,o=S(a[f.preset]||a.basic,f.options),s=E(f.data||[]);h.value&&h.value.release();let c=new n(e,A(o,s,i?r.DARK:r.DEFAULT,D(i)));if(!x(t,e)){c.release();return}h.value=c,j(c),p(`ganttCreated`,c)}catch(e){console.error(`甘特图初始化失败:`,e)}},N=async()=>{if(m.value)try{document.fullscreenElement?(await document.exitFullscreen(),g.value=!1):(await m.value.requestFullscreen(),g.value=!0),setTimeout(()=>h.value?.resize?.(),100)}catch(e){console.warn(`全屏切换失败:`,e),g.value=!g.value,(0,n.nextTick)(()=>h.value?.resize?.())}},P=()=>{g.value=!!document.fullscreenElement,(0,n.nextTick)(()=>h.value?.resize?.())},F=e=>{if(h.value&&e)try{h.value.setRecords(E(e))}catch(e){console.warn(`更新数据失败:`,e)}},I=e=>{if(h.value&&e)try{h.value.updateOption(e)}catch(e){console.warn(`更新配置失败:`,e)}},L=()=>{if(h.value)try{h.value.release()}catch(e){console.warn(`销毁甘特图失败:`,e)}finally{h.value=void 0}};return(0,n.watch)(()=>f.data,e=>{e&&h.value&&F(e)},{deep:!0}),(0,n.watch)(()=>[f.options,f.preset],()=>(0,n.nextTick)(()=>M()),{deep:!0}),(0,n.watch)(()=>f.theme,()=>(0,n.nextTick)(()=>M())),(0,n.onMounted)(()=>{y=!1,document.addEventListener(`fullscreenchange`,P),(0,n.nextTick)(()=>{y||(v=setTimeout(()=>M(),100))})}),(0,n.onUnmounted)(()=>{y=!0,_+=1,v&&clearTimeout(v),document.removeEventListener(`fullscreenchange`,P),L()}),i({ganttInstance:h,updateData:F,updateOptions:I,toggleFullscreen:N}),(i,a)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,o,[t.showToolbar?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,s,[(0,n.createElementVNode)(`div`,c,[(0,n.createElementVNode)(`span`,l,(0,n.toDisplayString)(t.title||`甘特图`),1)]),(0,n.createElementVNode)(`div`,u,[t.showFullscreenButton?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NButton),{key:0,size:`small`,onClick:N},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:g.value?`carbon:minimize`:`carbon:maximize`,size:16,color:`currentColor`},null,8,[`name`])]),default:(0,n.withCtx)(()=>[(0,n.createTextVNode)(` `+(0,n.toDisplayString)(g.value?`退出全屏`:`全屏`),1)]),_:1})):(0,n.createCommentVNode)(`v-if`,!0)])])):(0,n.createCommentVNode)(`v-if`,!0),(0,n.createElementVNode)(`div`,{ref_key:`ganttContainerRef`,ref:m,class:`gantt-container`,style:(0,n.normalizeStyle)({height:b.value})},null,4)]))}});var f=t.t(d,[[`__scopeId`,`data-v-cadc6c9b`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|
package/dist/C_VtableGantt2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{computed as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createTextVNode as s,createVNode as c,defineComponent as l,nextTick as u,normalizeStyle as d,onMounted as f,onUnmounted as p,openBlock as m,ref as h,toDisplayString as g,unref as _,watch as v,withCtx as y}from"vue";import{NButton as b}from"naive-ui";const x={headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:1,fontSize:14,fontWeight:`bold`},bodyStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:[1,0,1,0],fontSize:13}},S={basic:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:220,tree:!0},{field:`start`,title:`开始时间`,width:120},{field:`end`,title:`结束时间`,width:120},{field:`progress`,title:`进度`,width:80}],tableWidth:420,minTableWidth:300,theme:x},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`#e1e4e8`,cornerRadius:6},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:2}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:18,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:4,borderLineWidth:0},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:1,fillColor:`#ffd666`,width:12}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:12,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},project:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:200,tree:!0,editor:`input`},{field:`start`,title:`开始时间`,width:120,editor:`date-input`},{field:`end`,title:`结束时间`,width:120,editor:`date-input`},{field:`priority`,title:`优先级`,width:80,editor:`input`},{field:`progress`,title:`进度%`,width:80,editor:`input`}],tableWidth:480,minTableWidth:350,maxTableWidth:800,theme:x,hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(24, 144, 255, 0.3)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:12,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:6,borderLineWidth:0}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,startOfWeek:`monday`,format:e=>`第${e.dateIndex}周`,style:{fontSize:13,fontWeight:`bold`,textAlign:`center`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11,textAlign:`center`}}]},rowSeriesNumber:{title:`序号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},timeline:{overscrollBehavior:`none`,headerRowHeight:45,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`事件名称`,width:250,tree:!0},{field:`start`,title:`时间`,width:150}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...x.headerStyle},bodyStyle:x.bodyStyle}},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`rgba(128, 128, 128, 0.3)`,cornerRadius:4},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:22,barColor:`#722ed1`,completedBarColor:`#b37feb`,cornerRadius:8,borderLineWidth:0}},timelineHeader:{colWidth:60,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},milestone:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:38,taskListTable:{columns:[{field:`title`,title:`里程碑`,width:200,tree:!0},{field:`start`,title:`目标日期`,width:120},{field:`priority`,title:`重要性`,width:100}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...x.headerStyle,borderColor:`#ffa940`},bodyStyle:{...x.bodyStyle,borderColor:`#ffa940`}}},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#ffa940`,cornerRadius:6},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`},horizontalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`}},taskBar:{startDateField:`start`,endDateField:`start`,labelText:`{title}`,labelTextStyle:{fontSize:12,fontWeight:`bold`},barStyle:{width:0,barColor:`transparent`},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:2,fillColor:`#ffd666`,width:16}},timelineHeader:{colWidth:80,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},official:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`title`,width:180,sort:!0,tree:!0,editor:`input`},{field:`start`,title:`start`,width:120,sort:!0,editor:`date-input`},{field:`end`,title:`end`,width:120,sort:!0,editor:`date-input`},{field:`priority`,title:`priority`,width:80,sort:!0,editor:`input`},{field:`progress`,title:`progress`,width:80,sort:!0,editor:`input`}],tableWidth:460,minTableWidth:350,maxTableWidth:800,theme:{headerStyle:{...x.headerStyle,fontSize:18,color:`red`},bodyStyle:{...x.bodyStyle,fontSize:16,color:`#4D4D4D`}},hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3},horizontalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(99, 144, 0, 0.4)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:16,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#ee8800`,completedBarColor:`#91e8e0`,cornerRadius:8,borderLineWidth:1,borderColor:`black`},milestoneStyle:{borderColor:`red`,borderLineWidth:1,fillColor:`green`,width:15}},timelineHeader:{backgroundColor:`#EEF1F5`,colWidth:60,horizontalLine:{lineWidth:1,lineColor:`#e1e4e8`},verticalLine:{lineWidth:1,lineColor:`#e1e4e8`},scales:[{unit:`week`,step:1,startOfWeek:`sunday`,format:e=>`Week ${e.dateIndex}`,style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`,textStick:!0}},{unit:`day`,step:1,format:e=>e.dateIndex.toString(),style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`}}]},markLine:[{date:`2024-07-28`,style:{lineWidth:1,lineColor:`blue`,lineDash:[8,4]}},{date:`2024-08-17`,style:{lineWidth:2,lineColor:`red`,lineDash:[8,4]}}],rowSeriesNumber:{title:`行号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}}},C={class:`c-vtable-gantt-wrapper`},w={key:0,class:`gantt-toolbar`},T={class:`toolbar-left`},E={class:`gantt-title`},D={class:`toolbar-right`};var O=t(l({name:`C_VtableGantt`,__name:`index`,props:{data:{default:()=>[]},options:{default:()=>({})},preset:{default:`basic`},height:{default:`600px`},title:{default:``},showToolbar:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},theme:{default:`light`}},emits:[`ganttCreated`,`taskClick`,`taskChange`],setup(t,{expose:l,emit:x}){let O=t,k=x,A=h(),j=h(),M=h(!1),N=n(()=>typeof O.height==`number`?`${O.height}px`:O.height),P=(e,t,n=new WeakMap)=>F(e)?F(t)?n.has(t)?n.get(t):L(e,t,n):e:t,F=e=>typeof e==`object`&&!!e,I=e=>e instanceof Date||e instanceof RegExp,L=(e,t,n)=>{let r=Array.isArray(e)?[...e]:{...e};n.set(t,r);for(let i in t){if(!t.hasOwnProperty(i))continue;let a=t[i];r[i]=F(a)&&!Array.isArray(a)&&!I(a)?P(e[i]||{},a,n):a}return r},R=e=>e.map(e=>({...e,title:e.title||`任务${e.id}`,children:e.children?R(e.children):void 0})),z=e=>({underlayBackgroundColor:e?`#1e1e1e`:`#ffffff`,timelineHeaderBg:e?`#2d2d2d`:`#EEF1F5`,gridBg:e?`#1e1e1e`:`#ffffff`,lineColor:e?`rgba(255, 255, 255, 0.1)`:`rgba(128, 128, 128, 0.2)`,textColor:e?`#ffffff`:`#000000`}),B=(e,t)=>({...e,backgroundColor:t.timelineHeaderBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor},scales:e?.scales?.map(e=>({...e,style:{...e.style,color:t.textColor}}))}),V=(e,t)=>({...e,backgroundColor:t.gridBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor}}),H=(e,t,n,r)=>({...e,records:t,underlayBackgroundColor:r.underlayBackgroundColor,taskListTable:{...e.taskListTable,theme:n},timelineHeader:B(e.timelineHeader,r),grid:V(e.grid,r)}),U=e=>{e.on(`click_cell`,e=>{let{record:t,event:n}=e||{};t&&k(`taskClick`,t,n)}),e.on(`change_data`,e=>{let{record:t,changes:n}=e||{};t&&n&&k(`taskChange`,t,n)})},W=async()=>{if(A.value)try{let{Gantt:e}=await import(`@visactor/vtable-gantt`),{themes:t}=await import(`@visactor/vtable`),n=O.theme===`dark`,r=P(S[O.preset]||S.basic,O.options),i=R(O.data||[]);j.value&&j.value.release();let a=H(r,i,n?t.DARK:t.DEFAULT,z(n));j.value=new e(A.value,a),U(j.value),k(`ganttCreated`,j.value)}catch(e){console.error(`甘特图初始化失败:`,e)}},G=async()=>{if(A.value)try{document.fullscreenElement?(await document.exitFullscreen(),M.value=!1):(await A.value.requestFullscreen(),M.value=!0),setTimeout(()=>j.value?.resize?.(),100)}catch(e){console.warn(`全屏切换失败:`,e),M.value=!M.value,u(()=>j.value?.resize?.())}},K=()=>{M.value=!!document.fullscreenElement,u(()=>j.value?.resize?.())},q=e=>{if(j.value&&e)try{j.value.setRecords(R(e))}catch(e){console.warn(`更新数据失败:`,e)}},J=e=>{if(j.value&&e)try{j.value.updateOption(e)}catch(e){console.warn(`更新配置失败:`,e)}},Y=()=>{if(j.value)try{j.value.release()}catch(e){console.warn(`销毁甘特图失败:`,e)}finally{j.value=void 0}};return v(()=>O.data,e=>{e&&j.value&&q(e)},{deep:!0}),v(()=>[O.options,O.preset],()=>u(()=>W()),{deep:!0}),v(()=>O.theme,()=>u(()=>W())),f(()=>{document.addEventListener(`fullscreenchange`,K),u(()=>setTimeout(()=>W(),100))}),p(()=>{document.removeEventListener(`fullscreenchange`,K),Y()}),l({ganttInstance:j,updateData:q,updateOptions:J,toggleFullscreen:G}),(n,l)=>(m(),a(`div`,C,[t.showToolbar?(m(),a(`div`,w,[o(`div`,T,[o(`span`,E,g(t.title||`甘特图`),1)]),o(`div`,D,[t.showFullscreenButton?(m(),r(_(b),{key:0,size:`small`,onClick:G},{icon:y(()=>[c(e,{name:M.value?`carbon:minimize`:`carbon:maximize`,size:16,color:`currentColor`},null,8,[`name`])]),default:y(()=>[s(` `+g(M.value?`退出全屏`:`全屏`),1)]),_:1})):i(`v-if`,!0)])])):i(`v-if`,!0),o(`div`,{ref_key:`ganttContainerRef`,ref:A,class:`gantt-container`,style:d({height:N.value})},null,4)]))}}),[[`__scopeId`,`data-v-1fc4d705`]]);export{S as n,O as t};
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{computed as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createTextVNode as s,createVNode as c,defineComponent as l,nextTick as u,normalizeStyle as d,onMounted as f,onUnmounted as p,openBlock as m,ref as h,toDisplayString as g,unref as _,watch as v,withCtx as y}from"vue";import{NButton as b}from"naive-ui";const x={headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:1,fontSize:14,fontWeight:`bold`},bodyStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:[1,0,1,0],fontSize:13}},S={basic:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:220,tree:!0},{field:`start`,title:`开始时间`,width:120},{field:`end`,title:`结束时间`,width:120},{field:`progress`,title:`进度`,width:80}],tableWidth:420,minTableWidth:300,theme:x},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`#e1e4e8`,cornerRadius:6},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:2}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:18,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:4,borderLineWidth:0},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:1,fillColor:`#ffd666`,width:12}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:12,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},project:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:200,tree:!0,editor:`input`},{field:`start`,title:`开始时间`,width:120,editor:`date-input`},{field:`end`,title:`结束时间`,width:120,editor:`date-input`},{field:`priority`,title:`优先级`,width:80,editor:`input`},{field:`progress`,title:`进度%`,width:80,editor:`input`}],tableWidth:480,minTableWidth:350,maxTableWidth:800,theme:x,hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(24, 144, 255, 0.3)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:12,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:6,borderLineWidth:0}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,startOfWeek:`monday`,format:e=>`第${e.dateIndex}周`,style:{fontSize:13,fontWeight:`bold`,textAlign:`center`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11,textAlign:`center`}}]},rowSeriesNumber:{title:`序号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},timeline:{overscrollBehavior:`none`,headerRowHeight:45,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`事件名称`,width:250,tree:!0},{field:`start`,title:`时间`,width:150}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...x.headerStyle},bodyStyle:x.bodyStyle}},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`rgba(128, 128, 128, 0.3)`,cornerRadius:4},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:22,barColor:`#722ed1`,completedBarColor:`#b37feb`,cornerRadius:8,borderLineWidth:0}},timelineHeader:{colWidth:60,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},milestone:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:38,taskListTable:{columns:[{field:`title`,title:`里程碑`,width:200,tree:!0},{field:`start`,title:`目标日期`,width:120},{field:`priority`,title:`重要性`,width:100}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...x.headerStyle,borderColor:`#ffa940`},bodyStyle:{...x.bodyStyle,borderColor:`#ffa940`}}},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#ffa940`,cornerRadius:6},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`},horizontalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`}},taskBar:{startDateField:`start`,endDateField:`start`,labelText:`{title}`,labelTextStyle:{fontSize:12,fontWeight:`bold`},barStyle:{width:0,barColor:`transparent`},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:2,fillColor:`#ffd666`,width:16}},timelineHeader:{colWidth:80,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},official:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`title`,width:180,sort:!0,tree:!0,editor:`input`},{field:`start`,title:`start`,width:120,sort:!0,editor:`date-input`},{field:`end`,title:`end`,width:120,sort:!0,editor:`date-input`},{field:`priority`,title:`priority`,width:80,sort:!0,editor:`input`},{field:`progress`,title:`progress`,width:80,sort:!0,editor:`input`}],tableWidth:460,minTableWidth:350,maxTableWidth:800,theme:{headerStyle:{...x.headerStyle,fontSize:18,color:`red`},bodyStyle:{...x.bodyStyle,fontSize:16,color:`#4D4D4D`}},hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3},horizontalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(99, 144, 0, 0.4)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:16,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#ee8800`,completedBarColor:`#91e8e0`,cornerRadius:8,borderLineWidth:1,borderColor:`black`},milestoneStyle:{borderColor:`red`,borderLineWidth:1,fillColor:`green`,width:15}},timelineHeader:{backgroundColor:`#EEF1F5`,colWidth:60,horizontalLine:{lineWidth:1,lineColor:`#e1e4e8`},verticalLine:{lineWidth:1,lineColor:`#e1e4e8`},scales:[{unit:`week`,step:1,startOfWeek:`sunday`,format:e=>`Week ${e.dateIndex}`,style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`,textStick:!0}},{unit:`day`,step:1,format:e=>e.dateIndex.toString(),style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`}}]},markLine:[{date:`2024-07-28`,style:{lineWidth:1,lineColor:`blue`,lineDash:[8,4]}},{date:`2024-08-17`,style:{lineWidth:2,lineColor:`red`,lineDash:[8,4]}}],rowSeriesNumber:{title:`行号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}}},C={class:`c-vtable-gantt-wrapper`},w={key:0,class:`gantt-toolbar`},T={class:`toolbar-left`},E={class:`gantt-title`},D={class:`toolbar-right`};var O=t(l({name:`C_VtableGantt`,__name:`index`,props:{data:{default:()=>[]},options:{default:()=>({})},preset:{default:`basic`},height:{default:`600px`},title:{default:``},showToolbar:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},theme:{default:`light`}},emits:[`ganttCreated`,`taskClick`,`taskChange`],setup(t,{expose:l,emit:x}){let O=t,k=x,A=h(),j=h(),M=h(!1),N=0,P,F=!1,I=n(()=>typeof O.height==`number`?`${O.height}px`:O.height),L=(e,t)=>!F&&e===N&&A.value===t,R=(e,t,n=new WeakMap)=>z(e)?z(t)?n.has(t)?n.get(t):V(e,t,n):e:t,z=e=>typeof e==`object`&&!!e,B=e=>e instanceof Date||e instanceof RegExp,V=(e,t,n)=>{let r=Array.isArray(e)?[...e]:{...e};n.set(t,r);for(let i in t){if(!t.hasOwnProperty(i))continue;let a=t[i];r[i]=z(a)&&!Array.isArray(a)&&!B(a)?R(e[i]||{},a,n):a}return r},H=e=>e.map(e=>({...e,title:e.title||`任务${e.id}`,children:e.children?H(e.children):void 0})),U=e=>({underlayBackgroundColor:e?`#1e1e1e`:`#ffffff`,timelineHeaderBg:e?`#2d2d2d`:`#EEF1F5`,gridBg:e?`#1e1e1e`:`#ffffff`,lineColor:e?`rgba(255, 255, 255, 0.1)`:`rgba(128, 128, 128, 0.2)`,textColor:e?`#ffffff`:`#000000`}),W=(e,t)=>({...e,backgroundColor:t.timelineHeaderBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor},scales:e?.scales?.map(e=>({...e,style:{...e.style,color:t.textColor}}))}),G=(e,t)=>({...e,backgroundColor:t.gridBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor}}),K=(e,t,n,r)=>({...e,records:t,underlayBackgroundColor:r.underlayBackgroundColor,taskListTable:{...e.taskListTable,theme:n},timelineHeader:W(e.timelineHeader,r),grid:G(e.grid,r)}),q=e=>{e.on(`click_cell`,e=>{let{record:t,event:n}=e||{};t&&k(`taskClick`,t,n)}),e.on(`change_data`,e=>{let{record:t,changes:n}=e||{};t&&n&&k(`taskChange`,t,n)})},J=async()=>{let e=A.value;if(!e||F)return;let t=++N;try{let{Gantt:n}=await import(`@visactor/vtable-gantt`),{themes:r}=await import(`@visactor/vtable`);if(!L(t,e))return;let i=O.theme===`dark`,a=R(S[O.preset]||S.basic,O.options),o=H(O.data||[]);j.value&&j.value.release();let s=new n(e,K(a,o,i?r.DARK:r.DEFAULT,U(i)));if(!L(t,e)){s.release();return}j.value=s,q(s),k(`ganttCreated`,s)}catch(e){console.error(`甘特图初始化失败:`,e)}},Y=async()=>{if(A.value)try{document.fullscreenElement?(await document.exitFullscreen(),M.value=!1):(await A.value.requestFullscreen(),M.value=!0),setTimeout(()=>j.value?.resize?.(),100)}catch(e){console.warn(`全屏切换失败:`,e),M.value=!M.value,u(()=>j.value?.resize?.())}},X=()=>{M.value=!!document.fullscreenElement,u(()=>j.value?.resize?.())},Z=e=>{if(j.value&&e)try{j.value.setRecords(H(e))}catch(e){console.warn(`更新数据失败:`,e)}},Q=e=>{if(j.value&&e)try{j.value.updateOption(e)}catch(e){console.warn(`更新配置失败:`,e)}},$=()=>{if(j.value)try{j.value.release()}catch(e){console.warn(`销毁甘特图失败:`,e)}finally{j.value=void 0}};return v(()=>O.data,e=>{e&&j.value&&Z(e)},{deep:!0}),v(()=>[O.options,O.preset],()=>u(()=>J()),{deep:!0}),v(()=>O.theme,()=>u(()=>J())),f(()=>{F=!1,document.addEventListener(`fullscreenchange`,X),u(()=>{F||(P=setTimeout(()=>J(),100))})}),p(()=>{F=!0,N+=1,P&&clearTimeout(P),document.removeEventListener(`fullscreenchange`,X),$()}),l({ganttInstance:j,updateData:Z,updateOptions:Q,toggleFullscreen:Y}),(n,l)=>(m(),a(`div`,C,[t.showToolbar?(m(),a(`div`,w,[o(`div`,T,[o(`span`,E,g(t.title||`甘特图`),1)]),o(`div`,D,[t.showFullscreenButton?(m(),r(_(b),{key:0,size:`small`,onClick:Y},{icon:y(()=>[c(e,{name:M.value?`carbon:minimize`:`carbon:maximize`,size:16,color:`currentColor`},null,8,[`name`])]),default:y(()=>[s(` `+g(M.value?`退出全屏`:`全屏`),1)]),_:1})):i(`v-if`,!0)])])):i(`v-if`,!0),o(`div`,{ref_key:`ganttContainerRef`,ref:A,class:`gantt-container`,style:d({height:I.value})},null,4)]))}}),[[`__scopeId`,`data-v-cadc6c9b`]]);export{S as n,O as t};
|
package/dist/constants2.d.cts
CHANGED
|
@@ -124,10 +124,10 @@ declare const __VLS_export: vue.DefineComponent<FormulaEditorProps, FormulaEdito
|
|
|
124
124
|
modelValue: string;
|
|
125
125
|
placeholder: string;
|
|
126
126
|
disabled: boolean;
|
|
127
|
-
showPreview: boolean;
|
|
128
127
|
variables: FormulaVariable[];
|
|
129
128
|
functions: FormulaFunction[];
|
|
130
129
|
sampleData: Record<string, number | string | boolean>;
|
|
130
|
+
showPreview: boolean;
|
|
131
131
|
showKeyboard: boolean;
|
|
132
132
|
showVariablePanel: boolean;
|
|
133
133
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
package/dist/constants2.d.ts
CHANGED
|
@@ -124,10 +124,10 @@ declare const __VLS_export: vue.DefineComponent<FormulaEditorProps, FormulaEdito
|
|
|
124
124
|
modelValue: string;
|
|
125
125
|
placeholder: string;
|
|
126
126
|
disabled: boolean;
|
|
127
|
-
showPreview: boolean;
|
|
128
127
|
variables: FormulaVariable[];
|
|
129
128
|
functions: FormulaFunction[];
|
|
130
129
|
sampleData: Record<string, number | string | boolean>;
|
|
130
|
+
showPreview: boolean;
|
|
131
131
|
showKeyboard: boolean;
|
|
132
132
|
showVariablePanel: boolean;
|
|
133
133
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
package/dist/constants3.d.cts
CHANGED
|
@@ -172,11 +172,11 @@ declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, Notific
|
|
|
172
172
|
onNewMessage?: ((message: NotificationMessage) => any) | undefined;
|
|
173
173
|
onNavigate?: ((url: string) => any) | undefined;
|
|
174
174
|
}>, {
|
|
175
|
+
storageKey: string;
|
|
175
176
|
desktopNotification: boolean;
|
|
176
177
|
maxBadgeCount: number;
|
|
177
178
|
pollingInterval: number;
|
|
178
179
|
pageSize: number;
|
|
179
|
-
storageKey: string;
|
|
180
180
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
181
181
|
declare const _default: typeof __VLS_export;
|
|
182
182
|
//#endregion
|
|
@@ -221,7 +221,7 @@ declare function useNotificationCore(props: NotificationCenterProps): {
|
|
|
221
221
|
actionText?: string | undefined;
|
|
222
222
|
extra?: Record<string, unknown> | undefined;
|
|
223
223
|
}[]>;
|
|
224
|
-
activeCategory: vue.Ref<
|
|
224
|
+
activeCategory: vue.Ref<"all" | NotificationCategory, "all" | NotificationCategory>;
|
|
225
225
|
loading: vue.Ref<boolean, boolean>;
|
|
226
226
|
total: vue.Ref<number, number>;
|
|
227
227
|
page: vue.Ref<number, number>;
|
package/dist/constants3.d.ts
CHANGED
|
@@ -172,11 +172,11 @@ declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, Notific
|
|
|
172
172
|
onNewMessage?: ((message: NotificationMessage) => any) | undefined;
|
|
173
173
|
onNavigate?: ((url: string) => any) | undefined;
|
|
174
174
|
}>, {
|
|
175
|
+
storageKey: string;
|
|
175
176
|
desktopNotification: boolean;
|
|
176
177
|
maxBadgeCount: number;
|
|
177
178
|
pollingInterval: number;
|
|
178
179
|
pageSize: number;
|
|
179
|
-
storageKey: string;
|
|
180
180
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
181
181
|
declare const _default: typeof __VLS_export;
|
|
182
182
|
//#endregion
|
|
@@ -221,7 +221,7 @@ declare function useNotificationCore(props: NotificationCenterProps): {
|
|
|
221
221
|
actionText?: string | undefined;
|
|
222
222
|
extra?: Record<string, unknown> | undefined;
|
|
223
223
|
}[]>;
|
|
224
|
-
activeCategory: vue.Ref<
|
|
224
|
+
activeCategory: vue.Ref<"all" | NotificationCategory, "all" | NotificationCategory>;
|
|
225
225
|
loading: vue.Ref<boolean, boolean>;
|
|
226
226
|
total: vue.Ref<number, number>;
|
|
227
227
|
page: vue.Ref<number, number>;
|
package/dist/constants4.d.cts
CHANGED
|
@@ -198,29 +198,29 @@ type __VLS_Slots = {} & {
|
|
|
198
198
|
declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
199
199
|
error: (file: UploadFileItem, error: Error) => any;
|
|
200
200
|
change: (fileList: UploadFileItem[]) => any;
|
|
201
|
-
progress: (file: UploadFileItem, percent: number) => any;
|
|
202
201
|
success: (file: UploadFileItem, response: unknown) => any;
|
|
202
|
+
progress: (file: UploadFileItem, percent: number) => any;
|
|
203
203
|
remove: (file: UploadFileItem) => any;
|
|
204
204
|
finish: (fileList: UploadFileItem[]) => any;
|
|
205
205
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
206
206
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
207
207
|
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
208
208
|
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
209
|
-
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
210
209
|
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
210
|
+
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
211
211
|
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
212
212
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
213
213
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
214
214
|
}>, {
|
|
215
|
-
data: Record<string, unknown>;
|
|
216
215
|
disabled: boolean;
|
|
217
216
|
multiple: boolean;
|
|
218
|
-
maxSize: number;
|
|
219
217
|
draggable: boolean;
|
|
220
218
|
action: string;
|
|
221
219
|
headers: Record<string, string>;
|
|
220
|
+
data: Record<string, unknown>;
|
|
222
221
|
directory: boolean;
|
|
223
222
|
accept: string;
|
|
223
|
+
maxSize: number;
|
|
224
224
|
maxCount: number;
|
|
225
225
|
pasteable: boolean;
|
|
226
226
|
chunked: boolean;
|
package/dist/constants4.d.ts
CHANGED
|
@@ -198,29 +198,29 @@ type __VLS_Slots = {} & {
|
|
|
198
198
|
declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
199
199
|
error: (file: UploadFileItem, error: Error) => any;
|
|
200
200
|
change: (fileList: UploadFileItem[]) => any;
|
|
201
|
-
progress: (file: UploadFileItem, percent: number) => any;
|
|
202
201
|
success: (file: UploadFileItem, response: unknown) => any;
|
|
202
|
+
progress: (file: UploadFileItem, percent: number) => any;
|
|
203
203
|
remove: (file: UploadFileItem) => any;
|
|
204
204
|
finish: (fileList: UploadFileItem[]) => any;
|
|
205
205
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
206
206
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
207
207
|
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
208
208
|
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
209
|
-
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
210
209
|
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
210
|
+
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
211
211
|
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
212
212
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
213
213
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
214
214
|
}>, {
|
|
215
|
-
data: Record<string, unknown>;
|
|
216
215
|
disabled: boolean;
|
|
217
216
|
multiple: boolean;
|
|
218
|
-
maxSize: number;
|
|
219
217
|
draggable: boolean;
|
|
220
218
|
action: string;
|
|
221
219
|
headers: Record<string, string>;
|
|
220
|
+
data: Record<string, unknown>;
|
|
222
221
|
directory: boolean;
|
|
223
222
|
accept: string;
|
|
223
|
+
maxSize: number;
|
|
224
224
|
maxCount: number;
|
|
225
225
|
pasteable: boolean;
|
|
226
226
|
chunked: boolean;
|
package/dist/constants5.d.cts
CHANGED
|
@@ -258,11 +258,11 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
|
|
|
258
258
|
//#endregion
|
|
259
259
|
//#region src/components/C_VideoPlayer/index.vue.d.ts
|
|
260
260
|
declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
261
|
-
ready: () => any;
|
|
262
261
|
error: (error: Error) => any;
|
|
263
|
-
|
|
262
|
+
ready: () => any;
|
|
264
263
|
stateChange: (state: PlayerState) => any;
|
|
265
264
|
timeUpdate: (currentTime: number, duration: number) => any;
|
|
265
|
+
ended: () => any;
|
|
266
266
|
qualityChange: (quality: QualityLevel) => any;
|
|
267
267
|
rateChange: (rate: number) => any;
|
|
268
268
|
fullscreenChange: (isFullscreen: boolean) => any;
|
|
@@ -271,11 +271,11 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
|
|
|
271
271
|
chapterChange: (chapter: Chapter) => any;
|
|
272
272
|
progressUpdate: (data: ProgressData) => any;
|
|
273
273
|
}, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
|
|
274
|
-
onReady?: (() => any) | undefined;
|
|
275
274
|
onError?: ((error: Error) => any) | undefined;
|
|
276
|
-
|
|
275
|
+
onReady?: (() => any) | undefined;
|
|
277
276
|
onStateChange?: ((state: PlayerState) => any) | undefined;
|
|
278
277
|
onTimeUpdate?: ((currentTime: number, duration: number) => any) | undefined;
|
|
278
|
+
onEnded?: (() => any) | undefined;
|
|
279
279
|
onQualityChange?: ((quality: QualityLevel) => any) | undefined;
|
|
280
280
|
onRateChange?: ((rate: number) => any) | undefined;
|
|
281
281
|
onFullscreenChange?: ((isFullscreen: boolean) => any) | undefined;
|
package/dist/constants5.d.ts
CHANGED
|
@@ -258,11 +258,11 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
|
|
|
258
258
|
//#endregion
|
|
259
259
|
//#region src/components/C_VideoPlayer/index.vue.d.ts
|
|
260
260
|
declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
261
|
-
ready: () => any;
|
|
262
261
|
error: (error: Error) => any;
|
|
263
|
-
|
|
262
|
+
ready: () => any;
|
|
264
263
|
stateChange: (state: PlayerState) => any;
|
|
265
264
|
timeUpdate: (currentTime: number, duration: number) => any;
|
|
265
|
+
ended: () => any;
|
|
266
266
|
qualityChange: (quality: QualityLevel) => any;
|
|
267
267
|
rateChange: (rate: number) => any;
|
|
268
268
|
fullscreenChange: (isFullscreen: boolean) => any;
|
|
@@ -271,11 +271,11 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
|
|
|
271
271
|
chapterChange: (chapter: Chapter) => any;
|
|
272
272
|
progressUpdate: (data: ProgressData) => any;
|
|
273
273
|
}, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
|
|
274
|
-
onReady?: (() => any) | undefined;
|
|
275
274
|
onError?: ((error: Error) => any) | undefined;
|
|
276
|
-
|
|
275
|
+
onReady?: (() => any) | undefined;
|
|
277
276
|
onStateChange?: ((state: PlayerState) => any) | undefined;
|
|
278
277
|
onTimeUpdate?: ((currentTime: number, duration: number) => any) | undefined;
|
|
278
|
+
onEnded?: (() => any) | undefined;
|
|
279
279
|
onQualityChange?: ((quality: QualityLevel) => any) | undefined;
|
|
280
280
|
onRateChange?: ((rate: number) => any) | undefined;
|
|
281
281
|
onFullscreenChange?: ((isFullscreen: boolean) => any) | undefined;
|
package/dist/index.vue.d.cts
CHANGED
|
@@ -63,10 +63,10 @@ declare const __VLS_base: vue.DefineComponent<TableActionsProps, {}, {}, {}, {},
|
|
|
63
63
|
"onDropdown-click"?: ((item: ActionDropdownItem, action: ActionItem) => any) | undefined;
|
|
64
64
|
"onAction-click"?: ((action: ActionItem) => any) | undefined;
|
|
65
65
|
}>, {
|
|
66
|
+
config: ActionBarConfig;
|
|
66
67
|
actions: ActionItem[];
|
|
67
68
|
leftActions: ActionItem[];
|
|
68
69
|
rightActions: ActionItem[];
|
|
69
|
-
config: ActionBarConfig;
|
|
70
70
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
71
71
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
72
72
|
declare const _default: typeof __VLS_export;
|
package/dist/index.vue.d.ts
CHANGED
|
@@ -63,10 +63,10 @@ declare const __VLS_base: vue.DefineComponent<TableActionsProps, {}, {}, {}, {},
|
|
|
63
63
|
"onDropdown-click"?: ((item: ActionDropdownItem, action: ActionItem) => any) | undefined;
|
|
64
64
|
"onAction-click"?: ((action: ActionItem) => any) | undefined;
|
|
65
65
|
}>, {
|
|
66
|
+
config: ActionBarConfig;
|
|
66
67
|
actions: ActionItem[];
|
|
67
68
|
leftActions: ActionItem[];
|
|
68
69
|
rightActions: ActionItem[];
|
|
69
|
-
config: ActionBarConfig;
|
|
70
70
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
71
71
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
72
72
|
declare const _default: typeof __VLS_export;
|