| | |
| | | * @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 |
| | | --> |
| | |
| | | <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> |
| | |
| | | dialogVisible: false, |
| | | latticeList: [], |
| | | ImageUrlList: [], |
| | | myHeader: {} |
| | | } |
| | | }, |
| | | created(){ |
| | |
| | | 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; |
| | |
| | | }, |
| | | 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; |
| | | } |
| | |
| | | |
| | | }, |
| | | 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}) |
| | |
| | | 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> |