|
@@ -4,18 +4,10 @@
|
|
|
<div class="order-management-inner">
|
|
|
<div class="base-info">
|
|
|
<span>关键词:</span>
|
|
|
- <el-input
|
|
|
- @keyup.enter.native="()=>{currentPage=1;_getSceneData()}"
|
|
|
- v-model="searchKey"
|
|
|
- placeholder="关键词"
|
|
|
- ></el-input>
|
|
|
+ <el-input @keyup.enter.native="()=>{currentPage=1;_getSceneData()}" v-model="searchKey" placeholder="关键词"></el-input>
|
|
|
<el-button type="primary" @click="()=>{currentPage=1;_getSceneData()}" color="red">搜索</el-button>
|
|
|
<span style="margin-left:10px;">SN码:</span>
|
|
|
- <el-input
|
|
|
- @keyup.enter.native="getSceneBySN"
|
|
|
- v-model="snKey"
|
|
|
- placeholder="输入SN码下载场景数据"
|
|
|
- ></el-input>
|
|
|
+ <el-input @keyup.enter.native="getSceneBySN" v-model="snKey" placeholder="输入SN码下载场景数据"></el-input>
|
|
|
<el-button type="primary" @click="getSceneBySN" color="red">下载场景数据</el-button>
|
|
|
|
|
|
</div>
|
|
@@ -25,17 +17,9 @@
|
|
|
<div class="order-management-table">
|
|
|
<div class="scene-management_tab">
|
|
|
<ul>
|
|
|
- <li
|
|
|
- v-for="(item,index) in tabs"
|
|
|
- :key="index"
|
|
|
- :class="{'scene-management_tab_li_active':item.idx==tabIndex}"
|
|
|
- @click="clickTabItem(item.idx)"
|
|
|
- >
|
|
|
+ <li v-for="(item,index) in tabs" :key="index" :class="{'scene-management_tab_li_active':item.idx==tabIndex}" @click="clickTabItem(item.idx)">
|
|
|
{{item.name}}
|
|
|
- <span
|
|
|
- v-if="item.idx != -2"
|
|
|
- style="margin:0 10px;color: #999;font-weight: normal;"
|
|
|
- >/</span>
|
|
|
+ <span v-if="item.idx != -2" style="margin:0 10px;color: #999;font-weight: normal;">/</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<div style="float: right;vertical-align: middle;">
|
|
@@ -46,18 +30,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <el-table
|
|
|
- key="order_table"
|
|
|
- ref="order_table"
|
|
|
- class="e-table"
|
|
|
- :data="scenes"
|
|
|
- style="width: 100%"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- width="55">
|
|
|
- </el-table-column>
|
|
|
+ <el-table key="order_table" ref="order_table" class="e-table" :data="scenes" style="width: 100%" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="场景封面" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
<a :href="scope.row.webSite" target="_blank" style="cursor: pointer;">
|
|
@@ -96,68 +71,45 @@
|
|
|
<el-table-column prop="viewCount" label="浏览数"></el-table-column>
|
|
|
<el-table-column prop="sceneType" label="平台展示">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-switch
|
|
|
- @change="_updateSceneStatus(scope.row.num,scope.row.status)"
|
|
|
- v-model="scope.row.statusBoo"
|
|
|
- active-color="#13ce66"
|
|
|
- inactive-color="#ff4949"
|
|
|
- ></el-switch>
|
|
|
+ <el-switch @change="_updateSceneStatus(scope.row.num,scope.row.status)" v-model="scope.row.statusBoo" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="status" label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- v-if="scope.row.sceneScheme>4"
|
|
|
- type="text"
|
|
|
- @click="_showDownloadSelect(scope.row.num);"
|
|
|
- class="download_btn"
|
|
|
- >下载</el-button>
|
|
|
+ <el-button v-if="scope.row.sceneScheme>4" type="text" @click="_showDownloadSelect(scope.row.num);" class="download_btn">下载</el-button>
|
|
|
<el-button type="text" @click="_deleScene(scope.row.num)" class="delete_btn">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<div class="order-management-pagination">
|
|
|
- <el-pagination
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page.sync="currentPage"
|
|
|
- :page-size="pageSize"
|
|
|
- layout="total, prev, pager, next, jumper"
|
|
|
- :total="total"
|
|
|
- ></el-pagination>
|
|
|
+ <el-pagination @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="total, prev, pager, next, jumper" :total="total"></el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<el-dialog width="450px" title="迁移场景" :visible.sync="dialogTransferVisible">
|
|
|
- <el-form >
|
|
|
- <el-form-item label="当前SN码:" width="100%">
|
|
|
- <div style="max-height:300px;overflow: auto;">
|
|
|
- <p v-for="(item,i) in multipleSelection" :key="i">{{item.snCode||item.childName}}</p>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="迁往SN码:" width="100%">
|
|
|
- <el-input v-model="transferSN"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="dialogTransferVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="transferScene">确 定</el-button>
|
|
|
+ <el-form>
|
|
|
+ <el-form-item label="当前SN码:" width="100%">
|
|
|
+ <div style="max-height:300px;overflow: auto;">
|
|
|
+ <p v-for="(item,i) in multipleSelection" :key="i">{{item.snCode||item.childName}}</p>
|
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-dialog
|
|
|
- width="500px"
|
|
|
- title="场景下载"
|
|
|
- :visible.sync="downloadDialogVisible"
|
|
|
- >
|
|
|
+ <el-form-item label="迁往SN码:" width="100%">
|
|
|
+ <el-input v-model="transferSN"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogTransferVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="transferScene">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog width="500px" title="场景下载" :visible.sync="downloadDialogVisible">
|
|
|
<el-form :model="downloadOptions">
|
|
|
<el-form-item label="是否下载tiles">
|
|
|
- <el-switch
|
|
|
- v-model="downloadOptions.isTiles"
|
|
|
- active-color="#13ce66"
|
|
|
- inactive-color="#ff4949">
|
|
|
+ <el-switch v-model="downloadOptions.isTiles" active-color="#13ce66" inactive-color="#ff4949">
|
|
|
</el-switch>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -168,12 +120,7 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
- width="500px"
|
|
|
- title="下载场景"
|
|
|
- :visible.sync="download.showSta"
|
|
|
- :before-close="_handleClose"
|
|
|
- >
|
|
|
+ <el-dialog width="500px" title="下载场景" :visible.sync="download.showSta" :before-close="_handleClose">
|
|
|
<el-form v-if="download.showSta" label-width="100px">
|
|
|
<div id="progressText" class>
|
|
|
<span>{{download.downloadSta}}</span>
|
|
@@ -201,7 +148,8 @@ const _sceneTypeName = {
|
|
|
}
|
|
|
|
|
|
// const serverName = 'https://test.4dkankan.com'
|
|
|
-const serverName = 'http://192.168.0.28:8887'
|
|
|
+// const serverName = 'http://192.168.0.28:8887'
|
|
|
+const serverName = 'manager/user'
|
|
|
// const serverName = 'https://www.4dage.com'
|
|
|
|
|
|
export default {
|
|
@@ -292,6 +240,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
async downloadMultipleScene () {
|
|
|
+ this.download.percent = 0
|
|
|
if (!this.multipleSelection && this.multipleSelection.length === 0) {
|
|
|
return this.$alert('请选择场景', '提示', {
|
|
|
confirmButtonText: '确定'
|
|
@@ -299,13 +248,38 @@ export default {
|
|
|
}
|
|
|
let arr = []
|
|
|
arr = this.multipleSelection.map((item) => item.num)
|
|
|
+ if (arr.length > 1) {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '只能下载一个场景'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let status = this.multipleSelection[0].status
|
|
|
+ if (status == 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '场景计算中,请耐心等待'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ } else if (status == -1) {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '场景计算失败'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
this.fullscreenLoading = true
|
|
|
|
|
|
- this.$confirm(`此操作将下载您选择的${arr.length}个场景, 是否继续?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ this.$confirm(
|
|
|
+ `此操作将下载您选择的${arr.length}个场景, 是否继续?`,
|
|
|
+ '提示',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }
|
|
|
+ )
|
|
|
.then(() => {
|
|
|
this._downloadScene('', arr, this.downloadOptions.isTiles)
|
|
|
})
|
|
@@ -340,11 +314,15 @@ export default {
|
|
|
message: '查询不到该SN码场景数据。'
|
|
|
})
|
|
|
}
|
|
|
- this.$confirm(`此操作将下载该相机下的${arr.length}个场景, 是否继续?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ this.$confirm(
|
|
|
+ `此操作将下载该相机下的${arr.length}个场景, 是否继续?`,
|
|
|
+ '提示',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }
|
|
|
+ )
|
|
|
.then(() => {
|
|
|
this._downloadScene(this.snKey, arr, this.downloadOptions.isTiles)
|
|
|
})
|
|
@@ -367,7 +345,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
async transferScene () {
|
|
|
- let sceneNumArr = this.multipleSelection.map(item => {
|
|
|
+ let sceneNumArr = this.multipleSelection.map((item) => {
|
|
|
return item.num
|
|
|
})
|
|
|
|
|
@@ -467,7 +445,9 @@ export default {
|
|
|
},
|
|
|
|
|
|
_showDownloadSelect (num) {
|
|
|
+ this.download.percent = 0
|
|
|
this.downloadDialogVisible = true
|
|
|
+
|
|
|
this.downloadOptions = {
|
|
|
activeNum: num,
|
|
|
isTiles: false
|
|
@@ -475,11 +455,12 @@ export default {
|
|
|
},
|
|
|
|
|
|
_downloadSingleScene () {
|
|
|
- let {activeNum: num, isTiles} = this.downloadOptions
|
|
|
+ let { activeNum: num, isTiles } = this.downloadOptions
|
|
|
this._downloadScene('', [num], isTiles)
|
|
|
},
|
|
|
|
|
|
_downloadScene (SNCode = '', sceneArr, isTiles = true) {
|
|
|
+ this.$forceUpdate()
|
|
|
this.fullscreenLoading = true
|
|
|
|
|
|
// let {isTiles} = this.downloadOptions
|
|
@@ -490,17 +471,24 @@ export default {
|
|
|
let arr = sceneArr
|
|
|
|
|
|
// arr = ['1ggqA2lb1', 'RQpb8C4qz', '1IgPTqRUB', '3dFKNeveg']
|
|
|
- let urlArr = arr.map(item => {
|
|
|
- return this.$http.get(`/scene/getInfo?num=${item}&t=${new Date().getTime()}`)
|
|
|
+
|
|
|
+ let urlArr = arr.map((item) => {
|
|
|
+ return this.$http.get(
|
|
|
+ `/scene/getInfo?num=${item}&t=${new Date().getTime()}`
|
|
|
+ )
|
|
|
})
|
|
|
|
|
|
let allPromise = this.$http.all(urlArr)
|
|
|
let errmsg = ''
|
|
|
- allPromise.then(res => {
|
|
|
+ allPromise.then((res) => {
|
|
|
let temp = []
|
|
|
- res.forEach(ele => {
|
|
|
+ res.forEach((ele) => {
|
|
|
if (ele && ele.code === 0) {
|
|
|
- this.$http.get(`/scene/addDownloadNum?sceneNum=${ele.data.num}&t=${new Date().getTime()}`)
|
|
|
+ this.$http.get(
|
|
|
+ `/scene/addDownloadNum?sceneNum=${
|
|
|
+ ele.data.num
|
|
|
+ }&t=${new Date().getTime()}`
|
|
|
+ )
|
|
|
ele.data.sceneScheme = ele.data.sceneScheme === 11 ? 2 : 1 // 禁止本地端放大缩小
|
|
|
temp.push({
|
|
|
sceneCode: ele.data.num,
|
|
@@ -520,55 +508,67 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- let snCode = SNCode ? ('SN_' + SNCode) : temp[0].sceneCode
|
|
|
+ let snCode = SNCode ? 'SN_' + SNCode : temp[0].sceneCode
|
|
|
let version = ''
|
|
|
try {
|
|
|
console.log(JSON.parse(temp[0].sceneInfo))
|
|
|
|
|
|
- version = JSON.parse(temp[0].sceneInfo).data.buildType.toLowerCase() === 'v2' ? 'v2/' : ''
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ version =
|
|
|
+ JSON.parse(temp[0].sceneInfo).data.buildType.toLowerCase() === 'v2'
|
|
|
+ ? 'v2/'
|
|
|
+ : ''
|
|
|
+ } catch (error) {}
|
|
|
|
|
|
this.downloadDialogVisible = false
|
|
|
this.fullscreenLoading = false
|
|
|
this.$http
|
|
|
- .post(`${serverName}/downloadData/${version}`, {
|
|
|
- sceneCodeArr: temp,
|
|
|
- isTiles: isTiles,
|
|
|
- snCode
|
|
|
- // sceneCode: sceneCode,
|
|
|
- // isTiles,
|
|
|
- // sceneInfo: JSON.stringify(resp)
|
|
|
+ .post('manager/user/checkDownload', {
|
|
|
+ sceneNum: arr.join()
|
|
|
})
|
|
|
- .then(resp => {
|
|
|
- // 将请求发送至服务器后再轮询
|
|
|
- if (resp['sta'] === 1003) {
|
|
|
- // 文件已存在
|
|
|
- this._browserDownload(resp['data']['url']) // 调用浏览器下载文件
|
|
|
- } else {
|
|
|
- this.download.showSta = true
|
|
|
- this.download.downloadDataName = `${snCode}.zip`
|
|
|
- if (resp['sta'] === 1000 || resp['sta'] === 1002) {
|
|
|
- this._downloadHandler(resp)
|
|
|
- }
|
|
|
- if (resp['sta'] === 1001) {
|
|
|
- this._compressHandler(resp)
|
|
|
- }
|
|
|
- this.download.timer = setInterval(() => {
|
|
|
- this.$http
|
|
|
- .get(
|
|
|
- `${serverName}/downloadData/process/${version}?snCode=${snCode}`
|
|
|
- )
|
|
|
- .then(resp => {
|
|
|
- console.log(resp)
|
|
|
- if (resp['sta'] === 1000) {
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.$http
|
|
|
+ .post(`/manager/user/downloadScene`, {
|
|
|
+ // sceneCodeArr: temp,
|
|
|
+ // isTiles: isTiles,
|
|
|
+ // snCode
|
|
|
+ sceneNum: arr.join()
|
|
|
+ })
|
|
|
+ .then((resp) => {
|
|
|
+ // 将请求发送至服务器后再轮询
|
|
|
+ if (resp['sta'] === 1003) {
|
|
|
+ // 文件已存在
|
|
|
+ this._browserDownload(resp['data']['url']) // 调用浏览器下载文件
|
|
|
+ } else {
|
|
|
+ this.download.showSta = true
|
|
|
+ this.download.downloadDataName = `${snCode}.zip`
|
|
|
+ if (resp['sta'] === 1000 || resp['sta'] === 1002) {
|
|
|
this._downloadHandler(resp)
|
|
|
}
|
|
|
if (resp['sta'] === 1001) {
|
|
|
this._compressHandler(resp)
|
|
|
}
|
|
|
- })
|
|
|
- }, 1000)
|
|
|
+ this.download.timer = setInterval(() => {
|
|
|
+ this.$http
|
|
|
+ .post(
|
|
|
+ // `/manager/user/downloadProcess/${version}?snCode=${snCode}`, {
|
|
|
+ `/manager/user/downloadProcess`,
|
|
|
+ {
|
|
|
+ sceneNum: arr.join()
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then((resp) => {
|
|
|
+ console.log(resp)
|
|
|
+ if (resp.data['status'] === 1000) {
|
|
|
+ this._downloadHandler(resp)
|
|
|
+ }
|
|
|
+ if (resp.data['status'] === 1002) {
|
|
|
+ this._compressHandler(resp)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -580,7 +580,7 @@ export default {
|
|
|
this.download.showSta = false
|
|
|
clearInterval(this.download.timer)
|
|
|
})
|
|
|
- .catch(_ => {})
|
|
|
+ .catch((_) => {})
|
|
|
},
|
|
|
|
|
|
_downloadHandler (resp) {
|
|
@@ -618,7 +618,7 @@ export default {
|
|
|
confirmButtonText: '确定'
|
|
|
})
|
|
|
}
|
|
|
- let sceneIdArr = this.multipleSelection.map(item => {
|
|
|
+ let sceneIdArr = this.multipleSelection.map((item) => {
|
|
|
return item.num
|
|
|
})
|
|
|
this.$confirm('此操作将删除您选择的多个场景, 是否继续?', '提示', {
|