jihongshun
7 天以前 417c46988366e8c11f54230345f2e6840a0025f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<template>
  <div class="app-container">
     <el-row :gutter="20">
       <el-col :span="showMap ? 12 : 24" :xs="24">
        <AppTable ref="AppTable" selection :showDeptSearch="false" :url="'tower/point/list'" :tableColumns="tableColumns"
          :tableFilter="tableFilter">
          <template #operatorBox="{ row }">
            <el-button type="primary" plain icon="el-icon-plus" size="mini"
              @click="handleAdd">新增模板</el-button>
          </template>
          <template #operator="{ row }">
            <el-button size="mini" type="text" icon="el-icon-view"
              @click="preview(row)">预览</el-button>
            <el-button size="mini" type="text" icon="el-icon-delete"
              @click="handleDelete(row)">删除</el-button>
          </template>
        </AppTable>
      </el-col>
       <el-col :span="12" :xs="24" v-if="showMap">
          <CesiumMap ></CesiumMap>
       </el-col>
     </el-row>
    
    <shootPointDialog  @on-submit="$refs.AppTable.getData()"  v-if="showDialog" @close="close" :templateId="templateId"></shootPointDialog>
  </div>
</template>
 
<script>
import shootPointDialog from './components/shootPointDialog.vue';
import CesiumMap from "../../../utils/components/cesium-map.vue";
export default {
  name: "towers",
  dicts: ['model_typpe'],
  components: {
    shootPointDialog,
    CesiumMap
  },
  data() {
    return {
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      tableColumns: [
        {
          label: '模板名称',
          prop: 'templateName'
        },
        {
          label: '模型ID',
          prop: 'modelId'
        },
        {
          label: '操作',
          type: 'slot',
          slotName: 'operator',
          width: '330px'
        },
      ],
      tableFilter: [
        {
          title: '模型名称',
          placeholder: '请输入模型名称',
          fieldName: 'name',
          clearable: true,
          type: 'search',
        }
      ],
      showMap:false,
      showDialog:false,
      templateId:null
    };
  },
  watch: {
  },
  created() {
  },
  mounted() {
  },
  methods: {
    // 添加数据
    handleAdd() {
      this.templateId = null
      this.showMap  = false
      this.showDialog = true
      // this.$refs.shootPointDialog.show()
    },
    // 更新数据
    handleUpdate(row) {
      const ids = row.id || this.ids
      this.$refs.shootPointDialog.show(ids)
    },
    // 删除数据
    handleDelete(row) {
      const ids = row.id || this.ids
      // const name = row.name || ''
      const name = ids
      this.$api.deleteByName('/tower/point', ids,name).then(res => {
        this.$refs.AppTable.getData()
      })
    },
    // 导出表格数据
    handleExport() {
      this.$refs.AppTable.exportExcel()
    },
    // clickRow(row){
    //   console.log(row)
    //   this.showMap =true
    // },
    close(){
      this.showDialog =false
    },
    preview(row){
      console.log(row)
      this.templateId = row.id
      this.showDialog = true
    }
  },
};
</script>
 
<style scoped>
.left-card {
  height: calc(100vh - 105px);
  overflow: auto;
}
 
.right-card {
  height: calc(100vh - 105px);
}
</style>