Browse Source

优化/文件上传

master
xuhuajiao 3 months ago
parent
commit
02a5b30a55
  1. BIN
      src/assets/images/fileIcon/OFD.png
  2. 4
      src/assets/styles/yxk-admin.scss
  3. 3
      src/views/AIAssistant/AIKeywords/index copy.vue
  4. 7
      src/views/archiveKeeping/inStorage/pendingInArchive/module/uploadFile/index.vue
  5. 7
      src/views/archivesManage/managementLibrary/file/index.vue
  6. 7
      src/views/archivesManage/managementLibrary/module/uploadFile/index.vue
  7. 10
      src/views/collectReorganizi/batchConnection/module/form.vue
  8. 7
      src/views/collectReorganizi/collectionLibrary/file/index.vue
  9. 11
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  10. 7
      src/views/collectReorganizi/collectionLibrary/module/uploadFile/index.vue
  11. 156
      src/views/collectReorganizi/collectionLibrary/module/uploadOriginal/bigUpload.vue
  12. 7
      src/views/components/archivesDetail/uploadFile/index.vue
  13. 65
      src/views/components/category/PreviewForm.vue
  14. 2
      src/views/prearchiveLibrary/index.vue
  15. 25
      src/views/prearchiveLibrary/module/batchFile.vue
  16. 7
      src/views/prearchiveLibrary/module/detail.vue
  17. 2
      src/views/preview/index.vue
  18. 17
      src/views/system/archiveScopeManage/module/tableList.vue

BIN
src/assets/images/fileIcon/OFD.png

After

Width: 200  |  Height: 200  |  Size: 5.9 KiB

4
src/assets/styles/yxk-admin.scss

@ -2061,6 +2061,10 @@ input[type ='number'] {
background: url("~@/assets/images/fileIcon/txt.png") no-repeat; background: url("~@/assets/images/fileIcon/txt.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
&.icon-ofd{
background: url("~@/assets/images/fileIcon/OFD.png") no-repeat;
background-size: 100% 100%;
}
&.icon-other{ &.icon-other{
background: url("~@/assets/images/fileIcon/attachment.png") no-repeat; background: url("~@/assets/images/fileIcon/attachment.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;

3
src/views/AIAssistant/AIKeywords/index copy.vue

@ -74,6 +74,9 @@
<div v-else-if="scope.row.file_type === 'txt'"> <div v-else-if="scope.row.file_type === 'txt'">
<i class="fileIcon icon-txt" /> <i class="fileIcon icon-txt" />
</div> </div>
<div v-else-if="scope.row.file_type === 'ofd'">
<i class="fileIcon icon-ofd" />
</div>
<div v-else> <div v-else>
<i class="fileIcon icon-other" /> <i class="fileIcon icon-other" />
</div> </div>

7
src/views/archiveKeeping/inStorage/pendingInArchive/module/uploadFile/index.vue

@ -23,7 +23,7 @@
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="file_name" label="文件名称" show-overflow-tooltip min-width="140" /> <el-table-column prop="file_name" label="文件名称" show-overflow-tooltip min-width="140" />
<el-table-column prop="file_type" label="格式" min-width="60" align="center" /> <el-table-column prop="file_type" label="格式" min-width="60" align="center" />
<el-table-column prop="file_size" label="大小" min-width="85" align="center">
<el-table-column prop="file_size" label="大小" min-width="85" align="right">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getFileSize(scope.row.file_size) }} {{ getFileSize(scope.row.file_size) }}
</template> </template>
@ -57,6 +57,9 @@
<div v-else-if="scope.row.file_type === 'txt'"> <div v-else-if="scope.row.file_type === 'txt'">
<i class="fileIcon icon-txt" /> <i class="fileIcon icon-txt" />
</div> </div>
<div v-else-if="scope.row.file_type === 'ofd'">
<i class="fileIcon icon-ofd" />
</div>
<div v-else> <div v-else>
<i class="fileIcon icon-other" /> <i class="fileIcon icon-other" />
</div> </div>
@ -162,7 +165,7 @@ export default {
}, },
methods: { methods: {
getFileSize(fileSize) { getFileSize(fileSize) {
const fileSizeInKB = (fileSize / 1024).toFixed(2) + 'kB'
const fileSizeInKB = (fileSize / 1024).toFixed(2) + ' KB'
const fileSizeInB = fileSize + 'B' const fileSizeInB = fileSize + 'B'
return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB
}, },

7
src/views/archivesManage/managementLibrary/file/index.vue

@ -38,7 +38,7 @@
<!-- <el-table-column type="index" label="序号" width="55" align="center" /> --> <!-- <el-table-column type="index" label="序号" width="55" align="center" /> -->
<el-table-column prop="file_name" label="原文名称" show-overflow-tooltip min-width="140" /> <el-table-column prop="file_name" label="原文名称" show-overflow-tooltip min-width="140" />
<el-table-column prop="file_type" label="格式" min-width="60" align="center" /> <el-table-column prop="file_type" label="格式" min-width="60" align="center" />
<el-table-column prop="file_size" label="大小" min-width="85" align="center">
<el-table-column prop="file_size" label="大小" min-width="85" align="right">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getFileSize(scope.row.file_size) }} {{ getFileSize(scope.row.file_size) }}
</template> </template>
@ -72,6 +72,9 @@
<div v-else-if="scope.row.file_type === 'txt'"> <div v-else-if="scope.row.file_type === 'txt'">
<i class="fileIcon icon-txt" /> <i class="fileIcon icon-txt" />
</div> </div>
<div v-else-if="scope.row.file_type === 'ofd'">
<i class="fileIcon icon-ofd" />
</div>
<div v-else> <div v-else>
<i class="fileIcon icon-other" /> <i class="fileIcon icon-other" />
</div> </div>
@ -155,7 +158,7 @@ export default {
}, },
methods: { methods: {
getFileSize(fileSize) { getFileSize(fileSize) {
const fileSizeInKB = (fileSize / 1024).toFixed(2) + 'kB'
const fileSizeInKB = (fileSize / 1024).toFixed(2) + ' KB'
const fileSizeInB = fileSize + 'B' const fileSizeInB = fileSize + 'B'
return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB
}, },

7
src/views/archivesManage/managementLibrary/module/uploadFile/index.vue

@ -17,7 +17,7 @@
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="file_name" label="文件名称" show-overflow-tooltip min-width="140" /> <el-table-column prop="file_name" label="文件名称" show-overflow-tooltip min-width="140" />
<el-table-column prop="file_type" label="格式" min-width="60" align="center" /> <el-table-column prop="file_type" label="格式" min-width="60" align="center" />
<el-table-column prop="file_size" label="大小" min-width="85" align="center">
<el-table-column prop="file_size" label="大小" min-width="85" align="right">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getFileSize(scope.row.file_size) }} {{ getFileSize(scope.row.file_size) }}
</template> </template>
@ -45,6 +45,9 @@
<div v-else-if="scope.row.file_type === 'txt'"> <div v-else-if="scope.row.file_type === 'txt'">
<i class="fileIcon icon-txt" /> <i class="fileIcon icon-txt" />
</div> </div>
<div v-else-if="scope.row.file_type === 'ofd'">
<i class="fileIcon icon-ofd" />
</div>
<div v-else> <div v-else>
<i class="fileIcon icon-other" /> <i class="fileIcon icon-other" />
</div> </div>
@ -131,7 +134,7 @@ export default {
localStorage.setItem('fileCurrent', JSON.stringify(row)) localStorage.setItem('fileCurrent', JSON.stringify(row))
}, },
getFileSize(fileSize) { getFileSize(fileSize) {
const fileSizeInKB = (fileSize / 1024).toFixed(2) + 'kB'
const fileSizeInKB = (fileSize / 1024).toFixed(2) + ' KB'
const fileSizeInB = fileSize + 'B' const fileSizeInB = fileSize + 'B'
return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB
}, },

10
src/views/collectReorganizi/batchConnection/module/form.vue

@ -127,9 +127,9 @@ export default {
hitchRemarkArray: [], hitchRemarkArray: [],
connectionType: 0, connectionType: 0,
form: { form: {
checkRepeatType: null,
checkRepeatType: 1,
hitchFiled: null, hitchFiled: null,
matchingMode: 1,
matchingMode: 2,
fields: null, fields: null,
file: null, file: null,
protocol: null, protocol: null,
@ -328,6 +328,12 @@ export default {
json.value = item.fieldName json.value = item.fieldName
return json return json
}) })
// archive_no
const archiveNoOption = this.fieldOptions.find(item => item.value === 'archive_no')
if (archiveNoOption) {
this.form.hitchFiled = archiveNoOption.value
this.selectFiled(archiveNoOption.value)
}
}) })
}, },
selectFiled(val) { selectFiled(val) {

7
src/views/collectReorganizi/collectionLibrary/file/index.vue

@ -37,7 +37,7 @@
<!-- <el-table-column type="index" label="序号" width="55" align="center" /> --> <!-- <el-table-column type="index" label="序号" width="55" align="center" /> -->
<el-table-column prop="file_name" label="原文名称" show-overflow-tooltip min-width="140" /> <el-table-column prop="file_name" label="原文名称" show-overflow-tooltip min-width="140" />
<el-table-column prop="file_type" label="格式" min-width="60" align="center" /> <el-table-column prop="file_type" label="格式" min-width="60" align="center" />
<el-table-column prop="file_size" label="大小" min-width="85" align="center">
<el-table-column prop="file_size" label="大小" min-width="85" align="right">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getFileSize(scope.row.file_size) }} {{ getFileSize(scope.row.file_size) }}
</template> </template>
@ -72,6 +72,9 @@
<div v-else-if="scope.row.file_type === 'txt'"> <div v-else-if="scope.row.file_type === 'txt'">
<i class="fileIcon icon-txt" /> <i class="fileIcon icon-txt" />
</div> </div>
<div v-else-if="scope.row.file_type === 'ofd'">
<i class="fileIcon icon-ofd" />
</div>
<div v-else> <div v-else>
<i class="fileIcon icon-other" /> <i class="fileIcon icon-other" />
</div> </div>
@ -164,7 +167,7 @@ export default {
}, },
methods: { methods: {
getFileSize(fileSize) { getFileSize(fileSize) {
const fileSizeInKB = (fileSize / 1024).toFixed(2) + 'kB'
const fileSizeInKB = (fileSize / 1024).toFixed(2) + ' KB'
const fileSizeInB = fileSize + 'B' const fileSizeInB = fileSize + 'B'
return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB
}, },

11
src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue

@ -72,8 +72,8 @@
</el-menu-item-group> </el-menu-item-group>
<el-menu-item-group v-if="(isTitleType === 3 && selectedCategory.arrangeType === 1) || isTitleType === 4 || isTitleType === 6 || (isTitleType === 3 && activeIndex === 1)" class="collect-submenu-group submenu-tree"> <el-menu-item-group v-if="(isTitleType === 3 && selectedCategory.arrangeType === 1) || isTitleType === 4 || isTitleType === 6 || (isTitleType === 3 && activeIndex === 1)" class="collect-submenu-group submenu-tree">
<template slot="title">原文上传</template> <template slot="title">原文上传</template>
<el-menu-item index="1-5" @click="fileUpload(0)">普通上传</el-menu-item>
<el-menu-item index="1-6" @click="fileUpload(1)">文件上传</el-menu-item>
<!-- <el-menu-item index="1-5" @click="fileUpload(0)">普通上传</el-menu-item> -->
<el-menu-item index="1-6" @click="fileUpload(1)">文件上传</el-menu-item>
</el-menu-item-group> </el-menu-item-group>
</el-submenu> </el-submenu>
<el-submenu v-if="isTitleType !== 6" index="2"> <el-submenu v-if="isTitleType !== 6" index="2">
@ -290,8 +290,8 @@
<!--档案号重复得list--> <!--档案号重复得list-->
<el-dialog title="档号重复" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="repeatVisible" :before-close="handleRepeatClose"> <el-dialog title="档号重复" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="repeatVisible" :before-close="handleRepeatClose">
<div class="setting-dialog"> <div class="setting-dialog">
<div v-if="repeatResponseData.delcount === 0" class="double-click-btn" style="position: static; margin: -10px 0 10px 0;"><i class="iconfont icon-zhuyi-lan" /><span>建议修改当前输入的档号</span></div>
<div v-else class="double-click-btn" style="position: static; margin: -10px 0 10px 0;"><i class="iconfont icon-zhuyi-lan" /><span>建议删除回收站相关数据 或者 修改当前输入的档号</span></div>
<div v-if="repeatResponseData.delcount === 0" class="double-click-btn" style="position: static; margin: -10px 0 10px 0;"><i style="color: #ff4949;" class="iconfont icon-zhuyi-lan" /><span style="color: #ff4949; font-weight: bold;">因档号重复当前操作无法保存</span><span>建议修改当前输入的档号</span></div>
<div v-else class="double-click-btn" style="position: static; margin: -10px 0 10px 0;"><i style="color: #ff4949;" class="iconfont icon-zhuyi-lan" /><span style="color: #ff4949; font-weight: bold;">因档号重复当前操作无法保存</span><span>建议删除回收站相关数据 或者 修改当前输入的档号</span></div>
<el-table <el-table
ref="table" ref="table"
@ -692,7 +692,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.previewForm.archivesType = 'edit' this.$refs.previewForm.archivesType = 'edit'
this.$refs.previewForm.addOrUpdateForm = data.echo this.$refs.previewForm.addOrUpdateForm = data.echo
this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
// this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
}) })
}) })
}) })
@ -1017,6 +1017,7 @@ export default {
this.$refs.uploadOriginalRef.uploadVisible = true this.$refs.uploadOriginalRef.uploadVisible = true
} else if (uploadType === 1) { } else if (uploadType === 1) {
this.$refs.uploadBigRef.uploadBigVisible = true this.$refs.uploadBigRef.uploadBigVisible = true
this.$refs.uploadBigRef.fileList = []
} else if (uploadType === 2) { } else if (uploadType === 2) {
this.$refs.uploadOriginalRef.uploadTitle = '原文目录上传' this.$refs.uploadOriginalRef.uploadTitle = '原文目录上传'
this.$refs.uploadOriginalRef.uploadVisible = true this.$refs.uploadOriginalRef.uploadVisible = true

7
src/views/collectReorganizi/collectionLibrary/module/uploadFile/index.vue

@ -23,7 +23,7 @@
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="file_name" label="文件名称" show-overflow-tooltip min-width="140" /> <el-table-column prop="file_name" label="文件名称" show-overflow-tooltip min-width="140" />
<el-table-column prop="file_type" label="格式" min-width="60" align="center" /> <el-table-column prop="file_type" label="格式" min-width="60" align="center" />
<el-table-column prop="file_size" label="大小" min-width="85" align="center">
<el-table-column prop="file_size" label="大小" min-width="85" align="right">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getFileSize(scope.row.file_size) }} {{ getFileSize(scope.row.file_size) }}
</template> </template>
@ -57,6 +57,9 @@
<div v-else-if="scope.row.file_type === 'txt'"> <div v-else-if="scope.row.file_type === 'txt'">
<i class="fileIcon icon-txt" /> <i class="fileIcon icon-txt" />
</div> </div>
<div v-else-if="scope.row.file_type === 'ofd'">
<i class="fileIcon icon-ofd" />
</div>
<div v-else> <div v-else>
<i class="fileIcon icon-other" /> <i class="fileIcon icon-other" />
</div> </div>
@ -185,7 +188,7 @@ export default {
}, },
methods: { methods: {
getFileSize(fileSize) { getFileSize(fileSize) {
const fileSizeInKB = (fileSize / 1024).toFixed(2) + 'kB'
const fileSizeInKB = (fileSize / 1024).toFixed(2) + ' KB'
const fileSizeInB = fileSize + 'B' const fileSizeInB = fileSize + 'B'
return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB
}, },

156
src/views/collectReorganizi/collectionLibrary/module/uploadOriginal/bigUpload.vue

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<!--上传组件--> <!--上传组件-->
<el-dialog class="big-file" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="uploadBigVisible">
<el-dialog class="big-file" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="uploadBigVisible" :before-close="handleCloseDialog">
<template #title> <template #title>
{{ uploadTitle }} {{ uploadTitle }}
<span style="color: red;font-size: 12px; ">单个文件不可超过10GB</span> <span style="color: red;font-size: 12px; ">单个文件不可超过10GB</span>
@ -21,31 +21,29 @@
<uploader-unsupport /> <uploader-unsupport />
<uploader-drop> <uploader-drop>
<p>将文件拖到此处或点击上传</p> <p>将文件拖到此处或点击上传</p>
<uploader-btn single>
<uploader-btn>
<slot> <slot>
<i class="iconfont icon-tianjiawenjian upload-icon" /> <i class="iconfont icon-tianjiawenjian upload-icon" />
</slot> </slot>
</uploader-btn> </uploader-btn>
<div class="el-upload__tip">上传限制文件大小最大10GB/</div> <div class="el-upload__tip">上传限制文件大小最大10GB/</div>
<!-- <uploader-btn :attrs="attrs">选择图片</uploader-btn>
<uploader-btn :directory="true">选择文件夹</uploader-btn> -->
</uploader-drop> </uploader-drop>
<uploader-files />
<!-- <ul class="file-list">
<li
v-for="file in fileList"
:key="file.id"
class="file-item"
:class="`file-${file.id}`"
>
<!-- <uploader-files /> -->
<uploader-list>
<!--通过slot-scope绑定文件实例-->
<div slot-scope="props" class="set-file">
<div v-for="(file,i) in props.fileList" :key="i">
<uploader-file <uploader-file
ref="files"
:class="'file_' + file.id"
:file="file"
:list="true" :list="true"
:file="file"
:class=" file.fileType.substring(0, file.fileType.indexOf('/')) === 'image' ? 'icon-image' : `icon-`+file.name.substring(
file.name.lastIndexOf('.') + 1,
file.name.length
)"
/> />
</li>
</ul> -->
</div>
</div>
</uploader-list>
</uploader> </uploader>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -98,7 +96,7 @@ export default {
}, },
data() { data() {
return { return {
uploadTitle: '文件上传',
uploadTitle: '文件上传',
btnLoading: false, btnLoading: false,
uploadBigVisible: false, uploadBigVisible: false,
skip: false, skip: false,
@ -106,7 +104,7 @@ export default {
target: null, target: null,
// //
testChunks: true, // testChunks: true, //
singleFile: true, //
singleFile: false, //
uploadMethod: 'post', // 使 HTTP , POST uploadMethod: 'post', // 使 HTTP , POST
allowDuplicateUploads: false, // allowDuplicateUploads: false, //
parseTimeRemaining: function(timeRemaining, parsedTimeRemaining) { parseTimeRemaining: function(timeRemaining, parsedTimeRemaining) {
@ -190,12 +188,12 @@ export default {
} }
}, },
filesRemove(file, index) { filesRemove(file, index) {
this.fileList = []
const uploaderInstance = this.$refs.uploader.uploader const uploaderInstance = this.$refs.uploader.uploader
const temp = uploaderInstance.fileList.findIndex(e => e.uniqueIdentifier === file.uniqueIdentifier) const temp = uploaderInstance.fileList.findIndex(e => e.uniqueIdentifier === file.uniqueIdentifier)
if (temp > -1) { if (temp > -1) {
uploaderInstance.fileList[temp].cancel() // uploaderInstance.fileList[temp].cancel() //
} }
this.fileList = this.fileList.filter(f => f.uniqueIdentifier !== file.uniqueIdentifier)
}, },
handleUploadConfirm() { handleUploadConfirm() {
if (this.$refs.uploader.fileList.length === 0) { if (this.$refs.uploader.fileList.length === 0) {
@ -203,21 +201,25 @@ export default {
return false return false
} }
this.nowDate = getCurrentTime() this.nowDate = getCurrentTime()
this.$refs.uploader.fileList.map(async(item, index) => {
const jsonArrayToSend = []
// 使 Promise.all
Promise.all(this.$refs.uploader.fileList.map(async(item) => {
const json = {} const json = {}
const jsonArray = [] const jsonArray = []
const jsonString = {} const jsonString = {}
if (item.file.type.substring(0, item.file.type.indexOf('/')) === 'image') { if (item.file.type.substring(0, item.file.type.indexOf('/')) === 'image') {
const fileBase64 = await this.getBase64(item)
const fileBase64 = await this.getBase64(item.file)
const imgRes = await this.getImgPx(fileBase64) const imgRes = await this.getImgPx(fileBase64)
item.file.px = imgRes.width + 'px*' + imgRes.height + 'px' item.file.px = imgRes.width + 'px*' + imgRes.height + 'px'
} else { } else {
item.file.px = '' item.file.px = ''
} }
jsonString.file_name = item.file.name jsonString.file_name = item.file.name
jsonString.file_size = item.file.size jsonString.file_size = item.file.size
jsonString.file_type = item.file.name.substring(item.name.lastIndexOf('.') + 1, item.file.name.length) jsonString.file_type = item.file.name.substring(item.name.lastIndexOf('.') + 1, item.file.name.length)
// jsonString.file_path = res.data.data
json.last_modified = item.file.lastModified json.last_modified = item.file.lastModified
jsonString.file_path = '' jsonString.file_path = ''
jsonString.sequence = null jsonString.sequence = null
@ -232,23 +234,26 @@ export default {
json.archivesId = this.arcId json.archivesId = this.arcId
json.identifier = item.uniqueIdentifier json.identifier = item.uniqueIdentifier
json.filename = item.name json.filename = item.name
// chunk.offset
json.totalChunks = item.chunks.length - 1 json.totalChunks = item.chunks.length - 1
json.totalSize = item.size json.totalSize = item.size
json.fileJsonString = JSON.stringify(jsonArray) json.fileJsonString = JSON.stringify(jsonArray)
if (item.completed && this.submitted) {
jsonArrayToSend.push(json)
})).then(() => {
console.log('jsonArrayToSend', jsonArrayToSend)
if (this.$refs.uploader.fileList.every(item => item.completed) && this.submitted) {
this.btnLoading = true this.btnLoading = true
this.submitted = false this.submitted = false
axios.post(this.baseApi + '/api/collect/merge', json, { headers: {
axios.post(this.baseApi + '/api/collect/merge', jsonArrayToSend, {
headers: {
'Authorization': getToken() 'Authorization': getToken()
}}).then((res) => {
}
}).then((res) => {
console.log(res) console.log(res)
if (res.data.code === 200 && res.data.data !== '') { if (res.data.code === 200 && res.data.data !== '') {
this.$message({ message: '上传成功', type: 'success', offset: 8 })
this.$message({ message: '所有文件上传成功', type: 'success', offset: 8 })
} else { } else {
this.$message({ message: '上传失败', type: 'error', offset: 8 })
this.$message({ message: '部分或全部文件上传失败', type: 'error', offset: 8 })
} }
this.$emit('close-dialog') this.$emit('close-dialog')
this.uploadBigVisible = false this.uploadBigVisible = false
@ -266,19 +271,19 @@ export default {
}) })
}, },
onFileError(rootFile, file, message, chunk) { onFileError(rootFile, file, message, chunk) {
this.$message({ message: '上传出错:' + message, type: 'error', offset: 8 })
this.$message({ message: `上传出错:${file.name} - ${message}`, type: 'error', offset: 8 })
}, },
handleRepeatFileCancel() { handleRepeatFileCancel() {
this.repeatFileVisible = false this.repeatFileVisible = false
this.repeatFileData = [] this.repeatFileData = []
this.originFileData = [] this.originFileData = []
const uploaderInstance = this.$refs.uploader.uploader const uploaderInstance = this.$refs.uploader.uploader
uploaderInstance.fileList[0].cancel()
uploaderInstance.fileList.forEach(file => file.cancel())
}, },
handleRepeatFile(type) { handleRepeatFile(type) {
if (type === 0) { if (type === 0) {
// //
this.computeMD5(this.fileList[0])
this.fileList.forEach(file => this.computeMD5(file))
} else { } else {
// //
const nonRepeatFileData = this.fileList.filter(file => !this.repeatFileData.some(repeatFile => repeatFile.name === file.name)) const nonRepeatFileData = this.fileList.filter(file => !this.repeatFileData.some(repeatFile => repeatFile.name === file.name))
@ -287,13 +292,17 @@ export default {
this.handleRepeatFileCancel() this.handleRepeatFileCancel()
this.handleCloseDialog() this.handleCloseDialog()
} else { } else {
this.computeMD5(this.fileList)
//
// this.$refs.uploader.fileList
const uploaderInstance = this.$refs.uploader
uploaderInstance.fileList = uploaderInstance.fileList.filter(file => nonRepeatFileData.some(nonRepeatFile => nonRepeatFile.uniqueIdentifier === file.uniqueIdentifier))
this.$refs.uploader.files = this.$refs.uploader.files.filter(file => nonRepeatFileData.some(nonRepeatFile => nonRepeatFile.uniqueIdentifier === file.uniqueIdentifier))
nonRepeatFileData.forEach(file => this.computeMD5(file))
} }
} }
this.repeatFileVisible = false this.repeatFileVisible = false
}, },
async filesAdded(file, fileList, event) { async filesAdded(file, fileList, event) {
this.fileList = []
// //
await this.getFileList() await this.getFileList()
@ -395,9 +404,14 @@ export default {
}, },
handleCloseDialog(done) { handleCloseDialog(done) {
this.uploadBigVisible = false this.uploadBigVisible = false
this.fileList = []
const uploaderInstance = this.$refs.uploader.uploader const uploaderInstance = this.$refs.uploader.uploader
uploaderInstance.fileList[0].cancel()
console.log('uploaderInstance.fileList', uploaderInstance.fileList)
uploaderInstance.fileList.forEach(file => file.cancel())
uploaderInstance.fileList = []
uploaderInstance.files = []
this.fileList = []
this.$refs.uploader.files = []
this.$refs.uploader.fileList = []
} }
} }
} }
@ -452,4 +466,72 @@ export default {
.uploader-file[status="success"] .uploader-file-remove { .uploader-file[status="success"] .uploader-file-remove {
display:block display:block
} }
::v-deep .uploader-list{
max-height: 344px;
overflow-y: scroll;
.uploader-file-size{
text-align: right !important;
}
.uploader-file-icon:before{
content: "";
}
.uploader-file-name{
text-align: left !important;
}
.uploader-file{
.uploader-file-icon:before{
background: url("~@/assets/images/fileIcon/attachment.png") no-repeat;
background-size: 100% 100%;
}
&.icon-image{
.uploader-file-icon:before{
background: url("~@/assets/images/fileIcon/image.png") no-repeat;
background-size: 100% 100%;
}
}
&.icon-excel,&.icon-xlsx,&.icon-xls{
.uploader-file-icon:before{
background: url("~@/assets/images/fileIcon/excel.png") no-repeat;
background-size: 100% 100%;
}
}
&.icon-pdf{
.uploader-file-icon:before{
background: url("~@/assets/images/fileIcon/pdf.png") no-repeat;
background-size: 100% 100%;
}
}
&.icon-ppt, &.icon-pptx{
.uploader-file-icon:before{
background: url("~@/assets/images/fileIcon/ppt.png") no-repeat;
background-size: 100% 100%;
}
}
&.icon-word,&.icon-docx,&.icon-doc{
.uploader-file-icon:before{
background: url("~@/assets/images/fileIcon/word.png") no-repeat;
background-size: 100% 100%;
}
}
&.icon-zip,&.icon-rar{
.uploader-file-icon:before{
background: url("~@/assets/images/fileIcon/zip.png") no-repeat;
background-size: 100% 100%;
}
}
&.icon-txt{
.uploader-file-icon:before{
background: url("~@/assets/images/fileIcon/txt.png") no-repeat;
background-size: 100% 100%;
}
}
&.icon-ofd{
.uploader-file-icon:before{
background: url("~@/assets/images/fileIcon/OFD.png") no-repeat;
background-size: 100% 100%;
}
}
}
}
</style> </style>

7
src/views/components/archivesDetail/uploadFile/index.vue

@ -23,7 +23,7 @@
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="file_name" label="文件名称" show-overflow-tooltip min-width="140" /> <el-table-column prop="file_name" label="文件名称" show-overflow-tooltip min-width="140" />
<el-table-column prop="file_type" label="格式" min-width="60" align="center" /> <el-table-column prop="file_type" label="格式" min-width="60" align="center" />
<el-table-column prop="file_size" label="大小" min-width="85" align="center">
<el-table-column prop="file_size" label="大小" min-width="85" align="right">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getFileSize(scope.row.file_size) }} {{ getFileSize(scope.row.file_size) }}
</template> </template>
@ -57,6 +57,9 @@
<div v-else-if="scope.row.file_type === 'txt'"> <div v-else-if="scope.row.file_type === 'txt'">
<i class="fileIcon icon-txt" /> <i class="fileIcon icon-txt" />
</div> </div>
<div v-else-if="scope.row.file_type === 'ofd'">
<i class="fileIcon icon-ofd" />
</div>
<div v-else> <div v-else>
<i class="fileIcon icon-other" /> <i class="fileIcon icon-other" />
</div> </div>
@ -226,7 +229,7 @@ export default {
localStorage.setItem('fileCurrent', JSON.stringify(row)) localStorage.setItem('fileCurrent', JSON.stringify(row))
}, },
getFileSize(fileSize) { getFileSize(fileSize) {
const fileSizeInKB = (fileSize / 1024).toFixed(2) + 'kB'
const fileSizeInKB = (fileSize / 1024).toFixed(2) + ' KB'
const fileSizeInB = fileSize + 'B' const fileSizeInB = fileSize + 'B'
return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB
}, },

65
src/views/components/category/PreviewForm.vue

@ -76,17 +76,14 @@
<el-row v-if="isDesFormType === 'prearchiveLibrary'" class="preview-form-bottom prearch-bottom"> <el-row v-if="isDesFormType === 'prearchiveLibrary'" class="preview-form-bottom prearch-bottom">
<el-col> <el-col>
<el-form-item label="电子原件" prop="fileOriginal" class="prearch-upload"> <el-form-item label="电子原件" prop="fileOriginal" class="prearch-upload">
<!-- <el-input
v-model="addOrUpdateForm['fileOriginal']"
type="text"
style="width: 446px"
/> -->
<p :class="['input-style', fileOriginal === null ? 'error-box' :'']">{{ fileOriginal }}</p>
<span v-if="fileOriginal === null" class="error-tip">请上传原文</span>
<div class="upload-btn">
<!-- <p :class="['input-style', fileOriginal === null ? 'error-box' :'']">{{ fileOriginal }}</p> -->
<p class="input-style">{{ fileOriginal }}</p>
<!-- <span v-if="fileOriginal === null" class="error-tip">请上传原文</span> -->
<!-- <div class="upload-btn">
<input id="upFile" type="file" name="upFile" @change="changeFile($event)"> <input id="upFile" type="file" name="upFile" @change="changeFile($event)">
<el-button size="small" type="primary"><i class="iconfont icon-shangchuan" />上传</el-button> <el-button size="small" type="primary"><i class="iconfont icon-shangchuan" />上传</el-button>
</div>
</div> -->
<PreUpload :selected-document="selectedDocument" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -157,11 +154,12 @@ import { FetchInitSearchFonds } from '@/api/archiveUtilize/archiveUtilize'
import { FetchArchivesClassTree, FetchSonArchivesClass } from '@/api/system/archivesClass' import { FetchArchivesClassTree, FetchSonArchivesClass } from '@/api/system/archivesClass'
import { parseTime, getCurrentTime } from '@/utils/index' import { parseTime, getCurrentTime } from '@/utils/index'
import { reDocumentUpload } from '@/utils/upload' import { reDocumentUpload } from '@/utils/upload'
import PreUpload from './preUpload'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
name: 'PreviewForm', name: 'PreviewForm',
components: { draggable, Treeselect },
components: { draggable, Treeselect, PreUpload },
mixins: [crud()], mixins: [crud()],
inject: ['parentsData'], inject: ['parentsData'],
props: { props: {
@ -373,6 +371,7 @@ export default {
}, },
// //
handleAuto() { handleAuto() {
console.log('handleAuto')
let string = '' let string = ''
const getAutoFiledVal = [] const getAutoFiledVal = []
this.autoMatic.forEach(async val => { this.autoMatic.forEach(async val => {
@ -502,6 +501,7 @@ export default {
}, },
// //
FetchNoFormatField(categoryId) { FetchNoFormatField(categoryId) {
return new Promise((resolve) => {
let categoryLevel let categoryLevel
if (this.isDesFormType === 'mergeFile') { if (this.isDesFormType === 'mergeFile') {
categoryLevel = 3 categoryLevel = 3
@ -511,6 +511,8 @@ export default {
getNoFormatField({ categoryId: categoryId, categoryLevel: categoryLevel }).then(res => { getNoFormatField({ categoryId: categoryId, categoryLevel: categoryLevel }).then(res => {
this.autoMatic = res this.autoMatic = res
this.handleAuto() this.handleAuto()
resolve()
})
}) })
}, },
// //
@ -644,11 +646,21 @@ export default {
} }
// && this.isDesFormType !== 'mergeFile' // && this.isDesFormType !== 'mergeFile'
if (this.isDesFormType !== 'prearchiveLibrary') { if (this.isDesFormType !== 'prearchiveLibrary') {
if (!item.isAutomatic) {
console.log('333')
console.log('item', item)
console.log('item.isAutomatic)', item.fieldName)
console.log('item.isAutomatic)', item.isAutomatic)
if (item.fieldName !== 'archive_no') {
// 使 async/await
this.FetchNoFormatField(this.selectedCategory.id).then(() => {
const index = this.autoMatic.findIndex(i => item.fieldName === i.fieldName) const index = this.autoMatic.findIndex(i => item.fieldName === i.fieldName)
if (index !== -1) {
console.log('index', index)
console.log(!item.isAutomatic && index !== -1)
if (!item.isAutomatic && index !== -1) {
this.handleAuto() this.handleAuto()
} }
})
} }
} }
}, },
@ -689,6 +701,12 @@ export default {
} }
// && this.isDesFormType !== 'mergeFile' // && this.isDesFormType !== 'mergeFile'
if (this.isDesFormType !== 'prearchiveLibrary') { if (this.isDesFormType !== 'prearchiveLibrary') {
console.log('111')
console.log('this.autoMatic', this.autoMatic)
console.log('this.treeCurrentFiled.fieldNam', this.treeCurrentFiled.fieldName)
if (this.archivesType === 'edit') {
this.FetchNoFormatField(this.selectedCategory.id)
}
if (this.autoMatic) { if (this.autoMatic) {
const index = this.autoMatic.findIndex(i => this.treeCurrentFiled.fieldName === i.fieldName) const index = this.autoMatic.findIndex(i => this.treeCurrentFiled.fieldName === i.fieldName)
if (index !== -1) { if (index !== -1) {
@ -724,6 +742,10 @@ export default {
// && this.isDesFormType !== 'mergeFile' // && this.isDesFormType !== 'mergeFile'
if (this.isDesFormType !== 'prearchiveLibrary') { if (this.isDesFormType !== 'prearchiveLibrary') {
console.log('222')
if (this.archivesType === 'edit') {
this.FetchNoFormatField(this.selectedCategory.id)
}
if (this.autoMatic) { if (this.autoMatic) {
const index = this.autoMatic.findIndex(i => this.currentFieldName === i.fieldName) const index = this.autoMatic.findIndex(i => this.currentFieldName === i.fieldName)
if (index !== -1) { if (index !== -1) {
@ -1000,13 +1022,18 @@ export default {
if (this.archivesType === 'add') { if (this.archivesType === 'add') {
this.addOrUpdateForm.fonds_affiliation = this.selectedCategory.fondsId this.addOrUpdateForm.fonds_affiliation = this.selectedCategory.fondsId
} }
delete this.addOrUpdateForm.id
console.log('this.addOrUpdateForm', this.addOrUpdateForm)
console.log('this.addOrUpdateForm.archive_no', this.addOrUpdateForm.archive_no)
this.$refs[formName].validate((valid, fields) => { this.$refs[formName].validate((valid, fields) => {
if (valid) { if (valid) {
delete this.addOrUpdateForm.id
this.$emit('formLoadingShow', true) this.$emit('formLoadingShow', true)
// //
if (this.isDesFormType === 'prearchiveLibrary') { if (this.isDesFormType === 'prearchiveLibrary') {
if (this.fileOriginal === null) { if (this.fileOriginal === null) {
this.$emit('formLoadingShow', false)
return false return false
} }
// delete this.addOrUpdateForm.fileOriginal // delete this.addOrUpdateForm.fileOriginal
@ -1127,7 +1154,7 @@ export default {
collectEdit(params).then(res => { collectEdit(params).then(res => {
console.log('res-collectEdit', res) console.log('res-collectEdit', res)
if (res.code !== 500) { if (res.code !== 500) {
this.$message({ message: res.message, type: 'success', offset: 8 })
this.$message({ message: res, type: 'success', offset: 8 })
this.$emit('close-dialog', parentsId) this.$emit('close-dialog', parentsId)
} else { } else {
this.$message({ message: res.message, type: 'error', offset: 8 }) this.$message({ message: res.message, type: 'error', offset: 8 })
@ -1347,10 +1374,10 @@ export default {
} }
.prearch-bottom{ .prearch-bottom{
position: fixed;
bottom: 72px;
left: 0;
background: #fff;
// position: fixed;
// bottom: 72px;
// left: 0;
// background: #fff;
width: 100%; width: 100%;
padding: 20px 0 0 20px; padding: 20px 0 0 20px;
} }
@ -1375,7 +1402,7 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.input-style{ .input-style{
width: 500px;
width: 539px;
height: 34px; height: 34px;
line-height: 34px; line-height: 34px;
padding: 0 20px; padding: 0 20px;

2
src/views/prearchiveLibrary/index.vue

@ -442,6 +442,6 @@ export default {
<style lang='scss' scoped> <style lang='scss' scoped>
.preview-dialog .el-dialog .preview-content { .preview-dialog .el-dialog .preview-content {
height: calc(100vh - 290px) !important;
// height: calc(100vh - 290px) !important;
} }
</style> </style>

25
src/views/prearchiveLibrary/module/batchFile.vue

@ -293,7 +293,7 @@ export default {
const indexRetention = res.findIndex(item => item.fieldName === 'retention') const indexRetention = res.findIndex(item => item.fieldName === 'retention')
console.log('indexRetention', indexRetention) console.log('indexRetention', indexRetention)
if (indexClass !== -1 && this.scopeSelection[0].archivesClass !== null) { if (indexClass !== -1 && this.scopeSelection[0].archivesClass !== null) {
this.selectStatus.splice(indexClass, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.name, field: this.allCorrField[indexClass], isInput: this.allCorrField[indexClass].isInput })
this.selectStatus.splice(indexClass, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.code, field: this.allCorrField[indexClass], isInput: this.allCorrField[indexClass].isInput })
} }
if (indexRetention !== -1 && this.scopeSelection[0].retention !== '') { if (indexRetention !== -1 && this.scopeSelection[0].retention !== '') {
this.selectStatus.splice(indexRetention, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allCorrField[indexRetention], isInput: this.allCorrField[indexRetention].isInput }) this.selectStatus.splice(indexRetention, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allCorrField[indexRetention], isInput: this.allCorrField[indexRetention].isInput })
@ -324,7 +324,7 @@ export default {
const indexRetention = res.findIndex(item => item.categoryFieldId.fieldName === 'retention') const indexRetention = res.findIndex(item => item.categoryFieldId.fieldName === 'retention')
console.log('indexRetention', indexRetention) console.log('indexRetention', indexRetention)
if (indexClass !== -1 && this.scopeSelection[0].archivesClass !== null) { if (indexClass !== -1 && this.scopeSelection[0].archivesClass !== null) {
this.selectStatus.splice(indexClass, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.name, field: this.allFieldData[indexClass].documentFieldId, isInput: this.allFieldData[indexClass].documentFieldId.isInput })
this.selectStatus.splice(indexClass, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.code, field: this.allFieldData[indexClass].documentFieldId, isInput: this.allFieldData[indexClass].documentFieldId.isInput })
} }
if (indexRetention !== -1 && this.scopeSelection[0].retention !== '') { if (indexRetention !== -1 && this.scopeSelection[0].retention !== '') {
this.selectStatus.splice(indexRetention, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allFieldData[indexRetention].documentFieldId, isInput: this.allFieldData[indexRetention].documentFieldId.isInput }) this.selectStatus.splice(indexRetention, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allFieldData[indexRetention].documentFieldId, isInput: this.allFieldData[indexRetention].documentFieldId.isInput })
@ -387,6 +387,7 @@ export default {
hanleScopeSelect(val, category) { hanleScopeSelect(val, category) {
if (val.length !== 0) { if (val.length !== 0) {
this.scopeSelection = val this.scopeSelection = val
console.log('val222', val)
this.form.scope = '【' + val[0].scopeCode + '】' + val[0].scopeName this.form.scope = '【' + val[0].scopeCode + '】' + val[0].scopeName
if (category.arrangeType) { if (category.arrangeType) {
this.form.categoryId = category.id this.form.categoryId = category.id
@ -436,7 +437,7 @@ export default {
this.selectStatus.splice(index, 1, { mode: false, fiedType: this.selectStatus[index].fiedType, value: this.selectStatus[index].fiedType === 1 ? this.selectStatus[index].value : this.allCorrField[index].isDefaultValue, field: this.selectStatus[index].field, isInput: this.selectStatus[index].field.isInput }) this.selectStatus.splice(index, 1, { mode: false, fiedType: this.selectStatus[index].fiedType, value: this.selectStatus[index].fiedType === 1 ? this.selectStatus[index].value : this.allCorrField[index].isDefaultValue, field: this.selectStatus[index].field, isInput: this.selectStatus[index].field.isInput })
if (this.form.scope) { if (this.form.scope) {
if (this.allCorrField[index].fieldName === 'archive_ctg_no' && this.scopeSelection[0].archivesClass !== null) { if (this.allCorrField[index].fieldName === 'archive_ctg_no' && this.scopeSelection[0].archivesClass !== null) {
this.selectStatus.splice(index, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.name, field: this.allCorrField[index], isInput: this.allCorrField[index].isInput })
this.selectStatus.splice(index, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.code, field: this.allCorrField[index], isInput: this.allCorrField[index].isInput })
} }
if (this.allCorrField[index].fieldName === 'retention' && this.scopeSelection[0].retention !== null) { if (this.allCorrField[index].fieldName === 'retention' && this.scopeSelection[0].retention !== null) {
this.selectStatus.splice(index, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allCorrField[index], isInput: this.allCorrField[index].isInput }) this.selectStatus.splice(index, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allCorrField[index], isInput: this.allCorrField[index].isInput })
@ -495,6 +496,7 @@ export default {
this.allCorrField = [] this.allCorrField = []
this.isTest = false this.isTest = false
this.batchCategory = {} this.batchCategory = {}
this.archivesBtnLoading = false
// done() // done()
}, },
handleComfirmBatchToFile() { handleComfirmBatchToFile() {
@ -525,7 +527,7 @@ export default {
if (filteredFields[index].fiedType === 2) { if (filteredFields[index].fiedType === 2) {
if (item.fieldName === 'archive_ctg_no' && this.scopeSelection[0].archivesClass !== null) { if (item.fieldName === 'archive_ctg_no' && this.scopeSelection[0].archivesClass !== null) {
console.log('111') console.log('111')
documentValue = this.scopeSelection[0].archivesClass.name
documentValue = this.scopeSelection[0].archivesClass.code
} else if (item.fieldName === 'retention' && this.scopeSelection[0].retention !== null) { } else if (item.fieldName === 'retention' && this.scopeSelection[0].retention !== null) {
console.log('222') console.log('222')
documentValue = this.scopeSelection[0].retention documentValue = this.scopeSelection[0].retention
@ -551,10 +553,21 @@ export default {
console.log('this.selectStatus[index].field.fieldName', this.selectStatus[index].field.fieldName) console.log('this.selectStatus[index].field.fieldName', this.selectStatus[index].field.fieldName)
} }
let documentValue = ''
if (this.selectStatus[index].fiedType === 2) {
if (this.selectStatus[index].value !== '') {
documentValue = this.selectStatus[index].value
} else {
documentValue = item.categoryFieldId.isDefaultValue
}
} else {
documentValue = this.selectStatus[index].field.fieldName
}
return { return {
'categoryValue': item.categoryFieldId.fieldName, 'categoryValue': item.categoryFieldId.fieldName,
// 'documentValue': this.selectStatus[index].fiedType === 2 ? item.categoryFieldId.isDefaultValue : this.selectStatus[index].field.fieldName,
'documentValue': this.selectStatus[index].fiedType === 2 && this.selectStatus[index].value !== '' ? this.selectStatus[index].value : item.categoryFieldId.isDefaultValue,
'documentValue': documentValue,
// 'documentValue': this.selectStatus[index].fiedType === 2 && this.selectStatus[index].value !== '' ? this.selectStatus[index].value : item.categoryFieldId.isDefaultValue,
'getType': this.selectStatus[index].fiedType, 'getType': this.selectStatus[index].fiedType,
'isRequired': item.categoryFieldId.isRequired 'isRequired': item.categoryFieldId.isRequired
} }

7
src/views/prearchiveLibrary/module/detail.vue

@ -31,7 +31,7 @@
> >
<el-table-column prop="file_name" label="文件名称" show-overflow-tooltip min-width="140" align="center" /> <el-table-column prop="file_name" label="文件名称" show-overflow-tooltip min-width="140" align="center" />
<el-table-column prop="file_type" label="格式" min-width="60" align="center" /> <el-table-column prop="file_type" label="格式" min-width="60" align="center" />
<el-table-column prop="file_size" label="大小" min-width="85" align="center">
<el-table-column prop="file_size" label="大小" min-width="85" align="right">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getFileSize(scope.row.file_size) }} {{ getFileSize(scope.row.file_size) }}
</template> </template>
@ -65,6 +65,9 @@
<div v-else-if="scope.row.file_type === 'txt'"> <div v-else-if="scope.row.file_type === 'txt'">
<i class="fileIcon icon-txt" /> <i class="fileIcon icon-txt" />
</div> </div>
<div v-else-if="scope.row.file_type === 'ofd'">
<i class="fileIcon icon-ofd" />
</div>
<div v-else> <div v-else>
<i class="fileIcon icon-other" /> <i class="fileIcon icon-other" />
</div> </div>
@ -158,7 +161,7 @@ export default {
localStorage.setItem('fileCurrent', JSON.stringify(row)) localStorage.setItem('fileCurrent', JSON.stringify(row))
}, },
getFileSize(fileSize) { getFileSize(fileSize) {
const fileSizeInKB = (fileSize / 1024).toFixed(2) + 'kB'
const fileSizeInKB = (fileSize / 1024).toFixed(2) + ' KB'
const fileSizeInB = fileSize + 'B' const fileSizeInB = fileSize + 'B'
return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB
}, },

2
src/views/preview/index.vue

@ -486,7 +486,7 @@ export default {
} }
.content-right{ .content-right{
position: relative; position: relative;
flex: 1;
width: calc(100% - 300px);
border: 1px solid #edeff3; border: 1px solid #edeff3;
border-top: none; border-top: none;
border-bottom: none; border-bottom: none;

17
src/views/system/archiveScopeManage/module/tableList.vue

@ -52,7 +52,16 @@
:options="classifyOptions" :options="classifyOptions"
:normalizer="classifyNormalizer" :normalizer="classifyNormalizer"
placeholder="选择门类之后再选择档案分类" placeholder="选择门类之后再选择档案分类"
/>
>
<p
slot="option-label"
slot-scope="{node}"
style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; width: 100%; padding-left: 10px;"
:title="node.label"
>
<template> {{ node.label }} </template>
</p>
</treeselect>
</el-form-item> </el-form-item>
<el-form-item label="编码" prop="scopeCode"> <el-form-item label="编码" prop="scopeCode">
<el-input v-model="form.scopeCode" /> <el-input v-model="form.scopeCode" />
@ -503,12 +512,12 @@ export default {
} }
}, },
classifyNormalizer(node) { classifyNormalizer(node) {
if (node.childArchivesClass && !node.childArchivesClass.length) {
if (node.childArchivesClass === null) {
delete node.childArchivesClass delete node.childArchivesClass
} }
return { return {
id: node.id,
label: node.name,
id: node.code,
label: `${node.name} - ${node.code}`,
children: node.childArchivesClass children: node.childArchivesClass
} }
}, },

Loading…
Cancel
Save