zartui 2.0.53 → 2.0.55
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.generated.md +6 -0
- package/es/calendar/components/Header.js +6 -0
- package/es/calendar/index.js +5 -0
- package/es/hierarchy-select/breadcrumb.js +23 -24
- package/es/hierarchy-select/hierarchySelect.js +162 -0
- package/es/hierarchy-select/index.css +1 -1
- package/es/hierarchy-select/index.js +83 -79
- package/es/hierarchy-select/index.less +261 -159
- package/es/hierarchy-select/markList.js +67 -24
- package/es/index.js +1 -1
- package/es/media-picker/index.js +2 -1
- package/es/style/var.less +18 -2
- package/lib/calendar/components/Header.js +6 -0
- package/lib/calendar/index.js +5 -0
- package/lib/hierarchy-select/breadcrumb.js +23 -24
- package/lib/hierarchy-select/hierarchySelect.js +177 -0
- package/lib/hierarchy-select/index.css +1 -1
- package/lib/hierarchy-select/index.js +85 -82
- package/lib/hierarchy-select/index.less +261 -159
- package/lib/hierarchy-select/markList.js +64 -21
- package/lib/index.css +1 -1
- package/lib/index.js +1 -1
- package/lib/media-picker/index.js +2 -1
- package/lib/style/var.less +18 -2
- package/lib/zart.js +2744 -1584
- package/lib/zart.min.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
### [v2.0.55](http://192.168.101.70:8000/compare/v2.0.54...v2.0.55)
|
|
2
|
+
|
|
3
|
+
`2023-07-20`
|
|
4
|
+
|
|
5
|
+
- [M][296178]media-picker增加原始图片名称返回 [7fbfac](http://192.168.101.70:8000/commits/7fbfac1c2d4afe85dcfc0e729c0805a25b5cfa36)
|
|
6
|
+
- [M][295893](calendar) 日历增加参数控制隐藏星期 [2f1f39](http://192.168.101.70:8000/commits/2f1f39e114eab31f181c23cb5027204a946832d4)
|
|
@@ -13,6 +13,7 @@ export default createComponent({
|
|
|
13
13
|
subtitle: String,
|
|
14
14
|
showTitle: Boolean,
|
|
15
15
|
showSubtitle: Boolean,
|
|
16
|
+
showWeekDays: Boolean,
|
|
16
17
|
firstDayOfWeek: Number,
|
|
17
18
|
yearPreEnable: Boolean,
|
|
18
19
|
monthPreEnable: Boolean,
|
|
@@ -99,6 +100,11 @@ export default createComponent({
|
|
|
99
100
|
},
|
|
100
101
|
genWeekDays: function genWeekDays() {
|
|
101
102
|
var h = this.$createElement;
|
|
103
|
+
|
|
104
|
+
if (!this.showWeekDays) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
|
|
102
108
|
var weekdays = t('weekdays'); // console.log(" weekdays " + JSON.stringify(weekdays));
|
|
103
109
|
|
|
104
110
|
var firstDayOfWeek = this.firstDayOfWeek;
|
package/es/calendar/index.js
CHANGED
|
@@ -68,6 +68,10 @@ export default createComponent({
|
|
|
68
68
|
type: Boolean,
|
|
69
69
|
default: true
|
|
70
70
|
},
|
|
71
|
+
showWeekDays: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true
|
|
74
|
+
},
|
|
71
75
|
closeOnPopstate: {
|
|
72
76
|
type: Boolean,
|
|
73
77
|
default: true
|
|
@@ -561,6 +565,7 @@ export default createComponent({
|
|
|
561
565
|
"lazyRender": this.lazyRender,
|
|
562
566
|
"currentDate": this.currentDate,
|
|
563
567
|
"showSubtitle": this.showSubtitle,
|
|
568
|
+
"showWeekDays": this.showWeekDays,
|
|
564
569
|
"allowSameDay": this.allowSameDay,
|
|
565
570
|
"showMonthTitle": showMonthTitle,
|
|
566
571
|
"firstDayOfWeek": this.dayOffset,
|
|
@@ -4,7 +4,8 @@ import Icon from "../icon";
|
|
|
4
4
|
|
|
5
5
|
var _createNamespace = createNamespace('hierarchy-select-breadcrumb'),
|
|
6
6
|
createComponent = _createNamespace[0],
|
|
7
|
-
bem = _createNamespace[1]
|
|
7
|
+
bem = _createNamespace[1],
|
|
8
|
+
t = _createNamespace[2];
|
|
8
9
|
|
|
9
10
|
export default createComponent({
|
|
10
11
|
props: {
|
|
@@ -21,47 +22,43 @@ export default createComponent({
|
|
|
21
22
|
textKey: {
|
|
22
23
|
type: String,
|
|
23
24
|
default: "name"
|
|
24
|
-
},
|
|
25
|
-
breadcrumbTitle: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: "全部"
|
|
28
25
|
}
|
|
29
26
|
},
|
|
27
|
+
data: function data() {
|
|
28
|
+
return {};
|
|
29
|
+
},
|
|
30
30
|
methods: {
|
|
31
31
|
chooseSenior: function chooseSenior(index) {
|
|
32
|
-
if (this.data.length === index + 1) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
32
|
this.$emit("chooseSenior", index);
|
|
37
33
|
}
|
|
38
34
|
},
|
|
39
|
-
render: function render() {
|
|
35
|
+
render: function render(h) {
|
|
40
36
|
var _this = this;
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
return h("section", {
|
|
38
|
+
return h("div", [this.data.length > 0 ? h("div", {
|
|
44
39
|
"class": bem()
|
|
45
|
-
}, [h("
|
|
46
|
-
"class": bem(
|
|
47
|
-
},
|
|
48
|
-
"class": bem(
|
|
40
|
+
}, [h("span", {
|
|
41
|
+
"class": bem("fill-blur")
|
|
42
|
+
}), h("div", {
|
|
43
|
+
"class": bem("indicator-crumb-list")
|
|
44
|
+
}, [h("span", {
|
|
45
|
+
"style": {
|
|
46
|
+
color: '#0091fa'
|
|
47
|
+
},
|
|
49
48
|
"on": {
|
|
50
49
|
"click": function click() {
|
|
51
50
|
_this.chooseSenior(-1);
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
|
-
}, [
|
|
53
|
+
}, ["\u5168\u90E8"]), this.data.map(function (item, index) {
|
|
55
54
|
return h("div", {
|
|
56
|
-
"class": bem(
|
|
55
|
+
"class": bem("crumb-item")
|
|
57
56
|
}, [h(Icon, {
|
|
58
|
-
"class": bem('icon'),
|
|
59
57
|
"attrs": {
|
|
60
|
-
"name": "arrow-right"
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
"name": "arrow-right"
|
|
59
|
+
},
|
|
60
|
+
"class": bem("icon-arrow")
|
|
63
61
|
}), h("span", {
|
|
64
|
-
"class": bem('name'),
|
|
65
62
|
"style": {
|
|
66
63
|
color: index === _this.data.length - 1 ? '' : '#0091fa'
|
|
67
64
|
},
|
|
@@ -71,6 +68,8 @@ export default createComponent({
|
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
}, [item[_this.textKey]])]);
|
|
74
|
-
})])
|
|
71
|
+
})]), h("span", {
|
|
72
|
+
"class": "fill-blur"
|
|
73
|
+
})]) : h()]);
|
|
75
74
|
}
|
|
76
75
|
});
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// Utils
|
|
2
|
+
import { createNamespace } from '../utils';
|
|
3
|
+
import { resetObject } from "../utils/index";
|
|
4
|
+
import { deepClone } from '../utils/deep-clone';
|
|
5
|
+
import Breadcrumb from "./breadcrumb";
|
|
6
|
+
import MarkList from "./markList";
|
|
7
|
+
import Loading from '../loading';
|
|
8
|
+
import Toast from '../toast';
|
|
9
|
+
|
|
10
|
+
var _createNamespace = createNamespace('hierarchy-select-core'),
|
|
11
|
+
createComponent = _createNamespace[0],
|
|
12
|
+
bem = _createNamespace[1],
|
|
13
|
+
t = _createNamespace[2];
|
|
14
|
+
|
|
15
|
+
var defaultData = function defaultData() {
|
|
16
|
+
return {
|
|
17
|
+
dataList: [],
|
|
18
|
+
indexTree: [],
|
|
19
|
+
breadcrumbData: [],
|
|
20
|
+
callback: null,
|
|
21
|
+
historyLayers: [],
|
|
22
|
+
loading: false
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default createComponent({
|
|
27
|
+
props: {
|
|
28
|
+
treeData: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default: function _default() {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
disableParent: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
asyncGetter: {
|
|
39
|
+
type: Function,
|
|
40
|
+
default: null
|
|
41
|
+
},
|
|
42
|
+
multiple: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
resetReplaceCancel: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
valueKey: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: "id"
|
|
53
|
+
},
|
|
54
|
+
textKey: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: "name"
|
|
57
|
+
},
|
|
58
|
+
returnChainData: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
data: function data() {
|
|
64
|
+
return defaultData();
|
|
65
|
+
},
|
|
66
|
+
mounted: function mounted() {
|
|
67
|
+
// resetObject(this, defaultData())
|
|
68
|
+
// if (this.$refs.markList) {
|
|
69
|
+
// this.$refs.markList.reset()
|
|
70
|
+
// }
|
|
71
|
+
this.dataList = deepClone(this.treeData);
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
clickNext: function clickNext(obj) {
|
|
75
|
+
var _this = this;
|
|
76
|
+
|
|
77
|
+
var item = obj.item,
|
|
78
|
+
index = obj.index;
|
|
79
|
+
|
|
80
|
+
if (item["children"] && item["children"].length) {
|
|
81
|
+
this.historyLayers.push(this.dataList);
|
|
82
|
+
this.breadcrumbData.push(item);
|
|
83
|
+
this.dataList = item["children"];
|
|
84
|
+
} else {
|
|
85
|
+
if (this.asyncGetter) {
|
|
86
|
+
this.loading = true;
|
|
87
|
+
this.asyncGetter(item[this.valueKey]).then(function (list) {
|
|
88
|
+
_this.loading = false;
|
|
89
|
+
|
|
90
|
+
if (!list || list.length === 0) {
|
|
91
|
+
Toast("无下级数据");
|
|
92
|
+
_this.dataList[index].children = null;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
_this.historyLayers.push(_this.dataList);
|
|
97
|
+
|
|
98
|
+
_this.breadcrumbData.push(item);
|
|
99
|
+
|
|
100
|
+
_this.dataList = list;
|
|
101
|
+
}).catch(function () {
|
|
102
|
+
_this.loading = false;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
selected: function selected(item) {
|
|
108
|
+
var data = deepClone(this.breadcrumbData);
|
|
109
|
+
data.push(item);
|
|
110
|
+
this.$emit("selected", this.returnChainData ? data : item);
|
|
111
|
+
},
|
|
112
|
+
chooseSenior: function chooseSenior(index) {
|
|
113
|
+
this.breadcrumbData.splice(index + 1);
|
|
114
|
+
this.dataList = this.historyLayers[index + 1];
|
|
115
|
+
this.historyLayers.splice(index + 1);
|
|
116
|
+
},
|
|
117
|
+
reset: function reset() {
|
|
118
|
+
this.$emit("reset");
|
|
119
|
+
},
|
|
120
|
+
cancel: function cancel() {
|
|
121
|
+
this.$emit("cancel");
|
|
122
|
+
},
|
|
123
|
+
confirm: function confirm(list) {
|
|
124
|
+
this.$emit("confirm", list);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
render: function render(h) {
|
|
128
|
+
return h("div", {
|
|
129
|
+
"class": bem()
|
|
130
|
+
}, [h(Breadcrumb, {
|
|
131
|
+
"attrs": {
|
|
132
|
+
"data": this.breadcrumbData,
|
|
133
|
+
"valueKey": this.valueKey,
|
|
134
|
+
"textKey": this.textKey
|
|
135
|
+
},
|
|
136
|
+
"on": {
|
|
137
|
+
"chooseSenior": this.chooseSenior
|
|
138
|
+
}
|
|
139
|
+
}), h("div", {
|
|
140
|
+
"class": bem("list")
|
|
141
|
+
}, [this.loading ? h(Loading, {
|
|
142
|
+
"class": bem('loading')
|
|
143
|
+
}) : h(), h(MarkList, {
|
|
144
|
+
"ref": "markList",
|
|
145
|
+
"attrs": {
|
|
146
|
+
"dataList": this.dataList,
|
|
147
|
+
"multiple": this.multiple,
|
|
148
|
+
"resetReplaceCancel": this.resetReplaceCancel,
|
|
149
|
+
"disableParent": this.disableParent,
|
|
150
|
+
"valueKey": this.valueKey,
|
|
151
|
+
"textKey": this.textKey
|
|
152
|
+
},
|
|
153
|
+
"on": {
|
|
154
|
+
"clickNext": this.clickNext,
|
|
155
|
+
"selected": this.selected,
|
|
156
|
+
"cancel": this.cancel,
|
|
157
|
+
"confirm": this.confirm,
|
|
158
|
+
"reset": this.reset
|
|
159
|
+
}
|
|
160
|
+
})])]);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.zt2-hierarchy-
|
|
1
|
+
.zt2-hierarchy-select__popup{height:100%}.zt2-hierarchy-select__popup .zt2-hierarchy-select{background-color:#f5f5ff;height:100%}.zt2-hierarchy-select__popup .zt2-hierarchy-select__title{height:44px;position:relative;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.1)}.zt2-hierarchy-select__popup .zt2-hierarchy-select__title i{font-size:14px;position:absolute;left:15px;top:16px}.zt2-hierarchy-select__popup .zt2-hierarchy-select__title div{line-height:44px;text-align:center;font-weight:700;font-size:18px;color:#142841}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-select-core .zt2-loading{position:absolute;top:50%;left:50%;margin-left:-18px;margin-right:-18px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-select-core__list span{height:24px;font-size:16px;font-family:PingFangSC,PingFangSC-Semibold;font-weight:600;color:#0091fa;line-height:24px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-select-core__list .flex{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-select-breadcrumb{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;padding:10px 0;background-color:#fff;margin-bottom:16px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-select-breadcrumb__indicator-crumb-list{-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:0 16px;overflow-x:auto}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-select-breadcrumb__indicator-crumb-list span{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;white-space:nowrap;height:24px;font-size:16px;font-family:PingFangSC,PingFangSC-Regular;text-align:left;color:#000;line-height:24px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-select-breadcrumb__indicator-crumb-list__icon-arrow{margin:0 4px;width:20px;height:20px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-select-breadcrumb__crumb-item{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-select-breadcrumb__fill-blur{position:absolute;top:0;width:16px;height:44px;background:-webkit-gradient(linear,right top,left top,from(rgba(255,255,255,0)),to(#fff))}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-select-breadcrumb__fill-blur:last-child{right:0;top:0;background:-webkit-gradient(linear,right top,left top,from(#fff),to(rgba(255,255,255,0)))}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list{background-color:#fff}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__multiple-button{margin-right:8px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__select-icon{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center;text-align:center;border-radius:100%;font-size:22px;cursor:pointer}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__select-icon--normal{color:transparent;background-image:-webkit-linear-gradient(315deg,#e6ebf0 0,#fff 100%);background-image:linear-gradient(135deg,#e6ebf0 0,#fff 100%);border:1px solid rgba(45,75,115,.13);box-shadow:-1px -1px 2px 0 #fff,0 0 3px 0 rgba(45,75,115,.2)}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__select-icon--checked{color:#fff;background-color:#0091fa;border:1px solid rgba(255,255,255,.5);box-shadow:inset 1px 1px 2px 0 rgba(0,0,0,.2)}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__score-item{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:10px 0;background-color:#fff;margin-left:16px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__score-item:after{content:" ";position:absolute;bottom:0;height:1px;width:100%;background-color:rgba(0,0,0,.1);box-shadow:0 0 0 0 #000 inset}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__item-content{-webkit-box-flex:1;-webkit-flex:1;flex:1;margin-right:16px;width:278px;font-size:16px;font-family:PingFangSC,PingFangSC-Regular;font-weight:400;text-align:left;color:#000;line-height:24px;word-break:break-all}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__item-content span{color:#0091fa}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__item-nav{padding:0 16px;border-left:rgba(0,0,0,.1) 1px solid}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__sub-level{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__sub-level span{color:#0091fa}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__sub-level--disable{opacity:.2}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__sub-icon{margin-right:4px;font-size:0;width:20px;height:20px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__result-box{position:fixed;left:0;bottom:0;background:#fff;width:100%}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__result-list{height:160px;box-shadow:0 -4px 8px 0 rgba(0,0,0,.1);border-radius:8px 8px 0 0;padding:12px 16px;font-size:14px;color:#000;line-height:24px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__operate-box{display:-webkit-box;display:-webkit-flex;display:flex;height:44px;line-height:44px;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__selected{border-top:1px solid rgba(0,0,0,.1);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:0 16px;-webkit-box-flex:1;-webkit-flex:1;flex:1;height:44px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__selected i{color:#0091fa;font-size:20px;margin-right:4px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__selected span{font-size:14px;color:rgba(0,0,0,.6)}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__selected span.zt2-hierarchy-mark-list__blue{color:#0091fa;margin-left:8px}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__line{width:1px;height:24px;background:rgba(0,0,0,.1);-webkit-transform:scaleX(.5);transform:scaleX(.5);border-top:1px solid rgba(0,0,0,.1)}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__reset-button{width:110px;border-top:1px solid rgba(0,0,0,.1);font-size:16px;color:#000;text-align:center}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__cancel-button{width:110px;border-top:1px solid rgba(0,0,0,.1);font-size:16px;color:#000;text-align:center}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__confirm-button{width:110px;border-top:1px solid #0091fa;font-weight:700;font-size:16px;color:#fff;text-align:center;background:#0091fa}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__disable .zt2-hierarchy-mark-list__item-content,.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__disable-parent .zt2-hierarchy-mark-list__item-content{color:#c8c9cc}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__disable .zt2-hierarchy-mark-list__multiple-button>.zt2-icon,.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__disable-parent .zt2-hierarchy-mark-list__multiple-button>.zt2-icon{cursor:not-allowed;background-image:-webkit-linear-gradient(316deg,#e1e6eb 0,#e5edf5 100%);background-image:linear-gradient(134deg,#e1e6eb 0,#e5edf5 100%);border:1px solid rgba(45,75,115,.08);box-shadow:-1px -1px 2px 0 #fff,0 0 3px 0 rgba(45,75,115,.2)}.zt2-hierarchy-select__popup .zt2-hierarchy-select .zt2-hierarchy-mark-list__disable .zt2-hierarchy-mark-list__item-nav{cursor:not-allowed;opacity:.4}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
// Utils
|
|
2
2
|
import { createNamespace } from '../utils';
|
|
3
|
-
import { deepClone } from '../utils/deep-clone';
|
|
4
|
-
import Breadcrumb from "./breadcrumb";
|
|
5
|
-
import MarkList from "./markList";
|
|
6
|
-
import Loading from '../loading';
|
|
7
|
-
import Toast from '../toast';
|
|
8
3
|
|
|
9
4
|
var _createNamespace = createNamespace('hierarchy-select'),
|
|
10
5
|
createComponent = _createNamespace[0],
|
|
11
|
-
bem = _createNamespace[1]
|
|
6
|
+
bem = _createNamespace[1],
|
|
7
|
+
t = _createNamespace[2];
|
|
12
8
|
|
|
9
|
+
import HierarchySelect from './hierarchySelect';
|
|
10
|
+
import Popup from '../popup';
|
|
11
|
+
import { PopupMixin } from '../mixins/popup';
|
|
12
|
+
import Icon from "../icon";
|
|
13
13
|
export default createComponent({
|
|
14
|
+
mixins: [PopupMixin()],
|
|
14
15
|
props: {
|
|
15
16
|
treeData: {
|
|
16
17
|
type: Array,
|
|
17
|
-
default:
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
18
|
+
default: []
|
|
20
19
|
},
|
|
21
20
|
disableParent: {
|
|
22
21
|
type: Boolean,
|
|
@@ -38,104 +37,109 @@ export default createComponent({
|
|
|
38
37
|
type: String,
|
|
39
38
|
default: "name"
|
|
40
39
|
},
|
|
41
|
-
|
|
40
|
+
title: {
|
|
42
41
|
type: String,
|
|
43
|
-
default: "
|
|
42
|
+
default: "选择"
|
|
43
|
+
},
|
|
44
|
+
returnChainData: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
showTitle: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true
|
|
51
|
+
},
|
|
52
|
+
customCancel: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
44
55
|
},
|
|
45
|
-
|
|
56
|
+
resetReplaceCancel: {
|
|
46
57
|
type: Boolean,
|
|
47
58
|
default: false
|
|
48
59
|
}
|
|
49
60
|
},
|
|
50
61
|
data: function data() {
|
|
51
62
|
return {
|
|
52
|
-
|
|
53
|
-
indexTree: [],
|
|
54
|
-
breadcrumbData: [],
|
|
55
|
-
callback: null,
|
|
56
|
-
historyLayers: [],
|
|
57
|
-
loading: false
|
|
63
|
+
showPicker: false
|
|
58
64
|
};
|
|
59
65
|
},
|
|
60
|
-
mounted: function mounted() {
|
|
61
|
-
this.dataList = deepClone(this.treeData);
|
|
62
|
-
},
|
|
63
66
|
methods: {
|
|
64
|
-
|
|
65
|
-
var _this = this;
|
|
66
|
-
|
|
67
|
-
var item = obj.item,
|
|
68
|
-
index = obj.index;
|
|
69
|
-
|
|
70
|
-
if (item.children && item.children.length) {
|
|
71
|
-
this.historyLayers.push(this.dataList);
|
|
72
|
-
this.breadcrumbData.push(item);
|
|
73
|
-
this.dataList = item.children;
|
|
74
|
-
} else if (this.asyncGetter) {
|
|
75
|
-
this.loading = true;
|
|
76
|
-
this.asyncGetter(item[this.valueKey]).then(function (list) {
|
|
77
|
-
_this.loading = false;
|
|
78
|
-
|
|
79
|
-
if (!list || list.length === 0) {
|
|
80
|
-
Toast("无下级数据");
|
|
81
|
-
_this.dataList[index].children = _this.autoChangeToChildren ? undefined : [];
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
_this.historyLayers.push(_this.dataList);
|
|
86
|
-
|
|
87
|
-
_this.breadcrumbData.push(item);
|
|
88
|
-
|
|
89
|
-
_this.dataList = list;
|
|
90
|
-
}).catch(function () {
|
|
91
|
-
_this.loading = false;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
selected: function selected(item) {
|
|
67
|
+
onSelected: function onSelected(item) {
|
|
96
68
|
this.$emit("selected", item);
|
|
97
69
|
},
|
|
98
|
-
|
|
99
|
-
this.
|
|
100
|
-
|
|
101
|
-
|
|
70
|
+
show: function show() {
|
|
71
|
+
this.showPicker = true;
|
|
72
|
+
},
|
|
73
|
+
hide: function hide() {
|
|
74
|
+
this.showPicker = false;
|
|
75
|
+
},
|
|
76
|
+
reset: function reset() {
|
|
77
|
+
this.$emit("reset");
|
|
78
|
+
this.hide();
|
|
79
|
+
},
|
|
80
|
+
cancel: function cancel() {
|
|
81
|
+
if (this.customCancel) {
|
|
82
|
+
this.$emit("cancel");
|
|
83
|
+
} else {
|
|
84
|
+
this.hide();
|
|
85
|
+
}
|
|
102
86
|
},
|
|
103
|
-
|
|
104
|
-
this.$emit("
|
|
87
|
+
confirm: function confirm(list) {
|
|
88
|
+
this.$emit("confirm", list);
|
|
105
89
|
}
|
|
106
90
|
},
|
|
107
91
|
render: function render(h) {
|
|
108
|
-
|
|
92
|
+
var _this = this;
|
|
93
|
+
|
|
94
|
+
return h(Popup, {
|
|
95
|
+
"attrs": {
|
|
96
|
+
"position": "bottom",
|
|
97
|
+
"closeOnPopstate": true,
|
|
98
|
+
"getContainer": this.getContainer
|
|
99
|
+
},
|
|
100
|
+
"class": bem('popup'),
|
|
101
|
+
"model": {
|
|
102
|
+
value: _this.showPicker,
|
|
103
|
+
callback: function callback($$v) {
|
|
104
|
+
_this.showPicker = $$v;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}, [h("div", {
|
|
109
108
|
"class": bem()
|
|
110
|
-
}, [h(
|
|
109
|
+
}, [h("div", {
|
|
110
|
+
"directives": [{
|
|
111
|
+
name: "show",
|
|
112
|
+
value: this.showTitle
|
|
113
|
+
}],
|
|
114
|
+
"class": bem("title")
|
|
115
|
+
}, [h(Icon, {
|
|
111
116
|
"attrs": {
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
"name": "back"
|
|
118
|
+
},
|
|
119
|
+
"style": {
|
|
120
|
+
fontSize: '18px'
|
|
116
121
|
},
|
|
117
122
|
"on": {
|
|
118
|
-
"
|
|
123
|
+
"click": function click() {
|
|
124
|
+
_this.showPicker = false;
|
|
125
|
+
}
|
|
119
126
|
}
|
|
120
|
-
}), h("div", {
|
|
121
|
-
"class": bem("list")
|
|
122
|
-
}, [this.loading ? h(Loading, {
|
|
123
|
-
"class": bem('loading')
|
|
124
|
-
}) : h(), h(MarkList, {
|
|
125
|
-
"ref": "markList",
|
|
127
|
+
}), h("div", [this.title])]), h(HierarchySelect, {
|
|
126
128
|
"attrs": {
|
|
127
|
-
"
|
|
128
|
-
"multiple": this.multiple,
|
|
129
|
-
"resetReplaceCancel": this.resetReplaceCancel,
|
|
129
|
+
"treeData": this.treeData,
|
|
130
130
|
"disableParent": this.disableParent,
|
|
131
|
+
"asyncGetter": this.asyncGetter,
|
|
132
|
+
"resetReplaceCancel": this.resetReplaceCancel,
|
|
133
|
+
"multiple": this.multiple,
|
|
131
134
|
"valueKey": this.valueKey,
|
|
132
135
|
"textKey": this.textKey,
|
|
133
|
-
"
|
|
136
|
+
"returnChainData": this.returnChainData
|
|
134
137
|
},
|
|
135
138
|
"on": {
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
+
"selected": this.onSelected,
|
|
140
|
+
"cancel": this.cancel,
|
|
141
|
+
"confirm": this.confirm,
|
|
142
|
+
"reset": this.reset
|
|
139
143
|
}
|
|
140
144
|
})])]);
|
|
141
145
|
}
|