n20-common-lib 2.9.13 → 2.9.14
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/nstc-g6/components/NstcCharts/NstcCharts.vue +16 -8
- package/package.json +8 -5
- package/src/assets/css/approve-card.scss +1 -1
- package/src/assets/css/date-quarter.scss +8 -0
- package/src/assets/css/expandable-pane.scss +7 -0
- package/src/assets/css/file-upload-table.scss +2 -3
- package/src/assets/css/font-icon.scss +3 -1
- package/src/assets/css/message.scss +6 -6
- package/src/assets/css/normalize.scss +4 -1
- package/src/assets/css/table.scss +16 -11
- package/src/assets/iconFont/SIMSUN.ttf +0 -0
- package/src/assets/iconFont/font.css +4 -0
- package/src/components/AIButton/index.vue +101 -0
- package/src/components/AdvancedFilter/formItemRender.vue +7 -4
- package/src/components/AdvancedFilter/index.vue +6 -7
- package/src/components/Anchor/index.vue +1 -0
- package/src/components/ApprovalButtons/index.vue +404 -82
- package/src/components/ApprovalButtons/indexApp.vue +1102 -0
- package/src/components/ApprovalButtons/selectSpr.vue +128 -0
- package/src/components/ApprovalButtons/setCarboncopyProp.vue +1 -1
- package/src/components/ApprovalButtons/setRejectToProp.vue +45 -5
- package/src/components/ApprovalButtons/showAppOpi.vue +265 -8
- package/src/components/ApprovalButtons/showOtherAttrNew.vue +161 -0
- package/src/components/ApprovalCard/index.vue +190 -44
- package/src/components/ApprovalCard/indexApp.vue +592 -0
- package/src/components/ApprovalRecord/approvalImgPro/child.vue +1 -1
- package/src/components/ApprovalRecord/approvalImgPro/index.vue +42 -5
- package/src/components/ApprovalRecord/index.vue +23 -6
- package/src/components/ApprovalRecord/indexApp.vue +79 -0
- package/src/components/AttachmentPass/index.vue +286 -0
- package/src/components/Button/button-group.vue +3 -1
- package/src/components/CascaderArea/index.vue +5 -6
- package/src/components/DatePicker/por.vue +31 -1
- package/src/components/DateSelect/quarterDatePicker.vue +23 -1
- package/src/components/Descriptions/index.vue +7 -3
- package/src/components/Dialog/index.vue +4 -0
- package/src/components/Diff/index.vue +4 -2
- package/src/components/DynamicField/DynamicField.vue +29 -6
- package/src/components/DynamicField/DynamicFieldMixin.js +13 -5
- package/src/components/DynamicField/DynamicFieldOptions.vue +135 -62
- package/src/components/DynamicField/DynamicTable.vue +11 -1
- package/src/components/DynamicField/contentPop.vue +110 -0
- package/src/components/DynamicField/tableList.vue +5 -1
- package/src/components/DynamicField/tableView.vue +143 -0
- package/src/components/ECharts/index.vue +15 -9
- package/src/components/Expandable/main.vue +17 -2
- package/src/components/FileImport/index.vue +4 -5
- package/src/components/FileUploadTable/FileUploadTableV3.vue +937 -0
- package/src/components/FileUploadTable/aiCheckDialog.vue +139 -0
- package/src/components/FileUploadTable/index.vue +251 -33
- package/src/components/FileUploadTable/jytg.svg +6 -0
- package/src/components/FileUploadTable/wsc.svg +3 -0
- package/src/components/FileUploadTable/ysc.svg +3 -0
- package/src/components/HandlingAdvice/index.vue +191 -0
- package/src/components/InputAccount/index.vue +105 -0
- package/src/components/InputNumber/index.vue +16 -4
- package/src/components/InputNumber/numberRange.vue +14 -0
- package/src/components/InputSearch/index.vue +8 -0
- package/src/components/Layout/HeaderWrap/changePwd.vue +50 -23
- package/src/components/Layout/HeaderWrap/index.vue +2 -2
- package/src/components/Layout/HeaderWrap/indexN.vue +296 -119
- package/src/components/Layout/SubContent/index.vue +45 -14
- package/src/components/Layout/indexN.vue +26 -5
- package/src/components/LoginTemporary/form.vue +126 -34
- package/src/components/LoginTemporary/index.vue +14 -3
- package/src/components/LoginTemporary/indexN.vue +35 -13
- package/src/components/Preview/index.vue +199 -0
- package/src/components/SelectDatePickerPro/customDatePicker.vue +7 -0
- package/src/components/SelectDatePickerPro/halfYearPicker.vue +165 -0
- package/src/components/SelectDatePickerPro/index.vue +44 -4
- package/src/components/SelectDatePickerPro/quarterDatePicker.vue +32 -10
- package/src/components/SelectTree/index.vue +10 -4
- package/src/components/SelectTree/pro.vue +3 -0
- package/src/components/ShowColumn/index copy 2.vue +545 -0
- package/src/components/ShowColumn/index copy.vue +566 -0
- package/src/components/ShowColumn/index.vue +11 -7
- package/src/components/Statis/statisItem.vue +8 -7
- package/src/components/Table/filters.js +13 -0
- package/src/components/Table/index.vue +4 -4
- package/src/components/TablePro/filterContent.vue +18 -8
- package/src/components/TablePro/index.js +41 -1
- package/src/components/TablePro/index.vue +117 -6
- package/src/components/TableProOperateColumn/OperateBtns.vue +11 -53
- package/src/components/TableProOperateColumn/OperateBtns_copy.vue +141 -0
- package/src/components/TableProOperateColumn/childrenOperateBtn.vue +108 -0
- package/src/components/TableProOperateColumn/index.vue +3 -6
- package/src/components/TableSetSize/index.vue +1 -1
- package/src/components/Tree/index.vue +21 -5
- package/src/components/Upload/index.vue +25 -10
- package/src/components/Upload/uploadMsg.vue +30 -25
- package/src/components/operatingStatus/index.vue +3 -4
- package/src/directives/VTitle/index.js +15 -5
- package/src/directives/watermark/index.js +140 -56
- package/src/i18n.json +146 -18
- package/src/index.js +31 -3
- package/src/plugins/Sign/CaMap.js +47 -8
- package/src/plugins/Sign/Itrus/index.js +1 -1
- package/src/plugins/Sign/Itrus/sign_3720.js +2 -1
- package/src/plugins/Sign/NetSM3/index.js +20 -11
- package/src/plugins/Sign/NetV3/index.js +163 -22
- package/src/plugins/Sign/SkfSign/index.js +55 -52
- package/src/plugins/Sign/bjca/index.js +229 -9
- package/src/plugins/Sign/hnca/index.js +5064 -0
- package/src/plugins/Sign/index.js +155 -103
- package/src/plugins/Sign/kySign/base64.js +160 -0
- package/src/plugins/Sign/kySign/hex.js +92 -0
- package/src/plugins/Sign/kySign/index.js +186 -0
- package/src/plugins/Sign/kySign/skf.js +937 -0
- package/src/plugins/Sign/kySign/test.html +463 -0
- package/src/plugins/Sign/sdca/index.js +73 -0
- package/src/plugins/Sign/sign.js +72 -52
- package/src/plugins/Sign/signV3/InfosecNetSignCNGAgent.min.js +1 -0
- package/src/plugins/Sign/signV3/sign.js +187 -0
- package/src/plugins/Sign/sign_back.js +172 -0
- package/src/utils/accountFormat.js +7 -0
- package/src/utils/asyncGetRelaNos.js +79 -46
- package/src/utils/axios.js +3 -5
- package/src/utils/i18n/index.js +1 -1
- package/src/utils/importGlobal.js +23 -12
- package/style/fonts/SIMSUN.5e0c362c.ttf +0 -0
- package/style/index.css +2 -2
- package/theme/blue.css +2 -2
- package/theme/cctcRed.css +2 -2
- package/theme/fonts/SIMSUN.5e0c362c.ttf +0 -0
- package/theme/green.css +2 -2
- package/theme/lightBlue.css +2 -2
- package/theme/orange.css +2 -2
- package/theme/purple.css +2 -2
- package/theme/red.css +2 -2
- package/theme/yellow.css +2 -2
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Dialog
|
|
3
|
+
v-drag
|
|
4
|
+
class="p-a-0"
|
|
5
|
+
:title="'附件预览' | $lc"
|
|
6
|
+
:visible.sync="visibleP"
|
|
7
|
+
top="4vh"
|
|
8
|
+
width="96%"
|
|
9
|
+
append-to-body
|
|
10
|
+
:close-on-click-modal="false"
|
|
11
|
+
@close="closeSee"
|
|
12
|
+
>
|
|
13
|
+
<span class="file-upload-table_preview-pn"> </span>
|
|
14
|
+
<div v-if="visiblePv" class="p-a" style="height: 82vh">
|
|
15
|
+
<!-- <ViewerImg v-if="imgType.test(previewName)" :options="viewerOptions" style="height: 100%">
|
|
16
|
+
<img :src="previewUrl" :alt="previewName" style="display: none" />
|
|
17
|
+
</ViewerImg> -->
|
|
18
|
+
<component
|
|
19
|
+
:is="previewSameOrg ? 'object' : 'div'"
|
|
20
|
+
:key="previewUrl"
|
|
21
|
+
:data="previewUrl"
|
|
22
|
+
style="width: 100%; height: calc(100% - 30px)"
|
|
23
|
+
>
|
|
24
|
+
<div class="flex-column flex-c flex-v" style="height: 100%">
|
|
25
|
+
<i class="el-icon-s-release" style="font-size: 60px; color: #999"></i>
|
|
26
|
+
<!-- <span style="margin-top: 16px">
|
|
27
|
+
{{ '不支持在线预览,请' | $lc }}
|
|
28
|
+
<a :href="previewUrl" :download="previewName || previewUrl">下载</a>
|
|
29
|
+
到本地查看
|
|
30
|
+
</span> -->
|
|
31
|
+
<span style="margin-top: 16px">
|
|
32
|
+
{{ '不支持在线预览,请' | $lc }}
|
|
33
|
+
<a :href="previewUrl" :download="previewName || previewUrl">{{ '下载' | $lc }}</a
|
|
34
|
+
>{{ '到本地查看' | $lc }}
|
|
35
|
+
</span>
|
|
36
|
+
</div>
|
|
37
|
+
</component>
|
|
38
|
+
<div class="flex-box flex-c flex-v m-t-s">
|
|
39
|
+
<el-button round onlyicon plain size="mini" icon="el-icon-back" @click="preSee" />
|
|
40
|
+
<span v-if="fileList.length > 0" class="m-l-s m-r-s">{{ index + 1 }}/{{ fileList.length }}</span>
|
|
41
|
+
<el-button round onlyicon plain size="mini" icon="el-icon-right" @click="nextSee" />
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</Dialog>
|
|
45
|
+
</template>
|
|
46
|
+
<script>
|
|
47
|
+
import importG from '../../utils/importGlobal.js'
|
|
48
|
+
import Dialog from '../Dialog/index.vue'
|
|
49
|
+
const ViewerImg = async function () {
|
|
50
|
+
let { component } = await importG('v-viewer', () => import(/*webpackChunkName: "v-viewer"*/ 'v-viewer'))
|
|
51
|
+
return component
|
|
52
|
+
}
|
|
53
|
+
export default {
|
|
54
|
+
name: 'Preview',
|
|
55
|
+
components: {
|
|
56
|
+
ViewerImg,
|
|
57
|
+
Dialog
|
|
58
|
+
},
|
|
59
|
+
props: {
|
|
60
|
+
apiPrefix: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: undefined
|
|
63
|
+
},
|
|
64
|
+
visible: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
fileList: {
|
|
69
|
+
type: Array,
|
|
70
|
+
default: () => {
|
|
71
|
+
return []
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// seeRow: {
|
|
75
|
+
// type: Object,
|
|
76
|
+
// default: () => {}
|
|
77
|
+
// }
|
|
78
|
+
},
|
|
79
|
+
data() {
|
|
80
|
+
this.viewerOptions = {
|
|
81
|
+
debug: true,
|
|
82
|
+
inline: true,
|
|
83
|
+
scalable: false, // 不显示水平(垂直)翻转
|
|
84
|
+
navbar: false,
|
|
85
|
+
button: false,
|
|
86
|
+
title: true,
|
|
87
|
+
toolbar: {
|
|
88
|
+
zoomIn: true,
|
|
89
|
+
zoomOut: true,
|
|
90
|
+
oneToOne: true,
|
|
91
|
+
reset: true,
|
|
92
|
+
rotateLeft: true,
|
|
93
|
+
rotateRight: true,
|
|
94
|
+
flipHorizontal: true,
|
|
95
|
+
flipVertical: true,
|
|
96
|
+
prev: false,
|
|
97
|
+
play: false,
|
|
98
|
+
next: false
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
name: '',
|
|
103
|
+
// 附件预览
|
|
104
|
+
imgType: /\.jpg|\.png|\.gif|\.jpeg|\.svg$/i,
|
|
105
|
+
seeTypes: /\.(jpg|png|gif|svg|pdf|swf|xlsx|xls|docx|doc)$/i,
|
|
106
|
+
previewUrl: undefined,
|
|
107
|
+
previewName: undefined,
|
|
108
|
+
previewSameOrg: false,
|
|
109
|
+
visiblePv: false,
|
|
110
|
+
visiblePvT: null,
|
|
111
|
+
visibleP: false,
|
|
112
|
+
index: 0
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
methods: {
|
|
117
|
+
async preSee() {
|
|
118
|
+
if (this.fileList.length > 0) {
|
|
119
|
+
if (this.index === 0) {
|
|
120
|
+
this.index = this.fileList.length - 1
|
|
121
|
+
} else {
|
|
122
|
+
this.index--
|
|
123
|
+
}
|
|
124
|
+
const { url, name, sameOrg } = await this.getFileInfo(this.fileList[this.index])
|
|
125
|
+
if (url) {
|
|
126
|
+
this.previewSameOrg = sameOrg
|
|
127
|
+
this.previewUrl = url
|
|
128
|
+
this.previewName = name
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
this.$emit('preSee')
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
async nextSee() {
|
|
135
|
+
if (this.fileList.length > 0) {
|
|
136
|
+
if (this.index === this.fileList.length - 1) {
|
|
137
|
+
this.index = 0
|
|
138
|
+
} else {
|
|
139
|
+
this.index++
|
|
140
|
+
}
|
|
141
|
+
const { url, name, sameOrg } = await this.getFileInfo(this.fileList[this.index])
|
|
142
|
+
if (url) {
|
|
143
|
+
this.previewSameOrg = sameOrg
|
|
144
|
+
this.previewUrl = url
|
|
145
|
+
this.previewName = name
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
this.$emit('nextSee')
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
async fileShow(id, fileName = '') {
|
|
153
|
+
let selectid = id
|
|
154
|
+
this.index = 0
|
|
155
|
+
if (this.fileList.length > 0) {
|
|
156
|
+
selectid = this.fileList[this.index]
|
|
157
|
+
}
|
|
158
|
+
this.name = fileName
|
|
159
|
+
const { url, name, sameOrg } = await this.getFileInfo(selectid)
|
|
160
|
+
if (url) {
|
|
161
|
+
this.previewSameOrg = sameOrg
|
|
162
|
+
this.previewUrl = url
|
|
163
|
+
this.previewName = name
|
|
164
|
+
this.visibleP = true
|
|
165
|
+
clearTimeout(this.visiblePvT)
|
|
166
|
+
this.visiblePv = true
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
async getFileInfo(id) {
|
|
170
|
+
const response = await this.$axios.post(
|
|
171
|
+
this.apiPrefix ? this.apiPrefix + '/neams/eamsbaserecord/downloadFile' : '/neams/eamsbaserecord/downloadFile',
|
|
172
|
+
{ beid: id },
|
|
173
|
+
{ responseType: 'blob', loading: true }
|
|
174
|
+
)
|
|
175
|
+
const blob = response
|
|
176
|
+
// 下载文件名
|
|
177
|
+
const name = this.name || blob.name
|
|
178
|
+
let url = ''
|
|
179
|
+
if (!this.seeTypes.test(name)) {
|
|
180
|
+
url = URL.createObjectURL(blob)
|
|
181
|
+
} else {
|
|
182
|
+
url = `/api/onlinePreview?beid=${id}`
|
|
183
|
+
}
|
|
184
|
+
const sameOrg = this.seeTypes.test(name) || this.seeTypes.test(url)
|
|
185
|
+
console.log(url, name, sameOrg)
|
|
186
|
+
return {
|
|
187
|
+
url,
|
|
188
|
+
name,
|
|
189
|
+
sameOrg
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
closeSee() {
|
|
193
|
+
this.previewUrl && URL.revokeObjectURL(this.previewUrl)
|
|
194
|
+
this.previewUrl = undefined
|
|
195
|
+
this.visibleP = false
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
</script>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-popover
|
|
3
|
+
ref="popover"
|
|
4
|
+
v-model="showHalfYear"
|
|
5
|
+
popper-class="half-year-picker el-date-picker"
|
|
6
|
+
width="324"
|
|
7
|
+
placement="bottom-start"
|
|
8
|
+
trigger="click"
|
|
9
|
+
>
|
|
10
|
+
<div class="el-picker-panel__body">
|
|
11
|
+
<div class="el-date-picker__header el-date-picker__header--bordered">
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
aria-label="前一年"
|
|
15
|
+
class="el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left"
|
|
16
|
+
@click="prev"
|
|
17
|
+
></button>
|
|
18
|
+
<span role="button" class="el-date-picker__header-label" @click="handleYear">{{ year }}{{ '年' | $lc }}</span>
|
|
19
|
+
<button
|
|
20
|
+
type="button"
|
|
21
|
+
aria-label="后一年"
|
|
22
|
+
class="el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right"
|
|
23
|
+
@click="next"
|
|
24
|
+
></button>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div v-if="isHalfYear" class="half-year-picker__grid">
|
|
28
|
+
<el-button
|
|
29
|
+
type="text"
|
|
30
|
+
class="half-year-picker__btn"
|
|
31
|
+
:class="halfYear === 1 ? 'isactive' : ''"
|
|
32
|
+
@click="selectHalfYear(0)"
|
|
33
|
+
>{{ year }}{{ '年 上半年' | $lc }}</el-button
|
|
34
|
+
>
|
|
35
|
+
<el-button
|
|
36
|
+
type="text"
|
|
37
|
+
class="half-year-picker__btn"
|
|
38
|
+
:class="halfYear === 2 ? 'isactive' : ''"
|
|
39
|
+
@click="selectHalfYear(1)"
|
|
40
|
+
>{{ year }}{{ '年 下半年' | $lc }}</el-button
|
|
41
|
+
>
|
|
42
|
+
</div>
|
|
43
|
+
<div v-else class="n20-quarter-date-picker__year__grid">
|
|
44
|
+
<el-button
|
|
45
|
+
v-for="item in getYear"
|
|
46
|
+
:key="item"
|
|
47
|
+
type="text"
|
|
48
|
+
size="medium"
|
|
49
|
+
:class="year === item ? 'color-primary' : ''"
|
|
50
|
+
class="n20-quarter-date-picker__btn"
|
|
51
|
+
@click="selectYear(item)"
|
|
52
|
+
>{{ item }}{{ '年' | $lc }}</el-button
|
|
53
|
+
>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<el-input
|
|
57
|
+
slot="reference"
|
|
58
|
+
ref="halfYear"
|
|
59
|
+
v-model="showValue"
|
|
60
|
+
class="el-date-editor"
|
|
61
|
+
clearable
|
|
62
|
+
:placeholder="'选择半年' | $lc"
|
|
63
|
+
@focus="focusFn"
|
|
64
|
+
>
|
|
65
|
+
<i slot="suffix" class="el-input__icon el-icon-date" :class="showValue && 'half-year-picker__input--icon'"></i>
|
|
66
|
+
</el-input>
|
|
67
|
+
</el-popover>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script>
|
|
71
|
+
export default {
|
|
72
|
+
name: 'HalfYearPicker',
|
|
73
|
+
props: {
|
|
74
|
+
value: {
|
|
75
|
+
type: Object,
|
|
76
|
+
default: () => ({})
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
data() {
|
|
80
|
+
return {
|
|
81
|
+
showHalfYear: false,
|
|
82
|
+
year: new Date().getFullYear(),
|
|
83
|
+
isHalfYear: true,
|
|
84
|
+
halfYear: 1,
|
|
85
|
+
showValue: ''
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
computed: {
|
|
89
|
+
getYear() {
|
|
90
|
+
let nfOptionsArray = []
|
|
91
|
+
for (var i = this.year - 4; i <= this.year + 5; i++) {
|
|
92
|
+
nfOptionsArray.push(i)
|
|
93
|
+
}
|
|
94
|
+
return nfOptionsArray
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
watch: {
|
|
98
|
+
value: {
|
|
99
|
+
handler(val) {
|
|
100
|
+
if (val && val.startDate && val.endDate) {
|
|
101
|
+
const regex = /(\d{4})-(\d{2})-(\d{2})/
|
|
102
|
+
const startDateMatch = val.startDate.match(regex)
|
|
103
|
+
const [, year, startMonth] = startDateMatch
|
|
104
|
+
this.year = year
|
|
105
|
+
this.halfYear = startMonth === '01' ? 1 : 2
|
|
106
|
+
this.showValue = `${year} 年 ${startMonth === '01' ? '上半年' : '下半年'}`
|
|
107
|
+
} else {
|
|
108
|
+
this.showValue = ''
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
immediate: true
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
methods: {
|
|
115
|
+
selectYear(i) {
|
|
116
|
+
this.year = i
|
|
117
|
+
this.isHalfYear = true
|
|
118
|
+
},
|
|
119
|
+
prev() {
|
|
120
|
+
this.year = this.year * 1 - 1
|
|
121
|
+
},
|
|
122
|
+
next() {
|
|
123
|
+
this.year = this.year * 1 + 1
|
|
124
|
+
},
|
|
125
|
+
handleYear() {
|
|
126
|
+
this.isHalfYear = false
|
|
127
|
+
},
|
|
128
|
+
focusFn() {
|
|
129
|
+
this.$refs.halfYear.blur()
|
|
130
|
+
},
|
|
131
|
+
selectHalfYear(i) {
|
|
132
|
+
this.halfYear = i + 1
|
|
133
|
+
let arr = [`${this.year}-${i === 0 ? '01' : '07'}`, `${this.year}-${i === 0 ? '06' : '12'}`]
|
|
134
|
+
this.showHalfYear = false
|
|
135
|
+
this.showValue = `${this.year} 年 ${i === 0 ? '上半年' : '下半年'}`
|
|
136
|
+
// 6月最后一天是30 12月最后一天是31
|
|
137
|
+
this.$emit('input', { startDate: arr[0] + '-01', endDate: i === 0 ? arr[1] + '-30' : arr[1] + '-31' })
|
|
138
|
+
this.$emit('change', { startDate: arr[0] + '-01', endDate: i === 0 ? arr[1] + '-30' : arr[1] + '-31' })
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
</script>
|
|
143
|
+
|
|
144
|
+
<style>
|
|
145
|
+
.half-year-picker__grid {
|
|
146
|
+
display: flex;
|
|
147
|
+
justify-content: space-around;
|
|
148
|
+
}
|
|
149
|
+
.half-year-picker__btn {
|
|
150
|
+
flex: 1;
|
|
151
|
+
padding: 10px;
|
|
152
|
+
border: none;
|
|
153
|
+
background: #fff;
|
|
154
|
+
color: var(--text-color-base);
|
|
155
|
+
outline: none;
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
}
|
|
158
|
+
.half-year-picker__btn.isactive {
|
|
159
|
+
color: var(--color-primary);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.el-date-editor:hover .half-year-picker__input--icon {
|
|
163
|
+
display: none;
|
|
164
|
+
}
|
|
165
|
+
</style>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!--结算 日 周 月 年 时间选择控件封装 -->
|
|
3
3
|
<div class="n20-date-select">
|
|
4
|
-
<el-select v-model="type" placeholder="请选择" style="width:
|
|
4
|
+
<el-select v-model="type" placeholder="请选择" style="width: 75px" @change="dateTypeSelectChange">
|
|
5
5
|
<el-option v-for="(item, index) in selectList" :key="index" :label="item" :value="item" />
|
|
6
6
|
</el-select>
|
|
7
7
|
<date-picker
|
|
8
8
|
v-if="type === '日' && selectList.includes(type)"
|
|
9
9
|
key="day"
|
|
10
10
|
v-model="day"
|
|
11
|
-
style="width:
|
|
11
|
+
style="width: 100%"
|
|
12
12
|
format="yyyy-MM-dd"
|
|
13
13
|
value-format="yyyy-MM-dd"
|
|
14
14
|
type="daterange"
|
|
@@ -39,6 +39,13 @@
|
|
|
39
39
|
:placeholder="'选择月' | $lc"
|
|
40
40
|
/>
|
|
41
41
|
<quarter-date-picker v-if="type === '季'" key="quarter" v-model="quarter" :disabled-date="attrs.disabledDate" />
|
|
42
|
+
<HalfYearPicker
|
|
43
|
+
v-if="type === '半年' && selectList.includes(type)"
|
|
44
|
+
key="year"
|
|
45
|
+
v-model="halfYear"
|
|
46
|
+
v-bind="$attrs"
|
|
47
|
+
:placeholder="'选择半年' | $lc"
|
|
48
|
+
/>
|
|
42
49
|
<date-picker
|
|
43
50
|
v-if="type === '年' && selectList.includes(type)"
|
|
44
51
|
key="year"
|
|
@@ -50,6 +57,15 @@
|
|
|
50
57
|
:editable="false"
|
|
51
58
|
:placeholder="'选择年' | $lc"
|
|
52
59
|
/>
|
|
60
|
+
<el-date-picker
|
|
61
|
+
v-if="type === '临时' && selectList.includes(type)"
|
|
62
|
+
v-model="custom"
|
|
63
|
+
type="daterange"
|
|
64
|
+
style="width: 100%"
|
|
65
|
+
value-format="yyyy-MM-dd"
|
|
66
|
+
:start-placeholder="$l('开始日期')"
|
|
67
|
+
:end-placeholder="$l('结束日期')"
|
|
68
|
+
/>
|
|
53
69
|
</div>
|
|
54
70
|
</template>
|
|
55
71
|
|
|
@@ -57,10 +73,11 @@
|
|
|
57
73
|
// TODO: 双向绑定数值格式不统一
|
|
58
74
|
import datePicker from '../DatePicker/index.vue'
|
|
59
75
|
import quarterDatePicker from './quarterDatePicker'
|
|
76
|
+
import HalfYearPicker from './halfYearPicker'
|
|
60
77
|
import dayjs from 'dayjs'
|
|
61
78
|
export default {
|
|
62
79
|
name: 'SelectDatePickerPro',
|
|
63
|
-
components: { datePicker, quarterDatePicker },
|
|
80
|
+
components: { datePicker, quarterDatePicker, HalfYearPicker },
|
|
64
81
|
props: {
|
|
65
82
|
value: {
|
|
66
83
|
type: Object,
|
|
@@ -87,7 +104,7 @@ export default {
|
|
|
87
104
|
selectList: {
|
|
88
105
|
type: Array,
|
|
89
106
|
default: () => {
|
|
90
|
-
return ['日', '周', '月', '季', '年']
|
|
107
|
+
return ['日', '周', '月', '季', '半年', '年', '临时']
|
|
91
108
|
}
|
|
92
109
|
}
|
|
93
110
|
},
|
|
@@ -199,6 +216,15 @@ export default {
|
|
|
199
216
|
this.$emit('change', Object.assign(value, { typeDate: this.type }))
|
|
200
217
|
}
|
|
201
218
|
},
|
|
219
|
+
halfYear: {
|
|
220
|
+
get() {
|
|
221
|
+
return this.value
|
|
222
|
+
},
|
|
223
|
+
set(value) {
|
|
224
|
+
this.$emit('input', Object.assign(value, { typeDate: this.type }))
|
|
225
|
+
this.$emit('change', Object.assign(value, { typeDate: this.type }))
|
|
226
|
+
}
|
|
227
|
+
},
|
|
202
228
|
year: {
|
|
203
229
|
get() {
|
|
204
230
|
if (this.value.startDate) {
|
|
@@ -226,6 +252,20 @@ export default {
|
|
|
226
252
|
this.$emit('change', iYear)
|
|
227
253
|
}
|
|
228
254
|
}
|
|
255
|
+
},
|
|
256
|
+
custom: {
|
|
257
|
+
get() {
|
|
258
|
+
return [this.value.startDate, this.value.endDate]
|
|
259
|
+
},
|
|
260
|
+
set(value) {
|
|
261
|
+
if (value) {
|
|
262
|
+
this.$emit('input', { startDate: value[0], endDate: value[1], typeDate: this.type })
|
|
263
|
+
this.$emit('change', { startDate: value[0], endDate: value[1], typeDate: this.type })
|
|
264
|
+
} else {
|
|
265
|
+
this.$emit('input', { startDate: '', endDate: '', typeDate: this.type })
|
|
266
|
+
this.$emit('change', { startDate: '', endDate: '', typeDate: this.type })
|
|
267
|
+
}
|
|
268
|
+
}
|
|
229
269
|
}
|
|
230
270
|
},
|
|
231
271
|
methods: {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
class="el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left"
|
|
17
17
|
@click="prev"
|
|
18
18
|
></button>
|
|
19
|
-
<span role="button" class="el-date-picker__header-label" @click="handleYear">{{ year }}
|
|
19
|
+
<span role="button" class="el-date-picker__header-label" @click="handleYear">{{ year }}{{ '年' | $lc }}</span>
|
|
20
20
|
<button
|
|
21
21
|
type="button"
|
|
22
22
|
aria-label="后一年"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
class="n20-quarter-date-picker__btn"
|
|
35
35
|
:class="this.season == 1 ? 'isactive' : ''"
|
|
36
36
|
@click="selectSeason(0)"
|
|
37
|
-
>{{ year }}年
|
|
37
|
+
>{{ year }}{{ '年' | $lc }} {{ '第一季度' | $lc }}</el-button
|
|
38
38
|
>
|
|
39
39
|
<el-button
|
|
40
40
|
type="text"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
class="n20-quarter-date-picker__btn"
|
|
44
44
|
:class="this.season == 2 ? 'isactive' : ''"
|
|
45
45
|
@click="selectSeason(1)"
|
|
46
|
-
>{{ year }}年
|
|
46
|
+
>{{ year }}{{ '年' | $lc }} {{ '第二季度' | $lc }}</el-button
|
|
47
47
|
>
|
|
48
48
|
<el-button
|
|
49
49
|
type="text"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
class="n20-quarter-date-picker__btn"
|
|
53
53
|
:class="this.season == 3 ? 'isactive' : ''"
|
|
54
54
|
@click="selectSeason(2)"
|
|
55
|
-
>{{ year }}年
|
|
55
|
+
>{{ year }}{{ '年' | $lc }} {{ '第三季度' | $lc }}</el-button
|
|
56
56
|
>
|
|
57
57
|
<el-button
|
|
58
58
|
:disabled="isDisabled(year, '4')"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
class="n20-quarter-date-picker__btn"
|
|
62
62
|
:class="this.season == 4 ? 'isactive' : ''"
|
|
63
63
|
@click="selectSeason(3)"
|
|
64
|
-
>{{ year }}年
|
|
64
|
+
>{{ year }}{{ '年' | $lc }} {{ '第四季度' | $lc }}</el-button
|
|
65
65
|
>
|
|
66
66
|
</div>
|
|
67
67
|
<div v-else class="n20-quarter-date-picker__year__grid">
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
size="medium"
|
|
73
73
|
:class="year === item ? 'color-primary' : ''"
|
|
74
74
|
class="n20-quarter-date-picker__btn"
|
|
75
|
-
@click="
|
|
76
|
-
>{{ item }}
|
|
75
|
+
@click="selectYear(item)"
|
|
76
|
+
>{{ item }}{{ '年' | $lc }}</el-button
|
|
77
77
|
>
|
|
78
78
|
</div>
|
|
79
79
|
</div>
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
ref="quarterDate"
|
|
84
84
|
v-model="showValue"
|
|
85
85
|
class="el-date-editor"
|
|
86
|
-
placeholder="选择季度"
|
|
86
|
+
:placeholder="'选择季度' | $lc"
|
|
87
87
|
clearable
|
|
88
88
|
@focus="changeFocus"
|
|
89
89
|
>
|
|
@@ -176,7 +176,9 @@ export default {
|
|
|
176
176
|
},
|
|
177
177
|
get() {
|
|
178
178
|
if (this.value.startDate && this.value.endDate) {
|
|
179
|
-
return `${dayjs(this.value.startDate).year()} 年
|
|
179
|
+
return `${dayjs(this.value.startDate).year()} 年 第${this.getChinese(
|
|
180
|
+
dayjs(this.value.endDate).quarter()
|
|
181
|
+
)}季度`
|
|
180
182
|
} else {
|
|
181
183
|
return ''
|
|
182
184
|
}
|
|
@@ -188,6 +190,26 @@ export default {
|
|
|
188
190
|
// this.getDefaultTime()
|
|
189
191
|
},
|
|
190
192
|
methods: {
|
|
193
|
+
getChinese(val) {
|
|
194
|
+
let value = ''
|
|
195
|
+
switch (val) {
|
|
196
|
+
case 1:
|
|
197
|
+
value = '一'
|
|
198
|
+
break
|
|
199
|
+
case 2:
|
|
200
|
+
value = '二'
|
|
201
|
+
break
|
|
202
|
+
case 3:
|
|
203
|
+
value = '三'
|
|
204
|
+
break
|
|
205
|
+
case 4:
|
|
206
|
+
value = '四'
|
|
207
|
+
break
|
|
208
|
+
default:
|
|
209
|
+
break
|
|
210
|
+
}
|
|
211
|
+
return value
|
|
212
|
+
},
|
|
191
213
|
prev() {
|
|
192
214
|
this.year = this.year * 1 - 1
|
|
193
215
|
},
|
|
@@ -201,7 +223,7 @@ export default {
|
|
|
201
223
|
this.isQuarter = true
|
|
202
224
|
this.$refs.quarterDate.blur()
|
|
203
225
|
},
|
|
204
|
-
|
|
226
|
+
selectYear(i) {
|
|
205
227
|
this.year = i
|
|
206
228
|
this.isQuarter = true
|
|
207
229
|
},
|
|
@@ -45,7 +45,9 @@
|
|
|
45
45
|
:class="data[props.disabled] ? 'cursor-not' : ''"
|
|
46
46
|
:style="{ color: data[props.disabled] ? 'var(--color-text-placeholder) ' : '' }"
|
|
47
47
|
>
|
|
48
|
-
{{
|
|
48
|
+
{{
|
|
49
|
+
props.isShowNo && data[props.value] ? '(' + data[props.value] + ') ' + data[props.label] : data[props.label]
|
|
50
|
+
}}
|
|
49
51
|
</div></el-tree
|
|
50
52
|
>
|
|
51
53
|
</el-select>
|
|
@@ -123,6 +125,10 @@ export default {
|
|
|
123
125
|
load: {
|
|
124
126
|
type: Function,
|
|
125
127
|
default: undefined
|
|
128
|
+
},
|
|
129
|
+
bigData: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: false
|
|
126
132
|
}
|
|
127
133
|
},
|
|
128
134
|
data() {
|
|
@@ -153,16 +159,17 @@ export default {
|
|
|
153
159
|
}
|
|
154
160
|
return
|
|
155
161
|
}
|
|
156
|
-
|
|
157
162
|
let dataList = []
|
|
158
163
|
forEachs(this.data, (d) => dataList.push(d), this.props.children)
|
|
159
|
-
|
|
160
164
|
if (!this.multiple) {
|
|
161
165
|
let valueObj = dataList.find((d) => d[this.props.value] === val)
|
|
162
166
|
this.wCdList = valueObj ? [valueObj] : []
|
|
163
167
|
this.$refs['tree']?.setCurrentKey(val)
|
|
164
168
|
} else {
|
|
165
169
|
this.wCdList = dataList.filter((d) => val.includes(d[this.props.value]))
|
|
170
|
+
if (this.bigData && this.wCdList.length > 0) {
|
|
171
|
+
this.wCdList = this.wCdList.slice(0, 1)
|
|
172
|
+
}
|
|
166
173
|
this.$refs['tree']?.setCheckedKeys(val)
|
|
167
174
|
}
|
|
168
175
|
},
|
|
@@ -215,7 +222,6 @@ export default {
|
|
|
215
222
|
nodeClick(data) {
|
|
216
223
|
if (!this.multiple && !data.disabled) {
|
|
217
224
|
this.lazy && (this.tCdList = [data])
|
|
218
|
-
|
|
219
225
|
let vK = this.props.value
|
|
220
226
|
this.$emit('input', data[vK])
|
|
221
227
|
this.$emit('change', data[vK], data)
|
|
@@ -117,6 +117,7 @@ export default {
|
|
|
117
117
|
methods: {
|
|
118
118
|
check(data, { checkedKeys }) {
|
|
119
119
|
this.$emit('input', checkedKeys)
|
|
120
|
+
this.$emit('change', checkedKeys)
|
|
120
121
|
},
|
|
121
122
|
clear() {
|
|
122
123
|
this.$emit('clear')
|
|
@@ -138,9 +139,11 @@ export default {
|
|
|
138
139
|
this.$refs.tree.setCheckedNodes(this.data)
|
|
139
140
|
const data = this.$refs.tree.getCheckedKeys()
|
|
140
141
|
this.$emit('input', data)
|
|
142
|
+
this.$emit('change', data)
|
|
141
143
|
} else {
|
|
142
144
|
this.$refs.tree.setCheckedNodes([])
|
|
143
145
|
this.$emit('input', [])
|
|
146
|
+
this.$emit('change', [])
|
|
144
147
|
}
|
|
145
148
|
}
|
|
146
149
|
}
|