@netang/quasar 0.0.45 → 0.0.46
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,23 +1,23 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<slot :data="data" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
export default {
|
|
7
|
-
/**
|
|
8
|
-
* 标识
|
|
9
|
-
*/
|
|
10
|
-
name: 'NData',
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 传参
|
|
14
|
-
*/
|
|
15
|
-
props: {
|
|
16
|
-
// 数据
|
|
17
|
-
data: {},
|
|
18
|
-
},
|
|
19
|
-
}
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<style>
|
|
23
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<slot :data="data" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
export default {
|
|
7
|
+
/**
|
|
8
|
+
* 标识
|
|
9
|
+
*/
|
|
10
|
+
name: 'NData',
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 传参
|
|
14
|
+
*/
|
|
15
|
+
props: {
|
|
16
|
+
// 数据
|
|
17
|
+
data: {},
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<style>
|
|
23
|
+
</style>
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<n-splitter
|
|
3
3
|
class="absolute-full"
|
|
4
|
+
v-model="currentValue"
|
|
5
|
+
:reverse="reverse"
|
|
6
|
+
:unit="unit"
|
|
7
|
+
:limits="limits"
|
|
8
|
+
:horizontal="horizontal"
|
|
9
|
+
|
|
10
|
+
v-model:after="currentAfter"
|
|
4
11
|
@update:after="setSelection"
|
|
5
12
|
:hide-after-in-mobile="hideAfterInMobile"
|
|
6
|
-
|
|
13
|
+
:cache="cache"
|
|
7
14
|
>
|
|
8
15
|
<!-- 表格 -->
|
|
9
16
|
<template v-slot:before="{ after, toggleAfter }">
|
|
10
17
|
<n-table
|
|
11
|
-
v-bind="
|
|
18
|
+
v-bind="$attrs"
|
|
12
19
|
>
|
|
13
20
|
<!-- 工具栏右边插槽(手机端不显示) -->
|
|
14
21
|
<template #toolbar-right v-if="isWatcher">
|
|
15
22
|
|
|
23
|
+
<!-- 工具栏右边插槽 -->
|
|
24
|
+
<slot name="toolbar-right" />
|
|
25
|
+
|
|
16
26
|
<!-- 是否显示详情 -->
|
|
17
27
|
<q-toggle
|
|
18
28
|
icon="apps"
|
|
@@ -58,7 +68,7 @@
|
|
|
58
68
|
|
|
59
69
|
<!-- 空状态 -->
|
|
60
70
|
<n-empty
|
|
61
|
-
:description="
|
|
71
|
+
:description="renderDescription"
|
|
62
72
|
v-else
|
|
63
73
|
/>
|
|
64
74
|
|
|
@@ -75,26 +85,51 @@ import { NTableKey } from '../../utils/symbols'
|
|
|
75
85
|
|
|
76
86
|
export default {
|
|
77
87
|
|
|
88
|
+
/**
|
|
89
|
+
* 关闭组件 attribute 透传行为
|
|
90
|
+
*/
|
|
91
|
+
inheritAttrs: false,
|
|
92
|
+
|
|
78
93
|
/**
|
|
79
94
|
* 标识
|
|
80
95
|
*/
|
|
81
|
-
name: '
|
|
96
|
+
name: 'NTableSplitter',
|
|
82
97
|
|
|
83
98
|
/**
|
|
84
99
|
* 声明属性
|
|
85
100
|
*/
|
|
86
101
|
props: {
|
|
87
|
-
//
|
|
88
|
-
|
|
102
|
+
// 值 v-model
|
|
103
|
+
modelValue: {
|
|
104
|
+
type: Number,
|
|
105
|
+
default: 50,
|
|
106
|
+
},
|
|
107
|
+
reverse: Boolean,
|
|
108
|
+
unit: String,
|
|
109
|
+
limits: Array,
|
|
110
|
+
horizontal: Boolean,
|
|
111
|
+
|
|
112
|
+
// 显示后置插槽 v-model:after
|
|
113
|
+
// 注意: 如果非双向绑定, 如 :after 并不会影响内部值变化, 仅做初始值使用
|
|
114
|
+
after: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: true,
|
|
117
|
+
},
|
|
89
118
|
// 手机模式隐藏后插槽
|
|
90
119
|
hideAfterInMobile: {
|
|
91
120
|
type: Boolean,
|
|
92
121
|
default: true,
|
|
93
122
|
},
|
|
94
|
-
//
|
|
95
|
-
|
|
123
|
+
// 是否开启缓存
|
|
124
|
+
cache: {
|
|
125
|
+
type: [ Boolean, String ],
|
|
126
|
+
default: true,
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
// 工具提示
|
|
130
|
+
tooltip: {
|
|
96
131
|
type: String,
|
|
97
|
-
default: '
|
|
132
|
+
default: '是否显示详情',
|
|
98
133
|
},
|
|
99
134
|
// 渲染组件路径
|
|
100
135
|
renderPath: {
|
|
@@ -103,17 +138,25 @@ export default {
|
|
|
103
138
|
},
|
|
104
139
|
// 格式化已选表格的数据并返回渲染组件参数
|
|
105
140
|
renderQuery: Function,
|
|
106
|
-
//
|
|
107
|
-
|
|
141
|
+
// 渲染空状态描述
|
|
142
|
+
renderDescription: {
|
|
108
143
|
type: String,
|
|
109
|
-
default: '
|
|
144
|
+
default: '没有找到任何数据',
|
|
110
145
|
},
|
|
111
146
|
},
|
|
112
147
|
|
|
148
|
+
/**
|
|
149
|
+
* 声明事件
|
|
150
|
+
*/
|
|
151
|
+
emits: [
|
|
152
|
+
'update:modelValue',
|
|
153
|
+
'update:after',
|
|
154
|
+
],
|
|
155
|
+
|
|
113
156
|
/**
|
|
114
157
|
* 组合式
|
|
115
158
|
*/
|
|
116
|
-
setup(props, { slots }) {
|
|
159
|
+
setup(props, { emit, slots }) {
|
|
117
160
|
|
|
118
161
|
// ==========【计算属性】=========================================================================================
|
|
119
162
|
|
|
@@ -121,7 +164,7 @@ export default {
|
|
|
121
164
|
* 插槽标识
|
|
122
165
|
*/
|
|
123
166
|
const slotNames = computed(function() {
|
|
124
|
-
return utils.isValidObject(slots) ? Object.keys(slots) : []
|
|
167
|
+
return utils.isValidObject(slots) ? Object.keys(slots).filter(e => e !== 'toolbar-right') : []
|
|
125
168
|
})
|
|
126
169
|
|
|
127
170
|
/**
|
|
@@ -166,8 +209,42 @@ export default {
|
|
|
166
209
|
// 当前已选单条数据
|
|
167
210
|
const currentSelectedItem = ref(null)
|
|
168
211
|
|
|
212
|
+
// 当前值
|
|
213
|
+
const currentValue = ref(props.modelValue)
|
|
214
|
+
|
|
215
|
+
// 当前显示前置插槽
|
|
216
|
+
const currentAfter = ref(props.after)
|
|
217
|
+
|
|
169
218
|
// ==========【监听数据】=========================================================================================
|
|
170
219
|
|
|
220
|
+
/**
|
|
221
|
+
* 监听声明值
|
|
222
|
+
*/
|
|
223
|
+
watch(() => props.modelValue, function (val) {
|
|
224
|
+
currentValue.value = val
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* 监听声明显示前置插槽
|
|
229
|
+
*/
|
|
230
|
+
watch(() => props.after, function (val) {
|
|
231
|
+
currentAfter.value = val
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* 监听当前值
|
|
236
|
+
*/
|
|
237
|
+
watch(currentValue, function (val) {
|
|
238
|
+
emit('update:modelValue', val)
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* 监听当前显示前置插槽
|
|
243
|
+
*/
|
|
244
|
+
watch(currentAfter, function (val) {
|
|
245
|
+
emit('update:after', val)
|
|
246
|
+
})
|
|
247
|
+
|
|
171
248
|
/**
|
|
172
249
|
* 监听表格已选数据(非手机端有效)
|
|
173
250
|
*/
|
|
@@ -235,6 +312,11 @@ export default {
|
|
|
235
312
|
// 当前传参
|
|
236
313
|
currentQuery,
|
|
237
314
|
|
|
315
|
+
// 当前值
|
|
316
|
+
currentValue,
|
|
317
|
+
// 当前显示前置插槽
|
|
318
|
+
currentAfter,
|
|
319
|
+
|
|
238
320
|
// 设置表格选择类型
|
|
239
321
|
setSelection,
|
|
240
322
|
}
|
package/package.json
CHANGED
package/utils/price.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 换算金额
|
|
3
|
-
*/
|
|
4
|
-
utils.price = function(value, params) {
|
|
5
|
-
return utils.decimal(value, Object.assign({
|
|
6
|
-
// 最小值
|
|
7
|
-
min: 0,
|
|
8
|
-
// 小数点位数
|
|
9
|
-
decimalLength: 2,
|
|
10
|
-
// 是否开启人民币分转元(如值 189 -> 1.89)
|
|
11
|
-
centToYuan: utils.config('priceCent') === true,
|
|
12
|
-
}, params))
|
|
13
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 换算金额
|
|
3
|
+
*/
|
|
4
|
+
utils.price = function(value, params) {
|
|
5
|
+
return utils.decimal(value, Object.assign({
|
|
6
|
+
// 最小值
|
|
7
|
+
min: 0,
|
|
8
|
+
// 小数点位数
|
|
9
|
+
decimalLength: 2,
|
|
10
|
+
// 是否开启人民币分转元(如值 189 -> 1.89)
|
|
11
|
+
centToYuan: utils.config('priceCent') === true,
|
|
12
|
+
}, params))
|
|
13
|
+
}
|