|
@@ -0,0 +1,114 @@
|
|
|
+<template>
|
|
|
+ <div class="scene">
|
|
|
+ <el-form ref="form" :model="form" label-width="80px" size="small">
|
|
|
+ <el-form-item label="场景名字">
|
|
|
+ <el-input v-model="form.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="地图">
|
|
|
+ <el-input v-model="form.url"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="基站">
|
|
|
+ <el-button style="margin-bottom: 10px;" type="primary" icon="el-icon-plus" size="small" @click="addBase"></el-button>
|
|
|
+ <div class="base" v-for="(item,index) in base_list" :key="index">
|
|
|
+ <el-input v-model="item.id" placeholder="基站id" size="small"></el-input>
|
|
|
+ <el-button class="btn" type="primary" icon="el-icon-plus" size="small" @click="addBase"></el-button>
|
|
|
+ <el-button class="btn" type="primary" icon="el-icon-delete" size="small" @click="removeBase(index)"></el-button>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="卡id">
|
|
|
+ <el-button style="margin-bottom: 10px;" type="primary" icon="el-icon-plus" size="small" @click="addCard"></el-button>
|
|
|
+ <div class="base" v-for="(item,index) in card_list" :key="index">
|
|
|
+ <el-input v-model="item.id" placeholder="卡id" size="small"></el-input>
|
|
|
+ <el-button class="btn" type="primary" icon="el-icon-plus" size="small" @click="addCard"></el-button>
|
|
|
+ <el-button class="btn" type="primary" icon="el-icon-delete" size="small" @click="removeCard(index)"></el-button>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button v-if="bite" type="primary" @click="onSubmit">立即创建</el-button>
|
|
|
+ <el-button v-if="!bite" type="primary" @click="onSubmit">保存编辑</el-button>
|
|
|
+ <el-button @click="back">取消</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ base_list:[],
|
|
|
+ card_list:[],
|
|
|
+ form: {
|
|
|
+ name: '',
|
|
|
+ url: '',
|
|
|
+ date1: '',
|
|
|
+ date2: '',
|
|
|
+ delivery: false,
|
|
|
+ type: [],
|
|
|
+ resource: '',
|
|
|
+ desc: ''
|
|
|
+ },
|
|
|
+ bite:true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onSubmit() {
|
|
|
+ console.log('submit!');
|
|
|
+ },
|
|
|
+ back(){
|
|
|
+ this.$router.go(-1)
|
|
|
+ },
|
|
|
+ addBase(){
|
|
|
+ this.base_list.push({id:''})
|
|
|
+ },
|
|
|
+ removeBase(e){
|
|
|
+ this.base_list.splice(e,1)
|
|
|
+ },
|
|
|
+ addCard(){
|
|
|
+ this.card_list.push({id:''})
|
|
|
+ },
|
|
|
+ removeCard(e){
|
|
|
+ this.card_list.splice(e,1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+
|
|
|
+ console.log(this.$route.query.flight)
|
|
|
+ var flight = JSON.parse(this.$route.query.flight);
|
|
|
+ console.log(typeof flight)
|
|
|
+ if(typeof flight != undefined){
|
|
|
+ this.bite = false;
|
|
|
+ this.form.name = flight.name;
|
|
|
+ this.form.url = flight.url;
|
|
|
+ var arr=[];
|
|
|
+ arr = flight.card_list.split(',')
|
|
|
+ for(var card of arr){
|
|
|
+ console.log(card)
|
|
|
+ this.card_list.push({id:card})
|
|
|
+ }
|
|
|
+ console.log(this.card_list)
|
|
|
+ var brr=[];
|
|
|
+ brr = flight.site_list.split(',')
|
|
|
+ for(var base of brr){
|
|
|
+ this.base_list.push({id:base})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+ .scene{
|
|
|
+ width:500px;
|
|
|
+ margin: 0 auto 50px;
|
|
|
+ .base{
|
|
|
+ display: flex;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ .btn{
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|