zhanghua
2025-07-16 7c20fd15b7fbc2bd5756b39d5ab655cc849ffcc3
src/components/filePictrue/index.vue
@@ -2,62 +2,115 @@
    <div class="file-picture">
        <div class="file-tell">
            <div class="tell-title">上报</div>
            <div class="tell-show">
                <div class="my-demo">
                    <!-- <img src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__ef98ada722c616eccb097d1352880862.svg"
                            alt=""> -->
                    <img class="img" :src="imgSource[0].url" alt="">
                    <div class="tip">
                        <div>【图片类型】上报</div>
                        <div>【上报时间】2022-09-08 14:23:34</div>
            <div class="tell-show" v-for="item in imgSource" :key="item.id">
                <div v-if="item.type == '01'" style="display: flex">
                    <div class="my-demo" v-for="childer in item.url">
                        <img class="img" :src="childer" alt="" />
                        <div class="tip">
                            <div>【图片类型】上报</div>
                            <div>
                                【上传时间】{{ changeTime(item.createTime) }}
                            </div>
                        </div>
                    </div>
                </div>
                <img src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__ef98ada722c616eccb097d1352880862.svg"
                    alt="">
            </div>
        </div>
        <div class="file-deal">
            <div class="tell-title">处置</div>
            <div class="tell-show">
                <div class="my-demo">
                    <!-- <img src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__ef98ada722c616eccb097d1352880862.svg"
                        alt=""> -->
                    <img class="img" :src="imgSource[1].url" alt="">
                    <div class="tip">
                        <div>【图片类型】处置</div>
                        <div>【上报时间】2022-09-08 14:23:34</div>
            <div class="tell-show" v-for="item in imgSource" :key="item.id">
                <div v-if="item.type == '02'" class="tell-demo">
                    <div class="my-demo" v-for="childer in item.url">
                        <img class="img" :src="childer" alt="" />
                        <div class="tip">
                            <!-- <div>【图片类型】处置</div> -->
                            <div>
                                【上传时间】{{ changeTime(item.createTime) }}
                            </div>
                        </div>
                    </div>
                </div>
                <img src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__ef98ada722c616eccb097d1352880862.svg"
                    alt="">
            </div>
        </div>
    </div>
</template>
<script>
import { parseTime, FILE_ORIGINAL_PATH } from "@/utils/index";
export default {
    data() {
        return {
            imgSource: []
        }
            imgSource: [],
        };
    },
    props: ['filesPictureVo'],
    props: ["filesPictureVo", "mycode"],
    created() {
        console.log(this.filesPictureVo);
        const { filesPictureVo: { imageResources: mysource } } = this;
        this.imgSource = mysource;
        this.imgSource = []
        const {
            filesPictureVo: { imageResources: imgList },
        } = this;
        let pic = this.filesPictureVo.imageResources;
        pic.forEach((item) => {
            if (item.url) {
                if (typeof item.url == "string") {
                    let urls = item.url.split(",");
                    item.url = [];
                    urls.forEach((o) => {
                        o = o.replace("[", "").replace("]", "");
                        if (o !== '') {
                            item.url.push(FILE_ORIGINAL_PATH + o);
                        }
                    });
                }
            } else {
                item.url = [];
            }
        });
        this.imgSource = pic;
        // this.getEventInfo(this.mycode);
    },
    methods: {
        // 获取token
        getToken() {
            const token = sessionStorage.getItem('token');
            const tokenHead = sessionStorage.getItem('tokenHead');
            const token = sessionStorage.getItem("token");
            const tokenHead = sessionStorage.getItem("tokenHead");
            if (token && tokenHead) {
                return { Authorization: tokenHead + token };
            }
        }
    }
}
        },
        changeTime(time) {
            if (time) {
                return parseTime(time);
            }
        },
        getEventInfo(mycode) {
            this.$axios({
                method: "get",
                url: `sccg/base_case/baseCaseDetail/${mycode}`,
            }).then((res) => {
                this.info = res.data;
                this.dialogView = true;
                let pic = res.data.filesPictureVo.imageResources;
                pic.forEach((item) => {
                    if (item.url) {
                        if (typeof item.url == "string") {
                            let urls = item.url.split(",");
                            item.url = [];
                            urls.forEach((o) => {
                                o = o.replace("[", "").replace("]", "");
                                item.url.push(FILE_ORIGINAL_PATH + o);
                            });
                        }
                    } else {
                        item.url = [];
                    }
                });
                this.imgSource = pic;
            });
        },
    },
};
</script>
<style lang="scss" scoped>
.file-picture {
@@ -70,13 +123,18 @@
        }
        .tell-show {
            display: flex;
            .tell-demo {
                display: flex;
                flex-wrap: wrap;
                width: 100%;
            }
        }
    }
    .my-demo {
        position: relative;
        height: 159px;
        margin: 10px;
    }
    .tip {