Commit ed2caa6b authored by 仇晓婷's avatar 仇晓婷

项目管理优化

parent 996debfa
<template> <template>
<div class="files-view"> <div class="files-view">
<Tag v-for="(item, index) in nameList" :key="index" :name="item.id"> <Card v-for="(item, index) in nameList" :key="index" :name="item.id">
<a @click="downFile(item)" target="_blank">{{ item.fileName }}</a> <Row :gutter="16">
</Tag> <Col span="4">
<Icon
type="md-images"
v-if="
item.fileType == 'jpg' ||
item.fileType == 'gif' ||
item.fileType == 'png'
"
/>
<Icon type="ios-paper" v-else />
</Col>
<Col span="20">
<div>
<div
v-if="
item.fileType == 'jpg' ||
item.fileType == 'gif' ||
item.fileType == 'png'
"
>
图片名称
</div>
<div v-else>文件名称</div>
<Tooltip :content="item.fileName" placement="top">
<a @click="downFile(item)" target="_blank">
{{ item.fileName | ellipsis }}</a
>
</Tooltip>
</div>
</Col>
</Row>
</Card>
<Modal <Modal
v-model="modal" v-model="modal"
title="查看" title="查看"
...@@ -33,6 +64,16 @@ export default { ...@@ -33,6 +64,16 @@ export default {
default: "", default: "",
}, },
}, },
filters: {
ellipsis(value) {
let len = value.length;
if (!value) return "";
if (value.length > 28) {
return value.substring(0, 28) + "...";
}
return value;
},
},
mounted() { mounted() {
if (this.parms.eid) { if (this.parms.eid) {
...@@ -82,5 +123,24 @@ export default { ...@@ -82,5 +123,24 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
.files-view { .files-view {
min-height: 300px;
display: -webkit-flex;
display: flex;
flex-wrap: wrap;
align-content: flex-start;
.ivu-card {
height: 80px;
width: 235px;
margin: 10px;
.ivu-icon {
font-size: 30px;
margin-top: 8px;
color: #515a6e;
}
}
}
.files-view .ivu-card > .ivu-card-body {
padding: 16px 0 0 5px;
} }
</style> </style>
...@@ -12,13 +12,13 @@ export default { ...@@ -12,13 +12,13 @@ export default {
}, },
mounted() { mounted() {
if (this.src) { if (this.src) {
this.path = downUrl + v; // this.path = downUrl + this.src;
} }
}, },
watch: { watch: {
src(v) { src(v) {
if (v) { if (v) {
this.path = downUrl + v; // this.path = downUrl + v;
} }
}, },
}, },
......
...@@ -240,7 +240,7 @@ export default { ...@@ -240,7 +240,7 @@ export default {
} }
}, },
imgName(newName, oldName) { imgName(newName, oldName) {
console.log(newName); // console.log(newName);
const imgPathsArr = JSON.parse(newName); const imgPathsArr = JSON.parse(newName);
this.entity.picture = imgPathsArr[0].filePath; this.entity.picture = imgPathsArr[0].filePath;
this.avatorPath = fileUrlDown + imgPathsArr[0].filePath; this.avatorPath = fileUrlDown + imgPathsArr[0].filePath;
......
...@@ -16,12 +16,13 @@ ...@@ -16,12 +16,13 @@
</Filed> </Filed>
<Filed :span="24" :name="l('note') + ':'">{{ entity.note }}</Filed> <Filed :span="24" :name="l('note') + ':'">{{ entity.note }}</Filed>
<Filed :span="24" :name="l('attachment') + ':'"> <Filed :span="24" :name="l('attachment') + ':'">
<files <FilesView ref="refFile" :parms="parms" />
<!-- <files
ref="refFile" ref="refFile"
:parms="parms" :parms="parms"
fileFormat fileFormat
:showList="false" :showList="false"
/> /> -->
</Filed> </Filed>
</Row> </Row>
</div> </div>
......
...@@ -171,9 +171,13 @@ export default { ...@@ -171,9 +171,13 @@ export default {
this.load(v); this.load(v);
} }
}, },
imgName(newName, oldName) {
const imgPathsArr = JSON.parse(newName);
this.entity.picture = imgPathsArr[0].filePath;
this.avatorPath = fileUrlDown + imgPathsArr[0].filePath;
},
}, },
}; };
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
\ No newline at end of file
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
footer-hide footer-hide
:mask-closable="false" :mask-closable="false"
> >
<FilesView ref="refFile" :parms="parms" class="files-detail" /> <FilesView ref="refFile" :parms="parms" />
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -403,8 +403,25 @@ export default { ...@@ -403,8 +403,25 @@ export default {
} }
}, },
viewImg(row) { viewImg(row) {
console.log(row); // console.log(row);
window.open(fileUrlDown + row.picture, "_blank"); // window.open(fileUrlDown + row.picture, "_blank");
if (row.picture) {
this.$Modal.confirm({
render: (h) => {
return h("Pictrue", {
props: {
src: row.picture,
},
style: {
width: "100%",
height: "100%",
},
});
},
});
} else {
this.$Message.error("暂没上传图片");
}
}, },
viewFiles(row) { viewFiles(row) {
console.log(row); console.log(row);
...@@ -562,7 +579,4 @@ export default { ...@@ -562,7 +579,4 @@ export default {
} }
} }
} }
.files-detail {
min-height: 300px;
}
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment