vue2-client 1.13.19 → 1.13.20

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.13.19",
3
+ "version": "1.13.20",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -1,121 +1,128 @@
1
- <template>
2
- <div class="x-input-wrapper">
3
- <div class="input-container">
4
- <span v-if="config?.label" class="input-label">{{ config.label }}</span>
5
- <div class="input-wrapper">
6
- <a-input
7
- v-model="innerValue"
8
- v-bind="$attrs"
9
- :placeholder="config?.placeholder"
10
- :size="config?.size"
11
- :maxLength="config?.maxLength"
12
- :disabled="config?.disabled"
13
- :allowClear="config?.allowClear"
14
- @change="handleInput"
15
- @pressEnter="handleSearch"
16
- >
17
- <template v-if="config?.prefix" #prefix>
18
- <a-icon :type="config.prefix" @click="handleSearch" class="clickable-icon" />
19
- </template>
20
- <template v-if="config?.suffix" #suffix>
21
- <a-icon :type="config.suffix" @click="handleSearch" class="clickable-icon" />
22
- </template>
23
- </a-input>
24
- </div>
25
- </div>
26
- </div>
27
- </template>
28
-
29
- <script>
30
- import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
31
-
32
- export default {
33
- name: 'XInput',
34
- inheritAttrs: false,
35
- props: {
36
- value: {
37
- type: [String, Number],
38
- default: ''
39
- },
40
- queryParamsName: {
41
- type: String,
42
- default: ''
43
- }
44
- },
45
- data () {
46
- return {
47
- innerValue: this.value || '',
48
- config: null
49
- }
50
- },
51
- created () {
52
- this.getData(this.queryParamsName)
53
- },
54
- emits: ['search'],
55
- methods: {
56
- runLogic,
57
- async getData (data) {
58
- getConfigByName(data, 'af-his', res => {
59
- this.config = res
60
- if (res.defaultValue !== undefined) {
61
- this.innerValue = res.defaultValue
62
- }
63
- })
64
- },
65
- handleInput (e) {
66
- const value = e.target.value
67
- this.innerValue = value
68
- this.$emit('search', value)
69
- },
70
- handleSearch () {
71
- // 统一的搜索事件:将当前输入值发送给父组件
72
- this.$emit('search', this.innerValue)
73
- }
74
- },
75
- watch: {
76
- value: {
77
- handler (newValue) {
78
- this.innerValue = newValue
79
- },
80
- immediate: true
81
- },
82
- queryParamsName: {
83
- handler (newValue) {
84
- this.getData(newValue)
85
- },
86
- deep: true
87
- }
88
- }
89
- }
90
- </script>
91
-
92
- <style scoped>
93
- .x-input-wrapper {
94
- position: relative;
95
- display: inline-block;
96
- width: 100%;
97
- }
98
-
99
- .input-container {
100
- display: flex;
101
- align-items: center;
102
- }
103
-
104
- .input-label {
105
- white-space: nowrap;
106
- color: rgba(0, 0, 0, 0.85);
107
- padding-right: 8px; /* 标签右侧固定间距 */
108
- }
109
-
110
- .input-wrapper {
111
- flex: 1; /* 输入框占据剩余空间 */
112
- }
113
-
114
- :deep(.clickable-icon) {
115
- cursor: pointer;
116
- }
117
-
118
- :deep(.clickable-icon:hover) {
119
- color: #1890ff;
120
- }
121
- </style>
1
+ <template>
2
+ <div class="x-input-wrapper">
3
+ <div class="input-container">
4
+ <span v-if="config?.label" class="input-label">{{ config.label }}</span>
5
+ <div class="input-wrapper">
6
+ <a-input
7
+ v-model="innerValue"
8
+ v-bind="$attrs"
9
+ :placeholder="config?.placeholder"
10
+ :size="config?.size"
11
+ :maxLength="config?.maxLength"
12
+ :disabled="config?.disabled"
13
+ :allowClear="config?.allowClear"
14
+ @change="handleInput"
15
+ @pressEnter="handleSearch"
16
+ >
17
+ <template v-if="config?.prefix" #prefix>
18
+ <a-icon :type="config.prefix" @click="handleSearch" class="clickable-icon" />
19
+ </template>
20
+ <template v-if="config?.suffix" #suffix>
21
+ <a-icon :type="config.suffix" @click="handleSearch" class="clickable-icon" />
22
+ </template>
23
+ </a-input>
24
+ </div>
25
+ <span v-if="config?.tail" class="input-tail">{{ config.tail }}</span>
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
32
+
33
+ export default {
34
+ name: 'XInput',
35
+ inheritAttrs: false,
36
+ props: {
37
+ value: {
38
+ type: [String, Number],
39
+ default: ''
40
+ },
41
+ queryParamsName: {
42
+ type: String,
43
+ default: ''
44
+ }
45
+ },
46
+ data () {
47
+ return {
48
+ innerValue: this.value || '',
49
+ config: null
50
+ }
51
+ },
52
+ created () {
53
+ this.getData(this.queryParamsName)
54
+ },
55
+ emits: ['search'],
56
+ methods: {
57
+ runLogic,
58
+ async getData (data) {
59
+ getConfigByName(data, 'af-his', res => {
60
+ this.config = res
61
+ if (res.defaultValue !== undefined) {
62
+ this.innerValue = res.defaultValue
63
+ }
64
+ })
65
+ },
66
+ handleInput (e) {
67
+ const value = e.target.value
68
+ this.innerValue = value
69
+ this.$emit('search', value)
70
+ },
71
+ handleSearch () {
72
+ // 统一的搜索事件:将当前输入值发送给父组件
73
+ this.$emit('search', this.innerValue)
74
+ }
75
+ },
76
+ watch: {
77
+ value: {
78
+ handler (newValue) {
79
+ this.innerValue = newValue
80
+ },
81
+ immediate: true
82
+ },
83
+ queryParamsName: {
84
+ handler (newValue) {
85
+ this.getData(newValue)
86
+ },
87
+ deep: true
88
+ }
89
+ }
90
+ }
91
+ </script>
92
+
93
+ <style scoped>
94
+ .x-input-wrapper {
95
+ position: relative;
96
+ display: inline-block;
97
+ width: 100%;
98
+ }
99
+
100
+ .input-container {
101
+ display: flex;
102
+ align-items: center;
103
+ }
104
+
105
+ .input-label {
106
+ white-space: nowrap;
107
+ color: rgba(0, 0, 0, 0.85);
108
+ padding-right: 8px; /* 标签右侧固定间距 */
109
+ }
110
+
111
+ .input-label {
112
+ white-space: nowrap;
113
+ color: rgba(0, 0, 0, 0.85);
114
+ padding-left: 4px; /* 标签左侧固定间距 */
115
+ }
116
+
117
+ .input-wrapper {
118
+ flex: 1; /* 输入框占据剩余空间 */
119
+ }
120
+
121
+ :deep(.clickable-icon) {
122
+ cursor: pointer;
123
+ }
124
+
125
+ :deep(.clickable-icon:hover) {
126
+ color: #1890ff;
127
+ }
128
+ </style>
@@ -13,16 +13,18 @@ XInput 是一个封装了 Ant Design Vue 的输入框组件,提供搜索功能
13
13
 
14
14
  组件通过 `queryParamsName` 属性获取配置,配置内容如下:
15
15
 
16
- | 参数 | 说明 | 类型 | 默认值 |
17
- | --- | --- | --- | --- |
18
- | size | 输入框大小 | string | 'default' |
19
- | prefix | 前缀图标类型 | string | '' |
20
- | defaultValue | 默认值 | string/number | '' |
21
- | disabled | 是否禁用 | boolean | false |
22
- | placeholder | 占位文本 | string | '' |
23
- | allowClear | 是否允许清除 | boolean | true |
24
- | suffix | 后缀图标类型 | string | 'search' |
25
- | maxLength | 最大输入长度 | number | 50 |
16
+ | 参数 | 说明 | 类型 | 默认值 |
17
+ |--------------|--------|---------------| --- |
18
+ | size | 输入框大小 | string | 'default' |
19
+ | prefix | 前缀图标类型 | string | '' |
20
+ | defaultValue | 默认值 | string/number | '' |
21
+ | disabled | 是否禁用 | boolean | false |
22
+ | placeholder | 占位文本 | string | '' |
23
+ | allowClear | 是否允许清除 | boolean | true |
24
+ | suffix | 后缀图标类型 | string | 'search' |
25
+ | maxLength | 最大输入长度 | number | 50 |
26
+ | label | 输入框前文字 | String | '' |
27
+ | tail | 输入框后文字 | String | '' |
26
28
 
27
29
  ## 事件
28
30
 
@@ -36,8 +38,8 @@ XInput 是一个封装了 Ant Design Vue 的输入框组件,提供搜索功能
36
38
 
37
39
  ```vue
38
40
  <template>
39
- <x-input
40
- v-model="searchValue"
41
+ <x-input
42
+ v-model="searchValue"
41
43
  @search="handleSearch"
42
44
  />
43
45
  </template>
@@ -80,8 +82,8 @@ export default {
80
82
 
81
83
  ```vue
82
84
  <template>
83
- <x-input
84
- v-model="searchValue"
85
+ <x-input
86
+ v-model="searchValue"
85
87
  query-params-name="customInputConfig"
86
88
  @search="handleSearch"
87
89
  />
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <a-card :bordered="false">
3
- <a-tabs :tabBarGutter="10" :activeKey="activeKey" @change="tabPaneChange">
3
+ <a-tabs :tabBarGutter="10" :activeKey="activeKey" @change="tabPaneChange" :hideAdd="true" :tabBarStyle="{ display: showTabBar ? 'block' : 'none' }">
4
4
  <a-tab-pane
5
5
  :forceRender="true"
6
6
  v-for="(tab, index) in config.data"
@@ -50,7 +50,8 @@ export default {
50
50
  activeKey: 0,
51
51
  // 配置
52
52
  config: undefined,
53
- attr: {}
53
+ attr: {},
54
+ showTabBar: true // 默认显示页签
54
55
  }
55
56
  },
56
57
  computed: {
@@ -133,11 +134,15 @@ export default {
133
134
  this.getConfig()
134
135
  } else if (this.localConfig) {
135
136
  this.config = this.localConfig
137
+ // 设置是否显示页签
138
+ this.showTabBar = this.localConfig.showTabBar !== false
136
139
  }
137
140
  },
138
141
  getConfig () {
139
142
  getConfigByName(this.configName, this.serverName, res => {
140
143
  this.config = res
144
+ // 设置是否显示页签
145
+ this.showTabBar = res.showTabBar !== false
141
146
  }, this.env === 'dev')
142
147
  },
143
148
  getEventHandlers (tab, index) {