vue2-client 1.12.88 → 1.12.90
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 +109 -109
- package/src/base-client/components/common/XCollapse/XCollapse.vue +6 -6
- package/src/base-client/components/common/XCollapse/XCollapseDemo.vue +15 -0
- package/src/base-client/components/common/XReportGrid/XReportDemo.vue +44 -44
- package/src/base-client/components/common/XTimeline/XTimeline.vue +58 -13
- package/src/base-client/components/common/XTimeline/index.md +191 -0
- package/src/base-client/components/his/XRadio/XRadio.vue +65 -9
- package/src/base-client/components/his/XRadio/index.md +137 -9
- package/src/base-client/components/his/XSidebar/XSidebar.vue +1 -1
- package/src/base-client/plugins/AppData.js +126 -126
- package/src/pages/ReportGrid/index.vue +76 -76
- package/src/router/async/router.map.js +123 -119
package/package.json
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vue2-client",
|
|
3
|
-
"version": "1.12.
|
|
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.90",
|
|
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
|
+
}
|
|
@@ -123,12 +123,12 @@ export default {
|
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
125
|
created () {
|
|
126
|
-
this.getData(this.queryParamsName)
|
|
126
|
+
this.getData(this.queryParamsName, this.parameter)
|
|
127
127
|
},
|
|
128
128
|
beforeDestroy () {
|
|
129
129
|
},
|
|
130
130
|
methods: {
|
|
131
|
-
getComponentName(componentName) {
|
|
131
|
+
getComponentName (componentName) {
|
|
132
132
|
return componentName
|
|
133
133
|
},
|
|
134
134
|
listClick (data) {
|
|
@@ -138,12 +138,12 @@ export default {
|
|
|
138
138
|
const refKey = `dynamicComponent_${componentName}`
|
|
139
139
|
return this.$refs[refKey]
|
|
140
140
|
},
|
|
141
|
-
async getData (config) {
|
|
141
|
+
async getData (config, parameter) {
|
|
142
142
|
this.configName = config
|
|
143
143
|
getConfigByName(config, 'af-his', res => {
|
|
144
144
|
this.config = res
|
|
145
145
|
console.warn(this.config)
|
|
146
|
-
runLogic(res.mainLogic,
|
|
146
|
+
runLogic(res.mainLogic, parameter, 'af-his').then(result => {
|
|
147
147
|
this.config.showData = result
|
|
148
148
|
// 更具timeType更改时间类型
|
|
149
149
|
if (this.config.timeType && this.config.timeType === '.') {
|
|
@@ -159,7 +159,7 @@ export default {
|
|
|
159
159
|
})
|
|
160
160
|
},
|
|
161
161
|
refreshXCollapse () {
|
|
162
|
-
this.getData(this.queryParamsName)
|
|
162
|
+
this.getData(this.queryParamsName, this.parameter)
|
|
163
163
|
},
|
|
164
164
|
convertToCustomFormat (dateString) {
|
|
165
165
|
// 创建一个新的 Date 对象
|
|
@@ -181,7 +181,7 @@ export default {
|
|
|
181
181
|
watch: {
|
|
182
182
|
queryParamsName: {
|
|
183
183
|
handler (newValue) {
|
|
184
|
-
this.getData(newValue,
|
|
184
|
+
this.getData(newValue, this.parameter)
|
|
185
185
|
},
|
|
186
186
|
deep: true
|
|
187
187
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<x-collapse :query-params-name="openPrescriptionConfig" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import XCollapse from '@vue2-client/base-client/components/common/XCollapse/XCollapse.vue'
|
|
7
|
+
export default {
|
|
8
|
+
name: 'Demo',
|
|
9
|
+
components: { XCollapse }
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<style scoped>
|
|
14
|
+
|
|
15
|
+
</style>
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div id="test">
|
|
3
|
-
<a-card :bordered="false">
|
|
4
|
-
<XReport
|
|
5
|
-
ref="main"
|
|
6
|
-
:use-oss-for-img="false"
|
|
7
|
-
config-name="openPrescriptionCover"
|
|
8
|
-
server-name="af-his"
|
|
9
|
-
:show-img-in-cell="true"
|
|
10
|
-
:display-only="true"
|
|
11
|
-
:edit-mode="false"
|
|
12
|
-
:dont-format="true"/>
|
|
13
|
-
</a-card>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
import XReport from './XReport'
|
|
19
|
-
import XAddReport from '../XAddReport/XAddReport.vue'
|
|
20
|
-
// eslint-disable-next-line no-unused-vars
|
|
21
|
-
|
|
22
|
-
export default {
|
|
23
|
-
name: 'XReportDemo',
|
|
24
|
-
components: {
|
|
25
|
-
XReport, XAddReport
|
|
26
|
-
},
|
|
27
|
-
mounted () {
|
|
28
|
-
// this.$refs.xAddReport.init({
|
|
29
|
-
// configName: 'skinTestExecuActionCover',
|
|
30
|
-
// selectedId: '11111',
|
|
31
|
-
// mixinData: {}
|
|
32
|
-
// })
|
|
33
|
-
},
|
|
34
|
-
data () {
|
|
35
|
-
return {
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
methods: {
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
</script>
|
|
42
|
-
<style scoped>
|
|
43
|
-
|
|
44
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div id="test">
|
|
3
|
+
<a-card :bordered="false">
|
|
4
|
+
<XReport
|
|
5
|
+
ref="main"
|
|
6
|
+
:use-oss-for-img="false"
|
|
7
|
+
config-name="openPrescriptionCover"
|
|
8
|
+
server-name="af-his"
|
|
9
|
+
:show-img-in-cell="true"
|
|
10
|
+
:display-only="true"
|
|
11
|
+
:edit-mode="false"
|
|
12
|
+
:dont-format="true"/>
|
|
13
|
+
</a-card>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import XReport from './XReport'
|
|
19
|
+
import XAddReport from '../XAddReport/XAddReport.vue'
|
|
20
|
+
// eslint-disable-next-line no-unused-vars
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: 'XReportDemo',
|
|
24
|
+
components: {
|
|
25
|
+
XReport, XAddReport
|
|
26
|
+
},
|
|
27
|
+
mounted () {
|
|
28
|
+
// this.$refs.xAddReport.init({
|
|
29
|
+
// configName: 'skinTestExecuActionCover',
|
|
30
|
+
// selectedId: '11111',
|
|
31
|
+
// mixinData: {}
|
|
32
|
+
// })
|
|
33
|
+
},
|
|
34
|
+
data () {
|
|
35
|
+
return {
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
methods: {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
<style scoped>
|
|
43
|
+
|
|
44
|
+
</style>
|
|
@@ -78,16 +78,23 @@ export default {
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
computed: {
|
|
81
|
-
//
|
|
81
|
+
// 计算需要显示的日期范围,固定显示周一到周日
|
|
82
82
|
displayDates () {
|
|
83
83
|
const dates = []
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
// 计算当前日期所在周的周一
|
|
85
|
+
const currentDay = dayjs(this.baseDate)
|
|
86
|
+
const dayOfWeek = currentDay.day() || 7 // 获取星期几,将周日的0转换为7
|
|
87
|
+
const mondayOfWeek = currentDay.subtract(dayOfWeek - 1, 'day') // 减去相应的天数得到周一
|
|
88
|
+
|
|
89
|
+
// 从周一开始,生成一周的日期
|
|
90
|
+
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')) // 周日
|
|
97
|
+
|
|
91
98
|
return dates
|
|
92
99
|
}
|
|
93
100
|
},
|
|
@@ -207,8 +214,15 @@ export default {
|
|
|
207
214
|
if (this.config?.minDate && newDate.isBefore(this.config.minDate)) {
|
|
208
215
|
return
|
|
209
216
|
}
|
|
217
|
+
// 更新基准日期
|
|
210
218
|
this.baseDate = newDate.format('YYYY-MM-DD')
|
|
219
|
+
// 同时选中新的日期
|
|
220
|
+
this.currentDate = this.baseDate
|
|
221
|
+
this.$emit('update:modelValue', this.currentDate)
|
|
222
|
+
// 触发前一天事件
|
|
211
223
|
this.$emit('prev-day', this.baseDate)
|
|
224
|
+
// 触发变更事件
|
|
225
|
+
this.$emit('change', this.currentDate)
|
|
212
226
|
},
|
|
213
227
|
|
|
214
228
|
// 后一天
|
|
@@ -217,13 +231,26 @@ export default {
|
|
|
217
231
|
if (this.config?.maxDate && newDate.isAfter(this.config.maxDate)) {
|
|
218
232
|
return
|
|
219
233
|
}
|
|
234
|
+
// 更新基准日期
|
|
220
235
|
this.baseDate = newDate.format('YYYY-MM-DD')
|
|
236
|
+
// 同时选中新的日期
|
|
237
|
+
this.currentDate = this.baseDate
|
|
238
|
+
this.$emit('update:modelValue', this.currentDate)
|
|
239
|
+
// 触发后一天事件
|
|
221
240
|
this.$emit('next-day', this.baseDate)
|
|
241
|
+
// 触发变更事件
|
|
242
|
+
this.$emit('change', this.currentDate)
|
|
222
243
|
},
|
|
223
|
-
|
|
224
244
|
// 前一周
|
|
225
245
|
goToPrevWeek () {
|
|
226
|
-
|
|
246
|
+
// 计算当前日期所在周的周一
|
|
247
|
+
const currentDay = dayjs(this.baseDate)
|
|
248
|
+
const dayOfWeek = currentDay.day() || 7 // 获取星期几,将周日的0转换为7
|
|
249
|
+
const mondayOfWeek = currentDay.subtract(dayOfWeek - 1, 'day') // 减去相应的天数得到周一
|
|
250
|
+
|
|
251
|
+
// 前一周的周一
|
|
252
|
+
const newDate = mondayOfWeek.subtract(7, 'day')
|
|
253
|
+
|
|
227
254
|
if (this.config?.minDate && newDate.isBefore(this.config.minDate)) {
|
|
228
255
|
return
|
|
229
256
|
}
|
|
@@ -233,7 +260,12 @@ export default {
|
|
|
233
260
|
|
|
234
261
|
// 后一周
|
|
235
262
|
goToNextWeek () {
|
|
236
|
-
|
|
263
|
+
// 计算当前日期所在周的周一
|
|
264
|
+
const currentDay = dayjs(this.baseDate)
|
|
265
|
+
const dayOfWeek = currentDay.day() || 7 // 获取星期几,将周日的0转换为7
|
|
266
|
+
const mondayOfWeek = currentDay.subtract(dayOfWeek - 1, 'day') // 减去相应的天数得到周一
|
|
267
|
+
// 后一周的周一
|
|
268
|
+
const newDate = mondayOfWeek.add(7, 'day')
|
|
237
269
|
if (this.config?.maxDate && newDate.isAfter(this.config.maxDate)) {
|
|
238
270
|
return
|
|
239
271
|
}
|
|
@@ -278,8 +310,15 @@ export default {
|
|
|
278
310
|
transition: all 0.3s;
|
|
279
311
|
}
|
|
280
312
|
|
|
281
|
-
|
|
282
|
-
|
|
313
|
+
/* 非选中日期的悬浮效果 */
|
|
314
|
+
.date-item:hover:not(.ant-btn-disabled):not(.ant-btn-primary) {
|
|
315
|
+
background: #e6f7ff;
|
|
316
|
+
color: #1890ff;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/* 选中日期不需要悬浮效果 */
|
|
320
|
+
.date-item.ant-btn-primary:hover {
|
|
321
|
+
background: #1890ff;
|
|
283
322
|
}
|
|
284
323
|
|
|
285
324
|
.date-item.ant-btn-primary {
|
|
@@ -292,6 +331,12 @@ export default {
|
|
|
292
331
|
color: #fff;
|
|
293
332
|
}
|
|
294
333
|
|
|
334
|
+
/* 非选中日期悬浮时的字体颜色 */
|
|
335
|
+
.date-item:hover:not(.ant-btn-disabled):not(.ant-btn-primary) .weekday,
|
|
336
|
+
.date-item:hover:not(.ant-btn-disabled):not(.ant-btn-primary) .date {
|
|
337
|
+
color: #1890ff;
|
|
338
|
+
}
|
|
339
|
+
|
|
295
340
|
.date-item.date-weekend:not(.ant-btn-disabled):not(.ant-btn-primary) {
|
|
296
341
|
color: #ff4d4f;
|
|
297
342
|
}
|