|
@@ -28,6 +28,7 @@
|
|
|
|
|
|
<el-table-column label="操作" width="300">
|
|
|
<template slot-scope="scope">
|
|
|
+ <span class="o-span" v-if="roleType==='admin'" @click="send(scope.row)">发送</span>
|
|
|
<span class="o-span" v-if="roleType==='admin'" @click="reCalculate(scope.row)">重算</span>
|
|
|
<span class="o-span" v-if="roleType==='admin'" @click="zipScene(scope.row)">{{scope.row.downloadStatus === '已打包'?'重新':''}}打包</span>
|
|
|
<span class="o-span" v-if="roleType==='admin'" @click="download(scope.row)">下载</span>
|
|
@@ -88,7 +89,10 @@ const statusArr = {
|
|
|
const downloadArr = {
|
|
|
'0': '打包中',
|
|
|
'-1': '未打包',
|
|
|
- '1': '已打包'
|
|
|
+ '1': '已打包',
|
|
|
+ '2': '文件发送成功',
|
|
|
+ '3': '文件发送失败,',
|
|
|
+ '4': '传输中'
|
|
|
}
|
|
|
|
|
|
const authority = {
|
|
@@ -140,6 +144,61 @@ export default {
|
|
|
this.loading = false
|
|
|
},
|
|
|
|
|
|
+ async send (item) {
|
|
|
+ // '0': '计算中',
|
|
|
+ // '-1': '计算出错',
|
|
|
+ // '-2': '计算完成',
|
|
|
+ // '1': '计算完成'
|
|
|
+ console.log(item.downloadStatus)
|
|
|
+
|
|
|
+ if (item.downloadStatus === '未打包') {
|
|
|
+ return this.$notify.info({
|
|
|
+ title: '消息',
|
|
|
+ message: '未打包,请打包后发送'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (item.downloadStatus === '传输中') {
|
|
|
+ return this.$notify.info({
|
|
|
+ title: '消息',
|
|
|
+ message: '发送中,请稍后'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$confirm('此操作将会发送该场景, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ let res = await this.$http({
|
|
|
+ method: 'get',
|
|
|
+ data: {
|
|
|
+ id: item.id
|
|
|
+ },
|
|
|
+ url: `api/manage/center/scene/send/${item.id}`,
|
|
|
+ headers: {
|
|
|
+ Authorization: window.localStorage.getItem('token')
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ if (res.status === 2000) {
|
|
|
+ this.$alert(`正在发送,请稍等`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ callback: action => {
|
|
|
+ this.refresh()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ this.$notify.error({
|
|
|
+ title: '错误',
|
|
|
+ message: res.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
async reCalculate (item) {
|
|
|
// '0': '计算中',
|
|
|
// '-1': '计算出错',
|
|
@@ -177,10 +236,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消'
|
|
|
- })
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -318,10 +374,6 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消删除'
|
|
|
- })
|
|
|
})
|
|
|
},
|
|
|
|