vue2-client 1.12.94 → 1.12.96

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,109 +1,107 @@
1
- {
2
- "name": "vue2-client",
3
- "version": "1.12.94",
4
- "private": false,
5
- "scripts": {
6
- "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
7
- "serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
8
- "serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
9
- "serve:liuli": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode liuli",
10
- "serve:scada": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode scada",
11
- "serve:iot": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode iot",
12
- "serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
13
- "mac-serve": "vue-cli-service serve --no-eslint --mode his",
14
- "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
15
- "test:unit": "vue-cli-service test:unit",
16
- "lint": "vue-cli-service lint",
17
- "build:preview": "vue-cli-service build --mode preview",
18
- "lint:nofix": "vue-cli-service lint --no-fix",
19
- "test": "jest"
20
- },
21
- "dependencies": {
22
- "@afwenming123/vue-easy-tree": "^1.0.1",
23
- "@afwenming123/vue-plugin-hiprint": "^0.0.70",
24
- "@amap/amap-jsapi-loader": "^1.0.1",
25
- "@antv/data-set": "^0.11.8",
26
- "@antv/g2plot": "^2.4.31",
27
- "@hufe921/canvas-editor": "^0.9.49",
28
- "@microsoft/fetch-event-source": "^2.0.1",
29
- "@vue/babel-preset-jsx": "^1.4.0",
30
- "animate.css": "^4.1.1",
31
- "ant-design-vue": "^1.7.8",
32
- "axios": "^0.27.2",
33
- "clipboard": "^2.0.11",
34
- "core-js": "^3.33.0",
35
- "crypto-js": "^4.1.1",
36
- "date-fns": "^2.29.3",
37
- "dayjs": "^1.11.13",
38
- "default-passive-events": "^2.0.0",
39
- "dotenv": "^16.3.1",
40
- "echarts": "^5.5.0",
41
- "enquire.js": "^2.1.6",
42
- "file-saver": "^2.0.5",
43
- "highlight.js": "^11.7.0",
44
- "html2canvas": "^1.4.1",
45
- "js-base64": "^3.7.5",
46
- "js-cookie": "^2.2.1",
47
- "jsencrypt": "^3.3.2",
48
- "jspdf": "^2.5.1",
49
- "lodash.clonedeep": "^4.5.0",
50
- "lodash.debounce": "^4",
51
- "lodash.get": "^4.4.2",
52
- "marked": "^4",
53
- "mockjs": "^1.1.0",
54
- "nprogress": "^0.2.0",
55
- "qs": "^6.11.2",
56
- "regenerator-runtime": "^0.14.0",
57
- "videojs-contrib-hls": "^5.15.0",
58
- "viser-vue": "^2.4.8",
59
- "vue": "^2.7.14",
60
- "vue-codemirror": "4.0.6",
61
- "vue-draggable-resizable": "^2",
62
- "vue-i18n": "^8.28.2",
63
- "vue-json-viewer": "^2.2.22",
64
- "vue-router": "^3.6.5",
65
- "vue-video-player": "^5.0.2",
66
- "vue-virtual-scroller": "^1.1.2",
67
- "vuedraggable": "^2.24.3",
68
- "vuex": "^3.6.2",
69
- "xlsx": "0.18.5"
70
- },
71
- "devDependencies": {
72
- "@ant-design/colors": "^7.0.0",
73
- "@babel/core": "^7.22.20",
74
- "@babel/eslint-parser": "^7.22.15",
75
- "@babel/preset-env": "^7.22.20",
76
- "@jest/globals": "^29.7.0",
77
- "@vue/cli-plugin-babel": "^5.0.8",
78
- "@vue/cli-plugin-eslint": "^5.0.8",
79
- "@vue/cli-service": "^5.0.8",
80
- "@vue/eslint-config-standard": "^8.0.1",
81
- "@vue/test-utils": "^1.3.6",
82
- "babel-plugin-transform-remove-console": "^6.9.4",
83
- "compression-webpack-plugin": "^10.0.0",
84
- "css-minimizer-webpack-plugin": "^5.0.1",
85
- "deepmerge": "^4.3.1",
86
- "eslint": "^8.51.0",
87
- "eslint-plugin-vue": "^9.17.0",
88
- "fast-deep-equal": "^3.1.3",
89
- "ignore-loader": "^0.1.2",
90
- "jest": "^29.7.0",
91
- "jest-environment-jsdom": "^29.7.0",
92
- "jest-transform-stub": "^2.0.0",
93
- "less-loader": "^6.2.0",
94
- "script-loader": "^0.7.2",
95
- "style-resources-loader": "^1.5.0",
96
- "vue-cli-plugin-style-resources-loader": "^0.1.5",
97
- "vue-jest": "^4.0.1",
98
- "vue-template-compiler": "^2.7.14",
99
- "webpack": "^5.88.2",
100
- "webpack-theme-color-replacer": "^1.4.7",
101
- "whatwg-fetch": "^3.6.19"
102
- },
103
- "browserslist": [
104
- "> 1%",
105
- "last 2 versions",
106
- "not dead",
107
- "not ie 11"
108
- ]
109
- }
1
+ {
2
+ "name": "vue2-client",
3
+ "version": "1.12.96",
4
+ "private": false,
5
+ "scripts": {
6
+ "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
7
+ "serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
8
+ "serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
9
+ "serve:liuli": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode liuli",
10
+ "serve:scada": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode scada",
11
+ "serve:iot": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode iot",
12
+ "serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
13
+ "mac-serve": "vue-cli-service serve --no-eslint --mode his",
14
+ "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
15
+ "test:unit": "vue-cli-service test:unit",
16
+ "lint": "vue-cli-service lint",
17
+ "build:preview": "vue-cli-service build --mode preview",
18
+ "lint:nofix": "vue-cli-service lint --no-fix",
19
+ "test": "jest"
20
+ },
21
+ "dependencies": {
22
+ "@afwenming123/vue-easy-tree": "^1.0.1",
23
+ "@afwenming123/vue-plugin-hiprint": "^0.0.70",
24
+ "@amap/amap-jsapi-loader": "^1.0.1",
25
+ "@antv/data-set": "^0.11.8",
26
+ "@antv/g2plot": "^2.4.31",
27
+ "@hufe921/canvas-editor": "^0.9.49",
28
+ "@microsoft/fetch-event-source": "^2.0.1",
29
+ "@vue/babel-preset-jsx": "^1.4.0",
30
+ "animate.css": "^4.1.1",
31
+ "ant-design-vue": "^1.7.8",
32
+ "axios": "^0.27.2",
33
+ "clipboard": "^2.0.11",
34
+ "core-js": "^3.33.0",
35
+ "crypto-js": "^4.1.1",
36
+ "date-fns": "^2.29.3",
37
+ "default-passive-events": "^2.0.0",
38
+ "dotenv": "^16.3.1",
39
+ "echarts": "^5.5.0",
40
+ "enquire.js": "^2.1.6",
41
+ "file-saver": "^2.0.5",
42
+ "highlight.js": "^11.7.0",
43
+ "html2canvas": "^1.4.1",
44
+ "js-base64": "^3.7.5",
45
+ "js-cookie": "^2.2.1",
46
+ "jsencrypt": "^3.3.2",
47
+ "jspdf": "^2.5.1",
48
+ "lodash.clonedeep": "^4.5.0",
49
+ "lodash.debounce": "^4",
50
+ "lodash.get": "^4.4.2",
51
+ "marked": "^4",
52
+ "mockjs": "^1.1.0",
53
+ "nprogress": "^0.2.0",
54
+ "qs": "^6.11.2",
55
+ "regenerator-runtime": "^0.14.0",
56
+ "videojs-contrib-hls": "^5.15.0",
57
+ "viser-vue": "^2.4.8",
58
+ "vue": "^2.7.14",
59
+ "vue-codemirror": "4.0.6",
60
+ "vue-draggable-resizable": "^2",
61
+ "vue-i18n": "^8.28.2",
62
+ "vue-json-viewer": "^2.2.22",
63
+ "vue-router": "^3.6.5",
64
+ "vue-video-player": "^5.0.2",
65
+ "vue-virtual-scroller": "^1.1.2",
66
+ "vuedraggable": "^2.24.3",
67
+ "vuex": "^3.6.2",
68
+ "xlsx": "0.18.5"
69
+ },
70
+ "devDependencies": {
71
+ "@ant-design/colors": "^7.0.0",
72
+ "@babel/core": "^7.22.20",
73
+ "@babel/eslint-parser": "^7.22.15",
74
+ "@babel/preset-env": "^7.22.20",
75
+ "@vue/cli-plugin-babel": "^5.0.8",
76
+ "@vue/cli-plugin-eslint": "^5.0.8",
77
+ "@vue/cli-service": "^5.0.8",
78
+ "@vue/eslint-config-standard": "^8.0.1",
79
+ "@vue/test-utils": "^1.3.6",
80
+ "babel-plugin-transform-remove-console": "^6.9.4",
81
+ "compression-webpack-plugin": "^10.0.0",
82
+ "css-minimizer-webpack-plugin": "^5.0.1",
83
+ "deepmerge": "^4.3.1",
84
+ "eslint": "^8.51.0",
85
+ "eslint-plugin-vue": "^9.17.0",
86
+ "fast-deep-equal": "^3.1.3",
87
+ "ignore-loader": "^0.1.2",
88
+ "jest": "^29.7.0",
89
+ "jest-environment-jsdom": "^29.7.0",
90
+ "jest-transform-stub": "^2.0.0",
91
+ "less-loader": "^6.2.0",
92
+ "script-loader": "^0.7.2",
93
+ "style-resources-loader": "^1.5.0",
94
+ "vue-cli-plugin-style-resources-loader": "^0.1.5",
95
+ "vue-jest": "^4.0.1",
96
+ "vue-template-compiler": "^2.7.14",
97
+ "webpack": "^5.88.2",
98
+ "webpack-theme-color-replacer": "^1.4.7",
99
+ "whatwg-fetch": "^3.6.19"
100
+ },
101
+ "browserslist": [
102
+ "> 1%",
103
+ "last 2 versions",
104
+ "not dead",
105
+ "not ie 11"
106
+ ]
107
+ }
@@ -128,9 +128,9 @@ export default {
128
128
  },
129
129
  props: {
130
130
  // 接收配置
131
- config: {
132
- type: Object,
133
- default: () => ({})
131
+ configName: {
132
+ type: String,
133
+ default: ''
134
134
  }
135
135
  },
136
136
  data () {
@@ -144,11 +144,10 @@ export default {
144
144
  }
145
145
  },
146
146
  created () {
147
- this.getData(this.config)
147
+ this.getData(this.configName)
148
148
  },
149
149
  computed: {
150
150
  // 使用计算属性访问合并后的配置
151
- // eslint-disable-next-line vue/no-dupe-keys
152
151
  config () {
153
152
  return this.mergedConfig
154
153
  },
@@ -164,6 +163,7 @@ export default {
164
163
  methods: {
165
164
  // 获取配置
166
165
  getData (config) {
166
+ console.warn(config)
167
167
  getConfigByName(config, 'af-his', res => {
168
168
  // 深度合并配置
169
169
  this.mergedConfig = this.mergeConfig(defaultConfig, res)
@@ -0,0 +1,284 @@
1
+ # XCalendar
2
+
3
+ 基于 Ant Design Vue Calendar 的可配置日历组件,支持自定义标题、导航、样式等功能。
4
+
5
+ ## 何时使用
6
+
7
+ 当需要在界面中展示一个功能丰富的日历,并且需要:
8
+ - 自定义日历的标题和导航
9
+ - 添加自定义操作按钮
10
+ - 自定义样式和布局
11
+ - 响应日期选择和月份切换事件
12
+
13
+ ## 引用方式
14
+
15
+ ```javascript
16
+ import XCalendar from '@vue2-client/base-client/components/common/XCalendar/XCalendar'
17
+
18
+ export default {
19
+ components: {
20
+ XCalendar
21
+ }
22
+ }
23
+ ```
24
+
25
+ ## 代码演示
26
+
27
+ ```html
28
+ <x-calendar
29
+ :configName="calendarConfigName"
30
+ @select="handleSelect"
31
+ @monthChange="handleMonthChange"
32
+ @action="handleAction">
33
+ </x-calendar>
34
+ ```
35
+
36
+ ## API
37
+
38
+ ### Props
39
+
40
+ | 参数 | 说明 | 类型 | 默认值 |
41
+ |------|------|------|------|
42
+ | configName | 配置名称,用于从后端获取配置 | String | '' |
43
+
44
+ ### 事件
45
+
46
+ | 事件名 | 说明 | 回调参数 |
47
+ |------|------|------|
48
+ | select | 选择日期时触发 | function(date: Moment) |
49
+ | back-to-today | 点击"返回当天"按钮时触发 | function(date: Moment) |
50
+ | action | 点击操作按钮时触发 | function(date: Moment) |
51
+ | add | 点击新增按钮时触发 | function(date: Moment) |
52
+ | month-change | 切换月份时触发 | function(date: Moment) |
53
+
54
+ ## 配置说明
55
+
56
+ 组件通过 `configName` 从后端获取配置,配置格式如下:
57
+
58
+ ### 完整配置结构
59
+
60
+ ```json
61
+ {
62
+ "header": {
63
+ "show": true,
64
+ "title": "我的日程",
65
+ "showIcon": true,
66
+ "showBackToToday": true,
67
+ "backToTodayText": "返回当天",
68
+ "showMonth": true,
69
+ "showDay": true,
70
+ "monthClickable": false,
71
+ "dayClickable": false
72
+ },
73
+ "subHeader": {
74
+ "show": true,
75
+ "showNavigation": true,
76
+ "prevMonthText": "←",
77
+ "nextMonthText": "→"
78
+ },
79
+ "calendar": {
80
+ "fullscreen": false,
81
+ "locale": "zh-cn"
82
+ },
83
+ "actions": [
84
+ {
85
+ "text": "+ 新增日程",
86
+ "type": "add",
87
+ "handler": "handleAdd"
88
+ }
89
+ ],
90
+ "styles": {
91
+ "wrapper": {},
92
+ "header": {},
93
+ "titleInput": {},
94
+ "subHeader": {},
95
+ "currentDate": {},
96
+ "year": {},
97
+ "actionItem": {},
98
+ "calendarContent": {}
99
+ },
100
+ "events": {
101
+ "select": "select",
102
+ "backToToday": "back-to-today",
103
+ "action": "action",
104
+ "add": "add",
105
+ "monthChange": "month-change"
106
+ }
107
+ }
108
+ ```
109
+
110
+ ### 配置项详细说明
111
+
112
+ #### 1. header 配置
113
+
114
+ | 参数 | 说明 | 类型 | 默认值 |
115
+ |------|------|------|------|
116
+ | show | 是否显示头部 | boolean | true |
117
+ | title | 标题文本 | string | '我的日程' |
118
+ | showIcon | 是否显示图标 | boolean | true |
119
+ | showBackToToday | 是否显示返回今天按钮 | boolean | true |
120
+ | backToTodayText | 返回今天按钮文本 | string | '返回当天' |
121
+ | showMonth | 是否显示月份 | boolean | true |
122
+ | showDay | 是否显示日期 | boolean | true |
123
+ | monthClickable | 月份是否可点击 | boolean | false |
124
+ | dayClickable | 日期是否可点击 | boolean | false |
125
+
126
+ #### 2. subHeader 配置
127
+
128
+ | 参数 | 说明 | 类型 | 默认值 |
129
+ |------|------|------|------|
130
+ | show | 是否显示子标题栏 | boolean | true |
131
+ | showNavigation | 是否显示导航按钮 | boolean | true |
132
+ | prevMonthText | 上个月按钮文本 | string | '←' |
133
+ | nextMonthText | 下个月按钮文本 | string | '→' |
134
+
135
+ #### 3. calendar 配置
136
+
137
+ | 参数 | 说明 | 类型 | 默认值 |
138
+ |------|------|------|------|
139
+ | fullscreen | 是否全屏显示 | boolean | false |
140
+ | locale | 语言设置 | string | 'zh-cn' |
141
+
142
+ #### 4. actions 配置
143
+
144
+ 每个操作按钮的配置项:
145
+
146
+ | 参数 | 说明 | 类型 | 示例 |
147
+ |------|------|------|------|
148
+ | text | 按钮显示文本 | string | '+ 新增日程' |
149
+ | type | 按钮类型标识 | string | 'add' |
150
+ | handler | 处理函数名称 | string | 'handleAdd' |
151
+
152
+ #### 5. styles 配置
153
+
154
+ 所有样式配置都接受标准的 CSS 属性对象:
155
+
156
+ | 参数 | 说明 | 类型 | 示例 |
157
+ |------|------|------|------|
158
+ | wrapper | 整体容器样式 | object | { background: '#fff' } |
159
+ | header | 头部样式 | object | { padding: '16px' } |
160
+ | titleInput | 标题输入框样式 | object | { fontSize: '16px' } |
161
+ | subHeader | 子标题栏样式 | object | { marginBottom: '20px' } |
162
+ | currentDate | 当前日期样式 | object | { color: '#1890ff' } |
163
+ | year | 年份样式 | object | { fontSize: '14px' } |
164
+ | actionItem | 操作按钮样式 | object | { cursor: 'pointer' } |
165
+ | calendarContent | 日历内容区域样式 | object | { padding: '24px' } |
166
+
167
+ ## 使用示例
168
+
169
+ ### 1. 基础使用
170
+
171
+ ```html
172
+ <template>
173
+ <x-calendar :configName="'MyCalendarConfig'" @select="onSelect" />
174
+ </template>
175
+
176
+ <script>
177
+ export default {
178
+ methods: {
179
+ onSelect(date) {
180
+ console.log('选择的日期:', date.format('YYYY-MM-DD'))
181
+ }
182
+ }
183
+ }
184
+ </script>
185
+ ```
186
+
187
+ ### 2. 自定义样式配置
188
+
189
+ ```json
190
+ {
191
+ "styles": {
192
+ "wrapper": {
193
+ "backgroundColor": "#f5f5f5",
194
+ "padding": "24px",
195
+ "borderRadius": "8px"
196
+ },
197
+ "header": {
198
+ "borderBottom": "1px solid #e8e8e8",
199
+ "marginBottom": "16px"
200
+ },
201
+ "currentDate": {
202
+ "fontSize": "24px",
203
+ "fontWeight": "bold",
204
+ "color": "#1890ff"
205
+ }
206
+ }
207
+ }
208
+ ```
209
+
210
+ ### 3. 自定义操作按钮
211
+
212
+ ```json
213
+ {
214
+ "actions": [
215
+ {
216
+ "text": "+ 新增日程",
217
+ "type": "add",
218
+ "handler": "handleAdd"
219
+ },
220
+ {
221
+ "text": "查看详情",
222
+ "type": "view",
223
+ "handler": "handleView"
224
+ }
225
+ ]
226
+ }
227
+ ```
228
+
229
+ ## 注意事项
230
+
231
+ 1. 组件使用 moment.js 处理日期,确保项目中已正确配置
232
+ 2. 样式配置支持所有合法的 CSS 属性,使用驼峰命名
233
+ 3. 自定义事件处理函数需要在父组件中实现
234
+ 4. 所有配置项都是可选的,未配置时使用默认值
235
+ 5. 语言设置默认为中文,可通过 calendar.locale 配置修改
236
+ 6. 样式配置支持响应式设计,可根据需要调整
237
+
238
+ ## 常见问题
239
+
240
+ ### 1. 如何修改日历的默认语言?
241
+
242
+ 通过 calendar 配置项设置:
243
+ ```json
244
+ {
245
+ "calendar": {
246
+ "locale": "en-us"
247
+ }
248
+ }
249
+ ```
250
+
251
+ ### 2. 如何自定义日期显示格式?
252
+
253
+ 可以通过监听 select 事件,在回调函数中自定义格式化:
254
+ ```javascript
255
+ onSelect(date) {
256
+ const formattedDate = date.format('YYYY年MM月DD日')
257
+ }
258
+ ```
259
+
260
+ ### 3. 如何添加自定义操作按钮?
261
+
262
+ 在配置中的 actions 数组中添加按钮配置:
263
+ ```json
264
+ {
265
+ "actions": [
266
+ {
267
+ "text": "自定义按钮",
268
+ "type": "custom",
269
+ "handler": "handleCustom"
270
+ }
271
+ ]
272
+ }
273
+ ```
274
+
275
+ ### 4. 如何处理按钮点击事件?
276
+
277
+ 在父组件中实现对应的处理函数:
278
+ ```javascript
279
+ methods: {
280
+ handleCustom(date) {
281
+ console.log('自定义按钮点击,当前日期:', date.format('YYYY-MM-DD'))
282
+ }
283
+ }
284
+ ```
@@ -175,7 +175,7 @@ export default {
175
175
  this.activeKey = keys
176
176
  },
177
177
  onSearch (value, panelIndex) {
178
- console.log('搜索内容:', value, '面板索引:', panelIndex)
178
+ this.$emit('searchChange', { value: value, panelIndex: panelIndex })
179
179
  },
180
180
  },
181
181
  watch: {
@@ -2,6 +2,7 @@
2
2
  <a-card :bordered="false">
3
3
  <a-button @click="()=>{queryParamsName = 'crud_device_realtime_upload_物联网流量计'}">测试1</a-button>
4
4
  <a-button @click="()=>{queryParamsName = 'crud_device_realtime_upload_LaiDe_TiaoYaXiang'}">测试2</a-button>
5
+ <a-button @click="test()">测试3</a-button>
5
6
  <x-form-table
6
7
  title="示例表单"
7
8
  :queryParamsName="queryParamsName"
@@ -16,6 +17,7 @@
16
17
  <script>
17
18
  import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
18
19
  import { microDispatch } from '@vue2-client/utils/microAppUtils'
20
+
19
21
  export default {
20
22
  name: 'Demo',
21
23
  components: {
@@ -36,6 +38,9 @@ export default {
36
38
  }
37
39
  },
38
40
  methods: {
41
+ test () {
42
+ this.$refs.xFormTable.setTableData([])
43
+ },
39
44
  defaultF () {
40
45
  this.$refs.xFormTable.setTableSize('default')
41
46
  },
@@ -46,7 +51,11 @@ export default {
46
51
  this.$refs.xFormTable.setTableSize('small')
47
52
  },
48
53
  columnClick (key, value, record) {
49
- microDispatch({ type: 'v3route', path: '/bingliguanli/dianzibingliluru', props: { selected: arguments[0].his_f_admission_id } })
54
+ microDispatch({
55
+ type: 'v3route',
56
+ path: '/bingliguanli/dianzibingliluru',
57
+ props: { selected: arguments[0].his_f_admission_id }
58
+ })
50
59
  },
51
60
  action (record, id, actionType) {
52
61
  this.detailVisible = true
@@ -58,8 +67,7 @@ export default {
58
67
  this.$refs.xFormTable.refreshTable(true)
59
68
  }
60
69
  },
61
- computed: {
62
- },
70
+ computed: {},
63
71
  }
64
72
  </script>
65
73
 
@@ -1272,7 +1272,7 @@ export default {
1272
1272
  // 普通模式
1273
1273
  this.$nextTick(() => {
1274
1274
  if (this.$refs.table) {
1275
- this.$refs.table.localDataSource = [...data]
1275
+ this.$refs.table.setLocalDataSource(data)
1276
1276
  }
1277
1277
  })
1278
1278
  }
@@ -154,6 +154,9 @@ export default {
154
154
  },
155
155
  inject: ['tableContext'],
156
156
  methods: {
157
+ setLocalDataSource (data) {
158
+ this.$refs.table.setLocalDataSource(data)
159
+ },
157
160
  loadData () {
158
161
  if (this.loadSelectedData) {
159
162
  return this.loadSelectedDataGen
@@ -42,12 +42,11 @@
42
42
  </template>
43
43
 
44
44
  <script>
45
- import dayjs from 'dayjs'
46
- import 'dayjs/locale/zh-cn'
45
+ import moment from 'moment'
47
46
  import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
48
47
 
49
- // 设置 dayjs 为中文语言环境
50
- dayjs.locale('zh-cn')
48
+ // 设置 moment 为中文语言环境
49
+ moment.locale('zh-cn')
51
50
 
52
51
  export default {
53
52
  name: 'XTimeline',
@@ -62,7 +61,7 @@ export default {
62
61
  // 配置参数名称,用于获取时间轴配置
63
62
  queryParamsName: {
64
63
  type: String,
65
- default: ''
64
+ default: 'XTimelineExampleConfig'
66
65
  }
67
66
  },
68
67
 
@@ -72,7 +71,7 @@ export default {
72
71
  data () {
73
72
  return {
74
73
  currentDate: this.modelValue, // 当前选中日期
75
- baseDate: dayjs().format('YYYY-MM-DD'), // 基准日期,默认今天,用于计算显示范围
74
+ baseDate: moment().format('YYYY-MM-DD'), // 基准日期,默认今天,用于计算显示范围
76
75
  config: null,
77
76
  disabledDates: [] // 禁用日期列表
78
77
  }
@@ -82,18 +81,15 @@ export default {
82
81
  displayDates () {
83
82
  const dates = []
84
83
  // 计算当前日期所在周的周一
85
- const currentDay = dayjs(this.baseDate)
84
+ const currentDay = moment(this.baseDate)
86
85
  const dayOfWeek = currentDay.day() || 7 // 获取星期几,将周日的0转换为7
87
- const mondayOfWeek = currentDay.subtract(dayOfWeek - 1, 'day') // 减去相应的天数得到周一
86
+ const mondayOfWeek = currentDay.clone().subtract(dayOfWeek - 1, 'day') // 减去相应的天数得到周一
88
87
 
89
88
  // 从周一开始,生成一周的日期
90
89
  dates.push(mondayOfWeek.format('YYYY-MM-DD')) // 周一
91
- dates.push(dayjs(mondayOfWeek).add(1, 'day').format('YYYY-MM-DD')) // 周二
92
- dates.push(dayjs(mondayOfWeek).add(2, 'day').format('YYYY-MM-DD')) // 周三
93
- dates.push(dayjs(mondayOfWeek).add(3, 'day').format('YYYY-MM-DD')) // 周四
94
- dates.push(dayjs(mondayOfWeek).add(4, 'day').format('YYYY-MM-DD')) // 周五
95
- dates.push(dayjs(mondayOfWeek).add(5, 'day').format('YYYY-MM-DD')) // 周六
96
- dates.push(dayjs(mondayOfWeek).add(6, 'day').format('YYYY-MM-DD')) // 周日
90
+ for (let i = 1; i <= 6; i++) {
91
+ dates.push(mondayOfWeek.clone().add(i, 'day').format('YYYY-MM-DD'))
92
+ }
97
93
 
98
94
  return dates
99
95
  }
@@ -167,28 +163,28 @@ export default {
167
163
  // 格式化日期显示
168
164
  formatDate (date) {
169
165
  const format = this.config?.dateFormat || 'MM/DD'
170
- return dayjs(date).format(format)
166
+ return moment(date).format(format)
171
167
  },
172
168
 
173
169
  // 获取星期显示
174
170
  getWeekDay (date) {
175
171
  const format = this.config?.weekFormat || '周dd'
176
- return dayjs(date).format(format)
172
+ return moment(date).format(format)
177
173
  },
178
174
 
179
175
  // 判断是否为周末
180
176
  isWeekend (date) {
181
177
  if (!this.config?.highlightWeekend) return false
182
- const day = dayjs(date).day()
178
+ const day = moment(date).day()
183
179
  return day === 0 || day === 6
184
180
  },
185
181
 
186
182
  // 判断日期是否禁用
187
183
  isDisabled (date) {
188
- if (this.config?.minDate && dayjs(date).isBefore(this.config.minDate)) {
184
+ if (this.config?.minDate && moment(date).isBefore(this.config.minDate)) {
189
185
  return true
190
186
  }
191
- if (this.config?.maxDate && dayjs(date).isAfter(this.config.maxDate)) {
187
+ if (this.config?.maxDate && moment(date).isAfter(this.config.maxDate)) {
192
188
  return true
193
189
  }
194
190
  return this.disabledDates.includes(date)
@@ -197,7 +193,7 @@ export default {
197
193
  // 判断是否为当前选中日期
198
194
  isCurrentDate (date) {
199
195
  if (!this.currentDate) return false
200
- return dayjs(date).format('YYYY-MM-DD') === dayjs(this.currentDate).format('YYYY-MM-DD')
196
+ return moment(date).format('YYYY-MM-DD') === moment(this.currentDate).format('YYYY-MM-DD')
201
197
  },
202
198
 
203
199
  // 选择日期
@@ -210,7 +206,7 @@ export default {
210
206
 
211
207
  // 前一天
212
208
  goToPrevDay () {
213
- const newDate = dayjs(this.baseDate).subtract(1, 'day')
209
+ const newDate = moment(this.baseDate).subtract(1, 'day')
214
210
  if (this.config?.minDate && newDate.isBefore(this.config.minDate)) {
215
211
  return
216
212
  }
@@ -227,7 +223,7 @@ export default {
227
223
 
228
224
  // 后一天
229
225
  goToNextDay () {
230
- const newDate = dayjs(this.baseDate).add(1, 'day')
226
+ const newDate = moment(this.baseDate).add(1, 'day')
231
227
  if (this.config?.maxDate && newDate.isAfter(this.config.maxDate)) {
232
228
  return
233
229
  }
@@ -241,12 +237,13 @@ export default {
241
237
  // 触发变更事件
242
238
  this.$emit('change', this.currentDate)
243
239
  },
240
+
244
241
  // 前一周
245
242
  goToPrevWeek () {
246
243
  // 计算当前日期所在周的周一
247
- const currentDay = dayjs(this.baseDate)
244
+ const currentDay = moment(this.baseDate)
248
245
  const dayOfWeek = currentDay.day() || 7 // 获取星期几,将周日的0转换为7
249
- const mondayOfWeek = currentDay.subtract(dayOfWeek - 1, 'day') // 减去相应的天数得到周一
246
+ const mondayOfWeek = currentDay.clone().subtract(dayOfWeek - 1, 'day') // 减去相应的天数得到周一
250
247
 
251
248
  // 前一周的周一
252
249
  const newDate = mondayOfWeek.subtract(7, 'day')
@@ -261,9 +258,9 @@ export default {
261
258
  // 后一周
262
259
  goToNextWeek () {
263
260
  // 计算当前日期所在周的周一
264
- const currentDay = dayjs(this.baseDate)
261
+ const currentDay = moment(this.baseDate)
265
262
  const dayOfWeek = currentDay.day() || 7 // 获取星期几,将周日的0转换为7
266
- const mondayOfWeek = currentDay.subtract(dayOfWeek - 1, 'day') // 减去相应的天数得到周一
263
+ const mondayOfWeek = currentDay.clone().subtract(dayOfWeek - 1, 'day') // 减去相应的天数得到周一
267
264
  // 后一周的周一
268
265
  const newDate = mondayOfWeek.add(7, 'day')
269
266
  if (this.config?.maxDate && newDate.isAfter(this.config.maxDate)) {
@@ -63,6 +63,11 @@ export default {
63
63
  return item.picture
64
64
  ? { backgroundImage: `url(${item.picture})` }
65
65
  : {}
66
+ },
67
+ filterData (par) {
68
+ runLogic(this.queryParamsName, par, 'af-his').then(res => {
69
+ this.data = res.data
70
+ })
66
71
  }
67
72
  }
68
73
  }
@@ -1,99 +1,99 @@
1
- <template>
2
- <div class="x-time-select">
3
- <a-range-picker
4
- :value="dateRange"
5
- :placeholder="['开始日期', '结束日期']"
6
- separator="至"
7
- :disabled="disabled"
8
- :allowClear="allowClear"
9
- :format="format"
10
- @change="handleDateChange"
11
- />
12
- </div>
13
- </template>
14
-
15
- <script>
16
- import dayjs from 'dayjs'
17
-
18
- export default {
19
- name: 'XTimeSelect',
20
- props: {
21
- value: {
22
- type: Array,
23
- default: () => []
24
- },
25
- disabled: {
26
- type: Boolean,
27
- default: false
28
- },
29
- allowClear: {
30
- type: Boolean,
31
- default: true
32
- },
33
- format: {
34
- type: String,
35
- default: 'YYYY/MM/DD'
36
- }
37
- },
38
- data () {
39
- return {
40
- dateRange: []
41
- }
42
- },
43
- watch: {
44
- value: {
45
- handler (newVal) {
46
- if (newVal && newVal.length === 2) {
47
- this.dateRange = [
48
- newVal[0] ? dayjs(newVal[0]) : null,
49
- newVal[1] ? dayjs(newVal[1]) : null
50
- ]
51
- } else {
52
- this.dateRange = []
53
- }
54
- },
55
- immediate: true,
56
- deep: true
57
- }
58
- },
59
- methods: {
60
- handleDateChange (dates, dateStrings) {
61
- this.dateRange = dates
62
- console.warn(dateStrings)
63
- this.$emit('change', dateStrings)
64
- }
65
- }
66
- }
67
- </script>
68
-
69
- <style scoped>
70
- .x-time-select {
71
- position: relative;
72
- width: 100%;
73
- box-sizing: border-box;
74
- display: block;
75
- }
76
- .x-time-select :deep(.ant-picker-range),
77
- .x-time-select :deep(.ant-picker) {
78
- width: 100%;
79
- height: 30px;
80
- border-radius: 7px;
81
- background: #FFFFFF;
82
- border: 1px solid #E5E9F0;
83
- }
84
- .x-time-select :deep(.ant-calendar-picker) {
85
- width: 100%;
86
- display: block;
87
- }
88
- .x-time-select :deep(.ant-calendar-picker-input) {
89
- width: 100%;
90
- height: 30px;
91
- border-radius: 7px;
92
- background: #FFFFFF;
93
- border: 1px solid #E5E9F0;
94
- }
95
-
96
- .x-time-select :deep(.ant-input) {
97
- width: 100%;
98
- }
99
- </style>
1
+ <template>
2
+ <div class="x-time-select">
3
+ <a-range-picker
4
+ :value="dateRange"
5
+ :placeholder="['开始日期', '结束日期']"
6
+ separator="至"
7
+ :disabled="disabled"
8
+ :allowClear="allowClear"
9
+ :format="format"
10
+ @change="handleDateChange"
11
+ />
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+ import moment from 'moment'
17
+
18
+ export default {
19
+ name: 'XTimeSelect',
20
+ props: {
21
+ value: {
22
+ type: Array,
23
+ default: () => []
24
+ },
25
+ disabled: {
26
+ type: Boolean,
27
+ default: false
28
+ },
29
+ allowClear: {
30
+ type: Boolean,
31
+ default: true
32
+ },
33
+ format: {
34
+ type: String,
35
+ default: 'YYYY/MM/DD'
36
+ }
37
+ },
38
+ data () {
39
+ return {
40
+ dateRange: []
41
+ }
42
+ },
43
+ watch: {
44
+ value: {
45
+ handler (newVal) {
46
+ if (newVal && newVal.length === 2) {
47
+ this.dateRange = [
48
+ newVal[0] ? moment(newVal[0]) : null,
49
+ newVal[1] ? moment(newVal[1]) : null
50
+ ]
51
+ } else {
52
+ this.dateRange = []
53
+ }
54
+ },
55
+ immediate: true,
56
+ deep: true
57
+ }
58
+ },
59
+ methods: {
60
+ handleDateChange (dates, dateStrings) {
61
+ this.dateRange = dates
62
+ console.warn(dateStrings)
63
+ this.$emit('change', dateStrings)
64
+ }
65
+ }
66
+ }
67
+ </script>
68
+
69
+ <style scoped>
70
+ .x-time-select {
71
+ position: relative;
72
+ width: 100%;
73
+ box-sizing: border-box;
74
+ display: block;
75
+ }
76
+ .x-time-select :deep(.ant-picker-range),
77
+ .x-time-select :deep(.ant-picker) {
78
+ width: 100%;
79
+ height: 30px;
80
+ border-radius: 7px;
81
+ background: #FFFFFF;
82
+ border: 1px solid #E5E9F0;
83
+ }
84
+ .x-time-select :deep(.ant-calendar-picker) {
85
+ width: 100%;
86
+ display: block;
87
+ }
88
+ .x-time-select :deep(.ant-calendar-picker-input) {
89
+ width: 100%;
90
+ height: 30px;
91
+ border-radius: 7px;
92
+ background: #FFFFFF;
93
+ border: 1px solid #E5E9F0;
94
+ }
95
+
96
+ .x-time-select :deep(.ant-input) {
97
+ width: 100%;
98
+ }
99
+ </style>
@@ -223,6 +223,9 @@ export default {
223
223
  })
224
224
  }
225
225
  },
226
+ setLocalDataSource (data) {
227
+ this.localDataSource = data
228
+ },
226
229
  initTotalList (columns) {
227
230
  const totalList = []
228
231
  columns && columns instanceof Array && columns.forEach(column => {
@@ -52,10 +52,10 @@ routerResource.newDynamicStatistics = () => import('@vue2-client/pages/NewDynami
52
52
  routerResource.example = {
53
53
  path: 'example',
54
54
  name: '示例主页面',
55
- component: () => import('@vue2-client/base-client/components/his/XTimeSelect/XTimeSelect.vue'),
55
+ // component: () => import('@vue2-client/base-client/components/his/XTimeSelect/XTimeSelect.vue'),
56
56
  // component: () => import('@vue2-client/base-client/components/his/XRadio/XRadio.vue'),
57
57
  // component: () => import('@vue2-client/base-client/components/his/XList/XList.vue'),
58
- // component: () => import('@vue2-client/base-client/components/common/XCollapse/XCollapse.vue'),
58
+ component: () => import('@vue2-client/base-client/components/common/XCollapse/XCollapse.vue'),
59
59
  // component: () => import('@vue2-client/base-client/components/common/XDataCard/XDataCard.vue'),
60
60
  // component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
61
61
  // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),