zartui 0.1.97 → 0.1.98
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/es/index.js +4 -3
- package/es/pdf-viewer/index.js +118 -107
- package/es/timeline/index.css +1 -0
- package/es/timeline/index.js +185 -0
- package/es/timeline/index.less +130 -0
- package/es/timeline/style/index.js +4 -0
- package/es/timeline/style/less.js +4 -0
- package/lib/index.css +1 -1
- package/lib/index.js +6 -2
- package/lib/index.less +1 -0
- package/lib/pdf-viewer/index.js +118 -107
- package/lib/timeline/index.css +1 -0
- package/lib/timeline/index.js +194 -0
- package/lib/timeline/index.less +130 -0
- package/lib/timeline/style/index.js +4 -0
- package/lib/timeline/style/less.js +4 -0
- package/lib/zart.js +306 -107
- package/lib/zart.min.js +3 -3
- package/package.json +1 -1
package/es/index.js
CHANGED
|
@@ -72,12 +72,13 @@ import TabbarItem from './tabbar-item';
|
|
|
72
72
|
import Table from './table';
|
|
73
73
|
import Tabs from './tabs';
|
|
74
74
|
import Tag from './tag';
|
|
75
|
+
import Timeline from './timeline';
|
|
75
76
|
import Toast from './toast';
|
|
76
77
|
import Uploader from './uploader';
|
|
77
|
-
var version = '0.1.
|
|
78
|
+
var version = '0.1.98';
|
|
78
79
|
|
|
79
80
|
function install(Vue) {
|
|
80
|
-
var components = [ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, PdfViewer, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, Toast, Uploader];
|
|
81
|
+
var components = [ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, PdfViewer, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, Timeline, Toast, Uploader];
|
|
81
82
|
components.forEach(function (item) {
|
|
82
83
|
if (item.install) {
|
|
83
84
|
Vue.use(item);
|
|
@@ -91,7 +92,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
91
92
|
install(window.Vue);
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
export { install, version, ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, PdfViewer, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, Toast, Uploader };
|
|
95
|
+
export { install, version, ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, PdfViewer, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, Timeline, Toast, Uploader };
|
|
95
96
|
export default {
|
|
96
97
|
install: install,
|
|
97
98
|
version: version
|
package/es/pdf-viewer/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
var _methods;
|
|
2
|
-
|
|
3
1
|
import { createNamespace } from '../utils';
|
|
4
2
|
|
|
5
3
|
var _createNamespace = createNamespace('pdf-viewer'),
|
|
@@ -31,7 +29,7 @@ var defaultData = function defaultData() {
|
|
|
31
29
|
bodyInitialHeight: "",
|
|
32
30
|
bodyInitialMinHeight: "",
|
|
33
31
|
metaContent: "",
|
|
34
|
-
|
|
32
|
+
pdfScrollEvent: function pdfScrollEvent() {},
|
|
35
33
|
scrollEvent: function scrollEvent() {}
|
|
36
34
|
};
|
|
37
35
|
};
|
|
@@ -125,7 +123,7 @@ export default createComponent({
|
|
|
125
123
|
}
|
|
126
124
|
}
|
|
127
125
|
},
|
|
128
|
-
methods:
|
|
126
|
+
methods: {
|
|
129
127
|
recordScrollEvent: function recordScrollEvent() {
|
|
130
128
|
this.scrollEvent = window.onscroll;
|
|
131
129
|
},
|
|
@@ -135,9 +133,9 @@ export default createComponent({
|
|
|
135
133
|
if (restore) {
|
|
136
134
|
window.onscroll = this.scrollEvent;
|
|
137
135
|
} else {
|
|
138
|
-
if (this.
|
|
136
|
+
if (this.pdfScrollEvent) {
|
|
139
137
|
window.onscroll = function () {
|
|
140
|
-
_this3.
|
|
138
|
+
_this3.pdfScrollEvent();
|
|
141
139
|
};
|
|
142
140
|
}
|
|
143
141
|
}
|
|
@@ -230,120 +228,133 @@ export default createComponent({
|
|
|
230
228
|
_this5.pageNum = 1;
|
|
231
229
|
_this5.pdfArr = pdfArr;
|
|
232
230
|
|
|
233
|
-
_this5.
|
|
231
|
+
_this5.buildPdfScrollEvent();
|
|
234
232
|
}).catch(function (err) {
|
|
235
233
|
console.error("pdf 加载失败", err);
|
|
236
234
|
}).finally(function () {
|
|
237
235
|
_this5.loading = false;
|
|
238
236
|
});
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
237
|
+
},
|
|
238
|
+
buildPdfScrollEvent: function buildPdfScrollEvent() {
|
|
239
|
+
var _this6 = this;
|
|
240
|
+
|
|
241
|
+
this.pdfScrollEvent = window.onscroll = _.throttle(function () {
|
|
242
|
+
if (_this6.pageChangeByButton) {
|
|
243
|
+
_this6.pageChangeByButton = false;
|
|
244
|
+
} else {
|
|
245
|
+
_this6.changePage();
|
|
246
|
+
}
|
|
247
|
+
}, 1000);
|
|
248
|
+
},
|
|
249
|
+
changePage: function changePage() {
|
|
250
|
+
if (window.pageYOffset === 0) {
|
|
251
|
+
this.pageNum = 1;
|
|
252
|
+
return;
|
|
248
253
|
}
|
|
249
|
-
}, 1000);
|
|
250
|
-
}, _methods.changePage = function changePage() {
|
|
251
|
-
if (window.pageYOffset === 0) {
|
|
252
|
-
this.pageNum = 1;
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
254
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
var i = 1,
|
|
256
|
+
count = this.pdfPageCount;
|
|
257
|
+
var clientHeight = document.documentElement.clientHeight;
|
|
259
258
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
259
|
+
do {
|
|
260
|
+
var start = this.findPos(document.getElementById("pdfContent" + i));
|
|
261
|
+
var end = start + document.getElementById("pdfContent" + i).offsetHeight;
|
|
263
262
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
263
|
+
if (window.pageYOffset + clientHeight >= start && window.pageYOffset + clientHeight <= end) {
|
|
264
|
+
this.pageNum = i;
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
268
267
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
268
|
+
if (i === count && window.pageYOffset + clientHeight > end) {
|
|
269
|
+
this.pageNum = i;
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
273
272
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
this.
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
273
|
+
i++;
|
|
274
|
+
} while (i < count + 1);
|
|
275
|
+
},
|
|
276
|
+
findPos: function findPos(obj) {
|
|
277
|
+
if (obj) {
|
|
278
|
+
return obj.offsetTop;
|
|
279
|
+
} else {
|
|
280
|
+
return 0;
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
perPage: function perPage() {
|
|
284
|
+
if (this.pageNum > 1) {
|
|
285
|
+
this.pageNum = this.pageNum - 1;
|
|
286
|
+
this.pageChangeByButton = true;
|
|
287
|
+
} else {
|
|
288
|
+
Toast("已经是首页!");
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
nextPage: function nextPage() {
|
|
292
|
+
if (this.pageNum < this.pdfPageCount) {
|
|
293
|
+
this.pageNum = this.pageNum + 1;
|
|
294
|
+
this.pageChangeByButton = true;
|
|
295
|
+
} else {
|
|
296
|
+
Toast("已经是尾页!");
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
onPdfLoaded: function onPdfLoaded(e) {
|
|
300
|
+
this.pdfArr[e - 1].loaded = true;
|
|
301
|
+
this.$emit("loaded", e);
|
|
302
|
+
console.log("pdf loaded", e);
|
|
303
|
+
},
|
|
304
|
+
onPdfError: function onPdfError(e) {
|
|
305
|
+
this.$emit("error", e);
|
|
306
|
+
console.log("pdf viewer error: " + e);
|
|
307
|
+
},
|
|
308
|
+
rotate: function rotate() {
|
|
309
|
+
this.rotateDegree += 90;
|
|
310
|
+
},
|
|
311
|
+
genPdf: function genPdf(i) {
|
|
312
|
+
var h = this.$createElement;
|
|
313
|
+
|
|
314
|
+
if (this.currentShowArr.includes(i) || this.pdfArr[i - 1].loaded) {
|
|
315
|
+
return h("div", [h(pdf, {
|
|
316
|
+
"attrs": {
|
|
317
|
+
"src": this.loadingTask,
|
|
318
|
+
"page": i,
|
|
319
|
+
"id": "pdfContent" + i,
|
|
320
|
+
"rotate": this.rotateDegree
|
|
321
|
+
},
|
|
322
|
+
"key": i,
|
|
323
|
+
"on": {
|
|
324
|
+
"page-loaded": this.onPdfLoaded,
|
|
325
|
+
"error": this.onPdfError
|
|
326
|
+
}
|
|
327
|
+
}), h("div", {
|
|
328
|
+
"class": bem("page-margin")
|
|
329
|
+
})]);
|
|
330
|
+
} else {
|
|
331
|
+
return h("div", [h("div", {
|
|
332
|
+
"attrs": {
|
|
333
|
+
"id": "pdfContent" + i
|
|
334
|
+
},
|
|
335
|
+
"style": "width:100vw;height:100vh;"
|
|
336
|
+
}), h("div", {
|
|
337
|
+
"class": bem("page-margin")
|
|
338
|
+
})]);
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
showPagePicker: function showPagePicker() {
|
|
342
|
+
this.showPicker = true;
|
|
343
|
+
},
|
|
344
|
+
getPageList: function getPageList() {
|
|
345
|
+
return this.pdfArr.map(function (v, i) {
|
|
346
|
+
return i + 1;
|
|
347
|
+
});
|
|
348
|
+
},
|
|
349
|
+
setPage: function setPage(i) {
|
|
350
|
+
this.pageNum = i;
|
|
292
351
|
this.pageChangeByButton = true;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
this.pdfArr[e - 1].loaded = true;
|
|
298
|
-
this.$emit("loaded", e);
|
|
299
|
-
console.log("pdf loaded", e);
|
|
300
|
-
}, _methods.onPdfError = function onPdfError(e) {
|
|
301
|
-
this.$emit("error", e);
|
|
302
|
-
console.log("pdf viewer error: " + e);
|
|
303
|
-
}, _methods.rotate = function rotate() {
|
|
304
|
-
this.rotateDegree += 90;
|
|
305
|
-
}, _methods.genPdf = function genPdf(i) {
|
|
306
|
-
var h = this.$createElement;
|
|
307
|
-
|
|
308
|
-
if (this.currentShowArr.includes(i) || this.pdfArr[i - 1].loaded) {
|
|
309
|
-
return h("div", [h(pdf, {
|
|
310
|
-
"attrs": {
|
|
311
|
-
"src": this.loadingTask,
|
|
312
|
-
"page": i,
|
|
313
|
-
"id": "pdfContent" + i,
|
|
314
|
-
"rotate": this.rotateDegree
|
|
315
|
-
},
|
|
316
|
-
"key": i,
|
|
317
|
-
"on": {
|
|
318
|
-
"page-loaded": this.onPdfLoaded,
|
|
319
|
-
"error": this.onPdfError
|
|
320
|
-
}
|
|
321
|
-
}), h("div", {
|
|
322
|
-
"class": bem("page-margin")
|
|
323
|
-
})]);
|
|
324
|
-
} else {
|
|
325
|
-
return h("div", [h("div", {
|
|
326
|
-
"attrs": {
|
|
327
|
-
"id": "pdfContent" + i
|
|
328
|
-
},
|
|
329
|
-
"style": "width:100vw;height:100vh;"
|
|
330
|
-
}), h("div", {
|
|
331
|
-
"class": bem("page-margin")
|
|
332
|
-
})]);
|
|
352
|
+
this.showPicker = false;
|
|
353
|
+
},
|
|
354
|
+
cancel: function cancel() {
|
|
355
|
+
this.showPicker = false;
|
|
333
356
|
}
|
|
334
|
-
},
|
|
335
|
-
this.showPicker = true;
|
|
336
|
-
}, _methods.getPageList = function getPageList() {
|
|
337
|
-
return this.pdfArr.map(function (v, i) {
|
|
338
|
-
return i + 1;
|
|
339
|
-
});
|
|
340
|
-
}, _methods.setPage = function setPage(i) {
|
|
341
|
-
this.pageNum = i;
|
|
342
|
-
this.pageChangeByButton = true;
|
|
343
|
-
this.showPicker = false;
|
|
344
|
-
}, _methods.cancel = function cancel() {
|
|
345
|
-
this.showPicker = false;
|
|
346
|
-
}, _methods),
|
|
357
|
+
},
|
|
347
358
|
render: function render(h) {
|
|
348
359
|
var _this7 = this;
|
|
349
360
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.zt-timeline{background-color:#fff}.zt-timeline__top-bar{height:44px;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}.zt-timeline__top-left{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-timeline__bar{width:4px;height:16px;background:#0091fa;margin-right:12px}.zt-timeline__title{font-size:16px;font-weight:700;color:#000;line-height:24px}.zt-timeline__top-right{padding-right:16px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-timeline__fold-text{font-size:16px;color:rgba(0,0,0,.6);line-height:24px;margin-right:8px}.zt-timeline__container{padding-top:16px}.zt-timeline__item{padding:0 16px 16px 16px;display:-webkit-box;display:-webkit-flex;display:flex}.zt-timeline__item.last-item .zt-timeline__line{height:0}.zt-timeline__left-container{margin-right:8px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-timeline__right-container{-webkit-box-flex:1;-webkit-flex:1;flex:1}.zt-timeline__avatar-box{width:40px;height:40px}.zt-timeline__avatar{width:40px;height:40px;background:#0091fa;border-radius:4px;font-size:14px;font-weight:700;text-align:center;color:#fff;line-height:40px}.zt-timeline__line{background-color:#f5f5f5;width:2px;height:100%;margin-top:4px;margin-bottom:-12px}.zt-timeline__title-box{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;margin-bottom:8px}.zt-timeline__title{font-size:16px;font-weight:700;color:#000;line-height:24px}.zt-timeline__time{font-size:12px;color:rgba(0,0,0,.8);line-height:16px}.zt-timeline__content-box{font-size:14px;color:rgba(0,0,0,.8);line-height:20px;padding-bottom:8px}.zt-timeline__main-container{background:rgba(0,0,0,.02);border-radius:4px;padding:8px 12px}.zt-timeline__main-container::before{border-radius:4px}.zt-timeline__main-container .zt-timeline__text-bold{font-weight:700;color:#000}.zt-timeline__opinion-box{padding-top:7px}.zt-timeline__opinion-label{margin-bottom:4px;font-size:14px;color:rgba(0,0,0,.4);line-height:20px}.zt-timeline__opinion{font-size:14px;color:#000;line-height:20px}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { createNamespace } from '../utils';
|
|
2
|
+
|
|
3
|
+
var _createNamespace = createNamespace('timeline'),
|
|
4
|
+
createComponent = _createNamespace[0],
|
|
5
|
+
bem = _createNamespace[1];
|
|
6
|
+
|
|
7
|
+
import Switch from "../switch";
|
|
8
|
+
|
|
9
|
+
var defaultData = function defaultData() {
|
|
10
|
+
return {
|
|
11
|
+
isFold: false
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default createComponent({
|
|
16
|
+
props: {
|
|
17
|
+
title: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "办理经过"
|
|
20
|
+
},
|
|
21
|
+
// 默认折叠显示
|
|
22
|
+
defaultFold: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
// 折叠时显示几条数据
|
|
27
|
+
collapseCount: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 0
|
|
30
|
+
},
|
|
31
|
+
processes: {
|
|
32
|
+
type: Array,
|
|
33
|
+
default: function _default() {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
opinionKey: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "处理意见"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
data: function data() {
|
|
43
|
+
return defaultData();
|
|
44
|
+
},
|
|
45
|
+
computed: {},
|
|
46
|
+
watch: {},
|
|
47
|
+
mounted: function mounted() {
|
|
48
|
+
this.isFold = this.defaultFold;
|
|
49
|
+
console.log("this.$slots", this.$slots);
|
|
50
|
+
},
|
|
51
|
+
methods: {
|
|
52
|
+
genProcesses: function genProcesses() {
|
|
53
|
+
var _this = this;
|
|
54
|
+
|
|
55
|
+
if (this.isFold) {
|
|
56
|
+
var showProcesses = this.processes.slice(0, this.collapseCount);
|
|
57
|
+
return showProcesses.map(function (item, index) {
|
|
58
|
+
return _this.genProcessItem(item, index === showProcesses.length - 1);
|
|
59
|
+
});
|
|
60
|
+
} else {
|
|
61
|
+
return this.processes.map(function (item, index) {
|
|
62
|
+
return _this.genProcessItem(item, index === _this.processes.length - 1);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
genAvatar: function genAvatar(item, avatarSlot) {
|
|
67
|
+
var h = this.$createElement;
|
|
68
|
+
|
|
69
|
+
if (avatarSlot) {
|
|
70
|
+
return h("div", {
|
|
71
|
+
"class": bem("avatar-box") + " half-border"
|
|
72
|
+
}, [avatarSlot]);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return h("div", {
|
|
76
|
+
"class": bem("avatar-box" + " half-border")
|
|
77
|
+
}, [item.avatar ? h("img", {
|
|
78
|
+
"class": bem("avatar"),
|
|
79
|
+
"attrs": {
|
|
80
|
+
"src": item.avatar,
|
|
81
|
+
"alt": ""
|
|
82
|
+
}
|
|
83
|
+
}) : h("div", {
|
|
84
|
+
"class": bem("avatar")
|
|
85
|
+
}, [item.human.slice(-2)])]);
|
|
86
|
+
},
|
|
87
|
+
genTitle: function genTitle(item, titleSlot) {
|
|
88
|
+
var h = this.$createElement;
|
|
89
|
+
|
|
90
|
+
if (titleSlot) {
|
|
91
|
+
return h("div", {
|
|
92
|
+
"class": bem("title-box")
|
|
93
|
+
}, [titleSlot]);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return h("div", {
|
|
97
|
+
"class": bem("title-box")
|
|
98
|
+
}, [h("span", {
|
|
99
|
+
"class": bem("title")
|
|
100
|
+
}, [item.department + "[" + item.human + "]"]), h("span", {
|
|
101
|
+
"class": bem("time")
|
|
102
|
+
}, [item.timestamp])]);
|
|
103
|
+
},
|
|
104
|
+
genContent: function genContent(item, contentSlot) {
|
|
105
|
+
var h = this.$createElement;
|
|
106
|
+
|
|
107
|
+
if (contentSlot) {
|
|
108
|
+
return h("div", {
|
|
109
|
+
"class": bem("content-box") + " half-border-bottom"
|
|
110
|
+
}, [contentSlot]);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return h("div", {
|
|
114
|
+
"class": bem("content-box" + " half-border-bottom")
|
|
115
|
+
}, ["\u5728", h("span", [item.stage]), "\u9636\u6BB5", h("span", {
|
|
116
|
+
"class": bem("text-bold")
|
|
117
|
+
}, [" ", item.action, " "]), "\u5230", h("span", [item.nextAction]), h("span", [item.nextDepartment]), h("span", {
|
|
118
|
+
"class": bem("text-bold")
|
|
119
|
+
}, [" [", item.nextHuman, "]"])]);
|
|
120
|
+
},
|
|
121
|
+
genOpinion: function genOpinion(item, opinionSlot) {
|
|
122
|
+
var h = this.$createElement;
|
|
123
|
+
|
|
124
|
+
if (opinionSlot) {
|
|
125
|
+
return h("div", {
|
|
126
|
+
"class": bem("opinion-box")
|
|
127
|
+
}, [opinionSlot]);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return h("div", {
|
|
131
|
+
"class": bem("opinion-box")
|
|
132
|
+
}, [h("div", {
|
|
133
|
+
"class": bem("opinion-label")
|
|
134
|
+
}, [this.opinionKey]), h("div", {
|
|
135
|
+
"class": bem("opinion")
|
|
136
|
+
}, [item.opinion])]);
|
|
137
|
+
},
|
|
138
|
+
genProcessItem: function genProcessItem(item, isLast) {
|
|
139
|
+
var h = this.$createElement;
|
|
140
|
+
var avatarSlot = this.slots("avatar", item);
|
|
141
|
+
var titleSlot = this.slots("title", item);
|
|
142
|
+
var contentSlot = this.slots("content", item);
|
|
143
|
+
var opinionSlot = this.slots("opinion", item);
|
|
144
|
+
return h("div", {
|
|
145
|
+
"class": bem("item") + (" " + (isLast ? "last-item" : ""))
|
|
146
|
+
}, [h("div", {
|
|
147
|
+
"class": bem("left-container")
|
|
148
|
+
}, [this.genAvatar(item, avatarSlot), h("div", {
|
|
149
|
+
"class": bem("line")
|
|
150
|
+
})]), h("div", {
|
|
151
|
+
"class": bem("right-container")
|
|
152
|
+
}, [this.genTitle(item, titleSlot), h("div", {
|
|
153
|
+
"class": bem("main-container") + " half-border"
|
|
154
|
+
}, [this.genContent(item, contentSlot), this.genOpinion(item, opinionSlot)])])]);
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
render: function render(h) {
|
|
158
|
+
var _this2 = this;
|
|
159
|
+
|
|
160
|
+
return h("div", {
|
|
161
|
+
"class": bem()
|
|
162
|
+
}, [h("div", {
|
|
163
|
+
"class": bem("top-bar") + " half-border-bottom"
|
|
164
|
+
}, [h("div", {
|
|
165
|
+
"class": bem("top-left")
|
|
166
|
+
}, [h("div", {
|
|
167
|
+
"class": bem("bar")
|
|
168
|
+
}), h("div", {
|
|
169
|
+
"class": bem("title")
|
|
170
|
+
}, [this.title])]), h("div", {
|
|
171
|
+
"class": bem("top-right")
|
|
172
|
+
}, [h("span", {
|
|
173
|
+
"class": bem("fold-text")
|
|
174
|
+
}, ["\u6298\u53E0", this.title]), h(Switch, {
|
|
175
|
+
"model": {
|
|
176
|
+
value: _this2.isFold,
|
|
177
|
+
callback: function callback($$v) {
|
|
178
|
+
_this2.isFold = $$v;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
})])]), this.processes.length ? h("div", {
|
|
182
|
+
"class": bem("container")
|
|
183
|
+
}, [this.genProcesses()]) : h()]);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
@import '../style/var';
|
|
2
|
+
|
|
3
|
+
.zt-timeline {
|
|
4
|
+
background-color: #fff;
|
|
5
|
+
&__top-bar {
|
|
6
|
+
height: 44px;
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
align-items: center;
|
|
10
|
+
}
|
|
11
|
+
&__top-left {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
&__bar {
|
|
16
|
+
width: 4px;
|
|
17
|
+
height: 16px;
|
|
18
|
+
background: #0091fa;
|
|
19
|
+
margin-right: 12px;
|
|
20
|
+
}
|
|
21
|
+
&__title {
|
|
22
|
+
font-size: 16px;
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
color: #000000;
|
|
25
|
+
line-height: 24px;
|
|
26
|
+
}
|
|
27
|
+
&__top-right {
|
|
28
|
+
padding-right: 16px;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
}
|
|
32
|
+
&__fold-text {
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
color: rgba(0,0,0,0.60);
|
|
35
|
+
line-height: 24px;
|
|
36
|
+
margin-right: 8px;
|
|
37
|
+
}
|
|
38
|
+
&__container {
|
|
39
|
+
padding-top: 16px;
|
|
40
|
+
}
|
|
41
|
+
&__item {
|
|
42
|
+
padding: 0 16px 16px 16px;
|
|
43
|
+
display: flex;
|
|
44
|
+
&.last-item {
|
|
45
|
+
.zt-timeline__line {
|
|
46
|
+
height: 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
&__left-container {
|
|
51
|
+
margin-right: 8px;
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
align-items: center;
|
|
55
|
+
}
|
|
56
|
+
&__right-container {
|
|
57
|
+
flex: 1;
|
|
58
|
+
}
|
|
59
|
+
&__avatar-box {
|
|
60
|
+
width: 40px;
|
|
61
|
+
height: 40px;
|
|
62
|
+
}
|
|
63
|
+
&__avatar {
|
|
64
|
+
width: 40px;
|
|
65
|
+
height: 40px;
|
|
66
|
+
background: #0091fa;
|
|
67
|
+
border-radius: 4px;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
font-weight: bold;
|
|
70
|
+
text-align: center;
|
|
71
|
+
color: #ffffff;
|
|
72
|
+
line-height: 40px;
|
|
73
|
+
}
|
|
74
|
+
&__line {
|
|
75
|
+
background-color: #f5f5f5;
|
|
76
|
+
width: 2px;
|
|
77
|
+
height: 100%;
|
|
78
|
+
margin-top: 4px;
|
|
79
|
+
margin-bottom: -12px;
|
|
80
|
+
}
|
|
81
|
+
&__title-box {
|
|
82
|
+
display: flex;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
align-items: center;
|
|
85
|
+
margin-bottom: 8px;
|
|
86
|
+
}
|
|
87
|
+
&__title {
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
font-weight: bold;
|
|
90
|
+
color: #000000;
|
|
91
|
+
line-height: 24px;
|
|
92
|
+
}
|
|
93
|
+
&__time {
|
|
94
|
+
font-size: 12px;
|
|
95
|
+
color: rgba(0,0,0,.8);
|
|
96
|
+
line-height: 16px;
|
|
97
|
+
}
|
|
98
|
+
&__content-box {
|
|
99
|
+
font-size: 14px;
|
|
100
|
+
color: rgba(0,0,0,0.80);
|
|
101
|
+
line-height: 20px;
|
|
102
|
+
padding-bottom: 8px;
|
|
103
|
+
}
|
|
104
|
+
&__main-container {
|
|
105
|
+
background: rgba(0,0,0,0.02);
|
|
106
|
+
border-radius: 4px;
|
|
107
|
+
padding: 8px 12px;
|
|
108
|
+
&::before {
|
|
109
|
+
border-radius: 4px;
|
|
110
|
+
}
|
|
111
|
+
.zt-timeline__text-bold {
|
|
112
|
+
font-weight: bold;
|
|
113
|
+
color: #000000;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
&__opinion-box {
|
|
117
|
+
padding-top: 7px;
|
|
118
|
+
}
|
|
119
|
+
&__opinion-label {
|
|
120
|
+
margin-bottom: 4px;
|
|
121
|
+
font-size: 14px;
|
|
122
|
+
color: rgba(0,0,0,.4);
|
|
123
|
+
line-height: 20px;
|
|
124
|
+
}
|
|
125
|
+
&__opinion {
|
|
126
|
+
font-size: 14px;
|
|
127
|
+
color: #000000;
|
|
128
|
+
line-height: 20px;
|
|
129
|
+
}
|
|
130
|
+
}
|