jihongshun
2 天以前 f03ea598d39abceac4eeb5f3a10b1fe7dd706b2c
src/views/system/shootPoint/components/chooseModelDialog.vue
@@ -6,12 +6,13 @@
    width="70%">
    <el-row :gutter="20">
       <el-col :span="showMap ? 12 : 24" :xs="24">
        <AppTable ref="AppTable"  :showDeptSearch="false" :url="'device/towers/list'" :tableColumns="tableColumns"  :showSearchBtn="false">
        <AppTable ref="AppTable"  :showDeptSearch="false" :url="'tower/model/list'" :tableColumns="tableColumns"  :showSearchBtn="false">
          <template #operator="{ row }">
            <el-button size="mini" type="text"
              @click="clickRow(row)">预览</el-button>
            <el-button size="mini" type="text"
              @click="chooseRow(row)">选择</el-button>
          </template>
          <template #modelType="{ row }">
            <DictTag :options="dict.type.model_type" :value="row.modelType"></DictTag>
          </template>
        </AppTable>
      </el-col>
@@ -29,6 +30,7 @@
import CesiumMap from "../../../../utils/components/cesium-map.vue";
  export default {
    name:'chooseModelDialog',
    dicts: ['model_type'],
    components: {
      CesiumMap
    },
@@ -39,15 +41,16 @@
        tableColumns: [
            {
              label: '模型名称',
              prop: 'name'
              prop: 'modelName'
            },
            {
             {
              label: '模型类型',
              prop: 'createBy'
              type: 'slot',
              slotName: 'modelType'
            },
            {
              label: '模型路径',
              prop: 'createTime'
              prop: 'modelRoute'
            },
            {
              label: '操作',
@@ -69,6 +72,7 @@
        this.$emit('getRowData',row)
      },  
      clickRow(row){
        console.log(row)
        this.showMap =true
        setTimeout(()=>{
          const position = Cesium.Cartesian3.fromDegrees(0, 0, 0);
@@ -90,8 +94,7 @@
              position: position,
              orientation: orientation,
              model: {
                uri: "/Model/tower.glb", // 替换成你的模型路径
                scale: 1000,
                uri: row.modelRoute, // 替换成你的模型路径
              },
            });
            viewer.flyTo(entity)