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,566 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<dialog-wrap
|
|
3
|
+
ref="dialog"
|
|
4
|
+
v-drag
|
|
5
|
+
class="p-t-0"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
:visible.sync="visible"
|
|
8
|
+
:title="title"
|
|
9
|
+
:width="width"
|
|
10
|
+
:close-on-click-modal="false"
|
|
11
|
+
@open="popOpen"
|
|
12
|
+
>
|
|
13
|
+
<div class="dialog-view">
|
|
14
|
+
<div class="flex-box">
|
|
15
|
+
<div class="left-c flex-column p-t-m bd-r">
|
|
16
|
+
<div class="flex-box flex-v p-r m-b">
|
|
17
|
+
<span>{{ header }}</span>
|
|
18
|
+
<span class="m-l-m color-999">
|
|
19
|
+
{{ '已选' | $lc }}
|
|
20
|
+
<span class="color-main">{{ dragList.length }}</span>
|
|
21
|
+
</span>
|
|
22
|
+
<el-link :underline="false" type="primary" class="m-l-auto" @click="setAll">{{
|
|
23
|
+
setState ? $lc('全部清空') : $lc('全部选中')
|
|
24
|
+
}}</el-link>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="flex-item p-r" style="height: 50%; overflow: auto">
|
|
27
|
+
<el-checkbox-group :value="dragListN.map((d) => d[labelKey])">
|
|
28
|
+
<template v-if="!columnsGroups">
|
|
29
|
+
<el-checkbox
|
|
30
|
+
v-for="(column, i) in columnsAs"
|
|
31
|
+
:key="i"
|
|
32
|
+
v-hover-tooltip="column[labelKey]"
|
|
33
|
+
:label="column[labelKey]"
|
|
34
|
+
:disabled="column.checked"
|
|
35
|
+
class="m-t"
|
|
36
|
+
@change="(val) => checkChange(val, column)"
|
|
37
|
+
>{{ column[labelKey] }}</el-checkbox
|
|
38
|
+
>
|
|
39
|
+
</template>
|
|
40
|
+
<template v-else>
|
|
41
|
+
<div v-for="gp in columnsGroups" :key="gp.groupId" class="m-b">
|
|
42
|
+
<div class="f-s-b font-w600">{{ gp.groupName }}</div>
|
|
43
|
+
<template v-for="(column, i) in columnsAs">
|
|
44
|
+
<el-checkbox
|
|
45
|
+
v-if="column.groupId === gp.groupId"
|
|
46
|
+
:key="i"
|
|
47
|
+
v-hover-tooltip="column[labelKey]"
|
|
48
|
+
:label="column[labelKey]"
|
|
49
|
+
:disabled="column.checked"
|
|
50
|
+
class="m-t"
|
|
51
|
+
@change="(val) => checkChange(val, column)"
|
|
52
|
+
>{{ column[labelKey] }}</el-checkbox
|
|
53
|
+
>
|
|
54
|
+
</template>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
</el-checkbox-group>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<div v-if="!hasPX" class="right-c flex-column p-t-m">
|
|
61
|
+
<div class="m-b">
|
|
62
|
+
{{ '当前选定项' | $lc }}
|
|
63
|
+
<el-link type="primary" style="visibility: hidden">{{ '当前选定项' | $lc }}</el-link>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="flex-1 overflow-y">
|
|
66
|
+
<drag-list :list="dragList" :label-key="labelKey" :in-show-column="true" />
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div v-else class="right-tree flex-column p-t-m">
|
|
70
|
+
<div class="m-b flex-box flex-lr flex-v">
|
|
71
|
+
{{ '当前选定项' | $lc }}
|
|
72
|
+
<el-link class="m-r-s" :underline="false" icon="n20-icon-xinzeng" @click="add">{{
|
|
73
|
+
'新增字段' | $lc
|
|
74
|
+
}}</el-link>
|
|
75
|
+
</div>
|
|
76
|
+
<el-tree
|
|
77
|
+
ref="menu-tree"
|
|
78
|
+
class="menu-tree"
|
|
79
|
+
:data="dragList"
|
|
80
|
+
:props="{
|
|
81
|
+
children: 'children',
|
|
82
|
+
label: 'label'
|
|
83
|
+
}"
|
|
84
|
+
node-key="prop"
|
|
85
|
+
draggable
|
|
86
|
+
style="width: 200px"
|
|
87
|
+
:allow-drop="allowDrop"
|
|
88
|
+
>
|
|
89
|
+
<span slot-scope="{ node, data }" class="menu-item flex-item flex-box flex-lr flex-v">
|
|
90
|
+
<span>
|
|
91
|
+
<i class="n20-drag-icon n20-icon-tuodong"></i>
|
|
92
|
+
<span
|
|
93
|
+
:class="data.isNew ? 'color-success' : 'color-primary'"
|
|
94
|
+
class="text-ellipsis pointer"
|
|
95
|
+
@click="clickItem(data)"
|
|
96
|
+
>{{ data.label }}</span
|
|
97
|
+
>
|
|
98
|
+
</span>
|
|
99
|
+
<el-link
|
|
100
|
+
class="n20-icon-shanchu"
|
|
101
|
+
:underline="false"
|
|
102
|
+
:disabled="data.checked"
|
|
103
|
+
@click.stop="() => removeMenu(node, data)"
|
|
104
|
+
/>
|
|
105
|
+
</span>
|
|
106
|
+
</el-tree>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
<dialogWrap
|
|
111
|
+
v-drag
|
|
112
|
+
:visible.sync="configVisible"
|
|
113
|
+
:title="'表头设置' | $lc"
|
|
114
|
+
width="350px"
|
|
115
|
+
:close-on-click-modal="false"
|
|
116
|
+
>
|
|
117
|
+
<el-form :model="configModel">
|
|
118
|
+
<el-form-item>
|
|
119
|
+
{{ configModel.label }}
|
|
120
|
+
</el-form-item>
|
|
121
|
+
<el-form-item
|
|
122
|
+
:label="'表头宽度' | $lc"
|
|
123
|
+
:rules="[
|
|
124
|
+
{
|
|
125
|
+
type: 'number',
|
|
126
|
+
trigger: ['change', 'blur'],
|
|
127
|
+
validator: validator
|
|
128
|
+
}
|
|
129
|
+
]"
|
|
130
|
+
prop="width"
|
|
131
|
+
>
|
|
132
|
+
<el-input v-model="configModel.width" class="w-224" />
|
|
133
|
+
</el-form-item>
|
|
134
|
+
<el-form-item :label="'是否折行' | $lc">
|
|
135
|
+
<el-radio-group v-model="configModel.wrap">
|
|
136
|
+
<el-radio :label="true">{{ $lc('是') }}</el-radio>
|
|
137
|
+
<el-radio :label="false">{{ $lc('否') }}</el-radio>
|
|
138
|
+
</el-radio-group>
|
|
139
|
+
</el-form-item>
|
|
140
|
+
<el-form-item :label="'是否加粗' | $lc">
|
|
141
|
+
<el-radio-group v-model="configModel.bold">
|
|
142
|
+
<el-radio :label="true">{{ $lc('是') }}</el-radio>
|
|
143
|
+
<el-radio :label="false">{{ $lc('否') }}</el-radio>
|
|
144
|
+
</el-radio-group>
|
|
145
|
+
</el-form-item>
|
|
146
|
+
<el-form-item :label="'对齐方式' | $lc">
|
|
147
|
+
<el-radio-group v-model="configModel.align">
|
|
148
|
+
<el-radio :label="'right'">{{ $lc('右对齐') }}</el-radio>
|
|
149
|
+
<el-radio :label="'left'">{{ $lc('左对齐') }}</el-radio>
|
|
150
|
+
<el-radio :label="'center'">{{ $lc('居中对齐') }}</el-radio>
|
|
151
|
+
</el-radio-group>
|
|
152
|
+
</el-form-item>
|
|
153
|
+
</el-form>
|
|
154
|
+
<div slot="footer">
|
|
155
|
+
<el-button type="primary" @click="configSave">{{ '确定' | $lc }}</el-button>
|
|
156
|
+
</div>
|
|
157
|
+
</dialogWrap>
|
|
158
|
+
<dialogWrap v-drag :visible.sync="configVisibleN" :title="'新增' | $lc" width="350px" :close-on-click-modal="false">
|
|
159
|
+
<el-form :model="configModelN">
|
|
160
|
+
<el-form-item :label="'名称' | $lc" required>
|
|
161
|
+
<el-input v-model="configModelN.label" class="input-w" :placeholder="'请输入' | $lc" />
|
|
162
|
+
</el-form-item>
|
|
163
|
+
</el-form>
|
|
164
|
+
<div slot="footer">
|
|
165
|
+
<el-button type="primary" @click="configSaveN">{{ '确定' | $lc }}</el-button>
|
|
166
|
+
</div>
|
|
167
|
+
</dialogWrap>
|
|
168
|
+
<div slot="footer" class="text-c">
|
|
169
|
+
<el-button type="primary" @click="setChange">{{ '确定' | $lc }}</el-button>
|
|
170
|
+
<el-button plain @click="reset">{{ '恢复默认' | $lc }}</el-button>
|
|
171
|
+
</div>
|
|
172
|
+
</dialog-wrap>
|
|
173
|
+
</template>
|
|
174
|
+
|
|
175
|
+
<script>
|
|
176
|
+
import axios from '../../utils/axios'
|
|
177
|
+
import { $lc } from '../../utils/i18n/index'
|
|
178
|
+
|
|
179
|
+
import { Message } from 'element-ui'
|
|
180
|
+
import forEachs from '../../utils/forEachs'
|
|
181
|
+
import dialogWrap from '../Dialog/index.vue'
|
|
182
|
+
import dragList from '../DragList/index.vue'
|
|
183
|
+
export default {
|
|
184
|
+
name: 'ShowColumn',
|
|
185
|
+
components: { dialogWrap, dragList },
|
|
186
|
+
inheritAttrs: false,
|
|
187
|
+
props: {
|
|
188
|
+
dialogVisible: {
|
|
189
|
+
type: Boolean,
|
|
190
|
+
default: false
|
|
191
|
+
},
|
|
192
|
+
columns: {
|
|
193
|
+
type: Array,
|
|
194
|
+
default: () => []
|
|
195
|
+
},
|
|
196
|
+
columnsGroups: {
|
|
197
|
+
type: Array,
|
|
198
|
+
default: undefined
|
|
199
|
+
},
|
|
200
|
+
checkColumns: {
|
|
201
|
+
type: Array,
|
|
202
|
+
default: () => []
|
|
203
|
+
},
|
|
204
|
+
isExport: {
|
|
205
|
+
type: Boolean,
|
|
206
|
+
default: false
|
|
207
|
+
},
|
|
208
|
+
isFilter: {
|
|
209
|
+
type: Boolean,
|
|
210
|
+
default: false
|
|
211
|
+
},
|
|
212
|
+
labelKey: {
|
|
213
|
+
type: String,
|
|
214
|
+
default: 'label'
|
|
215
|
+
},
|
|
216
|
+
pageId: {
|
|
217
|
+
type: String,
|
|
218
|
+
default: undefined
|
|
219
|
+
},
|
|
220
|
+
autoSave: {
|
|
221
|
+
type: Boolean,
|
|
222
|
+
default: false
|
|
223
|
+
},
|
|
224
|
+
width: {
|
|
225
|
+
type: String,
|
|
226
|
+
default: '1000px'
|
|
227
|
+
},
|
|
228
|
+
hasPX: {
|
|
229
|
+
type: Boolean,
|
|
230
|
+
default: false
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
data() {
|
|
234
|
+
return {
|
|
235
|
+
dragList: [],
|
|
236
|
+
configVisible: false,
|
|
237
|
+
enabled: false,
|
|
238
|
+
configModel: {
|
|
239
|
+
wrap: false,
|
|
240
|
+
bold: false,
|
|
241
|
+
align: 'center'
|
|
242
|
+
},
|
|
243
|
+
configModelN: {
|
|
244
|
+
label: '',
|
|
245
|
+
prop: '',
|
|
246
|
+
width: 120,
|
|
247
|
+
isNew: true,
|
|
248
|
+
children: []
|
|
249
|
+
},
|
|
250
|
+
userNo: sessionStorage.getItem('userNo'),
|
|
251
|
+
configVisibleN: false,
|
|
252
|
+
dragListN: []
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
computed: {
|
|
256
|
+
title() {
|
|
257
|
+
if (this.isExport) {
|
|
258
|
+
return $lc('导出')
|
|
259
|
+
} else if (this.isFilter) {
|
|
260
|
+
return $lc('筛选')
|
|
261
|
+
} else {
|
|
262
|
+
return $lc('设置显示列')
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
header() {
|
|
266
|
+
if (this.isExport) {
|
|
267
|
+
return $lc('导出')
|
|
268
|
+
} else if (this.isFilter) {
|
|
269
|
+
return $lc('筛选')
|
|
270
|
+
} else {
|
|
271
|
+
return $lc('显示列')
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
visible: {
|
|
275
|
+
get() {
|
|
276
|
+
return this.dialogVisible
|
|
277
|
+
},
|
|
278
|
+
set(val) {
|
|
279
|
+
this.$emit('update:dialogVisible', val)
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
setState() {
|
|
283
|
+
return this.columnsAs.length && this.columnsAs.length === this.dragListN.length
|
|
284
|
+
},
|
|
285
|
+
columnsAs: {
|
|
286
|
+
get() {
|
|
287
|
+
return this.columns.filter((col) => !col.static)
|
|
288
|
+
},
|
|
289
|
+
set(val) {
|
|
290
|
+
return val
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
watch: {
|
|
295
|
+
dragList: {
|
|
296
|
+
handler() {
|
|
297
|
+
let arr = []
|
|
298
|
+
forEachs(this.dragList, (item) => {
|
|
299
|
+
arr.push(item)
|
|
300
|
+
})
|
|
301
|
+
this.dragListN = arr
|
|
302
|
+
/* const newArr = arr.filter((item) => {
|
|
303
|
+
return item.isNew
|
|
304
|
+
})
|
|
305
|
+
newArr.forEach((item) => {
|
|
306
|
+
const index = this.columns.findIndex((col) => col.prop === item.prop || col.label === item.label)
|
|
307
|
+
if (index === -1) {
|
|
308
|
+
this.columns.push(item)
|
|
309
|
+
}
|
|
310
|
+
}) */
|
|
311
|
+
},
|
|
312
|
+
immediate: true,
|
|
313
|
+
deep: true
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
methods: {
|
|
317
|
+
validator(rule, value, callback) {
|
|
318
|
+
if (value) {
|
|
319
|
+
if (value > 300) {
|
|
320
|
+
return callback(new Error($lc('输入最大宽度不能大于300')))
|
|
321
|
+
} else if (!/^[1-9]\d*$/.test(value)) {
|
|
322
|
+
return callback(new Error($lc('表头宽度只能输入正整数')))
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
callback()
|
|
326
|
+
},
|
|
327
|
+
add() {
|
|
328
|
+
this.configVisibleN = true
|
|
329
|
+
this.configModelN.prop = `prop${Date.now()}`
|
|
330
|
+
},
|
|
331
|
+
configSaveN() {
|
|
332
|
+
if (!this.configModelN.label) {
|
|
333
|
+
return this.$message.warning($lc('请填写名称'))
|
|
334
|
+
}
|
|
335
|
+
const hasLabel = this.dragListN.find((item) => {
|
|
336
|
+
return item.label === this.configModelN.label
|
|
337
|
+
})
|
|
338
|
+
if (hasLabel) {
|
|
339
|
+
return this.$message.warning($lc('已有重名字段,请修改'))
|
|
340
|
+
}
|
|
341
|
+
this.dragList.unshift(this.configModelN)
|
|
342
|
+
// this.columns = [this.configModelN, ...this.columns]
|
|
343
|
+
this.$message.success($lc('添加成功'))
|
|
344
|
+
this.configVisibleN = false
|
|
345
|
+
this.configModelN = {
|
|
346
|
+
label: '',
|
|
347
|
+
prop: '',
|
|
348
|
+
width: 120,
|
|
349
|
+
isNew: true,
|
|
350
|
+
children: []
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
removeMenu(node, data) {
|
|
354
|
+
const parent = node.parent
|
|
355
|
+
const children = parent.data.children || parent.data
|
|
356
|
+
const index = children.findIndex((d) => d.prop === data.prop)
|
|
357
|
+
children.splice(index, 1)
|
|
358
|
+
},
|
|
359
|
+
allowDrop(draggingNode, dropNode, type) {
|
|
360
|
+
if (type === 'inner' && draggingNode.data.isNew) {
|
|
361
|
+
return !(draggingNode.level <= dropNode.level)
|
|
362
|
+
} else if (type === 'inner' && !draggingNode.data.isNew) {
|
|
363
|
+
return !(draggingNode.level <= dropNode.level && !dropNode.data.isNew)
|
|
364
|
+
} else {
|
|
365
|
+
return true
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
clickItem(item) {
|
|
369
|
+
this.configModel = item
|
|
370
|
+
this.configVisible = true
|
|
371
|
+
},
|
|
372
|
+
configSave() {
|
|
373
|
+
this.configVisible = false
|
|
374
|
+
},
|
|
375
|
+
popOpen() {
|
|
376
|
+
// 深拷贝一下,防止修改
|
|
377
|
+
this.dragList = JSON.parse(JSON.stringify(this.checkColumns)).filter((col) => !col.static)
|
|
378
|
+
},
|
|
379
|
+
setAll() {
|
|
380
|
+
if (this.setState) {
|
|
381
|
+
this.dragList = this.dragList.filter((c) => c.checked)
|
|
382
|
+
} else {
|
|
383
|
+
this.dragList = [...this.columnsAs]
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
checkChange(val, column) {
|
|
387
|
+
if (val === false) {
|
|
388
|
+
let index = this.dragList.findIndex((d) => d[this.labelKey] === column[this.labelKey])
|
|
389
|
+
index !== -1 && this.dragList.splice(index, 1)
|
|
390
|
+
} else {
|
|
391
|
+
let index = this.dragListN.findIndex((d) => d[this.labelKey] === column[this.labelKey])
|
|
392
|
+
if (index !== -1) {
|
|
393
|
+
Message.warning($lc(`子级请在右侧删除!`))
|
|
394
|
+
return false
|
|
395
|
+
}
|
|
396
|
+
this.dragList.push(column)
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
reset() {
|
|
400
|
+
let dragList = this.columns.filter((col) => col.isDefault)
|
|
401
|
+
this.dragList = dragList.length ? dragList : this.checkColumns.filter((col) => !col.static)
|
|
402
|
+
},
|
|
403
|
+
setChange() {
|
|
404
|
+
if (this.dragList.length < 1) {
|
|
405
|
+
this.$message.error(
|
|
406
|
+
`${$lc(`至少设置`)}${
|
|
407
|
+
this.isExport ? $lc('一列导出数据') : this.isFilter ? $lc('一个筛选条件') : $lc('一列显示列')
|
|
408
|
+
}!`
|
|
409
|
+
)
|
|
410
|
+
return
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
let list = []
|
|
414
|
+
let preCols = this.columns.filter((col) => col.static === 'pre')
|
|
415
|
+
let nextCols = this.columns.filter((col) => col.static === 'next')
|
|
416
|
+
list.push(...preCols, ...this.dragList, ...nextCols)
|
|
417
|
+
// 新增校验
|
|
418
|
+
if (!this.isExport) {
|
|
419
|
+
let state = list.findIndex((c) => c.isNew && c.children && c.children.length === 0)
|
|
420
|
+
if (state !== -1) {
|
|
421
|
+
Message.warning($lc(`新增字段必须包含子级!`))
|
|
422
|
+
return false
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
// 自动保存设置的显示列
|
|
426
|
+
this.userNo = sessionStorage.getItem('userNo')
|
|
427
|
+
!this.isExport && this.autoSave && this.saveColumns(list)
|
|
428
|
+
if (this.isExport) {
|
|
429
|
+
this.visible = false
|
|
430
|
+
this.$emit('setColumns', list)
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
saveColumns(list) {
|
|
434
|
+
let columns = saveTransform(list, this.labelKey, this.isFilter)
|
|
435
|
+
axios.post(
|
|
436
|
+
'/bems/prod_1.0/user/pageHabit',
|
|
437
|
+
{
|
|
438
|
+
userNo: this.userNo,
|
|
439
|
+
pageId: this.pageId,
|
|
440
|
+
showStructure: JSON.stringify(columns)
|
|
441
|
+
},
|
|
442
|
+
{ loading: false }
|
|
443
|
+
).then(() => {
|
|
444
|
+
this.getColumns(this.pageId).then(list => {
|
|
445
|
+
this.visible = false
|
|
446
|
+
this.$emit('setColumns', list)
|
|
447
|
+
})
|
|
448
|
+
})
|
|
449
|
+
},
|
|
450
|
+
getColumns(pageId) {
|
|
451
|
+
return getColumns(pageId || this.pageId, this.userNo, this.columns, this.labelKey)
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function saveTransform(list, labelKey, isFilter) {
|
|
457
|
+
let listN = []
|
|
458
|
+
if (!isFilter) {
|
|
459
|
+
list.forEach((c) => {
|
|
460
|
+
if (c.prop && !c.children && !c.isNew && !c.width & !c.isNew) {
|
|
461
|
+
listN.push({ _colKey: 'prop', _colVal: c.prop })
|
|
462
|
+
} else if (c.slotName) {
|
|
463
|
+
listN.push({ _colKey: 'slotName', _colVal: c.slotName })
|
|
464
|
+
} else if (c.type && ['selection', 'index', 'expand'].includes(c.type)) {
|
|
465
|
+
listN.push({ _colKey: 'type', _colVal: c.type })
|
|
466
|
+
} else {
|
|
467
|
+
let sFn = false
|
|
468
|
+
for (let k in c) {
|
|
469
|
+
// if (typeof c[k] === 'function') sFn = true
|
|
470
|
+
}
|
|
471
|
+
if (sFn && c[labelKey]) {
|
|
472
|
+
listN.push({ _colKey: labelKey, _colVal: c[labelKey] })
|
|
473
|
+
} else {
|
|
474
|
+
listN.push(c)
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
})
|
|
478
|
+
} else {
|
|
479
|
+
list.forEach((c) => {
|
|
480
|
+
if (c.value) {
|
|
481
|
+
listN.push({ _colKey: 'value', _colVal: c.value })
|
|
482
|
+
} else if (c.startValue) {
|
|
483
|
+
listN.push({ _colKey: 'startValue', _colVal: c.startValue })
|
|
484
|
+
} else if (c.startDate) {
|
|
485
|
+
listN.push({ _colKey: 'startDate', _colVal: c.startDate })
|
|
486
|
+
} else if (c.slotName) {
|
|
487
|
+
listN.push({ _colKey: 'slotName', _colVal: c.slotName })
|
|
488
|
+
} else {
|
|
489
|
+
listN.push(c)
|
|
490
|
+
}
|
|
491
|
+
})
|
|
492
|
+
}
|
|
493
|
+
return listN
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function getTransform(list, columnsT, labelKey = 'label') {
|
|
497
|
+
let columns = []
|
|
498
|
+
|
|
499
|
+
list.forEach((d) => {
|
|
500
|
+
// 如果list中的每一项是字符串
|
|
501
|
+
if (typeof d === 'string') {
|
|
502
|
+
// 从columnsT中找到label等于d的项
|
|
503
|
+
let column = columnsT.find((c) => c[labelKey] === d)
|
|
504
|
+
// 如果找到,则将其添加到columns中
|
|
505
|
+
column && columns.push(column)
|
|
506
|
+
// 如果list中的每一项是对象
|
|
507
|
+
} else if (typeof d === 'object') {
|
|
508
|
+
if (d.children) {
|
|
509
|
+
d.children.forEach((item, index) => {
|
|
510
|
+
let column = columnsT.find((c) => c.prop === d.children[index].prop)
|
|
511
|
+
// 如果找到,则将其添加到columns中
|
|
512
|
+
if (column.formatter) {
|
|
513
|
+
d.children[index].formatter = column.formatter
|
|
514
|
+
}
|
|
515
|
+
})
|
|
516
|
+
columns.push(d)
|
|
517
|
+
} else {
|
|
518
|
+
// 如果d中有_colKey属性
|
|
519
|
+
if (d._colKey) {
|
|
520
|
+
// 从columnsT中找到d._colKey等于d._colVal的项
|
|
521
|
+
let column = columnsT.find((c) => c[d._colKey] === d._colVal)
|
|
522
|
+
// 如果找到,则将其添加到columns中
|
|
523
|
+
column && columns.push(column)
|
|
524
|
+
// 如果d中没有_colKey属性
|
|
525
|
+
} else {
|
|
526
|
+
let column = columnsT.find((c) => c.prop === d.prop)
|
|
527
|
+
d.formatter = column.formatter
|
|
528
|
+
// 将d添加到columns中
|
|
529
|
+
columns.push(d)
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
})
|
|
534
|
+
console.log(columns)
|
|
535
|
+
// 返回columns
|
|
536
|
+
return columns
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
// 这段代码在筛选组件中复用
|
|
540
|
+
export function getColumns(pageId, userNo, columnsT, labelKey = 'label') {
|
|
541
|
+
return new Promise((resolve, reject) => {
|
|
542
|
+
axios
|
|
543
|
+
.post(
|
|
544
|
+
'/bems/prod_1.0/user/pageHabit/list',
|
|
545
|
+
{
|
|
546
|
+
userNo: userNo,
|
|
547
|
+
pageId: pageId
|
|
548
|
+
},
|
|
549
|
+
{ loading: false }
|
|
550
|
+
)
|
|
551
|
+
.then(({ data }) => {
|
|
552
|
+
if (data) {
|
|
553
|
+
let _data = JSON.parse(data)
|
|
554
|
+
if (_data && _data.length > 0) {
|
|
555
|
+
let columns = getTransform(_data, columnsT, labelKey)
|
|
556
|
+
return resolve(columns)
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
return resolve(null)
|
|
560
|
+
})
|
|
561
|
+
.catch((err) => {
|
|
562
|
+
reject(err)
|
|
563
|
+
})
|
|
564
|
+
})
|
|
565
|
+
}
|
|
566
|
+
</script>
|
|
@@ -280,7 +280,12 @@ export default {
|
|
|
280
280
|
}
|
|
281
281
|
},
|
|
282
282
|
setState() {
|
|
283
|
-
|
|
283
|
+
const columnsAs = []
|
|
284
|
+
forEachs(this.columnsAs, (item) => {
|
|
285
|
+
columnsAs.push(item)
|
|
286
|
+
})
|
|
287
|
+
return columnsAs.length && columnsAs.length === this.dragListN.length
|
|
288
|
+
// return this.columnsAs.length && this.columnsAs.length === this.dragListN.length
|
|
284
289
|
},
|
|
285
290
|
columnsAs: {
|
|
286
291
|
get() {
|
|
@@ -289,6 +294,9 @@ export default {
|
|
|
289
294
|
set(val) {
|
|
290
295
|
return val
|
|
291
296
|
}
|
|
297
|
+
},
|
|
298
|
+
columnsN() {
|
|
299
|
+
return this.columns || []
|
|
292
300
|
}
|
|
293
301
|
},
|
|
294
302
|
watch: {
|
|
@@ -424,7 +432,7 @@ export default {
|
|
|
424
432
|
// 自动保存设置的显示列
|
|
425
433
|
this.userNo = sessionStorage.getItem('userNo')
|
|
426
434
|
!this.isExport && this.autoSave && this.saveColumns(list)
|
|
427
|
-
|
|
435
|
+
|
|
428
436
|
this.$emit('setColumns', list)
|
|
429
437
|
if (this.isExport) {
|
|
430
438
|
this.visible = false
|
|
@@ -444,7 +452,7 @@ export default {
|
|
|
444
452
|
this.visible = false
|
|
445
453
|
},
|
|
446
454
|
getColumns(pageId) {
|
|
447
|
-
return getColumns(pageId || this.pageId, this.userNo, this.
|
|
455
|
+
return getColumns(pageId || this.pageId, this.userNo, this.columnsN, this.labelKey)
|
|
448
456
|
}
|
|
449
457
|
}
|
|
450
458
|
}
|
|
@@ -455,8 +463,6 @@ function saveTransform(list, labelKey, isFilter) {
|
|
|
455
463
|
list.forEach((c) => {
|
|
456
464
|
if (c.prop && !c.children && !c.isNew && !c.width & !c.isNew) {
|
|
457
465
|
listN.push({ _colKey: 'prop', _colVal: c.prop })
|
|
458
|
-
} else if (c.slotName) {
|
|
459
|
-
listN.push({ _colKey: 'slotName', _colVal: c.slotName })
|
|
460
466
|
} else if (c.type && ['selection', 'index', 'expand'].includes(c.type)) {
|
|
461
467
|
listN.push({ _colKey: 'type', _colVal: c.type })
|
|
462
468
|
} else {
|
|
@@ -479,8 +485,6 @@ function saveTransform(list, labelKey, isFilter) {
|
|
|
479
485
|
listN.push({ _colKey: 'startValue', _colVal: c.startValue })
|
|
480
486
|
} else if (c.startDate) {
|
|
481
487
|
listN.push({ _colKey: 'startDate', _colVal: c.startDate })
|
|
482
|
-
} else if (c.slotName) {
|
|
483
|
-
listN.push({ _colKey: 'slotName', _colVal: c.slotName })
|
|
484
488
|
} else {
|
|
485
489
|
listN.push(c)
|
|
486
490
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="!isDbz" class="n20-statis">
|
|
3
|
-
<span v-if="title" class="p-r-ss text-r stati-item-cell">{{ title }}</span
|
|
4
|
-
|
|
3
|
+
<span v-if="title" class="p-r-ss text-r stati-item-cell">{{ title }}</span>
|
|
4
|
+
<span class="stati-type stati-item-cell p-r-ss">{{ type }}</span
|
|
5
5
|
><span class="n20-statis-division p-r-ss stati-item-cell">|</span
|
|
6
6
|
><span v-for="(item, i) in list" :key="i" class="p-r-ss stati-item-cell"
|
|
7
7
|
>{{ item.label }}:<span v-if="countLabel.includes(item.label)" class="n20-primary">{{ item.value }}</span
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<div v-else class="n20-statis">
|
|
12
12
|
<span class="stati-type stati-item-cell">{{ type }}</span>
|
|
13
13
|
<span v-if="total !== null">:</span>
|
|
14
|
-
<span
|
|
14
|
+
<span class="stati-type stati-item-cell n20-primary p-l-ss">{{ total }}</span>
|
|
15
15
|
<span v-if="total !== null" class="n20-statis-division p-l-ss p-r-ss stati-item-cell">|</span>
|
|
16
16
|
<span v-if="title" class="text-r stati-item-cell p-r-ss">{{ title }}</span>
|
|
17
17
|
<span v-for="(item, i) in list" :key="i" class="p-r-ss p-l-ss stati-item-cell"
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
<script>
|
|
25
25
|
import { $lc } from '../../utils/i18n/index'
|
|
26
|
-
import numerify from 'numerify'
|
|
26
|
+
// import numerify from 'numerify'
|
|
27
|
+
import XEUtils from 'xe-utils'
|
|
27
28
|
const n = 10000
|
|
28
29
|
|
|
29
30
|
export default {
|
|
@@ -32,12 +33,12 @@ export default {
|
|
|
32
33
|
numerify({ label, value }, f, w, unit = '') {
|
|
33
34
|
unit = unit ? (unit === true ? $lc('元') : unit) : ''
|
|
34
35
|
if (!w) {
|
|
35
|
-
return
|
|
36
|
+
return XEUtils.commafy(value, { digits: 2 }) + unit
|
|
36
37
|
} else {
|
|
37
38
|
if (value > n) {
|
|
38
|
-
return
|
|
39
|
+
return XEUtils.commafy(value / n, { digits: 2 }) + $lc('万') + unit
|
|
39
40
|
} else {
|
|
40
|
-
return
|
|
41
|
+
return XEUtils.commafy(value, { digits: 2 }) + unit
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
}
|
|
@@ -58,6 +58,19 @@ export function colfF(colf, map) {
|
|
|
58
58
|
return (row) => tplFn(row, sc, mck, map)
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
export function colfFRow(row, colf, map) {
|
|
62
|
+
if (typeof colf !== 'string') return colf
|
|
63
|
+
let sc = colf.split(/{.+?}/g) || []
|
|
64
|
+
let mc = colf.match(/{.+?}/g) || []
|
|
65
|
+
let mck = []
|
|
66
|
+
mc.forEach((t) => {
|
|
67
|
+
t = t.replace(/^{|\s+|}$/g, '').split('|')
|
|
68
|
+
mck.push(t)
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
return tplFn(row, sc, mck, map)
|
|
72
|
+
}
|
|
73
|
+
|
|
61
74
|
export function colftF(colft, fMap) {
|
|
62
75
|
if (typeof colft !== 'string') return colft
|
|
63
76
|
return fMap[colft]
|