|
@@ -3,27 +3,38 @@
|
|
|
<div class="d-header">
|
|
|
<ul class="tab-list" v-if="!deviceLogin">
|
|
|
<li @click="tabActive = item.id" :class="{active:tabActive === item.id}" v-for="(item,i) in langScenes.tabList" :key="i">
|
|
|
- {{item.name}}
|
|
|
+ {{item.name}}({{i===0?allTotal:xiezuoNum}})
|
|
|
</li>
|
|
|
</ul>
|
|
|
|
|
|
<ul class="tab-list" v-else>
|
|
|
<li class="active" v-for="(item,i) in [langScenes.tabList[0]]" :key="i">
|
|
|
- {{item.name}}
|
|
|
+ {{item.name}}({{allTotal}})
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <div class="tab-search">
|
|
|
- <input
|
|
|
- v-model="searchKey"
|
|
|
- @keyup.enter="gotoSearch(searchKey)"
|
|
|
- type="text"
|
|
|
- :placeholder="langScenes.placeholder.searchID"
|
|
|
- />
|
|
|
- <i class="iconfont icon-sousuo" @click="gotoSearch(searchKey)"></i>
|
|
|
+ <div class="rig-con">
|
|
|
+ <div class="btns" v-if="tabActive===1&&!isImgType">
|
|
|
+ <span class="button" @click="multCop">{{langScenes.fenpei}}</span>
|
|
|
+ <span class="button default" @click="multDel">{{langScenes.delete}}</span>
|
|
|
+ </div>
|
|
|
+ <div class="tab-search">
|
|
|
+ <input
|
|
|
+ v-model="searchKey"
|
|
|
+ @keyup.enter="gotoSearch(searchKey)"
|
|
|
+ type="text"
|
|
|
+ :placeholder="langScenes.placeholder.searchID"
|
|
|
+ />
|
|
|
+ <i class="iconfont icon-sousuo" @click="gotoSearch(searchKey)"></i>
|
|
|
+ </div>
|
|
|
+ <div class="main-list">
|
|
|
+ <i @click="changeType(true)" class="iconfont icon-main_grid" :title="langScenes.pictle" :class="{active:isImgType}"></i>
|
|
|
+ <i @click="changeType(false)" class="iconfont icon-main_list" :title="langScenes.listtle" :class="{active:!isImgType}"></i>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <ul v-if="total" ref="ulMenu">
|
|
|
+ <template v-if="total">
|
|
|
+ <ul v-if="isImgType" ref="ulMenu">
|
|
|
<template>
|
|
|
<li v-for="(item,index) in myscene.list" :key="index">
|
|
|
<div @click="((item.status === 1||item.status===-2)&&item.payStatus !== -2) && goto(item.webSite)" class="a-tap">
|
|
@@ -52,7 +63,7 @@
|
|
|
</div>
|
|
|
<ul :style="{minWidth: language==='en'?'150px': '90px'}">
|
|
|
<li v-if="item.status === 1||item.status===-2" @click="gotoEdit(item)">{{langScenes.edit}}</li>
|
|
|
- <li @click="handleCooperation(item)" v-if="(item.status === 1||item.status===-2)&&!deviceLogin">{{item.cooperationUserId?langScenes.qxfp:langScenes.fenpei}}</li>
|
|
|
+ <li @click="handleCooperation(item)" v-if="(item.status === 1||item.status===-2)&&!deviceLogin">{{langScenes.fenpei}}</li>
|
|
|
<li v-if="item.status !== 0" @click="del(item)">{{langScenes.delete}}</li>
|
|
|
</ul>
|
|
|
</template>
|
|
@@ -78,10 +89,36 @@
|
|
|
</li>
|
|
|
</template>
|
|
|
</ul>
|
|
|
+
|
|
|
+ <tableList v-else @selection-change="data=>{selectedArr=data}" :header='tabHeader' :showLine='true' :selection='true' :data='myscene.list' class="table-list" >
|
|
|
+ <div slot-scope="{data}" slot="header">
|
|
|
+ {{language==='en'?data.en:data.name}}
|
|
|
+ </div>
|
|
|
+ <div slot-scope="{data,canclick,type,item}" slot="item" style="width:100%">
|
|
|
+ <template v-if="canclick">
|
|
|
+ <span class="edit" v-if="item.status === 1||item.status===-2" @click="gotoEdit(item)">{{langScenes.edit}}</span>
|
|
|
+ <span class="edit" @click="handleCooperation(item)" v-if="(item.status === 1||item.status===-2)&&!deviceLogin&&tabActive===1" >{{langScenes.fenpei}}</span>
|
|
|
+ </template>
|
|
|
+ <div style="position:relative;" v-else-if="type === 'image'" >
|
|
|
+ <div :title="item.name" @click="((item.status === 1||item.status===-2)&&item.payStatus !== -2) && goto(item.webSite)" style="height:40px;" class="card-img" :style="{backgroundImage: `url(${getSceneImg(item)})`}"></div>
|
|
|
+ <div class="loading-hover" v-if="item.status === 0">
|
|
|
+ <div class="loading-icon" style="width:100%">
|
|
|
+ <p style="margin-top:0">{{langScenes.share.calcule}}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <span v-else-if="type === 'typefix'">{{langScenes.typeObj[data]}}</span>
|
|
|
+ <span v-else>{{data||'-'}}</span>
|
|
|
+ </div>
|
|
|
+ </tableList>
|
|
|
+ </template>
|
|
|
+
|
|
|
<div class="scene-nothing" v-else>
|
|
|
<img :src="`${$cdn}images/nothing.png`" />
|
|
|
<div>{{langScenes.noScenes}}</div>
|
|
|
</div>
|
|
|
+
|
|
|
<div class="paging" v-if="total">
|
|
|
<Paging @clickHandle="pageChange" :current="currentPage" :total="total" :equable="pageSize" />
|
|
|
</div>
|
|
@@ -135,9 +172,11 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapState } from 'vuex'
|
|
|
+import tableList from '@/components/table'
|
|
|
+import {scene} from './iscene'
|
|
|
import Paging from '@/components/Paging'
|
|
|
export default {
|
|
|
- components: { Paging },
|
|
|
+ components: { Paging, tableList },
|
|
|
data () {
|
|
|
let imgs = [
|
|
|
{
|
|
@@ -153,15 +192,23 @@ export default {
|
|
|
id: 2
|
|
|
}
|
|
|
]
|
|
|
+
|
|
|
+ let isImgType = localStorage.getItem('isImgType') === '' ? true : (localStorage.getItem('isImgType') === 'true')
|
|
|
return {
|
|
|
+ tabHeader: scene,
|
|
|
+ xiezuoNum: 0,
|
|
|
pageSize: 12,
|
|
|
+ lock: false,
|
|
|
currentPage: 1,
|
|
|
searchKey: '',
|
|
|
+ selectedArr: [],
|
|
|
total: 0,
|
|
|
+ allTotal: 0,
|
|
|
showShare: false,
|
|
|
imgs,
|
|
|
num: '',
|
|
|
rnd: Math.random(),
|
|
|
+ isImgType: isImgType,
|
|
|
lwidth: 853,
|
|
|
lheight: 480,
|
|
|
url: 'https://www.4dkankan.com/showProPC.html?m=KcMeJlOr8',
|
|
@@ -237,39 +284,54 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
} else {
|
|
|
+ this.getCooTotal()
|
|
|
this.getList()
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- async handleCooperation (item) {
|
|
|
- if (item.cooperationUserId) {
|
|
|
- let result = await this.$http({
|
|
|
- method: 'post',
|
|
|
- data: {
|
|
|
- sceneNum: item.num
|
|
|
- },
|
|
|
- headers: {
|
|
|
- token: this.token
|
|
|
- },
|
|
|
- url: '/user/scene/cooperation/delete'
|
|
|
+ changeType (status) {
|
|
|
+ this.isImgType = status
|
|
|
+ localStorage.setItem('isImgType', status)
|
|
|
+ },
|
|
|
+ checkSelect () {
|
|
|
+ let pass = this.selectedArr.length <= 0
|
|
|
+ if (pass) {
|
|
|
+ return this.$toast.show('warn', `${this.language === 'en' ? 'Please select at least one.' : '请至少勾选一项'}`)
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ multCop () {
|
|
|
+ if (this.checkSelect()) {
|
|
|
+ let nums = this.selectedArr.map(item => {
|
|
|
+ return item.num
|
|
|
})
|
|
|
- let data = result.data
|
|
|
- if (data.code === 0) {
|
|
|
- this.$toast.show('success', this.langToast['45'], () => {
|
|
|
- this.getList()
|
|
|
- })
|
|
|
- } else {
|
|
|
- return this.$toast.show('warn', this.langToast[data.code], () => {})
|
|
|
- }
|
|
|
- } else {
|
|
|
+
|
|
|
this.$toast.showCooperation({
|
|
|
- num: item.num,
|
|
|
+ ids: nums.join(','),
|
|
|
type: 'scene'
|
|
|
}, () => {
|
|
|
this.getList()
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ multDel () {
|
|
|
+ if (this.checkSelect()) {
|
|
|
+ let nums = this.selectedArr.map(item => {
|
|
|
+ return item.num
|
|
|
+ })
|
|
|
+
|
|
|
+ this.del(nums.join(','), true)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async handleCooperation (item) {
|
|
|
+ this.$toast.showCooperation({
|
|
|
+ num: item.num,
|
|
|
+ cooName: item.cooperationUserName,
|
|
|
+ type: 'scene'
|
|
|
+ }, () => {
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ },
|
|
|
handleMenu (index) {
|
|
|
this.ulActive = index === this.ulActive ? '' : index
|
|
|
},
|
|
@@ -352,10 +414,10 @@ export default {
|
|
|
|
|
|
window.open(url.replace('http://', 'https://') + (this.language === 'en' ? '&lang=en' : ''), '_blank')
|
|
|
},
|
|
|
- async del (item) {
|
|
|
+ async del (item, multi = false) {
|
|
|
this.$toast.showConfirm('warn', this.langScenes.delwarn, async () => {
|
|
|
let params = {
|
|
|
- sceneNum: item.num
|
|
|
+ sceneNum: multi ? item : item.num
|
|
|
}
|
|
|
let res = await this.$http({
|
|
|
method: 'post',
|
|
@@ -385,6 +447,24 @@ export default {
|
|
|
this.getList(searchKey)
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ async getCooTotal () {
|
|
|
+ let res = await this.$http({
|
|
|
+ method: 'post',
|
|
|
+ data: {
|
|
|
+ pageNum: this.currentPage,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ cameraId: null,
|
|
|
+ searchKey: this.searchKey,
|
|
|
+ cameraType: null
|
|
|
+ },
|
|
|
+ headers: {
|
|
|
+ token: this.token
|
|
|
+ },
|
|
|
+ url: '/user/scene/cooperation/cooperationSceneList'
|
|
|
+ })
|
|
|
+ this.xiezuoNum = res.data.data.total
|
|
|
+ },
|
|
|
async getList (searchKey = null) {
|
|
|
this.searchKey = searchKey || this.searchKey
|
|
|
let { id: cameraId = null, type: cameraType = null } = this.cameradetail
|
|
@@ -393,7 +473,7 @@ export default {
|
|
|
pageNum: this.currentPage,
|
|
|
pageSize: this.pageSize,
|
|
|
cameraId,
|
|
|
- searchKey: this.searchKey,
|
|
|
+ searchKey: this.searchKey.trim(),
|
|
|
cameraType
|
|
|
}
|
|
|
if (this.tabActive === 2) {
|
|
@@ -405,6 +485,11 @@ export default {
|
|
|
}
|
|
|
this.pageSize = this.myscene.pageSize
|
|
|
this.total = this.myscene.total || 0
|
|
|
+
|
|
|
+ if (!this.lock && !this.allTotal) {
|
|
|
+ this.lock = true
|
|
|
+ this.allTotal = this.total
|
|
|
+ }
|
|
|
},
|
|
|
copyTextToClipboard (text) {
|
|
|
var textArea = document.createElement('textarea')
|
|
@@ -471,30 +556,66 @@ $font-color: #2d2d2d;
|
|
|
border-bottom: 1px solid $theme-color;
|
|
|
}
|
|
|
}
|
|
|
- .tab-search{
|
|
|
+
|
|
|
+ .rig-con{
|
|
|
+ margin-right: 40px;
|
|
|
float: right;
|
|
|
- position: relative;
|
|
|
- width: 230px;
|
|
|
- padding-left: 10px;
|
|
|
- margin-right: 120px;
|
|
|
- border: 1px solid #ccc;
|
|
|
display: flex;
|
|
|
- .iconfont{
|
|
|
- width: 28px;
|
|
|
- height: 28px;
|
|
|
- padding: 6px;
|
|
|
- cursor: pointer;
|
|
|
- background: #e4e4e4;
|
|
|
+ align-items: center;
|
|
|
+ .btns{
|
|
|
+ margin-right: 20px;
|
|
|
+ .button{
|
|
|
+ line-height: 30px;
|
|
|
+ height: 30px;
|
|
|
+ min-width: 80px;
|
|
|
+ padding: 0 10px;
|
|
|
+ text-align: center;
|
|
|
+ vertical-align: middle;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #202020;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .default{
|
|
|
+ background: #E4E4E4;
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
- input{
|
|
|
- width: 100%;
|
|
|
- font-size: 14px;
|
|
|
- appearance: none;
|
|
|
- line-height: 28px;
|
|
|
- height: 28px;
|
|
|
- border: 0;
|
|
|
+ .tab-search{
|
|
|
+ position: relative;
|
|
|
+ width: 230px;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ display: flex;
|
|
|
+ .iconfont{
|
|
|
+ width: 28px;
|
|
|
+ height: 28px;
|
|
|
+ padding: 6px;
|
|
|
+ cursor: pointer;
|
|
|
+ background: #e4e4e4;
|
|
|
+ }
|
|
|
+ input{
|
|
|
+ width: 100%;
|
|
|
+ font-size: 14px;
|
|
|
+ appearance: none;
|
|
|
+ padding-left: 10px;
|
|
|
+ line-height: 28px;
|
|
|
+ height: 28px;
|
|
|
+ border: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .main-list{
|
|
|
+ display: inline-block;
|
|
|
+ margin-left: 20px;
|
|
|
+ .iconfont{
|
|
|
+ cursor: pointer;
|
|
|
+ font-size: 20px;
|
|
|
+ margin-left: 5px;
|
|
|
+ }
|
|
|
+ .active{
|
|
|
+ color: #1fe4dc;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
> ul {
|
|
|
padding: 30px 0 0 40px;
|
|
@@ -657,31 +778,20 @@ $font-color: #2d2d2d;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // .tab-search {
|
|
|
- // float: right;
|
|
|
- // position: relative;
|
|
|
- // width: 230px;
|
|
|
- // padding-left: 10px;
|
|
|
- // border: 1px solid #ccc;
|
|
|
- // top: -30px;
|
|
|
- // right: 6vw;
|
|
|
- // display: flex;
|
|
|
- // .iconfont {
|
|
|
- // width: 28px;
|
|
|
- // height: 28px;
|
|
|
- // padding: 6px;
|
|
|
- // background: #e4e4e4;
|
|
|
- // cursor: pointer;
|
|
|
- // }
|
|
|
- // input {
|
|
|
- // width: 100%;
|
|
|
- // font-size: 14px;
|
|
|
- // appearance: none;
|
|
|
- // line-height: 28px;
|
|
|
- // height: 28px;
|
|
|
- // border: 0;
|
|
|
- // }
|
|
|
- // }
|
|
|
+
|
|
|
+ .table-list{
|
|
|
+ width: calc(100% - 80px);
|
|
|
+ margin: 30px auto;
|
|
|
+ .card-img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ cursor: pointer;
|
|
|
+ background-position: center;
|
|
|
+ background-size: auto 100%;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.scene-nothing {
|
|
|
width: 75%;
|
|
|
padding: 42px 0 210px 0;
|
|
@@ -701,7 +811,7 @@ $font-color: #2d2d2d;
|
|
|
& /deep/ .layout {
|
|
|
text-align: left;
|
|
|
margin-top: 0;
|
|
|
- margin-left: 15px;
|
|
|
+ margin-left: 30px;
|
|
|
}
|
|
|
& /deep/ .layout a:not(:last-child) {
|
|
|
margin: 10px 8px;
|