@netang/quasar 0.0.58 → 0.0.60
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.
|
@@ -10,6 +10,26 @@
|
|
|
10
10
|
|
|
11
11
|
<template v-if="dataType">
|
|
12
12
|
|
|
13
|
+
<!-- 设置重定向 URL -->
|
|
14
|
+
<div class="col-xs-12 col-sm-6 col-md-3" v-if="! url">
|
|
15
|
+
|
|
16
|
+
<!-- 树 -->
|
|
17
|
+
<n-field-tree
|
|
18
|
+
class="n-field-fieldset"
|
|
19
|
+
:label="routeType === 0 ? '跳转页面' : '重定向 URL'"
|
|
20
|
+
outlined
|
|
21
|
+
clearable
|
|
22
|
+
stack-label
|
|
23
|
+
dense
|
|
24
|
+
|
|
25
|
+
v-model="formData.toPage"
|
|
26
|
+
:nodes="treeNodes"
|
|
27
|
+
:expanded="treeExpanded"
|
|
28
|
+
strict
|
|
29
|
+
accordion
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
13
33
|
<!-- 列表有效 -->
|
|
14
34
|
<template v-if="dataType === dicts.POWER_DATA_TYPE__LIST">
|
|
15
35
|
|
|
@@ -35,31 +55,12 @@
|
|
|
35
55
|
|
|
36
56
|
</template>
|
|
37
57
|
|
|
58
|
+
<!-- 非列表有效 -->
|
|
38
59
|
<template v-else>
|
|
39
60
|
|
|
40
61
|
<!-- 新窗口有效 -->
|
|
41
62
|
<template v-if="dataType === dicts.POWER_DATA_TYPE__OPEN">
|
|
42
63
|
|
|
43
|
-
<!-- 设置跳转页面(没有路由类型) -->
|
|
44
|
-
<div class="col-xs-12 col-sm-6 col-md-3" v-if="routeType === 0">
|
|
45
|
-
|
|
46
|
-
<!-- 树 -->
|
|
47
|
-
<n-field-tree
|
|
48
|
-
class="n-field-fieldset"
|
|
49
|
-
label="跳转页面"
|
|
50
|
-
outlined
|
|
51
|
-
clearable
|
|
52
|
-
stack-label
|
|
53
|
-
dense
|
|
54
|
-
|
|
55
|
-
v-model="formData.toPage"
|
|
56
|
-
:nodes="treeNodes"
|
|
57
|
-
:expanded="treeExpanded"
|
|
58
|
-
strict
|
|
59
|
-
accordion
|
|
60
|
-
/>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
64
|
<!-- 是否记录来源页面 -->
|
|
64
65
|
<div class="col-xs-12 col-sm-6 col-md-3">
|
|
65
66
|
<q-select
|
|
@@ -365,6 +366,8 @@ export default {
|
|
|
365
366
|
props: {
|
|
366
367
|
// 值
|
|
367
368
|
modelValue: String,
|
|
369
|
+
// URL
|
|
370
|
+
url: String,
|
|
368
371
|
// 数据类型
|
|
369
372
|
dataType: Number,
|
|
370
373
|
// 路由类型
|
|
@@ -449,7 +452,7 @@ export default {
|
|
|
449
452
|
show: '',
|
|
450
453
|
// 是否增加来源页面参数
|
|
451
454
|
addFromPageQuery: false,
|
|
452
|
-
// 跳转页面
|
|
455
|
+
// 页面 ID (跳转页面 / 重定向 URL)
|
|
453
456
|
toPage: '',
|
|
454
457
|
// 是否固定列
|
|
455
458
|
fixed: false,
|
|
@@ -730,9 +733,6 @@ export default {
|
|
|
730
733
|
})
|
|
731
734
|
return false
|
|
732
735
|
}
|
|
733
|
-
|
|
734
|
-
// 设置跳转页面 id
|
|
735
|
-
obj.toPage = data.toPage
|
|
736
736
|
}
|
|
737
737
|
|
|
738
738
|
// 如果增加来源页面参数
|
|
@@ -772,6 +772,22 @@ export default {
|
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
774
|
|
|
775
|
+
// 如果有 跳转页面 / 重定向 URL
|
|
776
|
+
if ($n_isValidValue(data.toPage)) {
|
|
777
|
+
|
|
778
|
+
// 如果定义了 url
|
|
779
|
+
if ($n_isValidValue(props.url)) {
|
|
780
|
+
// 轻提示
|
|
781
|
+
$n_toast({
|
|
782
|
+
message: `如果定义了【${props.routeType === 0 ? '跳转页面' : '重定向 URL'}】,则 URL 必须为空`,
|
|
783
|
+
})
|
|
784
|
+
return false
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
// 设置跳转页面 id
|
|
788
|
+
obj.toPage = data.toPage
|
|
789
|
+
}
|
|
790
|
+
|
|
775
791
|
// 自定义参数
|
|
776
792
|
const params = formatParams(data.params)
|
|
777
793
|
if ($n_isRequired(params)) {
|
package/package.json
CHANGED
package/utils/uploader.js
CHANGED
|
@@ -5,6 +5,8 @@ import $n_has from 'lodash/has'
|
|
|
5
5
|
import $n_get from 'lodash/get'
|
|
6
6
|
import $n_toLower from 'lodash/toLower'
|
|
7
7
|
import $n_findIndex from 'lodash/findIndex'
|
|
8
|
+
import $n_uniq from 'lodash/uniq'
|
|
9
|
+
import $n_find from 'lodash/find'
|
|
8
10
|
|
|
9
11
|
import $n_isValidArray from '@netang/utils/isValidArray'
|
|
10
12
|
import $n_isValidObject from '@netang/utils/isValidObject'
|
|
@@ -19,20 +21,16 @@ import $n_run from '@netang/utils/run'
|
|
|
19
21
|
import $n_isValidValue from '@netang/utils/isValidValue'
|
|
20
22
|
import $n_copy from '@netang/utils/copy'
|
|
21
23
|
import $n_http from '@netang/utils/http'
|
|
24
|
+
import $n_getThrowMessage from '@netang/utils/getThrowMessage'
|
|
22
25
|
|
|
23
26
|
import $n_toast from './toast'
|
|
24
27
|
import $n_confirm from './confirm'
|
|
25
28
|
import $n_alert from './alert'
|
|
26
|
-
|
|
29
|
+
import $n_previewImage from './previewImage'
|
|
30
|
+
import $n_getImage from './getImage'
|
|
31
|
+
import $n_getFile from './getFile'
|
|
27
32
|
import $n_config from './config'
|
|
28
33
|
|
|
29
|
-
import { configs } from './config'
|
|
30
|
-
|
|
31
|
-
const {
|
|
32
|
-
// api 文件请求地址
|
|
33
|
-
apiFileUrl,
|
|
34
|
-
} = configs
|
|
35
|
-
|
|
36
34
|
import {
|
|
37
35
|
// 文件类型映射
|
|
38
36
|
FilE_TYPE,
|
|
@@ -198,7 +196,7 @@ function create(params) {
|
|
|
198
196
|
|
|
199
197
|
// 请求 - 获取文件
|
|
200
198
|
const { status, data: resExisted } = await $n_http({
|
|
201
|
-
url: apiFileUrl + 'get_file',
|
|
199
|
+
url: $n_config('apiFileUrl') + 'get_file',
|
|
202
200
|
data: {
|
|
203
201
|
hashs,
|
|
204
202
|
},
|
|
@@ -654,7 +652,7 @@ function create(params) {
|
|
|
654
652
|
|
|
655
653
|
// 请求 - 检查文件是否存在 hash
|
|
656
654
|
const { status, data: resExisted } = await $n_http({
|
|
657
|
-
url: apiFileUrl + 'check_exist',
|
|
655
|
+
url: $n_config('apiFileUrl') + 'check_exist',
|
|
658
656
|
data: {
|
|
659
657
|
hashs: $n_uniq(checkHashs),
|
|
660
658
|
},
|
|
@@ -974,7 +972,7 @@ function create(params) {
|
|
|
974
972
|
|
|
975
973
|
// 请求 - 修改文件名
|
|
976
974
|
const { status } = await $n_http({
|
|
977
|
-
url: apiFileUrl + 'edit_file_title',
|
|
975
|
+
url: $n_config('apiFileUrl') + 'edit_file_title',
|
|
978
976
|
data: {
|
|
979
977
|
hash,
|
|
980
978
|
title: newTitle,
|