vue2-client 1.16.41 → 1.16.43

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,166 +1,166 @@
1
- <template>
2
- <div>
3
- <a-row type="flex" justfy="space-around">
4
- <template v-for="(item, index) in config">
5
- <!-- 展示项 -->
6
- <a-col :key="'col' + index" :span="Math.floor(24 / config.length)">
7
- <div class="item">
8
- <!-- 标题 -->
9
- <p class="label">{{ item.label }}</p>
10
- <!-- 内容 - 进度条 -->
11
- <template v-if="item.type === 'percent'">
12
- <p class="value" :style="'color: ' + determineColor(data[item.key])">{{ data[item.key] }}%</p>
13
- </template>
14
- <!-- 内容 - 非进度条 -->
15
- <template v-else>
16
- <p class="value" :style="item.style ? item.style : ''">{{ data[item.key] }}</p>
17
- </template>
18
- </div>
19
- </a-col>
20
- <!-- 分割线 -->
21
- <a-col :key="'col' + index + 'after'" :span="1" v-if="index !== config.length - 1" class="divider-col">
22
- <a-divider type="vertical" class="divider"/>
23
- </a-col>
24
- </template>
25
- </a-row>
26
- </div>
27
- </template>
28
-
29
- <script>
30
-
31
- import { getConfigByName } from '@vue2-client/services/api/common'
32
-
33
- export default {
34
- name: 'XSimpleDescriptions',
35
- props: {
36
- // 配置
37
- dataConfig: {
38
- type: Array,
39
- default: undefined
40
- },
41
- // 数据
42
- dataContent: {
43
- type: Object,
44
- default: undefined
45
- },
46
- // 配置名
47
- dataConfigName: {
48
- type: String,
49
- default: undefined
50
- },
51
- // 服务名
52
- serviceName: {
53
- type: String,
54
- default: process.env.VUE_APP_SYSTEM_NAME
55
- }
56
- },
57
- data () {
58
- return {
59
- // 配置
60
- config: [],
61
- // 数据
62
- data: {},
63
- }
64
- },
65
- mounted () {
66
- // 初始化配置
67
- if (this.dataConfig) {
68
- this.config = this.dataConfig
69
- } else if (this.dataConfigName) {
70
- getConfigByName(this.dataConfigName, this.serviceName, (res) => {
71
- this.config = res.config
72
- })
73
- } else {
74
- this.config = [
75
- {
76
- label: '未能正确获取配置',
77
- key: 'totalUser'
78
- },
79
- {
80
- label: '未能正确获取配置',
81
- key: 'totalResidentArea'
82
- },
83
- {
84
- label: '未能正确获取配置',
85
- key: 'doneNum'
86
- },
87
- {
88
- label: '未能正确获取配置',
89
- key: 'todoNum'
90
- },
91
- {
92
- label: '未能正确获取配置',
93
- key: 'ratio',
94
- type: 'percent'
95
- }
96
- ]
97
- }
98
-
99
- // 初始化数据
100
- if (this.dataContent) {
101
- this.data = this.dataContent
102
- } else {
103
- this.data = {
104
- totalUser: 0,
105
- totalResidentArea: 0,
106
- doneNum: 0,
107
- todoNum: 0,
108
- ratio: 20
109
- }
110
- }
111
- },
112
- methods: {
113
- // 根据完成率决定颜色
114
- determineColor (ratio) {
115
- let result
116
- if (ratio >= 90) {
117
- result = 'rgb( 1,245, 38 )'
118
- } else if (ratio >= 75) {
119
- result = 'rgb( 139,245, 0)'
120
- } else if (ratio >= 40) {
121
- result = 'rgb(245,163, 0)'
122
- } else if (ratio >= 20) {
123
- result = 'rgb(244, 96, 0)'
124
- } else {
125
- result = 'rgb(255, 0, 0)'
126
- }
127
- return result
128
- }
129
- },
130
- watch: {
131
- dataContent: {
132
- handler (newValue) {
133
- this.data = newValue
134
- },
135
- deep: true
136
- }
137
- }
138
- }
139
- </script>
140
-
141
- <style lang="less" scoped>
142
- .item {
143
- padding: 5%;
144
-
145
- .label {
146
- color: rgba(117, 117, 117, 0.8);
147
- text-align: center;
148
- }
149
-
150
- .value {
151
- color: rgb( 51,157,255 );
152
- font-size: 1.6em;
153
- text-align: center;
154
- }
155
- }
156
-
157
- .divider-col {
158
- display: flex;
159
- justify-content: center;
160
-
161
- .divider {
162
- margin-top: 35%;
163
- height: 40px;
164
- }
165
- }
166
- </style>
1
+ <template>
2
+ <div>
3
+ <a-row type="flex" justfy="space-around">
4
+ <template v-for="(item, index) in config">
5
+ <!-- 展示项 -->
6
+ <a-col :key="'col' + index" :span="Math.floor(24 / config.length)">
7
+ <div class="item">
8
+ <!-- 标题 -->
9
+ <p class="label">{{ item.label }}</p>
10
+ <!-- 内容 - 进度条 -->
11
+ <template v-if="item.type === 'percent'">
12
+ <p class="value" :style="'color: ' + determineColor(data[item.key])">{{ data[item.key] }}%</p>
13
+ </template>
14
+ <!-- 内容 - 非进度条 -->
15
+ <template v-else>
16
+ <p class="value" :style="item.style ? item.style : ''">{{ data[item.key] }}</p>
17
+ </template>
18
+ </div>
19
+ </a-col>
20
+ <!-- 分割线 -->
21
+ <a-col :key="'col' + index + 'after'" :span="1" v-if="index !== config.length - 1" class="divider-col">
22
+ <a-divider type="vertical" class="divider"/>
23
+ </a-col>
24
+ </template>
25
+ </a-row>
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+
31
+ import { getConfigByName } from '@vue2-client/services/api/common'
32
+
33
+ export default {
34
+ name: 'XSimpleDescriptions',
35
+ props: {
36
+ // 配置
37
+ dataConfig: {
38
+ type: Array,
39
+ default: undefined
40
+ },
41
+ // 数据
42
+ dataContent: {
43
+ type: Object,
44
+ default: undefined
45
+ },
46
+ // 配置名
47
+ dataConfigName: {
48
+ type: String,
49
+ default: undefined
50
+ },
51
+ // 服务名
52
+ serviceName: {
53
+ type: String,
54
+ default: process.env.VUE_APP_SYSTEM_NAME
55
+ }
56
+ },
57
+ data () {
58
+ return {
59
+ // 配置
60
+ config: [],
61
+ // 数据
62
+ data: {},
63
+ }
64
+ },
65
+ mounted () {
66
+ // 初始化配置
67
+ if (this.dataConfig) {
68
+ this.config = this.dataConfig
69
+ } else if (this.dataConfigName) {
70
+ getConfigByName(this.dataConfigName, this.serviceName, (res) => {
71
+ this.config = res.config
72
+ })
73
+ } else {
74
+ this.config = [
75
+ {
76
+ label: '未能正确获取配置',
77
+ key: 'totalUser'
78
+ },
79
+ {
80
+ label: '未能正确获取配置',
81
+ key: 'totalResidentArea'
82
+ },
83
+ {
84
+ label: '未能正确获取配置',
85
+ key: 'doneNum'
86
+ },
87
+ {
88
+ label: '未能正确获取配置',
89
+ key: 'todoNum'
90
+ },
91
+ {
92
+ label: '未能正确获取配置',
93
+ key: 'ratio',
94
+ type: 'percent'
95
+ }
96
+ ]
97
+ }
98
+
99
+ // 初始化数据
100
+ if (this.dataContent) {
101
+ this.data = this.dataContent
102
+ } else {
103
+ this.data = {
104
+ totalUser: 0,
105
+ totalResidentArea: 0,
106
+ doneNum: 0,
107
+ todoNum: 0,
108
+ ratio: 20
109
+ }
110
+ }
111
+ },
112
+ methods: {
113
+ // 根据完成率决定颜色
114
+ determineColor (ratio) {
115
+ let result
116
+ if (ratio >= 90) {
117
+ result = 'rgb( 1,245, 38 )'
118
+ } else if (ratio >= 75) {
119
+ result = 'rgb( 139,245, 0)'
120
+ } else if (ratio >= 40) {
121
+ result = 'rgb(245,163, 0)'
122
+ } else if (ratio >= 20) {
123
+ result = 'rgb(244, 96, 0)'
124
+ } else {
125
+ result = 'rgb(255, 0, 0)'
126
+ }
127
+ return result
128
+ }
129
+ },
130
+ watch: {
131
+ dataContent: {
132
+ handler (newValue) {
133
+ this.data = newValue
134
+ },
135
+ deep: true
136
+ }
137
+ }
138
+ }
139
+ </script>
140
+
141
+ <style lang="less" scoped>
142
+ .item {
143
+ padding: 5%;
144
+
145
+ .label {
146
+ color: rgba(117, 117, 117, 0.8);
147
+ text-align: center;
148
+ }
149
+
150
+ .value {
151
+ color: rgb( 51,157,255 );
152
+ font-size: 1.6em;
153
+ text-align: center;
154
+ }
155
+ }
156
+
157
+ .divider-col {
158
+ display: flex;
159
+ justify-content: center;
160
+
161
+ .divider {
162
+ margin-top: 35%;
163
+ height: 40px;
164
+ }
165
+ }
166
+ </style>
@@ -0,0 +1,149 @@
1
+ // 测试配置 - 用于演示混合支付功能
2
+ export const testChargeConfig = {
3
+ "amountFields": [
4
+ {
5
+ "field": 'f_amount',
6
+ "disabled": false,
7
+ "label": '费用总额'
8
+ },
9
+ {
10
+ "field": 'f_insurance_amount',
11
+ "disabled": true,
12
+ "label": '医保支付'
13
+ },
14
+ {
15
+ "field": 'f_self_amount',
16
+ "disabled": true,
17
+ "label": '自费金额'
18
+ },
19
+ {
20
+ "field": 'out_of_pocket_amount',
21
+ "disabled": true,
22
+ "label": '自付金额'
23
+ },
24
+ {
25
+ "field": 'biscount_amount',
26
+ "disabled": true,
27
+ "label": '折扣金额'
28
+ },
29
+ {
30
+ "field": 'billing_amount',
31
+ "disabled": true,
32
+ "label": '记账金额'
33
+ }
34
+ ],
35
+ "paymentMethods": [
36
+ {
37
+ "key": '医保卡',
38
+ "label": '医保卡'
39
+ },
40
+ {
41
+ "key": '微信/支付宝',
42
+ "label": '微信/支付宝'
43
+ },
44
+ {
45
+ "key": '银行卡',
46
+ "label": '银行卡'
47
+ },
48
+ {
49
+ "key": '现金',
50
+ "label": '现金'
51
+ }
52
+ ],
53
+ "bottomFields": [
54
+ {
55
+ "field": 'f_balance',
56
+ "label": '账户余额',
57
+ "disabled": false
58
+ },
59
+ {
60
+ "field": 'received',
61
+ "label": '实收',
62
+ "disabled": false
63
+ },
64
+ {
65
+ "field": 'change',
66
+ "label": '找零',
67
+ "disabled": false
68
+ }
69
+ ],
70
+ "actionButtons": [
71
+ {
72
+ "key": 'charge',
73
+ "label": '收费',
74
+ "icon": 'check'
75
+ },
76
+ {
77
+ "key": 'refund',
78
+ "label": '退费',
79
+ "icon": 'undo'
80
+ },
81
+ {
82
+ "key": 'print',
83
+ "label": '打印',
84
+ "icon": 'printer'
85
+ }
86
+ ],
87
+ "enableMixedPayment": true, // 启用混合支付
88
+ // 可配置事件名,参考 fronImport 风格
89
+ "eventNames": {
90
+ "method": 'method',
91
+ "methods": 'methods',
92
+ "totalPaymentAmount": 'totalPaymentAmount',
93
+ "action": 'action'
94
+ },
95
+ "dataSourceConfig": 'testChargeLogic'
96
+ }
97
+
98
+ // 单选模式测试配置
99
+ export const testSingleChargeConfig = {
100
+ "amountFields": [
101
+ {
102
+ "field": 'f_amount',
103
+ "disabled": false,
104
+ "label": '费用总额'
105
+ },
106
+ {
107
+ "field": 'f_insurance_amount',
108
+ "disabled": true,
109
+ "label": '医保支付'
110
+ }
111
+ ],
112
+ "paymentMethods": [
113
+ {
114
+ "key": '医保卡',
115
+ "label": '医保卡'
116
+ },
117
+ {
118
+ "key": '现金',
119
+ "label": '现金'
120
+ }
121
+ ],
122
+ "bottomFields": [
123
+ {
124
+ "field": 'received',
125
+ "label": '实收',
126
+ "disabled": false
127
+ },
128
+ {
129
+ "field": 'change',
130
+ "label": '找零',
131
+ "disabled": false
132
+ }
133
+ ],
134
+ "actionButtons": [
135
+ {
136
+ "key": 'charge',
137
+ "label": '收费',
138
+ "icon": 'check'
139
+ }
140
+ ],
141
+ "enableMixedPayment": false, // 禁用混合支付(单选模式)
142
+ "eventNames": {
143
+ "method": 'method',
144
+ "methods": 'methods',
145
+ "totalPaymentAmount": 'totalPaymentAmount',
146
+ "action": 'action'
147
+ },
148
+ "dataSourceConfig": 'testChargeLogic'
149
+ }
@@ -153,7 +153,7 @@ export default {
153
153
  const classes = {}
154
154
 
155
155
  const booleanStyleKeys = [
156
- 'description'
156
+ 'description', 'no-padding'
157
157
  ]
158
158
  booleanStyleKeys.forEach(key => {
159
159
  const val = attrs[key]
@@ -476,4 +476,7 @@ export default {
476
476
  }
477
477
  }
478
478
  }
479
+ .xhdesc-no-padding {
480
+ padding: 0px;
481
+ }
479
482
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="x-radio-container">
2
+ <div class="x-radio-container" :class="wrapperClassObject()">
3
3
  <a-radio-group v-model="innerValue" @change="onChange" class="x-radio-group">
4
4
  <div v-for="item in data" :key="item.value" class="x-radio-item-container">
5
5
  <a-radio :value="item.value" class="x-radio-item">
@@ -87,12 +87,25 @@ export default {
87
87
  onChange (e) {
88
88
  this.innerValue = e.target.value
89
89
  this.$emit('change', e.target.value)
90
- }
90
+ },
91
+ wrapperClassObject () {
92
+ const attrs = this.$attrs || {}
93
+ const classes = {}
94
+ const booleanStyleKeys = [
95
+ 'item-0padding'
96
+ ]
97
+ booleanStyleKeys.forEach(key => {
98
+ const val = attrs[key]
99
+ const truthy = val === true || val === '' || val === 'true'
100
+ if (truthy) classes[`x-radio-${key}`] = true
101
+ })
102
+ return classes
103
+ },
91
104
  }
92
105
  }
93
106
  </script>
94
107
 
95
- <style scoped>
108
+ <style scoped lang="less">
96
109
  .x-radio-container {
97
110
  display: flex;
98
111
  flex-direction: column;
@@ -122,4 +135,16 @@ export default {
122
135
  transition: all 0.3s;
123
136
  max-width: 100%;
124
137
  }
138
+ .x-radio-description {
139
+ padding: 4px 4px 4px 4px;
140
+ }
141
+
142
+ .x-radio-item-0padding {
143
+ &.x-radio-container,
144
+ .x-radio-container {
145
+ :deep(.x-radio-item-container) {
146
+ padding: 0px;
147
+ }
148
+ }
149
+ }
125
150
  </style>
@@ -4,6 +4,7 @@
4
4
  v-model="selectedValue"
5
5
  :placeholder="placeholder"
6
6
  class="x-select"
7
+ :class="wrapperClassObject()"
7
8
  :allowClear="true"
8
9
  :showSearch="true"
9
10
  :filter-option="filterOption"
@@ -56,7 +57,20 @@ export default {
56
57
  },
57
58
  filterOption (input, option) {
58
59
  return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
59
- }
60
+ },
61
+ wrapperClassObject () {
62
+ const attrs = this.$attrs || {}
63
+ const classes = {}
64
+ const booleanStyleKeys = [
65
+ 'x-select4'
66
+ ]
67
+ booleanStyleKeys.forEach(key => {
68
+ const val = attrs[key]
69
+ const truthy = val === true || val === '' || val === 'true'
70
+ if (truthy) classes[`x-select-${key}`] = true
71
+ })
72
+ return classes
73
+ },
60
74
  },
61
75
  watch: {
62
76
  selectedValue (val) {
@@ -65,8 +79,13 @@ export default {
65
79
  }
66
80
  </script>
67
81
 
68
- <style scoped>
82
+ <style scoped lang="less">
69
83
  .x-select {
70
84
  min-width: 150px;
71
85
  }
86
+
87
+ .x-select-x-select4 {
88
+ width: 100%;
89
+ min-width: auto;
90
+ }
72
91
  </style>