wl-design-mobile 0.0.8 → 0.1.0

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.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <div class="info-btn-div">
3
+ <div class="info-btn-div" >
4
4
  <van-button :disabled="disabled" :icon="icon" :icon-position="position" :loading="loading"
5
5
  :type="'info'" :class="dynamicClass" size="normal" @click="handleClick"> {{ text }}
6
6
  <slot name="extend"></slot>
@@ -99,6 +99,13 @@ export default {
99
99
  border-radius: 3px;
100
100
  }
101
101
 
102
+ .info-btn-div {
103
+ display: flex;
104
+ justify-content: center;
105
+ align-items: center;
106
+ align-content: center;
107
+ }
108
+
102
109
  /* type[info] disable[true] plain[false] */
103
110
  /deep/ .info-btn-div .van-button--info {
104
111
  background-color: transparent;
@@ -32,7 +32,7 @@ export default {
32
32
  display: flex;
33
33
  padding: 0 14px;
34
34
  background-color: var(--scl-white-1);
35
- border-bottom: 1px solid rgba(229, 229, 229, 1.5);
35
+ border-bottom: 1px solid var(--scl-white-2);
36
36
  }
37
37
 
38
38
  .button-group /deep/ .btn-sel {
@@ -32,6 +32,7 @@ export default {
32
32
  align-items: center;
33
33
  justify-content: center;
34
34
  }
35
+
35
36
  .line-div {
36
37
  height: 12px;
37
38
  width: 1px;
@@ -1,9 +1,8 @@
1
1
  <template>
2
- <div class="btn-sel">
2
+ <div class="btn-sel" ref="btnSel">
3
3
  <lambo-btn :type="type" :text="text" :size="size" :position="position" :disabled="disabled" :icon="icon"
4
- :loading="loading"
5
- :class="dynamicClass" @click="onClick"></lambo-btn>
6
- <ul v-show="show" class="extend-ul">
4
+ :loading="loading" :class="dynamicClass" @click="onClick"></lambo-btn>
5
+ <ul v-show="show" class="extend-ul" @click="toggleClick">
7
6
  <slot></slot>
8
7
  </ul>
9
8
  </div>
@@ -53,6 +52,21 @@ export default {
53
52
  onClick() {
54
53
  this.show = !this.show;
55
54
  },
55
+ handleClickOutside(event) {
56
+ const btnSel = this.$refs.btnSel;
57
+ if (btnSel && !btnSel.contains(event.target)) {
58
+ this.show = false;
59
+ }
60
+ },
61
+ toggleClick() {
62
+ this.show = !this.show;
63
+ }
64
+ },
65
+ mounted() {
66
+ document.addEventListener('click', this.handleClickOutside);
67
+ },
68
+ beforeDestroy() {
69
+ document.removeEventListener('click', this.handleClickOutside);
56
70
  },
57
71
  computed: {
58
72
  dynamicClass() {
@@ -1,12 +1,18 @@
1
1
  <template>
2
- <van-button :icon="loadIcon" class="btn-icon" :loading="loading" :disabled="disabled" @click="handleClick"></van-button>
2
+ <div class="icon-btn-div">
3
+ <van-button :icon="loadIcon" :class="dynamicClass" :loading="loading" :disabled="disabled"
4
+ @click="handleClick"></van-button>
5
+ </div>
3
6
  </template>
4
7
  <script>
5
8
 
6
9
  export default {
7
10
  name: "LamboIconBtn",
8
11
  props: {
9
- icon: String,
12
+ icon: {
13
+ type: String,
14
+ required: true
15
+ },
10
16
  loading: {
11
17
  type: Boolean,
12
18
  default: false
@@ -15,9 +21,15 @@ export default {
15
21
  type: Boolean,
16
22
  default: false
17
23
  },
24
+ border: {
25
+ type: Boolean,
26
+ default: true
27
+ }
18
28
  },
19
29
  data() {
20
- return {}
30
+ return {
31
+
32
+ }
21
33
  },
22
34
  methods: {
23
35
  handleClick(event) {
@@ -26,9 +38,18 @@ export default {
26
38
  },
27
39
  computed: {
28
40
  loadIcon() {
29
- // vite的写法,而且需要用相对路径
30
- // return new URL('../../../assets/icon/' + this.icon, import.meta.url).href
31
41
  return require('../assets/icon/' + this.icon)
42
+ },
43
+ dynamicClass() {
44
+ if (this.border === true) {
45
+ return {
46
+ "btn-icon-border": true
47
+ }
48
+ } else {
49
+ return {
50
+ "btn-icon-border0": true
51
+ }
52
+ }
32
53
  }
33
54
  }
34
55
  }
@@ -36,7 +57,7 @@ export default {
36
57
  <style scoped>
37
58
  @import "../styles/index.less";
38
59
 
39
- .btn-icon {
60
+ .btn-icon-border {
40
61
  border: 1px solid #e5e5e5;
41
62
  width: 40px;
42
63
  height: 30px;
@@ -44,7 +65,17 @@ export default {
44
65
  font-size: 12px;
45
66
  border-radius: 3px;
46
67
  }
47
- /deep/ .van-icon__image {
68
+
69
+ .btn-icon-border0 {
70
+ border: none;
71
+ width: 40px;
72
+ height: 30px;
73
+ background-color: transparent;
74
+ font-size: 12px;
75
+ border-radius: 3px;
76
+ }
77
+
78
+ /deep/ .icon-btn-div .van-icon__image {
48
79
  width: 1em;
49
80
  }
50
81
  </style>
@@ -8,8 +8,14 @@
8
8
  {{ title }}
9
9
  </div>
10
10
  </div>
11
+ <div slot="value" class="coll-title-icon">
12
+ <slot name="right-value">
13
+ </slot>
14
+ </div>
11
15
  <div slot="right-icon" class="coll-title-icon">
12
- <van-icon :color="'#0070D2'" class="van-icon van-cell__right-icon" name="play" />
16
+ <slot name="right-icon">
17
+ <van-icon :color="'#0070D2'" class="van-icon van-cell__right-icon" name="play" />
18
+ </slot>
13
19
  </div>
14
20
  <slot></slot>
15
21
  </van-collapse-item>
@@ -65,7 +71,7 @@ export default {
65
71
 
66
72
  /* 覆盖折叠面板的标题的padding */
67
73
  /deep/ .van-cell {
68
- padding: 12px 10px;
74
+ padding: 10px 14px 10px 10px;
69
75
  }
70
76
 
71
77
  /* 覆盖去掉折叠面板的标题下面的线 */
@@ -73,6 +79,13 @@ export default {
73
79
  border: none;
74
80
  }
75
81
 
82
+ /deep/ .van-cell__title {
83
+ display: flex;
84
+ justify-content: flex-start;
85
+ align-items: center;
86
+ align-content: center;
87
+ }
88
+
76
89
  /* 覆盖折叠面板的内容的padding */
77
90
  /deep/ .van-collapse-item__content {
78
91
  padding: 0px 0px 0px 0px;
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <div>
3
+ <div v-for="(item, index) in data" :key="index">
4
+ <lambo-file-row v-if="item && item.fileId" :file-id="item.fileId" :file-name="item.fileName" :if-delete="ifDelete" @on-delete="handleDelet($event, index)"></lambo-file-row>
5
+ </div>
6
+ </div>
7
+ </template>
8
+ <script>
9
+ import LamboFileRow from "../../../doc/file/compoents/lambo-file-row.vue";
10
+
11
+ export default {
12
+ name: 'LamboFileList',
13
+ components: {LamboFileRow},
14
+ props: {
15
+ data: {
16
+ type: Array,
17
+ default: () => []
18
+ },
19
+ ifDelete: {
20
+ type: Boolean,
21
+ default: false
22
+ }
23
+ },
24
+ data() {
25
+ return {
26
+
27
+ }
28
+ },
29
+ methods: {
30
+ handleDelet(item, index) {
31
+ console.log("lambo-file-list item:", item)
32
+ console.log("lambo-file-list index:", index)
33
+ this.data.splice(index, 1)
34
+ this.$emit("on-delete", {...item, index: index});
35
+ }
36
+ }
37
+ }
38
+ </script>
39
+ <style scoped>
40
+
41
+ </style>
@@ -0,0 +1,165 @@
1
+ <template>
2
+ <div class="file-container">
3
+ <div class="title-div">
4
+ <img :src="loadIcon" class="file-type-icon"/>
5
+ <p class="file-name">{{ fileName }}</p>
6
+ </div>
7
+ <div class="btn-div" v-if="ifDelete">
8
+ <van-icon name="cross" @click="deleteDoc"/>
9
+ </div>
10
+ </div>
11
+ </template>
12
+ <script>
13
+ import excelIcon from "../../../assets/img/doc/excel.png";
14
+ import mp3Icon from "../../../assets/img/doc/mp3.png";
15
+ import otherIcon from "../../../assets/img/doc/other.png";
16
+ import pdfIcon from "../../../assets/img/doc/pdf.png";
17
+ import pptIcon from "../../../assets/img/doc/ppt.png";
18
+ import txtIcon from "../../../assets/img/doc/txt.png";
19
+ import videoIcon from "../../../assets/img/doc/video.png";
20
+ import wordIcon from "../../../assets/img/doc/word.png";
21
+ import zipIcon from "../../../assets/img/doc/zip.png";
22
+ import photoIcon from "../../../assets/img/doc/photo.png";
23
+
24
+ export default {
25
+ name: 'LamboFileRow',
26
+ components: {},
27
+ props: {
28
+ fileId: {
29
+ type: String,
30
+ required: true
31
+ },
32
+ fileName: {
33
+ type: String,
34
+ default: ''
35
+ },
36
+ ifDelete: {
37
+ type: Boolean,
38
+ default: false
39
+ }
40
+ },
41
+ data() {
42
+ return {
43
+
44
+ }
45
+ },
46
+ computed: {
47
+ loadIcon() {
48
+ return this.getFileIcon(this.fileName)
49
+ }
50
+ },
51
+ methods: {
52
+ deleteDoc() {
53
+ this.$emit("on-delete", {fileId: this.fileId, fileName: this.fileName});
54
+ },
55
+ getFileIcon(fileName) {
56
+ let suffix = ''
57
+ if (fileName.indexOf(".") > -1) {
58
+ suffix = fileName.split('.')[1]
59
+ }
60
+ let icon = otherIcon
61
+ switch (suffix) {
62
+ case 'mp4':
63
+ case 'm3u8':
64
+ case 'rmvb':
65
+ case 'avi':
66
+ case 'swf':
67
+ case '3gp':
68
+ case 'mkv':
69
+ case 'flv':
70
+ icon = videoIcon;
71
+ break;
72
+ case 'mp3':
73
+ case 'wav':
74
+ case 'wma':
75
+ case 'ogg':
76
+ case 'aac':
77
+ case 'flac':
78
+ icon = mp3Icon;
79
+ break;
80
+ case 'doc':
81
+ case 'pages':
82
+ case 'epub':
83
+ case 'docx':
84
+ icon = wordIcon;
85
+ break;
86
+ case 'pdf':
87
+ icon = pdfIcon;
88
+ break;
89
+ case 'txt':
90
+ icon = txtIcon;
91
+ break;
92
+ case 'numbers':
93
+ case 'csv':
94
+ case 'xls':
95
+ case 'xlsx':
96
+ icon = excelIcon;
97
+ break;
98
+ case 'keynote':
99
+ case 'ppt':
100
+ case 'pptx':
101
+ icon = pptIcon;
102
+ break;
103
+ case 'zip':
104
+ icon = zipIcon;
105
+ break;
106
+ case 'jpg':
107
+ case 'jpeg':
108
+ case 'png':
109
+ case 'gif':
110
+ case 'bmp':
111
+ case 'tiff':
112
+ case 'tif':
113
+ case 'psd':
114
+ case 'webp':
115
+ case 'svg':
116
+ case 'raw':
117
+ icon = photoIcon;
118
+ break;
119
+ default:
120
+ icon = otherIcon;
121
+ break;
122
+ }
123
+ return icon;
124
+ },
125
+ },
126
+ created() {
127
+
128
+ }
129
+ }
130
+ </script>
131
+ <style scoped>
132
+ .file-container {
133
+ margin: 0px 14px 5px 14px;
134
+ background-color: var(--scl-white-7);
135
+ height: 38px;
136
+ display: flex;
137
+ justify-content: space-between;
138
+ padding: 0px 10px;
139
+ border-radius: 3px;
140
+ }
141
+
142
+ .title-div {
143
+ display: flex;
144
+ flex-direction: row;
145
+ align-content: center;
146
+ align-items: center;
147
+ }
148
+
149
+ .btn-div {
150
+ display: flex;
151
+ flex-direction: row;
152
+ align-content: center;
153
+ align-items: center;
154
+ }
155
+
156
+ .file-type-icon {
157
+ width: 17px;
158
+ height: 20px;
159
+ margin-right: 5px;
160
+ }
161
+
162
+ .file-name {
163
+ font-size: 14px;
164
+ }
165
+ </style>
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <div>
3
+ <lambo-collapse :title="title">
4
+ <template #right-icon>
5
+ <van-uploader v-model="fileArr" :show-upload="false" :preview-image="false" accept="*" :after-read="afterRead"
6
+ @click-upload.stop="handleStopUploaderClick">
7
+ <lambo-icon-btn :icon="'fileImg.png'" :border="false"></lambo-icon-btn>
8
+ </van-uploader>
9
+ </template>
10
+ 内容。。。。
11
+ </lambo-collapse>
12
+ </div>
13
+ </template>
14
+ <script>
15
+ import LamboCollapse from "../../collapse/lambo-collapse.vue";
16
+ import LamboBtn from "../../btn/lambo-btn.vue";
17
+ import LamboIconBtn from "../../btn/lambo-icon-btn.vue";
18
+
19
+ export default {
20
+ name: "LamboFileUploadCollapse",
21
+ components: {LamboIconBtn, LamboBtn, LamboCollapse},
22
+ props: {
23
+ title: {
24
+ type: String,
25
+ default: "文件上传"
26
+ }
27
+ },
28
+ data() {
29
+ return {
30
+ fileArr: []
31
+ }
32
+ },
33
+ methods: {
34
+ handleStopUploaderClick() {
35
+ console.log('handleStopUploaderClick click stop!');
36
+ },
37
+ upload() {
38
+
39
+ },
40
+ afterRead(files, detail) {
41
+ console.log(files, detail)
42
+ }
43
+ },
44
+ created() {
45
+
46
+ },
47
+ mounted() {
48
+
49
+ }
50
+ }
51
+ </script>
52
+ <style scoped>
53
+
54
+ </style>
@@ -2,7 +2,6 @@
2
2
  <div>
3
3
  <div class="fileUplodaContainer">
4
4
  <div class="setUploader">
5
- <div class="fileUplodaTitle"><p>{{ title }}</p></div>
6
5
  <van-uploader v-model="fileList" :after-read="afterRead" :before-read="beforeRead" accept="*">
7
6
  <van-button :icon="fileImg" type="primary"></van-button>
8
7
  </van-uploader>
@@ -1,12 +1,9 @@
1
1
  <template>
2
2
  <div>
3
- <div class="imgUplodaContainer">
4
- <div class="setUploader">
5
- <div class="imgUplodaTitle"><p>{{ title }}</p></div>
6
- <van-uploader v-model="fileList" :after-read="afterRead" :before-read="beforeRead" accept="image/*">
7
- <van-button :icon="uploadImg" type="primary"></van-button>
8
- </van-uploader>
9
- </div>
3
+ <div class="img-upload-container">
4
+ <van-uploader v-model="fileList" :after-read="afterRead" :before-read="beforeRead" accept="image/*"/>
5
+ <van-button class="img-upload-btn" icon="upgrade" type="default"></van-button>
6
+
10
7
  </div>
11
8
  </div>
12
9
  </template>
@@ -106,4 +103,18 @@ export default {
106
103
  <style scoped>
107
104
  @import "../../styles/index.less";
108
105
  @import './styles/css/index.css';
106
+
107
+ .img-upload-btn {
108
+ height: 80px;
109
+ width: 80px;
110
+ margin-bottom: 8px;
111
+ margin-right: 8px;
112
+ background-color: var(--scl-white-4);
113
+ }
114
+ /*!*无框类型按钮样式 *!
115
+ /deep/ .img-upload-container .van-button--default {
116
+ background-color: var(--scl-white-4);
117
+ border: none;
118
+ }*/
119
+
109
120
  </style>
@@ -1,53 +1,32 @@
1
- .imgUplodaContainer {
2
- padding: 12px 14px;
3
- background: var(--scl-white-1);
1
+ .img-upload-container {
2
+ padding: 0px 14px 12px 14px;
4
3
  }
5
4
 
6
- .imgUplodaTitle {
7
- /*margin-bottom: 18px;*/
8
- display: flex;
9
- justify-content: space-between;
10
- }
11
-
12
- .imgUplodaTitle p {
13
- width: 100%;
14
- color: var(--scl-gray-3);
15
- font-size: 14px;
16
- position: absolute;
17
- top: -2px;
18
- }
19
-
20
- .imgUplodaTitle img {
21
- width: 20px;
22
- height: 20px;
23
- display: block;
24
- }
25
-
26
- /*右上角上传按钮样式*/
5
+ /*!*右上角上传按钮样式*!
27
6
  /deep/ .van-button--primary {
28
7
  background: none;
29
8
  border: none;
30
9
  height: auto;
31
10
  }
32
11
 
33
- /*右上角上传按钮位置*/
12
+ !*右上角上传按钮位置*!
34
13
  /deep/ .van-uploader__input-wrapper, .van-uploader {
35
14
  width: 100%;
36
15
  position: static;
37
16
  }
38
17
 
39
- /*上传按钮首次进页面控制图标大小*/
18
+ !*上传按钮首次进页面控制图标大小*!
40
19
  /deep/ .van-icon__image {
41
20
  width: 1em;
42
21
  }
43
22
 
44
- /*图片上传区域及右上角上传按钮*/
23
+ !*图片上传区域及右上角上传按钮*!
45
24
  /deep/ .setUploader {
46
25
  position: relative;
47
26
  margin-bottom: 10px;
48
27
  }
49
28
 
50
- /*图片整体位置*/
29
+ !*图片整体位置*!
51
30
  /deep/ .van-uploader__wrapper {
52
31
  margin-top: 30px;
53
32
  display: grid;
@@ -56,7 +35,7 @@
56
35
  gap: 10px;
57
36
  }
58
37
 
59
- /*右上角上传按钮位置*/
38
+ !*右上角上传按钮位置*!
60
39
  /deep/ .van-button--normal {
61
40
  width: 20px;
62
41
  position: absolute;
@@ -64,23 +43,7 @@
64
43
  right: -8px;
65
44
  }
66
45
 
67
- /*/deep/ .van-uploader__preview {*/
68
- /* width: 23%;*/
69
- /* height: auto;*/
70
- /* padding-left: 8px;*/
71
- /* margin: 8px 0 0 0;*/
72
- /*}*/
73
-
74
- /*预览图片样式*/
75
- /*/deep/ .van-uploader__preview-image {*/
76
- /* display: block;*/
77
- /* width: auto;*/
78
- /* height: 100px;*/
79
- /* overflow: hidden;*/
80
- /* border: 1px solid #515a6e38;*/
81
- /*}*/
82
-
83
- /*控制上传功能覆盖区域*/
46
+ !*控制上传功能覆盖区域*!
84
47
  /deep/ .van-uploader__input {
85
48
  height: 20px;
86
49
  width: 20px;
@@ -95,4 +58,4 @@
95
58
  /deep/ .van-uploader__preview-image {
96
59
  width: auto;
97
60
  height: 95px;
98
- }
61
+ }*/
@@ -131,5 +131,9 @@ export default {
131
131
  </script>
132
132
  <style scoped>
133
133
  @import "../../styles/index.less";
134
- @import "styles/css/index.css";
134
+ @import "./styles/css/index.css";
135
+
136
+ /deep/ .edit-left-box .van-cell {
137
+ padding: 0px 0px;
138
+ }
135
139
  </style>
@@ -101,5 +101,10 @@ export default {
101
101
  }
102
102
  </script>
103
103
  <style scoped>
104
- @import "styles/css/index.css";
104
+ @import "../../styles/index.less";
105
+ @import "./styles/css/index.css";
106
+
107
+ /deep/ .edit-left-box .van-cell {
108
+ padding: 0px 0px;
109
+ }
105
110
  </style>
@@ -104,5 +104,9 @@ export default {
104
104
  </script>
105
105
  <style scoped>
106
106
  @import "../../styles/index.less";
107
- @import "styles/css/index.css";
107
+ @import "./styles/css/index.css";
108
+
109
+ /deep/ .edit-left-box .van-cell {
110
+ padding: 0px 0px;
111
+ }
108
112
  </style>
@@ -1,15 +1,14 @@
1
1
  <template>
2
2
  <div class="edit-box" @click="changeColor">
3
3
  <div class="edit-left-box">
4
- <div class="edit-left-top">
4
+ <div v-if="title" class="edit-left-top">
5
5
  <div v-if="required" class="edit-red-icon">
6
6
  <lambo-required-red-star :required="required"></lambo-required-red-star>
7
7
  </div>
8
8
  <div class="edit-title">{{ title }}</div>
9
9
  </div>
10
10
  <van-field v-model="innerValue" :autosize="true" :clearable="true" :maxlength="maxlength"
11
- :placeholder="placeholder" :show-word-limit="showWordLimit" :type="type"
12
- class="edit-lambo-input-textarea" label="" v-bind="$attrs" @input="$emit('input', $event)"/>
11
+ :placeholder="placeholder" :type="type" class="edit-lambo-input-textarea" label="" v-bind="$attrs" @input="$emit('input', $event)"/>
13
12
  </div>
14
13
  <div v-if="icon" class="edit-right-icon">
15
14
  <lambo-vector-icon :icon="icon"></lambo-vector-icon>
@@ -45,16 +44,12 @@ export default {
45
44
  },
46
45
  title: {
47
46
  type: String,
48
- default: false,
47
+ default: '',
49
48
  },
50
49
  value: {
51
50
  type: String,
52
51
  default: '',
53
52
  },
54
- showWordLimit: {
55
- type: Boolean,
56
- default: false,
57
- },
58
53
  icon: {
59
54
  type: String,
60
55
  default: "",
@@ -88,5 +83,9 @@ export default {
88
83
  </script>
89
84
  <style scoped>
90
85
  @import "../../styles/index.less";
91
- @import "styles/css/index.css";
86
+ @import "./styles/css/index.css";
87
+
88
+ /deep/ .edit-left-box .van-cell {
89
+ padding: 0px 0px;
90
+ }
92
91
  </style>
@@ -8,8 +8,7 @@
8
8
  <div class="edit-title">{{ title }}</div>
9
9
  </div>
10
10
  <van-field v-model="innerValue" :clearable="true" :maxlength="maxlength" :placeholder="placeholder"
11
- class="edit-lambo-input" :show-word-limit="showWordLimit"
12
- :type="type" label="" v-bind="$attrs" @input="$emit('input', $event)"/>
11
+ class="edit-lambo-input" :type="type" label="" v-bind="$attrs" @input="$emit('input', $event)"/>
13
12
  </div>
14
13
  <div class="edit-right-icon" v-if="icon">
15
14
  <lambo-vector-icon :icon="icon"></lambo-vector-icon>
@@ -51,10 +50,6 @@ export default {
51
50
  type: String,
52
51
  default: '',
53
52
  },
54
- showWordLimit: {
55
- type: Boolean,
56
- default: false,
57
- },
58
53
  icon: {
59
54
  type: String,
60
55
  default: "",
@@ -88,5 +83,9 @@ export default {
88
83
  </script>
89
84
  <style scoped>
90
85
  @import "../../styles/index.less";
91
- @import "styles/css/index.css";
86
+ @import "./styles/css/index.css";
87
+
88
+ /deep/ .edit-left-box .van-cell {
89
+ padding: 0px 0px;
90
+ }
92
91
  </style>
@@ -6,10 +6,10 @@
6
6
  <div class="edit-red-icon" v-if="required">
7
7
  <lambo-required-red-star :required="required"></lambo-required-red-star>
8
8
  </div>
9
- <div class="edit-title">{{ title }}222</div>
9
+ <div class="edit-title">{{ title }}</div>
10
10
  </div>
11
11
  <van-field v-model="valName" :placeholder="placeholder" class="edit-lambo-input"
12
- clear-trigger="focus"></van-field>
12
+ :readonly="true" clear-trigger="focus"></van-field>
13
13
  </div>
14
14
  <div class="edit-right-icon" v-if="icon">
15
15
  <lambo-vector-icon :icon="icon" @click="onOpen"></lambo-vector-icon>
@@ -156,5 +156,9 @@ export default {
156
156
  </script>
157
157
  <style scoped>
158
158
  @import "../../styles/index.less";
159
- @import "styles/css/index.css";
159
+ @import "./styles/css/index.css";
160
+
161
+ /deep/ .edit-left-box .van-cell {
162
+ padding: 0px 0px;
163
+ }
160
164
  </style>
@@ -149,5 +149,9 @@ export default {
149
149
  </script>
150
150
  <style scoped>
151
151
  @import "../../styles/index.less";
152
- @import "styles/css/index.css";
152
+ @import "./styles/css/index.css";
153
+
154
+ /deep/ .edit-left-box .van-cell {
155
+ padding: 0px 0px;
156
+ }
153
157
  </style>
@@ -10,19 +10,14 @@
10
10
 
11
11
  .edit-left-box {
12
12
  width: 100%;
13
- }
14
-
15
- /* 覆盖value的padding */
16
- .edit-left-box /deep/ .van-cell {
17
- padding: 0;
13
+ padding: 0px 0px 0px 14px;
18
14
  }
19
15
 
20
16
  .edit-left-top {
21
17
  display: flex;
22
18
  align-items: center;
23
19
  height: 16px;
24
- padding: 0 15px;
25
- margin-bottom: 12px
20
+ margin-bottom: 10px
26
21
  }
27
22
 
28
23
  .edit-red-icon {
@@ -46,7 +41,6 @@
46
41
  justify-content: flex-start;
47
42
  align-items: center;
48
43
  flex: 1;
49
- margin-right: 8px;
50
44
  }
51
45
 
52
46
  .edit-lambo-input-textarea {
@@ -63,10 +57,10 @@
63
57
 
64
58
  .edit-right-icon {
65
59
  display: flex;
66
- align-items: center
60
+ align-items: center;
61
+ margin-right: 14px;
67
62
  }
68
63
 
69
-
70
64
  .edit-top-div {
71
65
  display: flex;
72
66
  justify-content: space-between;
@@ -102,11 +96,12 @@
102
96
  padding-top: 44px;
103
97
  }
104
98
 
105
- /*修改单选多选的滚动条样式*/
99
+ /*
100
+ !*修改单选多选的滚动条样式*!
106
101
  /deep/ .van-cell:first-child {
107
102
  padding-top: 10px;
108
103
  }
109
-
104
+ */
110
105
 
111
106
  /*滚动条样式*/
112
107
  /deep/ ::-webkit-scrollbar {
@@ -0,0 +1,171 @@
1
+ <template>
2
+ <div class="container">
3
+ <div class="table-head">
4
+ <div class="table-cell" :style="{'--width': item.width + 'px' || 'auto'}" v-for="(item,index) in columns" :key="index" >{{ item.title }}</div>
5
+ </div>
6
+ <van-list
7
+ ref="vanList1"
8
+ v-model="loading"
9
+ :finished="finished"
10
+ finished-text="没有更多了"
11
+ @load="onLoad"
12
+ offset="10"
13
+ >
14
+ <div class="table-row" v-for="(item,index) in list" :key="index">
15
+ <template v-for="column in columns">
16
+ <div v-if="column.type === 'index'" v-bind:key="column.key" class="table-cell table-cell-list" :style="{'--width': column.width + 'px' || 'auto'}">{{index + 1}}</div>
17
+ <div v-else class="table-cell table-cell-list" v-bind:key="column.key" :style="{'--width': column.width + 'px' || 'auto'}">{{item[column.key]}} </div>
18
+ </template>
19
+ </div>
20
+ </van-list>
21
+ </div>
22
+ </template>
23
+ <script>
24
+ import {axios} from "../util/axios/index"
25
+ import {Toast} from "vant"
26
+
27
+ export default {
28
+ name: "LamboTableList",
29
+ components: {},
30
+ props: {
31
+ heightRatio: {
32
+ type: Number,
33
+ default: 0.5,
34
+ },
35
+ url: {
36
+ type: String
37
+ },
38
+ searchParams: {
39
+ type: Object
40
+ },
41
+ columns: {
42
+ type: Array,
43
+ default: () => []
44
+ }
45
+ },
46
+ data() {
47
+ return {
48
+ loading: false,
49
+ finished: true,
50
+ finishedTxt: "",
51
+ pageNum: 1, // 当前页数
52
+ pageSize: 10, // 每页数据条数
53
+ listHeight: '100vh', // 默认列表高度为视口高度的80%
54
+ refreshing: false,
55
+ offset: 0,
56
+ limit: 10,
57
+ list: [],
58
+ };
59
+ },
60
+ mounted() {
61
+ this.getListHeight();
62
+ },
63
+ watch: {
64
+ searchParams: {
65
+ handler: function (val, oldVal) {
66
+ console.log("searchParams -- val,oldVal:", {val, oldVal})
67
+ console.log("searchParams -- val===oldVal:", val === oldVal)
68
+ //查询时重置页码
69
+ this.pageNum = 1
70
+ this.offset = 0
71
+ this.limit = 10
72
+ this.list = []
73
+
74
+ this.onLoad()
75
+ },
76
+ deep: true
77
+ }
78
+ },
79
+ methods: {
80
+ onLoad() {
81
+ if (this.refreshing) {
82
+ this.list = [];
83
+ this.refreshing = false;
84
+ }
85
+
86
+ let params = {offset: this.offset, limit: this.limit, ...this.searchParams}
87
+ axios.get(this.url, {params}).then(res => {
88
+ console.log("lambo-init-table-list -- onLoad -- loadData:", res)
89
+ if (res && res.code === 1) {
90
+ let pageData = res.data
91
+
92
+ if (pageData && pageData.rows.length > 0) {
93
+ for (let item of pageData.rows) {
94
+ if (this.list.length < pageData.total) {
95
+ this.list.push(item)
96
+ this.finished = false
97
+ } else {
98
+ this.finished = true // 数据加载完毕
99
+ }
100
+ }
101
+ this.offset = this.pageNum * 10
102
+ this.pageNum++;
103
+ this.finishedTxt = "没有更多了"
104
+ } else {
105
+ this.finished = true; // 数据加载完毕
106
+ }
107
+ this.loading = false; // 加载状态结束
108
+ } else {
109
+ console.error("lambo-init-list -- onLoad -- 查询[" + this.title + "]数据失败", res)
110
+ Toast.fail("查询[" + this.title + "]数据失败:" + res.data || '')
111
+ }
112
+ }).catch(err => {
113
+ console.error("lambo-init-list -- onLoad -- 查询[" + this.title + "]异常:", err)
114
+ Toast.fail("查询[" + this.url + "]数据异常")
115
+ })
116
+ },
117
+ getListHeight() {
118
+ const windowHeight = window.innerHeight;
119
+ this.listHeight = `${windowHeight * this.heightRatio}px`;
120
+ },
121
+ onRefresh() {
122
+ console.log("lambo-init-list -- onRefresh")
123
+
124
+ this.finished = false
125
+ this.pageNum = 1
126
+ this.offset = 0
127
+ this.limit = 10
128
+
129
+ this.loading = true
130
+ this.onLoad()
131
+ }
132
+ },
133
+ beforeDestroy() {
134
+ this.pageNum = 1
135
+ this.offset = 0
136
+ this.limit = 10
137
+ this.list = []
138
+ },
139
+ };
140
+ </script>
141
+ <style scoped>
142
+ :root {
143
+ --width: auto
144
+ }
145
+
146
+ .container {
147
+ background: var(--scl-white-1);
148
+ }
149
+
150
+ .table-head {
151
+ display: flex;
152
+ margin-bottom: 5px;
153
+ color: var(--scl-blue);
154
+ }
155
+
156
+ .table-row {
157
+ display: flex;
158
+ }
159
+
160
+ .table-cell {
161
+ flex: 0 0 var(--width);
162
+ text-align: center;
163
+ padding: 5px;
164
+ min-width: 0;
165
+ word-wrap: break-word;
166
+ }
167
+
168
+ .table-cell-list {
169
+ font-size: var(--ind-font-size-sm);
170
+ }
171
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wl-design-mobile",
3
- "version": "0.0.8",
4
- "description": "",
3
+ "version": "0.1.0",
4
+ "description": "0.0.9",
5
5
  "main": "index.js",
6
6
  "author": "finch",
7
7
  "license": "ISC",
package/styles/base.less CHANGED
@@ -26,6 +26,7 @@
26
26
  --scl-white-4: #F5F5F5FF;
27
27
  --scl-white-5: #EDEDEDFF;
28
28
  --scl-white-6: #D7D7D7;
29
+ --scl-white-7: #F2F2F2;
29
30
 
30
31
  --scl-gray-1: #333333;
31
32
  --scl-gray-2: #666666;
@@ -5,7 +5,7 @@
5
5
  margin-left: 1%;
6
6
  font-size: 14px;
7
7
  color: var(--scl-white-1);
8
- border-radius: 6px;
8
+ border-radius: 3px;
9
9
  background-color: var(--scl-blue);
10
10
  border: none;
11
11
  }
@@ -22,7 +22,7 @@
22
22
  margin-right: 1%;
23
23
  font-size: 14px;
24
24
  color: var(--scl-blue);
25
- border-radius: 6px;
25
+ border-radius: 3px;
26
26
  background-color: var(--scl-white-4);
27
27
  border: 1px solid var(--scl-blue);
28
28
  }
package/tag/lambo-tag.vue CHANGED
@@ -3,7 +3,6 @@
3
3
  <van-tag :class="tagClass">{{ title }}</van-tag>
4
4
  </div>
5
5
  </template>
6
-
7
6
  <script>
8
7
  export default {
9
8
  name: "LamboTag",
@@ -19,7 +18,6 @@ export default {
19
18
  }
20
19
  }
21
20
  </script>
22
-
23
21
  <style scoped>
24
22
 
25
- </style>
23
+ </style>
@@ -32,11 +32,11 @@ export default {
32
32
  },
33
33
  marginBottom: {
34
34
  type: Boolean,
35
- default: false,
35
+ default: true,
36
36
  },
37
37
  border: {
38
38
  type: Boolean,
39
- default: false,
39
+ default: true,
40
40
  },
41
41
  },
42
42
  data() {
@@ -123,7 +123,7 @@ export default {
123
123
  /* 控制 .opt-btn-div 内的元素的右边距为 6px */
124
124
  .opt-btn-div > * {
125
125
  margin-right: 6px;
126
- border-radius: 6px;
126
+ border-radius: 3px;
127
127
  }
128
128
 
129
129
  /* 控制 .opt-btn-div 内的最后一个元素的右边距为 0px */