| @@ -12,12 +12,24 @@ | |||
| <el-tab-pane label="公开镜像" name="first" v-loading="loadingPublic"> | |||
| <template v-if="tableDataPublic.length!==0"> | |||
| <div class="ui sixteen wide column"> | |||
| <div class="ui two column stackable grid"> | |||
| <!-- <div class="ui two column stackable grid"> | |||
| <div class="column"> | |||
| <el-input placeholder="请输入镜像名称关健词" v-model="search" class="input-with-select" @keyup.enter.native="searchName()"> | |||
| </div> | |||
| <div class="column"> | |||
| <el-input placeholder="搜镜像名称/描述/标签..." v-model="search" class="input-with-select" @keyup.enter.native="searchName()"> | |||
| <el-button id="success" slot="append" icon="el-icon-search" @click="searchName()">搜索</el-button> | |||
| </el-input> | |||
| </div> | |||
| </div> --> | |||
| <div class="ui eight wide column"> | |||
| </div> | |||
| <div class="ui three wide column"> | |||
| </div> | |||
| <div class="ui five wide column"> | |||
| </div> | |||
| </div> | |||
| <el-row style="margin-top:15px;"> | |||
| @@ -71,7 +83,9 @@ | |||
| align="center" | |||
| > | |||
| <template slot-scope="scope"> | |||
| {{scope.row.isPrivate | transformPravite}} | |||
| <a :href="scope.row.UserName" :title="scope.row.UserName"> | |||
| <img :src="scope.row.RelAvatarLink" class="ui avatar image"> | |||
| </a> | |||
| </template> | |||
| </el-table-column> | |||
| <el-table-column | |||
| @@ -93,7 +107,7 @@ | |||
| <div style="display: flex;justify-content: flex-end;align-items: center;"> | |||
| <div style="display: flex;align-items: center;cursor:pointer;padding: 0 1rem;" @click="imageStar(scope.row.id)"> | |||
| <svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke"><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg> | |||
| <span style="line-height: 2;margin-left:0.3rem;">3</span> | |||
| <span style="line-height: 2;margin-left:0.3rem;">{{scope.row.numStars}}</span> | |||
| </div> | |||
| <span style="padding: 0 1rem;color:#0366d6;cursor:pointer;" @click="copyUrl(scope.row.place)">复制地址</span> | |||
| </div> | |||
| @@ -198,9 +212,9 @@ | |||
| > | |||
| <template slot-scope="scope"> | |||
| <div style="display: flex;justify-content: flex-end;align-items: center;"> | |||
| <div style="display: flex;align-items: center;cursor:pointer;padding: 0 1rem;" @click="imageStar(scope.row.id)"> | |||
| <div style="display: flex;align-items: center;cursor:pointer;padding: 0 1rem;" @click="imageStar(scope.$index,scope.row.id)"> | |||
| <svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke"><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg> | |||
| <span style="line-height: 2;margin-left:0.3rem;">3</span> | |||
| <span style="line-height: 2;margin-left:0.3rem;">{{scope.row.numStars}}</span> | |||
| </div> | |||
| <span style="padding: 0 1rem;color:#0366d6;cursor:pointer;" @click="copyUrl(scope.row.place)">复制地址</span> | |||
| <div style="padding-left:1rem;cursor:pointer;"> | |||
| @@ -344,6 +358,7 @@ export default { | |||
| totalNumCustom:0, | |||
| paramsCustom:{page:1,pageSize:15,q:''}, | |||
| tableDataCustom: [], | |||
| starCustom:[], | |||
| loadingCustom:false, | |||
| currentPageStar:1, | |||
| @@ -427,6 +442,10 @@ export default { | |||
| console.log("res",res) | |||
| this.totalNumCustom = res.data.count | |||
| this.tableDataCustom = res.data.images | |||
| this.tableDataCustom.forEach(element => { | |||
| this.starCustom.push({id:element.id,}) | |||
| }); | |||
| this.loadingCustom = false | |||
| }) | |||
| }, | |||
| @@ -452,6 +471,13 @@ export default { | |||
| eidtImage(id){ | |||
| location.href = `/image/${id}/imageSquare` | |||
| }, | |||
| imageStar(index,id){ | |||
| console.log("===index",index,this.tableDataCustom[index]) | |||
| this.$axios.put(`/image/${id}/action/star`).then((res)=>{ | |||
| console.log(res) | |||
| this.tableDataCustom[index].numStars = this.tableDataCustom[index].numStars + 1 | |||
| }) | |||
| }, | |||
| copyUrl(url){ | |||
| const cInput = document.createElement('input') | |||
| cInput.value = url | |||