cnhis-design-vue 3.2.3-beta.7 → 3.2.3-beta.9
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/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/calendar/index.d.ts +11 -2
- package/es/components/calendar/src/Calendar.vue.d.ts +11 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +28 -0
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/classification/src/index.vue.d.ts +3 -3
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/Row.vue.d.ts +1 -1
- package/es/components/form-config/index.d.ts +82 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +82 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +28 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +40 -0
- package/es/components/form-render/index.d.ts +28 -0
- package/es/components/form-render/src/FormRender.vue.d.ts +28 -0
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +28 -0
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +129 -0
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +128 -0
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -0
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -0
- package/es/components/form-render/src/types/index.d.ts +2 -0
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +66 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +66 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +30 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +28 -0
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
- package/es/components/shortcut-setter/index.d.ts +30 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +30 -0
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/emoji/emotion_001.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_002.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_003.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_004.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_005.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_006.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_007.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_008.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_009.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_010.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_011.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_012.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_013.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_014.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_015.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_016.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_017.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_018.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_019.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_020.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_021.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_022.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_023.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_024.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_025.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_026.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_027.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_028.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_029.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_030.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_031.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_032.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_033.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_034.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_035.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_036.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_037.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_038.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_039.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_040.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_041.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_042.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_043.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_044.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_045.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_046.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_047.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_048.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_049.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_050.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_051.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_052.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_053.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_054.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_055.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_056.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_057.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_058.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_059.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_060.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_061.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_062.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_063.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_064.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_065.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_066.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_067.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_068.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_069.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_070.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_071.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_072.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_073.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_074.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_075.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_076.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_077.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_078.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_079.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_080.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_081.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_082.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_083.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_084.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_085.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_086.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_087.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_088.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_089.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_090.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_091.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_092.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_093.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_094.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_095.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_096.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_097.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_098.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_099.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_100.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_101.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_102.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_103.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_104.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_105.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_106.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_107.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_108.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_109.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_110.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_111.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_112.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_113.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_114.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_115.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_116.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_117.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_118.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_119.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_120.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_121.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_122.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_123.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_124.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_125.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_126.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_127.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_128.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_129.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_130.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_131.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_132.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_133.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_134.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_135.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_136.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_137.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_138.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_139.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_140.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_141.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_142.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_143.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_144.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_145.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_146.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_147.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_148.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_149.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_150.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_151.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_152.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_153.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_154.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_155.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_156.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_157.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_158.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_159.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_160.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_161.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_162.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_163.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_164.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_165.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_166.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_167.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_168.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_169.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_170.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_171.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_172.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_173.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_174.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_175.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_176.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_177.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_178.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_179.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_180.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_181.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_182.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_183.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_184.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_185.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_186.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_187.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_188.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_189.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_190.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_191.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_192.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_193.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_194.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_195.png.js +1 -1
- package/es/shared/assets/img/emoji/emotion_196.png.js +1 -1
- 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/table_style_2.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/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
- package/es/components/node_modules/naive-ui/node_modules/date-fns/docs/logo.svg +0 -26
- package/es/components/node_modules/naive-ui/node_modules/date-fns/docs/logotype.svg +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{defineComponent as t,ref as e,withDirectives as n,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as l,createVNode as
|
|
1
|
+
import{defineComponent as t,ref as e,withDirectives as n,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as l,createVNode as c,withCtx as r,createCommentVNode as u,Fragment as d,renderList as p,createBlock as f,createTextVNode as g,toDisplayString as m,vShow as h}from"vue";import{NPopover as v,NTooltip as y,NUpload as M,NUploadTrigger as k,NButton as T}from"naive-ui";import{format as x}from"date-fns";import{useState as C}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{images as E,alt as I}from"../utils/emoji.js";import{MESSAGE_TYPE as w}from"../constants/index.js";import{uploadFileApi as _}from"../api/index.js";const S={class:"tool-box"},j=l("span",null,[l("i",{class:"chat--iconfont chat--icon-face"})],-1),L={class:"emoji-box"},F=l("span",null,"默认表情",-1),K={class:"list-box"},D=["onClick"],H=["src"],J=[l("i",{class:"chat--iconfont chat--icon-good"},null,-1)],N=["onClick"],O=[l("i",{class:"chat--iconfont chat--icon-image"},null,-1)],A=["onClick"],G=[l("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],X={class:"btn-box"},z=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var B=t({__name:"ChatFooter",setup(t){const B=e(),R=e(""),{state:U,stompClient:q}=C(),{setCurrentSessionItem:P}=b(U);function Q(t){["Enter"].includes(t.key)&&(function(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}(t)||(t.preventDefault(),Y()))}function V(){var t,e;R.value=(null==(e=null==(t=B.value)?void 0:t.innerText)?void 0:e.trim())||""}async function W(t,e){console.log(W,t);const{file:n,name:s}=t.file,i=new FormData;i.append("sender",U.userInfo.id),i.append("file",n);const a=await _(i);if(!a)return console.log("上传失败");Z({chatMessageType:e,msg:e===w.FILE?s:a,url:a})}function Y(){if(!(R.value.length>2e3))return R.value?void Z({msg:R.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function Z(t){const{chatMessageType:e=w.TEXT,msg:n,url:s}=t,i={msg:n,chatMessageType:e};e===w.FILE&&(i.fileUrl=s),[w.TEXT,w.BLEND].includes(e)&&(B.value.innerHTML="",R.value="");const a=x(new Date,"yyyy-MM-dd HH:mm:ss");U.currentMsg={content:i,sender:U.userInfo.id,id:"",sendTime:a,sending:!0,fail:!1},U.isAppendMsg=!0,P({lastMessageSendTime:a,lastMessage:i.msg,sortTime:a,chatMessageType:i.chatMessageType}),U.isChangeSession=!0;try{q.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:U.currentSessionItem.receiver})),U.currentMsg={...U.currentMsg,fail:!1}}catch(t){U.currentMsg={...U.currentMsg,fail:!0}}finally{U.currentMsg={...U.currentMsg,sending:!1}}}return(t,e)=>n((s(),i("section",{class:"chat-footer",style:a({cursor:o(U).id?"default":"not-allowed"})},[l("div",S,[c(o(v),{placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show"},{trigger:r((()=>[j])),default:r((()=>[l("div",L,[u(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),F,l("div",K,[(s(!0),i(d,null,p(o(E),((t,e)=>(s(),i(d,{key:e},[e>0?(s(),f(o(y),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:r((()=>[l("i",{onClick:()=>Z({chatMessageType:o(w).EMOJI,msg:e})},[l("img",{src:t},null,8,H)],8,D)])),default:r((()=>[g(" "+m(o(I)[e-1]||"微笑"),1)])),_:2},1024)):u("v-if",!0)],64)))),128))])])])),_:1}),l("span",{onClick:e[0]||(e[0]=()=>Z({chatMessageType:o(w).EMOJI,msg:0}))},J),c(o(M),{abstract:"",multiple:"",accept:"image/*",onChange:e[1]||(e[1]=t=>W(t,o(w).IMAGE))},{default:r((()=>[c(o(k),{abstract:""},{default:r((({handleClick:t})=>[l("span",{onClick:t},O,8,N)])),_:1})])),_:1}),c(o(M),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:e[2]||(e[2]=t=>W(t,o(w).FILE))},{default:r((()=>[c(o(k),{abstract:""},{default:r((({handleClick:t})=>[l("span",{onClick:t},G,8,A)])),_:1})])),_:1})]),n(l("div",{ref_key:"inputRef",ref:B,class:"input-box",contenteditable:"",onKeydown:Q,onInput:V},null,544),[[h,o(U).id]]),l("div",X,[z,c(o(T),{type:"primary",round:"",disabled:!R.value,onClick:Y},{default:r((()=>[g("发送")])),_:1},8,["disabled"])])],4)),[[h,o(U).id]])}});export{B as default};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/Viewer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/features/modeling';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'diagram-js/lib/navigation/movecanvas';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="date-fns" />
|
|
2
|
-
/// <reference types="../../components/node_modules/naive-ui/node_modules/date-fns/typings" />
|
|
3
2
|
import { SFCWithInstall } from '../../shared/types';
|
|
4
3
|
export * from './src/types';
|
|
5
4
|
declare const Calendar: SFCWithInstall<import("vue").DefineComponent<{
|
|
@@ -229,7 +228,17 @@ declare const Calendar: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
229
228
|
NIcon: any;
|
|
230
229
|
ChevronBackOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
231
230
|
ChevronForwardOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
232
|
-
FullCalendar:
|
|
231
|
+
FullCalendar: import("vue").DefineComponent<{
|
|
232
|
+
options: import("vue").PropType<import("@fullcalendar/core/internal-common").a>;
|
|
233
|
+
}, unknown, {
|
|
234
|
+
renderId: number;
|
|
235
|
+
customRenderingMap: Map<string, import("@fullcalendar/core/internal-common").eF<any>>;
|
|
236
|
+
}, {}, {
|
|
237
|
+
getApi(): import("@fullcalendar/core").Calendar;
|
|
238
|
+
buildOptions(suppliedOptions: import("@fullcalendar/core/internal-common").a | undefined): import("@fullcalendar/core/internal-common").a;
|
|
239
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
240
|
+
options: import("vue").PropType<import("@fullcalendar/core/internal-common").a>;
|
|
241
|
+
}>>, {}>;
|
|
233
242
|
isSameDay: typeof import("date-fns").isSameDay;
|
|
234
243
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange")[], "select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
235
244
|
showDateNavigation: {
|
|
@@ -221,7 +221,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
221
221
|
NIcon: any;
|
|
222
222
|
ChevronBackOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
223
223
|
ChevronForwardOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
224
|
-
FullCalendar:
|
|
224
|
+
FullCalendar: import("vue").DefineComponent<{
|
|
225
|
+
options: PropType<import("@fullcalendar/core/internal-common").a>;
|
|
226
|
+
}, unknown, {
|
|
227
|
+
renderId: number;
|
|
228
|
+
customRenderingMap: Map<string, import("@fullcalendar/core/internal-common").eF<any>>;
|
|
229
|
+
}, {}, {
|
|
230
|
+
getApi(): import("@fullcalendar/core").Calendar;
|
|
231
|
+
buildOptions(suppliedOptions: import("@fullcalendar/core/internal-common").a | undefined): import("@fullcalendar/core/internal-common").a;
|
|
232
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
233
|
+
options: PropType<import("@fullcalendar/core/internal-common").a>;
|
|
234
|
+
}>>, {}>;
|
|
225
235
|
isSameDay: typeof isSameDay;
|
|
226
236
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange")[], "select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
227
237
|
showDateNavigation: {
|
|
@@ -178,6 +178,14 @@ export declare const CallbackMaps: Map<string, {
|
|
|
178
178
|
selectedFields: {
|
|
179
179
|
type: import("vue").PropType<string[]>;
|
|
180
180
|
};
|
|
181
|
+
linebarDirection: {
|
|
182
|
+
type: import("vue").PropType<"horizontal" | "vertical">;
|
|
183
|
+
default: string;
|
|
184
|
+
};
|
|
185
|
+
linebarWidth: {
|
|
186
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
187
|
+
default: number;
|
|
188
|
+
};
|
|
181
189
|
}, {
|
|
182
190
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
183
191
|
fieldList: {
|
|
@@ -352,6 +360,14 @@ export declare const CallbackMaps: Map<string, {
|
|
|
352
360
|
selectedFields: {
|
|
353
361
|
type: import("vue").PropType<string[]>;
|
|
354
362
|
};
|
|
363
|
+
linebarDirection: {
|
|
364
|
+
type: import("vue").PropType<"horizontal" | "vertical">;
|
|
365
|
+
default: string;
|
|
366
|
+
};
|
|
367
|
+
linebarWidth: {
|
|
368
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
369
|
+
default: number;
|
|
370
|
+
};
|
|
355
371
|
}>> & {
|
|
356
372
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
357
373
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
@@ -521,6 +537,8 @@ export declare const CallbackMaps: Map<string, {
|
|
|
521
537
|
wordSplitFilter: boolean;
|
|
522
538
|
selectMode: boolean;
|
|
523
539
|
selectedFields: string[];
|
|
540
|
+
linebarWidth: string | number;
|
|
541
|
+
linebarDirection: "horizontal" | "vertical";
|
|
524
542
|
}>) => Record<string, import("@formily/json-schema").Stringify<{
|
|
525
543
|
[key: symbol]: any;
|
|
526
544
|
[key: `x-${string}`]: any;
|
|
@@ -871,6 +889,14 @@ export declare const CallbackMaps: Map<string, {
|
|
|
871
889
|
selectedFields: {
|
|
872
890
|
type: import("vue").PropType<string[]>;
|
|
873
891
|
};
|
|
892
|
+
linebarDirection: {
|
|
893
|
+
type: import("vue").PropType<"horizontal" | "vertical">;
|
|
894
|
+
default: string;
|
|
895
|
+
};
|
|
896
|
+
linebarWidth: {
|
|
897
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
898
|
+
default: number;
|
|
899
|
+
};
|
|
874
900
|
}>> & {
|
|
875
901
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
876
902
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
@@ -894,6 +920,8 @@ export declare const CallbackMaps: Map<string, {
|
|
|
894
920
|
forceClearable: boolean;
|
|
895
921
|
wordSplitFilter: boolean;
|
|
896
922
|
selectMode: boolean;
|
|
923
|
+
linebarWidth: string | number;
|
|
924
|
+
linebarDirection: "horizontal" | "vertical";
|
|
897
925
|
operationalFormInit: boolean;
|
|
898
926
|
}>;
|
|
899
927
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
@@ -699,9 +699,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
699
699
|
handleInitConditions: () => Promise<void>;
|
|
700
700
|
validate: () => Promise<unknown>;
|
|
701
701
|
saveAdd: () => void;
|
|
702
|
-
/**
|
|
703
|
-
* 改变展示方式
|
|
704
|
-
*/
|
|
705
702
|
cancelSaveAdd: () => void;
|
|
706
703
|
checkActionList: () => boolean;
|
|
707
704
|
NSpin: any;
|
|
@@ -1450,6 +1447,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1450
1447
|
isSecondDisabled(second: number, minute: number | null, hour: number | null): boolean | 0;
|
|
1451
1448
|
};
|
|
1452
1449
|
NSelect: any;
|
|
1450
|
+
/**
|
|
1451
|
+
* 改变展示方式
|
|
1452
|
+
*/
|
|
1453
1453
|
NPopover: any;
|
|
1454
1454
|
CDatePicker: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
|
1455
1455
|
updateUnchangedValue: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as u,getType as a,isOverlapPoint as c,getFloorNumber as d,isValidValue as p,setOtherType as f,isEffectiveNode as h,getTime as v,getIndex as g,deleteProperty as y}from"../../utils/index.js";import{cloneDeep as m,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useCommon as j}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as w,PAIN_MENU as L,OVERLAP as k}from"../../constants/index.js";function S(S,E,M,$,O,P,C,A,I,R){r(S,E);const{getEqualXTypes:T,handleAddPrevent:V,getPointEventProps:X}=j(S,M,E),{createShadowLines:z}=t(),{left:D,xScaleList:F,xCellWidth:H,yCellHeight:_,originX:W,endX:q,originY:G,endY:B,itemList:J,event:K,vitalSignsOriginY:N,painOriginY:Q,hospitalizationDate:U,config:Z,canvasHeight:ee}=E,te=new Set,ie=["xinmai","mai"],ne=new Map,oe=new Set,le=new Set,se=new Set,re=m(D.yScaleValue);function ue(t){var o;const l=re.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(te.size&&S.value.remove(...te),te.clear(),ne.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ne.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ne)t.push(e[1]),e[0]===ie[0]&&e[1].forEach((e=>{(ne.get(ie[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),u=n[i],a=o[r],c=n[i-1],d=n[i+1],p=o[r-1],f=o[r+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&s.push(p);const h=Math.min(u[1],a[1]);l.push([u,a].find((e=>e[1]===h)));const v=Math.max(u[1],a[1]);s.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(s.push(f),g()):g()})),e}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...z(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),te.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...x(t)],{...r,originX:"center"});e.push(n),te.add(n)}))}S.value.add(...e)}te.add(l),S.value.add(l)}))}}function ae(){var e;const t=re.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},k,D.overlap||{}),l=[];oe.size&&[...oe].forEach((e=>{[...le].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{S.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),se.add(e)}))}))}function ce(e,t,r){var a;const{type:c,riseStyle:h={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:w={},dataList:L=[],list:k=[]}=r,{type:E,textStyle:$,showConnectLine:P=!1}=j,A=[],R=[],T=[];let V=null;if(null==(a=e.list)||a.forEach(((a,j)=>{const z=u(c)?L.find((e=>e.key===a.key)):e,D=fe(a,r),F=e.list[j+1],W=F?fe(F,r):void 0,q=F?u(c)?L.find((e=>e.key===F.key)):e:{},{title:G=""}=z;if("脉搏"===G&&"脉搏"!==q.title||"脉搏"!==G&&"脉搏"===q.title||!D||!W||d(D[0],1)!==d(W[0],1))D&&V&&(D[0]=V),V=null;else{const e=D[0]-H/2;D[0]=e+H/4,W[0]=V=D[0]+H/2}const B={};B.value=function(e,t,i){if(!(null==e?void 0:e.length)||!Z.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=N.originY+_?e[1]+_:e[1]-_,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return T.push(s),{obj:s,top:-_}}(D,a,z),function(e,t,r,u){var a,d;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:f={}}=r,{value:m}=u;let x,b,j,w,L;if(t.noRise&&v.show){const t=Y(v)?O(c,k,35):e[1];if(v.text)j=l([e[0],Y(v)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style});else{const i=t+2*_;j=s([e[0],t,i],{...v.style})}T.push(j)}t.rise&&h.show&&h.text&&(w=l([e[0],e[1]-(m?_:0)-5],{value:h.text.split("").join("\n"),originY:"bottom",...h.style}),T.push(w));t.verified&&(L=l([e[0],e[1]-(m?_:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),T.push(L));if(p(t.physicsReduce)||p(t.drugReduce)){const l=O(c,k,null!=(a=t.physicsReduce)?a:t.drugReduce),s=l<e[1]&&(null==Z?void 0:Z.hypothermyViewCustom)?e[0]+H/2:e[0];x=i([...e,s,l],{...f,...y.line,...n}),b=o((null==(d=null==y?void 0:y.point)?void 0:d.type)||"circle",{left:s,top:l,...y.point,...n,originY:l===ee?"bottom":"center"}),x&&T.push(x),b&&T.push(b)}Object.assign(u,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:v.text?5:2*_,isFixed:Y(v)},riseText:{obj:w,top:(m?-_:0)-5},verifiedText:{obj:L,top:(m?-_:0)-5},reducePoint:{obj:b,type:"reduce"}})}(D,a,z,B),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...k),r=Math.min(...k);let u,a,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*_,i=[e[1]-_/2,t];t<N.originY&&(t=e[1]+2.5*_,i=[t,e[1]+_/2]),u=s([e[0],i[0],i[1]],x,"up"),T.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=u?e[1]+_/2+u.height:e[1]+_;a=l([e[0],t],i),T.push(a)}+t.value<r&&(a=l([e[0],e[1]-_],i),T.push(a))}if(w.show&&+t.value<r){const t=e[1];if(w.text)d=l([e[0],e[1]+5],{value:w.text.split("").join("\n"),originY:"top",...w.style});else{const i=t+2*_;d=s([e[0],t,i],{...w.style})}T.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:a,top:-_},belowMinValue:{obj:d,top:w.text?5:2*_,moveHide:!0}})}(D,a,z,B),function(n,l,s,u,a,d){let p,h;const{pointAttr:v={},lineAttr:g={},title:y="",key:x,type:b="circle"}=a,j=e.list[u+1],w=de(c,e.list[u].value),L=l&&de(c,j.value);if(n&&l&&!s.breakpoint&&(!w&&!L||P)){h=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==Z?void 0:Z.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});T.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const k=s.pacemakerShow&&"pulse"==c?m.value:w&&"number"===E?0:b,Y=R[u-1],O={origin:{data:s,title:y,key:x||"",unit:r.unit,type:c,_type:f(y,c),dataIndex:t,index:u},leftLine:Y,rightLine:h,otherObj:d,...s.pacemakerShow&&"pulse"==c?m.style:v,lockMovementX:!0,...X(),...w?{selectable:!1,evented:!1,..."number"===E?$:{}}:{}};n&&(Y?O.leftLine.set("x2",n[0]):O.leftLine=null,p=o(k,{left:n[0],top:w?n[1]-5:n[1],...O}));R.push(h),p&&(y.includes("脉搏")?oe.add(p):le.add(p),function(e){K.hovered&&(e.on("mouseover",(()=>{pe(e,"hover")})),e.on("mouseout",(()=>{I.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?Q:N;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(S.value.remove(i),delete e.otherObj.obj)))})),ue(e)}(e),K.hovered&&pe(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=C(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};S.value.discardActiveObject(),M("change",n),ve(n,"change")}}))}(p),A.push(p),se.add(p))}(D,W,a,j,z,B)})),"pulse"===c){const e={};ie.forEach((t=>{e[t]=A.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t}))}));let t=null;ie.forEach((i=>{ne.set(i,e[i].map(((e,i,n)=>{var o,l;const s=n[i+1];if(s&&d(e.left,1)===d(s.left,1)){const i=e.left-H/2;e.set("left",i+H/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+H/2,s.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]})))}))}Promise.all(A).then((e=>{const t=R.filter((e=>e));Promise.all(T).then((i=>{S.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&S.value.remove(e.leftLine),e.rightLine&&S.value.remove(e.rightLine))}}(t,e)}))}))}))}function de(e,t){return"pain"===e&&0==t}function pe(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top},I.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},u="hover"===t?l.value:C(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${u}—>${r}${n||""}`;return`${i} ${u}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`],I.show=!0}function fe(e,t){const i="pain"===t.type?Q:N;if(!h(e)||!function(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=v(e);return l>=n&&l<=o}(e.time))return;const n=$(e.time),o=O(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function he(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=v(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=v(`${P(e)}:00`);return U&&l<v(U)?(V("exceedMin"),!1):!(l>o)||(V("exceedMax"),!1)}function ve(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=re.find((e=>e.type===i));if("add"===t){const e=u(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=g(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ge()}function ge(){var e;se.size&&(null==(e=S.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...se]))),ne.clear(),se.clear(),oe.clear(),le.clear(),re.forEach((e=>{e.dataList.forEach(((t,i)=>{u(e.type)&&!t.enable||ce(t,i,e)}))})),ue(),ae()}return ne.clear(),oe.clear(),le.clear(),re.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=O(e.type,e.list,e.positionLine.value),n=i([W,t,q,t],e.positionLine);S.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||u(e.type)&&!t.enable||ce(t,i,e)}))})),ue(),ae(),S.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!E.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=W&&e<=q&&t>=G&&t<=B){R.point={x:e,y:t},R.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(R.list=[...w]),"pain"===o&&(R.list=[...L]),R.target=i;else{R.target=null,R.list=["新增节点"],J.forEach((i=>{if(!T([...se],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Q:N;t>=e.originY&&t<=e.endY&&R.list.push({renderItem:A?A(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=he(e);i&&1!==R.list.length||(R.show=!1,1===R.list.length&&i&&V("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=W&&e<=q&&t>0&&t<ee&&M("click:grid",{x:e,y:t,time:P(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=y(i,[...w,...L]);s[`${e.type}`]=e.value,u(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};M("change",r),ve(r,"change")}else{const t={data:{time:P(e.pointer.x),value:C(e.origin.type,e.pointer.y),...u(e.origin.type)?{key:e.origin.key}:{}},...e.origin};M("add",t),ve(t)}},setPopup:pe,isAddPoint:he,updateData:ve,redrawPoints:ge,gridPoints:se}}function Y(e){return"fixed"===e.position}export{S as useCenter};
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as u,getType as a,isOverlapPoint as c,getFloorNumber as d,isValidValue as p,setOtherType as f,getTime as h,isEffectiveNode as v,getIndex as g,deleteProperty as y}from"../../utils/index.js";import{cloneDeep as m,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useCommon as j}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as w,PAIN_MENU as L,OVERLAP as k}from"../../constants/index.js";function S(S,E,M,$,O,P,C,A,I,R){r(S,E);const{getEqualXTypes:T,handleAddPrevent:V,getPointEventProps:X}=j(S,M,E),{createShadowLines:z}=t(),{left:D,xScaleList:F,xCellWidth:H,yCellHeight:_,originX:W,endX:q,originY:G,endY:B,itemList:J,event:K,vitalSignsOriginY:N,painOriginY:Q,hospitalizationDate:U,config:Z,canvasHeight:ee}=E,te=new Set,ie=["xinmai","mai"],ne=new Map,oe=new Set,le=new Set,se=new Set,re=m(D.yScaleValue);function ue(t){var o;const l=re.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(te.size&&S.value.remove(...te),te.clear(),ne.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ne.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ne)t.push(e[1]),e[0]===ie[0]&&e[1].forEach((e=>{(ne.get(ie[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),u=n[i],a=o[r],c=n[i-1],d=n[i+1],p=o[r-1],f=o[r+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&s.push(p);const h=Math.min(u[1],a[1]);l.push([u,a].find((e=>e[1]===h)));const v=Math.max(u[1],a[1]);s.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(s.push(f),g()):g()})),e}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...z(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),te.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...x(t)],{...r,originX:"center"});e.push(n),te.add(n)}))}S.value.add(...e)}te.add(l),S.value.add(l)}))}}function ae(){var e;const t=re.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},k,D.overlap||{}),l=[];oe.size&&[...oe].forEach((e=>{[...le].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{S.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),se.add(e)}))}))}function ce(e,t,r){var a;const{type:c,riseStyle:h={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:w={},dataList:L=[],list:k=[]}=r,{type:E,textStyle:P,showConnectLine:A=!1}=j,R=[],T=[],V=[];let z=null;if(null==(a=e.list)||a.forEach(((a,j)=>{const D=u(c)?L.find((e=>e.key===a.key)):e,F=he(a,r),W=e.list[j+1],q=W?he(W,r):void 0,G=W?u(c)?L.find((e=>e.key===W.key)):e:{},{title:B=""}=D;if("脉搏"===B&&"脉搏"!==G.title||"脉搏"!==B&&"脉搏"===G.title||!F||!q||d(F[0],1)!==d(q[0],1))F&&z&&(F[0]=z),z=null;else{const e=F[0]-H/2;F[0]=e+H/4,q[0]=z=F[0]+H/2}const J={};J.value=function(e,t,i){if(!(null==e?void 0:e.length)||!Z.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=N.originY+_?e[1]+_:e[1]-_,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return V.push(s),{obj:s,top:-_}}(F,a,D),function(e,t,r,u){var a,d;if(!["temperature","pain"].includes(c))return;if(!(null==e?void 0:e.length)&&("pain"===c||"temperature"===c&&!fe(t.time)))return;const{lineAttr:f={}}=r,{value:m}=u,x=$(t.time);let b,j,w,L,S;if(t.noRise&&v.show){const i=Y(v,t)?O(c,k,35):(null==e?void 0:e[1])||0;if(v.text)w=l([x,Y(v,t)?i:i+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),t.value||se.add(w);else if(t.value){w=s([x,i,i+2*_],{...v.style})}w&&V.push(w)}if((null==e?void 0:e[1])&&(t.rise&&h.show&&h.text&&(L=l([x,e[1]-(m?_:0)-5],{value:h.text.split("").join("\n"),originY:"bottom",...h.style}),V.push(L)),t.verified&&(S=l([x,e[1]-(m?_:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),V.push(S)),p(t.physicsReduce)||p(t.drugReduce))){const l=O(c,k,null!=(a=t.physicsReduce)?a:t.drugReduce),s=l<e[1]&&(null==Z?void 0:Z.hypothermyViewCustom)?x+H/2:x;b=i([...e,s,l],{...f,...y.line,...n}),j=o((null==(d=null==y?void 0:y.point)?void 0:d.type)||"circle",{left:s,top:l,...y.point,...n,originY:l===ee?"bottom":"center"}),b&&V.push(b),j&&V.push(j)}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:v.text?5:2*_,isFixed:Y(v,t)},riseText:{obj:L,top:(m?-_:0)-5},verifiedText:{obj:S,top:(m?-_:0)-5},reducePoint:{obj:j,type:"reduce"}})}(F,a,D,J),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...k),r=Math.min(...k);let u,a,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*_,i=[e[1]-_/2,t];t<N.originY&&(t=e[1]+2.5*_,i=[t,e[1]+_/2]),u=s([e[0],i[0],i[1]],x,"up"),V.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=u?e[1]+_/2+u.height:e[1]+_;a=l([e[0],t],i),V.push(a)}+t.value<r&&(a=l([e[0],e[1]-_],i),V.push(a))}if(w.show&&+t.value<r){const t=e[1];if(w.text)d=l([e[0],e[1]+5],{value:w.text.split("").join("\n"),originY:"top",...w.style});else{const i=t+2*_;d=s([e[0],t,i],{...w.style})}V.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:a,top:-_},belowMinValue:{obj:d,top:w.text?5:2*_,moveHide:!0}})}(F,a,D,J),function(n,l,s,u,a,d){let p,h;const{pointAttr:v={},lineAttr:g={},title:y="",key:x,type:b="circle"}=a,j=e.list[u+1],w=de(c,e.list[u].value),L=l&&de(c,j.value);if(n&&l&&!s.breakpoint&&(!w&&!L||A)){h=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==Z?void 0:Z.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});V.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const k=s.pacemakerShow&&"pulse"==c?m.value:w&&"number"===E?0:b,Y=T[u-1],$={origin:{data:s,title:y,key:x||"",unit:r.unit,type:c,_type:f(y,c),dataIndex:t,index:u},leftLine:Y,rightLine:h,otherObj:d,...s.pacemakerShow&&"pulse"==c?m.style:v,lockMovementX:!0,...X(),...w?{selectable:!1,evented:!1,..."number"===E?P:{}}:{}};n&&(Y?$.leftLine.set("x2",n[0]):$.leftLine=null,p=o(k,{left:n[0],top:w?n[1]-5:n[1],...$}));T.push(h),p&&(y.includes("脉搏")?oe.add(p):le.add(p),function(e){K.hovered&&(e.on("mouseover",(()=>{pe(e,"hover")})),e.on("mouseout",(()=>{I.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?Q:N;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(S.value.remove(i),delete e.otherObj.obj)))})),ue(e)}(e),K.hovered&&pe(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=C(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};S.value.discardActiveObject(),M("change",n),ge(n,"change")}}))}(p),R.push(p),se.add(p))}(F,q,a,j,D,J)})),"pulse"===c){const e={};ie.forEach((t=>{e[t]=R.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t}))}));let t=null;ie.forEach((i=>{ne.set(i,e[i].map(((e,i,n)=>{var o,l;const s=n[i+1];if(s&&d(e.left,1)===d(s.left,1)){const i=e.left-H/2;e.set("left",i+H/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+H/2,s.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]})))}))}Promise.all(R).then((e=>{const t=T.filter((e=>e));Promise.all(V).then((i=>{S.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&S.value.remove(e.leftLine),e.rightLine&&S.value.remove(e.rightLine))}}(t,e)}))}))}))}function de(e,t){return"pain"===e&&0==t}function pe(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top},I.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},u="hover"===t?l.value:C(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${u}—>${r}${n||""}`;return`${i} ${u}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`],I.show=!0}function fe(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}function he(e,t){const i="pain"===t.type?Q:N;if(!v(e)||!fe(e.time))return;const n=$(e.time),o=O(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function ve(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${P(e)}:00`);return U&&l<h(U)?(V("exceedMin"),!1):!(l>o)||(V("exceedMax"),!1)}function ge(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=re.find((e=>e.type===i));if("add"===t){const e=u(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=g(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ye()}function ye(){var e;se.size&&(null==(e=S.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...se]))),ne.clear(),se.clear(),oe.clear(),le.clear(),re.forEach((e=>{e.dataList.forEach(((t,i)=>{u(e.type)&&!t.enable||ce(t,i,e)}))})),ue(),ae()}return ne.clear(),oe.clear(),le.clear(),re.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=O(e.type,e.list,e.positionLine.value),n=i([W,t,q,t],e.positionLine);S.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||u(e.type)&&!t.enable||ce(t,i,e)}))})),ue(),ae(),S.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!E.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=W&&e<=q&&t>=G&&t<=B){R.point={x:e,y:t},R.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(R.list=[...w]),"pain"===o&&(R.list=[...L]),R.target=i;else{R.target=null,R.list=["新增节点"],J.forEach((i=>{if(!T([...se],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Q:N;t>=e.originY&&t<=e.endY&&R.list.push({renderItem:A?A(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=ve(e);i&&1!==R.list.length||(R.show=!1,1===R.list.length&&i&&V("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=W&&e<=q&&t>0&&t<ee&&M("click:grid",{x:e,y:t,time:P(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=y(i,[...w,...L]);s[`${e.type}`]=e.value,u(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};M("change",r),ge(r,"change")}else{const t={data:{time:P(e.pointer.x),value:C(e.origin.type,e.pointer.y),...u(e.origin.type)?{key:e.origin.key}:{}},...e.origin};M("add",t),ge(t)}},setPopup:pe,isAddPoint:ve,updateData:ge,redrawPoints:ye,gridPoints:se}}function Y(e,t){return"fixed"===e.position||!t.value&&0!==t.value}export{S as useCenter};
|
|
@@ -457,9 +457,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
457
457
|
requiredDisable: boolean;
|
|
458
458
|
hide: boolean;
|
|
459
459
|
}>;
|
|
460
|
-
isHighlightRow: boolean;
|
|
461
460
|
idx: number;
|
|
462
461
|
isHighlight: boolean;
|
|
462
|
+
isHighlightRow: boolean;
|
|
463
463
|
}>;
|
|
464
464
|
EditDialog: import("vue").DefineComponent<{
|
|
465
465
|
visible: {
|
|
@@ -575,9 +575,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
575
575
|
requiredDisable: boolean;
|
|
576
576
|
hide: boolean;
|
|
577
577
|
}>;
|
|
578
|
-
isHighlightRow: boolean;
|
|
579
578
|
idx: number;
|
|
580
579
|
isHighlight: boolean;
|
|
580
|
+
isHighlightRow: boolean;
|
|
581
581
|
}>;
|
|
582
582
|
isArray: {
|
|
583
583
|
(value?: any): value is any[];
|
|
@@ -282,8 +282,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
282
282
|
requiredDisable: boolean;
|
|
283
283
|
hide: boolean;
|
|
284
284
|
}>;
|
|
285
|
-
isHighlightRow: boolean;
|
|
286
285
|
idx: number;
|
|
287
286
|
isHighlight: boolean;
|
|
287
|
+
isHighlightRow: boolean;
|
|
288
288
|
}>;
|
|
289
289
|
export default _default;
|