cnhis-design-vue 2.1.127 → 2.1.128
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 -38
- package/es/affix/index.js +8 -8
- package/es/age/index.js +10 -10
- package/es/alert/index.js +8 -8
- package/es/anchor/index.js +8 -8
- package/es/auto-complete/index.js +8 -8
- package/es/avatar/index.js +8 -8
- package/es/back-top/index.js +8 -8
- package/es/badge/index.js +8 -8
- package/es/base/index.js +8 -8
- package/es/big-table/index.js +339 -1630
- package/es/big-table/style.css +1 -1
- package/es/breadcrumb/index.js +8 -8
- package/es/button/index.js +22 -22
- package/es/calendar/index.js +8 -8
- package/es/captcha/index.js +3 -3
- package/es/card/index.js +8 -8
- package/es/card-reader-sdk/index.js +1 -1
- package/es/carousel/index.js +8 -8
- package/es/cascader/index.js +8 -8
- package/es/checkbox/index.js +9 -9
- package/es/col/index.js +8 -8
- package/es/collapse/index.js +8 -8
- package/es/color-picker/index.js +1 -1
- package/es/comment/index.js +8 -8
- package/es/config-provider/index.js +8 -8
- package/es/date-picker/index.js +8 -8
- package/es/descriptions/index.js +8 -8
- package/es/direct/index.js +16 -16
- package/es/divider/index.js +8 -8
- package/es/drag-layout/index.js +3 -3
- package/es/drawer/index.js +8 -8
- package/es/dropdown/index.js +8 -8
- package/es/editor/index.js +1 -1
- package/es/ellipsis/index.js +1 -1
- package/es/empty/index.js +8 -8
- package/es/fabric-chart/index.js +99 -224
- package/es/form/index.js +8 -8
- package/es/form-model/index.js +8 -8
- package/es/form-table/index.js +696 -697
- package/es/full-calendar/index.js +52 -52
- package/es/full-calendar/style.css +1 -1
- package/es/grid/index.js +1 -0
- package/es/index/index.js +1216 -1826
- package/es/index/style.css +1 -1
- package/es/input/index.js +9 -9
- package/es/input-number/index.js +8 -8
- package/es/layout/index.js +8 -8
- package/es/list/index.js +8 -8
- package/es/locale-provider/index.js +8 -8
- package/es/map/index.js +9 -9
- package/es/mentions/index.js +8 -8
- package/es/menu/index.js +8 -8
- package/es/message/index.js +8 -8
- package/es/multi-chat/index.js +76 -76
- package/es/multi-chat-client/index.js +70 -70
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +14 -14
- package/es/multi-chat-setting/index.js +22 -22
- package/es/multi-chat-sip/index.js +1 -1
- package/es/notification/index.js +8 -8
- package/es/page-header/index.js +8 -8
- package/es/pagination/index.js +8 -8
- package/es/popconfirm/index.js +8 -8
- package/es/popover/index.js +8 -8
- package/es/progress/index.js +8 -8
- package/es/radio/index.js +9 -9
- package/es/rate/index.js +8 -8
- package/es/result/index.js +8 -8
- package/es/row/index.js +8 -8
- package/es/scale-container/index.js +367 -368
- package/es/scale-view/index.js +74 -65
- package/es/scale-view/style.css +1 -1
- package/es/select/index.js +12 -12
- package/es/select-label/index.js +11 -11
- package/es/select-person/index.js +2 -2
- package/es/select-tag/index.js +4 -4
- package/es/shortcut-setter/index.js +10 -10
- package/es/skeleton/index.js +8 -8
- package/es/slider/index.js +8 -8
- package/es/slider-tree/index.js +9 -9
- package/es/space/index.js +8 -8
- package/es/spin/index.js +8 -8
- package/es/statistic/index.js +8 -8
- package/es/steps/index.js +8 -8
- package/es/switch/index.js +8 -8
- package/es/table-filter/index.js +178 -431
- package/es/tabs/index.js +8 -8
- package/es/tag/index.js +9 -9
- package/es/time-picker/index.js +8 -8
- package/es/timeline/index.js +8 -8
- package/es/tooltip/index.js +8 -8
- package/es/transfer/index.js +8 -8
- package/es/tree/index.js +8 -8
- package/es/tree-select/index.js +8 -8
- package/es/upload/index.js +8 -8
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +1219 -1923
- package/lib/cui.umd.js +1219 -1923
- package/lib/cui.umd.min.js +42 -42
- package/package.json +1 -1
- package/packages/big-table/index.js +0 -4
- package/packages/big-table/src/BigTable.vue +8 -6
- package/packages/big-table/src/components/edit-form/edit-component/edit-search/edit-search.vue +7 -81
- package/packages/big-table/src/components/edit-form/edit-component/edit-search-more/edit-search-more.vue +7 -63
- package/packages/big-table/src/components/edit-form/edit-component/mixins/search.js +0 -21
- package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +1 -4
- package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +8 -12
- package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +28 -80
- package/packages/fabric-chart/src/mixins/drawExtracorporealCirculation.js +6 -2
- package/packages/fabric-chart/src/utils/index.js +1 -9
- package/packages/full-calendar/src/FullCalendar.vue +11 -16
- package/packages/full-calendar/src/components/ListTag.vue +4 -6
- package/packages/grid/src/grid.js +3 -2
- package/packages/scale-view/formitem/r-choice.vue +10 -2
- package/packages/table-filter/src/components/render-widget/enums.js +16 -39
- package/packages/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +31 -245
- package/packages/table-filter/src/components/render-widget/index.vue +4 -7
- package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +11 -38
- package/packages/table-filter/src/mixins/mixins.js +8 -10
- package/packages/table-filter/src/mixins/renderWidget.js +2 -2
package/package.json
CHANGED
|
@@ -2143,11 +2143,13 @@ export default create({
|
|
|
2143
2143
|
let forbiddenBatchSelect = !this.checkMethod(data);
|
|
2144
2144
|
// 如果该行禁止批量多选,则选择/取消单行 并触发单击事件
|
|
2145
2145
|
if (this.selectType == 'checkbox' && forbiddenBatchSelect) {
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2146
|
+
/* 存在问题注释的代码
|
|
2147
|
+
选中“禁用”行,会把之前的选中数据清空
|
|
2148
|
+
table?.setAllCheckboxRow(false);
|
|
2149
|
+
*/
|
|
2150
|
+
const value = this.getRowClassName({ row }) == 'single--checked' ? [] : [row];
|
|
2149
2151
|
this.$set(this, 'checkedRows', value);
|
|
2150
|
-
this.pubCheckChange(value
|
|
2152
|
+
this.pubCheckChange(value);
|
|
2151
2153
|
this.$emit('handlerClickRow', row, rowIndex, { source, column, trigger });
|
|
2152
2154
|
return;
|
|
2153
2155
|
}
|
|
@@ -2491,13 +2493,13 @@ export default create({
|
|
|
2491
2493
|
|
|
2492
2494
|
this.setCurrentCheckedLength();
|
|
2493
2495
|
},
|
|
2494
|
-
pubCheckChange(rows = []
|
|
2496
|
+
pubCheckChange(rows = []) {
|
|
2495
2497
|
this.treeTableLength = rows.filter(item => {
|
|
2496
2498
|
let isGroupRow = vexutils.has(item, GROUP_TITLE_KEY);
|
|
2497
2499
|
return !isGroupRow;
|
|
2498
2500
|
}).length;
|
|
2499
2501
|
this.visibleTreeCheck = rows.length > 1;
|
|
2500
|
-
this.$emit('selectionChange', rows
|
|
2502
|
+
this.$emit('selectionChange', rows);
|
|
2501
2503
|
},
|
|
2502
2504
|
setCurrentPageRowChecked() {
|
|
2503
2505
|
let table = this.$refs.xGrid;
|
package/packages/big-table/src/components/edit-form/edit-component/edit-search/edit-search.vue
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<a-select
|
|
4
4
|
v-model="item.useFormValue"
|
|
5
5
|
:ref="'search-' + item.val_key"
|
|
6
|
-
:dropdownMatchSelectWidth="
|
|
6
|
+
:dropdownMatchSelectWidth="(item.elem_width || 6) > 11"
|
|
7
7
|
class="formItem-select editItem-search"
|
|
8
8
|
:placeholder="item.placeholder || '请输入关键字'"
|
|
9
9
|
:autoFocus="false"
|
|
@@ -16,12 +16,10 @@
|
|
|
16
16
|
@dropdownVisibleChange="handlerDropdownVisibleChange($event, item)"
|
|
17
17
|
@select="handleSearchSelect($event, item, 'select')"
|
|
18
18
|
@change="handleSearchSelect($event, item)"
|
|
19
|
-
:dropdownClassName="selectIsOpen ? 'form-default-select
|
|
19
|
+
:dropdownClassName="selectIsOpen ? 'form-default-select' : 'hide-select-drop'"
|
|
20
20
|
:notFoundContent="fetching ? undefined : '暂无数据'"
|
|
21
21
|
:dropdownStyle="{
|
|
22
|
-
maxWidth: optionsMaxWidth
|
|
23
|
-
background: 'transparent',
|
|
24
|
-
'box-shadow': 'none'
|
|
22
|
+
maxWidth: optionsMaxWidth
|
|
25
23
|
}"
|
|
26
24
|
optionLabelProp="label"
|
|
27
25
|
>
|
|
@@ -33,7 +31,7 @@
|
|
|
33
31
|
:label="hanlderGetSearchLabel(item, v)"
|
|
34
32
|
:disabled="k === 0 && item.wordbook.render_key && item.wordbook.render_key.length > 1"
|
|
35
33
|
>
|
|
36
|
-
|
|
34
|
+
<div
|
|
37
35
|
:class="{
|
|
38
36
|
'title-line': k === 0 && item.wordbook.render_key && item.wordbook.render_key.length > 1
|
|
39
37
|
}"
|
|
@@ -42,64 +40,17 @@
|
|
|
42
40
|
>
|
|
43
41
|
<span style="flex: 1;" v-for="(v1, k1) in v['showLabel'].split('≌')" :key="k1" class="select-content-item">{{ v1 }}</span>
|
|
44
42
|
</div>
|
|
45
|
-
<span v-else>{{ v[item.wordbook.value_key] }}</span>
|
|
43
|
+
<span v-else>{{ v[item.wordbook.value_key] }}</span>
|
|
46
44
|
</a-select-option>
|
|
47
|
-
<scale-container
|
|
48
|
-
slot="dropdownRender"
|
|
49
|
-
:class="`search-menu-${item.val_key}`"
|
|
50
|
-
slot-scope="menu"
|
|
51
|
-
style="background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 15%);"
|
|
52
|
-
@mousedown.native="e => e.preventDefault()"
|
|
53
|
-
:minW="optionsMaxWidthNew || 160"
|
|
54
|
-
:minH="45"
|
|
55
|
-
:defaultMaxH="300"
|
|
56
|
-
>
|
|
57
|
-
<a-spin
|
|
58
|
-
v-if="fetching"
|
|
59
|
-
class="loading-wrapper"
|
|
60
|
-
:spinning="fetching"
|
|
61
|
-
:tip="`${$t('1.1.7.14')}...`"
|
|
62
|
-
/>
|
|
63
|
-
<div
|
|
64
|
-
v-else
|
|
65
|
-
style="display: flex; flex-direction: column; max-height: inherit; height: 100%;"
|
|
66
|
-
>
|
|
67
|
-
<SelectOptions
|
|
68
|
-
style="flex: 1; overflow: hidden;"
|
|
69
|
-
:rows="optionRows"
|
|
70
|
-
:freeAddItem="freeAddItem"
|
|
71
|
-
:fields="fieldListConfig"
|
|
72
|
-
:wordbook="item.wordbook"
|
|
73
|
-
:context="menu && menu.context"
|
|
74
|
-
/>
|
|
75
|
-
<!-- <slot v-if="curOptions && curOptions.length">
|
|
76
|
-
<select-pages
|
|
77
|
-
v-if="!isnoPages"
|
|
78
|
-
style="flex-shrink: 0;"
|
|
79
|
-
:searchPageConfig="searchPageConfig"
|
|
80
|
-
:handleSearchChangePage="handleSearchChangePage"
|
|
81
|
-
/>
|
|
82
|
-
</slot> -->
|
|
83
|
-
</div>
|
|
84
|
-
</scale-container>
|
|
85
45
|
</a-select>
|
|
86
46
|
</div>
|
|
87
47
|
</template>
|
|
88
48
|
<script>
|
|
89
49
|
import itemDefault from '../mixins/item-default';
|
|
90
50
|
import search from '../mixins/search';
|
|
91
|
-
import { Select, Spin } from 'ant-design-vue';
|
|
92
|
-
import SelectOptions from '@/component/select-options';
|
|
93
|
-
import ScaleContainer from '~/scale-container/src/ScaleContainer';
|
|
94
51
|
export default {
|
|
95
52
|
name: 'editSearch',
|
|
96
|
-
components: {
|
|
97
|
-
[Select.name]: Select,
|
|
98
|
-
[Select.Option.name]: Select.Option,
|
|
99
|
-
[Spin.name]: Spin,
|
|
100
|
-
SelectOptions,
|
|
101
|
-
ScaleContainer
|
|
102
|
-
},
|
|
53
|
+
components: {},
|
|
103
54
|
props: {
|
|
104
55
|
item: Object
|
|
105
56
|
},
|
|
@@ -128,29 +79,4 @@ export default {
|
|
|
128
79
|
methods: {}
|
|
129
80
|
};
|
|
130
81
|
</script>
|
|
131
|
-
<style lang="less" scoped>
|
|
132
|
-
.loading-wrapper {
|
|
133
|
-
height: 100%;
|
|
134
|
-
min-height: 100px;
|
|
135
|
-
display: flex;
|
|
136
|
-
justify-content: center;
|
|
137
|
-
align-items: center;
|
|
138
|
-
flex-direction: column;
|
|
139
|
-
}
|
|
140
|
-
</style>
|
|
141
|
-
|
|
142
|
-
<style lang="less">
|
|
143
|
-
.edit-table-default-select {
|
|
144
|
-
.title-line {
|
|
145
|
-
font-weight: 700;
|
|
146
|
-
color: #000;
|
|
147
|
-
font-size: 14px;
|
|
148
|
-
}
|
|
149
|
-
.select-content-item {
|
|
150
|
-
padding: 0 5px;
|
|
151
|
-
}
|
|
152
|
-
.ant-select-dropdown-menu-item-selected {
|
|
153
|
-
color: #5585f5;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
</style>
|
|
82
|
+
<style lang="less" scoped></style>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
ref="form_a_select"
|
|
5
5
|
:showArrow="true"
|
|
6
6
|
class="formItem-select formItem-select-multiple formItem-search-more"
|
|
7
|
-
:dropdownMatchSelectWidth="
|
|
8
|
-
:dropdownClassName="selectIsOpen ? 'form-default-select
|
|
7
|
+
:dropdownMatchSelectWidth="(item.elem_width || 6) > 11"
|
|
8
|
+
:dropdownClassName="selectIsOpen ? 'form-default-select' : 'hide-select-drop'"
|
|
9
9
|
:disabled="item.is_edit == 0"
|
|
10
10
|
:defaultActiveFirstOption="true"
|
|
11
11
|
mode="multiple"
|
|
@@ -22,9 +22,7 @@
|
|
|
22
22
|
@change="searchMoreOnChange($event, item)"
|
|
23
23
|
:notFoundContent="fetching ? undefined : '暂无数据'"
|
|
24
24
|
:dropdownStyle="{
|
|
25
|
-
maxWidth: optionsMaxWidth
|
|
26
|
-
background: 'transparent',
|
|
27
|
-
'box-shadow': 'none'
|
|
25
|
+
maxWidth: optionsMaxWidth
|
|
28
26
|
}"
|
|
29
27
|
optionLabelProp="label"
|
|
30
28
|
>
|
|
@@ -36,7 +34,8 @@
|
|
|
36
34
|
:label="hanlderGetSearchLabel(item, v)"
|
|
37
35
|
:disabled="k === 0 && item.wordbook.render_key && item.wordbook.render_key.length > 1"
|
|
38
36
|
>
|
|
39
|
-
<!--
|
|
37
|
+
<!-- {{ v["showLabel"] || v[item.wordbook.value_key] }} -->
|
|
38
|
+
<div
|
|
40
39
|
:class="{
|
|
41
40
|
'title-line': k === 0 && item.wordbook.render_key && item.wordbook.render_key.length > 1
|
|
42
41
|
}"
|
|
@@ -45,56 +44,16 @@
|
|
|
45
44
|
>
|
|
46
45
|
<span style="flex: 1;" v-for="(v1, k1) in v['showLabel'].split('≌')" :key="k1">{{ v1 }}</span>
|
|
47
46
|
</div>
|
|
48
|
-
<span v-else>{{ v[item.wordbook.value_key] }}</span>
|
|
47
|
+
<span v-else>{{ v[item.wordbook.value_key] }}</span>
|
|
49
48
|
</a-select-option>
|
|
50
|
-
<scale-container
|
|
51
|
-
slot="dropdownRender"
|
|
52
|
-
:class="`search-menu-${item.val_key}`"
|
|
53
|
-
slot-scope="menu"
|
|
54
|
-
style="background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 15%);"
|
|
55
|
-
@mousedown.native="e => e.preventDefault()"
|
|
56
|
-
:minW="optionsMaxWidthNew ||160"
|
|
57
|
-
:minH="45"
|
|
58
|
-
:defaultMaxH="300"
|
|
59
|
-
>
|
|
60
|
-
<a-spin
|
|
61
|
-
v-if="fetching"
|
|
62
|
-
class="loading-wrapper"
|
|
63
|
-
:spinning="fetching"
|
|
64
|
-
:tip="`${$t('1.1.7.14')}...`"
|
|
65
|
-
/>
|
|
66
|
-
<div
|
|
67
|
-
v-else
|
|
68
|
-
style="display: flex; flex-direction: column; max-height: inherit; height: 100%;"
|
|
69
|
-
>
|
|
70
|
-
<SelectOptions
|
|
71
|
-
style="flex: 1; overflow: hidden;"
|
|
72
|
-
:rows="optionRows"
|
|
73
|
-
:freeAddItem="freeAddItem"
|
|
74
|
-
:fields="fieldListConfig"
|
|
75
|
-
:wordbook="item.wordbook"
|
|
76
|
-
:context="menu && menu.context"
|
|
77
|
-
separate="-"
|
|
78
|
-
/>
|
|
79
|
-
</div>
|
|
80
|
-
</scale-container>
|
|
81
49
|
</a-select>
|
|
82
50
|
</template>
|
|
83
51
|
<script>
|
|
84
52
|
import itemDefault from '../mixins/item-default';
|
|
85
53
|
import search from '../mixins/search';
|
|
86
|
-
import { Select, Spin } from 'ant-design-vue';
|
|
87
|
-
import SelectOptions from '@/component/select-options';
|
|
88
|
-
import ScaleContainer from '~/scale-container/src/ScaleContainer';
|
|
89
54
|
export default {
|
|
90
55
|
name: 'editSearchMore',
|
|
91
|
-
components: {
|
|
92
|
-
[Select.name]: Select,
|
|
93
|
-
[Select.Option.name]: Select.Option,
|
|
94
|
-
[Spin.name]: Spin,
|
|
95
|
-
SelectOptions,
|
|
96
|
-
ScaleContainer
|
|
97
|
-
},
|
|
56
|
+
components: {},
|
|
98
57
|
props: {
|
|
99
58
|
item: Object
|
|
100
59
|
},
|
|
@@ -133,19 +92,4 @@ export default {
|
|
|
133
92
|
top: 50%;
|
|
134
93
|
}
|
|
135
94
|
}
|
|
136
|
-
.loading-wrapper {
|
|
137
|
-
height: 100%;
|
|
138
|
-
min-height: 100px;
|
|
139
|
-
display: flex;
|
|
140
|
-
justify-content: center;
|
|
141
|
-
align-items: center;
|
|
142
|
-
flex-direction: column;
|
|
143
|
-
}
|
|
144
|
-
</style>
|
|
145
|
-
<style lang="less">
|
|
146
|
-
.edit-table-default-select-more {
|
|
147
|
-
.ant-select-dropdown-menu-item-selected {
|
|
148
|
-
color: #5585f5;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
95
|
</style>
|
|
@@ -31,10 +31,8 @@ export default {
|
|
|
31
31
|
page: 1, // 当前页
|
|
32
32
|
total: 1 // 总页数
|
|
33
33
|
},
|
|
34
|
-
fieldListConfig: [],
|
|
35
34
|
|
|
36
35
|
optionsMaxWidth: '100%',
|
|
37
|
-
optionsMaxWidthNew: 160,
|
|
38
36
|
|
|
39
37
|
cacheReqOptionsParams: '',
|
|
40
38
|
|
|
@@ -58,23 +56,6 @@ export default {
|
|
|
58
56
|
formType() {
|
|
59
57
|
const { formType } = this.mainForm || {};
|
|
60
58
|
return formType || {};
|
|
61
|
-
},
|
|
62
|
-
selectIsOpen() {
|
|
63
|
-
const { html_type, show_type } = this.item;
|
|
64
|
-
if (['SEARCH_MORE', 'SEARCH'].includes(html_type)) {
|
|
65
|
-
return !['pop', 'dialog'].includes(show_type);
|
|
66
|
-
}
|
|
67
|
-
return true;
|
|
68
|
-
},
|
|
69
|
-
isnoPages() {
|
|
70
|
-
const { searchPageConfig } = this;
|
|
71
|
-
return searchPageConfig.page <= 1 && !searchPageConfig.hasNextPage;
|
|
72
|
-
},
|
|
73
|
-
freeAddItem() {
|
|
74
|
-
return this.curOptions.find(v => v.is_free_entry_input__add);
|
|
75
|
-
},
|
|
76
|
-
optionRows() {
|
|
77
|
-
return this.curOptions.filter((v, i) => !(i === 0 && this.item.wordbook.render_key && this.item.wordbook.render_key.length > 1) && !v.is_free_entry_input__add);
|
|
78
59
|
}
|
|
79
60
|
},
|
|
80
61
|
mounted() {
|
|
@@ -455,7 +436,6 @@ export default {
|
|
|
455
436
|
if (!data) return [];
|
|
456
437
|
this.searchAddObj[`${itemData.val_key}_${itemData.name}`] = true;
|
|
457
438
|
let { rows, fieldList, page, total } = data.map;
|
|
458
|
-
this.fieldListConfig = fieldList;
|
|
459
439
|
this.searchPageConfig = Object.assign(this.searchPageConfig, {
|
|
460
440
|
page,
|
|
461
441
|
total,
|
|
@@ -941,7 +921,6 @@ export default {
|
|
|
941
921
|
|
|
942
922
|
res = parseInt(res, 10);
|
|
943
923
|
this.optionsMaxWidth = `${res}px`;
|
|
944
|
-
this.optionsMaxWidthNew = res || 160;
|
|
945
924
|
});
|
|
946
925
|
},
|
|
947
926
|
|
|
@@ -265,10 +265,7 @@ export default {
|
|
|
265
265
|
const [preItem0] = lineList[j + 1];
|
|
266
266
|
if (preItem0) {
|
|
267
267
|
const preStartMinute = new Date(preItem0).getTime();
|
|
268
|
-
if (preStartMinute > minMinute && preStartMinute <= maxMinute)
|
|
269
|
-
rightLimit.x2 = this.computedX(preItem0);
|
|
270
|
-
if (!x2) leftLimit.x2 = rightLimit.x2;
|
|
271
|
-
}
|
|
268
|
+
if (preStartMinute > minMinute && preStartMinute <= maxMinute) rightLimit.x2 = this.computedX(preItem0);
|
|
272
269
|
}
|
|
273
270
|
}
|
|
274
271
|
|
|
@@ -14,7 +14,6 @@ import MouseRightClick from '../components/MouseRightClick';
|
|
|
14
14
|
import DropPopup from '../components/DropPopup';
|
|
15
15
|
import defaultVaule from '../const/defaultVaule';
|
|
16
16
|
import Bus from '../utils/bus';
|
|
17
|
-
import { nearlyEqual } from '../utils';
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* @description: 递归遍历节点,设置颜色属性
|
|
@@ -610,7 +609,7 @@ export default {
|
|
|
610
609
|
* @param {polylineIndex} 当前折线 index
|
|
611
610
|
*/
|
|
612
611
|
drawPolyline(polyline, polylineIndex, polylineType, polylineTypeId) {
|
|
613
|
-
const { originY, endY
|
|
612
|
+
const { originY, endY } = this.propItems;
|
|
614
613
|
const { list = [], critical = {}, diffValue = {} } = polyline;
|
|
615
614
|
|
|
616
615
|
const pointList = [];
|
|
@@ -649,10 +648,7 @@ export default {
|
|
|
649
648
|
let line;
|
|
650
649
|
let point;
|
|
651
650
|
let previousLine;
|
|
652
|
-
line =
|
|
653
|
-
!points || !nextPoint || linePoints.data?.breakpoint || (table.breakpoint && nextPoint[0] - points[0] > xCellWidth)
|
|
654
|
-
? null
|
|
655
|
-
: this.drawLine([...points, ...nextPoint], { polylineIndex, polylineTypeId, lineIndex: index, ...lineAttr });
|
|
651
|
+
line = points && nextPoint && !linePoints.data?.breakpoint ? this.drawLine([...points, ...nextPoint], { polylineIndex, polylineTypeId, lineIndex: index, ...lineAttr }) : null;
|
|
656
652
|
previousLine = lineList[index - 1];
|
|
657
653
|
const pointOthers = { polylineTypeId, polylineIndex, pointIndex: index, ...pointAttr, lineAttr };
|
|
658
654
|
if (points) {
|
|
@@ -880,8 +876,8 @@ export default {
|
|
|
880
876
|
for (let i = 0, len = this.addPointList.length; i < len; i++) {
|
|
881
877
|
const currentPoint = this.addPointList[i];
|
|
882
878
|
const prevPoint = this.addPointList[i - 1] || { left: point.prePoint?.left ?? originLeft, top: point.prePoint?.top ?? originTop };
|
|
883
|
-
const currentPointObj = this.addPointObjList.find(obj =>
|
|
884
|
-
if (
|
|
879
|
+
const currentPointObj = this.addPointObjList.find(obj => obj.left === currentPoint.left);
|
|
880
|
+
if (currentPointObj?.line1?.x1 !== prevPoint.left) {
|
|
885
881
|
currentPointObj?.line1?.set({
|
|
886
882
|
x1: prevPoint.left,
|
|
887
883
|
y1: prevPoint.top,
|
|
@@ -901,7 +897,7 @@ export default {
|
|
|
901
897
|
if (k > 0) {
|
|
902
898
|
const curLeft = originLeft + this.spaceWidth * k;
|
|
903
899
|
// 判断this.addPointList中的left是否包含curLeft,不包含就说明是漏了
|
|
904
|
-
const hasPoint = this.addPointList.some(p =>
|
|
900
|
+
const hasPoint = this.addPointList.some(p => Math.abs(p.left - curLeft) <= 0.001);
|
|
905
901
|
// const hasPoint = this.addPointList.some(v => v.left == curLeft);
|
|
906
902
|
if (!hasPoint) {
|
|
907
903
|
let index;
|
|
@@ -944,7 +940,7 @@ export default {
|
|
|
944
940
|
const currentLeft = left;
|
|
945
941
|
|
|
946
942
|
const startLength = this.addPointList.length;
|
|
947
|
-
const n =
|
|
943
|
+
const n = 6; // 拖动范围,在需要增加节点的刻度左右吸入的范围值
|
|
948
944
|
const residue = (left - originLeft) % this.spaceWidth;
|
|
949
945
|
|
|
950
946
|
const condition = residue > 0 && (residue > this.spaceWidth - n || residue < n);
|
|
@@ -965,7 +961,7 @@ export default {
|
|
|
965
961
|
// point.line1 && this.removePolyline(point.line1.id);
|
|
966
962
|
setPointLineColor(point, 'transparent', conditionHasLine2);
|
|
967
963
|
this.addPointList.length == 0 && this.clonePoint(point, [point.line1 ? point.line1.x1 : originLeft, point.line1 ? point.line1.y1 : originTop, originLeft, originTop]);
|
|
968
|
-
if (this.addPointList.every(v =>
|
|
964
|
+
if (this.addPointList.every(v => v.left !== left)) {
|
|
969
965
|
// const points1 = i === 1 ? [originLeft, originTop] : point.prePoints;
|
|
970
966
|
const points1 = this.addPointList.length == 0 ? [originLeft, originTop] : point.prePoints;
|
|
971
967
|
if (points1) {
|
|
@@ -977,7 +973,7 @@ export default {
|
|
|
977
973
|
data.left = left;
|
|
978
974
|
data.top = top;
|
|
979
975
|
// 避免重复添加
|
|
980
|
-
if (this.addPointObjList.every(o =>
|
|
976
|
+
if (this.addPointObjList.every(o => o.left !== left)) {
|
|
981
977
|
this.addPointList.push(data);
|
|
982
978
|
this.clonePoint(point, [...points1, left, top]);
|
|
983
979
|
}
|
|
@@ -14,8 +14,6 @@ import DropPopup from '../components/DropPopup';
|
|
|
14
14
|
import MouseRightClick from '../components/MouseRightClick';
|
|
15
15
|
import eventCommon from '../mixins/eventCommon';
|
|
16
16
|
import Bus from '../utils/bus';
|
|
17
|
-
import { cloneDeep } from 'lodash';
|
|
18
|
-
import { sortByTime } from '../utils';
|
|
19
17
|
|
|
20
18
|
const rightClickNode = [
|
|
21
19
|
{ name: '修改', type: 'edit' },
|
|
@@ -67,8 +65,6 @@ export default {
|
|
|
67
65
|
}
|
|
68
66
|
},
|
|
69
67
|
data() {
|
|
70
|
-
this.markData = sortByTime(cloneDeep(this.templateData.bottom?.list));
|
|
71
|
-
this.markObjs = [];
|
|
72
68
|
return {
|
|
73
69
|
leftStartX: 0,
|
|
74
70
|
isDropVisible: false,
|
|
@@ -105,7 +101,7 @@ export default {
|
|
|
105
101
|
// this.canvas.renderAll();
|
|
106
102
|
if (this.templateData.bottom) {
|
|
107
103
|
this.drawExtracorporealCirculation();
|
|
108
|
-
this.drawBottomTextDataGroup();
|
|
104
|
+
this.drawBottomTextDataGroup(this.templateData.bottom);
|
|
109
105
|
}
|
|
110
106
|
},
|
|
111
107
|
drawBorder() {
|
|
@@ -326,33 +322,29 @@ export default {
|
|
|
326
322
|
};
|
|
327
323
|
const left = this.computedX(v.time);
|
|
328
324
|
title.dataList.push(left);
|
|
329
|
-
const icon =
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
...commonOptions
|
|
338
|
-
})
|
|
339
|
-
: null;
|
|
340
|
-
const iconHalfWidth = icon ? icon.width / 2 : 0;
|
|
325
|
+
const icon = await this.createPoint(_icon.type, {
|
|
326
|
+
originX: 'center',
|
|
327
|
+
left,
|
|
328
|
+
...item.style,
|
|
329
|
+
...(item.style ? { stroke: item.style.fill } : {}),
|
|
330
|
+
...(_icon.style || {}),
|
|
331
|
+
...commonOptions
|
|
332
|
+
});
|
|
341
333
|
const text = new this.fabric.Text(String(v.value), {
|
|
342
334
|
...defaultVaule.style,
|
|
343
335
|
...defaultVaule.textStyle,
|
|
344
336
|
...item.style,
|
|
345
|
-
left: left +
|
|
337
|
+
left: left + icon.width / 2,
|
|
346
338
|
name: v.value,
|
|
347
339
|
...commonOptions
|
|
348
340
|
});
|
|
349
|
-
const groupObj = new this.fabric.Group(
|
|
341
|
+
const groupObj = new this.fabric.Group([icon, text], {
|
|
350
342
|
id: `${index}_${i}_other_${Date.now()}`,
|
|
351
343
|
lockMovementY: true,
|
|
352
344
|
...commonOptions,
|
|
353
345
|
...this.eventStyle,
|
|
354
346
|
realLeft: left,
|
|
355
|
-
iconHalfWidth
|
|
347
|
+
iconHalfWidth: icon.width / 2
|
|
356
348
|
});
|
|
357
349
|
if (prevPoint) {
|
|
358
350
|
prevPoint.nextPoint = groupObj;
|
|
@@ -463,19 +455,23 @@ export default {
|
|
|
463
455
|
return time >= minTime && time <= maxTime;
|
|
464
456
|
},
|
|
465
457
|
removeMark() {
|
|
466
|
-
this.
|
|
458
|
+
this.canvas.forEachObject(obj => {
|
|
459
|
+
if (obj.type && obj.type === 'mark') {
|
|
460
|
+
this.canvas.remove(obj);
|
|
461
|
+
}
|
|
462
|
+
});
|
|
467
463
|
},
|
|
468
|
-
|
|
469
|
-
|
|
464
|
+
// 底部标记
|
|
465
|
+
drawBottomTextDataGroup(obj) {
|
|
470
466
|
const { endX, originX, endY, topTotal, markHeight } = this.propItems;
|
|
471
|
-
if (!
|
|
467
|
+
if (!markHeight || !obj.list) {
|
|
472
468
|
return;
|
|
473
469
|
}
|
|
474
470
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
const marginLeft =
|
|
471
|
+
topTotal.width && this.canvas.add(this.drawLine([endX, endY - 1, endX, endY + markHeight], { ...this.defaultRectStyle }));
|
|
472
|
+
topTotal.width && this.canvas.add(this.drawLine([originX, endY + markHeight, endX, endY + markHeight], { ...this.defaultRectStyle }));
|
|
473
|
+
// const textList = [];
|
|
474
|
+
const marginLeft = this.templateData.left.leftYScalevalue.spaceGridNumber || defaultVaule.spaceGridNumber;
|
|
479
475
|
const left = originX - marginLeft * 4; // 默认减去4倍的左边距,防止最左边的数据与名称显示重合了
|
|
480
476
|
const title = new this.fabric.Text(String(obj.title), {
|
|
481
477
|
...defaultVaule.style,
|
|
@@ -487,31 +483,14 @@ export default {
|
|
|
487
483
|
top: endY + markHeight / 2,
|
|
488
484
|
type: 'mark'
|
|
489
485
|
});
|
|
490
|
-
this.
|
|
491
|
-
|
|
492
|
-
},
|
|
493
|
-
// 底部标记
|
|
494
|
-
drawBottomTextDataGroup() {
|
|
495
|
-
const { bottom: obj } = this.templateData;
|
|
496
|
-
const { originX, endY, markHeight, xCellWidth } = this.propItems;
|
|
497
|
-
if (!markHeight || !this.markData?.length) {
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
|
-
if (this.markObjs.length) {
|
|
501
|
-
[...this.markObjs].forEach(obj => this.canvas.remove(obj));
|
|
502
|
-
this.markObjs = [];
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
this.drawTopTotalLineAndTitle();
|
|
506
|
-
|
|
486
|
+
this.canvas.add(title);
|
|
487
|
+
// textList.push(title);
|
|
507
488
|
const _endY = this.extracorporealCirculationHeight ? endY + this.extracorporealCirculationHeight : endY;
|
|
508
489
|
const baseY = _endY + 2; // 目前固定10像素的下边距
|
|
509
490
|
const baseYLimit = endY - 2; // 目前固定10像素的上边距
|
|
510
491
|
const lineHeightText = (obj.style?.fontSize || 12) + 2;
|
|
511
492
|
const lineHeightImg = (obj.iconStyle?.height || 12) + 2;
|
|
512
493
|
const lineHeightSeq = (obj.seqStyle?.circle?.radius || 9) * 2 + 2;
|
|
513
|
-
let prevLeft = originX;
|
|
514
|
-
let prevCondition;
|
|
515
494
|
|
|
516
495
|
const setTop = (lineHeight, i, condition) => {
|
|
517
496
|
if (!~condition.limitIndex) {
|
|
@@ -528,16 +507,12 @@ export default {
|
|
|
528
507
|
}
|
|
529
508
|
return condition.y;
|
|
530
509
|
};
|
|
531
|
-
|
|
510
|
+
obj.list.forEach((item, index) => {
|
|
532
511
|
const condition = {
|
|
533
512
|
limitIndex: -1, // 标志点是否往上排列的标志,大于-1则表示需要往上排列
|
|
534
513
|
y: baseY
|
|
535
514
|
};
|
|
536
515
|
const x = this.computedX(item[0]);
|
|
537
|
-
// 相隔小于或等于一个小格的宽度就继承上个时间标记的高度继续计算定位,即错位显示
|
|
538
|
-
if (x - prevLeft <= xCellWidth) {
|
|
539
|
-
Object.assign(condition, prevCondition);
|
|
540
|
-
}
|
|
541
516
|
if (this.isLimit(item[0])) {
|
|
542
517
|
const pointList = [];
|
|
543
518
|
item[1].forEach(async (v, i) => {
|
|
@@ -571,12 +546,7 @@ export default {
|
|
|
571
546
|
}
|
|
572
547
|
}
|
|
573
548
|
});
|
|
574
|
-
|
|
575
|
-
prevCondition = condition;
|
|
576
|
-
Promise.all(pointList).then(res => {
|
|
577
|
-
this.markObjs.push(...res);
|
|
578
|
-
this.canvas.add(...res);
|
|
579
|
-
});
|
|
549
|
+
Promise.all(pointList).then(res => this.canvas.add(...res));
|
|
580
550
|
}
|
|
581
551
|
});
|
|
582
552
|
},
|
|
@@ -650,31 +620,9 @@ export default {
|
|
|
650
620
|
newVal: this.getXValue(point.left)
|
|
651
621
|
};
|
|
652
622
|
this.$emit('markChange', value);
|
|
653
|
-
this.updateMarkData(value);
|
|
654
|
-
this.drawBottomTextDataGroup();
|
|
655
|
-
this.canvas.discardActiveObject();
|
|
656
623
|
});
|
|
657
624
|
}
|
|
658
625
|
},
|
|
659
|
-
updateMarkData({ data, newVal }) {
|
|
660
|
-
const id = data.id;
|
|
661
|
-
let listIndex, index;
|
|
662
|
-
listIndex = this.markData.findIndex(v => {
|
|
663
|
-
const i = v[1].findIndex(k => k.data?.id === id);
|
|
664
|
-
i > -1 && (index = i);
|
|
665
|
-
return i > -1;
|
|
666
|
-
});
|
|
667
|
-
const obj = this.markData[listIndex][1].splice(index, 1)[0];
|
|
668
|
-
const newIndex = this.markData.findIndex(v => v[0] === newVal);
|
|
669
|
-
if (!~newIndex) {
|
|
670
|
-
this.markData.push([newVal, [obj]]);
|
|
671
|
-
} else {
|
|
672
|
-
this.markData[newIndex][1].push(obj);
|
|
673
|
-
}
|
|
674
|
-
const emptyIndex = this.markData.findIndex(v => v[1].length === 0);
|
|
675
|
-
!!~emptyIndex && this.markData.splice(emptyIndex, 1);
|
|
676
|
-
sortByTime(this.markData);
|
|
677
|
-
},
|
|
678
626
|
moveLimit(point) {
|
|
679
627
|
point.setCoords();
|
|
680
628
|
const { originX, endX, originY, endY, markHeight } = this.propItems;
|
|
@@ -155,9 +155,13 @@ export default {
|
|
|
155
155
|
this.$emit('extracorporealCirculationChange', params);
|
|
156
156
|
const { index, key, data } = params;
|
|
157
157
|
this.extracorporealCirculation.list[index][key] = data;
|
|
158
|
-
this.drawExtracorporealCirculation();
|
|
158
|
+
this.drawExtracorporealCirculation(this.extracorporealCirculation);
|
|
159
159
|
this.canvas.discardActiveObject();
|
|
160
|
-
this.
|
|
160
|
+
this.canvas.forEachObject(obj => {
|
|
161
|
+
if (obj.type && obj.type === 'mark') {
|
|
162
|
+
obj.bringForward();
|
|
163
|
+
}
|
|
164
|
+
});
|
|
161
165
|
});
|
|
162
166
|
}
|
|
163
167
|
},
|
|
@@ -9,7 +9,7 @@ export function getTangent(angle) {
|
|
|
9
9
|
return +Math.tan((angle * Math.PI) / 180);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function nearlyEqual(v1, v2) {
|
|
13
13
|
return Math.abs(v1 - v2) <= 0.0001;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -79,11 +79,3 @@ export function getIntersectionPoint(a, b, c, d) {
|
|
|
79
79
|
// 否则不相交
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
export function sortByTime(list = []) {
|
|
84
|
-
list.sort((a, b) => {
|
|
85
|
-
return Date.parse(a[0]) - Date.parse(b[0]);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
return list;
|
|
89
|
-
}
|