vue2-client 1.15.13 → 1.15.14
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/package.json +2 -2
- package/src/ReportView.js +0 -6
- package/src/base-client/components/common/XForm/XForm.vue +419 -419
- package/src/base-client/components/common/XFormTable/demo.vue +0 -1
- package/src/base-client/components/common/XPrint/PrintBill.vue +3 -1
- package/src/base-client/components/common/XTable/XTableWrapper.vue +166 -1
- package/src/base-client/components/common/XUploadFilesView/index.vue +485 -485
- package/src/base-client/components/layout/XPageView/RenderRow.vue +88 -88
- package/src/base-client/components/layout/XPageView/XPageView.vue +223 -223
- package/src/base-client/components/layout/XPageView/XTab/XTab.vue +96 -96
- package/src/base-client/components/layout/XPageView/componentTypes.js +22 -22
- package/src/main.js +3 -4
- package/src/pages/WorkflowDetail/WorkFlowDemo2.vue +310 -14
- package/src/pages/WorkflowDetail/WorkflowPageDetail/LeaveMessage.vue +388 -388
- package/src/pages/XPageViewExample/index.vue +149 -149
- package/src/pages/addressSelect/addressDemo.vue +24 -24
- package/src/router/async/router.map.js +2 -4
- package/src/router.js +0 -2
- package/vue.config.js +0 -3
- package/src/base-client/components/common/AMisRender/index.js +0 -3
- package/src/base-client/components/common/AMisRender/index.vue +0 -263
- package/src/pages/AMisDemo/AMisDemo.vue +0 -325
- package/src/pages/AMisDemo/AMisDemo2.vue +0 -74
- package/test/Amis.spec.js +0 -164
@@ -1,149 +1,149 @@
|
|
1
|
-
<script setup>
|
2
|
-
import { onMounted, ref } from 'vue'
|
3
|
-
import XPageView from '@vue2-client/base-client/components/layout/XPageView'
|
4
|
-
|
5
|
-
const xPageViewRef = ref(null)
|
6
|
-
|
7
|
-
onMounted(() => {
|
8
|
-
xPageViewRef.value.init({
|
9
|
-
configValue: {
|
10
|
-
type: 'page',
|
11
|
-
onMounted: function (curr) {
|
12
|
-
console.warn(curr.data)
|
13
|
-
// 设置Tab配置数据
|
14
|
-
curr.data.tabData = {
|
15
|
-
index: 0,
|
16
|
-
items: [
|
17
|
-
// 第一组配置
|
18
|
-
{
|
19
|
-
tabConfigs: [
|
20
|
-
{ title: '表单列表', type: 'XFormTable', props: { serviceName: 'af-system', queryParamsName: 'crud_dictionary_manage' } },
|
21
|
-
{ title: '新增表单', type: 'XAddNativeForm', props: { serviceName: 'af-system', configName: 'crud_dictionary_manage_add_form' } }
|
22
|
-
]
|
23
|
-
},
|
24
|
-
// 第二组配置
|
25
|
-
{
|
26
|
-
tabConfigs: [
|
27
|
-
{ title: '数据列表', type: 'XFormTable', props: { serviceName: 'af-system', queryParamsName: 'crud_dictionary_manage' } },
|
28
|
-
{ title: '编辑表单', type: 'XAddNativeForm', props: { serviceName: 'af-system', configName: 'crud_dictionary_manage_add_form' } },
|
29
|
-
{ title: '查看记录', type: 'XFormTable', props: { serviceName: 'af-system', queryParamsName: 'crud_dictionary_manage' } }
|
30
|
-
]
|
31
|
-
}
|
32
|
-
]
|
33
|
-
}
|
34
|
-
console.log('页面初始化完成,全局数据上下文已创建')
|
35
|
-
},
|
36
|
-
gutter: [16, 16],
|
37
|
-
children: [
|
38
|
-
{
|
39
|
-
id: 'controlRow',
|
40
|
-
type: 'row',
|
41
|
-
gutter: 16,
|
42
|
-
template: 'card',
|
43
|
-
children: [
|
44
|
-
{
|
45
|
-
id: 'buttonContainer',
|
46
|
-
span: '24',
|
47
|
-
type: 'row',
|
48
|
-
gutter: 8,
|
49
|
-
children: [
|
50
|
-
{
|
51
|
-
id: 'reloadButton',
|
52
|
-
span: '6',
|
53
|
-
type: 'a-button',
|
54
|
-
props: {
|
55
|
-
type: 'primary',
|
56
|
-
value: '切换Tab配置'
|
57
|
-
},
|
58
|
-
children: [
|
59
|
-
{
|
60
|
-
type: 'text',
|
61
|
-
text: '切换Tab配置'
|
62
|
-
}
|
63
|
-
],
|
64
|
-
event: {
|
65
|
-
click: function (e, context) {
|
66
|
-
// 切换Tab配置
|
67
|
-
const tabData = context.data.tabData
|
68
|
-
tabData.index = tabData.index === 0 ? 1 : 0
|
69
|
-
|
70
|
-
// 获取当前配置和Tab组件
|
71
|
-
const currentConfig = tabData.items[tabData.index]
|
72
|
-
const tabComponent = context.comps.pageTab
|
73
|
-
|
74
|
-
if (tabComponent) {
|
75
|
-
// 更新Tab组件配置
|
76
|
-
tabComponent.$props.data = currentConfig.tabConfigs
|
77
|
-
console.log('Tab配置已更新,当前配置索引:', tabData.index)
|
78
|
-
|
79
|
-
// 更新状态文本
|
80
|
-
const statusText = context.comps.statusText
|
81
|
-
if (statusText && statusText.$el) {
|
82
|
-
statusText.message = `点击按钮切换不同的Tab配置,当前是第${tabData.index + 1}组配置`
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
86
|
-
}
|
87
|
-
},
|
88
|
-
{
|
89
|
-
id: 'statusText',
|
90
|
-
span: '18',
|
91
|
-
type: 'a-alert',
|
92
|
-
props: {
|
93
|
-
message: '点击按钮切换不同的Tab配置,当前是第1组配置',
|
94
|
-
type: 'success'
|
95
|
-
}
|
96
|
-
}
|
97
|
-
]
|
98
|
-
}
|
99
|
-
]
|
100
|
-
},
|
101
|
-
{
|
102
|
-
id: 'row2',
|
103
|
-
type: 'row',
|
104
|
-
gutter: 16,
|
105
|
-
template: 'none',
|
106
|
-
children: [
|
107
|
-
{
|
108
|
-
id: 'pageTab',
|
109
|
-
span: '24',
|
110
|
-
type: 'XTab',
|
111
|
-
props: {
|
112
|
-
showTabBar: true,
|
113
|
-
data: [
|
114
|
-
{
|
115
|
-
title: '表单列表',
|
116
|
-
type: 'XFormTable',
|
117
|
-
props: {
|
118
|
-
serviceName: 'af-system',
|
119
|
-
queryParamsName: 'crud_dictionary_manage'
|
120
|
-
}
|
121
|
-
},
|
122
|
-
{
|
123
|
-
title: '新增表单',
|
124
|
-
type: 'XAddNativeForm',
|
125
|
-
props: {
|
126
|
-
serviceName: 'af-system',
|
127
|
-
configName: 'crud_dictionary_manage_add_form'
|
128
|
-
}
|
129
|
-
}
|
130
|
-
],
|
131
|
-
onChange: function (oldKey, newKey, oldTab, newTab) {
|
132
|
-
console.log('Tab changed:', oldKey, newKey)
|
133
|
-
}
|
134
|
-
}
|
135
|
-
}
|
136
|
-
]
|
137
|
-
}
|
138
|
-
]
|
139
|
-
},
|
140
|
-
serviceName: 'af-his'
|
141
|
-
})
|
142
|
-
})
|
143
|
-
</script>
|
144
|
-
|
145
|
-
<template>
|
146
|
-
<div>
|
147
|
-
<x-page-view ref="xPageViewRef"></x-page-view>
|
148
|
-
</div>
|
149
|
-
</template>
|
1
|
+
<script setup>
|
2
|
+
import { onMounted, ref } from 'vue'
|
3
|
+
import XPageView from '@vue2-client/base-client/components/layout/XPageView'
|
4
|
+
|
5
|
+
const xPageViewRef = ref(null)
|
6
|
+
|
7
|
+
onMounted(() => {
|
8
|
+
xPageViewRef.value.init({
|
9
|
+
configValue: {
|
10
|
+
type: 'page',
|
11
|
+
onMounted: function (curr) {
|
12
|
+
console.warn(curr.data)
|
13
|
+
// 设置Tab配置数据
|
14
|
+
curr.data.tabData = {
|
15
|
+
index: 0,
|
16
|
+
items: [
|
17
|
+
// 第一组配置
|
18
|
+
{
|
19
|
+
tabConfigs: [
|
20
|
+
{ title: '表单列表', type: 'XFormTable', props: { serviceName: 'af-system', queryParamsName: 'crud_dictionary_manage' } },
|
21
|
+
{ title: '新增表单', type: 'XAddNativeForm', props: { serviceName: 'af-system', configName: 'crud_dictionary_manage_add_form' } }
|
22
|
+
]
|
23
|
+
},
|
24
|
+
// 第二组配置
|
25
|
+
{
|
26
|
+
tabConfigs: [
|
27
|
+
{ title: '数据列表', type: 'XFormTable', props: { serviceName: 'af-system', queryParamsName: 'crud_dictionary_manage' } },
|
28
|
+
{ title: '编辑表单', type: 'XAddNativeForm', props: { serviceName: 'af-system', configName: 'crud_dictionary_manage_add_form' } },
|
29
|
+
{ title: '查看记录', type: 'XFormTable', props: { serviceName: 'af-system', queryParamsName: 'crud_dictionary_manage' } }
|
30
|
+
]
|
31
|
+
}
|
32
|
+
]
|
33
|
+
}
|
34
|
+
console.log('页面初始化完成,全局数据上下文已创建')
|
35
|
+
},
|
36
|
+
gutter: [16, 16],
|
37
|
+
children: [
|
38
|
+
{
|
39
|
+
id: 'controlRow',
|
40
|
+
type: 'row',
|
41
|
+
gutter: 16,
|
42
|
+
template: 'card',
|
43
|
+
children: [
|
44
|
+
{
|
45
|
+
id: 'buttonContainer',
|
46
|
+
span: '24',
|
47
|
+
type: 'row',
|
48
|
+
gutter: 8,
|
49
|
+
children: [
|
50
|
+
{
|
51
|
+
id: 'reloadButton',
|
52
|
+
span: '6',
|
53
|
+
type: 'a-button',
|
54
|
+
props: {
|
55
|
+
type: 'primary',
|
56
|
+
value: '切换Tab配置'
|
57
|
+
},
|
58
|
+
children: [
|
59
|
+
{
|
60
|
+
type: 'text',
|
61
|
+
text: '切换Tab配置'
|
62
|
+
}
|
63
|
+
],
|
64
|
+
event: {
|
65
|
+
click: function (e, context) {
|
66
|
+
// 切换Tab配置
|
67
|
+
const tabData = context.data.tabData
|
68
|
+
tabData.index = tabData.index === 0 ? 1 : 0
|
69
|
+
|
70
|
+
// 获取当前配置和Tab组件
|
71
|
+
const currentConfig = tabData.items[tabData.index]
|
72
|
+
const tabComponent = context.comps.pageTab
|
73
|
+
|
74
|
+
if (tabComponent) {
|
75
|
+
// 更新Tab组件配置
|
76
|
+
tabComponent.$props.data = currentConfig.tabConfigs
|
77
|
+
console.log('Tab配置已更新,当前配置索引:', tabData.index)
|
78
|
+
|
79
|
+
// 更新状态文本
|
80
|
+
const statusText = context.comps.statusText
|
81
|
+
if (statusText && statusText.$el) {
|
82
|
+
statusText.message = `点击按钮切换不同的Tab配置,当前是第${tabData.index + 1}组配置`
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
},
|
88
|
+
{
|
89
|
+
id: 'statusText',
|
90
|
+
span: '18',
|
91
|
+
type: 'a-alert',
|
92
|
+
props: {
|
93
|
+
message: '点击按钮切换不同的Tab配置,当前是第1组配置',
|
94
|
+
type: 'success'
|
95
|
+
}
|
96
|
+
}
|
97
|
+
]
|
98
|
+
}
|
99
|
+
]
|
100
|
+
},
|
101
|
+
{
|
102
|
+
id: 'row2',
|
103
|
+
type: 'row',
|
104
|
+
gutter: 16,
|
105
|
+
template: 'none',
|
106
|
+
children: [
|
107
|
+
{
|
108
|
+
id: 'pageTab',
|
109
|
+
span: '24',
|
110
|
+
type: 'XTab',
|
111
|
+
props: {
|
112
|
+
showTabBar: true,
|
113
|
+
data: [
|
114
|
+
{
|
115
|
+
title: '表单列表',
|
116
|
+
type: 'XFormTable',
|
117
|
+
props: {
|
118
|
+
serviceName: 'af-system',
|
119
|
+
queryParamsName: 'crud_dictionary_manage'
|
120
|
+
}
|
121
|
+
},
|
122
|
+
{
|
123
|
+
title: '新增表单',
|
124
|
+
type: 'XAddNativeForm',
|
125
|
+
props: {
|
126
|
+
serviceName: 'af-system',
|
127
|
+
configName: 'crud_dictionary_manage_add_form'
|
128
|
+
}
|
129
|
+
}
|
130
|
+
],
|
131
|
+
onChange: function (oldKey, newKey, oldTab, newTab) {
|
132
|
+
console.log('Tab changed:', oldKey, newKey)
|
133
|
+
}
|
134
|
+
}
|
135
|
+
}
|
136
|
+
]
|
137
|
+
}
|
138
|
+
]
|
139
|
+
},
|
140
|
+
serviceName: 'af-his'
|
141
|
+
})
|
142
|
+
})
|
143
|
+
</script>
|
144
|
+
|
145
|
+
<template>
|
146
|
+
<div>
|
147
|
+
<x-page-view ref="xPageViewRef"></x-page-view>
|
148
|
+
</div>
|
149
|
+
</template>
|
@@ -1,24 +1,24 @@
|
|
1
|
-
<template>
|
2
|
-
<!-- 测试界面——测试地址选择新增组件-->
|
3
|
-
<div>
|
4
|
-
<a-button @click="open">打开选择地址弹窗</a-button>
|
5
|
-
<address-select :addressShow="showDialog"/>
|
6
|
-
</div>
|
7
|
-
</template>
|
8
|
-
|
9
|
-
<script>
|
10
|
-
import AddressSelect from '@/pages/addressSelect'
|
11
|
-
|
12
|
-
export default {
|
13
|
-
components: { AddressSelect },
|
14
|
-
data: () => ({
|
15
|
-
showDialog: false
|
16
|
-
}),
|
17
|
-
methods: {
|
18
|
-
open () {
|
19
|
-
console.log('打开选择地址弹窗')
|
20
|
-
this.showDialog = true
|
21
|
-
}
|
22
|
-
}
|
23
|
-
}
|
24
|
-
</script>
|
1
|
+
<template>
|
2
|
+
<!-- 测试界面——测试地址选择新增组件-->
|
3
|
+
<div>
|
4
|
+
<a-button @click="open">打开选择地址弹窗</a-button>
|
5
|
+
<address-select :addressShow="showDialog"/>
|
6
|
+
</div>
|
7
|
+
</template>
|
8
|
+
|
9
|
+
<script>
|
10
|
+
import AddressSelect from '@/pages/addressSelect'
|
11
|
+
|
12
|
+
export default {
|
13
|
+
components: { AddressSelect },
|
14
|
+
data: () => ({
|
15
|
+
showDialog: false
|
16
|
+
}),
|
17
|
+
methods: {
|
18
|
+
open () {
|
19
|
+
console.log('打开选择地址弹窗')
|
20
|
+
this.showDialog = true
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
</script>
|
@@ -43,8 +43,6 @@ routerResource.submitTicket = () => import('@vue2-client/pages/system/ticket')
|
|
43
43
|
routerResource.ServiceReview = () => import('@vue2-client/pages/ServiceReview')
|
44
44
|
// 系统设置
|
45
45
|
routerResource.settings = () => import('@vue2-client/pages/system/settings')
|
46
|
-
// AMIS示例页面
|
47
|
-
routerResource.amisDemo = () => import('@vue2-client/pages/AMisDemo/AMisDemo')
|
48
46
|
// 页面编辑器
|
49
47
|
routerResource.editablePage = () => import('@vue2-client/pages/lowCode/lowCodeEditor.vue')
|
50
48
|
// 数据检索
|
@@ -55,14 +53,14 @@ routerResource.newDynamicStatistics = () => import('@vue2-client/pages/NewDynami
|
|
55
53
|
routerResource.example = {
|
56
54
|
path: 'example',
|
57
55
|
name: '示例主页面',
|
58
|
-
|
56
|
+
component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo2.vue'),
|
59
57
|
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
60
58
|
// component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
|
61
59
|
// component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
|
62
60
|
// component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
|
63
61
|
// component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|
64
62
|
// component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
|
65
|
-
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
63
|
+
// component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
66
64
|
// component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
|
67
65
|
// component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
|
68
66
|
// component: () => import('@vue2-client/base-client/components/common/XRate/demo.vue'),
|
package/src/router.js
CHANGED
@@ -8,8 +8,6 @@ const routes = [
|
|
8
8
|
// 对于每个路由,你都可以使用 'loadView' 方法动态加载对应的组件
|
9
9
|
{ path: '/Tree', component: loadView('Tree') },
|
10
10
|
{ path: '/XStepView', component: loadView('XStepView') },
|
11
|
-
{ path: '/Amis', component: () => import('@vue2-client/pages/AMisDemo/AMisDemo') },
|
12
|
-
{ path: '/Amis2', component: () => import('@vue2-client/pages/AMisDemo/AMisDemo2') },
|
13
11
|
{ path: '/DynamicStatistics', component: () => import('@vue2-client/pages/DynamicStatistics/index') },
|
14
12
|
{ path: '/NewDynamicStatistics', component: () => import('@vue2-client/pages/NewDynamicStatistics/index') },
|
15
13
|
{ path: '/submitTicket', component: () => import('@vue2-client/pages/system/ticket') },
|
package/vue.config.js
CHANGED
@@ -1,263 +0,0 @@
|
|
1
|
-
<template><div ref="domRef">Loading...</div></template>
|
2
|
-
|
3
|
-
<script>
|
4
|
-
// // import 'amis/sdk/sdk.js'
|
5
|
-
// // import 'amis/sdk/sdk.css'
|
6
|
-
// // import 'amis/sdk/iconfont.css'
|
7
|
-
//
|
8
|
-
// // 可以不引用, 如果你不想要任何辅助类样式的话 (比如 `m-t-xs` 这种)
|
9
|
-
// // https://aisuda.bce.baidu.com/amis/zh-CN/style/index
|
10
|
-
// // import 'amis/sdk/helper.css'
|
11
|
-
// import qs from 'qs'
|
12
|
-
// import Vue from 'vue'
|
13
|
-
// import Index from '@vue2-client/base-client/components/index.js'
|
14
|
-
// import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
|
15
|
-
//
|
16
|
-
// let React
|
17
|
-
// let amisLib
|
18
|
-
// let scoped
|
19
|
-
// const apps = {}
|
20
|
-
// function loadScript (src, callback) {
|
21
|
-
// const script = document.createElement('script')
|
22
|
-
// script.setAttribute('type', 'text/javascript')
|
23
|
-
// script.setAttribute('src', src)
|
24
|
-
// script.onload = () => callback()
|
25
|
-
// script.onerror = () => callback(new Error(`Failed to load ${src}`))
|
26
|
-
// document.body.appendChild(script)
|
27
|
-
// }
|
28
|
-
// const vueList = {}
|
29
|
-
//
|
30
|
-
// // eslint-disable-next-line no-unused-vars
|
31
|
-
// function CustomComponent (props, dom) {
|
32
|
-
// const store = Vue.$store
|
33
|
-
// const router = Vue.$router
|
34
|
-
// const i18n = Vue.$i18n
|
35
|
-
// console.log('props', props)
|
36
|
-
// React.useEffect(function () {
|
37
|
-
// vueList[props.$schema.name] = new Vue({
|
38
|
-
// router,
|
39
|
-
// store,
|
40
|
-
// i18n,
|
41
|
-
// render: h => h(Index[props.$schema.type], {
|
42
|
-
// props: props.$schema
|
43
|
-
// })
|
44
|
-
// }).$mount(dom.current)
|
45
|
-
// }, [])
|
46
|
-
// const app = React.createElement('div', {
|
47
|
-
// ref: dom
|
48
|
-
// })
|
49
|
-
// if (apps[props.name] !== undefined) {
|
50
|
-
// const vue = vueList[props.$schema.name]
|
51
|
-
// vue.$children[0].active(props.data)
|
52
|
-
// } else {
|
53
|
-
// apps[props.name] = app
|
54
|
-
// }
|
55
|
-
// return app
|
56
|
-
// }
|
57
|
-
//
|
58
|
-
// function loadStyles (styles) {
|
59
|
-
// for (const path of styles) {
|
60
|
-
// const style = document.createElement('link')
|
61
|
-
// style.setAttribute('rel', 'stylesheet')
|
62
|
-
// style.setAttribute('type', 'text/css')
|
63
|
-
// style.setAttribute('href', path)
|
64
|
-
// document.head.appendChild(style)
|
65
|
-
// }
|
66
|
-
// }
|
67
|
-
// // eslint-disable-next-line no-unused-vars
|
68
|
-
// function appstyle (data) {
|
69
|
-
// console.log('111111111111')
|
70
|
-
// }
|
71
|
-
// // 动态导入组件
|
72
|
-
//
|
73
|
-
// function loadSDK () {
|
74
|
-
// return new Promise((resolve, reject) => {
|
75
|
-
// if (window.amisRequire) {
|
76
|
-
// resolve()
|
77
|
-
// return
|
78
|
-
// }
|
79
|
-
// loadStyles([
|
80
|
-
// '/amis/sdk/sdk.css',
|
81
|
-
// '/amis/sdk/helper.css',
|
82
|
-
// '/amis/sdk/iconfont.css',
|
83
|
-
// ])
|
84
|
-
// loadScript('/amis/sdk/sdk.js', (err) => {
|
85
|
-
// if (err) {
|
86
|
-
// reject(err)
|
87
|
-
// return
|
88
|
-
// }
|
89
|
-
// resolve()
|
90
|
-
// })
|
91
|
-
// })
|
92
|
-
// }
|
93
|
-
//
|
94
|
-
// export default {
|
95
|
-
// name: 'AMISRenderer',
|
96
|
-
// components: {},
|
97
|
-
// props: {
|
98
|
-
// schema: {
|
99
|
-
// type: Object,
|
100
|
-
// default: {
|
101
|
-
// type: 'page',
|
102
|
-
// body: 'Hello World!',
|
103
|
-
// },
|
104
|
-
// },
|
105
|
-
// locals: {
|
106
|
-
// type: Object,
|
107
|
-
// default: () => ({}),
|
108
|
-
// },
|
109
|
-
// props: {
|
110
|
-
// type: Object,
|
111
|
-
// default: () => ({}),
|
112
|
-
// },
|
113
|
-
// env: {
|
114
|
-
// type: Object,
|
115
|
-
// default: () => ({}),
|
116
|
-
// },
|
117
|
-
// },
|
118
|
-
// data () {
|
119
|
-
// const router = this.$router
|
120
|
-
// return {
|
121
|
-
// // 这里面的数据所有 amis 页面都可以获取到
|
122
|
-
// // 可以用来放一下公共数据,比如用户信息等
|
123
|
-
// // 不要放受控数据,受控数据应该通过 data 下发
|
124
|
-
// context: {
|
125
|
-
// siteName: 'AMIS DEMO',
|
126
|
-
// },
|
127
|
-
// get location () {
|
128
|
-
// const current = router.history.current
|
129
|
-
// return {
|
130
|
-
// pathname: current.path,
|
131
|
-
// hash: current.hash,
|
132
|
-
// query: current.query,
|
133
|
-
// search: `?${qs.stringify(current.query)}`,
|
134
|
-
// }
|
135
|
-
// },
|
136
|
-
// loading: false,
|
137
|
-
// amisInstance: null,
|
138
|
-
// unmounted: false,
|
139
|
-
// applist: {}
|
140
|
-
// }
|
141
|
-
// },
|
142
|
-
//
|
143
|
-
// watch: {
|
144
|
-
// locals: function () {
|
145
|
-
// this.updateProps()
|
146
|
-
// },
|
147
|
-
// props: function () {
|
148
|
-
// this.updateProps()
|
149
|
-
// },
|
150
|
-
// $route: function () {
|
151
|
-
// this.updateProps()
|
152
|
-
// },
|
153
|
-
// },
|
154
|
-
// async mounted () {
|
155
|
-
// try {
|
156
|
-
// this.loading = true
|
157
|
-
// await loadSDK()
|
158
|
-
// } finally {
|
159
|
-
// this.loading = false
|
160
|
-
// }
|
161
|
-
// if (this.unmounted) {
|
162
|
-
// return
|
163
|
-
// }
|
164
|
-
// React = window.amisRequire('react')
|
165
|
-
// amisLib = window.amisRequire('amis')
|
166
|
-
// scoped = window.amisRequire('amis/embed')
|
167
|
-
// const { normalizeLink } = amisLib
|
168
|
-
// const router = this.$router
|
169
|
-
// // eslint-disable-next-line no-prototype-builtins
|
170
|
-
// // console.log('this.schema.type', this.schema.type)
|
171
|
-
//
|
172
|
-
// amisLib.Renderer({
|
173
|
-
// test: new RegExp(`(^|\/)${this.schema.type}`)
|
174
|
-
// })(props => CustomComponent(props, this.$el))
|
175
|
-
//
|
176
|
-
// const instance = scoped.embed(
|
177
|
-
// this.$el,
|
178
|
-
// this.schema,
|
179
|
-
// {
|
180
|
-
// data: {
|
181
|
-
// ...this.locals,
|
182
|
-
// },
|
183
|
-
// context: this.context,
|
184
|
-
// location: this.location,
|
185
|
-
//
|
186
|
-
// // todo 下发 location 对象
|
187
|
-
// ...this.props,
|
188
|
-
// },
|
189
|
-
// {
|
190
|
-
// requestAdaptor (api) {
|
191
|
-
// api.headers.Authorization = localStorage.getItem(ACCESS_TOKEN)
|
192
|
-
// return api
|
193
|
-
// },
|
194
|
-
// // 覆盖 amis env
|
195
|
-
// // 参考 https://aisuda.bce.baidu.com/amis/zh-CN/docs/start/getting-started#sdk
|
196
|
-
// jumpTo: (to, action) => {
|
197
|
-
// if (to === 'goBack') {
|
198
|
-
// return router.go(-1)
|
199
|
-
// }
|
200
|
-
//
|
201
|
-
// to = normalizeLink(to, this.location)
|
202
|
-
//
|
203
|
-
// if (action?.actionType === 'url') {
|
204
|
-
// action.blank === false ? router.push(to) : window.open(to)
|
205
|
-
// return
|
206
|
-
// }
|
207
|
-
//
|
208
|
-
// // 主要是支持 nav 中的跳转
|
209
|
-
// if (action && to && action.target) {
|
210
|
-
// window.open(to, action.target)
|
211
|
-
// return
|
212
|
-
// }
|
213
|
-
//
|
214
|
-
// if (/^https?:\/\//.test(to)) {
|
215
|
-
// window.location.replace(to)
|
216
|
-
// } else {
|
217
|
-
// router.push(to)
|
218
|
-
// }
|
219
|
-
// },
|
220
|
-
//
|
221
|
-
// updateLocation: (location, replace) => {
|
222
|
-
// if (location === 'goBack') {
|
223
|
-
// return router.go(-1)
|
224
|
-
// }
|
225
|
-
//
|
226
|
-
// location = normalizeLink(location, this.location)
|
227
|
-
// replace ? router.replace(location) : router.replace(location)
|
228
|
-
// },
|
229
|
-
//
|
230
|
-
// ...this.env,
|
231
|
-
// },
|
232
|
-
// () => {
|
233
|
-
// this.$emit('ready', {
|
234
|
-
// instance,
|
235
|
-
// })
|
236
|
-
// }
|
237
|
-
// )
|
238
|
-
// this.amisInstance = instance
|
239
|
-
// },
|
240
|
-
//
|
241
|
-
// methods: {
|
242
|
-
// updateProps () {
|
243
|
-
// // eslint-disable-next-line no-unused-expressions
|
244
|
-
// this.amisInstance?.updateProps({
|
245
|
-
// data: {
|
246
|
-
// ...this.locals,
|
247
|
-
// },
|
248
|
-
// context: this.context,
|
249
|
-
// ...this.props,
|
250
|
-
// })
|
251
|
-
// },
|
252
|
-
// initConfig () {
|
253
|
-
// console.warn('initConfig')
|
254
|
-
// }
|
255
|
-
// },
|
256
|
-
//
|
257
|
-
// destroyed () {
|
258
|
-
// this.unmounted = true
|
259
|
-
// // eslint-disable-next-line no-unused-expressions
|
260
|
-
// this.amisInstance?.unmount()
|
261
|
-
// },
|
262
|
-
// }
|
263
|
-
</script>
|