n20-common-lib 2.6.1 → 2.6.2-beta
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 +5 -4
- package/src/assets/css/cl-file-upload-table.scss +2 -2
- package/src/assets/css/cl-layout-header.scss +34 -5
- package/src/assets/css/cl-message.scss +55 -1
- package/src/assets/css/filter.scss +1 -1
- package/src/components/AdvancedFilter/formItemRender.vue +8 -4
- package/src/components/AdvancedFilter/index.vue +37 -13
- package/src/components/AdvancedFilter/utils.js +8 -0
- package/src/components/Anchor/index.vue +5 -1
- package/src/components/ApprovalButtons/showAppOpi.vue +1 -0
- package/src/components/DateSelect/index.vue +29 -4
- package/src/components/DragList/index.vue +6 -2
- package/src/components/ElectronicArchive/index.vue +766 -0
- package/src/components/FileImport/index.vue +6 -0
- package/src/components/FileUploadTable/index.vue +1 -1
- package/src/components/Filters/index.vue +1 -1
- package/src/components/InputNumber/numberRange.vue +2 -0
- package/src/components/Layout/HeaderWrap/changePwd.vue +16 -9
- package/src/components/Layout/HeaderWrap/index.vue +10 -0
- package/src/components/Layout/HeaderWrap/indexN.vue +19 -4
- package/src/components/LoginTemporary/form.vue +8 -0
- package/src/components/SelectDatePickerPro/index.vue +13 -13
- package/src/components/ShowColumn/index.vue +3 -3
- package/src/components/TablePro/filterContent.vue +279 -0
- package/src/components/TablePro/filterContent_tree.vue +172 -0
- package/src/components/TablePro/index.js +30 -0
- package/src/components/TablePro/index.vue +3 -2
- package/src/components/Tree/index.vue +6 -1
- package/src/components/Upload/index.vue +5 -0
- package/src/components/Upload/uploadMsg.vue +7 -5
- package/src/components/operatingStatus/index.vue +5 -3
- package/src/directives/watermark/index.js +69 -0
- package/src/i18n.json +3 -0
- package/src/index.js +117 -109
- package/src/utils/amountInWords.js +17 -100
- package/src/utils/numberPor.js +24 -27
- package/style/index.css +1 -1
- package/theme/blue.css +1 -1
- package/theme/cctcRed.css +1 -1
- package/theme/green.css +1 -1
- package/theme/lightBlue.css +1 -1
- package/theme/orange.css +1 -1
- package/theme/purple.css +1 -1
- package/theme/red.css +1 -1
- package/theme/yellow.css +1 -1
|
@@ -0,0 +1,766 @@
|
|
|
1
|
+
<!--suppress ALL -->
|
|
2
|
+
|
|
3
|
+
<script src="../../utils/auth.js"></script>
|
|
4
|
+
<template>
|
|
5
|
+
<div class="n20-ElectronicArchive">
|
|
6
|
+
<div class="flex-box flex-v flex-lr m-b-s">
|
|
7
|
+
<div>
|
|
8
|
+
<slot name="title">{{ '附件信息' | $lc }}</slot>
|
|
9
|
+
</div>
|
|
10
|
+
<div>
|
|
11
|
+
<slot v-if="!readonly" name="add-btn">
|
|
12
|
+
<el-button type="primary" size="mini" @click="addRow">{{ '新增' | $lc }}</el-button>
|
|
13
|
+
</slot>
|
|
14
|
+
<slot name="down-btn">
|
|
15
|
+
<el-button size="mini" plain @click="downRows">{{ '下载' | $lc }}</el-button>
|
|
16
|
+
</slot>
|
|
17
|
+
<slot v-if="!readonly" name="delete-btn">
|
|
18
|
+
<el-button type="danger" plain size="mini" @click="deleteRows">{{ '删除' | $lc }}</el-button>
|
|
19
|
+
</slot>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<el-table
|
|
23
|
+
:data="tableData"
|
|
24
|
+
:row-key="keys.rowKey"
|
|
25
|
+
border
|
|
26
|
+
@selection-change="(selection) => (selectionList = selection)"
|
|
27
|
+
>
|
|
28
|
+
<slot name="selection-column">
|
|
29
|
+
<el-table-column type="selection" width="50" align="center" />
|
|
30
|
+
</slot>
|
|
31
|
+
<template v-if="dataProp.slotHeader">
|
|
32
|
+
<el-table-column
|
|
33
|
+
v-for="item in dataProp.slotHeader"
|
|
34
|
+
:key="item.prop"
|
|
35
|
+
:label="item.label"
|
|
36
|
+
:prop="item.prop"
|
|
37
|
+
:align="item.align || 'center'"
|
|
38
|
+
:width="item.width || 'auto'"
|
|
39
|
+
:show-overflow-tooltip="item.showOverflowTooltip || item['show-overflow-tooltip']"
|
|
40
|
+
/>
|
|
41
|
+
</template>
|
|
42
|
+
<template v-else>
|
|
43
|
+
<el-table-column :label="'业务类型' | $lc" :prop="keys.bussType">
|
|
44
|
+
<template v-slot:header="scope">
|
|
45
|
+
<slot name="bussType-header" :column="scope.column">{{ '业务类型' | $lc }}</slot>
|
|
46
|
+
</template>
|
|
47
|
+
<template v-slot="{ row }">
|
|
48
|
+
<slot name="type" :row="row">
|
|
49
|
+
<span v-if="readonly">{{ row[keys.bussType] | bussTypeFilter(bussTypeOptions) }}</span>
|
|
50
|
+
<el-select
|
|
51
|
+
v-else
|
|
52
|
+
v-model="row[keys.bussType]"
|
|
53
|
+
:disabled="row._bussTypeDisabled"
|
|
54
|
+
:placeholder="'请选择' | $lc"
|
|
55
|
+
@change="(val) => bussTypeChange(val, row)"
|
|
56
|
+
style="width: 100%"
|
|
57
|
+
>
|
|
58
|
+
<el-option
|
|
59
|
+
v-for="item in bussTypeOptions"
|
|
60
|
+
:key="item.bussValue"
|
|
61
|
+
:disabled="item.disabled"
|
|
62
|
+
:value="item.bussValue"
|
|
63
|
+
:label="item.bussName"
|
|
64
|
+
/>
|
|
65
|
+
</el-select>
|
|
66
|
+
</slot>
|
|
67
|
+
</template>
|
|
68
|
+
</el-table-column>
|
|
69
|
+
<el-table-column :label="'附件类型' | $lc" :prop="keys.type">
|
|
70
|
+
<template v-slot:header="scope">
|
|
71
|
+
<slot name="type-header" :column="scope.column">{{ '附件类型' | $lc }}</slot>
|
|
72
|
+
</template>
|
|
73
|
+
<template v-slot="{ row }">
|
|
74
|
+
<slot name="type" :row="row">
|
|
75
|
+
<span v-if="readonly">{{ row[keys.type] | typeFilter(typeOptions) }}</span>
|
|
76
|
+
<el-select
|
|
77
|
+
v-else
|
|
78
|
+
v-model="row[keys.type]"
|
|
79
|
+
:disabled="row._typeDisabled"
|
|
80
|
+
:placeholder="'请选择' | $lc"
|
|
81
|
+
style="width: 100%"
|
|
82
|
+
>
|
|
83
|
+
<el-option
|
|
84
|
+
v-for="item in typeOptions"
|
|
85
|
+
:key="item.attno"
|
|
86
|
+
:disabled="item.disabled"
|
|
87
|
+
:value="item.attno"
|
|
88
|
+
:label="item.attname"
|
|
89
|
+
/>
|
|
90
|
+
</el-select>
|
|
91
|
+
</slot>
|
|
92
|
+
</template>
|
|
93
|
+
</el-table-column>
|
|
94
|
+
<el-table-column :label="'附件名称' | $lc" :prop="keys.name">
|
|
95
|
+
<template v-slot:header="scope">
|
|
96
|
+
<slot name="name-header" :column="scope.column">{{ '附件名称' | $lc }}</slot>
|
|
97
|
+
</template>
|
|
98
|
+
<template v-slot="{ row }">
|
|
99
|
+
<slot name="name" :row="row">
|
|
100
|
+
<span v-if="readonly">{{ row[keys.name] ? row[keys.name].replace(/\.[A-z0-9]+$/, '') : '' }}</span>
|
|
101
|
+
<el-input
|
|
102
|
+
v-else
|
|
103
|
+
:value="row[keys.name] ? row[keys.name].replace(/\.[A-z0-9]+$/, '') : ''"
|
|
104
|
+
disabled
|
|
105
|
+
:placeholder="'请输入' | $lc"
|
|
106
|
+
/>
|
|
107
|
+
</slot>
|
|
108
|
+
</template>
|
|
109
|
+
</el-table-column>
|
|
110
|
+
<el-table-column v-if="readonly" :label="'附件上传' | $lc" :prop="keys.name">
|
|
111
|
+
<template v-slot:header="scope">
|
|
112
|
+
<slot name="upload-header" :column="scope.column">{{ '附件上传' | $lc }} </slot>
|
|
113
|
+
</template>
|
|
114
|
+
<template v-slot="{ row }">
|
|
115
|
+
<slot name="upload" :row="row">
|
|
116
|
+
{{ $options.filters.fileName(row, keys.url) || row[keys.name] }}
|
|
117
|
+
</slot>
|
|
118
|
+
</template>
|
|
119
|
+
</el-table-column>
|
|
120
|
+
<el-table-column v-if="!readonly" :label="'附件上传' | $lc">
|
|
121
|
+
<template v-slot:header="scope">
|
|
122
|
+
<slot name="upload-header" :column="scope.column">{{ '附件上传' | $lc }} </slot>
|
|
123
|
+
</template>
|
|
124
|
+
<template v-slot="{ row, $index }">
|
|
125
|
+
<slot name="upload" :row="row" :[indexKey]="$index">
|
|
126
|
+
<el-input
|
|
127
|
+
:disabled="!row[keys.type] || !row[keys.bussType] || row._typeDisabled || row.beid"
|
|
128
|
+
:value="row.name"
|
|
129
|
+
:placeholder="placeholder"
|
|
130
|
+
readonly
|
|
131
|
+
@click.native="handleClick(row, $index)"
|
|
132
|
+
>
|
|
133
|
+
<template slot="suffix">
|
|
134
|
+
<i class="el-input__icon n20-icon-shangchuan"></i>
|
|
135
|
+
</template>
|
|
136
|
+
</el-input>
|
|
137
|
+
<Upload
|
|
138
|
+
v-show="false"
|
|
139
|
+
:ref="'upload' + $index"
|
|
140
|
+
class="n20-upload-table-up"
|
|
141
|
+
:file-name="row | fileName(keys.url)"
|
|
142
|
+
:data="row['_fileData'] || fileData"
|
|
143
|
+
:msg-type="null"
|
|
144
|
+
:show-clear="false"
|
|
145
|
+
:action="action"
|
|
146
|
+
:multiple="multiple"
|
|
147
|
+
:headers="dataProp.headers"
|
|
148
|
+
:disabled="!row[keys.type] || row._typeDisabled"
|
|
149
|
+
:accept="row[keys.type] | acceptFilter(typeOptions, fileAccept)"
|
|
150
|
+
:size="row[keys.type] | sizeFilter(typeOptions, fileSize)"
|
|
151
|
+
:http-request="(options) => httpRequest(options, row)"
|
|
152
|
+
:before-upload="(file) => beforeUploadFn(file, row)"
|
|
153
|
+
:on-progress="(event) => onProgressFn(event, row)"
|
|
154
|
+
:on-success="
|
|
155
|
+
(response, file, fileList) =>
|
|
156
|
+
multiple
|
|
157
|
+
? MultipleSUccessFn(response, file, fileList, row)
|
|
158
|
+
: onSuccessFn(response, file, fileList, row)
|
|
159
|
+
"
|
|
160
|
+
:on-error="(err, file, fileList) => errorFn(err, file, fileList, row, $index)"
|
|
161
|
+
/>
|
|
162
|
+
</slot>
|
|
163
|
+
</template>
|
|
164
|
+
</el-table-column>
|
|
165
|
+
<slot name="slotCol"></slot>
|
|
166
|
+
<el-table-column :label="'上传时间' | $lc" :prop="keys.time" sortable width="170" align="left">
|
|
167
|
+
<template v-slot:header="scope">
|
|
168
|
+
<slot name="time-header" :column="scope.column">{{ '上传时间' | $lc }}</slot>
|
|
169
|
+
</template>
|
|
170
|
+
<template v-slot="{ row }">
|
|
171
|
+
<slot name="time" :row="row">{{ row[keys.time] }}</slot>
|
|
172
|
+
</template>
|
|
173
|
+
</el-table-column>
|
|
174
|
+
<el-table-column v-if="!hideUser" :label="'上传人' | $lc" :prop="keys.user" width="100">
|
|
175
|
+
<template v-slot:header="scope">
|
|
176
|
+
<slot name="user-header" :column="scope.column">{{ '上传人' | $lc }}</slot>
|
|
177
|
+
</template>
|
|
178
|
+
<template v-slot="{ row }">
|
|
179
|
+
<slot name="user" :row="row">{{ row[keys.user] }}</slot>
|
|
180
|
+
</template>
|
|
181
|
+
</el-table-column>
|
|
182
|
+
</template>
|
|
183
|
+
<el-table-column v-if="!readonly" :label="'上传进度' | $lc" width="220">
|
|
184
|
+
<template v-slot:header="scope">
|
|
185
|
+
<slot name="percent-header" :column="scope.column">{{ '上传进度' | $lc }}</slot>
|
|
186
|
+
</template>
|
|
187
|
+
<template v-slot="{ row, $index }">
|
|
188
|
+
<slot name="percent" :row="row" :[indexKey]="$index">
|
|
189
|
+
<div v-if="row['_percent'] >= 0 && !row._typeDisabled" class="flex-box flex-v">
|
|
190
|
+
<el-progress
|
|
191
|
+
class="n20-upload-table-progress"
|
|
192
|
+
:percentage="row['_percent']"
|
|
193
|
+
:status="row._status"
|
|
194
|
+
text-color=""
|
|
195
|
+
style="width: 140px"
|
|
196
|
+
/>
|
|
197
|
+
<el-button
|
|
198
|
+
v-if="row['_status'] === 'exception'"
|
|
199
|
+
type="text"
|
|
200
|
+
size="mini"
|
|
201
|
+
style="width: 60px"
|
|
202
|
+
@click="anewSubmitFn(row, $index)"
|
|
203
|
+
>{{ '重新上传' | $lc }}
|
|
204
|
+
</el-button>
|
|
205
|
+
<el-button
|
|
206
|
+
v-else-if="row['_percent'] >= 0 && row['_percent'] < 100"
|
|
207
|
+
type="text"
|
|
208
|
+
size="mini"
|
|
209
|
+
style="width: 60px"
|
|
210
|
+
@click="abortFn(row, $index)"
|
|
211
|
+
>{{ '取消' | $lc }}
|
|
212
|
+
</el-button>
|
|
213
|
+
</div>
|
|
214
|
+
</slot>
|
|
215
|
+
</template>
|
|
216
|
+
</el-table-column>
|
|
217
|
+
<el-table-column :label="'操作' | $lc" align="center" width="90" fixed="right">
|
|
218
|
+
<template v-slot:header="scope">
|
|
219
|
+
<slot name="handle-header" :column="scope.column">{{ '操作' | $lc }}</slot>
|
|
220
|
+
</template>
|
|
221
|
+
<template v-slot="{ row }">
|
|
222
|
+
<slot name="handle" :row="row">
|
|
223
|
+
<el-button type="text" icon="el-icon-view" :disabled="!row[keys.url]" @click="seeFile(row)" />
|
|
224
|
+
<el-button
|
|
225
|
+
v-if="readonly"
|
|
226
|
+
type="text"
|
|
227
|
+
icon="el-icon-download"
|
|
228
|
+
:disabled="!row[keys.url]"
|
|
229
|
+
@click="downFile(row)"
|
|
230
|
+
/>
|
|
231
|
+
</slot>
|
|
232
|
+
</template>
|
|
233
|
+
</el-table-column>
|
|
234
|
+
</el-table>
|
|
235
|
+
|
|
236
|
+
<Dialog title="基础附件选择" :visible.sync="baseVisible">
|
|
237
|
+
<el-table :data="baseAttnoData" border height="400px">
|
|
238
|
+
<el-table-column label="选择" align="center" width="65">
|
|
239
|
+
<template scope="scope">
|
|
240
|
+
<el-radio :label="scope.$index" v-model="radio" @change.native="getCurrentRow(scope.row)">{{}}</el-radio>
|
|
241
|
+
</template>
|
|
242
|
+
</el-table-column>
|
|
243
|
+
<el-table-column prop="recordname" label="文件名称" />
|
|
244
|
+
<el-table-column prop="attname" width="120px" show-overflow-tooltip label="附件类型名称" />
|
|
245
|
+
<el-table-column prop="cltName" width="140px" show-overflow-tooltip label="所属单位" />
|
|
246
|
+
<el-table-column prop="fileVersion" align="center" label="版本号" />
|
|
247
|
+
<el-table-column prop="startValidTime" width="120px" label="起始有效时间" align="center" />
|
|
248
|
+
<el-table-column prop="endValidTime" width="120px" label="截至有效时间" align="center"> </el-table-column>
|
|
249
|
+
<el-table-column prop="uploadTime" label="更新时间" width="160px" align="center">
|
|
250
|
+
<template v-slot="{ row }">
|
|
251
|
+
{{ dayjs(row.uploadTime).format('YYYY-MM-DD HH:mm:ss') }}
|
|
252
|
+
</template>
|
|
253
|
+
</el-table-column>
|
|
254
|
+
<el-table-column prop="isEnable" label="状态" align="center">
|
|
255
|
+
<template v-slot="{ row }">
|
|
256
|
+
<span>{{ row.isEnable === '1' ? '启用' : '禁用' }}</span>
|
|
257
|
+
</template>
|
|
258
|
+
</el-table-column>
|
|
259
|
+
</el-table>
|
|
260
|
+
</Dialog>
|
|
261
|
+
|
|
262
|
+
<Dialog
|
|
263
|
+
v-drag
|
|
264
|
+
class="p-a-0"
|
|
265
|
+
:title="'附件预览' | $lc"
|
|
266
|
+
:visible.sync="visibleP"
|
|
267
|
+
top="2vh"
|
|
268
|
+
width="96%"
|
|
269
|
+
:close-on-click-modal="false"
|
|
270
|
+
@close="closeSee"
|
|
271
|
+
>
|
|
272
|
+
<span class="file-upload-table_preview-pn">
|
|
273
|
+
<el-button round onlyicon plain size="mini" icon="el-icon-back" @click="preSee" />
|
|
274
|
+
<el-button round onlyicon plain size="mini" icon="el-icon-right" @click="nextSee" />
|
|
275
|
+
</span>
|
|
276
|
+
|
|
277
|
+
<div v-if="visiblePv" class="p-a" style="height: 82vh">
|
|
278
|
+
<ViewerImg v-if="imgType.test(previewName)" :options="viewerOptions" style="height: 100%">
|
|
279
|
+
<img :src="previewUrl" :alt="previewName" style="display: none" />
|
|
280
|
+
</ViewerImg>
|
|
281
|
+
<component
|
|
282
|
+
:is="previewSameOrg ? 'object' : 'div'"
|
|
283
|
+
v-else
|
|
284
|
+
:key="previewUrl"
|
|
285
|
+
:data="previewUrl"
|
|
286
|
+
style="width: 100%; height: 100%"
|
|
287
|
+
>
|
|
288
|
+
<div class="flex-column flex-c flex-v" style="height: 100%">
|
|
289
|
+
<i class="el-icon-s-release" style="font-size: 60px; color: #999"></i>
|
|
290
|
+
<span style="margin-top: 16px">
|
|
291
|
+
{{ '不支持在线预览,请' | $lc
|
|
292
|
+
}}<el-link type="primary" class="color-primary" @click="downFile(seeRow)">{{ '下载' | $lc }}</el-link
|
|
293
|
+
>{{ '到本地查看' | $lc }}
|
|
294
|
+
</span>
|
|
295
|
+
</div>
|
|
296
|
+
</component>
|
|
297
|
+
</div>
|
|
298
|
+
</Dialog>
|
|
299
|
+
</div>
|
|
300
|
+
</template>
|
|
301
|
+
|
|
302
|
+
<script>
|
|
303
|
+
import _axios from 'axios'
|
|
304
|
+
import auth from '../../utils/auth.js'
|
|
305
|
+
import Upload from '../Upload/index.vue'
|
|
306
|
+
import { $lc } from '../../utils/i18n/index.js'
|
|
307
|
+
import axios from '../../utils/axios.js'
|
|
308
|
+
import { msgboxPor } from '../../utils/msgboxPor'
|
|
309
|
+
import dayjs from 'dayjs'
|
|
310
|
+
import Dialog from '../Dialog/index.vue'
|
|
311
|
+
import 'viewerjs/dist/viewer.css'
|
|
312
|
+
import importG from '../../utils/importGlobal.js'
|
|
313
|
+
import downloadBlob from '../../utils/downloadBlob.js'
|
|
314
|
+
|
|
315
|
+
const ViewerImg = async function () {
|
|
316
|
+
let { component } = await importG('v-viewer', () => import(/*webpackChunkName: "v-viewer"*/ 'v-viewer'))
|
|
317
|
+
return component
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const keysDefault = {
|
|
321
|
+
rowKey: 'id',
|
|
322
|
+
bussType: 'bussValue',
|
|
323
|
+
type: 'attno',
|
|
324
|
+
name: 'name',
|
|
325
|
+
url: 'url',
|
|
326
|
+
time: 'time',
|
|
327
|
+
user: 'user'
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export default {
|
|
331
|
+
name: 'ElectronicArchive',
|
|
332
|
+
components: { Dialog, Upload, ViewerImg },
|
|
333
|
+
props: {
|
|
334
|
+
readonly: {
|
|
335
|
+
type: Boolean,
|
|
336
|
+
default: false
|
|
337
|
+
},
|
|
338
|
+
showClear: {
|
|
339
|
+
type: Boolean,
|
|
340
|
+
default: true
|
|
341
|
+
},
|
|
342
|
+
dataProp: {
|
|
343
|
+
type: Object,
|
|
344
|
+
default: () => {
|
|
345
|
+
return {
|
|
346
|
+
appno: '',
|
|
347
|
+
syscode: '',
|
|
348
|
+
bussValue: '',
|
|
349
|
+
bussId: ''
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
multiple: {
|
|
354
|
+
type: Boolean,
|
|
355
|
+
default: false
|
|
356
|
+
},
|
|
357
|
+
uploadHttpRequest: {
|
|
358
|
+
type: Function,
|
|
359
|
+
default: undefined
|
|
360
|
+
},
|
|
361
|
+
hideUser: {
|
|
362
|
+
type: Boolean,
|
|
363
|
+
default: false
|
|
364
|
+
},
|
|
365
|
+
placeholder: {
|
|
366
|
+
type: String,
|
|
367
|
+
default: $lc('请上传附件')
|
|
368
|
+
},
|
|
369
|
+
getFileMethod: {
|
|
370
|
+
type: Function,
|
|
371
|
+
default: undefined
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
data() {
|
|
375
|
+
this.viewerOptions = {
|
|
376
|
+
debug: true,
|
|
377
|
+
inline: true,
|
|
378
|
+
scalable: false, // 不显示水平(垂直)翻转
|
|
379
|
+
navbar: false,
|
|
380
|
+
button: false,
|
|
381
|
+
title: true,
|
|
382
|
+
toolbar: {
|
|
383
|
+
zoomIn: true,
|
|
384
|
+
zoomOut: true,
|
|
385
|
+
oneToOne: true,
|
|
386
|
+
reset: true,
|
|
387
|
+
rotateLeft: true,
|
|
388
|
+
rotateRight: true,
|
|
389
|
+
flipHorizontal: true,
|
|
390
|
+
flipVertical: true,
|
|
391
|
+
prev: false,
|
|
392
|
+
play: false,
|
|
393
|
+
next: false
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return {
|
|
397
|
+
dayjs,
|
|
398
|
+
radio: '',
|
|
399
|
+
action: '/api/neams/eamsbaserecord/save',
|
|
400
|
+
indexKey: '$index',
|
|
401
|
+
visibleP: false,
|
|
402
|
+
baseVisible: false,
|
|
403
|
+
baseAttnoData: [],
|
|
404
|
+
userInfo: JSON.parse(sessionStorage.getItem('userInfo')),
|
|
405
|
+
row: {},
|
|
406
|
+
imgType: /\.(jpg|png|gif|svg)$/i,
|
|
407
|
+
visiblePv: false,
|
|
408
|
+
seeRow: {},
|
|
409
|
+
tableData: [],
|
|
410
|
+
previewUrl: '',
|
|
411
|
+
previewName: '',
|
|
412
|
+
bussType: {},
|
|
413
|
+
bussTypeOptions: [],
|
|
414
|
+
filesList: [],
|
|
415
|
+
tempIndex: 1,
|
|
416
|
+
chooseVisible: false,
|
|
417
|
+
typeOptions: [],
|
|
418
|
+
previewSameOrg: false,
|
|
419
|
+
selectionList: []
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
computed: {
|
|
423
|
+
keys() {
|
|
424
|
+
return this.dataProp?.keys || keysDefault
|
|
425
|
+
},
|
|
426
|
+
fileAccept() {
|
|
427
|
+
return this.dataPorp?.fileAccept || undefined
|
|
428
|
+
},
|
|
429
|
+
fileSize() {
|
|
430
|
+
return this.dataPorp?.fileSize || undefined
|
|
431
|
+
},
|
|
432
|
+
fileData() {
|
|
433
|
+
return this.dataPorp?.fileData
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
filters: {
|
|
437
|
+
bussTypeFilter(type, bussTypeOptions) {
|
|
438
|
+
return bussTypeOptions.find((c) => c.bussValue === type)?.bussName || ''
|
|
439
|
+
},
|
|
440
|
+
typeFilter(type, typeOptions) {
|
|
441
|
+
return typeOptions.find((c) => c.attno === type)?.attname || ''
|
|
442
|
+
},
|
|
443
|
+
acceptFilter(type, typeOptions, fileAccept) {
|
|
444
|
+
return typeOptions.find((c) => c.type === type)?.accept || fileAccept
|
|
445
|
+
},
|
|
446
|
+
sizeFilter(type, typeOptions, fileSize) {
|
|
447
|
+
return typeOptions.find((c) => c.type === type)?.size || fileSize
|
|
448
|
+
},
|
|
449
|
+
fileName(row, urlK) {
|
|
450
|
+
if (row['_name']) {
|
|
451
|
+
return row['_name']
|
|
452
|
+
} else if (row[urlK]) {
|
|
453
|
+
let urlArr = row[urlK].split('/')
|
|
454
|
+
let _n = urlArr[urlArr.length - 1]
|
|
455
|
+
return _n ? decodeURI(_n) : undefined
|
|
456
|
+
}
|
|
457
|
+
return undefined
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
mounted() {
|
|
461
|
+
this.getBussTypeList()
|
|
462
|
+
this.getAttachList()
|
|
463
|
+
if (this.dataProp.bussId && this.dataProp.bussValue) {
|
|
464
|
+
this.getFileList()
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
methods: {
|
|
468
|
+
handleClick(row, index) {
|
|
469
|
+
this.row = row
|
|
470
|
+
this.$msgboxPor({
|
|
471
|
+
customClass: 'ElectronicArchive_msgboxPor',
|
|
472
|
+
showCancelButton: true,
|
|
473
|
+
confirmButtonText: '本地文件上传',
|
|
474
|
+
cancelButtonText: '选择基础附件',
|
|
475
|
+
center: true
|
|
476
|
+
})
|
|
477
|
+
.then((res) => {
|
|
478
|
+
this.handleUpload(index)
|
|
479
|
+
})
|
|
480
|
+
.catch((error) => {
|
|
481
|
+
this.getBaseData(row)
|
|
482
|
+
this.baseVisible = true
|
|
483
|
+
console.log('选择基础附件', row)
|
|
484
|
+
})
|
|
485
|
+
},
|
|
486
|
+
getCurrentRow(row) {
|
|
487
|
+
axios.post(`/api/neams/eamsbaserecord/fileBind/bussId/beid/bussValue`, {
|
|
488
|
+
beid: row.beid,
|
|
489
|
+
beids: [row.beid],
|
|
490
|
+
bussId: this.dataProp.bussId || this.row.bussId,
|
|
491
|
+
bussValue: this.dataProp.bussValue
|
|
492
|
+
})
|
|
493
|
+
this.baseVisible = false
|
|
494
|
+
this.getFileList()
|
|
495
|
+
},
|
|
496
|
+
async getFileList() {
|
|
497
|
+
const { code, data } = await axios.post(`/api/neams/eamsbaserecord/queryList?t=${Date.now()}`, {
|
|
498
|
+
bussValue: this.dataProp.bussValue,
|
|
499
|
+
bussId: this.dataProp.bussId
|
|
500
|
+
})
|
|
501
|
+
if (code === 200) {
|
|
502
|
+
this.tableData = data || []
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
async getBaseData(row) {
|
|
506
|
+
const { data } = await axios.post(`/api/neams/eamsBaseFile/qureyPageBaseFile`, {
|
|
507
|
+
current: 1,
|
|
508
|
+
attno: row.attno,
|
|
509
|
+
pageSize: 200
|
|
510
|
+
})
|
|
511
|
+
this.baseAttnoData = data.records || []
|
|
512
|
+
},
|
|
513
|
+
handleUpload(i) {
|
|
514
|
+
this.$refs['upload' + i].$refs['upload'].$refs['upload-inner'].handleClick()
|
|
515
|
+
},
|
|
516
|
+
httpRequest(options, row) {
|
|
517
|
+
if (this.uploadHttpRequest) {
|
|
518
|
+
return this.uploadHttpRequest(options, row)
|
|
519
|
+
}
|
|
520
|
+
return this.defindHttpRequest(options, row)
|
|
521
|
+
},
|
|
522
|
+
defindHttpRequest(options, row) {
|
|
523
|
+
const formData = new FormData()
|
|
524
|
+
formData.append(options.filename, options.file)
|
|
525
|
+
const data = options.data || [
|
|
526
|
+
{
|
|
527
|
+
syscode: row.syscode, // 系统
|
|
528
|
+
appno: row.appno, // 模块名
|
|
529
|
+
bussValue: row.bussValue, // 业务品种
|
|
530
|
+
attno: row.attno, // 附件类型
|
|
531
|
+
bussId: row.bussId, // 业务ID
|
|
532
|
+
cltno: this.userInfo.cltno,
|
|
533
|
+
deptno: this.userInfo.cltno,
|
|
534
|
+
memo: options.file.name,
|
|
535
|
+
recordname: options.file.name,
|
|
536
|
+
fileSize: options.file.size
|
|
537
|
+
}
|
|
538
|
+
]
|
|
539
|
+
formData.append('data', JSON.stringify(data))
|
|
540
|
+
formData.append('date', dayjs().format('YYYY-MM-DD HH:mm:ss') + ',2099-12-31 23:59:59')
|
|
541
|
+
let abort
|
|
542
|
+
let Pro = axios.post(options.action + '?r=' + Math.random(), formData, {
|
|
543
|
+
headers: Object.assign(auth.setHeaders(this.dataProp.headers), { 'Content-Type': 'multipart/form-data' }),
|
|
544
|
+
loading: false,
|
|
545
|
+
onUploadProgress: (arg) => {
|
|
546
|
+
if (options.onProgress) {
|
|
547
|
+
arg.percent = arg.progress * 100
|
|
548
|
+
options.onProgress(arg)
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
cancelToken: new _axios.CancelToken((cancel) => {
|
|
552
|
+
abort = cancel
|
|
553
|
+
})
|
|
554
|
+
})
|
|
555
|
+
Pro.abort = abort
|
|
556
|
+
return Pro
|
|
557
|
+
},
|
|
558
|
+
|
|
559
|
+
// clearFile() {
|
|
560
|
+
// },
|
|
561
|
+
/**
|
|
562
|
+
* 获取业务类型列表
|
|
563
|
+
* @returns {Promise<void>}
|
|
564
|
+
*/
|
|
565
|
+
async getBussTypeList() {
|
|
566
|
+
let dto = {
|
|
567
|
+
appno: this.dataProp.appno,
|
|
568
|
+
bussValue: this.dataProp.bussValue
|
|
569
|
+
}
|
|
570
|
+
const { code, data } = await axios.post(`/api/neams/eamsbusstype/getListByGradeAndBussValue`, dto)
|
|
571
|
+
if (code === 200) {
|
|
572
|
+
this.bussTypeOptions = data || []
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
/**
|
|
576
|
+
* 获取附件列表
|
|
577
|
+
* @returns {Promise<void>}
|
|
578
|
+
*/
|
|
579
|
+
async getAttachList() {
|
|
580
|
+
let dto = {
|
|
581
|
+
bussValue: this.dataProp.bussValue
|
|
582
|
+
}
|
|
583
|
+
const { data, code } = await axios.post(`/api/neams/eamsattachfile/getByBussValue`, dto)
|
|
584
|
+
if (code === 200) {
|
|
585
|
+
this.typeOptions = data || []
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
bussTypeChange(val, row) {
|
|
589
|
+
let bussId = this.bussTypeOptions.find((item) => item.bussValue === val)?.bussId || ''
|
|
590
|
+
this.$set(row, 'bussId', bussId)
|
|
591
|
+
},
|
|
592
|
+
/**
|
|
593
|
+
* 新增
|
|
594
|
+
*/
|
|
595
|
+
addRow() {
|
|
596
|
+
this.tableData.push({
|
|
597
|
+
[this.keys.id]: 'id' + Date.now(),
|
|
598
|
+
[this.keys.type]: undefined,
|
|
599
|
+
[this.keys.bussType]: this.bussTypeOptions.length === 1 ? this.bussTypeOptions[0].bussValue : '',
|
|
600
|
+
[this.keys.name]: '',
|
|
601
|
+
[this.keys.url]: '',
|
|
602
|
+
[this.keys.time]: '',
|
|
603
|
+
[this.keys.user]: this.userInfo.uname,
|
|
604
|
+
syscode: this.dataProp.syscode,
|
|
605
|
+
bussValue: this.dataProp.bussValue,
|
|
606
|
+
appno: this.dataProp.appno,
|
|
607
|
+
bussId: this.bussTypeOptions.length === 1 ? this.bussTypeOptions[0].bussId : '',
|
|
608
|
+
_bussTypeDisabled: this.bussTypeOptions.length === 1
|
|
609
|
+
})
|
|
610
|
+
this.bussType = this.bussTypeOptions.length === 1 && this.bussTypeOptions[0]
|
|
611
|
+
this.$emit('add-row')
|
|
612
|
+
},
|
|
613
|
+
/**
|
|
614
|
+
* 下载
|
|
615
|
+
*/
|
|
616
|
+
downRows() {
|
|
617
|
+
if (!this.selectionList.length) {
|
|
618
|
+
return this.$message({
|
|
619
|
+
message: $lc(`请先勾选要下载的数据!`),
|
|
620
|
+
type: 'warning',
|
|
621
|
+
showClose: true
|
|
622
|
+
})
|
|
623
|
+
}
|
|
624
|
+
// 自行下载
|
|
625
|
+
let filesId = this.selectionList.map((item) => item.beid)
|
|
626
|
+
if (filesId.length === 0) {
|
|
627
|
+
return this.$message.warning('请勾选附件')
|
|
628
|
+
}
|
|
629
|
+
let data = filesId.map((item) => {
|
|
630
|
+
return {
|
|
631
|
+
beid: item
|
|
632
|
+
}
|
|
633
|
+
})
|
|
634
|
+
axios
|
|
635
|
+
.post(`/api/neams/eamsbaserecord/batchDownloadFiles`, data, {
|
|
636
|
+
responseType: 'blob'
|
|
637
|
+
})
|
|
638
|
+
.then((res) => {
|
|
639
|
+
if (res) {
|
|
640
|
+
downloadBlob(res, '附件压缩包.zip')
|
|
641
|
+
}
|
|
642
|
+
})
|
|
643
|
+
},
|
|
644
|
+
deleteRows() {
|
|
645
|
+
this.deleteRowsFn(this.selectionList)
|
|
646
|
+
},
|
|
647
|
+
/**
|
|
648
|
+
* 删除
|
|
649
|
+
*/
|
|
650
|
+
async deleteRowsFn(rows, update) {
|
|
651
|
+
if (rows.length === 0) {
|
|
652
|
+
this.$message({
|
|
653
|
+
message: '请勾选所需要删除的附件',
|
|
654
|
+
type: 'warning'
|
|
655
|
+
})
|
|
656
|
+
return
|
|
657
|
+
}
|
|
658
|
+
console.log(rows)
|
|
659
|
+
let filesId = []
|
|
660
|
+
rows.forEach((item) => {
|
|
661
|
+
if (item.beid) {
|
|
662
|
+
filesId.push(item.beid)
|
|
663
|
+
}
|
|
664
|
+
})
|
|
665
|
+
// 调接口删除
|
|
666
|
+
if (filesId.length > 0) {
|
|
667
|
+
const res = await axios.post(`/api/neams/eamsbaserecord/delete`, filesId)
|
|
668
|
+
if (res.code === 200) {
|
|
669
|
+
if (!update) {
|
|
670
|
+
this.tableData = this.tableData.filter((item) => filesId.indexOf(item.beid) === -1)
|
|
671
|
+
this.$message.success('删除成功')
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
// 不调接口删除
|
|
676
|
+
let ids = rows.map((item) => item.id)
|
|
677
|
+
this.tableData = this.tableData.filter((item) => ids.indexOf(item.id) === -1 || item.beid)
|
|
678
|
+
},
|
|
679
|
+
beforeUploadFn() {},
|
|
680
|
+
MultipleSUccessFn() {},
|
|
681
|
+
async onSuccessFn(response, file, fileList, row) {
|
|
682
|
+
const { data } = response
|
|
683
|
+
if (row.beid) {
|
|
684
|
+
await this.deleteRows([{ beid: row.beid }], 'update')
|
|
685
|
+
}
|
|
686
|
+
let obj
|
|
687
|
+
let _obj = data[0]
|
|
688
|
+
for (let k in _obj) {
|
|
689
|
+
obj = JSON.parse(_obj[k])
|
|
690
|
+
}
|
|
691
|
+
this.$set(row, '_name', file.name)
|
|
692
|
+
this.$set(row, '_percent', 100)
|
|
693
|
+
row[this.keys.time] = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
694
|
+
|
|
695
|
+
row[this.keys.url] = response.data
|
|
696
|
+
row[this.keys.name] = file.name
|
|
697
|
+
this.$set(row, '_status', 'success')
|
|
698
|
+
this.$set(row, '_fileData', obj)
|
|
699
|
+
this.$set(row, 'beid', obj.beid)
|
|
700
|
+
this.$set(row, 'attno', obj.attno)
|
|
701
|
+
this.$set(row, 'recordname', obj.recordname)
|
|
702
|
+
this.$set(row, 'filepath', obj.filepath)
|
|
703
|
+
this.$set(row, 'archiveId', obj.beid)
|
|
704
|
+
this.$set(row, 'creator', obj.creator)
|
|
705
|
+
this.$set(row, '_typeDisabled', true)
|
|
706
|
+
},
|
|
707
|
+
closeSee() {
|
|
708
|
+
this.previewUrl && URL.revokeObjectURL(this.previewUrl)
|
|
709
|
+
this.previewUrl = undefined
|
|
710
|
+
this.visiblePvT = setTimeout(() => {
|
|
711
|
+
this.visiblePv = false
|
|
712
|
+
}, 300)
|
|
713
|
+
},
|
|
714
|
+
preSee() {
|
|
715
|
+
let i = this.tableData.findIndex((row) => row === this.seeRow)
|
|
716
|
+
let row = this.tableData[i - 1] || this.tableData[this.tableData.length - 1]
|
|
717
|
+
this.seeFile(row)
|
|
718
|
+
},
|
|
719
|
+
nextSee() {
|
|
720
|
+
let i = this.tableData.findIndex((row) => row === this.seeRow)
|
|
721
|
+
let row = this.tableData[i + 1] || this.tableData[0]
|
|
722
|
+
this.seeFile(row)
|
|
723
|
+
},
|
|
724
|
+
onProgressFn({ percent }, row) {
|
|
725
|
+
this.$set(row, '_percent', percent <= 99 ? Math.round(percent) : 99)
|
|
726
|
+
},
|
|
727
|
+
errorFn() {},
|
|
728
|
+
anewSubmitFn() {},
|
|
729
|
+
abortFn() {},
|
|
730
|
+
seeFile(row) {
|
|
731
|
+
if (this.getFileMethod) {
|
|
732
|
+
this.getFileMethod(row, 'preview')
|
|
733
|
+
return
|
|
734
|
+
}
|
|
735
|
+
this.previewUrl = `/api/onlinePreview?beid=${row.beid}`
|
|
736
|
+
this.previewName = row.name
|
|
737
|
+
this.previewSameOrg = true
|
|
738
|
+
this.visibleP = true
|
|
739
|
+
clearTimeout(this.visiblePvT)
|
|
740
|
+
this.visiblePv = true
|
|
741
|
+
this.seeRow = row
|
|
742
|
+
},
|
|
743
|
+
async downFile(row) {
|
|
744
|
+
if (this.getFileMethod) {
|
|
745
|
+
this.getFileMethod(row, 'download')
|
|
746
|
+
return
|
|
747
|
+
}
|
|
748
|
+
// 下载
|
|
749
|
+
let blob = await axios.get(`/api/neams/eamsbaserecord/download/${row.beid}`, null, {
|
|
750
|
+
responseType: 'blob'
|
|
751
|
+
})
|
|
752
|
+
let url = URL.createObjectURL(blob)
|
|
753
|
+
if (url) {
|
|
754
|
+
let aDom = document.createElement('a')
|
|
755
|
+
aDom.href = url
|
|
756
|
+
aDom.download = row.name || blob.name
|
|
757
|
+
aDom.click()
|
|
758
|
+
this.$nextTick(() => {
|
|
759
|
+
aDom = undefined
|
|
760
|
+
row && URL.revokeObjectURL(url)
|
|
761
|
+
})
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
</script>
|