eoss-mobiles 0.2.2 → 0.2.4
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 +4 -1
- package/lib/action-sheet.js +2 -2
- package/lib/button-group.js +2 -2
- package/lib/button.js +2 -2
- package/lib/calendar.js +2 -2
- package/lib/cascader.js +2 -2
- package/lib/cell.js +2 -2
- package/lib/checkbox.js +108 -108
- package/lib/circle.js +2 -2
- package/lib/count-down.js +2 -2
- package/lib/date.js +2 -2
- package/lib/empty.js +2 -2
- package/lib/eoss-mobile.common.js +506 -151
- package/lib/esign.js +522 -0
- package/lib/field.js +2 -2
- package/lib/flow.js +108 -108
- package/lib/form.js +2 -2
- package/lib/grid-item.js +2 -2
- package/lib/grid.js +2 -2
- package/lib/image-preview.js +2 -2
- package/lib/image.js +2 -2
- package/lib/index.js +1 -1
- package/lib/list.js +2 -2
- package/lib/loading.js +2 -2
- package/lib/nav-bar.js +2 -2
- package/lib/pagination.js +4 -4
- package/lib/picker.js +107 -107
- package/lib/popover.js +2 -2
- package/lib/popup.js +2 -2
- package/lib/radio.js +107 -107
- package/lib/rate.js +2 -2
- package/lib/search.js +2 -2
- package/lib/selector.js +296 -257
- package/lib/skeleton.js +2 -2
- package/lib/stepper.js +2 -2
- package/lib/switch.js +2 -2
- package/lib/tab.js +2 -2
- package/lib/table-column.js +106 -106
- package/lib/table.js +110 -110
- package/lib/tabs.js +2 -2
- package/lib/tag.js +2 -2
- package/lib/theme-chalk/esign.css +1 -0
- package/lib/theme-chalk/index.css +1 -1
- package/lib/uploader.js +2 -2
- package/package.json +3 -2
- package/packages/esign/index.js +5 -0
- package/packages/esign/src/main.vue +144 -0
- package/packages/selector/src/selector-tree.vue +90 -75
- package/packages/selector/src/tree.vue +9 -4
- package/packages/theme-chalk/lib/esign.css +1 -0
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/src/esign.scss +52 -0
- package/packages/theme-chalk/src/index.scss +1 -0
- package/src/index.js +4 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="em-esign">
|
|
3
|
+
<div v-if="!$scopedSlots.default && !$slots.default">
|
|
4
|
+
<div
|
|
5
|
+
class="signature-box box-flex box-justify-center"
|
|
6
|
+
:style="{
|
|
7
|
+
height:
|
|
8
|
+
typeof height === 'number'
|
|
9
|
+
? height
|
|
10
|
+
: height.replace('px', '') + 'px'
|
|
11
|
+
}"
|
|
12
|
+
v-tap="{ methods: esignShow }"
|
|
13
|
+
>
|
|
14
|
+
<img :src="files" />
|
|
15
|
+
</div>
|
|
16
|
+
<div class="opinion-box">
|
|
17
|
+
<span v-tap="{ methods: esignShow }">打开手写签字</span>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<slot v-else name="default" :click="esignShow" />
|
|
21
|
+
<van-popup
|
|
22
|
+
v-model="showEsign"
|
|
23
|
+
closeable
|
|
24
|
+
class="esign-skin"
|
|
25
|
+
:style="{
|
|
26
|
+
width:
|
|
27
|
+
typeof esignWidth === 'number'
|
|
28
|
+
? esignWidth
|
|
29
|
+
: esignWidth.replace('px', '') +
|
|
30
|
+
(esignWidth.indexOf('%') == -1 && 'px')
|
|
31
|
+
}"
|
|
32
|
+
>
|
|
33
|
+
<div class="esign-box">
|
|
34
|
+
<vue-esign
|
|
35
|
+
ref="esign"
|
|
36
|
+
:isCrop="false"
|
|
37
|
+
:height="esignHeight"
|
|
38
|
+
:lineWidth="lineWidth"
|
|
39
|
+
:lineColor="lineColor"
|
|
40
|
+
/>
|
|
41
|
+
<div class="esign-btn-box">
|
|
42
|
+
<em-button
|
|
43
|
+
type="warning"
|
|
44
|
+
size="small"
|
|
45
|
+
v-tap="{ methods: handleReset }"
|
|
46
|
+
>清除</em-button
|
|
47
|
+
>
|
|
48
|
+
<em-button
|
|
49
|
+
type="primary"
|
|
50
|
+
size="small"
|
|
51
|
+
v-tap="{ methods: handleGenerate }"
|
|
52
|
+
>保存</em-button
|
|
53
|
+
>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</van-popup>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
export default {
|
|
62
|
+
name: 'EmEsign',
|
|
63
|
+
data() {
|
|
64
|
+
return {
|
|
65
|
+
showEsign: false,
|
|
66
|
+
resultImg: '',
|
|
67
|
+
files: '',
|
|
68
|
+
file: ''
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
props: {
|
|
72
|
+
filePath: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: ''
|
|
75
|
+
},
|
|
76
|
+
height: {
|
|
77
|
+
type: [String, Number],
|
|
78
|
+
default: 80
|
|
79
|
+
},
|
|
80
|
+
esignWidth: {
|
|
81
|
+
type: Number,
|
|
82
|
+
default: 1
|
|
83
|
+
},
|
|
84
|
+
esignColor: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: '#000'
|
|
87
|
+
},
|
|
88
|
+
esignHeight: {
|
|
89
|
+
type: [String, Number],
|
|
90
|
+
default: 550
|
|
91
|
+
},
|
|
92
|
+
esignWidth: {
|
|
93
|
+
type: [String, Number],
|
|
94
|
+
default: '330'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
watch: {
|
|
98
|
+
filePath: {
|
|
99
|
+
handler(val) {
|
|
100
|
+
this.files = val;
|
|
101
|
+
},
|
|
102
|
+
immediate: true,
|
|
103
|
+
deep: true
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
methods: {
|
|
107
|
+
esignShow() {
|
|
108
|
+
this.showEsign = !this.showEsign;
|
|
109
|
+
},
|
|
110
|
+
handleReset() {
|
|
111
|
+
this.$refs.esign.reset();
|
|
112
|
+
this.$emit('reset');
|
|
113
|
+
},
|
|
114
|
+
handleGenerate() {
|
|
115
|
+
this.$refs.esign
|
|
116
|
+
.generate()
|
|
117
|
+
.then(res => {
|
|
118
|
+
this.resultImg = res;
|
|
119
|
+
this.files = res;
|
|
120
|
+
this.file = this.base64ImgtoFile(res);
|
|
121
|
+
this.showEsign = false;
|
|
122
|
+
this.$emit('save', { file: this.file, data: res });
|
|
123
|
+
})
|
|
124
|
+
.catch(err => {
|
|
125
|
+
this.$toast('请输入');
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
base64ImgtoFile(base64data, filename = 'file') {
|
|
129
|
+
let arr = base64data.split(',');
|
|
130
|
+
let mime = arr[0].match(/:(.*?);/)[1];
|
|
131
|
+
let suffix = mime.split('/')[1];
|
|
132
|
+
let bstr = atob(arr[1]);
|
|
133
|
+
let n = bstr.length;
|
|
134
|
+
let u8arr = new Uint8Array(n);
|
|
135
|
+
while (n--) {
|
|
136
|
+
u8arr[n] = bstr.charCodeAt(n);
|
|
137
|
+
}
|
|
138
|
+
return new File([u8arr], `${filename}.${suffix}`, {
|
|
139
|
+
type: mime
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
</script>
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
:departmentLabelKey="departmentLabelKey"
|
|
43
43
|
:departmentValueKey="departmentValueKey"
|
|
44
44
|
:nodeKey="nodeKey"
|
|
45
|
+
v-on="$listeners"
|
|
45
46
|
@popen="open"
|
|
46
47
|
:isTreeIcon="isTreeIcon"
|
|
47
48
|
@checke="checked"
|
|
@@ -51,7 +52,11 @@
|
|
|
51
52
|
:isOtherUnit="isOtherUnit"
|
|
52
53
|
:filid="filid"
|
|
53
54
|
>
|
|
54
|
-
<template
|
|
55
|
+
<template
|
|
56
|
+
slot="tree-icon"
|
|
57
|
+
v-if="$scopedSlots['tree-icon']"
|
|
58
|
+
slot-scope="{ value }"
|
|
59
|
+
>
|
|
55
60
|
<slot name="tree-icon" :value="value"></slot>
|
|
56
61
|
</template>
|
|
57
62
|
</em-tree>
|
|
@@ -107,9 +112,9 @@ export default {
|
|
|
107
112
|
// type: String, // 父id或者是空
|
|
108
113
|
// default: 'root'
|
|
109
114
|
// },
|
|
110
|
-
url:{
|
|
115
|
+
url: {
|
|
111
116
|
type: String,
|
|
112
|
-
default:''
|
|
117
|
+
default: ''
|
|
113
118
|
},
|
|
114
119
|
param: {
|
|
115
120
|
type: Object,
|
|
@@ -629,7 +634,11 @@ export default {
|
|
|
629
634
|
this.selectIndex
|
|
630
635
|
].param.selecttype;
|
|
631
636
|
request({
|
|
632
|
-
url:
|
|
637
|
+
url: this.url
|
|
638
|
+
? this.url
|
|
639
|
+
: this.baseUrl
|
|
640
|
+
? this.baseUrl + selectObject
|
|
641
|
+
: selectObject,
|
|
633
642
|
params: {
|
|
634
643
|
objType: this.objType,
|
|
635
644
|
namelike: this.namelike,
|
|
@@ -654,7 +663,6 @@ export default {
|
|
|
654
663
|
} else {
|
|
655
664
|
this.$toast(msg);
|
|
656
665
|
}
|
|
657
|
-
|
|
658
666
|
});
|
|
659
667
|
},
|
|
660
668
|
getData(obj) {
|
|
@@ -689,87 +697,94 @@ export default {
|
|
|
689
697
|
this.$toast.clear();
|
|
690
698
|
});
|
|
691
699
|
},
|
|
692
|
-
|
|
700
|
+
getChiled(res, isStart, key) {
|
|
693
701
|
const _that = this;
|
|
694
|
-
|
|
695
|
-
if (
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
} else {
|
|
701
|
-
this.$set(res.obj, 'open', true);
|
|
702
|
-
}
|
|
702
|
+
let data = (_that.$listeners[key])(res.obj, !!res.obj.children);
|
|
703
|
+
if (!isStart) {
|
|
704
|
+
if (res.obj.open) {
|
|
705
|
+
this.$set(res.obj, 'open', false);
|
|
706
|
+
} else {
|
|
707
|
+
this.$set(res.obj, 'open', true);
|
|
703
708
|
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
.then(res => {
|
|
725
|
-
res.map(x => {
|
|
726
|
-
!x[_that.nodeKey] && _that.$set(x, 'nocheck', false);
|
|
727
|
-
});
|
|
728
|
-
_that.$set(newData, 'children', res);
|
|
729
|
-
if (_that.selectList && _that.selectList.length > 0) {
|
|
730
|
-
_that.selectList.filter(r => {
|
|
731
|
-
newData.children.find(i => {
|
|
732
|
-
if (i[_that.valueKey] === r[_that.valueKey]) {
|
|
733
|
-
_that.$set(i, 'checked', true);
|
|
734
|
-
}
|
|
735
|
-
});
|
|
736
|
-
});
|
|
737
|
-
} else {
|
|
709
|
+
}
|
|
710
|
+
let newData = res.obj;
|
|
711
|
+
if (!newData.children && !isStart) {
|
|
712
|
+
if (this.nodeList && this.nodeList.length > 0) {
|
|
713
|
+
this.$toast.loading({
|
|
714
|
+
message: '加载中...',
|
|
715
|
+
forbidClick: true,
|
|
716
|
+
loadingType: 'spinner',
|
|
717
|
+
overlay: true,
|
|
718
|
+
duration: 0
|
|
719
|
+
});
|
|
720
|
+
if (!Array.isArray(data)) {
|
|
721
|
+
data
|
|
722
|
+
.then(res => {
|
|
723
|
+
res.map(x => {
|
|
724
|
+
!x[_that.nodeKey] && _that.$set(x, 'nocheck', false);
|
|
725
|
+
});
|
|
726
|
+
_that.$set(newData, 'children', res);
|
|
727
|
+
if (_that.selectList && _that.selectList.length > 0) {
|
|
728
|
+
_that.selectList.filter(r => {
|
|
738
729
|
newData.children.find(i => {
|
|
739
|
-
|
|
730
|
+
if (i[_that.valueKey] === r[_that.valueKey]) {
|
|
731
|
+
_that.$set(i, 'checked', true);
|
|
732
|
+
}
|
|
740
733
|
});
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
})
|
|
744
|
-
.catch(err => {
|
|
745
|
-
this.$toast('数据返回错误');
|
|
746
|
-
});
|
|
747
|
-
} else {
|
|
748
|
-
data.map(x => {
|
|
749
|
-
!x[_that.nodeKey] && _that.$set(x, 'nocheck', false);
|
|
750
|
-
});
|
|
751
|
-
_that.$set(newData, 'children', data);
|
|
752
|
-
if (_that.selectList && _that.selectList.length > 0) {
|
|
753
|
-
_that.selectList.filter(r => {
|
|
734
|
+
});
|
|
735
|
+
} else {
|
|
754
736
|
newData.children.find(i => {
|
|
755
|
-
|
|
756
|
-
_that.$set(i, 'checked', true);
|
|
757
|
-
}
|
|
737
|
+
_that.$set(i, 'checked', false);
|
|
758
738
|
});
|
|
759
|
-
}
|
|
760
|
-
|
|
739
|
+
}
|
|
740
|
+
this.$toast.clear();
|
|
741
|
+
})
|
|
742
|
+
.catch(err => {
|
|
743
|
+
this.$toast('数据返回错误');
|
|
744
|
+
});
|
|
745
|
+
} else {
|
|
746
|
+
data.map(x => {
|
|
747
|
+
!x[_that.nodeKey] && _that.$set(x, 'nocheck', false);
|
|
748
|
+
});
|
|
749
|
+
_that.$set(newData, 'children', data);
|
|
750
|
+
if (_that.selectList && _that.selectList.length > 0) {
|
|
751
|
+
_that.selectList.filter(r => {
|
|
761
752
|
newData.children.find(i => {
|
|
762
|
-
|
|
753
|
+
if (i[_that.valueKey] === r[_that.valueKey]) {
|
|
754
|
+
_that.$set(i, 'checked', true);
|
|
755
|
+
}
|
|
763
756
|
});
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
this.getData(res.obj);
|
|
757
|
+
});
|
|
758
|
+
} else {
|
|
759
|
+
newData.children.find(i => {
|
|
760
|
+
_that.$set(i, 'checked', false);
|
|
761
|
+
});
|
|
770
762
|
}
|
|
763
|
+
this.$toast.clear();
|
|
771
764
|
}
|
|
765
|
+
} else {
|
|
766
|
+
if (!res.obj.children) {
|
|
767
|
+
this.getData(res.obj);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
open(res, isStart, isNode) {
|
|
773
|
+
const _that = this;
|
|
774
|
+
_that.oldIsSearch = _that.isSearch;
|
|
775
|
+
// debugger
|
|
776
|
+
if (this.$listeners['node-click'] && this.$listeners['left-icon']) {
|
|
777
|
+
if (this.$listeners['left-icon'] && !isNode) {
|
|
778
|
+
this.getChiled(res, isStart, 'left-icon');
|
|
772
779
|
}
|
|
780
|
+
isNode && _that.$listeners['node-click'](res.obj, !!res.obj.children);
|
|
781
|
+
} else if (
|
|
782
|
+
this.$listeners['node-click'] ||
|
|
783
|
+
this.$listeners['left-icon']
|
|
784
|
+
) {
|
|
785
|
+
isNode &&this.$listeners['node-click'] && this.getChiled(res, isStart, 'node-click');
|
|
786
|
+
this.$listeners['left-icon']&& !isNode &&
|
|
787
|
+
this.getChiled(res, isStart, 'left-icon');
|
|
773
788
|
} else {
|
|
774
789
|
if (!isStart) {
|
|
775
790
|
if (res.obj.open) {
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
? item[labelKey].slice(0, 12) + '...'
|
|
21
21
|
: item[labelKey] -->
|
|
22
22
|
</div>
|
|
23
|
-
<
|
|
23
|
+
<div v-if="isTreeIcon" v-tap="{ methods: handleClickIcon, obj: item }" >
|
|
24
|
+
<slot name="tree-icon" :value="item"></slot>
|
|
25
|
+
</div>
|
|
24
26
|
{{ item[labelKey] }}
|
|
25
27
|
</div>
|
|
26
28
|
<van-icon name="arrow" class="right" v-if="!isTreeIcon" />
|
|
@@ -50,8 +52,7 @@
|
|
|
50
52
|
<template v-if="item.children && item.children.length > 0">
|
|
51
53
|
<em-tree
|
|
52
54
|
:model="item.children"
|
|
53
|
-
|
|
54
|
-
@checke="checke"
|
|
55
|
+
v-on="$listeners"
|
|
55
56
|
:isOtherUnit="isOtherUnit"
|
|
56
57
|
:filid="filid"
|
|
57
58
|
:nodeKey="nodeKey"
|
|
@@ -230,8 +231,12 @@ export default {
|
|
|
230
231
|
});
|
|
231
232
|
},
|
|
232
233
|
methods: {
|
|
234
|
+
handleClickIcon(res, isStart){
|
|
235
|
+
if(!this.$listeners['left-icon']) return
|
|
236
|
+
this.$emit('popen', res, res.isStart || isStart);
|
|
237
|
+
},
|
|
233
238
|
opened(res, isStart) {
|
|
234
|
-
this.$emit('popen', res, res.isStart || isStart);
|
|
239
|
+
this.$emit('popen', res, res.isStart || isStart,true);
|
|
235
240
|
},
|
|
236
241
|
checke(res) {
|
|
237
242
|
this.$emit('checke', res);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.em-esign .signature-box{margin-top:7px;height:80px;background-color:#f7f5f5;padding:5px;text-align:center}.em-esign .signature-box img{height:100%;background-color:#fff}.em-esign .opinion-box{height:32px;padding-top:10px;padding-bottom:5px;padding-right:10px;font-size:13px;color:#12278B;text-align:right}.em-esign .esign-skin{width:100%;border-radius:5px}.em-esign .esign-skin .van-popup__close-icon{top:8px;right:8px}.em-esign .esign-box .esign-title{height:40px;line-height:40px;border-bottom:1px solid #12278B;font-size:15px;padding:0 10px}.em-esign .esign-box .esign-btn-box{padding:10px;text-align:right}.em-esign .esign-box .esign-btn-box .van-button{padding:0 7px;border-radius:4px}
|