vue2-client 1.14.50 → 1.14.51

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,86 +1,76 @@
1
- <template>
2
- <a-card :bordered="false">
3
- <x-form-table
4
- title="示例表单"
5
- :queryParamsName="queryParamsName"
6
- :fixedAddForm="fixedAddForm"
7
- :externalSelectedRowKeys="selectedKeys"
8
- @action="action"
9
- @selectRow="selectRow"
10
- @columnClick="columnClick"
11
- ref="xFormTable">
12
- </x-form-table>
13
- </a-card>
14
- </template>
15
-
16
- <script>
17
- import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
18
- import { microDispatch } from '@vue2-client/utils/microAppUtils'
19
-
20
- export default {
21
- name: 'Demo',
22
- components: {
23
- XFormTable
24
- },
25
- data () {
26
- return {
27
- // 查询配置文件名
28
- queryParamsName: 'userInfosCRUD',
29
- // 新增表单固定值
30
- fixedAddForm: {},
31
- // 是否显示详情抽屉
32
- detailVisible: false,
33
- // 当前记录
34
- record: {},
35
- // 选中的行keys
36
- selectedKeys: ['813200000004', '72547', '72455', '72451'],
37
- selected: {
38
- keys: [],
39
- rows: []
40
- }
41
- }
42
- },
43
- methods: {
44
- test () {
45
- this.$refs.xFormTable.setTableData([])
46
- },
47
- defaultF () {
48
- this.$refs.xFormTable.setTableSize('default')
49
- },
50
- middleF () {
51
- this.$refs.xFormTable.setTableSize('middle')
52
- },
53
- smallF () {
54
- this.$refs.xFormTable.setTableSize('small')
55
- },
56
- columnClick (key, value, record) {
57
- microDispatch({
58
- type: 'v3route',
59
- path: '/bingliguanli/dianzibingliluru',
60
- props: { selected: arguments[0].his_f_admission_id }
61
- })
62
- },
63
- action (record, id, actionType) {
64
- this.detailVisible = true
65
- console.log('触发了详情操作', record, id, actionType)
66
- },
67
- onClose () {
68
- this.detailVisible = false
69
- // 关闭详情之后重新查询表单
70
- this.$refs.xFormTable.refreshTable(true)
71
- },
72
- selectRow (selectedRowKeys, selectedRows) {
73
- this.selected = {
74
- keys: selectedRowKeys,
75
- rows: selectedRows
76
- }
77
- console.log('selected', this.selected)
78
- },
79
- },
80
- computed: {},
81
- }
82
- </script>
83
-
84
- <style scoped>
85
-
86
- </style>
1
+ <template>
2
+ <a-card :bordered="false">
3
+ <a-button @click="()=>{queryParamsName = 'crud_device_realtime_upload_物联网流量计'}">测试1</a-button>
4
+ <a-button @click="()=>{queryParamsName = 'crud_device_realtime_upload_LaiDe_TiaoYaXiang'}">测试2</a-button>
5
+ <a-button @click="test()">测试3</a-button>
6
+ <x-form-table
7
+ title="示例表单"
8
+ :queryParamsName="queryParamsName"
9
+ :fixedAddForm="fixedAddForm"
10
+ @action="action"
11
+ @columnClick="columnClick"
12
+ ref="xFormTable">
13
+ </x-form-table>
14
+ </a-card>
15
+ </template>
16
+
17
+ <script>
18
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
19
+ import { microDispatch } from '@vue2-client/utils/microAppUtils'
20
+
21
+ export default {
22
+ name: 'Demo',
23
+ components: {
24
+ XFormTable
25
+ },
26
+ data () {
27
+ return {
28
+ // 查询配置文件名
29
+ queryParamsName: 'ChargeQueryCRUD',
30
+ // 查询配置左侧tree
31
+ xTreeConfigName: 'addressType',
32
+ // 新增表单固定值
33
+ fixedAddForm: {},
34
+ // 是否显示详情抽屉
35
+ detailVisible: false,
36
+ // 当前记录
37
+ record: {}
38
+ }
39
+ },
40
+ methods: {
41
+ test () {
42
+ this.$refs.xFormTable.setTableData([])
43
+ },
44
+ defaultF () {
45
+ this.$refs.xFormTable.setTableSize('default')
46
+ },
47
+ middleF () {
48
+ this.$refs.xFormTable.setTableSize('middle')
49
+ },
50
+ smallF () {
51
+ this.$refs.xFormTable.setTableSize('small')
52
+ },
53
+ columnClick (key, value, record) {
54
+ microDispatch({
55
+ type: 'v3route',
56
+ path: '/bingliguanli/dianzibingliluru',
57
+ props: { selected: arguments[0].his_f_admission_id }
58
+ })
59
+ },
60
+ action (record, id, actionType) {
61
+ this.detailVisible = true
62
+ console.log('触发了详情操作', record, id, actionType)
63
+ },
64
+ onClose () {
65
+ this.detailVisible = false
66
+ // 关闭详情之后重新查询表单
67
+ this.$refs.xFormTable.refreshTable(true)
68
+ }
69
+ },
70
+ computed: {},
71
+ }
72
+ </script>
73
+
74
+ <style scoped>
75
+
76
+ </style>
@@ -1,15 +1,16 @@
1
1
  <template>
2
- <a-card :bordered="false">
3
- <a-tabs :tabBarGutter="10" :activeKey="activeKey" @change="tabPaneChange" :hideAdd="true" :tabBarStyle="{ display: showTabBar ? 'block' : 'none' }">
2
+ <a-card :bordered="false" :body-style="bodyStyle">
3
+ <a-tabs :tabBarGutter="tabBarGutter" :activeKey="activeKey" @change="tabPaneChange" :hideAdd="true" :tabBarStyle="{ display: showTabBar ? 'block' : 'none' }">
4
+ <slot name="extraBeforeTabs"></slot>
4
5
  <a-tab-pane
5
6
  :forceRender="true"
6
7
  v-for="(tab, index) in config.data"
7
- :key="index"
8
+ :key="'xTabPane' + index"
8
9
  :tab="tab.title"
9
10
  >
10
11
  <component
11
12
  :is="tab.slotType"
12
- :key="index"
13
+ :key="'xTabPane' + index"
13
14
  :ref="`tab_com_${tab.slotType}_${index}`"
14
15
  :serviceName="tab.serviceName"
15
16
  :serverName="tab.serviceName"
@@ -57,6 +58,9 @@ export default {
57
58
  computed: {
58
59
  ...mapState('account', { currUser: 'user' })
59
60
  },
61
+ mounted () {
62
+ this.activeKey = this.defaultActiveKey
63
+ },
60
64
  methods: {
61
65
  // 自定义函数中调用的方法 这个不能删
62
66
  getWindow,
@@ -211,6 +215,20 @@ export default {
211
215
  type: Object,
212
216
  default: undefined
213
217
  },
218
+ tabBarGutter: {
219
+ type: Number,
220
+ default: 10
221
+ },
222
+ bodyStyle: {
223
+ type: Object,
224
+ default: () => {
225
+ return {}
226
+ }
227
+ },
228
+ defaultActiveKey: {
229
+ type: String,
230
+ default: 'xTabPane0'
231
+ },
214
232
  },
215
233
  watch: {
216
234
  configName: {
@@ -232,7 +250,4 @@ export default {
232
250
  }
233
251
  </script>
234
252
  <style scoped>
235
- :deep(.ant-tabs-bar) {
236
- margin: 0
237
- }
238
253
  </style>