|
@@ -15,16 +15,12 @@
|
|
<el-button type="primary" v-on:click="search">查询</el-button>
|
|
<el-button type="primary" v-on:click="search">查询</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- <!-- <router-link :to="{ name: 'add' }" class="button">添加场景</router-link> -->
|
|
|
|
<el-button type="primary" @click="downloadSceneData"
|
|
<el-button type="primary" @click="downloadSceneData"
|
|
- >下载MP场景数据</el-button
|
|
|
|
- >
|
|
|
|
- <!-- <div class="button">下载MP场景数据</div> -->
|
|
|
|
|
|
+ >下载MP场景数据</el-button>
|
|
</el-row>
|
|
</el-row>
|
|
<!-- 生成大场景someData -->
|
|
<!-- 生成大场景someData -->
|
|
<el-row type="flex" class="addScene">
|
|
<el-row type="flex" class="addScene">
|
|
- <el-button type="warning" style="margin-right: 20px" @click="logout"
|
|
|
|
- >登出</el-button
|
|
|
|
|
|
+ <el-button type="warning" style="margin-right: 20px" @click="logout">登出</el-button
|
|
>
|
|
>
|
|
<!-- <el-input placeholder="输入编码生成someData" v-model="url">
|
|
<!-- <el-input placeholder="输入编码生成someData" v-model="url">
|
|
<template slot="append">
|
|
<template slot="append">
|
|
@@ -34,11 +30,14 @@
|
|
</el-row>
|
|
</el-row>
|
|
</el-row>
|
|
</el-row>
|
|
<!-- 表格 -->
|
|
<!-- 表格 -->
|
|
- <el-table :data="scenes" style="width: 100%">
|
|
|
|
|
|
+ <el-table :data="scenes" style="width: 100%" @selection-change="handleSelectionChange">
|
|
|
|
+ <el-table-column type="selection" width="50"></el-table-column>
|
|
|
|
+ <el-table-column prop="sceneTitle" width="200" label="场景名称">
|
|
|
|
+ </el-table-column>
|
|
<el-table-column prop="sceneCode" width="200" label="MP场景码">
|
|
<el-table-column prop="sceneCode" width="200" label="MP场景码">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="状态" width="200">
|
|
<el-table-column label="状态" width="200">
|
|
- <template scope="scope">
|
|
|
|
|
|
+ <template slot-scope="scope">
|
|
<span>{{ manage_scene_status[scope.row.status] }}</span>
|
|
<span>{{ manage_scene_status[scope.row.status] }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -61,7 +60,7 @@
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<a :href="scope.row.webSite" target="_blank">查看</a>
|
|
<a :href="scope.row.webSite" target="_blank">查看</a>
|
|
<a @click="handModelDownload(scope.row)">模型下载</a>
|
|
<a @click="handModelDownload(scope.row)">模型下载</a>
|
|
- <a @click="handModelUpload">模型上传</a>
|
|
|
|
|
|
+ <a @click="handModelUpload(scope.row)">模型上传</a>
|
|
<a @click="handPanoramaDownload">全景图下载</a>
|
|
<a @click="handPanoramaDownload">全景图下载</a>
|
|
<a @click="handPanoramaUpload">全景图上传</a>
|
|
<a @click="handPanoramaUpload">全景图上传</a>
|
|
</template>
|
|
</template>
|
|
@@ -78,7 +77,7 @@
|
|
>
|
|
>
|
|
</el-pagination>
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
|
|
+ <!-- 场景码下载 -->
|
|
<el-dialog title="下载MP场景数据" :visible.sync="dialogFormVisible">
|
|
<el-dialog title="下载MP场景数据" :visible.sync="dialogFormVisible">
|
|
<el-form :model="form" ref="ruleForm" :rules="rules">
|
|
<el-form :model="form" ref="ruleForm" :rules="rules">
|
|
<el-form-item
|
|
<el-form-item
|
|
@@ -94,6 +93,19 @@
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<br />
|
|
<br />
|
|
|
|
+ <el-form-item
|
|
|
|
+ label="场景名称"
|
|
|
|
+ :label-width="formLabelWidth"
|
|
|
|
+ prop="sceneTitle"
|
|
|
|
+ >
|
|
|
|
+ <el-input
|
|
|
|
+ type="sceneTitle"
|
|
|
|
+ v-model="form.sceneTitle"
|
|
|
|
+ autocomplete="off"
|
|
|
|
+ placeholder="请输入场景名称"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <br />
|
|
<el-form-item label="备注" :label-width="formLabelWidth">
|
|
<el-form-item label="备注" :label-width="formLabelWidth">
|
|
<el-input
|
|
<el-input
|
|
type="textarea"
|
|
type="textarea"
|
|
@@ -111,6 +123,40 @@
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 文件上传 -->
|
|
|
|
+ <el-dialog title="上传模型" :visible.sync="dialogFilesVisible">
|
|
|
|
+ <el-form ref="form1" label-width="80px" class="add-frome">
|
|
|
|
+ <el-form-item label="全景图文件">
|
|
|
|
+ <el-upload
|
|
|
|
+ class="upload-demo"
|
|
|
|
+ :action="uploadUrl"
|
|
|
|
+ ref="upload"
|
|
|
|
+ accept=".zip"
|
|
|
|
+ :on-change="handleChange"
|
|
|
|
+ :on-remove="handleRemove"
|
|
|
|
+ :on-success="onSuccess"
|
|
|
|
+ :on-error="onError"
|
|
|
|
+ :file-list="fileList"
|
|
|
|
+ :auto-upload="false"
|
|
|
|
+ >
|
|
|
|
+ <el-button slot="trigger" size="small" type="primary"
|
|
|
|
+ >选取文件</el-button
|
|
|
|
+ >
|
|
|
|
+ <div slot="tip" class="el-upload__tip">只能上传zip文件</div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="dialogFilesVisible = false">取 消</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ v-loading.fullscreen.lock="fullscreenLoading"
|
|
|
|
+ @click="submitUpload"
|
|
|
|
+ >确 定</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -119,13 +165,6 @@ import { MANAGE_SCENE_STATUS } from "@/config/data";
|
|
export default {
|
|
export default {
|
|
name: "list",
|
|
name: "list",
|
|
data() {
|
|
data() {
|
|
- var validateSceneCode = (rule, value, callback) => {
|
|
|
|
- if (!value) {
|
|
|
|
- return callback(new Error("场景码不能为空"));
|
|
|
|
- } else {
|
|
|
|
- callback();
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
return {
|
|
return {
|
|
searchKey: "",
|
|
searchKey: "",
|
|
scenes: [],
|
|
scenes: [],
|
|
@@ -133,18 +172,24 @@ export default {
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
total: 0,
|
|
total: 0,
|
|
size: 15,
|
|
size: 15,
|
|
|
|
+ fileList: [],
|
|
|
|
+ uploadUrl: "",
|
|
|
|
+ fullscreenLoading: false,
|
|
|
|
+ targetObj: null,
|
|
manage_scene_status: MANAGE_SCENE_STATUS,
|
|
manage_scene_status: MANAGE_SCENE_STATUS,
|
|
dialogFormVisible: false,
|
|
dialogFormVisible: false,
|
|
|
|
+ dialogFilesVisible: false,
|
|
form: {
|
|
form: {
|
|
sceneCode: "",
|
|
sceneCode: "",
|
|
|
|
+ sceneTitle: "",
|
|
description: "",
|
|
description: "",
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
sceneCode: [
|
|
sceneCode: [
|
|
- {
|
|
|
|
- validator: validateSceneCode,
|
|
|
|
- trigger: "blur",
|
|
|
|
- },
|
|
|
|
|
|
+ { required: true, message: "场景码不能为空", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ sceneTitle: [
|
|
|
|
+ { required: true, message: "场景名称不能为空", trigger: "blur" },
|
|
],
|
|
],
|
|
description: [],
|
|
description: [],
|
|
},
|
|
},
|
|
@@ -160,13 +205,72 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ handleSelectionChange(val){
|
|
|
|
+ console.log('val',val)
|
|
|
|
+ },
|
|
|
|
+ handleRemove(file) {
|
|
|
|
+ let index = this.fileList.findIndex((item) => {
|
|
|
|
+ return item.uid === file.uid;
|
|
|
|
+ });
|
|
|
|
+ this.fileList.splice(index, 1);
|
|
|
|
+ },
|
|
|
|
+ handleChange(file) {
|
|
|
|
+ this.fileList = this.fileList.length === 0 ? this.fileList : [];
|
|
|
|
+ this.fileList.push(file["raw"]);
|
|
|
|
+ },
|
|
|
|
+ onSuccess(res) {
|
|
|
|
+ this.$alert("上传成功", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ callback: (action) => {
|
|
|
|
+ console.log("上传成功");
|
|
|
|
+ this.dialogFilesVisible = false;
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ onError(res) {
|
|
|
|
+ this.$alert("上传失败", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ callback: (action) => {
|
|
|
|
+ console.log("上传失败");
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ async submitUpload() {
|
|
|
|
+ var that = this;
|
|
|
|
+ if (this.fileList.length === 0) {
|
|
|
|
+ this.$alert("请上传附件", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ callback: (action) => {
|
|
|
|
+ console.log("上传失败");
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ let formData = new FormData();
|
|
|
|
+ this.fileList.forEach((file) => {
|
|
|
|
+ formData.append("file", file);
|
|
|
|
+ });
|
|
|
|
+ this.fullscreenLoading = true;
|
|
|
|
+ let res = await this.$http.post(
|
|
|
|
+ `/manage/scene/upload/obj/${this.targetObj.sceneCode}`,
|
|
|
|
+ formData,
|
|
|
|
+ {
|
|
|
|
+ "Content-Type": "multipart/form-data",
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ if (res["code"] === 0) {
|
|
|
|
+ this.fullscreenLoading = false;
|
|
|
|
+ that.onSuccess(res);
|
|
|
|
+ } else {
|
|
|
|
+ this.fullscreenLoading = false;
|
|
|
|
+ that.onError(res);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
search() {
|
|
search() {
|
|
this.currentPage === 1 ? this.getScenes() : (this.currentPage = 1);
|
|
this.currentPage === 1 ? this.getScenes() : (this.currentPage = 1);
|
|
},
|
|
},
|
|
sceneCodeSubmit(formName) {
|
|
sceneCodeSubmit(formName) {
|
|
- console.log(this);
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
this.$refs[formName].validate((valid) => {
|
|
- console.log("valid", valid);
|
|
|
|
if (valid) {
|
|
if (valid) {
|
|
this.sceneCodeSendHttp();
|
|
this.sceneCodeSendHttp();
|
|
}
|
|
}
|
|
@@ -176,19 +280,16 @@ export default {
|
|
let { sceneCode, description } = this.form;
|
|
let { sceneCode, description } = this.form;
|
|
let body = {
|
|
let body = {
|
|
description,
|
|
description,
|
|
- sceneCode
|
|
|
|
|
|
+ sceneCode,
|
|
};
|
|
};
|
|
- this.$http.post("/manage/scene/download",body).then(res=>{
|
|
|
|
- console.log('res',res)
|
|
|
|
- this.$message(res['msg']);
|
|
|
|
- if(res['code'] === 0) {
|
|
|
|
- console.log('下载成功')
|
|
|
|
|
|
+ this.$http.post("/manage/scene/download", body).then((res) => {
|
|
|
|
+ this.$message(res["msg"]);
|
|
|
|
+ if (res["code"] === 0) {
|
|
|
|
+ console.log("下载成功");
|
|
this.dialogFormVisible = false;
|
|
this.dialogFormVisible = false;
|
|
- }else {
|
|
|
|
-
|
|
|
|
|
|
+ } else {
|
|
}
|
|
}
|
|
- })
|
|
|
|
-
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
downloadSceneData() {
|
|
downloadSceneData() {
|
|
this.dialogFormVisible = true;
|
|
this.dialogFormVisible = true;
|
|
@@ -220,7 +321,11 @@ export default {
|
|
window.open(`http://${res["data"]}`);
|
|
window.open(`http://${res["data"]}`);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- handModelUpload() {},
|
|
|
|
|
|
+ handModelUpload(item) {
|
|
|
|
+ this.dialogFilesVisible = true;
|
|
|
|
+ this.targetObj = item;
|
|
|
|
+ this.fileList = [];
|
|
|
|
+ },
|
|
handPanoramaDownload() {},
|
|
handPanoramaDownload() {},
|
|
handPanoramaUpload() {},
|
|
handPanoramaUpload() {},
|
|
async delScene(name) {
|
|
async delScene(name) {
|