@netang/quasar 0.0.106 → 0.1.8
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/components/field-table.md +30 -29
- package/_docs/docs/components/table.md +24 -25
- package/_docs/docs/utils/table.md +195 -194
- package/components/field-table/index.vue +1227 -1222
- package/components/render/index.vue +120 -150
- package/components/table/index.vue +471 -456
- package/package.json +1 -1
- package/utils/$power.js +1216 -1215
- package/utils/$render.js +75 -0
- package/utils/$table.js +1001 -999
- package/utils/index.js +62 -61
- package/utils/timestamp.js +18 -18
|
@@ -1,150 +1,120 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-layout
|
|
3
|
-
class="absolute-full"
|
|
4
|
-
view="hHh lpr fFf"
|
|
5
|
-
container
|
|
6
|
-
>
|
|
7
|
-
<q-page-container>
|
|
8
|
-
<slot
|
|
9
|
-
:query="query"
|
|
10
|
-
v-bind="props"
|
|
11
|
-
v-if="$slots.default"
|
|
12
|
-
/>
|
|
13
|
-
<component
|
|
14
|
-
:is="comp"
|
|
15
|
-
:query="query"
|
|
16
|
-
v-bind="props"
|
|
17
|
-
v-else
|
|
18
|
-
/>
|
|
19
|
-
</q-page-container>
|
|
20
|
-
</q-layout>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
import { computed, defineAsyncComponent, provide } from 'vue'
|
|
25
|
-
import $n_router from '@netang/utils/vue/router'
|
|
26
|
-
|
|
27
|
-
import $n_has from 'lodash/has'
|
|
28
|
-
import $n_get from 'lodash/get'
|
|
29
|
-
import $n_isFunction from 'lodash/isFunction'
|
|
30
|
-
|
|
31
|
-
import $n_isValidObject from '@netang/utils/isValidObject'
|
|
32
|
-
import $n_isValidString from '@netang/utils/isValidString'
|
|
33
|
-
import $n_slash from '@netang/utils/slash'
|
|
34
|
-
|
|
35
|
-
import components from '../private/components'
|
|
36
|
-
|
|
37
|
-
import
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
// 获取页面路由
|
|
122
|
-
const $route = $n_router.resolve({
|
|
123
|
-
path: props.path,
|
|
124
|
-
query: data.query,
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
Object.assign(data, {
|
|
128
|
-
// 当前路由全路径
|
|
129
|
-
routeFullPath: $route.fullPath,
|
|
130
|
-
// 当前路由路径
|
|
131
|
-
routePath: $route.path,
|
|
132
|
-
// 当前路由参数
|
|
133
|
-
routeQuery: $route.query,
|
|
134
|
-
// 当前路由,
|
|
135
|
-
$route,
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// 向后代注入数据
|
|
140
|
-
provide(NRenderKey, data)
|
|
141
|
-
|
|
142
|
-
// ==========【返回】=============================================================================================
|
|
143
|
-
|
|
144
|
-
return {
|
|
145
|
-
// 组件
|
|
146
|
-
comp,
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<q-layout
|
|
3
|
+
class="absolute-full"
|
|
4
|
+
view="hHh lpr fFf"
|
|
5
|
+
container
|
|
6
|
+
>
|
|
7
|
+
<q-page-container>
|
|
8
|
+
<slot
|
|
9
|
+
:query="query"
|
|
10
|
+
v-bind="props"
|
|
11
|
+
v-if="$slots.default"
|
|
12
|
+
/>
|
|
13
|
+
<component
|
|
14
|
+
:is="comp"
|
|
15
|
+
:query="query"
|
|
16
|
+
v-bind="props"
|
|
17
|
+
v-else
|
|
18
|
+
/>
|
|
19
|
+
</q-page-container>
|
|
20
|
+
</q-layout>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import { computed, defineAsyncComponent, provide } from 'vue'
|
|
25
|
+
import $n_router from '@netang/utils/vue/router'
|
|
26
|
+
|
|
27
|
+
import $n_has from 'lodash/has'
|
|
28
|
+
import $n_get from 'lodash/get'
|
|
29
|
+
import $n_isFunction from 'lodash/isFunction'
|
|
30
|
+
|
|
31
|
+
import $n_isValidObject from '@netang/utils/isValidObject'
|
|
32
|
+
import $n_isValidString from '@netang/utils/isValidString'
|
|
33
|
+
import $n_slash from '@netang/utils/slash'
|
|
34
|
+
|
|
35
|
+
import components from '../private/components'
|
|
36
|
+
|
|
37
|
+
import $n_$render from '../../utils/$render'
|
|
38
|
+
import { NRenderKey } from '../../utils/symbols'
|
|
39
|
+
import { configs } from '../../utils/config'
|
|
40
|
+
|
|
41
|
+
const {
|
|
42
|
+
// 自定义路由
|
|
43
|
+
routers,
|
|
44
|
+
} = configs
|
|
45
|
+
|
|
46
|
+
export default {
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 标识
|
|
50
|
+
*/
|
|
51
|
+
name: 'NRender',
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 声明属性
|
|
55
|
+
*/
|
|
56
|
+
props: {
|
|
57
|
+
// 组件标识
|
|
58
|
+
name: String,
|
|
59
|
+
// 组件路径
|
|
60
|
+
path: String,
|
|
61
|
+
// 参数
|
|
62
|
+
query: Object,
|
|
63
|
+
// 组件传参
|
|
64
|
+
props: Object,
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 组合式
|
|
69
|
+
*/
|
|
70
|
+
setup(props) {
|
|
71
|
+
|
|
72
|
+
// ==========【计算属性】=========================================================================================
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 获取当前组件
|
|
76
|
+
*/
|
|
77
|
+
const comp = computed(function () {
|
|
78
|
+
|
|
79
|
+
// 组件
|
|
80
|
+
let comp
|
|
81
|
+
|
|
82
|
+
// 如果是路由路径
|
|
83
|
+
if (props.path) {
|
|
84
|
+
// 获取路由组件
|
|
85
|
+
comp = $n_get(routers, `${$n_slash(props.path, 'start', false)}.component`)
|
|
86
|
+
|
|
87
|
+
// 如果有组件标识
|
|
88
|
+
} else if (props.name && $n_has(components, props.name)) {
|
|
89
|
+
// 获取自定义组件
|
|
90
|
+
comp = components[props.name]
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 如果没有组件
|
|
94
|
+
if (! comp) {
|
|
95
|
+
return
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// 如果是方法, 则说明是异步组件
|
|
99
|
+
if ($n_isFunction(comp)) {
|
|
100
|
+
return defineAsyncComponent(comp)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// 返回组件
|
|
104
|
+
return comp
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
// ==========【注入】============================================================================================
|
|
108
|
+
|
|
109
|
+
// 创建渲染
|
|
110
|
+
$n_$render.create(props)
|
|
111
|
+
|
|
112
|
+
// ==========【返回】=============================================================================================
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
// 组件
|
|
116
|
+
comp,
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
</script>
|