wl-design-mobile 0.3.5 → 0.3.6

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.
@@ -3,7 +3,7 @@
3
3
  <van-grid :border="false" :center="false" :column-num="columnNum" class="detail-grid-main">
4
4
  <van-grid-item v-for="(row, index) in data" :key="index" class="detail-grid-box">
5
5
  <div class="detail-grid-title">{{ row.title }}</div>
6
- <div :class="data[index].className">
6
+ <div class="detail-grid-val">
7
7
  {{ row.val }}
8
8
  </div>
9
9
  </van-grid-item>
@@ -25,24 +25,7 @@ export default {
25
25
  }
26
26
  },
27
27
  created() {
28
- },
29
- mounted() {
30
28
  console.log("LamboDetailGrid -- created -- data:", this.data)
31
- this.initData()
32
- },
33
- methods: {
34
- initData() {
35
- if (this.columnNum === '1' || this.columnNum === 1) {
36
- this.data.forEach(item => { item.className = 'detail-grid-val' })
37
- } else {
38
- this.data.forEach((item, index) => {
39
- const isLastItem = index === this.data.length - 1;
40
- item.className = index % this.columnNum === 0
41
- ? (isLastItem ? 'detail-grid-val' : 'detail-grid-val-left')
42
- : 'detail-grid-val-right';
43
- })
44
- }
45
- }
46
29
  }
47
30
  }
48
31
  </script>
@@ -71,19 +54,5 @@ export default {
71
54
  .detail-grid-val {
72
55
  font-size: 14px;
73
56
  color: var(--scl-lucency-1);
74
- background: var(--scl-white-4);
75
- border-radius: 4px;
76
- }
77
- .detail-grid-val-left {
78
- font-size: 14px;
79
- color: var(--scl-lucency-1);
80
- background: var(--scl-white-4);
81
- border-radius: 4px 0 0 4px;
82
- }
83
- .detail-grid-val-right {
84
- font-size: 14px;
85
- color: var(--scl-lucency-1);
86
- background: var(--scl-white-4);
87
- border-radius: 0 4px 4px 0;
88
57
  }
89
58
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wl-design-mobile",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "finch",
@@ -11,7 +11,7 @@
11
11
  <p class="time">{{ endDate }}</p>
12
12
  </div>
13
13
  <van-calendar v-model:show="showBottom" :default-date="defaultDateArr" :min-date="minDate" :max-date="maxDate"
14
- type="range" :style="{ maxHeight: '65%' }" color="#0070D2" @confirm="onConfirm"/>
14
+ type="range" :style="{ maxHeight: '65%' }" color="#0070D2" @confirm="onConfirm" get-container="body"/>
15
15
  </div>
16
16
  </template>
17
17
  <script>
@@ -10,7 +10,7 @@
10
10
  </div>
11
11
  <div>
12
12
  <van-calendar v-model:show="showBottom" :default-date="defaultDateArr" :min-date="minDate" :max-date="maxDate" type="range"
13
- :style="{ maxHeight: '65%' }" color="#0070D2" @confirm="onConfirm"/>
13
+ :style="{ maxHeight: '65%' }" color="#0070D2" @confirm="onConfirm" get-container="body"/>
14
14
  </div>
15
15
  </div>
16
16
  </template>
@@ -7,7 +7,7 @@
7
7
  <lambo-vector-icon v-if="icon" :icon="icon" @click="onOpen"></lambo-vector-icon>
8
8
  </div>
9
9
  <div>
10
- <van-popup v-model:show="showBottom" :style="{ height: '31%' }" position="bottom">
10
+ <van-popup v-model:show="showBottom" get-container="body" :style="{ height: '31%' }" position="bottom">
11
11
  <van-checkbox-group v-model="selectItem.K">
12
12
  <div class="bottom-div">
13
13
  <div class="search-top-div">
@@ -7,7 +7,7 @@
7
7
  <lambo-vector-icon v-if="icon" :icon="icon" @click="onOpen"></lambo-vector-icon>
8
8
  </div>
9
9
  <div>
10
- <van-popup v-model:show="showBottom" :style="{ height: '31%' }" position="bottom">
10
+ <van-popup v-model:show="showBottom" get-container="body" :style="{ height: '31%' }" position="bottom">
11
11
  <van-radio-group v-model="selectItem.K">
12
12
  <div class="bottom-div">
13
13
  <div class="search-top-div">
@@ -38,10 +38,11 @@ import 'ag-grid-community/styles/ag-theme-balham.css'
38
38
  import {AgGridVue} from 'ag-grid-vue/lib/main.cjs.js'
39
39
  // import {AgGridVue} from 'ag-grid-vue'
40
40
  import {Toast} from "vant"
41
- import {axios} from "../util/axios";
41
+ import {axios} from "../util/axios"
42
42
 
43
43
  // 合计行标志
44
44
  const TOTAL_ROW_FIELD_KEY = "total_row"
45
+ // 是否下钻标志
45
46
  const PAGE_DRILL_FLAG_KEY = "drill"
46
47
 
47
48
  export default {
@@ -13,8 +13,8 @@
13
13
  </div>
14
14
  </div>
15
15
  </div>
16
- <div class="title1-sub-text" v-if="titleSub">
17
- <span>
16
+ <div class="title1-sub" v-if="titleSub">
17
+ <span class="title1-sub-text">
18
18
  {{titleSub}}
19
19
  </span>
20
20
  </div>
@@ -139,10 +139,13 @@ export default {
139
139
  margin-right: 0px;
140
140
  }
141
141
 
142
+ .title1-sub{
143
+ background-color: var(--scl-white-1);
144
+ }
145
+
142
146
  .title1-sub-text{
143
147
  margin: 0 14px 5px 14px;
144
148
  color:var(--scl-gray-3);
145
149
  font-size: 14px;
146
- background-color: var(--scl-white-1);
147
150
  }
148
151
  </style>
package/util/math.js ADDED
@@ -0,0 +1,76 @@
1
+ let math = {};
2
+ //js除法计算
3
+ math.accDiv = function(arg1, arg2) {
4
+ let t1 = 0,
5
+ t2 = 0,
6
+ r1, r2;
7
+ try {
8
+ t1 = arg1.toString().split(".")[1].length
9
+ } catch (e) {
10
+ console.error('accDiv',e)
11
+ }
12
+ try {
13
+ t2 = arg2.toString().split(".")[1].length
14
+ } catch (e) {
15
+ console.error('accDiv',e)
16
+ }
17
+ r1 = Number(arg1.toString().replace(".", ""))
18
+ r2 = Number(arg2.toString().replace(".", ""))
19
+ return Number(((r1 / r2) * Math.pow(10, t2 - t1)));
20
+ }
21
+
22
+ //js乘法计算
23
+ math.accMul = function(arg1, arg2) {
24
+ let m = 0,
25
+ s1 = arg1.toString(),
26
+ s2 = arg2.toString();
27
+ try {
28
+ m += s1.split(".")[1].length
29
+ } catch (e) {
30
+ console.error('accMul',e)
31
+ }
32
+ try {
33
+ m += s2.split(".")[1].length
34
+ } catch (e) {
35
+ console.error('accMul',e)
36
+ }
37
+ return Number(math.accDiv(Number(s1.replace(".", "")) * Number(s2.replace(".", "")), Math.pow(10, m)));
38
+ }
39
+
40
+ //js加法计算
41
+ math.accAdd = function(arg1, arg2) {
42
+ const POW4 = 10000;
43
+ let r1, r2, m;
44
+ try {
45
+ arg1 = math.accDiv(Math.round(arg1 * POW4) , POW4);
46
+ r1 = arg1.toString().split(".")[1].length
47
+ } catch (e) {
48
+ r1 = 0
49
+ }
50
+ try {
51
+ arg2 = math.accDiv(Math.round(arg2 * POW4) , POW4);
52
+ r2 = arg2.toString().split(".")[1].length
53
+ } catch (e) {
54
+ r2 = 0
55
+ }
56
+ m = Math.pow(10, Math.max(r1, r2));
57
+ return Number(math.accDiv((math.accMul(arg1, m) + math.accMul(arg2, m)), m));
58
+ }
59
+
60
+ //js减法计算
61
+ math.accSub = function(arg1, arg2) {
62
+ let r1, r2, m;
63
+ try {
64
+ r1 = arg1.toString().split(".")[1].length
65
+ } catch (e) {
66
+ r1 = 0
67
+ }
68
+ try {
69
+ r2 = arg2.toString().split(".")[1].length
70
+ } catch (e) {
71
+ r2 = 0
72
+ }
73
+ m = Math.pow(10, Math.max(r1, r2));
74
+ return Number(math.accDiv((math.accMul(arg1, m) - math.accMul(arg2, m)), m));
75
+ }
76
+ export default math;