vue2-client 1.12.83 → 1.12.87

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,90 +1,90 @@
1
- <template>
2
- <div class="list-wrapper" >
3
- <a-list size="large" :data-source="data" itemLayout="horizontal" class="list-container" ref="listRef">
4
- <a-list-item slot="renderItem" slot-scope="item, index" class="list-item" @click="handleClick(index)">
5
- {{ item.number }} {{ item.name }}
6
- </a-list-item>
7
- </a-list>
8
- </div>
9
- </template>
10
-
11
- <script>
12
-
13
- import { runLogic } from '@vue2-client/services/api/common'
14
-
15
- export default {
16
- name: 'XList',
17
- props: {
18
- queryParamsName: {
19
- type: Object,
20
- default: 'outpatientWaitLogic'
21
- },
22
- },
23
- inject: ['getComponentByName'],
24
- data () {
25
- return {
26
- data: []
27
- }
28
- },
29
- created () {
30
- this.getData(this.queryParamsName)
31
- },
32
- methods: {
33
- async getData (config) {
34
- runLogic(config, {}, 'af-his').then(res => {
35
- this.data = res
36
- })
37
- },
38
- handleClick (index) {
39
- this.$emit('listClick', this.data[index])
40
- },
41
- refreshList () {
42
- this.getData(this.queryParamsName)
43
- },
44
-
45
- }
46
- }
47
- </script>
48
-
49
- <style scoped>
50
- .list-wrapper {
51
- max-height: 240px;
52
- overflow-y: auto;
53
- cursor: pointer;
54
- padding-right: 2px;
55
- }
56
-
57
- .list-container {
58
- width: 100%;
59
- }
60
-
61
- .list-item {
62
- height: 35px;
63
- border-radius: 6px;
64
- background-color: #F4F4F4;
65
- padding: 8px 15px 7px 15px;
66
- font-size: 16px;
67
- display: flex;
68
- align-items: center;
69
- width: 100%;
70
- border: 1px solid #D9D9D9;
71
- box-sizing: border-box;
72
- margin-bottom: 16px;
73
- white-space: nowrap;
74
- overflow: clip;
75
- }
76
-
77
- /* 自定义滚动条样式 */
78
- .list-wrapper::-webkit-scrollbar {
79
- width: 6px;
80
- }
81
-
82
- .list-wrapper::-webkit-scrollbar-thumb {
83
- background-color: #d9d9d9;
84
- border-radius: 3px;
85
- }
86
-
87
- .list-wrapper::-webkit-scrollbar-track {
88
- background-color: #f0f0f0;
89
- }
90
- </style>
1
+ <template>
2
+ <div class="list-wrapper" >
3
+ <a-list size="large" :data-source="data" itemLayout="horizontal" class="list-container" ref="listRef">
4
+ <a-list-item slot="renderItem" slot-scope="item, index" class="list-item" @click="handleClick(index)">
5
+ {{ item.number }} {{ item.name }}
6
+ </a-list-item>
7
+ </a-list>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+
13
+ import { runLogic } from '@vue2-client/services/api/common'
14
+
15
+ export default {
16
+ name: 'XList',
17
+ props: {
18
+ queryParamsName: {
19
+ type: Object,
20
+ default: 'outpatientWaitLogic'
21
+ },
22
+ },
23
+ inject: ['getComponentByName'],
24
+ data () {
25
+ return {
26
+ data: []
27
+ }
28
+ },
29
+ created () {
30
+ this.getData(this.queryParamsName)
31
+ },
32
+ methods: {
33
+ async getData (config) {
34
+ runLogic(config, {}, 'af-his').then(res => {
35
+ this.data = res
36
+ })
37
+ },
38
+ handleClick (index) {
39
+ this.$emit('listClick', this.data[index])
40
+ },
41
+ refreshList () {
42
+ this.getData(this.queryParamsName)
43
+ },
44
+
45
+ }
46
+ }
47
+ </script>
48
+
49
+ <style scoped>
50
+ .list-wrapper {
51
+ max-height: 240px;
52
+ overflow-y: auto;
53
+ cursor: pointer;
54
+ padding-right: 2px;
55
+ }
56
+
57
+ .list-container {
58
+ width: 100%;
59
+ }
60
+
61
+ .list-item {
62
+ height: 35px;
63
+ border-radius: 6px;
64
+ background-color: #F4F4F4;
65
+ padding: 8px 15px 7px 15px;
66
+ font-size: 16px;
67
+ display: flex;
68
+ align-items: center;
69
+ width: 100%;
70
+ border: 1px solid #D9D9D9;
71
+ box-sizing: border-box;
72
+ margin-bottom: 16px;
73
+ white-space: nowrap;
74
+ overflow: clip;
75
+ }
76
+
77
+ /* 自定义滚动条样式 */
78
+ .list-wrapper::-webkit-scrollbar {
79
+ width: 6px;
80
+ }
81
+
82
+ .list-wrapper::-webkit-scrollbar-thumb {
83
+ background-color: #d9d9d9;
84
+ border-radius: 3px;
85
+ }
86
+
87
+ .list-wrapper::-webkit-scrollbar-track {
88
+ background-color: #f0f0f0;
89
+ }
90
+ </style>
@@ -1,50 +1,66 @@
1
- <template>
2
- <div>
3
- <a-radio-group v-model="innerValue" @change="onChange">
4
- <a-radio v-for="item in data" :key="item.value" :value="item.value">
5
- {{ item.label }}
6
- </a-radio>
7
- </a-radio-group>
8
- </div>
9
- </template>
10
-
11
- <script>
12
- import { getConfigByName } from '@vue2-client/services/api/common'
13
-
14
- export default {
15
- name: 'XRadio',
16
- inject: ['getComponentByName'],
17
- props: {
18
- queryParamsName: {
19
- type: Object,
20
- default: null
21
- },
22
- value: [String, Number]
23
- },
24
- data () {
25
- return {
26
- data: [],
27
- innerValue: null
28
- }
29
- },
30
- created () {
31
- this.getData(this.queryParamsName)
32
- },
33
- watch: {
34
- value (val) {
35
- this.innerValue = val
36
- }
37
- },
38
- methods: {
39
- async getData (data) {
40
- getConfigByName(data, 'af-his', res => {
41
- console.warn(res.radio)
42
- this.data = res.radio
43
- })
44
- },
45
- onChange (e) {
46
- this.$emit('radio', e.target.value)
47
- }
48
- }
49
- }
50
- </script>
1
+ <template>
2
+ <div>
3
+ <a-radio-group v-model="innerValue" @change="onChange">
4
+ <a-radio v-for="item in data" :key="item.value" :value="item.value">
5
+ {{ item.label }}
6
+ </a-radio>
7
+ </a-radio-group>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ import { getConfigByName } from '@vue2-client/services/api/common'
13
+
14
+ export default {
15
+ name: 'XRadio',
16
+ inject: ['getComponentByName'],
17
+ props: {
18
+ queryParamsName: {
19
+ type: Object,
20
+ default: null
21
+ },
22
+ value: [String, Number]
23
+ },
24
+ data () {
25
+ return {
26
+ data: [],
27
+ innerValue: null
28
+ }
29
+ },
30
+ created () {
31
+ this.getData(this.queryParamsName)
32
+ },
33
+ watch: {
34
+ value (val) {
35
+ this.innerValue = val
36
+ }
37
+ },
38
+ emits: ['change', 'init'],
39
+ methods: {
40
+ async getData (data) {
41
+ getConfigByName(data, 'af-his', res => {
42
+ // 1. 先加载选项
43
+ if (res.radio && Array.isArray(res.radio)) {
44
+ this.data = res.radio
45
+ // 2. 初始化默认值(优先级: 配置defaultValue > 第一个选项)
46
+ if (res.defaultValue !== undefined && res.defaultValue !== null) {
47
+ // 否则使用配置中的defaultValue
48
+ this.innerValue = res.defaultValue
49
+ } else if (this.data.length > 0) {
50
+ // 如果没有默认值但有选项,使用第一个选项
51
+ this.innerValue = this.data[0].value
52
+ }
53
+ // 3. 触发初始化事件
54
+ this.$emit('init', this.innerValue)
55
+ } else {
56
+ this.$message.error('配置错误,radio字段不是数组')
57
+ }
58
+ })
59
+ },
60
+ onChange (e) {
61
+ this.innerValue = e.target.value
62
+ this.$emit('change', e.target.value)
63
+ }
64
+ }
65
+ }
66
+ </script>
@@ -0,0 +1,106 @@
1
+ # XRadio
2
+
3
+ 基于配置的单选组件,支持从配置中动态加载选项和默认值。
4
+
5
+ ## 何时使用
6
+
7
+ 当需要一个通过配置动态加载的单选控件时使用,特别是选项需要从后端获取的场景。
8
+
9
+ ## 引用方式
10
+
11
+ ```javascript
12
+ import XRadio from '@vue2-client/base-client/components/his/XRadio/XRadio'
13
+
14
+ export default {
15
+ components: {
16
+ XRadio
17
+ }
18
+ }
19
+ ```
20
+
21
+ ## 代码演示
22
+
23
+ ```html
24
+ <x-radio
25
+ :queryParamsName="radioConfigName"
26
+ @change="handleChange"
27
+ @init="handleInit">
28
+ </x-radio>
29
+ ```
30
+
31
+ ## API
32
+
33
+ | 参数 | 说明 | 类型 | 默认值 |
34
+ |-----------------|----------------------|-------------------|------|
35
+ | queryParamsName | 查询配置名称 | String/Object | null |
36
+ | value | 当前选中值(可用于外部控制) | String/Number | null |
37
+
38
+ ### 事件
39
+
40
+ | 事件名 | 说明 | 回调参数 |
41
+ |--------|--------------|-----------------------------------------------|
42
+ | change | 选项变化时的回调 | function(value) |
43
+ | radio | 选项变化时的回调(兼容) | function(value) |
44
+ | init | 组件初始化完成时的回调 | function({config, options, value}) |
45
+
46
+ ### 配置说明
47
+
48
+ 组件通过 `queryParamsName` 从后端获取配置,配置格式如下:
49
+
50
+ ```json
51
+ {
52
+ "radio": [
53
+ {
54
+ "label": "选项A",
55
+ "value": 1
56
+ },
57
+ {
58
+ "label": "选项B",
59
+ "value": 2
60
+ },
61
+ {
62
+ "label": "选项C",
63
+ "value": 3
64
+ },
65
+ {
66
+ "label": "选项D",
67
+ "value": 4
68
+ }
69
+ ],
70
+ "defaultValue": 2
71
+ }
72
+ ```
73
+
74
+ ## 配置示例
75
+ ----
76
+
77
+ ```json
78
+ {
79
+ "radio": [
80
+ {
81
+ "label": "A",
82
+ "value": 1
83
+ },
84
+ {
85
+ "label": "B",
86
+ "value": 2
87
+ },
88
+ {
89
+ "label": "C",
90
+ "value": 3
91
+ },
92
+ {
93
+ "label": "D",
94
+ "value": 4
95
+ }
96
+ ],
97
+ "defaultValue": 2
98
+ }
99
+ ```
100
+
101
+ 注意事项
102
+ ----
103
+
104
+ 1. 如果配置中有 `defaultValue`,组件将默认选中该值对应的选项
105
+ 2. 如果没有 `defaultValue` 但有选项,将默认选中第一个选项
106
+ 3. 如果外部通过 `value` 属性传入值,优先使用外部值
@@ -0,0 +1,130 @@
1
+ <template>
2
+ <div>
3
+ <div class="filter-bar">
4
+ <a-date-picker v-model="upload_date" placeholder="上传日期" @change="selfSearch" />
5
+ <a-select
6
+ style="width: 200px;"
7
+ v-model="fusetype"
8
+ :options="fusetypes"
9
+ placeholder="分类"
10
+ @change="selfSearch"
11
+ allow-clear />
12
+ <a-button type="primary" @click="selfSearch">查询</a-button>
13
+ </div>
14
+ <a-list bordered>
15
+ <a-list-item v-for="item in files" :key="item.days">
16
+ <div class="file-group">
17
+ <h4>{{ item.days }}</h4>
18
+ <div class="file-items">
19
+ <div v-for="file in item.arrays" :key="file.id" class="file-card">
20
+ <img :src="file.f_downloadpath" class="file-image" v-if="file.f_filetype.includes('jpg') || file.f_filetype.includes('png')" />
21
+ <p>上传时间: {{ file.f_uploaddate }}</p>
22
+ <p>操作员: {{ file.f_username }}</p>
23
+ <p>分类: {{ file.fusetype }}</p>
24
+ <p>说明: {{ file.fremarks }}</p>
25
+ <a :href="file.f_downloadpath" target="_blank">预览</a>
26
+ <a-button v-if="isDelete === '1'" @click="delet(file.id)">删除</a-button>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </a-list-item>
31
+ </a-list>
32
+ </div>
33
+ </template>
34
+
35
+ <script>
36
+ import { post } from '@vue2-client/services/api'
37
+ export default {
38
+ props: {
39
+ currUserInfo: {
40
+ type: Object,
41
+ default: () => undefined
42
+ }
43
+ },
44
+ data () {
45
+ return {
46
+ upload_date: null,
47
+ fusetype: null,
48
+ files: [],
49
+ fusetypes: [],
50
+ isDelete: '0'
51
+ }
52
+ },
53
+ methods: {
54
+ async getfusetypes () {
55
+ this.fusetypes = [{ label: '全部', value: '' }]
56
+ const res = await post('rs/sql/singleTable_OrderBy', {
57
+ data: {
58
+ items: 'fusetype',
59
+ tablename: 't_files',
60
+ condition: `fusetype is not null GROUP BY fusetype`,
61
+ orderitem: 'fusetype'
62
+ }
63
+ })
64
+ this.fusetypes.push(...res.map(item => ({ label: item.fusetype, value: item.fusetype })))
65
+ console.log('123456', this.fusetypes)
66
+ },
67
+ async getFiles () {
68
+ console.log('999', this.currUserInfo)
69
+ if (!this.currUserInfo) return
70
+ this.files = []
71
+ let condition = `CONVERT(varchar(200),f_blobid) = '${this.currUserInfo.f_userinfo_id}'`
72
+ if (this.upload_date) {
73
+ condition += ` and CONVERT(VARCHAR(100), f_uploaddate, 23) = '${this.upload_date}'`
74
+ }
75
+ if (this.fusetype) {
76
+ condition += ` and fusetype = '${this.fusetype}'`
77
+ }
78
+ const res = await post('/api/af-revenue/logic/getAllFiles', { data: { condition } })
79
+ console.log('7777', res)
80
+ console.log('7777', res.days)
81
+ this.files = res.days.map(day => ({
82
+ days: day.uploadday,
83
+ arrays: res.array.filter(file => file.uploadday === day.uploadday)
84
+ }))
85
+ },
86
+ async delet (fileId) {
87
+ await this.$resetdelete('rs/entity/t_files', { id: fileId }, { resolveMsg: '删除成功', rejectMsg: '删除失败' })
88
+ this.getFiles()
89
+ },
90
+ selfSearch () {
91
+ this.getFiles()
92
+ }
93
+ },
94
+ mounted () {
95
+ if (this.$login.r.includes('上传附件删除')) {
96
+ this.isDelete = '1'
97
+ }
98
+ this.getFiles()
99
+ this.getfusetypes()
100
+ }
101
+ }
102
+ </script>
103
+
104
+ <style scoped>
105
+ .filter-bar {
106
+ display: flex;
107
+ gap: 10px;
108
+ margin-bottom: 15px;
109
+ }
110
+ .file-group {
111
+ margin-bottom: 15px;
112
+ }
113
+ .file-items {
114
+ display: flex;
115
+ flex-wrap: wrap;
116
+ gap: 10px;
117
+ }
118
+ .file-card {
119
+ border: 1px solid #ddd;
120
+ padding: 10px;
121
+ border-radius: 5px;
122
+ width: 200px;
123
+ }
124
+ .file-image {
125
+ width: 100%; /* 让图片填充整个容器 */
126
+ height: 150px; /* 调整高度 */
127
+ object-fit: cover; /* 保持图片比例,填充整个区域 */
128
+ border-radius: 5px; /* 圆角边框 */
129
+ }
130
+ </style>
@@ -34,6 +34,7 @@ import TransferRecordQuery from '@vue2-client/pages/userInfoDetailManage/Transfe
34
34
  import WatchCollectionRecordQuery from '@vue2-client/pages/userInfoDetailManage/WatchCollectionRecordQuery'
35
35
  import UserException from '@vue2-client/pages/userInfoDetailManage/UserException'
36
36
  import PriceAdjustments from '@vue2-client/pages/userInfoDetailManage/PriceAdjustments'
37
+ import uploadFilesHistory from '@vue2-client/pages/userInfoDetailManage/uploadFilesHistory'
37
38
 
38
39
  export default {
39
40
  name: 'UserInfoDetailQueryTabs',
@@ -56,6 +57,7 @@ export default {
56
57
  UserHandRecordQuery,
57
58
  UserException,
58
59
  PriceAdjustments,
60
+ uploadFilesHistory,
59
61
  },
60
62
  props: {
61
63
  userInfo: {
@@ -106,6 +108,7 @@ export default {
106
108
  { key: '13', label: '流量计参数查看', permission: '流量计参数查看', component: 'MeterParamRecordQuery' },
107
109
  { key: '14', label: '异常报警', permission: '异常报警', component: 'MeterParamRecordQuery' },
108
110
  { key: '15', label: '价格调整', permission: '价格调整', component: 'PriceAdjustments' },
111
+ { key: '16', label: '附件查看', permission: '附件查看', component: 'uploadFilesHistory' },
109
112
  ],
110
113
  }
111
114
  },