cnhis-design-vue 3.1.48-beta.0 → 3.1.48-release.0
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/README.md +87 -87
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/index.d.ts +68 -18
- package/es/components/scale-view/src/ScaleView.vue.d.ts +68 -18
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +53 -0
- package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +1 -1
- package/es/components/scale-view/src/components/EvaluatePage.vue.d.ts +1 -1
- package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.d.ts +5 -0
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-methods.d.ts +8 -0
- package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -0
- package/es/components/scale-view/src/hooks/scaleview-props.d.ts +102 -0
- package/es/components/scale-view/src/hooks/scaleview-props.js +1 -0
- package/es/components/scale-view/src/hooks/scaleview-state.d.ts +1 -0
- package/es/components/scale-view/src/hooks/scaleview-state.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.d.ts +4 -0
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/utils/judge-types.d.ts +8 -0
- package/es/components/scale-view/src/utils/judge-types.js +1 -1
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
- package/es/shared/utils/tapableLess.d.ts +0 -28
- package/es/shared/utils/tapableLess.js +0 -1
package/README.md
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
# 安装
|
|
2
|
-
|
|
3
|
-
```shell
|
|
4
|
-
npm i cnhis-design-vue@[版本号]
|
|
5
|
-
# or
|
|
6
|
-
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## 1.全局引入
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
// main.ts
|
|
13
|
-
import { createApp } from 'vue';
|
|
14
|
-
import App from './App.vue';
|
|
15
|
-
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
-
import cui from 'cnhis-design-vue';
|
|
17
|
-
|
|
18
|
-
const app = createApp(App);
|
|
19
|
-
app.use(cui).mount('#app');
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## 2. 按需引入
|
|
23
|
-
|
|
24
|
-
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
-
|
|
26
|
-
### 2.1 样式处理方式1 (按需引入样式)
|
|
27
|
-
|
|
28
|
-
```shell
|
|
29
|
-
# 安装自动导入样式的插件
|
|
30
|
-
npm i -d vite-plugin-style-import
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
// vite.config.ts
|
|
35
|
-
import { defineConfig } from 'vite';
|
|
36
|
-
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
-
|
|
38
|
-
export default defineConfig({
|
|
39
|
-
plugins: [
|
|
40
|
-
// ...otherPlugins
|
|
41
|
-
createStyleImportPlugin({
|
|
42
|
-
libs: [
|
|
43
|
-
{
|
|
44
|
-
libraryName: 'cnhis-design-vue',
|
|
45
|
-
esModule: true,
|
|
46
|
-
ensureStyleFile: true,
|
|
47
|
-
resolveStyle: name => {
|
|
48
|
-
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 2.2 样式处理方式2 (全局引入样式)
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
// main.ts
|
|
61
|
-
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## 3.FAQ
|
|
65
|
-
|
|
66
|
-
### 3.1 项目打包后样式丢失
|
|
67
|
-
|
|
68
|
-
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
// vite.config.ts
|
|
72
|
-
import { defineConfig } from 'vite';
|
|
73
|
-
|
|
74
|
-
export default defineConfig({
|
|
75
|
-
build: {
|
|
76
|
-
rollupOptions: {
|
|
77
|
-
// ..otherOptions
|
|
78
|
-
output: {
|
|
79
|
-
dir: './dist',
|
|
80
|
-
manualChunks: {
|
|
81
|
-
'cnhis-vendor': ['cnhis-design-vue']
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
```
|
|
1
|
+
# 安装
|
|
2
|
+
|
|
3
|
+
```shell
|
|
4
|
+
npm i cnhis-design-vue@[版本号]
|
|
5
|
+
# or
|
|
6
|
+
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## 1.全局引入
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
// main.ts
|
|
13
|
+
import { createApp } from 'vue';
|
|
14
|
+
import App from './App.vue';
|
|
15
|
+
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
+
import cui from 'cnhis-design-vue';
|
|
17
|
+
|
|
18
|
+
const app = createApp(App);
|
|
19
|
+
app.use(cui).mount('#app');
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 2. 按需引入
|
|
23
|
+
|
|
24
|
+
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
+
|
|
26
|
+
### 2.1 样式处理方式1 (按需引入样式)
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
# 安装自动导入样式的插件
|
|
30
|
+
npm i -d vite-plugin-style-import
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// vite.config.ts
|
|
35
|
+
import { defineConfig } from 'vite';
|
|
36
|
+
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
+
|
|
38
|
+
export default defineConfig({
|
|
39
|
+
plugins: [
|
|
40
|
+
// ...otherPlugins
|
|
41
|
+
createStyleImportPlugin({
|
|
42
|
+
libs: [
|
|
43
|
+
{
|
|
44
|
+
libraryName: 'cnhis-design-vue',
|
|
45
|
+
esModule: true,
|
|
46
|
+
ensureStyleFile: true,
|
|
47
|
+
resolveStyle: name => {
|
|
48
|
+
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 2.2 样式处理方式2 (全局引入样式)
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// main.ts
|
|
61
|
+
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 3.FAQ
|
|
65
|
+
|
|
66
|
+
### 3.1 项目打包后样式丢失
|
|
67
|
+
|
|
68
|
+
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// vite.config.ts
|
|
72
|
+
import { defineConfig } from 'vite';
|
|
73
|
+
|
|
74
|
+
export default defineConfig({
|
|
75
|
+
build: {
|
|
76
|
+
rollupOptions: {
|
|
77
|
+
// ..otherOptions
|
|
78
|
+
output: {
|
|
79
|
+
dir: './dist',
|
|
80
|
+
manualChunks: {
|
|
81
|
+
'cnhis-vendor': ['cnhis-design-vue']
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{drawLine as
|
|
1
|
+
import{drawLine as t,drawPoint as e}from"../useDraw.js";import{useGrid as o}from"../useGrid.js";import{useBirthProcessCumputedPoint as n}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import{getIndex as i,isEffectiveNode as l,getTime as s}from"../../utils/index.js";import{cloneDeep as r}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function a(a,u,c,d,f){const{cumputedX:p,cumputedY:v,getXValue:m,getYValue:h}=n(u),{left:g,xCellWidth:y,yCellHeight:x,originX:L,endX:k,originY:b,endY:j,itemList:P,event:w,canvasHeight:C,scaleValues:E,xAxis:X,startTime:Y}=u,$=new Set,A=r(E);function M(o,n,l){var s;const{type:r,unit:f,dataList:p=[]}=l,v=[],g=[];null==(s=o.list)||s.forEach(((s,p)=>{!function(o,s,p,y){let x,P;const{pointAttr:C={},lineAttr:E={},title:X="",key:Y,type:H="circle"}=y,I=D(y.list[p+1],l);o&&I&&!s.breakpoint&&o[0]!==I[0]&&(P=t([...o,...I],{...E}));const S=g[p-1],z={origin:{data:s,title:X,key:Y||"",unit:f,type:r,dataIndex:n,index:p},leftLine:S,rightLine:P,...C,...u.event.hovered?u.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:u.event};S?x=e(H,{left:S.get("x2"),top:S.get("y2"),...z}):o&&(z.leftLine=null,x=e(H,{left:o[0],top:o[1],...z}));g.push(P),x&&(!function(t){w.hovered&&(t.on("mouseover",(()=>{V(t,"hover")})),t.on("mouseout",(()=>{d.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{!function(t){t.setCoords();const e=t.prevPoint?t.prevPoint.left:L,o=t.nextPoint?t.nextPoint.left:k;t.top<b&&t.set("top",b),t.top>j&&t.set("top",j),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}(t),function(t){var e,o;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top})}(t),w.hovered&&V(t)})),t.on("mouseup",(e=>{if(d.show=!1,1===e.button){const{key:e,type:o}=t.origin,n={...t.origin,data:{...t.origin.data,time:m(t.left),value:h(o,t.top)}};a.value.discardActiveObject(),c("change",n),function(t,e="add"){const{dataIndex:o,data:n,index:l,key:s,type:r}=t,u=A.find((t=>t.type===r)),c=u.dataList.find((t=>t.key===s));switch(e){case"remove":c.list.splice(l,1);break;case"change":c.list[l]=n;break;default:{const t=i(n.time,c.data);c.list.splice(t,0,n);break}}!function(){var t;$.size&&(null==(t=a.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine)})),e}([...$]))),$.clear(),A.forEach((t=>{t.dataList.forEach(((e,o)=>{M(e,o,t)}))}))}()}(n,"change")}}))}(x),v.push(x),$.add(x))}(D(s,l),s,p,o)})),Promise.all(v).then((t=>{const e=g.filter((t=>t));let o=null;t=t.map((t=>(t&&o&&(o.nextPoint=t,t.prevPoint=o),o=t||o,t))),a.value.add(...e,...t)}))}function V(t,e="moving"){const{title:o,type:n,data:i,unit:l}=t.origin;d.point={x:t.left,y:t.top};const s=`${"hover"===e?i.value:h(n,t.top)}`;d.list=[`${o} ${s}${l||""}`,`时间 ${m(t.left).slice(-5)}`],d.show=!0}function D(t,e){if(l(t)&&function(t){const e=Date.parse(X.list.at(-1)),o=s(t);return o>=Y&&o<=e}(t.time)){const o=p(t.time),n=v(e.type,e.range,t.value);return[o,n<b?b:n>j?j:n]}}o(a,u),A.forEach((t=>{t.dataList.forEach(((e,o)=>{M(e,o,t)}))}))}export{a as useCenter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as t,createVNode as o,toRaw as i,h as n,onBeforeUnmount as a}from"vue";import{traverse as r}from"../../../../../../../shared/utils/index.js";import{isFunction as s,isObject as d,range as l}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as u,InjectionIhoTableUUID as c}from"../../../../constants/index.js";import{useAutoFocus as p}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as f,IhoTableRenderHelper as m,getRowHeight as v,getColumnRenderWidth as h,parseMergeField as A}from"../../../../utils/index.js";import{contentSeparate as E,getColumnInfoMaxLength as g,generateSeparateRowData as k,isSeparateColumn as _}from"./separateUtils.js";import b from"./editSeparate.vue.js";import{defineTablePlugin as x}from"../../../../hooks/useTablePlugin.js";function w(){const w="separateRendererPlugins",T=e(new Map);function P(e,t){var o;return null==(o=T.get(e))?void 0:o.get(t)}function R(e,t,o){const i=T.get(e)||new WeakMap;T.set(e,i),i.set(t,o)}const S=e(new Map);return x({name:w,vxe(e){e.interceptor.add("event.clearActived",f(u.SEPARATE,(e=>e.classList.contains("v-binder-follower-content")))),e.renderer.add(u.SEPARATE,{renderCell(e,{column:i,row:n}){const a=(P(t(c),n)||{separateData:{}}).separateData[i.field];return o("section",{class:"iho-table__ellipsis",title:a},[a])},renderEdit:m.createRenderEdit((({fieldItem:e,column:a,row:r,emitFormClick:l})=>{var u,p,f;const m=P(t(c),r),h=v(),A={};let E=null!=(p=null==(u=e.componentProps)?void 0:u.separateSlot)?p:e.separateSlot;return E&&(E=i(E),A.menu=s(E)?E:d(E)?e=>n(E,e):void 0),[o(b,{value:r[a.field],"onUpdate:value":e=>r[a.field]=e,"row-index":null==m?void 0:m.index,height:h,column:a,row:r,"display-content":null==(f=null==m?void 0:m.separateData)?void 0:f[a.field],onClick:l},A)]}))})},apply(e){function t(e){return(...t)=>{var o;return!(null==(o=t[0].row)?void 0:o.$__SEPARATE)&&(!s(e)||e(...t))}}p(e).bindAutoFocusConfig(w,u.SEPARATE,".iho-table__separateText"),e.fieldHooks.fieldList.tap(w,((e,{uuid:t})=>(t&&S.set(t,e.reduce(((e,t)=>(r(t,(t=>{_(t)&&
|
|
1
|
+
import{reactive as e,inject as t,createVNode as o,toRaw as i,h as n,onBeforeUnmount as a}from"vue";import{traverse as r}from"../../../../../../../shared/utils/index.js";import{isFunction as s,isObject as d,range as l}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as u,InjectionIhoTableUUID as c}from"../../../../constants/index.js";import{useAutoFocus as p}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as f,IhoTableRenderHelper as m,getRowHeight as v,getColumnRenderWidth as h,parseMergeField as A}from"../../../../utils/index.js";import{contentSeparate as E,getColumnInfoMaxLength as g,generateSeparateRowData as k,isSeparateColumn as _}from"./separateUtils.js";import b from"./editSeparate.vue.js";import{defineTablePlugin as x}from"../../../../hooks/useTablePlugin.js";function w(){const w="separateRendererPlugins",T=e(new Map);function P(e,t){var o;return null==(o=T.get(e))?void 0:o.get(t)}function R(e,t,o){const i=T.get(e)||new WeakMap;T.set(e,i),i.set(t,o)}const S=e(new Map);return x({name:w,vxe(e){e.interceptor.add("event.clearActived",f(u.SEPARATE,(e=>e.classList.contains("v-binder-follower-content")))),e.renderer.add(u.SEPARATE,{renderCell(e,{column:i,row:n}){const a=(P(t(c),n)||{separateData:{}}).separateData[i.field];return o("section",{class:"iho-table__ellipsis",title:a},[a])},renderEdit:m.createRenderEdit((({fieldItem:e,column:a,row:r,emitFormClick:l})=>{var u,p,f;const m=P(t(c),r),h=v(),A={};let E=null!=(p=null==(u=e.componentProps)?void 0:u.separateSlot)?p:e.separateSlot;return E&&(E=i(E),A.menu=s(E)?E:d(E)?e=>n(E,e):void 0),[o(b,{value:r[a.field],"onUpdate:value":e=>r[a.field]=e,"row-index":null==m?void 0:m.index,height:h,column:a,row:r,"display-content":null==(f=null==m?void 0:m.separateData)?void 0:f[a.field],onClick:l},A)]}))})},apply(e){function t(e){return(...t)=>{var o;return!(null==(o=t[0].row)?void 0:o.$__SEPARATE)&&(!s(e)||e(...t))}}p(e).bindAutoFocusConfig(w,u.SEPARATE,".iho-table__separateText"),e.fieldHooks.fieldList.tap(w,((e,{uuid:t})=>(t&&S.set(t,e.reduce(((e,t)=>(r(t,(t=>{_(t)&&e.push(i(t)),t.showOverflow="ellipsis"})),e)),[])),e))),e.dataHooks.data.tapPromise(w,(async(e,t,{insertAfter:o,index:i,$table:n})=>{if(!t.uuid)return;const a=S.get(t.uuid);if(!a||!a.length)return;const r=[];for(const t of a){if(!t.field)continue;const o=await h(t,n);r.push({field:t.field,data:E(A(e,t),t,o)})}l(g(r)).forEach(((n,a)=>{const s=k(r,a);if(0===a)return R(t.uuid,e,{index:i,separateData:s}),void(e.$__SEPARATE_DATA=[s]);const d={$__SEPARATE:!0};R(t.uuid,d,{index:i,separateData:s}),e.$__SEPARATE_DATA.push(s),o(d)}))})),e.eventHooks.onResizableChange.tap(w,(async({column:e},t,o)=>{_(e)&&o.updateTableDataRef()})),e.configHooks.editConfig.tap(w,((e={},o)=>(e.beforeEditMethod=t(e.beforeEditMethod),e))),e.configHooks.checkboxConfig.tap(w,((e={},o)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(w,(e=>{a((()=>{e.value.uuid&&(T.delete(e.value.uuid),S.delete(e.value.uuid))}))}))}})}export{w as separateRendererPlugins};
|