|
@@ -31,6 +31,9 @@
|
|
|
{{ row.fileUrl }}
|
|
{{ row.fileUrl }}
|
|
|
</span>
|
|
</span>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template slot="fileSize" slot-scope="{ row, index }">
|
|
|
|
|
+ <span>{{ formatByte(row.fileSize) }}</span>
|
|
|
|
|
+ </template>
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
<el-button size="small" type="text" icon="el-icon-edit" :disabled="disabled" @click="rowEdit(row)">{{
|
|
<el-button size="small" type="text" icon="el-icon-edit" :disabled="disabled" @click="rowEdit(row)">{{
|
|
|
row.$cellEdit ? "保存" : "编辑"
|
|
row.$cellEdit ? "保存" : "编辑"
|
|
@@ -49,6 +52,7 @@
|
|
|
import { getToken } from "@/util/auth";
|
|
import { getToken } from "@/util/auth";
|
|
|
import { updateListRemove, submitList } from "@/api/uploadFile/upload-file";
|
|
import { updateListRemove, submitList } from "@/api/uploadFile/upload-file";
|
|
|
import PreviewImage from "@/components/PreviewImage/index.vue";
|
|
import PreviewImage from "@/components/PreviewImage/index.vue";
|
|
|
|
|
+import byteConverter from "@/util/byteConverter";
|
|
|
export default {
|
|
export default {
|
|
|
name: "detailsPage",
|
|
name: "detailsPage",
|
|
|
components: { PreviewImage },
|
|
components: { PreviewImage },
|
|
@@ -87,21 +91,26 @@ export default {
|
|
|
prop: "fileProperties",
|
|
prop: "fileProperties",
|
|
|
overHidden: true,
|
|
overHidden: true,
|
|
|
cell: true,
|
|
cell: true,
|
|
|
- type: 'select',
|
|
|
|
|
- dicData:[{
|
|
|
|
|
- label:'鼓包并向照片',
|
|
|
|
|
- value:1
|
|
|
|
|
- },{
|
|
|
|
|
- label:'轮胎DOT',
|
|
|
|
|
- value:2
|
|
|
|
|
- },{
|
|
|
|
|
- label:'车头照片',
|
|
|
|
|
- value:3
|
|
|
|
|
- },{
|
|
|
|
|
- label:'鼓包处照片',
|
|
|
|
|
- value:4
|
|
|
|
|
- }],
|
|
|
|
|
- hide:!this.filePropertiesHide
|
|
|
|
|
|
|
+ type: "select",
|
|
|
|
|
+ dicData: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "鼓包并向照片",
|
|
|
|
|
+ value: 1,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "轮胎DOT",
|
|
|
|
|
+ value: 2,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "车头照片",
|
|
|
|
|
+ value: 3,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "鼓包处照片",
|
|
|
|
|
+ value: 4,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ hide: !this.filePropertiesHide,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: "文件地址",
|
|
label: "文件地址",
|
|
@@ -116,6 +125,12 @@ export default {
|
|
|
overHidden: true,
|
|
overHidden: true,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
|
|
+ label: "文件大小",
|
|
|
|
|
+ prop: "fileSize",
|
|
|
|
|
+ // cell: true,
|
|
|
|
|
+ overHidden: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
label: "备注",
|
|
label: "备注",
|
|
|
prop: "remarks",
|
|
prop: "remarks",
|
|
|
cell: true,
|
|
cell: true,
|
|
@@ -156,6 +171,10 @@ export default {
|
|
|
},
|
|
},
|
|
|
created() {},
|
|
created() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ //转换字节方法
|
|
|
|
|
+ formatByte(num) {
|
|
|
|
|
+ return byteConverter.formatBytes(num)
|
|
|
|
|
+ },
|
|
|
/**
|
|
/**
|
|
|
* @param {any} list
|
|
* @param {any} list
|
|
|
*/
|
|
*/
|
|
@@ -244,11 +263,14 @@ export default {
|
|
|
* @param {any} fileList
|
|
* @param {any} fileList
|
|
|
*/
|
|
*/
|
|
|
onSuccess(res, file, fileList) {
|
|
onSuccess(res, file, fileList) {
|
|
|
|
|
+
|
|
|
|
|
+ console.log(res,file)
|
|
|
this.data.push({
|
|
this.data.push({
|
|
|
pid: this.pId ? this.pId : null,
|
|
pid: this.pId ? this.pId : null,
|
|
|
fileName: res.data.originalName,
|
|
fileName: res.data.originalName,
|
|
|
fileUrl: res.data[this.linkKey],
|
|
fileUrl: res.data[this.linkKey],
|
|
|
fileType: this.getFileExtension(res.data.originalName),
|
|
fileType: this.getFileExtension(res.data.originalName),
|
|
|
|
|
+ fileSize:file.size,
|
|
|
$cellEdit: true,
|
|
$cellEdit: true,
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -256,6 +278,7 @@ export default {
|
|
|
this.data[this.rowIndex].fileName = res.data.originalName;
|
|
this.data[this.rowIndex].fileName = res.data.originalName;
|
|
|
this.data[this.rowIndex].fileUrl = res.data[this.linkKey];
|
|
this.data[this.rowIndex].fileUrl = res.data[this.linkKey];
|
|
|
this.data[this.rowIndex].fileType = this.getFileExtension(res.data.originalName);
|
|
this.data[this.rowIndex].fileType = this.getFileExtension(res.data.originalName);
|
|
|
|
|
+ this.data[this.rowIndex].fileSize =file.size;
|
|
|
},
|
|
},
|
|
|
rowPick(row, index) {
|
|
rowPick(row, index) {
|
|
|
console.log(row, index);
|
|
console.log(row, index);
|