cy-element-ui 1.0.28 → 1.0.30
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 +23 -14
- package/lib/alert.js +4 -4
- package/lib/aside.js +2 -2
- package/lib/autocomplete.js +4 -4
- package/lib/avatar.js +2 -2
- package/lib/backtop.js +4 -4
- package/lib/badge.js +4 -4
- package/lib/breadcrumb-item.js +4 -4
- package/lib/breadcrumb.js +2 -2
- package/lib/button-group.js +2 -2
- package/lib/button.js +2 -2
- package/lib/calendar.js +6 -6
- package/lib/card.js +2 -2
- package/lib/carousel-item.js +4 -4
- package/lib/carousel.js +2 -2
- package/lib/cascader-panel.js +4 -4
- package/lib/cascader.js +4 -4
- package/lib/checkbox-button.js +4 -4
- package/lib/checkbox-group.js +2 -2
- package/lib/checkbox.js +4 -4
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +4 -4
- package/lib/collapse.js +2 -2
- package/lib/color-picker.js +45 -45
- package/lib/container.js +2 -2
- package/lib/date-picker.js +49 -45
- package/lib/descriptions-item.js +2 -2
- package/lib/descriptions.js +2 -2
- package/lib/dialog.js +4 -4
- package/lib/divider.js +4 -4
- package/lib/drawer.js +6 -6
- package/lib/dropdown-item.js +2 -2
- package/lib/dropdown-menu.js +2 -2
- package/lib/dropdown.js +10 -10
- package/lib/element-ui.common.js +1801 -388
- package/lib/empty.js +4 -4
- package/lib/fileUpload.js +978 -0
- package/lib/footer.js +2 -2
- package/lib/form-item.js +4 -4
- package/lib/form.js +4 -4
- package/lib/header.js +2 -2
- package/lib/icon.js +2 -2
- package/lib/image.js +12 -12
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +2 -2
- package/lib/input-number.js +2 -2
- package/lib/input.js +4 -4
- package/lib/link.js +2 -2
- package/lib/loading.js +4 -4
- package/lib/locale/format.js +0 -1
- package/lib/main.js +2 -2
- package/lib/menu-item-group.js +4 -4
- package/lib/menu-item.js +2 -2
- package/lib/menu.js +3 -3
- package/lib/message-box.js +7 -7
- package/lib/message.js +4 -4
- package/lib/notification.js +4 -4
- package/lib/option-group.js +2 -2
- package/lib/option.js +2 -2
- package/lib/page-header.js +2 -2
- package/lib/pagination.js +4 -4
- package/lib/popconfirm.js +12 -12
- package/lib/popover.js +4 -4
- package/lib/progress.js +4 -4
- package/lib/radio-button.js +4 -4
- package/lib/radio-group.js +2 -2
- package/lib/radio.js +4 -4
- package/lib/rate.js +9 -9
- package/lib/result.js +2 -2
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +2 -2
- package/lib/select.js +2 -2
- package/lib/skeleton-item.js +2 -2
- package/lib/skeleton.js +2 -2
- package/lib/slider.js +4 -4
- package/lib/spinner.js +2 -2
- package/lib/statistic.js +4 -4
- package/lib/step.js +4 -4
- package/lib/steps.js +11 -11
- package/lib/subTitle.js +293 -0
- package/lib/submenu.js +2 -3
- package/lib/switch.js +2 -2
- package/lib/tab-pane.js +2 -2
- package/lib/tabDialog.js +787 -0
- package/lib/table-column.js +4 -4
- package/lib/table.js +19 -16
- package/lib/tabs.js +4 -4
- package/lib/tag.js +2 -2
- package/lib/time-picker.js +2 -2
- package/lib/time-select.js +2 -2
- package/lib/timeline-item.js +4 -4
- package/lib/timeline.js +2 -2
- package/lib/tooltip.js +2 -2
- package/lib/transfer.js +7 -7
- package/lib/tree.js +11 -11
- package/lib/{treeselect.js → treeSelect.js} +31 -31
- package/lib/upload.js +14 -14
- package/package.json +5 -1
- package/packages/alert/src/main.vue +1 -1
- package/packages/autocomplete/src/autocomplete.vue +3 -3
- package/packages/avatar/src/main.vue +5 -5
- package/packages/backtop/src/main.vue +3 -3
- package/packages/badge/src/main.vue +1 -1
- package/packages/breadcrumb/src/breadcrumb-item.vue +1 -1
- package/packages/calendar/src/date-table.vue +3 -3
- package/packages/calendar/src/main.vue +5 -5
- package/packages/carousel/src/item.vue +1 -1
- package/packages/cascader/src/cascader.vue +2 -2
- package/packages/cascader-panel/src/cascader-menu.vue +4 -4
- package/packages/cascader-panel/src/node.js +3 -4
- package/packages/cascader-panel/src/store.js +1 -2
- package/packages/checkbox/src/checkbox-button.vue +8 -8
- package/packages/checkbox/src/checkbox.vue +1 -1
- package/packages/col/src/col.js +5 -5
- package/packages/collapse/src/collapse-item.vue +1 -1
- package/packages/color-picker/src/color.js +4 -4
- package/packages/color-picker/src/components/alpha-slider.vue +12 -12
- package/packages/color-picker/src/components/hue-slider.vue +6 -6
- package/packages/color-picker/src/components/picker-dropdown.vue +1 -1
- package/packages/color-picker/src/components/predefine.vue +4 -4
- package/packages/color-picker/src/components/sv-panel.vue +4 -4
- package/packages/color-picker/src/main.vue +8 -8
- package/packages/date-picker/src/basic/date-table.vue +19 -19
- package/packages/date-picker/src/basic/month-table.vue +8 -9
- package/packages/date-picker/src/basic/year-table.vue +38 -38
- package/packages/date-picker/src/panel/date-range.vue +1 -1
- package/packages/date-picker/src/panel/date.vue +5 -5
- package/packages/date-picker/src/panel/month-range.vue +1 -1
- package/packages/descriptions/src/descriptions-row.js +3 -3
- package/packages/descriptions/src/index.js +1 -1
- package/packages/divider/src/main.vue +1 -1
- package/packages/drawer/src/main.vue +2 -2
- package/packages/dropdown/src/dropdown.vue +1 -1
- package/packages/empty/src/index.vue +1 -1
- package/packages/fileUpload/index.js +8 -0
- package/packages/fileUpload/src/main.vue +430 -0
- package/packages/form/src/form-item.vue +3 -3
- package/packages/form/src/form.vue +1 -1
- package/packages/image/src/image-viewer.vue +4 -4
- package/packages/infinite-scroll/src/main.js +2 -3
- package/packages/input/src/calcTextareaHeight.js +2 -2
- package/packages/input/src/input.vue +15 -15
- package/packages/menu/src/menu-item-group.vue +1 -1
- package/packages/menu/src/menu.vue +4 -4
- package/packages/menu/src/submenu.vue +3 -4
- package/packages/message/src/main.js +1 -1
- package/packages/notification/src/main.js +1 -1
- package/packages/pagination/src/pager.vue +1 -1
- package/packages/popconfirm/src/main.vue +28 -28
- package/packages/popover/src/main.vue +1 -1
- package/packages/progress/src/progress.vue +10 -10
- package/packages/radio/src/radio-button.vue +2 -2
- package/packages/radio/src/radio.vue +1 -1
- package/packages/row/src/row.js +3 -3
- package/packages/scrollbar/src/main.js +2 -2
- package/packages/scrollbar/src/util.js +1 -1
- package/packages/slider/src/main.vue +2 -2
- package/packages/statistic/src/main.vue +6 -7
- package/packages/steps/src/step.vue +2 -2
- package/packages/steps/src/steps.vue +4 -4
- package/packages/subTitle/index.js +8 -0
- package/packages/subTitle/src/main.vue +33 -0
- package/packages/tabDialog/index.js +23 -0
- package/packages/tabDialog/src/dialog/drag.js +63 -0
- package/packages/tabDialog/src/dialog/dragHeight.js +34 -0
- package/packages/tabDialog/src/dialog/dragWidth.js +30 -0
- package/packages/tabDialog/src/main.vue +277 -0
- package/packages/table/src/filter-panel.vue +7 -7
- package/packages/table/src/store/index.js +1 -1
- package/packages/table/src/table-body.js +2 -2
- package/packages/table/src/table-column.js +1 -1
- package/packages/table/src/table-header.js +1 -1
- package/packages/table/src/table-layout.js +1 -1
- package/packages/table/src/table.vue +16 -16
- package/packages/tabs/src/tab-bar.vue +3 -3
- package/packages/tabs/src/tab-nav.vue +13 -13
- package/packages/tabs/src/tabs.vue +3 -3
- package/packages/tag/src/tag.vue +3 -3
- package/packages/theme-cy/lib/element.css +1 -0
- package/packages/theme-cy/lib/fileUpload.css +1 -0
- package/packages/theme-cy/lib/index.css +1 -1
- package/packages/theme-cy/lib/subTitle.css +1 -0
- package/packages/theme-cy/lib/tabDialog.css +1 -0
- package/packages/theme-cy/lib/treeSelect.css +1 -0
- package/packages/theme-cy/src/element.scss +45 -0
- package/packages/theme-cy/src/fileUpload.scss +30 -0
- package/packages/theme-cy/src/index.scss +5 -1
- package/packages/theme-cy/src/subTitle.scss +26 -0
- package/packages/theme-cy/src/tabDialog.scss +43 -0
- package/packages/theme-cy/src/{treeselect.scss → treeSelect.scss} +93 -87
- package/packages/timeline/src/item.vue +2 -2
- package/packages/tooltip/src/main.js +1 -1
- package/packages/tree/src/tree-node.vue +3 -3
- package/packages/treeSelect/index.js +8 -0
- package/packages/{treeselect → treeSelect}/src/main.vue +246 -243
- package/packages/upload/src/ajax.js +3 -3
- package/packages/upload/src/upload-list.vue +1 -1
- package/packages/upload/src/upload.vue +1 -1
- package/src/index.js +13 -5
- package/src/locale/format.js +1 -2
- package/src/mixins/migrating.js +2 -2
- package/src/utils/types.js +1 -1
- package/types/element-ui.d.ts +18 -5
- package/types/fileUpload.d.ts +5 -0
- package/types/subTitle.d.ts +5 -0
- package/types/tabDialog.d.ts +5 -0
- package/types/treeSelect.d.ts +5 -0
- package/packages/theme-cy/lib/treeselect.css +0 -1
- package/packages/treeselect/index.js +0 -8
- package/types/treeselect.d.ts +0 -5
|
@@ -4,35 +4,35 @@
|
|
|
4
4
|
v-model="visible"
|
|
5
5
|
trigger="click"
|
|
6
6
|
>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
<div class="el-popconfirm">
|
|
8
|
+
<p class="el-popconfirm__main">
|
|
9
|
+
<i
|
|
10
|
+
v-if="!hideIcon"
|
|
11
|
+
:class="icon"
|
|
12
|
+
class="el-popconfirm__icon"
|
|
13
|
+
:style="{color: iconColor}"
|
|
14
|
+
></i>
|
|
15
|
+
{{ title }}
|
|
16
|
+
</p>
|
|
17
|
+
<div class="el-popconfirm__action">
|
|
18
|
+
<el-button
|
|
19
|
+
size="mini"
|
|
20
|
+
:type="cancelButtonType"
|
|
21
|
+
@click="cancel"
|
|
22
|
+
>
|
|
23
|
+
{{ displayCancelButtonText }}
|
|
24
|
+
</el-button>
|
|
25
|
+
<el-button
|
|
26
|
+
size="mini"
|
|
27
|
+
:type="confirmButtonType"
|
|
28
|
+
@click="confirm"
|
|
29
|
+
>
|
|
30
|
+
{{ displayConfirmButtonText }}
|
|
31
|
+
</el-button>
|
|
32
|
+
</div>
|
|
32
33
|
</div>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</el-popover>
|
|
34
|
+
<slot name="reference" slot="reference"></slot>
|
|
35
|
+
</el-popover>
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
38
|
<script>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<div class="el-progress-bar" v-if="type === 'line'">
|
|
18
18
|
<div class="el-progress-bar__outer" :style="{height: strokeWidth + 'px', backgroundColor:defineBackColor}">
|
|
19
19
|
<div class="el-progress-bar__inner" :style="barStyle">
|
|
20
|
-
<div class="el-progress-bar__innerText" :style="{color:textColor}" v-if="showText && textInside">{{content}}</div>
|
|
20
|
+
<div class="el-progress-bar__innerText" :style="{color:textColor}" v-if="showText && textInside">{{ content }}</div>
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
v-if="showText && !textInside"
|
|
46
46
|
:style="{fontSize: progressTextSize + 'px', color:textColor}"
|
|
47
47
|
>
|
|
48
|
-
<template v-if="!status">{{content}}</template>
|
|
48
|
+
<template v-if="!status">{{ content }}</template>
|
|
49
49
|
<i v-else :class="iconClass"></i>
|
|
50
50
|
</div>
|
|
51
51
|
</div>
|
|
@@ -125,9 +125,9 @@
|
|
|
125
125
|
const isDashboard = this.type === 'dashboard';
|
|
126
126
|
return `
|
|
127
127
|
M 50 50
|
|
128
|
-
m 0 ${isDashboard ? '' : '-'}${radius}
|
|
129
|
-
a ${radius} ${radius} 0 1 1 0 ${isDashboard ? '-' : ''}${radius * 2}
|
|
130
|
-
a ${radius} ${radius} 0 1 1 0 ${isDashboard ? '' : '-'}${radius * 2}
|
|
128
|
+
m 0 ${ isDashboard ? '' : '-' }${ radius }
|
|
129
|
+
a ${ radius } ${ radius } 0 1 1 0 ${ isDashboard ? '-' : '' }${ radius * 2 }
|
|
130
|
+
a ${ radius } ${ radius } 0 1 1 0 ${ isDashboard ? '' : '-' }${ radius * 2 }
|
|
131
131
|
`;
|
|
132
132
|
},
|
|
133
133
|
perimeter() {
|
|
@@ -138,17 +138,17 @@
|
|
|
138
138
|
},
|
|
139
139
|
strokeDashoffset() {
|
|
140
140
|
const offset = -1 * this.perimeter * (1 - this.rate) / 2;
|
|
141
|
-
return `${offset}px`;
|
|
141
|
+
return `${ offset }px`;
|
|
142
142
|
},
|
|
143
143
|
trailPathStyle() {
|
|
144
144
|
return {
|
|
145
|
-
strokeDasharray: `${(this.perimeter * this.rate)}px, ${this.perimeter}px`,
|
|
145
|
+
strokeDasharray: `${ (this.perimeter * this.rate) }px, ${ this.perimeter }px`,
|
|
146
146
|
strokeDashoffset: this.strokeDashoffset
|
|
147
147
|
};
|
|
148
148
|
},
|
|
149
149
|
circlePathStyle() {
|
|
150
150
|
return {
|
|
151
|
-
strokeDasharray: `${this.perimeter * this.rate * (this.percentage / 100) }px, ${this.perimeter}px`,
|
|
151
|
+
strokeDasharray: `${ this.perimeter * this.rate * (this.percentage / 100) }px, ${ this.perimeter }px`,
|
|
152
152
|
strokeDashoffset: this.strokeDashoffset,
|
|
153
153
|
transition: 'stroke-dasharray 0.6s ease 0s, stroke 0.6s ease'
|
|
154
154
|
};
|
|
@@ -187,13 +187,13 @@
|
|
|
187
187
|
progressTextSize() {
|
|
188
188
|
return this.type === 'line'
|
|
189
189
|
? 12 + this.strokeWidth * 0.4
|
|
190
|
-
: this.width * 0.111111 + 2
|
|
190
|
+
: this.width * 0.111111 + 2;
|
|
191
191
|
},
|
|
192
192
|
content() {
|
|
193
193
|
if (typeof this.format === 'function') {
|
|
194
194
|
return this.format(this.percentage) || '';
|
|
195
195
|
} else {
|
|
196
|
-
return `${this.percentage}%`;
|
|
196
|
+
return `${ this.percentage }%`;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
},
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
:style="value === label ? activeStyle : null"
|
|
32
32
|
@keydown.stop>
|
|
33
33
|
<slot></slot>
|
|
34
|
-
<template v-if="!$slots.default">{{label}}</template>
|
|
34
|
+
<template v-if="!$slots.default">{{ label }}</template>
|
|
35
35
|
</span>
|
|
36
36
|
</label>
|
|
37
37
|
</template>
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
return {
|
|
87
87
|
backgroundColor: this._radioGroup.fill || '',
|
|
88
88
|
borderColor: this._radioGroup.fill || '',
|
|
89
|
-
boxShadow: this._radioGroup.fill ? `-1px 0 0 0 ${this._radioGroup.fill}` : '',
|
|
89
|
+
boxShadow: this._radioGroup.fill ? `-1px 0 0 0 ${ this._radioGroup.fill }` : '',
|
|
90
90
|
color: this._radioGroup.textColor || ''
|
|
91
91
|
};
|
|
92
92
|
},
|
package/packages/row/src/row.js
CHANGED
|
@@ -22,7 +22,7 @@ export default {
|
|
|
22
22
|
const ret = {};
|
|
23
23
|
|
|
24
24
|
if (this.gutter) {
|
|
25
|
-
ret.marginLeft = `-${this.gutter / 2}px`;
|
|
25
|
+
ret.marginLeft = `-${ this.gutter / 2 }px`;
|
|
26
26
|
ret.marginRight = ret.marginLeft;
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -34,8 +34,8 @@ export default {
|
|
|
34
34
|
return h(this.tag, {
|
|
35
35
|
class: [
|
|
36
36
|
'el-row',
|
|
37
|
-
this.justify !== 'start' ? `is-justify-${this.justify}` : '',
|
|
38
|
-
this.align ? `is-align-${this.align}` : '',
|
|
37
|
+
this.justify !== 'start' ? `is-justify-${ this.justify }` : '',
|
|
38
|
+
this.align ? `is-align-${ this.align }` : '',
|
|
39
39
|
{ 'el-row--flex': this.type === 'flex' }
|
|
40
40
|
],
|
|
41
41
|
style: this.style
|
|
@@ -44,8 +44,8 @@ export default {
|
|
|
44
44
|
let style = this.wrapStyle;
|
|
45
45
|
|
|
46
46
|
if (gutter) {
|
|
47
|
-
const gutterWith = `-${gutter}px`;
|
|
48
|
-
const gutterStyle = `margin-bottom: ${gutterWith}; margin-right: ${gutterWith};`;
|
|
47
|
+
const gutterWith = `-${ gutter }px`;
|
|
48
|
+
const gutterStyle = `margin-bottom: ${ gutterWith }; margin-right: ${ gutterWith };`;
|
|
49
49
|
|
|
50
50
|
if (Array.isArray(this.wrapStyle)) {
|
|
51
51
|
style = toObject(this.wrapStyle);
|
|
@@ -23,7 +23,7 @@ export const BAR_MAP = {
|
|
|
23
23
|
|
|
24
24
|
export function renderThumbStyle({ move, size, bar }) {
|
|
25
25
|
const style = {};
|
|
26
|
-
const translate = `translate${bar.axis}(${ move }%)`;
|
|
26
|
+
const translate = `translate${ bar.axis }(${ move }%)`;
|
|
27
27
|
|
|
28
28
|
style[bar.size] = size;
|
|
29
29
|
style.transform = translate;
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
this.secondValue = this.max;
|
|
402
402
|
}
|
|
403
403
|
this.oldValue = [this.firstValue, this.secondValue];
|
|
404
|
-
valuetext = `${this.firstValue}-${this.secondValue}`;
|
|
404
|
+
valuetext = `${ this.firstValue }-${ this.secondValue }`;
|
|
405
405
|
} else {
|
|
406
406
|
if (typeof this.value !== 'number' || isNaN(this.value)) {
|
|
407
407
|
this.firstValue = this.min;
|
|
@@ -414,7 +414,7 @@
|
|
|
414
414
|
this.$el.setAttribute('aria-valuetext', valuetext);
|
|
415
415
|
|
|
416
416
|
// label screen reader
|
|
417
|
-
this.$el.setAttribute('aria-label', this.label ? this.label : `slider between ${this.min} and ${this.max}`);
|
|
417
|
+
this.$el.setAttribute('aria-label', this.label ? this.label : `slider between ${ this.min } and ${ this.max }`);
|
|
418
418
|
|
|
419
419
|
this.resetSize();
|
|
420
420
|
window.addEventListener('resize', this.resetSize);
|
|
@@ -109,8 +109,8 @@ export default {
|
|
|
109
109
|
},
|
|
110
110
|
magnification(num, mulriple = 1000, groupSeparator = ',') {
|
|
111
111
|
// magnification factor
|
|
112
|
-
const level = String(mulriple).length
|
|
113
|
-
return num.replace(new RegExp(`(\\d)(?=(\\d{${level - 1}})+$)`, 'g'), `$1${groupSeparator}`);
|
|
112
|
+
const level = String(mulriple).length;
|
|
113
|
+
return num.replace(new RegExp(`(\\d)(?=(\\d{${ level - 1 }})+$)`, 'g'), `$1${ groupSeparator }`);
|
|
114
114
|
},
|
|
115
115
|
dispose() {
|
|
116
116
|
let { value, rate, groupSeparator } = this;
|
|
@@ -123,7 +123,7 @@ export default {
|
|
|
123
123
|
if (groupSeparator) {
|
|
124
124
|
integer = this.magnification(integer, rate, groupSeparator);
|
|
125
125
|
}
|
|
126
|
-
let result = `${integer}${decimal ? this.decimalSeparator + decimal : ''}`;
|
|
126
|
+
let result = `${ integer }${ decimal ? this.decimalSeparator + decimal : '' }`;
|
|
127
127
|
this.disposeValue = result;
|
|
128
128
|
return result;
|
|
129
129
|
},
|
|
@@ -158,7 +158,7 @@ export default {
|
|
|
158
158
|
timeUnits,
|
|
159
159
|
(con, item) => {
|
|
160
160
|
const name = item[0];
|
|
161
|
-
return con.replace(new RegExp(`${name}+`, 'g'), (match) => {
|
|
161
|
+
return con.replace(new RegExp(`${ name }+`, 'g'), (match) => {
|
|
162
162
|
let sum = chain(time).divide(item[1]).floor(0).value();
|
|
163
163
|
time -= multiply(sum, item[1]);
|
|
164
164
|
return padStart(String(sum), String(match).length, 0);
|
|
@@ -189,15 +189,14 @@ export default {
|
|
|
189
189
|
let { REFRESH_INTERVAL, timeTask, diffDate, formatTimeStr, stopTime, suspend } = this;
|
|
190
190
|
if (timeTask) return;
|
|
191
191
|
let than = this;
|
|
192
|
-
this.timeTask = setInterval(()=> {
|
|
192
|
+
this.timeTask = setInterval(() => {
|
|
193
193
|
let diffTiem = diffDate(timeVlaue, Date.now());
|
|
194
194
|
than.disposeValue = formatTimeStr(diffTiem);
|
|
195
195
|
stopTime(diffTiem);
|
|
196
196
|
}, REFRESH_INTERVAL);
|
|
197
197
|
this.$once('hook:beforeDestroy', () => {
|
|
198
198
|
suspend(true);
|
|
199
|
-
});
|
|
200
|
-
|
|
199
|
+
});
|
|
201
200
|
}
|
|
202
201
|
}
|
|
203
202
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
isSimple && 'is-simple',
|
|
8
8
|
isLast && !space && !isCenter && 'is-flex',
|
|
9
9
|
isCenter && !isVertical && !isSimple && 'is-center'
|
|
10
|
-
|
|
10
|
+
]">
|
|
11
11
|
<!-- icon & line -->
|
|
12
12
|
<div
|
|
13
13
|
class="el-step__head"
|
|
@@ -110,7 +110,7 @@ export default {
|
|
|
110
110
|
},
|
|
111
111
|
space() {
|
|
112
112
|
const { isSimple, $parent: { space } } = this;
|
|
113
|
-
return isSimple ? '' : space
|
|
113
|
+
return isSimple ? '' : space;
|
|
114
114
|
},
|
|
115
115
|
style: function() {
|
|
116
116
|
const style = {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="cy-sub-title" :style="lineColorStyle">
|
|
3
|
+
<div class="left">
|
|
4
|
+
<slot>{{ title }}</slot>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div class="right">
|
|
8
|
+
<slot name="right"></slot>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
export default {
|
|
15
|
+
name: 'CySubTitle',
|
|
16
|
+
props: {
|
|
17
|
+
title: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ''
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
lineColor: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ''
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
computed: {
|
|
28
|
+
lineColorStyle() {
|
|
29
|
+
return this.lineColor ? `border-color: ${ this.lineColor };` : ''
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import TabDialog from './src/main';
|
|
2
|
+
import dialogDrag from './src/dialog/drag'
|
|
3
|
+
import dialogDragWidth from './src/dialog/dragWidth'
|
|
4
|
+
import dialogDragHeight from './src/dialog/dragHeight'
|
|
5
|
+
|
|
6
|
+
export const TabDialogDirective = (Vue) => {
|
|
7
|
+
// 注册指令
|
|
8
|
+
Vue.directive('dialogDrag', dialogDrag)
|
|
9
|
+
Vue.directive('dialogDragWidth', dialogDragWidth)
|
|
10
|
+
Vue.directive('dialogDragHeight', dialogDragHeight)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* istanbul ignore next */
|
|
14
|
+
TabDialog.install = function(Vue) {
|
|
15
|
+
// 注册组件
|
|
16
|
+
Vue.component(TabDialog.name, TabDialog);
|
|
17
|
+
// 注册指令
|
|
18
|
+
Vue.directive('dialogDrag', dialogDrag)
|
|
19
|
+
Vue.directive('dialogDragWidth', dialogDragWidth)
|
|
20
|
+
Vue.directive('dialogDragHeight', dialogDragHeight)
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default TabDialog;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v-dialogDrag 弹窗拖拽
|
|
3
|
+
* Copyright (c) 2019 ruoyi
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
bind(el, binding, vnode, oldVnode) {
|
|
8
|
+
const value = binding.value
|
|
9
|
+
if (value === false) return
|
|
10
|
+
// 获取拖拽内容头部
|
|
11
|
+
const dialogHeaderEl = el.querySelector('.el-dialog__header')
|
|
12
|
+
const dragDom = el.querySelector('.el-dialog')
|
|
13
|
+
dialogHeaderEl.style.cursor = 'move'
|
|
14
|
+
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
|
|
15
|
+
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
|
|
16
|
+
dragDom.style.position = 'absolute'
|
|
17
|
+
dragDom.style.marginTop = 0
|
|
18
|
+
let width = dragDom.style.width
|
|
19
|
+
if (width.includes('%')) {
|
|
20
|
+
width = +document.body.clientWidth * (+width.replace(/\%/g, '') / 100)
|
|
21
|
+
} else {
|
|
22
|
+
width = +width.replace(/\px/g, '')
|
|
23
|
+
}
|
|
24
|
+
dragDom.style.left = `${ (document.body.clientWidth - width) / 2 }px`
|
|
25
|
+
// 鼠标按下事件
|
|
26
|
+
dialogHeaderEl.onmousedown = (e) => {
|
|
27
|
+
// 鼠标按下,计算当前元素距离可视区的距离 (鼠标点击位置距离可视窗口的距离)
|
|
28
|
+
const disX = e.clientX - dialogHeaderEl.offsetLeft
|
|
29
|
+
const disY = e.clientY - dialogHeaderEl.offsetTop
|
|
30
|
+
|
|
31
|
+
// 获取到的值带px 正则匹配替换
|
|
32
|
+
let styL, styT
|
|
33
|
+
|
|
34
|
+
// 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
|
|
35
|
+
if (sty.left.includes('%')) {
|
|
36
|
+
styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
|
|
37
|
+
styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
|
|
38
|
+
} else {
|
|
39
|
+
styL = +sty.left.replace(/\px/g, '')
|
|
40
|
+
styT = +sty.top.replace(/\px/g, '')
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 鼠标拖拽事件
|
|
44
|
+
document.onmousemove = function(e) {
|
|
45
|
+
// 通过事件委托,计算移动的距离 (开始拖拽至结束拖拽的距离)
|
|
46
|
+
const l = e.clientX - disX
|
|
47
|
+
const t = e.clientY - disY
|
|
48
|
+
|
|
49
|
+
let finallyL = l + styL
|
|
50
|
+
let finallyT = t + styT
|
|
51
|
+
|
|
52
|
+
// 移动当前元素
|
|
53
|
+
dragDom.style.left = `${ finallyL }px`
|
|
54
|
+
dragDom.style.top = `${ finallyT }px`
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
document.onmouseup = function(e) {
|
|
58
|
+
document.onmousemove = null
|
|
59
|
+
document.onmouseup = null
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v-dialogDragWidth 可拖动弹窗高度(右下角)
|
|
3
|
+
* Copyright (c) 2019 ruoyi
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
bind(el) {
|
|
8
|
+
const dragDom = el.querySelector('.el-dialog')
|
|
9
|
+
const lineEl = document.createElement('div')
|
|
10
|
+
lineEl.style = 'width: 6px; background: inherit; height: 10px; position: absolute; right: 0; bottom: 0; margin: auto; z-index: 1; cursor: nwse-resize;'
|
|
11
|
+
lineEl.addEventListener('mousedown',
|
|
12
|
+
function(e) {
|
|
13
|
+
// 鼠标按下,计算当前元素距离可视区的距离
|
|
14
|
+
const disX = e.clientX - el.offsetLeft
|
|
15
|
+
const disY = e.clientY - el.offsetTop
|
|
16
|
+
// 当前宽度 高度
|
|
17
|
+
const curWidth = dragDom.offsetWidth
|
|
18
|
+
const curHeight = dragDom.offsetHeight
|
|
19
|
+
document.onmousemove = function(e) {
|
|
20
|
+
e.preventDefault() // 移动时禁用默认事件
|
|
21
|
+
// 通过事件委托,计算移动的距离
|
|
22
|
+
const xl = e.clientX - disX
|
|
23
|
+
const yl = e.clientY - disY
|
|
24
|
+
dragDom.style.width = `${ curWidth + xl }px`
|
|
25
|
+
dragDom.style.height = `${ curHeight + yl }px`
|
|
26
|
+
}
|
|
27
|
+
document.onmouseup = function(e) {
|
|
28
|
+
document.onmousemove = null
|
|
29
|
+
document.onmouseup = null
|
|
30
|
+
}
|
|
31
|
+
}, false)
|
|
32
|
+
dragDom.appendChild(lineEl)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v-dialogDragWidth 可拖动弹窗宽度(右侧边)
|
|
3
|
+
* Copyright (c) 2019 ruoyi
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
bind(el) {
|
|
8
|
+
const dragDom = el.querySelector('.el-dialog')
|
|
9
|
+
const lineEl = document.createElement('div')
|
|
10
|
+
lineEl.style = 'width: 5px; background: inherit; height: 80%; position: absolute; right: 0; top: 0; bottom: 0; margin: auto; z-index: 1; cursor: w-resize;'
|
|
11
|
+
lineEl.addEventListener('mousedown',
|
|
12
|
+
function(e) {
|
|
13
|
+
// 鼠标按下,计算当前元素距离可视区的距离
|
|
14
|
+
const disX = e.clientX - el.offsetLeft
|
|
15
|
+
// 当前宽度
|
|
16
|
+
const curWidth = dragDom.offsetWidth
|
|
17
|
+
document.onmousemove = function(e) {
|
|
18
|
+
e.preventDefault() // 移动时禁用默认事件
|
|
19
|
+
// 通过事件委托,计算移动的距离
|
|
20
|
+
const l = e.clientX - disX
|
|
21
|
+
dragDom.style.width = `${ curWidth + l }px`
|
|
22
|
+
}
|
|
23
|
+
document.onmouseup = function(e) {
|
|
24
|
+
document.onmousemove = null
|
|
25
|
+
document.onmouseup = null
|
|
26
|
+
}
|
|
27
|
+
}, false)
|
|
28
|
+
dragDom.appendChild(lineEl)
|
|
29
|
+
}
|
|
30
|
+
}
|