n20-common-lib 3.1.12 → 3.1.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.
@@ -7,7 +7,7 @@
7
7
  <span>{{ uploadedCount }} 个附件</span>
8
8
  <el-button type="text" class="summary-action v3-icon-download" @click="downRows">全部下载</el-button>
9
9
  </div>
10
- <el-button type="text" class="toggle-btn" @click="toggleCollapse">
10
+ <el-button v-if="!readonly" type="text" class="toggle-btn" @click="toggleCollapse">
11
11
  {{ showAllTypes ? '收起未传类型' : '展开全部' }}
12
12
  <i :class="['el-icon-arrow-down', { 'is-reverse': showAllTypes }]"></i>
13
13
  </el-button>
@@ -15,14 +15,25 @@
15
15
 
16
16
  <div class="type-list">
17
17
  <div v-for="(group, index) in displayTypeGroups" :key="group.typeValue || index" class="type-item">
18
- <div class="type-row" :class="[{ 'type-row__is-success': getTypeStatus(group.typeValue) === 'success' }]">
18
+ <div
19
+ class="type-row"
20
+ :class="[{ 'type-row__is-success': getTypeStatus(group.typeValue) === 'success' && !readonly }]"
21
+ >
19
22
  <div class="type-meta">
20
23
  <span v-if="isRequiredType(group.item)" class="required">*</span>
21
- <span class="type-index">{{ index + 1 }}、</span>
24
+ <span class="type-index">{{ readonly ? index + 1 : group.item.no }}、</span>
22
25
  <span class="type-name">{{ group.item[typeMap.label] }}</span>
23
- <img v-if="getTypeStatus(group.typeValue) === 'success'" src="./ysc.svg" class="status-icon" />
24
- <img v-else-if="getTypeStatus(group.typeValue) === 'warning'" src="./jytg.svg" class="status-icon" />
25
- <img v-else src="./wsc.svg" class="status-icon" />
26
+ <img
27
+ v-if="!readonly && getTypeStatus(group.typeValue) === 'success'"
28
+ src="./assets/ysc.svg"
29
+ class="status-icon"
30
+ />
31
+ <img
32
+ v-else-if="getTypeStatus(group.typeValue) === 'warning'"
33
+ src="./assets/jytg.svg"
34
+ class="status-icon"
35
+ />
36
+ <img v-else-if="!readonly" src="./assets/wsc.svg" class="status-icon" />
26
37
  </div>
27
38
 
28
39
  <Upload
@@ -53,32 +64,36 @@
53
64
  <div v-if="group.rows.length" class="file-cards">
54
65
  <div v-for="(row, rowIndex) in group.rows" :key="`${group.typeValue}-${rowIndex}`" class="file-card">
55
66
  <div class="file-info">
56
- <img v-if="matchFileExtension(row[keys.name], ['word', 'doc', 'docx'])" src="./46.svg" class="m-r-s" />
67
+ <img
68
+ v-if="matchFileExtension(row[keys.name], ['word', 'doc', 'docx'])"
69
+ src="./assets/46.svg"
70
+ class="m-r-s"
71
+ />
57
72
  <img
58
73
  v-else-if="matchFileExtension(row[keys.name], ['xlsx', 'xls', 'csv'])"
59
- src="./60.svg"
74
+ src="./assets/60.svg"
60
75
  class="m-r-s"
61
76
  />
62
- <img v-else-if="matchFileExtension(row[keys.name], ['pdf'])" src="./37.svg" class="m-r-s" />
77
+ <img v-else-if="matchFileExtension(row[keys.name], ['pdf'])" src="./assets/37.svg" class="m-r-s" />
63
78
  <img
64
- style="width: 36px; height: 36px"
65
79
  v-else-if="matchFileExtension(row[keys.name], ['png', 'jpg', 'jpeg', 'gif'])"
66
- src="./Png.svg"
80
+ style="width: 36px; height: 36px"
81
+ src="./assets/Png.svg"
67
82
  class="m-r-s"
68
83
  />
69
84
  <img
70
- style="width: 36px; height: 36px"
71
85
  v-else-if="matchFileExtension(row[keys.name], ['zip', 'rar'])"
72
- src="./Zip.svg"
86
+ style="width: 36px; height: 36px"
87
+ src="./assets/Zip.svg"
73
88
  class="m-r-s"
74
89
  />
75
90
  <img
76
- style="width: 36px; height: 36px"
77
91
  v-else-if="matchFileExtension(row[keys.name], ['txt', 'md', 'log'])"
78
- src="./Txt.svg"
92
+ style="width: 36px; height: 36px"
93
+ src="./assets/Txt.svg"
79
94
  class="m-r-s"
80
95
  />
81
- <img style="width: 36px; height: 36px" v-else src="./not.svg" class="m-r-s" />
96
+ <img v-else style="width: 36px; height: 36px" src="./assets/not.svg" class="m-r-s" />
82
97
  <div>
83
98
  <div class="file-name" :title="row[keys.name]">{{ row[keys.name] }}</div>
84
99
  <div class="file-meta">
@@ -88,8 +103,8 @@
88
103
  </div>
89
104
  </div>
90
105
  <div class="flex-box">
91
- <div class="file-ai__card" v-if="AICheck && !readonly" @click="AiCheck(row)">
92
- <img class="file-ai_icon" src="./jytg.svg" alt="" />
106
+ <div v-if="AICheck && !readonly" class="file-ai__card" @click="AiCheck(row)">
107
+ <img class="file-ai_icon" src="./assets/jytg.svg" alt="" />
93
108
  <span class="file-ai_check">{{ $lc('AI 校验') }}</span>
94
109
  </div>
95
110
  <div class="file-actions">
@@ -132,7 +147,7 @@
132
147
  >
133
148
  <div class="flex-column flex-c flex-v" style="height: 100%">
134
149
  <i class="el-icon-s-release" style="font-size: 60px; color: #999"></i>
135
- <span style="margin-top: 16px">
150
+ <span style="margin-top: 16px; display: flex">
136
151
  {{ '不支持在线预览,请' | $lc
137
152
  }}<el-link type="primary" class="color-primary" @click="downFile(seeRow)">{{ '下载' | $lc }}</el-link>
138
153
  {{ '到本地查看' | $lc }}
@@ -148,16 +163,17 @@
148
163
  <script>
149
164
  import _axios from 'axios'
150
165
  import dayjs from 'dayjs'
166
+ import 'viewerjs/dist/viewer.css'
151
167
  import XEUtils from 'xe-utils'
152
- import auth from '../../utils/auth.js'
153
- import axios from '../../utils/axios.js'
154
- import { $lc } from '../../utils/i18n/index'
155
- import importG from '../../utils/importGlobal.js'
156
- import Dialog from '../Dialog/index.vue'
157
- import Upload from '../Upload/index.vue'
158
- import aiCheckDialog from './aiCheckDialog.vue'
159
168
 
160
- import 'viewerjs/dist/viewer.css'
169
+ import aiCheckDialog from './components/aiCheckDialog.vue'
170
+
171
+ import auth from '../../../utils/auth.js'
172
+ import axios from '../../../utils/axios.js'
173
+ import { $lc } from '../../../utils/i18n/index'
174
+ import importG from '../../../utils/importGlobal.js'
175
+ import Dialog from '../../Dialog/index.vue'
176
+ import Upload from '../../Upload/index.vue'
161
177
 
162
178
  const ViewerImg = async function () {
163
179
  let { component } = await importG('v-viewer', () => import(/*webpackChunkName: "v-viewer"*/ 'v-viewer'))
@@ -174,7 +190,7 @@ const keysDefault = {
174
190
  }
175
191
 
176
192
  export default {
177
- name: 'FileUploadTableV3',
193
+ name: 'UploadList',
178
194
  components: {
179
195
  Upload,
180
196
  Dialog,
@@ -286,7 +302,7 @@ export default {
286
302
  return this.dataProp.fileData || undefined
287
303
  },
288
304
  typeOptions() {
289
- return this.dataProp.typeOptions
305
+ return this.dataProp.typeOptions.map((item, index) => ({ no: index + 1, ...item })) ?? []
290
306
  },
291
307
  keys() {
292
308
  return this.dataProp.keys || keysDefault
@@ -311,15 +327,15 @@ export default {
311
327
  })
312
328
  return map
313
329
  },
314
- displayTypeOptions() {
315
- if (this.showAllTypes) return this.typeOptions
316
- return (this.typeOptions || []).filter((item) => {
317
- const typeValue = item[this.typeMap.value]
318
- return (this.typeRowsMap[typeValue] || []).length > 0
319
- })
320
- },
321
330
  displayTypeGroups() {
322
- return (this.displayTypeOptions || []).map((item) => {
331
+ const options =
332
+ this.showAllTypes && !this.readonly
333
+ ? this.typeOptions
334
+ : this.typeOptions.filter((item) => {
335
+ const typeValue = item[this.typeMap.value]
336
+ return (this.typeRowsMap[typeValue] || []).length > 0
337
+ })
338
+ return options.map((item) => {
323
339
  const typeValue = item[this.typeMap.value]
324
340
  return {
325
341
  item,
package/src/index.js CHANGED
@@ -74,7 +74,6 @@ import Expandable from './components/Expandable/index.vue'
74
74
  import ExpandablePane from './components/Expandable/main.vue'
75
75
  import FileExportAsync from './components/FileExportAsync/index.vue'
76
76
  import FileImport from './components/FileImport/index.vue'
77
- import FileUploadTableV3 from './components/FileUploadTable/FileUploadTableV3.vue'
78
77
  import FileUploadTable from './components/FileUploadTable/index.vue'
79
78
  import Filters from './components/Filters/index.vue'
80
79
  import FiltersO from './components/Filters/indexO.vue'
@@ -129,6 +128,7 @@ import SecondaryTabV3 from './components/v3/SecondaryTab/index.vue'
129
128
 
130
129
  /* v3组件*/
131
130
  import tableProV3 from './components/v3/TablePro/index.vue'
131
+ import FileUploadTableV3 from './components/v3/UploadList/index.vue'
132
132
  import ViewToggle from './components/ViewToggle/index.vue'
133
133
  import WorkCard from './components/WorkCard/index.vue'
134
134
  import WornPagination from './components/WornPagination/index.vue'