1
lzhe
2024-06-16 4bb7defa0409584f5f60bc8b582123a3bdd6690c
1
已修改2个文件
92 ■■■■ 文件已修改
src/views/console/base/Shiftsystem.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/console/basic-data/gallery.vue 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/console/base/Shiftsystem.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-04-09 20:19:46
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-03 22:57:46
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-06-15 23:34:34
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/base/Shiftsystem.vue
-->
<template>
@@ -283,7 +283,6 @@
            }).catch(() => {
            })
        }
    },
}
src/views/console/basic-data/gallery.vue
@@ -2,7 +2,7 @@
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-03-26 10:28:33
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-06-05 17:06:58
 * @LastEditTime: 2024-06-16 00:08:37
 * @FilePath: /smart-web/src/views/master/person/main/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -29,19 +29,26 @@
                    <span class="delData" @click="delData(index)">删除</span>
                </div>
                <div class="upload">
                    <div v-for="(item1,index1) in item.ImageUrlList">
                        <img :src="item1.url" alt="" @click="viewUrl(item1)">
                    </div>
                    <el-upload
                        :disabled="!item.id"
                        :action="action"
                        :headers= "myHeader"
                        list-type="picture-card"
                        :show-file-list=false
                        :on-success="(file)=>handleAvatarSuccess(file,index)"
                        :before-upload="(file)=>beforeAvatarUpload(file,index)">
                        :before-upload="(file)=>beforeAvatarUpload(file,index)"
                        class="uploadStyle">
                        <el-icon><Plus /></el-icon>
                    </el-upload>
                    <el-dialog :visible.sync="dialogVisible">
                        <img width="100%" :src="dialogImageUrl" alt="">
                    <div v-for="(item1,index1) in item.children" class="imgStyle">
                        <img :src="'http://120.46.212.231:19000/visual/' + item1.link" alt="">
                        <div class="img-edit">
                            <el-icon @click="viewUrl(item1)"><CirclePlus /></el-icon>
                            <el-icon @click="delUrl(item1)"><Delete /></el-icon>
                        </div>
                    </div>
                    <el-dialog v-model="dialogVisible" class="dialogImageUrl" :width="500">
                        <img :src="dialogImageUrl" alt="">
                    </el-dialog>
                </div>
            </div>
@@ -63,6 +70,7 @@
                dialogVisible: false,
                latticeList: [],
                ImageUrlList: [],
                myHeader: {}
            }
        },
        created(){
@@ -77,7 +85,21 @@
        methods: {
            viewUrl(item1) {
                this.dialogVisible = true;
                this.dialogImageUrl = item1.url;
                this.dialogImageUrl = "http://120.46.212.231:19000/visual/" + item1.link;
            },
            delUrl(item1) {
                this.$confirm(`删除`, '', {
                    type: 'warning'
                }).then(() => {
                    this.$HTTP.delete(`/api/blade-system/gallery-item/remove`,[item1.id]).then(res => {
                        if (res.code === 200) {
                            this.$message.success("操作成功");
                            this.getTreeList();
                        }
                    })
                }).catch(() => {
                })
            },
            editData(index) {
                this.latticeList[index].status = 0;
@@ -137,7 +159,9 @@
            },
            beforeAvatarUpload(file,index) {
                if(this.latticeList[index].id) {
                    var TOKEN = this.$TOOL.cookie.get("TOKEN")
                    this.action = `/api/blade-system/gallery-item/insert?galleryId=${this.latticeList[index].id}`;
                    this.myHeader = {Authorization: 'Basic c2FiZXI6c2FiZXJfc2VjcmV0','Blade-Auth': TOKEN}
                }else {
                    return false;
                }
@@ -149,9 +173,7 @@
                
            },
            handleAvatarSuccess(file,index) {
                this.latticeList[index].ImageUrlList.push({
                    url: file.url
                })
                this.latticeList[index].children.push(file.data);
            },
            table_create() {
                this.latticeList.push({name: "",ImageUrlList: [],status: 0})
@@ -212,4 +234,47 @@
        margin-top: 12px;
        margin-bottom: 12px;
    }
    .uploadStyle {
        display: inline-block;
        vertical-align: top;
    }
    .imgStyle {
        display: inline-block;
        margin-left: 12px;
        position: relative;
    }
    .imgStyle:hover .img-edit {
        display: inline-block;
    }
    .imgStyle img {
        width: 148px;
        height: 148px;
    }
    /deep/ .dialogImageUrl {
        text-align: center;
    }
    .dialogImageUrl img {
        width: 400px;
        height: 400px;
    }
    .img-edit {
        display: none;
        vertical-align: top;
        position: absolute;
        top: 0;
        left: 0;
        width: 148px;
        height: 148px;
        background-color: rgba(0,0,0,.4);
        text-align: center;
        line-height: 148px;
    }
    .img-edit i {
        color: #fff;
        font-size: 20px;
        cursor: pointer;
    }
    .img-edit i:nth-child(1) {
        margin-right: 12px;
    }
</style>