|
@@ -10,6 +10,13 @@
|
|
|
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-button type="primary" @click="getSceneBySN" color="red">下载场景数据</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 全部 -->
|
|
@@ -94,7 +101,7 @@
|
|
|
<el-button
|
|
|
v-if="scope.row.sceneScheme>4"
|
|
|
type="text"
|
|
|
- @click="_downloadScene(scope.row.num);"
|
|
|
+ @click="_showDownloadSelect(scope.row.num);"
|
|
|
class="download_btn"
|
|
|
>下载</el-button>
|
|
|
<el-button type="text" @click="_deleScene(scope.row.id)" class="delete_btn">删除</el-button>
|
|
@@ -280,6 +287,27 @@
|
|
|
|
|
|
<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>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="downloadDialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="_downloadSingleScene">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ width="500px"
|
|
|
title="下载场景"
|
|
|
:visible.sync="download.showSta"
|
|
|
:before-close="_handleClose"
|
|
@@ -302,291 +330,393 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
const _sceneTypeName = {
|
|
|
- 0: "其他",
|
|
|
- 1: "文博",
|
|
|
- 2: "地产",
|
|
|
- 3: "电商",
|
|
|
- 4: "餐饮",
|
|
|
- 5: "家居"
|
|
|
-};
|
|
|
+ 0: '其他',
|
|
|
+ 1: '文博',
|
|
|
+ 2: '地产',
|
|
|
+ 3: '电商',
|
|
|
+ 4: '餐饮',
|
|
|
+ 5: '家居'
|
|
|
+}
|
|
|
+
|
|
|
+// const serverName = 'https://test.4dkankan.com'
|
|
|
+// const serverName = 'http://192.168.0.208:8887'
|
|
|
+const serverName = 'https://www.4dage.com'
|
|
|
+
|
|
|
export default {
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
- getRowKeys(row) {
|
|
|
- return row.number;
|
|
|
+ getRowKeys (row) {
|
|
|
+ return row.number
|
|
|
},
|
|
|
+
|
|
|
download: {
|
|
|
showSta: false,
|
|
|
- downloadSta: "正在拉取数据",
|
|
|
- downloadDataName: "场景数据.zip",
|
|
|
+ downloadSta: '正在拉取数据',
|
|
|
+ downloadDataName: '场景数据.zip',
|
|
|
percent: 0,
|
|
|
timer: 0
|
|
|
},
|
|
|
downloadDialogVisible: false,
|
|
|
- progressColor: "#09e1c0",
|
|
|
+ progressColor: '#09e1c0',
|
|
|
tabs: [
|
|
|
- { name: "全部", idx: 0 },
|
|
|
- { name: "展示中", idx: 1 },
|
|
|
- { name: "已隐藏", idx: -2 }
|
|
|
+ { name: '全部', idx: 0 },
|
|
|
+ { name: '展示中', idx: 1 },
|
|
|
+ { name: '已隐藏', idx: -2 }
|
|
|
],
|
|
|
expands: [],
|
|
|
expandedArr: [],
|
|
|
scenes: [],
|
|
|
currentPage: 1,
|
|
|
- key_input: "",
|
|
|
+ key_input: '',
|
|
|
fullscreenLoading: false,
|
|
|
total: 0,
|
|
|
// expressNum_input: "",
|
|
|
searchDate: [],
|
|
|
- searchKey: "",
|
|
|
- searchOrderNumber: "",
|
|
|
- searchPhone: "",
|
|
|
- searchExpressNum: "",
|
|
|
+ searchKey: '',
|
|
|
+ snKey: '',
|
|
|
+ searchOrderNumber: '',
|
|
|
+ searchPhone: '',
|
|
|
+ searchExpressNum: '',
|
|
|
hasClickSearch: false,
|
|
|
tabIndex: 0,
|
|
|
pageSize: 10,
|
|
|
- value2: true
|
|
|
- };
|
|
|
+ value2: true,
|
|
|
+ downloadOptions: {}
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
- currentPage() {
|
|
|
- this._getSceneData();
|
|
|
+ currentPage () {
|
|
|
+ this._getSceneData()
|
|
|
},
|
|
|
- tabIndex() {
|
|
|
- this._getSceneData();
|
|
|
+ tabIndex () {
|
|
|
+ this._getSceneData()
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- async changTypeHandle(item) {
|
|
|
- this.fullscreenLoading = true;
|
|
|
- await this.$http.post("/manager/scene/updateSceneType", {
|
|
|
+ async changTypeHandle (item) {
|
|
|
+ this.fullscreenLoading = true
|
|
|
+ await this.$http.post('/manager/scene/updateSceneType', {
|
|
|
sceneType: item.sceneType,
|
|
|
sceneId: item.id
|
|
|
- });
|
|
|
-
|
|
|
- this._getSceneData();
|
|
|
- this.fullscreenLoading = false;
|
|
|
+ })
|
|
|
|
|
|
+ this._getSceneData()
|
|
|
+ this.fullscreenLoading = false
|
|
|
},
|
|
|
- handleCurrentChange(val) {
|
|
|
- let page = val;
|
|
|
+
|
|
|
+ handleCurrentChange (val) {
|
|
|
+ let page = val
|
|
|
// console.log(`当前页: ${val}`)
|
|
|
if (this.total > 0 && !this.hasClickSearch) {
|
|
|
- this._getSceneData(page);
|
|
|
+ this._getSceneData(page)
|
|
|
} else {
|
|
|
- this._searchOrderByPage(page);
|
|
|
+ this._searchOrderByPage(page)
|
|
|
}
|
|
|
},
|
|
|
- clickTabItem(idx) {
|
|
|
+ clickTabItem (idx) {
|
|
|
// console.log(idx)
|
|
|
- this.tabIndex = idx;
|
|
|
- this.total = 0;
|
|
|
- this.hasClickSearch = false;
|
|
|
- this.currentPage = 0;
|
|
|
- this.$refs.searchKey.currentValue = this.key_input = "";
|
|
|
- this._getSceneData(1);
|
|
|
+ this.tabIndex = idx
|
|
|
+ this.total = 0
|
|
|
+ this.hasClickSearch = false
|
|
|
+ this.currentPage = 0
|
|
|
+ this.$refs.searchKey.currentValue = this.key_input = ''
|
|
|
+ this._getSceneData(1)
|
|
|
+ },
|
|
|
+
|
|
|
+ async getSceneBySN () {
|
|
|
+ if (!this.snKey) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.fullscreenLoading = true
|
|
|
+
|
|
|
+ let res = await this.$http.post('/manager/scene/findSceneProBySnCode', {
|
|
|
+ type: '',
|
|
|
+ snCode: this.snKey
|
|
|
+ })
|
|
|
+ this.fullscreenLoading = false
|
|
|
+ let arr = []
|
|
|
+ if (res.code === 0) {
|
|
|
+ arr = res.data.map((item) => item.num)
|
|
|
+ }
|
|
|
+ if (arr.length <= 0) {
|
|
|
+ return this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '查询不到该SN码场景数据。'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.$confirm(`此操作将下载该相机下的${arr.length}个场景, 是否继续?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this._downloadScene(this.snKey, arr, this.downloadOptions.isTiles)
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消'
|
|
|
+ })
|
|
|
+ this.fullscreenLoading = false
|
|
|
+ })
|
|
|
},
|
|
|
- async _getSceneData() {
|
|
|
- this.fullscreenLoading = true;
|
|
|
- let status = this.tabIndex === 0 ? null : this.tabIndex;
|
|
|
|
|
|
- let res = await this.$http.post("/manager/scene/list", {
|
|
|
+ async _getSceneData () {
|
|
|
+ this.fullscreenLoading = true
|
|
|
+ let status = this.tabIndex === 0 ? null : this.tabIndex
|
|
|
+
|
|
|
+ let res = await this.$http.post('/manager/scene/list', {
|
|
|
type: status,
|
|
|
searchKey: this.searchKey,
|
|
|
pageNum: this.currentPage,
|
|
|
pageSize: this.pageSize
|
|
|
- });
|
|
|
+ })
|
|
|
|
|
|
- this.fullscreenLoading = false;
|
|
|
+ this.fullscreenLoading = false
|
|
|
|
|
|
if (res.code === 0) {
|
|
|
- let temp = res.data.list;
|
|
|
+ let temp = res.data.list
|
|
|
for (var i = 0; i < temp.length; i++) {
|
|
|
- temp[i].sceneType = _sceneTypeName[temp[i].sceneType];
|
|
|
- temp[i].scenekey = temp[i].scenekey ? "私密" : "公开";
|
|
|
- temp[i]["userName"] = temp[i]["userName"]
|
|
|
- ? temp[i]["userName"]
|
|
|
- : "未绑定";
|
|
|
- let gpsStr = temp[i].gps || "";
|
|
|
+ temp[i].sceneType = _sceneTypeName[temp[i].sceneType]
|
|
|
+ temp[i].scenekey = temp[i].scenekey ? '私密' : '公开'
|
|
|
+ temp[i]['userName'] = temp[i]['userName']
|
|
|
+ ? temp[i]['userName']
|
|
|
+ : '未绑定'
|
|
|
+ let gpsStr = temp[i].gps || ''
|
|
|
|
|
|
if (gpsStr instanceof Object) {
|
|
|
JSON.parse(gpsStr, (k, v) => {
|
|
|
- if (k && k === "latitude") {
|
|
|
- temp[i].latitude = this.formatDegree(v);
|
|
|
- } else if (k && k === "longitude") {
|
|
|
- temp[i].longitude = this.formatDegree(v);
|
|
|
+ if (k && k === 'latitude') {
|
|
|
+ temp[i].latitude = this.formatDegree(v)
|
|
|
+ } else if (k && k === 'longitude') {
|
|
|
+ temp[i].longitude = this.formatDegree(v)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
if (temp[i].status === 1) {
|
|
|
- temp[i].statusBoo = true;
|
|
|
+ temp[i].statusBoo = true
|
|
|
} else if (temp[i].status === -2) {
|
|
|
- temp[i].statusBoo = false;
|
|
|
+ temp[i].statusBoo = false
|
|
|
} else {
|
|
|
- temp[i].statusBoo = "";
|
|
|
+ temp[i].statusBoo = ''
|
|
|
}
|
|
|
}
|
|
|
- this.scenes = temp;
|
|
|
- this.total = res.data.total ? res.data.total : this.total;
|
|
|
+ this.scenes = temp
|
|
|
+ this.total = res.data.total ? res.data.total : this.total
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- formatDegree(value) {
|
|
|
- value = Math.abs(value);
|
|
|
- var v1 = Math.floor(value); // 度
|
|
|
- var v2 = Math.floor((value - v1) * 60); // 分
|
|
|
- var v3 = Math.round(((value - v1) * 3600) % 60); // 秒
|
|
|
- return v1 + "°" + v2 + "'" + v3 + '"';
|
|
|
+ formatDegree (value) {
|
|
|
+ value = Math.abs(value)
|
|
|
+ var v1 = Math.floor(value) // 度
|
|
|
+ var v2 = Math.floor((value - v1) * 60) // 分
|
|
|
+ var v3 = Math.round(((value - v1) * 3600) % 60) // 秒
|
|
|
+ return v1 + '°' + v2 + "'" + v3 + '"'
|
|
|
},
|
|
|
- async _updateSceneStatus(num, status) {
|
|
|
- let tempStatus;
|
|
|
+ async _updateSceneStatus (num, status) {
|
|
|
+ let tempStatus
|
|
|
if (status === 1) {
|
|
|
- tempStatus = -2;
|
|
|
+ tempStatus = -2
|
|
|
} else if (status === -2) {
|
|
|
- tempStatus = 1;
|
|
|
+ tempStatus = 1
|
|
|
} else {
|
|
|
this.$notify.error({
|
|
|
- title: "错误",
|
|
|
- message: "切换失败"
|
|
|
- });
|
|
|
- return;
|
|
|
+ title: '错误',
|
|
|
+ message: '切换失败'
|
|
|
+ })
|
|
|
+ return
|
|
|
}
|
|
|
- this.fullscreenLoading = true;
|
|
|
- await this.$http.post("/manager/scene/updateStatus", {
|
|
|
+ this.fullscreenLoading = true
|
|
|
+ await this.$http.post('/manager/scene/updateStatus', {
|
|
|
type: tempStatus,
|
|
|
sceneId: num
|
|
|
- });
|
|
|
+ })
|
|
|
+
|
|
|
+ this._getSceneData()
|
|
|
+ this.fullscreenLoading = false
|
|
|
+ },
|
|
|
|
|
|
- this._getSceneData();
|
|
|
- this.fullscreenLoading = false;
|
|
|
+ _showDownloadSelect (num) {
|
|
|
+ this.downloadDialogVisible = true
|
|
|
+ this.downloadOptions = {
|
|
|
+ activeNum: num,
|
|
|
+ isTiles: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ _downloadSingleScene () {
|
|
|
+ let {activeNum: num, isTiles} = this.downloadOptions
|
|
|
+ this._downloadScene('', [num], isTiles)
|
|
|
},
|
|
|
|
|
|
- _downloadScene(sceneCode) {
|
|
|
- this.fullscreenLoading = true;
|
|
|
- let promise = this.$http.get(
|
|
|
- `/scene/getInfo?num=${sceneCode}&t=${new Date().getTime()}`
|
|
|
- ); // 请求sceneData.json数据
|
|
|
- promise.then(resp => {
|
|
|
- this.fullscreenLoading = false;
|
|
|
- resp.data.sceneScheme = 1; // 禁止本地端放大缩小
|
|
|
+ _downloadScene (SNCode = '', sceneArr, isTiles = true) {
|
|
|
+ this.fullscreenLoading = true
|
|
|
+
|
|
|
+ // let {isTiles} = this.downloadOptions
|
|
|
+
|
|
|
+ // SNCode = '0223B29DFw'
|
|
|
+
|
|
|
+ console.log(this.downloadOptions)
|
|
|
+ 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 allPromise = this.$http.all(urlArr)
|
|
|
+ let errmsg = ''
|
|
|
+ allPromise.then(res => {
|
|
|
+ let temp = []
|
|
|
+ res.forEach(ele => {
|
|
|
+ if (ele && ele.code === 0) {
|
|
|
+ ele.data.sceneScheme = 1 // 禁止本地端放大缩小
|
|
|
+ temp.push({
|
|
|
+ sceneCode: ele.data.num,
|
|
|
+ sceneInfo: JSON.stringify(ele)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ errmsg = ele.msg
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log('------temp----', temp)
|
|
|
+ if (temp.length <= 0) {
|
|
|
+ this.downloadDialogVisible = false
|
|
|
+ this.fullscreenLoading = false
|
|
|
+ return this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '下载失败,' + errmsg
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ let snCode = SNCode ? ('SN_' + SNCode) : temp[0].sceneCode
|
|
|
+
|
|
|
+ console.log('-snCode---', snCode)
|
|
|
+ this.downloadDialogVisible = false
|
|
|
+ this.fullscreenLoading = false
|
|
|
this.$http
|
|
|
- .post("https://test.4dkankan.com/downloadData/", {
|
|
|
- sceneCode: sceneCode,
|
|
|
- sceneInfo: JSON.stringify(resp)
|
|
|
+ .post(`${serverName}/downloadData/`, {
|
|
|
+ sceneCodeArr: temp,
|
|
|
+ isTiles: isTiles,
|
|
|
+ snCode
|
|
|
+ // sceneCode: sceneCode,
|
|
|
+ // isTiles,
|
|
|
+ // sceneInfo: JSON.stringify(resp)
|
|
|
})
|
|
|
.then(resp => {
|
|
|
// 将请求发送至服务器后再轮询
|
|
|
- if (resp["sta"] === 1003) {
|
|
|
+ if (resp['sta'] === 1003) {
|
|
|
// 文件已存在
|
|
|
- this._browserDownload(resp["data"]["url"]); // 调用浏览器下载文件
|
|
|
+ this._browserDownload(resp['data']['url']) // 调用浏览器下载文件
|
|
|
} else {
|
|
|
- this.download.showSta = true;
|
|
|
- this.download.downloadDataName = `${sceneCode}.zip`;
|
|
|
- if (resp["sta"] === 1000 || resp["sta"] === 1002) {
|
|
|
- this._downloadHandler(resp);
|
|
|
+ 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);
|
|
|
+ if (resp['sta'] === 1001) {
|
|
|
+ this._compressHandler(resp)
|
|
|
}
|
|
|
this.download.timer = setInterval(() => {
|
|
|
this.$http
|
|
|
.get(
|
|
|
- `https://test.4dkankan.com/downloadData/process?sceneCode=${sceneCode}`
|
|
|
+ `${serverName}/downloadData/process?snCode=${snCode}`
|
|
|
)
|
|
|
.then(resp => {
|
|
|
- console.log(resp);
|
|
|
- if (resp["sta"] === 1000) {
|
|
|
- this._downloadHandler(resp);
|
|
|
+ console.log(resp)
|
|
|
+ if (resp['sta'] === 1000) {
|
|
|
+ this._downloadHandler(resp)
|
|
|
}
|
|
|
- if (resp["sta"] === 1001) {
|
|
|
- this._compressHandler(resp);
|
|
|
+ if (resp['sta'] === 1001) {
|
|
|
+ this._compressHandler(resp)
|
|
|
}
|
|
|
- });
|
|
|
- }, 1000);
|
|
|
+ })
|
|
|
+ }, 1000)
|
|
|
}
|
|
|
- });
|
|
|
- });
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
- _handleClose() {
|
|
|
- this.$confirm("取消下载?", "提示")
|
|
|
+ _handleClose () {
|
|
|
+ this.$confirm('取消下载?', '提示')
|
|
|
.then(() => {
|
|
|
- this.download.showSta = false;
|
|
|
- clearInterval(this.download.timer);
|
|
|
+ this.download.showSta = false
|
|
|
+ clearInterval(this.download.timer)
|
|
|
})
|
|
|
- .catch(_ => {});
|
|
|
+ .catch(_ => {})
|
|
|
},
|
|
|
|
|
|
- _downloadHandler(resp) {
|
|
|
- this.download.downloadSta = "正在拉取数据";
|
|
|
- this.download.percent = parseInt(resp["data"]["percent"]);
|
|
|
- let percent = parseInt(resp["data"]["percent"]);
|
|
|
- this.download.percent = percent;
|
|
|
+ _downloadHandler (resp) {
|
|
|
+ this.download.downloadSta = '正在拉取数据'
|
|
|
+ this.download.percent = parseInt(resp['data']['percent'])
|
|
|
+ let percent = parseInt(resp['data']['percent'])
|
|
|
+ this.download.percent = percent
|
|
|
},
|
|
|
|
|
|
- _compressHandler(resp) {
|
|
|
- this.download.downloadSta = "正在压缩数据";
|
|
|
- let percent = parseInt(resp["data"]["percent"]);
|
|
|
- this.download.percent = percent;
|
|
|
+ _compressHandler (resp) {
|
|
|
+ this.download.downloadSta = '正在压缩数据'
|
|
|
+ let percent = parseInt(resp['data']['percent'])
|
|
|
+ this.download.percent = percent
|
|
|
if (percent === 100) {
|
|
|
- this.download.showSta = false;
|
|
|
- clearInterval(this.download.timer);
|
|
|
- this._browserDownload(resp["data"]["url"]);
|
|
|
+ this.download.showSta = false
|
|
|
+ clearInterval(this.download.timer)
|
|
|
+ this._browserDownload(resp['data']['url'])
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- _browserDownload(url) {
|
|
|
- let a = document.createElement("a");
|
|
|
- let urlArr = url.split("/");
|
|
|
- let fileName = urlArr[urlArr.length - 1];
|
|
|
- a.href = url;
|
|
|
- a.download = fileName;
|
|
|
- a.style.display = "none";
|
|
|
- document.body.appendChild(a);
|
|
|
- a.click();
|
|
|
- document.body.removeChild(a);
|
|
|
+ _browserDownload (url) {
|
|
|
+ let a = document.createElement('a')
|
|
|
+ let urlArr = url.split('/')
|
|
|
+ let fileName = urlArr[urlArr.length - 1]
|
|
|
+ a.href = url
|
|
|
+ a.download = fileName
|
|
|
+ a.style.display = 'none'
|
|
|
+ document.body.appendChild(a)
|
|
|
+ a.click()
|
|
|
+ document.body.removeChild(a)
|
|
|
},
|
|
|
|
|
|
- _deleScene(num) {
|
|
|
- this.$confirm("此操作将删除该场景, 是否继续?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ _deleScene (num) {
|
|
|
+ this.$confirm('此操作将删除该场景, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
})
|
|
|
.then(async () => {
|
|
|
- this.fullscreenLoading = true;
|
|
|
- let res = await this.$http.post("/manager/scene/delete", {
|
|
|
+ this.fullscreenLoading = true
|
|
|
+ let res = await this.$http.post('/manager/scene/delete', {
|
|
|
sceneId: num
|
|
|
- });
|
|
|
+ })
|
|
|
if (res.code === 0) {
|
|
|
this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!"
|
|
|
- });
|
|
|
- this._getSceneData();
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ })
|
|
|
+ this._getSceneData()
|
|
|
} else {
|
|
|
this.$message({
|
|
|
- type: "error",
|
|
|
+ type: 'error',
|
|
|
message: res.msg
|
|
|
- });
|
|
|
- this._getSceneData();
|
|
|
+ })
|
|
|
+ this._getSceneData()
|
|
|
}
|
|
|
- this.fullscreenLoading = false;
|
|
|
+ this.fullscreenLoading = false
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消删除"
|
|
|
- });
|
|
|
- this.fullscreenLoading = false;
|
|
|
- });
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ })
|
|
|
+ this.fullscreenLoading = false
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
- this._getSceneData();
|
|
|
+ created () {
|
|
|
+ this._getSceneData()
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="css" scoped>
|
|
|
@import "./style.css";
|