vue2-client 1.15.12 → 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.
@@ -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
- // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo2.vue'),
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') },
@@ -246,9 +246,20 @@ export class IndexedDBManager {
246
246
  // 再检查IndexedDB缓存
247
247
  const data = DB_CONFIG.NAME === LIULI_WEB_DB_NAME ? undefined : await this.getData(key)
248
248
 
249
+ if (data && data.ERROR) {
250
+ console.error(`获取配置失败:` + data.ERROR)
251
+ }
252
+
249
253
  if (!data && url) {
250
254
  // 缓存未命中,请求网络数据
251
- const res = await post(url, params)
255
+ let res
256
+ try {
257
+ res = await post(url, params)
258
+ } catch (e) {
259
+ res = {
260
+ ERROR: e
261
+ }
262
+ }
252
263
  const processedData = processFun ? processFun(res) : res
253
264
 
254
265
  // 同时保存到内存缓存
@@ -270,7 +281,7 @@ export class IndexedDBManager {
270
281
  callback(data)
271
282
  }
272
283
  } catch (error) {
273
- console.error(`[getByWeb] 获取数据失败: ${error.message}`)
284
+ console.error(`[getByWeb] 获取数据失败`, error)
274
285
 
275
286
  // IndexedDB操作失败时切换到备用方案
276
287
  if (error.name === 'InvalidStateError' || error.message?.includes('database') || error.message?.includes('transaction')) {
package/vue.config.js CHANGED
@@ -163,9 +163,6 @@ module.exports = {
163
163
  }))
164
164
 
165
165
  config.plugins.push(
166
- // new CopyPlugin({
167
- // patterns: [{ from: 'node_modules/amis/sdk', to: 'amis/sdk' }],
168
- // })
169
166
  )
170
167
 
171
168
  // 生产环境下将资源压缩成gzip格式
@@ -1,3 +0,0 @@
1
- import AMisRender from './index.vue'
2
-
3
- export default AMisRender