cnhis-design-vue 2.1.116 → 2.1.119
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 +49 -13
- 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 +3813 -3631
- 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 +573 -75
- package/es/fabric-chart/style.css +1 -1
- package/es/form/index.js +8 -8
- package/es/form-model/index.js +8 -8
- package/es/form-table/index.js +66 -66
- package/es/full-calendar/index.js +436 -513
- package/es/full-calendar/style.css +1 -1
- package/es/index/index.js +2677 -1881
- 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 +1 -1
- package/es/scale-view/index.js +27 -27
- 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 +480 -301
- package/es/table-filter/style.css +1 -1
- 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 +43341 -21890
- package/lib/cui.umd.js +43341 -21890
- package/lib/cui.umd.min.js +82 -82
- package/package.json +1 -1
- package/packages/big-table/src/BigTable.vue +30 -433
- package/packages/big-table/src/utils/bigTableProps.js +3 -1
- package/packages/big-table/src/utils/headerFilter.js +494 -0
- package/packages/button/src/ButtonPrint/js/print.es.min.js +3 -3
- package/packages/fabric-chart/src/FabricChart.vue +1 -1
- package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +6 -6
- package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +6 -6
- package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +14 -10
- package/packages/fabric-chart/src/mixins/draw.js +97 -1
- package/packages/fabric-chart/src/mixins/drawExtracorporealCirculation.js +196 -0
- package/packages/fabric-chart/src/mixins/fabricCommon.js +1 -1
- package/packages/fabric-chart/src/utils/index.js +81 -0
- package/packages/full-calendar/src/FullCalendar.vue +96 -60
- package/packages/full-calendar/src/components/Tag.vue +3 -3
- package/packages/full-calendar/src/components/TagDetail.vue +3 -3
- package/packages/full-calendar/src/utils/index.js +14 -0
- package/packages/table-filter/src/base-search-com/BaseSearch.vue +1 -0
- package/packages/table-filter/src/components/multi-select/multi-select.vue +1 -1
- package/packages/table-filter/src/components/render-widget/components/SelectDynamic.vue +1 -1
- package/packages/table-filter/src/components/render-widget/index.vue +2 -2
- package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +41 -38
- package/packages/table-filter/src/mixins/mixins.js +100 -17
- package/packages/table-filter/src/quick-search/QuickSearch.vue +38 -33
- package/packages/fabric-chart/src/mixins/type.js +0 -6
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: 'drawExtracorporealCirculation',
|
|
5
|
+
data() {
|
|
6
|
+
this.extracorporealCirculation = cloneDeep(this.templateData.bottom?.extracorporealCirculation);
|
|
7
|
+
this.extracorporealCirculationObjs = [];
|
|
8
|
+
return {};
|
|
9
|
+
},
|
|
10
|
+
components: {},
|
|
11
|
+
methods: {
|
|
12
|
+
drawExtracorporealCirculation(extracorporealCirculation) {
|
|
13
|
+
const { endX, originX, endY, markHeight, canvasWidth } = this.propItems;
|
|
14
|
+
if (!markHeight || !extracorporealCirculation || !extracorporealCirculation.list?.length) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (this.extracorporealCirculationObjs.length) {
|
|
18
|
+
[...this.extracorporealCirculationObjs].forEach(obj => this.canvas.remove(obj));
|
|
19
|
+
this.extracorporealCirculationObjs = [];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const { height = 20, extracorporealCirculationStyle, ascendAortaStyle, list = [] } = extracorporealCirculation;
|
|
23
|
+
const y2 = endY + height;
|
|
24
|
+
|
|
25
|
+
let prevEndX;
|
|
26
|
+
let prevLine;
|
|
27
|
+
|
|
28
|
+
list.forEach((item, index) => {
|
|
29
|
+
const xList = this.getExtracorporealCirculationX(item);
|
|
30
|
+
const idx = xList.findIndex(x => x > 0 && x < canvasWidth);
|
|
31
|
+
if (idx === -1) return;
|
|
32
|
+
|
|
33
|
+
let prevShadowBox;
|
|
34
|
+
xList.forEach((x, i) => {
|
|
35
|
+
const nextX = xList[i + 1];
|
|
36
|
+
const prevX = xList[i - 1];
|
|
37
|
+
if (isValid(x) || isValid(nextX)) {
|
|
38
|
+
const x1 = isValid(x) ? x : originX;
|
|
39
|
+
const x2 = isValid(nextX) ? nextX : endX;
|
|
40
|
+
const prevX1 = isValid(prevX) ? prevX : originX;
|
|
41
|
+
const shadowBox = {};
|
|
42
|
+
if (i < xList.length - 1) {
|
|
43
|
+
shadowBox.params = [x1, x2, y2, [0, 2].includes(i) ? extracorporealCirculationStyle : ascendAortaStyle];
|
|
44
|
+
shadowBox.shadowObjs = this.drawShadowBox(...shadowBox.params);
|
|
45
|
+
}
|
|
46
|
+
if (isValid(x)) {
|
|
47
|
+
const key = getKey(i);
|
|
48
|
+
const optLine = this.drawOptLine([x, endY, x, y2], {
|
|
49
|
+
origin: {
|
|
50
|
+
index,
|
|
51
|
+
key,
|
|
52
|
+
data: item[key]
|
|
53
|
+
},
|
|
54
|
+
limitX: {
|
|
55
|
+
x1: i === 0 ? prevEndX ?? originX : prevX1,
|
|
56
|
+
x2
|
|
57
|
+
},
|
|
58
|
+
...([1, 2, 3].includes(i) ? { leftShadowBox: prevShadowBox } : {}),
|
|
59
|
+
...([0, 1, 2].includes(i) ? { rightShadowBox: shadowBox } : {})
|
|
60
|
+
});
|
|
61
|
+
if (i === xList.length - 1) {
|
|
62
|
+
prevEndX = x;
|
|
63
|
+
prevLine = optLine;
|
|
64
|
+
}
|
|
65
|
+
if (i === 0 && prevLine) {
|
|
66
|
+
prevLine.limitX.x2 = shadowBox.params[0];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
prevShadowBox = shadowBox;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
function isValid(x) {
|
|
75
|
+
return x && x > 0 && x < canvasWidth;
|
|
76
|
+
}
|
|
77
|
+
function getKey(i) {
|
|
78
|
+
switch (i) {
|
|
79
|
+
case 0:
|
|
80
|
+
return 'extracorporealCirculationStart';
|
|
81
|
+
case 1:
|
|
82
|
+
return 'closeAscendAorta';
|
|
83
|
+
case 2:
|
|
84
|
+
return 'openAscendAorta';
|
|
85
|
+
case 3:
|
|
86
|
+
return 'extracorporealCirculationEnd';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
drawOptLine(coordinate, props) {
|
|
91
|
+
const optLine = new this.fabric.Line(coordinate, {
|
|
92
|
+
...props,
|
|
93
|
+
stroke: 'transparent',
|
|
94
|
+
strokeWidth: 5,
|
|
95
|
+
hasControls: false,
|
|
96
|
+
hasBorders: false,
|
|
97
|
+
hoverCursor: 'e-resize',
|
|
98
|
+
lockMovementY: true,
|
|
99
|
+
originX: 'center'
|
|
100
|
+
});
|
|
101
|
+
this.setExtracorporealCirculationEvent(optLine);
|
|
102
|
+
this.canvas.add(optLine);
|
|
103
|
+
this.extracorporealCirculationObjs.push(optLine);
|
|
104
|
+
return optLine;
|
|
105
|
+
},
|
|
106
|
+
setExtracorporealCirculationEvent(optLine) {
|
|
107
|
+
this.setPopup(optLine);
|
|
108
|
+
if (this.eventStyle.evented) {
|
|
109
|
+
optLine.on('moving', () => {
|
|
110
|
+
const { left, limitX } = optLine;
|
|
111
|
+
if (left < limitX.x1) {
|
|
112
|
+
optLine.setCoords().set({ x1: limitX.x1, x2: limitX.x1 });
|
|
113
|
+
}
|
|
114
|
+
if (left > limitX.x2) {
|
|
115
|
+
optLine.setCoords().set({ x1: limitX.x2, x2: limitX.x2 });
|
|
116
|
+
}
|
|
117
|
+
this.updateShadowBox(optLine, 'left');
|
|
118
|
+
this.updateShadowBox(optLine, 'right');
|
|
119
|
+
this.showDrapPopup(optLine);
|
|
120
|
+
});
|
|
121
|
+
optLine.on('moved', () => {
|
|
122
|
+
this.isDropVisible = false;
|
|
123
|
+
const params = optLine.origin;
|
|
124
|
+
params.data.time = this.getXValue(optLine.left);
|
|
125
|
+
this.$emit('extracorporealCirculationChange', params);
|
|
126
|
+
const { index, key, data } = params;
|
|
127
|
+
this.extracorporealCirculation.list[index][key] = data;
|
|
128
|
+
this.drawExtracorporealCirculation(this.extracorporealCirculation);
|
|
129
|
+
this.canvas.discardActiveObject();
|
|
130
|
+
this.canvas.forEachObject(obj => {
|
|
131
|
+
if (obj.type && obj.type === 'mark') {
|
|
132
|
+
obj.bringForward();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
updateShadowBox(optLine, direction) {
|
|
139
|
+
const { shadowObjs, params } = optLine[`${direction}ShadowBox`] || {};
|
|
140
|
+
if (!shadowObjs || !params) return;
|
|
141
|
+
shadowObjs.forEach(obj => this.canvas.remove(obj));
|
|
142
|
+
const idx = direction === 'left' ? 1 : 0;
|
|
143
|
+
params[idx] = optLine.left;
|
|
144
|
+
const _shadowObjs = this.drawShadowBox(...params);
|
|
145
|
+
optLine[`${direction}ShadowBox`] = {
|
|
146
|
+
shadowObjs: _shadowObjs,
|
|
147
|
+
params
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
drawShadowBox(x1, x2, y2, { mode, style }) {
|
|
151
|
+
const { endY } = this.propItems;
|
|
152
|
+
const _style = { ...style };
|
|
153
|
+
if (_style.angle) delete _style.angle;
|
|
154
|
+
const points = [
|
|
155
|
+
[x1, endY],
|
|
156
|
+
[x2, endY],
|
|
157
|
+
[x2, y2],
|
|
158
|
+
[x1, y2]
|
|
159
|
+
];
|
|
160
|
+
const polygon = new this.fabric.Polygon(
|
|
161
|
+
points.map(v => ({ x: v[0], y: v[1] })),
|
|
162
|
+
{
|
|
163
|
+
...this.defaultLineStyle,
|
|
164
|
+
..._style,
|
|
165
|
+
stroke: 'transparent',
|
|
166
|
+
...(['slash'].includes(mode) ? { fill: 'transparent' } : {})
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
const shadowLines = [];
|
|
170
|
+
if (['slash'].includes(mode)) {
|
|
171
|
+
// 斜线阴影模式
|
|
172
|
+
shadowLines.push(...this.drawShadow(points, style.angle, _style.space, _style));
|
|
173
|
+
}
|
|
174
|
+
this.canvas.add(polygon, ...shadowLines);
|
|
175
|
+
this.extracorporealCirculationObjs.push(...[polygon, ...shadowLines]);
|
|
176
|
+
return [polygon, ...shadowLines];
|
|
177
|
+
},
|
|
178
|
+
getExtracorporealCirculationX(item) {
|
|
179
|
+
const { extracorporealCirculationStart, closeAscendAorta, openAscendAorta, extracorporealCirculationEnd } = item;
|
|
180
|
+
let x1, x2, x3, x4;
|
|
181
|
+
if (extracorporealCirculationStart) {
|
|
182
|
+
x1 = this.computedX(extracorporealCirculationStart.time);
|
|
183
|
+
}
|
|
184
|
+
if (closeAscendAorta) {
|
|
185
|
+
x2 = this.computedX(closeAscendAorta.time);
|
|
186
|
+
}
|
|
187
|
+
if (openAscendAorta) {
|
|
188
|
+
x3 = this.computedX(openAscendAorta.time);
|
|
189
|
+
}
|
|
190
|
+
if (extracorporealCirculationEnd) {
|
|
191
|
+
x4 = this.computedX(extracorporealCirculationEnd.time);
|
|
192
|
+
}
|
|
193
|
+
return [x1, x2, x3, x4];
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export const isNumber = num => {
|
|
2
|
+
return typeof num === 'number' && Number.isFinite(num);
|
|
3
|
+
};
|
|
4
|
+
export const isObject = obj => {
|
|
5
|
+
return Object.prototype.toString.call(obj) === '[object Object]';
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export function getTangent(angle) {
|
|
9
|
+
return +Math.tan((angle * Math.PI) / 180);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function nearlyEqual(v1, v2) {
|
|
13
|
+
return Math.abs(v1 - v2) <= 0.0001;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function sortPoints(points) {
|
|
17
|
+
return points.sort((a, b) => a[1] - b[1]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function uniquePoints(points) {
|
|
21
|
+
return points.reduce((fin, point) => {
|
|
22
|
+
if (!hasPoint(fin, point)) fin.push(point);
|
|
23
|
+
return fin;
|
|
24
|
+
}, []);
|
|
25
|
+
|
|
26
|
+
function hasPoint(points, point) {
|
|
27
|
+
return points.some(p => nearlyEqual(p[0], point[0]) && nearlyEqual(p[1], point[1]));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function isInPolygon(checkPoint, polygonPoints) {
|
|
32
|
+
let counter = 0;
|
|
33
|
+
let xinters;
|
|
34
|
+
let p1, p2;
|
|
35
|
+
const pointCount = polygonPoints.length;
|
|
36
|
+
p1 = polygonPoints[0];
|
|
37
|
+
|
|
38
|
+
for (let i = 1; i <= pointCount; i++) {
|
|
39
|
+
p2 = polygonPoints[i % pointCount];
|
|
40
|
+
if (checkPoint[0] > Math.min(p1[0], p2[0]) && checkPoint[0] <= Math.max(p1[0], p2[0])) {
|
|
41
|
+
if (checkPoint[1] <= Math.max(p1[1], p2[1])) {
|
|
42
|
+
if (p1[0] != p2[0]) {
|
|
43
|
+
xinters = ((checkPoint[0] - p1[0]) * (p2[1] - p1[1])) / (p2[0] - p1[0]) + p1[1];
|
|
44
|
+
if (p1[1] == p2[1] || checkPoint[1] <= xinters) {
|
|
45
|
+
counter++;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
p1 = p2;
|
|
51
|
+
}
|
|
52
|
+
return counter % 2 !== 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function getIntersectionPoint(a, b, c, d) {
|
|
56
|
+
/** 1 解线性方程组, 求线段交点. **/
|
|
57
|
+
// 如果分母为0 则平行或共线, 不相交
|
|
58
|
+
const denominator = (b[1] - a[1]) * (d[0] - c[0]) - (a[0] - b[0]) * (c[1] - d[1]);
|
|
59
|
+
if (denominator === 0) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 线段所在直线的交点坐标 (x , y)
|
|
64
|
+
const x = ((b[0] - a[0]) * (d[0] - c[0]) * (c[1] - a[1]) + (b[1] - a[1]) * (d[0] - c[0]) * a[0] - (d[1] - c[1]) * (b[0] - a[0]) * c[0]) / denominator;
|
|
65
|
+
const y = -((b[1] - a[1]) * (d[1] - c[1]) * (c[0] - a[0]) + (b[0] - a[0]) * (d[1] - c[1]) * a[1] - (d[0] - c[0]) * (b[1] - a[1]) * c[1]) / denominator;
|
|
66
|
+
|
|
67
|
+
/** 2 判断交点是否在两条线段上 **/
|
|
68
|
+
if (
|
|
69
|
+
// 交点在线段1上
|
|
70
|
+
((x - a[0]) * (x - b[0]) < 0 || nearlyEqual(x, a[0]) || nearlyEqual(x, b[0])) &&
|
|
71
|
+
((y - a[1]) * (y - b[1]) < 0 || nearlyEqual(y, a[1]) || nearlyEqual(y, b[1])) &&
|
|
72
|
+
// 且交点也在线段2上
|
|
73
|
+
((x - c[0]) * (x - d[0]) < 0 || nearlyEqual(x, c[0]) || nearlyEqual(x, d[0])) &&
|
|
74
|
+
((y - c[1]) * (y - d[1]) < 0 || nearlyEqual(y, c[1]) || nearlyEqual(y, d[1]))
|
|
75
|
+
) {
|
|
76
|
+
// 返回交点p
|
|
77
|
+
return [x, y];
|
|
78
|
+
}
|
|
79
|
+
// 否则不相交
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
</div>
|
|
41
41
|
|
|
42
42
|
<TagDetail v-on="$listeners" ref="tagDetailRef"></TagDetail>
|
|
43
|
+
|
|
44
|
+
<div class="c-full-calendar__mask" v-if="!editable"></div>
|
|
43
45
|
</div>
|
|
44
46
|
</template>
|
|
45
47
|
|
|
@@ -55,11 +57,8 @@ import Tag from './components/Tag.vue';
|
|
|
55
57
|
import ListTag from './components/ListTag.vue';
|
|
56
58
|
import TagDetail from './components/TagDetail.vue';
|
|
57
59
|
// import SvgIcon from '@/component/svg/index.vue';
|
|
58
|
-
import { axiosInstance, getScheduleListApi, getScheduleSettingApi, getScheduleDataApi, queryScheduleListApi, saveOrUpdateScheduleApi, delScheduleApi } from './api';
|
|
59
60
|
import vexutils, { moment } from '@/utils/vexutils';
|
|
60
|
-
import {
|
|
61
|
-
|
|
62
|
-
window.moment = moment;
|
|
61
|
+
import { formatDate, weekIsMonth, viewMap, getAddTime } from './utils';
|
|
63
62
|
|
|
64
63
|
export default create({
|
|
65
64
|
name: 'full-calendar',
|
|
@@ -77,13 +76,26 @@ export default create({
|
|
|
77
76
|
[Icon.name]: Icon
|
|
78
77
|
},
|
|
79
78
|
props: {
|
|
80
|
-
serverPrefix: { type: String, default: 'inbox' },
|
|
79
|
+
// serverPrefix: { type: String, default: 'inbox' },
|
|
81
80
|
// userInfo: { type: Object, default: () => {} },
|
|
82
|
-
orgId: { type: String },
|
|
83
|
-
userId: { type: String },
|
|
84
|
-
token: { type: String },
|
|
81
|
+
// orgId: { type: String },
|
|
82
|
+
// userId: { type: String },
|
|
83
|
+
// token: { type: String },
|
|
84
|
+
editable: { type: Boolean, default: true },
|
|
85
85
|
showSearchHeader: { type: Boolean },
|
|
86
|
-
showSidebar: { type: Boolean }
|
|
86
|
+
showSidebar: { type: Boolean },
|
|
87
|
+
queryScheduleList: {
|
|
88
|
+
type: Function,
|
|
89
|
+
default: () => Promise.resolve([])
|
|
90
|
+
},
|
|
91
|
+
saveOrUpdateSchedule: {
|
|
92
|
+
type: Function,
|
|
93
|
+
default: () => Promise.resolve(true)
|
|
94
|
+
},
|
|
95
|
+
delSchedule: {
|
|
96
|
+
type: Function,
|
|
97
|
+
default: () => Promise.resolve(true)
|
|
98
|
+
}
|
|
87
99
|
},
|
|
88
100
|
computed: {
|
|
89
101
|
disabledToday() {
|
|
@@ -224,73 +236,60 @@ export default create({
|
|
|
224
236
|
};
|
|
225
237
|
},
|
|
226
238
|
beforeCreate() {
|
|
227
|
-
axiosInstance.interceptors.request.use(config => {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
});
|
|
232
|
-
},
|
|
233
|
-
async created() {
|
|
234
|
-
// await this.queryScheduleList();
|
|
235
|
-
// await this.getSchedulerList();
|
|
236
|
-
// await this.getSchedulerData();
|
|
239
|
+
// axiosInstance.interceptors.request.use(config => {
|
|
240
|
+
// config.headers['Authorization'] = 'bearer ' + this.token;
|
|
241
|
+
// config.baseURL = '/' + this.serverPrefix;
|
|
242
|
+
// return config;
|
|
243
|
+
// });
|
|
237
244
|
},
|
|
245
|
+
async created() {},
|
|
238
246
|
async mounted() {
|
|
239
247
|
this.calendar = this.$refs.fullCalendar.calendar;
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
// this.loading = true;
|
|
243
|
-
// this.calendar = this.$refs.fullCalendar.calendar;
|
|
244
|
-
// // await this.getScheduleSettingt();
|
|
245
|
-
// // await this.getSchedulerList();
|
|
246
|
-
// // await this.getSchedulerData();
|
|
247
|
-
// } catch (err) {
|
|
248
|
-
// this.loading = false;
|
|
249
|
-
// } finally {
|
|
250
|
-
// this.loading = false;
|
|
251
|
-
// }
|
|
248
|
+
this.setViewTime();
|
|
249
|
+
await this._queryScheduleList();
|
|
252
250
|
},
|
|
253
251
|
methods: {
|
|
254
|
-
async
|
|
252
|
+
async _queryScheduleList() {
|
|
255
253
|
this.loading = true;
|
|
256
254
|
try {
|
|
257
|
-
const
|
|
258
|
-
...this.currentDate
|
|
259
|
-
userId: this.userId,
|
|
260
|
-
orgId: this.orgId
|
|
255
|
+
const res = await this.queryScheduleList({
|
|
256
|
+
...this.currentDate
|
|
257
|
+
// userId: this.userId,
|
|
258
|
+
// orgId: this.orgId
|
|
261
259
|
});
|
|
262
|
-
if (!data.success) return;
|
|
260
|
+
// if (!data.success) return;
|
|
263
261
|
|
|
264
|
-
if (vexutils.isArray(
|
|
265
|
-
this.calendarOptions.events =
|
|
262
|
+
if (vexutils.isArray(res)) {
|
|
263
|
+
this.calendarOptions.events = res.map(item => ({ ...item, start: item.startTime, end: item.endTime }));
|
|
266
264
|
} else {
|
|
267
265
|
this.calendarOptions.events = [];
|
|
268
266
|
}
|
|
269
|
-
// this.dateValue && this.calendar.gotoDate(this.dateValue._d);
|
|
270
267
|
} catch (error) {
|
|
271
268
|
console.log(error);
|
|
272
269
|
} finally {
|
|
273
270
|
this.loading = false;
|
|
274
271
|
}
|
|
275
272
|
},
|
|
276
|
-
async
|
|
273
|
+
async _saveOrUpdateSchedule(params) {
|
|
274
|
+
this.loading = true;
|
|
277
275
|
try {
|
|
278
|
-
|
|
279
|
-
if (data.success) this.$message.success('保存成功');
|
|
280
|
-
await this.
|
|
276
|
+
await this.saveOrUpdateSchedule(params);
|
|
277
|
+
// if (data.success) this.$message.success('保存成功');
|
|
278
|
+
await this._queryScheduleList();
|
|
281
279
|
} catch (error) {
|
|
282
280
|
console.log(error);
|
|
283
281
|
} finally {
|
|
284
282
|
this.loading = false;
|
|
285
283
|
}
|
|
286
284
|
},
|
|
287
|
-
async
|
|
285
|
+
async _delSchedule(params) {
|
|
286
|
+
this.loading = true;
|
|
288
287
|
try {
|
|
289
|
-
const data = await
|
|
290
|
-
if (data
|
|
291
|
-
this.$message.success('删除成功');
|
|
288
|
+
const data = await this.delSchedule(params);
|
|
289
|
+
if (data) {
|
|
290
|
+
// this.$message.success('删除成功');
|
|
292
291
|
// this.calendarOptions.events = this.calendarOptions.events.filter(item => item.scheduleId === params.scheduleId);
|
|
293
|
-
await this.
|
|
292
|
+
await this._queryScheduleList();
|
|
294
293
|
}
|
|
295
294
|
} catch (error) {
|
|
296
295
|
console.log(error);
|
|
@@ -349,28 +348,48 @@ export default create({
|
|
|
349
348
|
handleCurrentDateChange() {
|
|
350
349
|
const date = moment(this.dateValue).format('YYYY-MM-DD');
|
|
351
350
|
let currentDate = {};
|
|
351
|
+
|
|
352
352
|
switch (this.viewType) {
|
|
353
353
|
case 'day':
|
|
354
354
|
currentDate = formatDate(date, 'day');
|
|
355
355
|
break;
|
|
356
|
-
case '
|
|
357
|
-
currentDate = formatDate(date, '
|
|
356
|
+
case 'list':
|
|
357
|
+
currentDate = formatDate(date, 'month');
|
|
358
358
|
break;
|
|
359
359
|
default:
|
|
360
|
-
|
|
360
|
+
this.setViewTime();
|
|
361
361
|
break;
|
|
362
362
|
}
|
|
363
363
|
Object.assign(this.currentDate, currentDate);
|
|
364
|
-
this.
|
|
364
|
+
this._queryScheduleList();
|
|
365
|
+
},
|
|
366
|
+
setViewTime() {
|
|
367
|
+
const currentDate = {};
|
|
368
|
+
const { activeStart, activeEnd } = this.calendar.view;
|
|
369
|
+
currentDate.startTime = moment(activeStart)
|
|
370
|
+
.clone()
|
|
371
|
+
.startOf('day')
|
|
372
|
+
.format('YYYY-MM-DD HH:mm:ss');
|
|
373
|
+
currentDate.endTime = moment(activeEnd)
|
|
374
|
+
.clone()
|
|
375
|
+
.subtract(1, 'day')
|
|
376
|
+
.endOf('day')
|
|
377
|
+
.format('YYYY-MM-DD HH:mm:ss');
|
|
378
|
+
|
|
379
|
+
Object.assign(this.currentDate, currentDate);
|
|
365
380
|
},
|
|
366
381
|
handleAdd() {
|
|
367
|
-
this.$emit('add',
|
|
382
|
+
this.$emit('add', getAddTime(this.dateValue));
|
|
368
383
|
},
|
|
369
384
|
handleSelect(event, type = 'add') {
|
|
370
385
|
const { start, end, extendedProps, title } = event;
|
|
371
|
-
const startTime =
|
|
372
|
-
const endTime = moment(end).format('YYYY-MM-DD HH:mm:ss');
|
|
386
|
+
const { startTime, endTime } = getAddTime(start);
|
|
373
387
|
const params = { ...extendedProps, startTime, endTime, title };
|
|
388
|
+
if (type === 'edit') {
|
|
389
|
+
params.startTime = moment(start).format('YYYY-MM-DD HH:mm:ss');
|
|
390
|
+
params.endTime = moment(end).format('YYYY-MM-DD HH:mm:ss');
|
|
391
|
+
}
|
|
392
|
+
const that = this;
|
|
374
393
|
if (moment(start).valueOf() < moment().valueOf()) {
|
|
375
394
|
this.$confirm({
|
|
376
395
|
title: '提示',
|
|
@@ -378,16 +397,24 @@ export default create({
|
|
|
378
397
|
okText: '确定',
|
|
379
398
|
cancelText: '取消',
|
|
380
399
|
onOk: () => {
|
|
381
|
-
|
|
400
|
+
setEmit();
|
|
382
401
|
},
|
|
383
402
|
onCancel: () => {
|
|
384
403
|
if (type === 'edit') {
|
|
385
|
-
this.
|
|
404
|
+
this._queryScheduleList();
|
|
386
405
|
}
|
|
387
406
|
}
|
|
388
407
|
});
|
|
389
408
|
} else {
|
|
390
|
-
|
|
409
|
+
setEmit();
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
function setEmit() {
|
|
413
|
+
if (type === 'add') {
|
|
414
|
+
that.$emit('add', params);
|
|
415
|
+
} else {
|
|
416
|
+
that._saveOrUpdateSchedule(params);
|
|
417
|
+
}
|
|
391
418
|
}
|
|
392
419
|
},
|
|
393
420
|
handleDrop({ event, oldEvent }) {
|
|
@@ -419,10 +446,18 @@ export default create({
|
|
|
419
446
|
@primary-color: #2d7aff;
|
|
420
447
|
|
|
421
448
|
.c-full-calendar {
|
|
449
|
+
position: relative;
|
|
422
450
|
display: flex;
|
|
423
451
|
flex-flow: column nowrap;
|
|
424
452
|
width: 100%;
|
|
425
453
|
height: 100%;
|
|
454
|
+
&__mask {
|
|
455
|
+
position: absolute;
|
|
456
|
+
z-index: 1;
|
|
457
|
+
width: 100%;
|
|
458
|
+
height: 100%;
|
|
459
|
+
background-color: rgba(0, 0, 0, 0);
|
|
460
|
+
}
|
|
426
461
|
/deep/ .tag-detail-wrpper {
|
|
427
462
|
display: none;
|
|
428
463
|
}
|
|
@@ -452,7 +487,7 @@ export default create({
|
|
|
452
487
|
.main-wrapper {
|
|
453
488
|
display: flex;
|
|
454
489
|
width: 100%;
|
|
455
|
-
|
|
490
|
+
height: 100%;
|
|
456
491
|
.full-calendar {
|
|
457
492
|
display: flex;
|
|
458
493
|
flex-flow: column nowrap;
|
|
@@ -561,6 +596,7 @@ export default create({
|
|
|
561
596
|
/deep/ .full-calendar__body {
|
|
562
597
|
width: 100%;
|
|
563
598
|
flex: 1;
|
|
599
|
+
overflow-y: scroll;
|
|
564
600
|
box-sizing: border-box;
|
|
565
601
|
|
|
566
602
|
.fc-header-toolbar {
|
|
@@ -21,6 +21,7 @@ import { Tooltip, Icon } from 'ant-design-vue';
|
|
|
21
21
|
import { moment } from '@/utils/vexutils';
|
|
22
22
|
import tippy from 'tippy.js';
|
|
23
23
|
import 'tippy.js/dist/tippy.css';
|
|
24
|
+
import { getAddTime } from '../utils';
|
|
24
25
|
|
|
25
26
|
export default {
|
|
26
27
|
name: 'tag',
|
|
@@ -90,7 +91,7 @@ export default {
|
|
|
90
91
|
const { startTime, endTime, scheduleId } = this.item;
|
|
91
92
|
switch (btn.type) {
|
|
92
93
|
case 'plus-square':
|
|
93
|
-
this.$emit('add',
|
|
94
|
+
this.$emit('add', getAddTime(startTime));
|
|
94
95
|
break;
|
|
95
96
|
case 'form':
|
|
96
97
|
this.$emit('edit', this.item);
|
|
@@ -102,8 +103,7 @@ export default {
|
|
|
102
103
|
okText: '确定',
|
|
103
104
|
cancelText: '取消',
|
|
104
105
|
onOk: () => {
|
|
105
|
-
this.$
|
|
106
|
-
this.tagDetailRef.$parent.delSchedule({ id: scheduleId });
|
|
106
|
+
this.tagDetailRef.$parent._delSchedule({ id: scheduleId });
|
|
107
107
|
},
|
|
108
108
|
onCancel() {}
|
|
109
109
|
});
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
<script>
|
|
37
37
|
import { Tooltip, Icon } from 'ant-design-vue';
|
|
38
38
|
import vexutils, { moment } from '@/utils/vexutils';
|
|
39
|
+
import { getAddTime } from '../utils';
|
|
39
40
|
|
|
40
41
|
export default {
|
|
41
42
|
name: 'tag-detail',
|
|
@@ -113,7 +114,7 @@ export default {
|
|
|
113
114
|
const { startTime, endTime, scheduleId } = this.item;
|
|
114
115
|
switch (btn.type) {
|
|
115
116
|
case 'plus-square':
|
|
116
|
-
this.$emit('add',
|
|
117
|
+
this.$emit('add', getAddTime(startTime));
|
|
117
118
|
break;
|
|
118
119
|
case 'form':
|
|
119
120
|
this.$emit('edit', this.item);
|
|
@@ -125,8 +126,7 @@ export default {
|
|
|
125
126
|
okText: '确定',
|
|
126
127
|
cancelText: '取消',
|
|
127
128
|
onOk: () => {
|
|
128
|
-
this.$
|
|
129
|
-
this.$parent.delSchedule({ id: scheduleId });
|
|
129
|
+
this.$parent._delSchedule({ id: scheduleId });
|
|
130
130
|
},
|
|
131
131
|
onCancel() {}
|
|
132
132
|
});
|
|
@@ -185,6 +185,20 @@ export function handleListRows(rows, v) {
|
|
|
185
185
|
return res;
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
export function getAddTime(start) {
|
|
189
|
+
const nearestHour = moment()
|
|
190
|
+
.clone()
|
|
191
|
+
.startOf('hour')
|
|
192
|
+
.add(1, 'hour');
|
|
193
|
+
const startTime = moment(start)
|
|
194
|
+
.set({ hour: nearestHour.hour(), minute: 0, second: 0 })
|
|
195
|
+
.format('YYYY-MM-DD HH:mm:ss');
|
|
196
|
+
const endTime = moment(startTime)
|
|
197
|
+
.add(1, 'hour')
|
|
198
|
+
.format('YYYY-MM-DD HH:mm:ss');
|
|
199
|
+
return { startTime, endTime };
|
|
200
|
+
}
|
|
201
|
+
|
|
188
202
|
export const viewMap = {
|
|
189
203
|
list: '列表',
|
|
190
204
|
day: '日',
|
|
@@ -75,11 +75,11 @@ export default {
|
|
|
75
75
|
return `unset`;
|
|
76
76
|
},
|
|
77
77
|
initComponentProps(cfg) {
|
|
78
|
-
const { widgetType, alias, title, placeholder: customPlaceholder, widgetCfg, fieldType } = cfg;
|
|
78
|
+
const { widgetType, alias, title, placeholder: customPlaceholder, widgetCfg, fieldType, explicitRequired } = cfg;
|
|
79
79
|
const { props, handlerProps } = WidgetCfgMaps.get(widgetType);
|
|
80
80
|
let Props = { ...props };
|
|
81
81
|
if (handlerProps) {
|
|
82
|
-
Props = handlerProps(Props, { ...widgetCfg, title: alias || title, fieldType, isQuick: this.isQuick });
|
|
82
|
+
Props = handlerProps(Props, { ...widgetCfg, title: alias || title, fieldType, isQuick: this.isQuick, explicitRequired });
|
|
83
83
|
}
|
|
84
84
|
if (customPlaceholder) {
|
|
85
85
|
Props.placeholder = customPlaceholder;
|