jihongshun
2025-07-03 307db148645230afc780a3d5d16ffb97aa32c189
src/views/system/shootPoint/components/chooseModelDialog.vue
@@ -6,12 +6,15 @@
    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 +32,7 @@
import CesiumMap from "../../../../utils/components/cesium-map.vue";
  export default {
    name:'chooseModelDialog',
    dicts: ['model_type'],
    components: {
      CesiumMap
    },
@@ -39,15 +43,16 @@
        tableColumns: [
            {
              label: '模型名称',
              prop: 'name'
              prop: 'modelName'
            },
            {
              label: '模型类型',
              prop: 'createBy'
              type: 'slot',
              slotName: 'modelType'
            },
            {
              label: '模型路径',
              prop: 'createTime'
              prop: 'modelRoute'
            },
            {
              label: '操作',
@@ -69,6 +74,7 @@
        this.$emit('getRowData',row)
      },  
      clickRow(row){
        console.log(row)
        this.showMap =true
        setTimeout(()=>{
          const position = Cesium.Cartesian3.fromDegrees(0, 0, 0);
@@ -90,7 +96,7 @@
              position: position,
              orientation: orientation,
              model: {
                uri: "/Model/tower.glb", // 替换成你的模型路径
                uri: row.modelRoute, // 替换成你的模型路径
                scale: 1000,
              },
            });