wl-design-mobile 0.1.7 → 0.1.8
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 +6 -6
- package/doc/img/styles/css/index.css +3 -3
- package/edit/list/styles/css/index.css +39 -39
- package/edit/select/lambo-edit-date-time.vue +14 -6
- package/list/components/table/lambo-table-footer.vue +44 -0
- package/list/components/table/lambo-table-row.vue +69 -0
- package/list/lambo-table-list2.vue +211 -0
- package/package.json +4 -2
- package/search/lambo-search-box.vue +1 -1
- package/search/styles/css/index.css +136 -136
- package/util/assist.js +43 -43
- package/util/bus.js +4 -4
- package/util/jssdk.js +141 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# wl-design-mobile
|
|
2
|
-
|
|
3
|
-
## Setup
|
|
4
|
-
```
|
|
5
|
-
npm i wl-design-mobile
|
|
6
|
-
```
|
|
1
|
+
# wl-design-mobile
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
```
|
|
5
|
+
npm i wl-design-mobile
|
|
6
|
+
```
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.img-upload-container {
|
|
2
|
-
padding: 0px 14px 12px 14px;
|
|
3
|
-
}
|
|
1
|
+
.img-upload-container {
|
|
2
|
+
padding: 0px 14px 12px 14px;
|
|
3
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
.coll-div {
|
|
2
|
-
margin-bottom: 8px;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.indicator-title {
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
color: var(--scl-blue);
|
|
9
|
-
font-size: 14px;
|
|
10
|
-
font-family: 微软雅黑, serif Regular;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.indicator-title .color-line {
|
|
14
|
-
width: 3px;
|
|
15
|
-
height: 14px;
|
|
16
|
-
margin-right: 8px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.coll-title-icon {
|
|
20
|
-
justify-content: center;
|
|
21
|
-
align-items: center;
|
|
22
|
-
align-content: center;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* 覆盖折叠面板的标题的padding */
|
|
26
|
-
/deep/ .van-cell {
|
|
27
|
-
padding: 12px 10px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* 覆盖去掉折叠面板的标题下面的线 */
|
|
31
|
-
/deep/ .van-cell::after {
|
|
32
|
-
border: none;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* 覆盖折叠面板的内容的padding */
|
|
36
|
-
/deep/ .van-collapse-item__content {
|
|
37
|
-
padding: 0px 0px 0px 0px;
|
|
38
|
-
}
|
|
39
|
-
|
|
1
|
+
.coll-div {
|
|
2
|
+
margin-bottom: 8px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.indicator-title {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
color: var(--scl-blue);
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
font-family: 微软雅黑, serif Regular;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.indicator-title .color-line {
|
|
14
|
+
width: 3px;
|
|
15
|
+
height: 14px;
|
|
16
|
+
margin-right: 8px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.coll-title-icon {
|
|
20
|
+
justify-content: center;
|
|
21
|
+
align-items: center;
|
|
22
|
+
align-content: center;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* 覆盖折叠面板的标题的padding */
|
|
26
|
+
/deep/ .van-cell {
|
|
27
|
+
padding: 12px 10px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* 覆盖去掉折叠面板的标题下面的线 */
|
|
31
|
+
/deep/ .van-cell::after {
|
|
32
|
+
border: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* 覆盖折叠面板的内容的padding */
|
|
36
|
+
/deep/ .van-collapse-item__content {
|
|
37
|
+
padding: 0px 0px 0px 0px;
|
|
38
|
+
}
|
|
39
|
+
|
|
@@ -7,11 +7,9 @@
|
|
|
7
7
|
</div>
|
|
8
8
|
<div class="edit-title">{{ title }}</div>
|
|
9
9
|
</div>
|
|
10
|
-
<van-field v-model="valName" :placeholder="placeholder" :readonly="true"
|
|
11
|
-
class="edit-lambo-input" clear-trigger="focus"></van-field>
|
|
10
|
+
<van-field v-model="valName" :placeholder="placeholder" :readonly="true" class="edit-lambo-input" clear-trigger="focus"></van-field>
|
|
12
11
|
<van-popup v-model="showBottom" position="bottom" :style="{ maxHeight: '33%' }">
|
|
13
|
-
<van-datetime-picker :type="type" title="选择时间" @confirm="onConfirm"
|
|
14
|
-
@cancel="onCancelTime"/>
|
|
12
|
+
<van-datetime-picker v-model="curDateTime" :type="type" title="选择时间" @confirm="onConfirm" @cancel="onCancelTime"/>
|
|
15
13
|
</van-popup>
|
|
16
14
|
</div>
|
|
17
15
|
<div v-if="icon" class="edit-right-icon">
|
|
@@ -48,6 +46,10 @@ export default {
|
|
|
48
46
|
type: String,
|
|
49
47
|
default: 'datetime',
|
|
50
48
|
},
|
|
49
|
+
defaultDate: {
|
|
50
|
+
type: Date,
|
|
51
|
+
default: () => null
|
|
52
|
+
},
|
|
51
53
|
},
|
|
52
54
|
data() {
|
|
53
55
|
return {
|
|
@@ -57,6 +59,7 @@ export default {
|
|
|
57
59
|
dateStr: '',
|
|
58
60
|
dateFormat: ''
|
|
59
61
|
},
|
|
62
|
+
curDateTime: null
|
|
60
63
|
}
|
|
61
64
|
},
|
|
62
65
|
methods: {
|
|
@@ -93,10 +96,15 @@ export default {
|
|
|
93
96
|
onCancelTime() {
|
|
94
97
|
this.showBottom = false;
|
|
95
98
|
},
|
|
99
|
+
initDefaultVal() {
|
|
100
|
+
if (this.defaultDate) {
|
|
101
|
+
this.curDateTime = this.defaultDate
|
|
102
|
+
this.onConfirm(this.defaultDate)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
96
105
|
},
|
|
97
106
|
created() {
|
|
98
|
-
|
|
99
|
-
mounted() {
|
|
107
|
+
this.initDefaultVal()
|
|
100
108
|
}
|
|
101
109
|
}
|
|
102
110
|
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="table-footer" ref="listRowDiv">
|
|
4
|
+
<div class="footer-cell">
|
|
5
|
+
<p>{{footerData.label}}</p>
|
|
6
|
+
<p>{{footerData.value}}</p>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'LamboTableFooter',
|
|
14
|
+
props: {
|
|
15
|
+
footerData: {
|
|
16
|
+
type: Object
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
data() {
|
|
20
|
+
return {}
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
<style scoped lang="css">
|
|
25
|
+
.table-footer {
|
|
26
|
+
width: 100%;
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-auto-rows: 30px;
|
|
29
|
+
gap: 1px;
|
|
30
|
+
align-items: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.footer-cell {
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
border: 1px solid #ddd;
|
|
36
|
+
border-radius: 3px;
|
|
37
|
+
font-size: 14px;
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
place-items: center;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
44
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-row" ref="listRowDiv">
|
|
3
|
+
<div v-for="(item, index) in columns" :key="index" class="table-cell" :style="{
|
|
4
|
+
gridColumn: index + 1,
|
|
5
|
+
minWidth: itemWidth,
|
|
6
|
+
textAlign: item.align || 'left' }">
|
|
7
|
+
<p v-if="item?.type === 'index'">{{seq + 1}}</p>
|
|
8
|
+
<p v-else> {{ data[item.key] }} </p>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
<script>
|
|
13
|
+
export default {
|
|
14
|
+
name: 'LamboTableRow',
|
|
15
|
+
props: {
|
|
16
|
+
columns: {
|
|
17
|
+
type: Array,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
data: {
|
|
21
|
+
type: Object,
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
24
|
+
seq: {
|
|
25
|
+
type: Number,
|
|
26
|
+
required: true
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
itemWidth: ''
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
mounted() {
|
|
35
|
+
this.setBodyWidth()
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
setBodyWidth() {
|
|
39
|
+
const headerItems = this.$refs.listRowDiv
|
|
40
|
+
if (headerItems && headerItems.length) {
|
|
41
|
+
const widths = headerItems.map(item => item.offsetWidth);
|
|
42
|
+
const maxWidth = Math.max(...widths) + 'px'; // 获取最大宽度
|
|
43
|
+
this.itemWidth = maxWidth; // 设置表体宽度
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
<style scoped lang="css">
|
|
50
|
+
.table-row {
|
|
51
|
+
width: 100%;
|
|
52
|
+
display: grid;
|
|
53
|
+
grid-auto-rows: 30px;
|
|
54
|
+
gap: 1px;
|
|
55
|
+
align-items: center;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.table-cell {
|
|
59
|
+
box-sizing: border-box;
|
|
60
|
+
border: 1px solid #ddd;
|
|
61
|
+
border-radius: 3px;
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
place-items: center;
|
|
65
|
+
display: inline-block;
|
|
66
|
+
align-items: center;
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
69
|
+
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<lambo-table-head :columns="columns"></lambo-table-head>
|
|
4
|
+
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
|
5
|
+
<van-list v-model="loading" :finished="finished" :finished-text="finishedTxt" :offset="200" @load="onLoad">
|
|
6
|
+
<div v-for="(item, index) in list" :key="index">
|
|
7
|
+
<lambo-table-row :seq="index" v-bind:key="index" :data="item" :columns="columns"></lambo-table-row>
|
|
8
|
+
</div>
|
|
9
|
+
</van-list>
|
|
10
|
+
</van-pull-refresh>
|
|
11
|
+
<lambo-table-footer v-if="tableFooter" :footer-data="footerData"></lambo-table-footer>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<script>
|
|
15
|
+
import {axios} from "../util/axios/index"
|
|
16
|
+
import {Toast} from "vant"
|
|
17
|
+
import LamboTableHead from "@/components/lambo/list/components/table/lambo-table-head.vue";
|
|
18
|
+
import LamboTableRow from "@/components/lambo/list/components/table/lambo-table-row.vue";
|
|
19
|
+
import LamboTableFooter from "@/components/lambo/list/components/table/lambo-table-footer.vue";
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: "LamboTableList2",
|
|
23
|
+
components: {
|
|
24
|
+
LamboTableHead,
|
|
25
|
+
LamboTableRow,
|
|
26
|
+
LamboTableFooter
|
|
27
|
+
},
|
|
28
|
+
props: {
|
|
29
|
+
heightRatio: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 0.5,
|
|
32
|
+
},
|
|
33
|
+
url: {
|
|
34
|
+
type: String
|
|
35
|
+
},
|
|
36
|
+
searchParams: {
|
|
37
|
+
type: Object
|
|
38
|
+
},
|
|
39
|
+
testMode: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
tableFooter: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
columns: {
|
|
48
|
+
type: Array,
|
|
49
|
+
default: () => []
|
|
50
|
+
},
|
|
51
|
+
footerData: {
|
|
52
|
+
type: Object,
|
|
53
|
+
default: () => {
|
|
54
|
+
return {
|
|
55
|
+
label: '',
|
|
56
|
+
value: '',
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
data() {
|
|
62
|
+
return {
|
|
63
|
+
loading: false,
|
|
64
|
+
finished: true,
|
|
65
|
+
finishedTxt: "",
|
|
66
|
+
pageNum: 1, // 当前页数
|
|
67
|
+
pageSize: 10, // 每页数据条数
|
|
68
|
+
refreshing: false,
|
|
69
|
+
offset: 0,
|
|
70
|
+
limit: 10,
|
|
71
|
+
list: [
|
|
72
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-01", person:"01", dpt: "储配部", note: "测试"},
|
|
73
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-02", person:"02", dpt: "储配部", note: "测试"},
|
|
74
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-01", person:"01", dpt: "储配部", note: "测试"},
|
|
75
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-02", person:"02", dpt: "储配部", note: "测试"},
|
|
76
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-01", person:"01", dpt: "储配部", note: "测试"},
|
|
77
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-02", person:"02", dpt: "储配部", note: "测试"},
|
|
78
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-01", person:"01", dpt: "储配部", note: "测试"},
|
|
79
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-02", person:"02", dpt: "储配部", note: "测试"},
|
|
80
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-01", person:"01", dpt: "储配部", note: "测试"},
|
|
81
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-02", person:"02", dpt: "储配部", note: "测试"},
|
|
82
|
+
]
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
mounted() {
|
|
86
|
+
},
|
|
87
|
+
watch: {
|
|
88
|
+
searchParams: {
|
|
89
|
+
handler: function (val, oldVal) {
|
|
90
|
+
console.log("searchParams -- val,oldVal:", {val, oldVal})
|
|
91
|
+
console.log("searchParams -- val===oldVal:", val === oldVal)
|
|
92
|
+
//查询时重置页码
|
|
93
|
+
this.pageNum = 1
|
|
94
|
+
this.offset = 0
|
|
95
|
+
this.limit = 10
|
|
96
|
+
this.list = []
|
|
97
|
+
|
|
98
|
+
this.onLoad()
|
|
99
|
+
},
|
|
100
|
+
deep: true
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
methods: {
|
|
104
|
+
onLoad() {
|
|
105
|
+
if (this.refreshing) {
|
|
106
|
+
this.list = [];
|
|
107
|
+
this.refreshing = false;
|
|
108
|
+
}
|
|
109
|
+
if (this.testMode === true) {
|
|
110
|
+
let arr = [
|
|
111
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-01", person:"01", dpt: "储配部", note: "测试"},
|
|
112
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-02", person:"02", dpt: "储配部", note: "测试"},
|
|
113
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-01", person:"01", dpt: "储配部", note: "测试"},
|
|
114
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-02", person:"02", dpt: "储配部", note: "测试"},
|
|
115
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-01", person:"01", dpt: "储配部", note: "测试"},
|
|
116
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-02", person:"02", dpt: "储配部", note: "测试"},
|
|
117
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-01", person:"01", dpt: "储配部", note: "测试"},
|
|
118
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-02", person:"02", dpt: "储配部", note: "测试"},
|
|
119
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-01", person:"01", dpt: "储配部", note: "测试"},
|
|
120
|
+
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-02", person:"02", dpt: "储配部", note: "测试"},
|
|
121
|
+
]
|
|
122
|
+
this.list.push(...arr)
|
|
123
|
+
this.finished = false
|
|
124
|
+
this.offset = this.pageNum * 10
|
|
125
|
+
this.pageNum++;
|
|
126
|
+
}else{
|
|
127
|
+
let params = {offset: this.offset, limit: this.limit, ...this.searchParams}
|
|
128
|
+
axios.get(this.url, {params}).then(res => {
|
|
129
|
+
console.log("lambo-list -- onLoad -- loadData:", res)
|
|
130
|
+
if (res && res.code === 1) {
|
|
131
|
+
let pageData = res.data
|
|
132
|
+
|
|
133
|
+
if (pageData && pageData.rows.length > 0) {
|
|
134
|
+
for (let item of pageData.rows) {
|
|
135
|
+
if (this.list.length < pageData.total) {
|
|
136
|
+
this.list.push(item)
|
|
137
|
+
this.finished = false
|
|
138
|
+
} else {
|
|
139
|
+
this.finished = true // 数据加载完毕
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
this.offset = this.pageNum * 10
|
|
143
|
+
this.pageNum++;
|
|
144
|
+
this.finishedTxt = "没有更多了"
|
|
145
|
+
} else {
|
|
146
|
+
this.finished = true; // 数据加载完毕
|
|
147
|
+
}
|
|
148
|
+
this.loading = false; // 加载状态结束
|
|
149
|
+
} else {
|
|
150
|
+
console.error("lambo-init-list -- onLoad -- 查询[" + this.title + "]数据失败", res)
|
|
151
|
+
Toast.fail("查询[" + this.title + "]数据失败:" + res.data || '')
|
|
152
|
+
}
|
|
153
|
+
}).catch(err => {
|
|
154
|
+
console.error("lambo-init-list -- onLoad -- 查询[" + this.title + "]异常:", err)
|
|
155
|
+
Toast.fail("查询[" + this.url + "]数据异常")
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
onRefresh() {
|
|
160
|
+
console.log("lambo-init-list -- onRefresh")
|
|
161
|
+
|
|
162
|
+
this.finished = false
|
|
163
|
+
this.pageNum = 1
|
|
164
|
+
this.offset = 0
|
|
165
|
+
this.limit = 10
|
|
166
|
+
|
|
167
|
+
this.loading = true
|
|
168
|
+
this.onLoad()
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
beforeDestroy() {
|
|
172
|
+
this.pageNum = 1
|
|
173
|
+
this.offset = 0
|
|
174
|
+
this.limit = 10
|
|
175
|
+
this.list = []
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
</script>
|
|
179
|
+
<style scoped>
|
|
180
|
+
@import "../styles/index.less";
|
|
181
|
+
|
|
182
|
+
/* 设置滚动条轨道颜色 */
|
|
183
|
+
::-webkit-scrollbar-track {
|
|
184
|
+
background: rgba(231, 242, 250, 0.4);
|
|
185
|
+
border-radius: 3px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* 设置滚动条滑块颜色 */
|
|
189
|
+
::-webkit-scrollbar-thumb {
|
|
190
|
+
background: rgba(45, 140, 240, 0.6);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* 设置滚动条宽度 */
|
|
194
|
+
::-webkit-scrollbar {
|
|
195
|
+
width: 6px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.custom-list {
|
|
199
|
+
overflow-y: auto;
|
|
200
|
+
background-color: var(--scl-white-1);
|
|
201
|
+
padding: 0 8px 0 14px;
|
|
202
|
+
margin-top: -6px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.list-item {
|
|
206
|
+
border-bottom: 1px solid var(--scl-gray-5);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
</style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wl-design-mobile",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "finch",
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
"vant": "^2.13.2",
|
|
20
20
|
"vue-router": "^3.0.5",
|
|
21
21
|
"moment": "^2.30.1",
|
|
22
|
-
"axios": "^1.7.2"
|
|
22
|
+
"axios": "^1.7.2",
|
|
23
|
+
"dingtalk-jsapi": "^3.0.12",
|
|
24
|
+
"weixin-js-sdk": "^1.6.5"
|
|
23
25
|
},
|
|
24
26
|
"devDependencies": {
|
|
25
27
|
"vue": "^2.6.14"
|
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
.search-top-pop {
|
|
2
|
-
min-height: 112px;
|
|
3
|
-
max-height: 33%;
|
|
4
|
-
background-color: var(--scl-white-1)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.search-body {
|
|
8
|
-
border-top: none;
|
|
9
|
-
overflow-y: auto;
|
|
10
|
-
flex: 1
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.search-bottom-btn {
|
|
14
|
-
padding: 12px 14px 12px 14px;
|
|
15
|
-
box-shadow: 0 -2px 10px rgba(125, 126, 128, .16);
|
|
16
|
-
background-color: rgb(255, 255, 255, 1);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/*日期选择*/
|
|
20
|
-
.search-row {
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: row;
|
|
23
|
-
justify-content: flex-start;
|
|
24
|
-
flex-wrap: nowrap;
|
|
25
|
-
align-items: center;
|
|
26
|
-
align-content: center;
|
|
27
|
-
height: 50px;
|
|
28
|
-
padding: 10px 0;
|
|
29
|
-
margin: 0 14px;
|
|
30
|
-
border-bottom: 1px solid var(--scl-white-2);
|
|
31
|
-
border-top: none;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.search-input-title {
|
|
35
|
-
height: 16px;
|
|
36
|
-
font-size: 12px;
|
|
37
|
-
color: var(--scl-gray-2);
|
|
38
|
-
display: flex;
|
|
39
|
-
justify-content: flex-start;
|
|
40
|
-
align-items: center;
|
|
41
|
-
margin-left: 12px;
|
|
42
|
-
width: 76px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.search-lambo-input {
|
|
46
|
-
border: none;
|
|
47
|
-
outline: none;
|
|
48
|
-
background: none;
|
|
49
|
-
height: 16px;
|
|
50
|
-
font-size: 12px;
|
|
51
|
-
color: var(--scl-gray-1);
|
|
52
|
-
display: flex;
|
|
53
|
-
justify-content: flex-start;
|
|
54
|
-
align-items: center;
|
|
55
|
-
margin-left: 8px;
|
|
56
|
-
flex: 1;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/*输入框*/
|
|
60
|
-
.search-lambo-input .van-cell {
|
|
61
|
-
padding: 10px 0;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/*多选*/
|
|
65
|
-
.search-top-div {
|
|
66
|
-
display: flex;
|
|
67
|
-
justify-content: space-between;
|
|
68
|
-
height: 44px;
|
|
69
|
-
line-height: 44px;
|
|
70
|
-
width: 100%;
|
|
71
|
-
position: fixed;
|
|
72
|
-
z-index: 2;
|
|
73
|
-
box-shadow: 0 2px 10px rgba(125, 126, 128, .16);
|
|
74
|
-
background-color: rgb(255, 255, 255, 1);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.search-cancel-btn {
|
|
78
|
-
border: none;
|
|
79
|
-
color: var(--scl-gray-3);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.search-confirm-btn {
|
|
83
|
-
border: none;
|
|
84
|
-
color: var(--scl-blue);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.search-select-title {
|
|
88
|
-
font-size: 16px;
|
|
89
|
-
font-weight: bold;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/*修改单选多选的滚动条样式*/
|
|
93
|
-
/deep/ .van-radio-group {
|
|
94
|
-
position: relative;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/*修改单选多选的滚动条样式*/
|
|
98
|
-
/deep/ .van-cell-group {
|
|
99
|
-
padding-top: 44px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/*修改单选多选的滚动条样式*/
|
|
103
|
-
/deep/ .van-cell:first-child {
|
|
104
|
-
padding-top: 10px;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/*滚动条样式*/
|
|
108
|
-
/deep/ ::-webkit-scrollbar {
|
|
109
|
-
width: 6px;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/*滚动条样式*/
|
|
113
|
-
/deep/ ::-webkit-scrollbar-thumb {
|
|
114
|
-
border-radius: var(--ind-border-radius-xl);
|
|
115
|
-
background: rgba(45, 140, 240, 0.6);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/*滚动条样式*/
|
|
119
|
-
/deep/ ::-webkit-scrollbar-track {
|
|
120
|
-
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
|
|
121
|
-
border-radius: var(--ind-border-radius-xl);
|
|
122
|
-
background: rgba(231, 242, 250, 0.4);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.bottom-div {
|
|
126
|
-
display: flex;
|
|
127
|
-
flex-direction: column;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.cell-group-div {
|
|
131
|
-
flex: 1;
|
|
132
|
-
overflow-y: auto;
|
|
133
|
-
margin-top: 44px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
1
|
+
.search-top-pop {
|
|
2
|
+
min-height: 112px;
|
|
3
|
+
max-height: 33%;
|
|
4
|
+
background-color: var(--scl-white-1)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.search-body {
|
|
8
|
+
border-top: none;
|
|
9
|
+
overflow-y: auto;
|
|
10
|
+
flex: 1
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.search-bottom-btn {
|
|
14
|
+
padding: 12px 14px 12px 14px;
|
|
15
|
+
box-shadow: 0 -2px 10px rgba(125, 126, 128, .16);
|
|
16
|
+
background-color: rgb(255, 255, 255, 1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/*日期选择*/
|
|
20
|
+
.search-row {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
justify-content: flex-start;
|
|
24
|
+
flex-wrap: nowrap;
|
|
25
|
+
align-items: center;
|
|
26
|
+
align-content: center;
|
|
27
|
+
height: 50px;
|
|
28
|
+
padding: 10px 0;
|
|
29
|
+
margin: 0 14px;
|
|
30
|
+
border-bottom: 1px solid var(--scl-white-2);
|
|
31
|
+
border-top: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.search-input-title {
|
|
35
|
+
height: 16px;
|
|
36
|
+
font-size: 12px;
|
|
37
|
+
color: var(--scl-gray-2);
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: flex-start;
|
|
40
|
+
align-items: center;
|
|
41
|
+
margin-left: 12px;
|
|
42
|
+
width: 76px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.search-lambo-input {
|
|
46
|
+
border: none;
|
|
47
|
+
outline: none;
|
|
48
|
+
background: none;
|
|
49
|
+
height: 16px;
|
|
50
|
+
font-size: 12px;
|
|
51
|
+
color: var(--scl-gray-1);
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: flex-start;
|
|
54
|
+
align-items: center;
|
|
55
|
+
margin-left: 8px;
|
|
56
|
+
flex: 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/*输入框*/
|
|
60
|
+
.search-lambo-input .van-cell {
|
|
61
|
+
padding: 10px 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/*多选*/
|
|
65
|
+
.search-top-div {
|
|
66
|
+
display: flex;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
height: 44px;
|
|
69
|
+
line-height: 44px;
|
|
70
|
+
width: 100%;
|
|
71
|
+
position: fixed;
|
|
72
|
+
z-index: 2;
|
|
73
|
+
box-shadow: 0 2px 10px rgba(125, 126, 128, .16);
|
|
74
|
+
background-color: rgb(255, 255, 255, 1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.search-cancel-btn {
|
|
78
|
+
border: none;
|
|
79
|
+
color: var(--scl-gray-3);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.search-confirm-btn {
|
|
83
|
+
border: none;
|
|
84
|
+
color: var(--scl-blue);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.search-select-title {
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
font-weight: bold;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/*修改单选多选的滚动条样式*/
|
|
93
|
+
/deep/ .van-radio-group {
|
|
94
|
+
position: relative;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/*修改单选多选的滚动条样式*/
|
|
98
|
+
/deep/ .van-cell-group {
|
|
99
|
+
padding-top: 44px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/*修改单选多选的滚动条样式*/
|
|
103
|
+
/deep/ .van-cell:first-child {
|
|
104
|
+
padding-top: 10px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/*滚动条样式*/
|
|
108
|
+
/deep/ ::-webkit-scrollbar {
|
|
109
|
+
width: 6px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/*滚动条样式*/
|
|
113
|
+
/deep/ ::-webkit-scrollbar-thumb {
|
|
114
|
+
border-radius: var(--ind-border-radius-xl);
|
|
115
|
+
background: rgba(45, 140, 240, 0.6);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/*滚动条样式*/
|
|
119
|
+
/deep/ ::-webkit-scrollbar-track {
|
|
120
|
+
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
|
|
121
|
+
border-radius: var(--ind-border-radius-xl);
|
|
122
|
+
background: rgba(231, 242, 250, 0.4);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.bottom-div {
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.cell-group-div {
|
|
131
|
+
flex: 1;
|
|
132
|
+
overflow-y: auto;
|
|
133
|
+
margin-top: 44px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
package/util/assist.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
// 深拷贝
|
|
2
|
-
export function deepCopy(data) {
|
|
3
|
-
let i;
|
|
4
|
-
const t = typeOf(data);
|
|
5
|
-
let o;
|
|
6
|
-
|
|
7
|
-
if (t === 'array') {
|
|
8
|
-
o = [];
|
|
9
|
-
} else if (t === 'object') {
|
|
10
|
-
o = {};
|
|
11
|
-
} else {
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (t === 'array') {
|
|
16
|
-
for (i = 0; i < data.length; i++) {
|
|
17
|
-
o.push(deepCopy(data[i]));
|
|
18
|
-
}
|
|
19
|
-
} else if (t === 'object') {
|
|
20
|
-
for (i in data) {
|
|
21
|
-
o[i] = deepCopy(data[i]);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return o;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// 判断对象类型
|
|
28
|
-
export function typeOf(obj) {
|
|
29
|
-
const toString = Object.prototype.toString;
|
|
30
|
-
const map = {
|
|
31
|
-
'[object Boolean]': 'boolean',
|
|
32
|
-
'[object Number]': 'number',
|
|
33
|
-
'[object String]': 'string',
|
|
34
|
-
'[object Function]': 'function',
|
|
35
|
-
'[object Array]': 'array',
|
|
36
|
-
'[object Date]': 'date',
|
|
37
|
-
'[object RegExp]': 'regExp',
|
|
38
|
-
'[object Undefined]': 'undefined',
|
|
39
|
-
'[object Null]': 'null',
|
|
40
|
-
'[object Object]': 'object'
|
|
41
|
-
};
|
|
42
|
-
return map[toString.call(obj)];
|
|
43
|
-
}
|
|
1
|
+
// 深拷贝
|
|
2
|
+
export function deepCopy(data) {
|
|
3
|
+
let i;
|
|
4
|
+
const t = typeOf(data);
|
|
5
|
+
let o;
|
|
6
|
+
|
|
7
|
+
if (t === 'array') {
|
|
8
|
+
o = [];
|
|
9
|
+
} else if (t === 'object') {
|
|
10
|
+
o = {};
|
|
11
|
+
} else {
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (t === 'array') {
|
|
16
|
+
for (i = 0; i < data.length; i++) {
|
|
17
|
+
o.push(deepCopy(data[i]));
|
|
18
|
+
}
|
|
19
|
+
} else if (t === 'object') {
|
|
20
|
+
for (i in data) {
|
|
21
|
+
o[i] = deepCopy(data[i]);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return o;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 判断对象类型
|
|
28
|
+
export function typeOf(obj) {
|
|
29
|
+
const toString = Object.prototype.toString;
|
|
30
|
+
const map = {
|
|
31
|
+
'[object Boolean]': 'boolean',
|
|
32
|
+
'[object Number]': 'number',
|
|
33
|
+
'[object String]': 'string',
|
|
34
|
+
'[object Function]': 'function',
|
|
35
|
+
'[object Array]': 'array',
|
|
36
|
+
'[object Date]': 'date',
|
|
37
|
+
'[object RegExp]': 'regExp',
|
|
38
|
+
'[object Undefined]': 'undefined',
|
|
39
|
+
'[object Null]': 'null',
|
|
40
|
+
'[object Object]': 'object'
|
|
41
|
+
};
|
|
42
|
+
return map[toString.call(obj)];
|
|
43
|
+
}
|
package/util/bus.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
|
|
3
|
-
const Bus = new Vue();
|
|
4
|
-
export default Bus;
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
|
|
3
|
+
const Bus = new Vue();
|
|
4
|
+
export default Bus;
|
package/util/jssdk.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import wx from "weixin-js-sdk";
|
|
2
|
+
import * as dd from 'dingtalk-jsapi';
|
|
3
|
+
import config from '../config/config'
|
|
4
|
+
import {axios} from '../util/axios'
|
|
5
|
+
|
|
6
|
+
let appId,agentId,corpId,appKey
|
|
7
|
+
|
|
8
|
+
function init({appId:a,agentId:b,corpId:c,appKey:d}){
|
|
9
|
+
appId = a
|
|
10
|
+
agentId = b
|
|
11
|
+
corpId = c
|
|
12
|
+
appKey = d
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
function getAppType() {
|
|
17
|
+
let ua = navigator.userAgent.toLowerCase();
|
|
18
|
+
let isWxWork = ua.match(/WxWork/i) == 'wxwork';
|
|
19
|
+
if (isWxWork) {
|
|
20
|
+
return '20'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let isWx = ua.match(/MicroMessenger/i) == 'micromessenger';
|
|
24
|
+
if (isWx) {
|
|
25
|
+
if(agentId){//如果有agentId认为是企业微信
|
|
26
|
+
return '20'
|
|
27
|
+
}
|
|
28
|
+
return '10'
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (dd.env.platform != 'notInDingTalk') {
|
|
32
|
+
return '30'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return ''
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function getJsConfig(){
|
|
39
|
+
let url = window.location.href.split('#')[0]
|
|
40
|
+
return new Promise((resolve, reject)=>{
|
|
41
|
+
axios.post(config.platformServerContext + '/api/weixin/getJsConfig', {
|
|
42
|
+
appType: getAppType(),
|
|
43
|
+
appId: appId,
|
|
44
|
+
agentId: agentId,
|
|
45
|
+
corpId: corpId,
|
|
46
|
+
appKey: appKey,
|
|
47
|
+
url: url
|
|
48
|
+
}).then((resp) => {
|
|
49
|
+
resolve(resp.data)
|
|
50
|
+
}).catch((error) => {
|
|
51
|
+
reject(error)
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function configWx(){
|
|
57
|
+
return new Promise((resolve, reject) =>{
|
|
58
|
+
getJsConfig().then((resp)=>{
|
|
59
|
+
wx.config({
|
|
60
|
+
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
61
|
+
appId: appId, // 必填,公众号的唯一标识
|
|
62
|
+
timestamp: resp.timestamp, // 必填,生成签名的时间戳
|
|
63
|
+
nonceStr: resp.noncestr, // 必填,生成签名的随机串
|
|
64
|
+
signature: resp.signature, // 必填,签名
|
|
65
|
+
jsApiList: ['chooseImage', 'uploadImage', 'downloadImage', 'getLocalImgData', 'openLocation', 'getLocation', 'scanQRCode', 'chooseWXPay', 'onHistoryBack','invoke','onLocationChange','previewFile'] // 必填,需要使用的JS接口列表
|
|
66
|
+
//jsApiList: ['chooseImage', 'uploadImage', 'downloadImage', 'getLocalImgData', 'openLocation', 'getLocation', 'scanQRCode', 'chooseWXPay', 'onHistoryBack','startLocationUpdateBackground','startLocationUpdate','onLocationChange','offLocationChange'] // 必填,需要使用的JS接口列表
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
wx.ready(() => {
|
|
70
|
+
console.log('初始化js-sdk成功');
|
|
71
|
+
resolve()
|
|
72
|
+
});
|
|
73
|
+
wx.error(res => {
|
|
74
|
+
console.log('初始化js-sdk失败' + res.errMsg);
|
|
75
|
+
console.log('友情提示:若想成功,则需通过params传参(而不是query)!!!');
|
|
76
|
+
reject('初始化js-sdk失败' + res.errMsg)
|
|
77
|
+
});
|
|
78
|
+
}).catch((error)=>{
|
|
79
|
+
reject('请求服务端jssdk签名失败:'+error)
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
let JsSDK = (function () {
|
|
85
|
+
function scanQRCode(){
|
|
86
|
+
return new Promise((resolve, reject) =>{
|
|
87
|
+
configWx().then(()=>{
|
|
88
|
+
wx.scanQRCode({
|
|
89
|
+
desc: 'scanQRCode desc',
|
|
90
|
+
needResult: 1,
|
|
91
|
+
scanType: ["qrCode", "barCode"],
|
|
92
|
+
success: function (resp) {
|
|
93
|
+
console.log("resp =>",resp)
|
|
94
|
+
let result = resp.resultStr
|
|
95
|
+
resolve(result)
|
|
96
|
+
},
|
|
97
|
+
fail: function (res) {
|
|
98
|
+
console.log("失败res=>",res)
|
|
99
|
+
if (res.errMsg.indexOf('function_not_exist') > 0) {
|
|
100
|
+
reject('版本过低请升级');
|
|
101
|
+
} else {
|
|
102
|
+
reject("扫码失败,请联系系统管理员!");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
}).catch((error)=>{
|
|
107
|
+
reject('扫码失败:'+error)
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
function getLocation(){
|
|
112
|
+
return new Promise((resolve, reject)=>{
|
|
113
|
+
configWx().then(()=>{
|
|
114
|
+
wx.getLocation({
|
|
115
|
+
type: 'gcj02', //获取gcj02的坐标
|
|
116
|
+
success: (res) => {
|
|
117
|
+
//res.longitude 获取经度
|
|
118
|
+
//res.latitude 获取纬度
|
|
119
|
+
console.log(res);
|
|
120
|
+
resolve(res)
|
|
121
|
+
}, fail: (res) => {
|
|
122
|
+
console.log("获取位置失败。"+JSON.stringify(res));
|
|
123
|
+
reject("获取位置失败" + JSON.stringify(res))
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}).catch((error)=>{
|
|
127
|
+
reject('获取位置失败:'+error)
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// 公开API
|
|
133
|
+
return {
|
|
134
|
+
init:init,
|
|
135
|
+
scanQRCode: scanQRCode,
|
|
136
|
+
getLocation:getLocation
|
|
137
|
+
};
|
|
138
|
+
})();
|
|
139
|
+
|
|
140
|
+
export default JsSDK
|
|
141
|
+
|