@netang/quasar 0.2.11 → 0.2.13
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/components/data/index.vue +20 -20
- package/components/dialog/index.vue +2 -2
- package/components/dragger/index.vue +203 -203
- package/components/field-date/methods.js +100 -100
- package/components/field-text/index.vue +165 -165
- package/components/input-number/index.vue +21 -13
- package/components/list-menu/index.vue +149 -149
- package/components/list-menu-item/index.vue +79 -79
- package/components/price/index.vue +188 -188
- package/components/private/components/index.js +11 -11
- package/components/table-pagination/index.vue +192 -192
- package/components/thumbnail/index.vue +72 -72
- package/components/value-format/index.vue +274 -274
- package/configs/area3.js +1 -1
- package/docs/css/index.css +3 -3
- package/package.json +1 -1
- package/sass/line.scss +39 -39
- package/sass/quasar/btn.scss +46 -46
- package/sass/quasar/common.scss +3 -3
- package/sass/quasar/drawer.scss +6 -6
- package/sass/quasar/loading.scss +6 -6
- package/sass/quasar/toolbar.scss +22 -22
- package/store/index.js +29 -29
- package/utils/$auth.js +127 -127
- package/utils/$rule.js +13 -13
- package/utils/$ruleValid.js +10 -10
- package/utils/alert.js +12 -12
- package/utils/area.js +400 -400
- package/utils/arr.js +51 -51
- package/utils/bus.js +6 -6
- package/utils/confirm.js +11 -11
- package/utils/copy.js +30 -30
- package/utils/dictOptions.js +28 -28
- package/utils/loading.js +15 -15
- package/utils/notify.js +13 -13
- package/utils/price.js +18 -18
- package/utils/symbols.js +18 -18
- package/utils/toast.js +13 -13
- package/utils/useAuth.js +30 -30
- package/utils/useRouter.js +47 -47
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<template v-for="item in data">
|
|
3
|
-
|
|
4
|
-
<!-- 如果有子菜单 -->
|
|
5
|
-
<q-expansion-item
|
|
6
|
-
:label="item.label"
|
|
7
|
-
:group="`group-${level}`"
|
|
8
|
-
v-model="item.expanded"
|
|
9
|
-
:icon="item.attr.icon"
|
|
10
|
-
v-if="item.children.length"
|
|
11
|
-
>
|
|
12
|
-
<n-list-menu-item
|
|
13
|
-
:data="item.children"
|
|
14
|
-
:level="level + 1"
|
|
15
|
-
@item-click="onItemClick"
|
|
16
|
-
/>
|
|
17
|
-
</q-expansion-item>
|
|
18
|
-
|
|
19
|
-
<!-- 否则为单独的菜单 -->
|
|
20
|
-
<q-item
|
|
21
|
-
:active="item.expanded"
|
|
22
|
-
active-class="text-white"
|
|
23
|
-
@click="onItemClick(item)"
|
|
24
|
-
clickable
|
|
25
|
-
v-else
|
|
26
|
-
>
|
|
27
|
-
<q-item-section>
|
|
28
|
-
<q-item-label>{{item.label}}</q-item-label>
|
|
29
|
-
</q-item-section>
|
|
30
|
-
</q-item>
|
|
31
|
-
|
|
32
|
-
</template>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<script>
|
|
36
|
-
export default {
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* 标识
|
|
40
|
-
*/
|
|
41
|
-
name: 'NListMenuItem',
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* 声明属性
|
|
45
|
-
*/
|
|
46
|
-
props: {
|
|
47
|
-
// 数据
|
|
48
|
-
data: Array,
|
|
49
|
-
// 层级
|
|
50
|
-
level: {
|
|
51
|
-
type: Number,
|
|
52
|
-
default: 1,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* 声明事件
|
|
58
|
-
*/
|
|
59
|
-
emits: [
|
|
60
|
-
// 单个元素点击
|
|
61
|
-
'itemClick',
|
|
62
|
-
],
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* 组合式
|
|
66
|
-
*/
|
|
67
|
-
setup(props, { emit }) {
|
|
68
|
-
|
|
69
|
-
// ==========【返回】=========================================================================================
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
// 单个元素点击
|
|
73
|
-
onItemClick(item) {
|
|
74
|
-
emit('itemClick', item)
|
|
75
|
-
},
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<template v-for="item in data">
|
|
3
|
+
|
|
4
|
+
<!-- 如果有子菜单 -->
|
|
5
|
+
<q-expansion-item
|
|
6
|
+
:label="item.label"
|
|
7
|
+
:group="`group-${level}`"
|
|
8
|
+
v-model="item.expanded"
|
|
9
|
+
:icon="item.attr.icon"
|
|
10
|
+
v-if="item.children.length"
|
|
11
|
+
>
|
|
12
|
+
<n-list-menu-item
|
|
13
|
+
:data="item.children"
|
|
14
|
+
:level="level + 1"
|
|
15
|
+
@item-click="onItemClick"
|
|
16
|
+
/>
|
|
17
|
+
</q-expansion-item>
|
|
18
|
+
|
|
19
|
+
<!-- 否则为单独的菜单 -->
|
|
20
|
+
<q-item
|
|
21
|
+
:active="item.expanded"
|
|
22
|
+
active-class="text-white"
|
|
23
|
+
@click="onItemClick(item)"
|
|
24
|
+
clickable
|
|
25
|
+
v-else
|
|
26
|
+
>
|
|
27
|
+
<q-item-section>
|
|
28
|
+
<q-item-label>{{item.label}}</q-item-label>
|
|
29
|
+
</q-item-section>
|
|
30
|
+
</q-item>
|
|
31
|
+
|
|
32
|
+
</template>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
export default {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 标识
|
|
40
|
+
*/
|
|
41
|
+
name: 'NListMenuItem',
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 声明属性
|
|
45
|
+
*/
|
|
46
|
+
props: {
|
|
47
|
+
// 数据
|
|
48
|
+
data: Array,
|
|
49
|
+
// 层级
|
|
50
|
+
level: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: 1,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 声明事件
|
|
58
|
+
*/
|
|
59
|
+
emits: [
|
|
60
|
+
// 单个元素点击
|
|
61
|
+
'itemClick',
|
|
62
|
+
],
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 组合式
|
|
66
|
+
*/
|
|
67
|
+
setup(props, { emit }) {
|
|
68
|
+
|
|
69
|
+
// ==========【返回】=========================================================================================
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
// 单个元素点击
|
|
73
|
+
onItemClick(item) {
|
|
74
|
+
emit('itemClick', item)
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
@@ -1,188 +1,188 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="n-price">
|
|
3
|
-
<!-- 价格符号 -->
|
|
4
|
-
<span v-if="sign" :style="signStyle">{{sign}}</span>
|
|
5
|
-
<!-- 价格 -->
|
|
6
|
-
<span :style="priceStyle">{{currentPrice.main}}</span>
|
|
7
|
-
<!-- 价格后缀 -->
|
|
8
|
-
<span :style="signStyle" v-if="currentPrice.odd">{{currentPrice.odd}}</span>
|
|
9
|
-
<!-- 删除价格 -->
|
|
10
|
-
<span class="n-price__del" :style="[
|
|
11
|
-
signBaseStyle,
|
|
12
|
-
{
|
|
13
|
-
marginLeft: toPx(delPriceMarginLeft),
|
|
14
|
-
color: delPriceColor,
|
|
15
|
-
}
|
|
16
|
-
]" v-if="delPrice && delPrice > price">{{sign}}{{getPrice(delPrice)}}</span>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
import { computed } from 'vue'
|
|
22
|
-
|
|
23
|
-
import $n_px from '@netang/utils/px'
|
|
24
|
-
import $n_split from '@netang/utils/split'
|
|
25
|
-
|
|
26
|
-
import $n_price from '../../utils/price'
|
|
27
|
-
|
|
28
|
-
export default {
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 标识
|
|
32
|
-
*/
|
|
33
|
-
name: 'NPrice',
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* 声明属性
|
|
37
|
-
*/
|
|
38
|
-
props: {
|
|
39
|
-
// 颜色
|
|
40
|
-
color: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: '#ff3750',
|
|
43
|
-
},
|
|
44
|
-
// 删除价格颜色
|
|
45
|
-
delPriceColor: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: '#999999',
|
|
48
|
-
},
|
|
49
|
-
// 价格符号
|
|
50
|
-
sign: {
|
|
51
|
-
type: [ String, Boolean ],
|
|
52
|
-
default: '¥'
|
|
53
|
-
},
|
|
54
|
-
// 价格符号大小
|
|
55
|
-
signSize: {
|
|
56
|
-
type: Number,
|
|
57
|
-
default: 12,
|
|
58
|
-
},
|
|
59
|
-
// 价格符号是否加粗
|
|
60
|
-
signBold: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: true,
|
|
63
|
-
},
|
|
64
|
-
// 价格
|
|
65
|
-
price: [ String, Number ],
|
|
66
|
-
// 最高价格
|
|
67
|
-
maxPrice: [ String, Number ],
|
|
68
|
-
// 删除价格
|
|
69
|
-
delPrice: [ String, Number ],
|
|
70
|
-
// 删除价格左边距
|
|
71
|
-
delPriceMarginLeft: {
|
|
72
|
-
type: [ String, Number ],
|
|
73
|
-
default: 8,
|
|
74
|
-
},
|
|
75
|
-
// 价格符号大小
|
|
76
|
-
priceSize: {
|
|
77
|
-
type: Number,
|
|
78
|
-
default: 16,
|
|
79
|
-
},
|
|
80
|
-
// 价格是否加粗
|
|
81
|
-
priceBold: {
|
|
82
|
-
type: Boolean,
|
|
83
|
-
default: true,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* 组合式
|
|
89
|
-
*/
|
|
90
|
-
setup(props) {
|
|
91
|
-
|
|
92
|
-
// ==========【计算属性】==========================================================================================
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* 当前价格
|
|
96
|
-
*/
|
|
97
|
-
const currentPrice = computed(function () {
|
|
98
|
-
|
|
99
|
-
const price = $n_price(props.price)
|
|
100
|
-
const arr = $n_split(String(price), '.')
|
|
101
|
-
|
|
102
|
-
return {
|
|
103
|
-
main: arr[0],
|
|
104
|
-
odd: arr.length > 1 ? '.' + arr[1] : ''
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* 价格符号基础样式
|
|
110
|
-
*/
|
|
111
|
-
const signBaseStyle = computed(function () {
|
|
112
|
-
return {
|
|
113
|
-
fontSize: $n_px(props.signSize),
|
|
114
|
-
marginBottom: $n_px((props.priceSize - props.signSize) * 0.5 / 2),
|
|
115
|
-
}
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* 价格符号样式
|
|
120
|
-
*/
|
|
121
|
-
const signStyle = computed(function () {
|
|
122
|
-
|
|
123
|
-
const style = {
|
|
124
|
-
color: props.color,
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (props.signBold) {
|
|
128
|
-
style.fontWeight = 'bold'
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return [
|
|
132
|
-
style,
|
|
133
|
-
signBaseStyle.value,
|
|
134
|
-
]
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* 价格样式
|
|
139
|
-
*/
|
|
140
|
-
const priceStyle = computed(function () {
|
|
141
|
-
|
|
142
|
-
const style = {
|
|
143
|
-
color: props.color,
|
|
144
|
-
fontSize: $n_px(props.priceSize),
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (props.priceBold) {
|
|
148
|
-
style.fontWeight = 'bold'
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return style
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
// ==========【方法】=============================================================================================
|
|
155
|
-
|
|
156
|
-
return {
|
|
157
|
-
// 当前价格
|
|
158
|
-
currentPrice,
|
|
159
|
-
// 价格符号基础样式
|
|
160
|
-
signBaseStyle,
|
|
161
|
-
// 价格符号样式
|
|
162
|
-
signStyle,
|
|
163
|
-
// 价格样式
|
|
164
|
-
priceStyle,
|
|
165
|
-
|
|
166
|
-
// 转为像素
|
|
167
|
-
toPx: $n_px,
|
|
168
|
-
// 获取价格
|
|
169
|
-
getPrice: $n_price
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
}
|
|
173
|
-
</script>
|
|
174
|
-
|
|
175
|
-
<style lang="scss">
|
|
176
|
-
|
|
177
|
-
.n-price {
|
|
178
|
-
display: flex;
|
|
179
|
-
flex-direction: row;
|
|
180
|
-
align-items: flex-end;
|
|
181
|
-
|
|
182
|
-
// 删除价格
|
|
183
|
-
&__del {
|
|
184
|
-
text-decoration: line-through;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="n-price">
|
|
3
|
+
<!-- 价格符号 -->
|
|
4
|
+
<span v-if="sign" :style="signStyle">{{sign}}</span>
|
|
5
|
+
<!-- 价格 -->
|
|
6
|
+
<span :style="priceStyle">{{currentPrice.main}}</span>
|
|
7
|
+
<!-- 价格后缀 -->
|
|
8
|
+
<span :style="signStyle" v-if="currentPrice.odd">{{currentPrice.odd}}</span>
|
|
9
|
+
<!-- 删除价格 -->
|
|
10
|
+
<span class="n-price__del" :style="[
|
|
11
|
+
signBaseStyle,
|
|
12
|
+
{
|
|
13
|
+
marginLeft: toPx(delPriceMarginLeft),
|
|
14
|
+
color: delPriceColor,
|
|
15
|
+
}
|
|
16
|
+
]" v-if="delPrice && delPrice > price">{{sign}}{{getPrice(delPrice)}}</span>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import { computed } from 'vue'
|
|
22
|
+
|
|
23
|
+
import $n_px from '@netang/utils/px'
|
|
24
|
+
import $n_split from '@netang/utils/split'
|
|
25
|
+
|
|
26
|
+
import $n_price from '../../utils/price'
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 标识
|
|
32
|
+
*/
|
|
33
|
+
name: 'NPrice',
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 声明属性
|
|
37
|
+
*/
|
|
38
|
+
props: {
|
|
39
|
+
// 颜色
|
|
40
|
+
color: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: '#ff3750',
|
|
43
|
+
},
|
|
44
|
+
// 删除价格颜色
|
|
45
|
+
delPriceColor: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: '#999999',
|
|
48
|
+
},
|
|
49
|
+
// 价格符号
|
|
50
|
+
sign: {
|
|
51
|
+
type: [ String, Boolean ],
|
|
52
|
+
default: '¥'
|
|
53
|
+
},
|
|
54
|
+
// 价格符号大小
|
|
55
|
+
signSize: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: 12,
|
|
58
|
+
},
|
|
59
|
+
// 价格符号是否加粗
|
|
60
|
+
signBold: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: true,
|
|
63
|
+
},
|
|
64
|
+
// 价格
|
|
65
|
+
price: [ String, Number ],
|
|
66
|
+
// 最高价格
|
|
67
|
+
maxPrice: [ String, Number ],
|
|
68
|
+
// 删除价格
|
|
69
|
+
delPrice: [ String, Number ],
|
|
70
|
+
// 删除价格左边距
|
|
71
|
+
delPriceMarginLeft: {
|
|
72
|
+
type: [ String, Number ],
|
|
73
|
+
default: 8,
|
|
74
|
+
},
|
|
75
|
+
// 价格符号大小
|
|
76
|
+
priceSize: {
|
|
77
|
+
type: Number,
|
|
78
|
+
default: 16,
|
|
79
|
+
},
|
|
80
|
+
// 价格是否加粗
|
|
81
|
+
priceBold: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: true,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 组合式
|
|
89
|
+
*/
|
|
90
|
+
setup(props) {
|
|
91
|
+
|
|
92
|
+
// ==========【计算属性】==========================================================================================
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 当前价格
|
|
96
|
+
*/
|
|
97
|
+
const currentPrice = computed(function () {
|
|
98
|
+
|
|
99
|
+
const price = $n_price(props.price)
|
|
100
|
+
const arr = $n_split(String(price), '.')
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
main: arr[0],
|
|
104
|
+
odd: arr.length > 1 ? '.' + arr[1] : ''
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* 价格符号基础样式
|
|
110
|
+
*/
|
|
111
|
+
const signBaseStyle = computed(function () {
|
|
112
|
+
return {
|
|
113
|
+
fontSize: $n_px(props.signSize),
|
|
114
|
+
marginBottom: $n_px((props.priceSize - props.signSize) * 0.5 / 2),
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 价格符号样式
|
|
120
|
+
*/
|
|
121
|
+
const signStyle = computed(function () {
|
|
122
|
+
|
|
123
|
+
const style = {
|
|
124
|
+
color: props.color,
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (props.signBold) {
|
|
128
|
+
style.fontWeight = 'bold'
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return [
|
|
132
|
+
style,
|
|
133
|
+
signBaseStyle.value,
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 价格样式
|
|
139
|
+
*/
|
|
140
|
+
const priceStyle = computed(function () {
|
|
141
|
+
|
|
142
|
+
const style = {
|
|
143
|
+
color: props.color,
|
|
144
|
+
fontSize: $n_px(props.priceSize),
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (props.priceBold) {
|
|
148
|
+
style.fontWeight = 'bold'
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return style
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
// ==========【方法】=============================================================================================
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
// 当前价格
|
|
158
|
+
currentPrice,
|
|
159
|
+
// 价格符号基础样式
|
|
160
|
+
signBaseStyle,
|
|
161
|
+
// 价格符号样式
|
|
162
|
+
signStyle,
|
|
163
|
+
// 价格样式
|
|
164
|
+
priceStyle,
|
|
165
|
+
|
|
166
|
+
// 转为像素
|
|
167
|
+
toPx: $n_px,
|
|
168
|
+
// 获取价格
|
|
169
|
+
getPrice: $n_price
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
}
|
|
173
|
+
</script>
|
|
174
|
+
|
|
175
|
+
<style lang="scss">
|
|
176
|
+
|
|
177
|
+
.n-price {
|
|
178
|
+
display: flex;
|
|
179
|
+
flex-direction: row;
|
|
180
|
+
align-items: flex-end;
|
|
181
|
+
|
|
182
|
+
// 删除价格
|
|
183
|
+
&__del {
|
|
184
|
+
text-decoration: line-through;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
</style>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { configs } from '../../../utils/config'
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
// 对话框组件
|
|
5
|
-
dialogComponents,
|
|
6
|
-
} = configs
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
moveToTree: () => import('./move-to-tree'),
|
|
10
|
-
...dialogComponents,
|
|
11
|
-
}
|
|
1
|
+
import { configs } from '../../../utils/config'
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
// 对话框组件
|
|
5
|
+
dialogComponents,
|
|
6
|
+
} = configs
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
moveToTree: () => import('./move-to-tree'),
|
|
10
|
+
...dialogComponents,
|
|
11
|
+
}
|