@netang/quasar 0.0.56 → 0.0.57
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/_docs/docs/.vuepress/client.js +0 -31
- package/_docs/docs/.vuepress/configs/sidebar/zh.js +21 -0
- package/_docs/docs/components/column-title.md +10 -0
- package/_docs/docs/components/data.md +21 -0
- package/_docs/docs/components/dialog.md +23 -0
- package/_docs/docs/components/dragger.md +26 -0
- package/_docs/docs/components/editor-code.md +16 -0
- package/_docs/docs/components/empty.md +11 -0
- package/_docs/docs/components/field-date.md +16 -0
- package/_docs/docs/components/field-table.md +57 -63
- package/_docs/docs/components/field-text.md +57 -0
- package/_docs/docs/components/field-tree.md +20 -0
- package/_docs/docs/components/input-number.md +21 -0
- package/_docs/docs/components/render.md +12 -0
- package/_docs/docs/components/search-item.md +10 -0
- package/_docs/docs/components/search.md +12 -0
- package/_docs/docs/components/select.md +11 -0
- package/_docs/docs/components/splitter.md +15 -0
- package/_docs/docs/components/table-splitter.md +20 -0
- package/_docs/docs/components/table.md +25 -0
- package/_docs/docs/components/thumbnail.md +11 -0
- package/_docs/docs/components/toolbar.md +9 -0
- package/_docs/docs/components/uploader-query.md +19 -0
- package/_docs/docs/components/uploader.md +16 -0
- package/_docs/docs/components/value-format.md +26 -0
- package/_docs/package.json +11 -17
- package/components/dialog/index.vue +6 -6
- package/components/dragger/index.vue +1 -1
- package/components/editor-code/index.vue +1 -1
- package/components/field-date/index.vue +24 -15
- package/components/field-table/index.vue +6 -6
- package/components/field-tree/index.vue +5 -6
- package/components/input-number/index.vue +6 -6
- package/components/search/index.vue +3 -7
- package/components/table/index.vue +2 -2
- package/components/table-splitter/index.vue +4 -0
- package/components/thumbnail/index.vue +1 -1
- package/components/toolbar/index.vue +1 -3
- package/components/value-format/index.vue +2 -2
- package/package.json +1 -1
- package/sass/common.scss +0 -2
- package/utils/{auth.js → $auth.js} +2 -2
- package/utils/{form.js → $form.js} +2 -2
- package/utils/{power.js → $power.js} +5 -4
- package/utils/{rule.js → $rule.js} +1 -1
- package/utils/{ruleValid.js → $ruleValid.js} +1 -1
- package/utils/{search.js → $search.js} +2 -2
- package/utils/{table.js → $table.js} +9 -9
- package/utils/{tree.js → $tree.js} +2 -2
- package/utils/config.js +20 -16
- package/utils/getData.js +3 -8
- package/utils/getFile.js +8 -4
- package/utils/getImage.js +9 -3
- package/utils/index.js +18 -16
- package/utils/uploader/qiniu.js +3 -9
- package/utils/uploader.js +3 -2
- package/utils/useRouter.js +7 -7
- package/_docs/docs/.vuepress/components/test.vue +0 -23
- package/components/dialog-table/index.vue +0 -94
- package/package2.json +0 -30
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# ValueFormat 值格式化
|
|
2
|
+
|
|
3
|
+
::: tip
|
|
4
|
+
值格式化
|
|
5
|
+
:::
|
|
6
|
+
|
|
7
|
+
| 属性名 | 说明 | 类型 | 可选值 | 默认值 |
|
|
8
|
+
|-------------------|------------|---------------------|-----|-------|
|
|
9
|
+
| value / v-model | 绑定值(必填) | - | - | - |
|
|
10
|
+
| before | 修改前值 | `Function` | - | - |
|
|
11
|
+
| after | 修改后值 | `Function` | - | - |
|
|
12
|
+
| no-emit | 不自动触发更新 | `Boolean` | - | false |
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### ValueFormat 插槽
|
|
16
|
+
|
|
17
|
+
| 插槽名 | 说明 |
|
|
18
|
+
|---------|------|
|
|
19
|
+
| default | 默认插槽 |
|
|
20
|
+
|
|
21
|
+
### ValueFormat `default` 插槽 对外暴露的方法
|
|
22
|
+
|
|
23
|
+
| 属性名 | 说明 | 类型 | 示例 |
|
|
24
|
+
|-------|--------|------------|-----|
|
|
25
|
+
| scope | 当前值 | - | - |
|
|
26
|
+
| emit | 触发更新方法 | `Function` | - |
|
package/_docs/package.json
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
{
|
|
2
|
-
"private": true,
|
|
3
|
-
"scripts": {
|
|
4
|
-
"docs:dev": "vuepress dev docs",
|
|
5
|
-
"docs:build": "vuepress build docs"
|
|
6
|
-
},
|
|
7
|
-
"devDependencies": {
|
|
8
|
-
"@
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"quasar": "^2.11.5",
|
|
13
|
-
"vue": "^3.2.47",
|
|
14
|
-
"vuepress": "^2.0.0-beta.60",
|
|
15
|
-
"utils": "^4.17.21"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"scripts": {
|
|
4
|
+
"docs:dev": "vuepress dev docs",
|
|
5
|
+
"docs:build": "vuepress build docs"
|
|
6
|
+
},
|
|
7
|
+
"devDependencies": {
|
|
8
|
+
"@vuepress/plugin-search": "^2.0.0-beta.60",
|
|
9
|
+
"vuepress": "^2.0.0-beta.60"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -96,20 +96,20 @@ export default {
|
|
|
96
96
|
props: Object,
|
|
97
97
|
// 标题
|
|
98
98
|
title: String,
|
|
99
|
-
//
|
|
99
|
+
// 是否显示关闭按钮
|
|
100
100
|
close: {
|
|
101
101
|
type: Boolean,
|
|
102
102
|
default: true,
|
|
103
103
|
},
|
|
104
|
-
//
|
|
104
|
+
// 是否显示取消按钮
|
|
105
105
|
cancel: Boolean,
|
|
106
|
-
//
|
|
107
|
-
onConfirm: Function,
|
|
108
|
-
// 显示底部
|
|
106
|
+
// 是否显示底部
|
|
109
107
|
bottom: {
|
|
110
108
|
type: Boolean,
|
|
111
109
|
default: true,
|
|
112
110
|
},
|
|
111
|
+
// 点击确定方法
|
|
112
|
+
onConfirm: Function,
|
|
113
113
|
// 宽度
|
|
114
114
|
width: {
|
|
115
115
|
type: [String, Number],
|
|
@@ -127,7 +127,7 @@ export default {
|
|
|
127
127
|
},
|
|
128
128
|
// 是否全屏
|
|
129
129
|
fullscreen: Boolean,
|
|
130
|
-
//
|
|
130
|
+
// 是否是页面容器
|
|
131
131
|
pageContainer: {
|
|
132
132
|
type: Boolean,
|
|
133
133
|
default: true,
|
|
@@ -169,15 +169,13 @@ export default {
|
|
|
169
169
|
},
|
|
170
170
|
// 结束值
|
|
171
171
|
end: [String, Number],
|
|
172
|
-
// 占位符
|
|
173
|
-
placeholder: String,
|
|
174
172
|
// 类型, 可选值 year month day time datetime daterange datetimerange
|
|
175
173
|
type: {
|
|
176
174
|
type: String,
|
|
177
175
|
default: 'day',
|
|
178
176
|
},
|
|
179
|
-
//
|
|
180
|
-
|
|
177
|
+
// 是否截止日期
|
|
178
|
+
isEndDate: Boolean,
|
|
181
179
|
// 是否显示秒
|
|
182
180
|
showSecond: Boolean,
|
|
183
181
|
// 显示在输入框中的格式
|
|
@@ -188,6 +186,8 @@ export default {
|
|
|
188
186
|
type: String,
|
|
189
187
|
default: 'X',
|
|
190
188
|
},
|
|
189
|
+
// 占位符
|
|
190
|
+
placeholder: String,
|
|
191
191
|
// 是否只读
|
|
192
192
|
readonly: Boolean,
|
|
193
193
|
},
|
|
@@ -316,6 +316,7 @@ export default {
|
|
|
316
316
|
watch([()=>props.modelValue, ()=>props.end, ()=>props.type], function() {
|
|
317
317
|
dateValue.value = formatDateValue()
|
|
318
318
|
Object.assign(timeValue, formatTimeValue())
|
|
319
|
+
|
|
319
320
|
showValue.value = updateValue(dateValue.value, timeValue, false)
|
|
320
321
|
})
|
|
321
322
|
|
|
@@ -345,6 +346,14 @@ export default {
|
|
|
345
346
|
ii: '',
|
|
346
347
|
})
|
|
347
348
|
|
|
349
|
+
// 如果是这种格式 06:59 的时间
|
|
350
|
+
if (
|
|
351
|
+
! $n_isDate(val)
|
|
352
|
+
&& $n_indexOf(val, ':') > -1
|
|
353
|
+
) {
|
|
354
|
+
val = quasarDate.formatDate(Date.now(), `YYYY-MM-DD ${val}`)
|
|
355
|
+
}
|
|
356
|
+
|
|
348
357
|
if ($n_isDate(val)) {
|
|
349
358
|
|
|
350
359
|
const { hh, ii, ss } = $n_dateObject(val)
|
|
@@ -461,7 +470,7 @@ export default {
|
|
|
461
470
|
}
|
|
462
471
|
|
|
463
472
|
// 如果不是范围日期 && 是结束日期
|
|
464
|
-
} else if (! isRange.value && props.
|
|
473
|
+
} else if (! isRange.value && props.isEndDate) {
|
|
465
474
|
obj.from = props.showSecond ? '23:59:59' : '23:59'
|
|
466
475
|
} else {
|
|
467
476
|
obj.from = props.showSecond ? '00:00:00' : '00:00'
|
|
@@ -493,17 +502,16 @@ export default {
|
|
|
493
502
|
|
|
494
503
|
// 如果是选择时间
|
|
495
504
|
if (props.type === 'time') {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|| ! $n_isValidValue(dateValue.ii)
|
|
499
|
-
|| (props.showSecond && ! $n_isValidValue(dateValue.ss))) {
|
|
505
|
+
|
|
506
|
+
if (! $n_isValidValue(dateValue.hh) && ! $n_isValidValue(dateValue.ii)) {
|
|
500
507
|
return ''
|
|
501
508
|
}
|
|
509
|
+
|
|
502
510
|
format = 'HH:mm'
|
|
503
511
|
if (props.showSecond) {
|
|
504
512
|
format += ':ss'
|
|
505
513
|
}
|
|
506
|
-
val = quasarDate.formatDate(Date.now(), `YYYY-MM-DD ${dateValue.hh}:${dateValue.ii}${props.showSecond ? dateValue.ss : (props.
|
|
514
|
+
val = quasarDate.formatDate(Date.now(), `YYYY-MM-DD ${dateValue.hh !== '' ? dateValue.hh : '00'}:${dateValue.ii !== '' ? dateValue.ii : '00'}${props.showSecond && dateValue.ss !== '' ? dateValue.ss : (props.isEndDate ? ':59' : ':00')}`)
|
|
507
515
|
|
|
508
516
|
// 否则是选择年月
|
|
509
517
|
} else {
|
|
@@ -518,11 +526,11 @@ export default {
|
|
|
518
526
|
}
|
|
519
527
|
|
|
520
528
|
format = 'YYYY-MM'
|
|
521
|
-
val = quasarDate[props.
|
|
529
|
+
val = quasarDate[props.isEndDate ? 'endOfDate' : 'startOfDate'](new Date(`${dateValue.y}-${dateValue.mm}`), 'month')
|
|
522
530
|
|
|
523
531
|
} else {
|
|
524
532
|
format = 'YYYY'
|
|
525
|
-
val = quasarDate[props.
|
|
533
|
+
val = quasarDate[props.isEndDate ? 'endOfDate' : 'startOfDate'](new Date(`${dateValue.y}-01`), 'year')
|
|
526
534
|
}
|
|
527
535
|
}
|
|
528
536
|
|
|
@@ -601,12 +609,12 @@ export default {
|
|
|
601
609
|
if (props.showSecond) {
|
|
602
610
|
format += ':ss'
|
|
603
611
|
} else {
|
|
604
|
-
from += (props.
|
|
612
|
+
from += (props.isEndDate ? ':59' : ':00')
|
|
605
613
|
}
|
|
606
614
|
} else {
|
|
607
|
-
from += (props.
|
|
615
|
+
from += (props.isEndDate ? '23:59' : '00:00')
|
|
608
616
|
if (! props.showSecond) {
|
|
609
|
-
from += (props.
|
|
617
|
+
from += (props.isEndDate ? ':59' : ':00')
|
|
610
618
|
}
|
|
611
619
|
}
|
|
612
620
|
if (props.format) {
|
|
@@ -671,6 +679,7 @@ export default {
|
|
|
671
679
|
// 更新值
|
|
672
680
|
const newValue = {}
|
|
673
681
|
newValue[type] = value
|
|
682
|
+
|
|
674
683
|
updateValue(Object.assign({}, dateValue.value, newValue), timeValue)
|
|
675
684
|
|
|
676
685
|
// 如是类型是年
|
|
@@ -194,8 +194,8 @@ import $n_numberDeep from '@netang/utils/numberDeep'
|
|
|
194
194
|
import $n_sleep from '@netang/utils/sleep'
|
|
195
195
|
import $n_http from '@netang/utils/http'
|
|
196
196
|
|
|
197
|
-
import $
|
|
198
|
-
import $
|
|
197
|
+
import $n_$power from '../../utils/$power'
|
|
198
|
+
import $n_$table from '../../utils/$table'
|
|
199
199
|
|
|
200
200
|
import { configs } from '../../utils/config'
|
|
201
201
|
|
|
@@ -357,7 +357,7 @@ export default {
|
|
|
357
357
|
|
|
358
358
|
|
|
359
359
|
// 创建权限实例
|
|
360
|
-
const $power = $
|
|
360
|
+
const $power = $n_$power.create({
|
|
361
361
|
// 路由路径
|
|
362
362
|
path: $n_isValidString(props.path) ? props.path : false,
|
|
363
363
|
// 路由参数
|
|
@@ -372,7 +372,7 @@ export default {
|
|
|
372
372
|
} = $power
|
|
373
373
|
|
|
374
374
|
// 创建表格实例
|
|
375
|
-
const $table = $
|
|
375
|
+
const $table = $n_$table.create({
|
|
376
376
|
// 权限实例
|
|
377
377
|
$power,
|
|
378
378
|
// 附加请求数据
|
|
@@ -788,7 +788,7 @@ export default {
|
|
|
788
788
|
// 如果有路由路径
|
|
789
789
|
} else if (routePath) {
|
|
790
790
|
// 否则如果有路由表格列数据
|
|
791
|
-
const rawTableColumns = $
|
|
791
|
+
const rawTableColumns = $n_$table.config(routePath, 'columns')
|
|
792
792
|
if ($n_isValidArray(rawTableColumns)) {
|
|
793
793
|
columns = $n_cloneDeep(rawTableColumns)
|
|
794
794
|
}
|
|
@@ -863,7 +863,7 @@ export default {
|
|
|
863
863
|
// 设置输入框焦点
|
|
864
864
|
setInputFocus()
|
|
865
865
|
|
|
866
|
-
window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, 0)
|
|
866
|
+
// window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, 0)
|
|
867
867
|
}
|
|
868
868
|
|
|
869
869
|
/**
|
|
@@ -149,12 +149,12 @@ export default {
|
|
|
149
149
|
expanded: Array, // v-model:expanded
|
|
150
150
|
// 节点数组
|
|
151
151
|
nodes: Array,
|
|
152
|
-
//
|
|
152
|
+
// 唯一的节点键值
|
|
153
153
|
nodeKey: {
|
|
154
154
|
type: String,
|
|
155
155
|
default: 'id',
|
|
156
156
|
},
|
|
157
|
-
//
|
|
157
|
+
// 标签字段
|
|
158
158
|
labelKey: {
|
|
159
159
|
type: String,
|
|
160
160
|
default: 'label',
|
|
@@ -165,15 +165,14 @@ export default {
|
|
|
165
165
|
multiple: Boolean,
|
|
166
166
|
// 手风琴模式
|
|
167
167
|
accordion: Boolean,
|
|
168
|
-
//
|
|
168
|
+
// 是否显示选中值的完整路径
|
|
169
169
|
showAllLevels: {
|
|
170
170
|
type: Boolean,
|
|
171
171
|
default: true,
|
|
172
172
|
},
|
|
173
|
-
|
|
174
173
|
// 是否开启筛选
|
|
175
174
|
filter: Boolean,
|
|
176
|
-
//
|
|
175
|
+
// 是否折叠标签(多选模式有效)
|
|
177
176
|
collapseTags: Boolean,
|
|
178
177
|
// 占位符
|
|
179
178
|
placeholder: String,
|
|
@@ -501,7 +500,7 @@ export default {
|
|
|
501
500
|
// 设置输入框焦点
|
|
502
501
|
setInputFocus()
|
|
503
502
|
|
|
504
|
-
window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, 0)
|
|
503
|
+
// window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, 0)
|
|
505
504
|
}
|
|
506
505
|
|
|
507
506
|
/**
|
|
@@ -72,6 +72,8 @@
|
|
|
72
72
|
|
|
73
73
|
<script>
|
|
74
74
|
import { computed, ref, watch } from 'vue'
|
|
75
|
+
import BigNumber from 'bignumber.js'
|
|
76
|
+
|
|
75
77
|
import $n_filter from 'lodash/filter'
|
|
76
78
|
|
|
77
79
|
import $n_isValidObject from '@netang/utils/isValidObject'
|
|
@@ -105,16 +107,10 @@ export default {
|
|
|
105
107
|
step: [Number, String],
|
|
106
108
|
// 小数位数(默认为 0, centToYuan开启后默认为 2)
|
|
107
109
|
decimalLength: [Number, String],
|
|
108
|
-
// 是否禁用
|
|
109
|
-
disable: Boolean,
|
|
110
|
-
// 是否只读
|
|
111
|
-
readonly: Boolean,
|
|
112
110
|
// 是否禁用减少按钮
|
|
113
111
|
disableMinus: Boolean,
|
|
114
112
|
// 是否禁用增加按钮
|
|
115
113
|
disablePlus: Boolean,
|
|
116
|
-
// 是否禁用输入框
|
|
117
|
-
disableInput: Boolean,
|
|
118
114
|
// 是否使用控制按钮
|
|
119
115
|
controls: Boolean,
|
|
120
116
|
// 居中显示
|
|
@@ -130,6 +126,10 @@ export default {
|
|
|
130
126
|
type: Number,
|
|
131
127
|
default: BigNumber.ROUND_DOWN,
|
|
132
128
|
},
|
|
129
|
+
// 是否禁用
|
|
130
|
+
disable: Boolean,
|
|
131
|
+
// 是否只读
|
|
132
|
+
readonly: Boolean,
|
|
133
133
|
},
|
|
134
134
|
|
|
135
135
|
/**
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
v-model="modelValue[itemIndex][index].value"
|
|
34
34
|
:type="modelValue[itemIndex][0].dateType"
|
|
35
35
|
dense
|
|
36
|
-
:end-date="index === 1"
|
|
36
|
+
:is-end-date="index === 1"
|
|
37
37
|
outlined
|
|
38
38
|
clearable
|
|
39
39
|
/>
|
|
@@ -171,11 +171,7 @@ import NFieldTable from '../field-table'
|
|
|
171
171
|
|
|
172
172
|
import $n_isValidArray from '@netang/utils/isValidArray'
|
|
173
173
|
|
|
174
|
-
import
|
|
175
|
-
|
|
176
|
-
const {
|
|
177
|
-
priceCentToYuan,
|
|
178
|
-
} = configs
|
|
174
|
+
import $n_config from '../../utils/config'
|
|
179
175
|
|
|
180
176
|
export default {
|
|
181
177
|
|
|
@@ -215,7 +211,7 @@ export default {
|
|
|
215
211
|
setup() {
|
|
216
212
|
return {
|
|
217
213
|
// 如果金额为分
|
|
218
|
-
centToYuan: priceCentToYuan,
|
|
214
|
+
centToYuan: $n_config('priceCentToYuan') === true,
|
|
219
215
|
|
|
220
216
|
isValidArray: $n_isValidArray,
|
|
221
217
|
}
|
|
@@ -242,14 +242,14 @@ export default {
|
|
|
242
242
|
},
|
|
243
243
|
// 树节点点击
|
|
244
244
|
treeNodeClick: Function,
|
|
245
|
-
//
|
|
245
|
+
// 是否选中第一个树节点
|
|
246
246
|
treeSelectFirstNode: {
|
|
247
247
|
type: Boolean,
|
|
248
248
|
default: true,
|
|
249
249
|
},
|
|
250
250
|
// 显示树筛选
|
|
251
251
|
treeFilter: Boolean,
|
|
252
|
-
//
|
|
252
|
+
// 树位置, 可选值: left / right
|
|
253
253
|
treeSide: {
|
|
254
254
|
type: String,
|
|
255
255
|
default: 'left',
|
|
@@ -123,9 +123,13 @@ export default {
|
|
|
123
123
|
type: Number,
|
|
124
124
|
default: 50,
|
|
125
125
|
},
|
|
126
|
+
// 反转插槽
|
|
126
127
|
reverse: Boolean,
|
|
128
|
+
// 模型的 CSS 单位
|
|
127
129
|
unit: String,
|
|
130
|
+
// 两个值的数组,表示两个面板的最小和最大分割大小
|
|
128
131
|
limits: Array,
|
|
132
|
+
// 是否水平拆分
|
|
129
133
|
horizontal: Boolean,
|
|
130
134
|
|
|
131
135
|
// 显示后置插槽 v-model:after
|
package/package.json
CHANGED
package/sass/common.scss
CHANGED
|
@@ -35,12 +35,13 @@ import $n_http from '@netang/utils/http'
|
|
|
35
35
|
import { statePower } from '../store'
|
|
36
36
|
import { NRenderKey, NPowerKey, NFormKey, NTableKey } from './symbols'
|
|
37
37
|
|
|
38
|
-
import $n_config from './config'
|
|
39
38
|
import $n_getData from './getData'
|
|
40
39
|
import $n_toast from './toast'
|
|
41
40
|
import $n_confirm from './confirm'
|
|
42
41
|
import $n_bus from './bus'
|
|
43
42
|
|
|
43
|
+
import $n_config from './config'
|
|
44
|
+
|
|
44
45
|
import { configs } from './config'
|
|
45
46
|
|
|
46
47
|
const {
|
|
@@ -540,7 +541,7 @@ async function getData() {
|
|
|
540
541
|
if (! statePower.value.v) {
|
|
541
542
|
|
|
542
543
|
// 获取权限数据
|
|
543
|
-
const res = await $n_getData($n_config('
|
|
544
|
+
const res = await $n_getData($n_config('apiDataPowerName'))
|
|
544
545
|
if (res === false) {
|
|
545
546
|
statePower.value = {
|
|
546
547
|
// 权限版本
|
|
@@ -1150,7 +1151,7 @@ function getPageData($route) {
|
|
|
1150
1151
|
/**
|
|
1151
1152
|
* 权限业务
|
|
1152
1153
|
*/
|
|
1153
|
-
const power = {
|
|
1154
|
+
const $power = {
|
|
1154
1155
|
// 创建
|
|
1155
1156
|
create,
|
|
1156
1157
|
// 设置权限数据
|
|
@@ -1165,4 +1166,4 @@ const power = {
|
|
|
1165
1166
|
request,
|
|
1166
1167
|
}
|
|
1167
1168
|
|
|
1168
|
-
export default power
|
|
1169
|
+
export default $power
|
|
@@ -498,7 +498,7 @@ function formatValue(rawSearchOptions, searchValue) {
|
|
|
498
498
|
/**
|
|
499
499
|
* 搜素业务
|
|
500
500
|
*/
|
|
501
|
-
const search = {
|
|
501
|
+
const $search = {
|
|
502
502
|
// 获取原始值
|
|
503
503
|
getRawData,
|
|
504
504
|
// 获取参数
|
|
@@ -507,4 +507,4 @@ const search = {
|
|
|
507
507
|
formatValue,
|
|
508
508
|
}
|
|
509
509
|
|
|
510
|
-
export default search
|
|
510
|
+
export default $search
|
|
@@ -28,8 +28,8 @@ import $n_toDate from '@netang/utils/toDate'
|
|
|
28
28
|
import $n_slash from '@netang/utils/slash'
|
|
29
29
|
import $n_http from '@netang/utils/http'
|
|
30
30
|
|
|
31
|
-
import $
|
|
32
|
-
import $
|
|
31
|
+
import $n_$search, { setItemValue } from './$search'
|
|
32
|
+
import $n_$power from './$power'
|
|
33
33
|
import $n_dict from './dict'
|
|
34
34
|
import $n_price from './price'
|
|
35
35
|
|
|
@@ -284,7 +284,7 @@ function create(params) {
|
|
|
284
284
|
// 首次表格搜索值(如果表格搜索参数中带了初始值, 则设置初始值)
|
|
285
285
|
firstTableSearchValue,
|
|
286
286
|
// 表格搜索值(如果表格搜索参数中带了初始值, 则设置初始值)
|
|
287
|
-
} = $
|
|
287
|
+
} = $n_$search.getRawData(tableColumns, Object.assign({}, $route.query), o.searchFromQuery)
|
|
288
288
|
|
|
289
289
|
// 表格搜索数据值
|
|
290
290
|
const tableSearchValue = ref($route.fullPath ? firstTableSearchValue : [])
|
|
@@ -305,7 +305,7 @@ function create(params) {
|
|
|
305
305
|
const lists = []
|
|
306
306
|
|
|
307
307
|
// 先格式化权限按钮列表
|
|
308
|
-
$n_forEach($
|
|
308
|
+
$n_forEach($n_$power.formatBtns($power.powerBtns.value), function(item) {
|
|
309
309
|
|
|
310
310
|
// 如果是固定按钮
|
|
311
311
|
if (item.fixed) {
|
|
@@ -671,7 +671,7 @@ function create(params) {
|
|
|
671
671
|
})
|
|
672
672
|
|
|
673
673
|
// 获取搜索值
|
|
674
|
-
const search = $
|
|
674
|
+
const search = $n_$search.formatValue(rawSearchOptions, tableSearchValue.value)
|
|
675
675
|
if ($n_isValidArray(search)) {
|
|
676
676
|
data.n_search = $n_has(data, 'n_search') ? $n_concat(data.n_search, search) : search
|
|
677
677
|
}
|
|
@@ -871,14 +871,14 @@ function create(params) {
|
|
|
871
871
|
* 设置表格搜索参数
|
|
872
872
|
*/
|
|
873
873
|
async function setTableSearchOptions(format) {
|
|
874
|
-
tableSearchOptions.value = await $
|
|
874
|
+
tableSearchOptions.value = await $n_$search.getOptions(rawSearchOptions, format)
|
|
875
875
|
}
|
|
876
876
|
|
|
877
877
|
/**
|
|
878
878
|
* 是否有表格搜索值
|
|
879
879
|
*/
|
|
880
880
|
function hasTableSearchValue() {
|
|
881
|
-
return !! $
|
|
881
|
+
return !! $n_$search.formatValue(rawSearchOptions, tableSearchValue.value).length
|
|
882
882
|
}
|
|
883
883
|
|
|
884
884
|
// 如果开启搜索
|
|
@@ -987,11 +987,11 @@ function config(routePath, path, defaultValue) {
|
|
|
987
987
|
/**
|
|
988
988
|
* 业务表格
|
|
989
989
|
*/
|
|
990
|
-
const table = {
|
|
990
|
+
const $table = {
|
|
991
991
|
// 创建表格
|
|
992
992
|
create,
|
|
993
993
|
// 获取表格配置
|
|
994
994
|
config,
|
|
995
995
|
}
|
|
996
996
|
|
|
997
|
-
export default table
|
|
997
|
+
export default $table
|