国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

基于vue3.0實現(xiàn)vr全景編輯器

這篇具有很好參考價值的文章主要介紹了基于vue3.0實現(xiàn)vr全景編輯器。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

隨著社會的不斷發(fā)現(xiàn),現(xiàn)實生活中有很多時候會使用到全景現(xiàn)實,比如房地產行業(yè)vr看房,汽車行業(yè)vr看車之類的,全景可視化真實還原了現(xiàn)場的場景,真正做到沉浸式體驗。

現(xiàn)在我們基于vue3.0版本開發(fā)出了一款沉浸式的編輯器,只需要使用全景相機在現(xiàn)場拍攝全景場景,然后將場景倒入編輯器,通過拖動圖標和導航的方式綁定數(shù)據(jù),從而實現(xiàn)沉浸式場景可視化。

部分潔面:

基于vue3.0實現(xiàn)vr全景編輯器,vr,vue,vue3,javascript,前端,編輯器

1、自定義動態(tài)添加數(shù)據(jù)綁定圖標,實時監(jiān)控數(shù)據(jù)運行狀態(tài)

基于vue3.0實現(xiàn)vr全景編輯器,vr,vue,vue3,javascript,前端,編輯器

2、自定義添加文字標記,綁定文字文本,標識場景設備名稱

基于vue3.0實現(xiàn)vr全景編輯器,vr,vue,vue3,javascript,前端,編輯器?3、自定義添加場景標記,點擊可以切換不同場景視角

基于vue3.0實現(xiàn)vr全景編輯器,vr,vue,vue3,javascript,前端,編輯器

4、自定義添加地圖經緯度標記,查看當前標記位置

基于vue3.0實現(xiàn)vr全景編輯器,vr,vue,vue3,javascript,前端,編輯器

5、自定義添加音視頻標記,點擊查看音視頻播放

基于vue3.0實現(xiàn)vr全景編輯器,vr,vue,vue3,javascript,前端,編輯器

?6、自定義添加網(wǎng)址和富文本標記,點擊跳轉網(wǎng)址查看富文本內容?

基于vue3.0實現(xiàn)vr全景編輯器,vr,vue,vue3,javascript,前端,編輯器

?部分代碼如下:文章來源地址http://www.zghlxwxcb.cn/news/detail-612321.html

(function (w) { // isFormat 表示是否格式化時間格式,,默認為格式化
  function $Date (isFormat = true) { // 格式化日期 前臺傳值方式  引用類.dateFormat(1402233166999,"yyyy-MM-dd hh:mm:ss")
    this.dateFormat = function (date, fmt = 'yyyy-MM-dd hh:mm:ss') {
      let getDate = new Date(date);
      let o = {
        'M+': getDate.getMonth() + 1,
        'd+': getDate.getDate(),
        'h+': getDate.getHours(),
        'm+': getDate.getMinutes(),
        's+': getDate.getSeconds(),
        'q+': Math.floor(
          (getDate.getMonth() + 3) / 3
        ),
        'S': getDate.getMilliseconds()
      };
      if (/(y+)/.test(fmt)) {
        fmt = fmt.replace(RegExp.$1, (getDate.getFullYear() + '').substr(4 - RegExp.$1.length));
      }
      for (let k in o) {
        if (new RegExp('(' + k + ')').test(fmt)) {
          fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
        }
      }
      return fmt;
    };
    // 當前日期時間
    this.now = isFormat ? this.dateFormat(new Date()) : new Date();

    // 當前日期
    this.date = this.dateFormat(new Date()).split(' ')[0];

    // 當前時間
    this.time = this.dateFormat(new Date()).split(' ')[1];

    // 當前月
    this.month = new Date().getMonth() + 1;

    // 當前消失
    this.hours = new Date().getHours();

    // 當前月天數(shù)
    this.monthDays = (() => {
      let nowMonth = new Date().getMonth(); // 當前月
      let nowYear = new Date().getYear(); // 當前年
      let monthStartDate = new Date(nowYear, nowMonth, 1);
      let monthEndDate = new Date(nowYear, nowMonth + 1, 1);
      let days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24);
      return days;
    })();

    // 本周的開始日期和結束日日期
    this.endDayOfWeek = (() => {
      let nowMonth = new Date().getMonth(); // 當前月
      let nowDay = new Date().getDate(); // 當前日
      let nowDayOfWeek = new Date().getDay(); // 今天本周的第幾天
      let day = nowDayOfWeek || 7;

      const start = new Date(new Date().getFullYear(), nowMonth, nowDay - day + 1);
      const starts = new Date(new Date().getFullYear(), nowMonth, nowDay - day + 1);
      const end = new Date(new Date().getFullYear(), nowMonth, nowDay + 7 - day);
      const ends = new Date(new Date().getFullYear(), nowMonth, nowDay + 7 - day);

      starts.setHours(23);
      starts.setMinutes(59);
      starts.setSeconds(59);

      ends.setHours(23);
      ends.setMinutes(59);
      ends.setSeconds(59);

      const firstDay = isFormat ? this.dateFormat(start) : start;
      const firstDays = isFormat ? this.dateFormat(starts) : starts;
      const lastDay = isFormat ? this.dateFormat(end) : end;
      const lastDays = isFormat ? this.dateFormat(ends) : ends;
      return {firstDay, firstDays, lastDay, lastDays};
    })();

    // 當天開始時間
    this.todayBegin = (() => {
      const now = new Date();
      now.setHours(0);
      now.setMinutes(0);
      now.setSeconds(0);
      return isFormat ? this.dateFormat(now) : now;
    })();

    // 當天59時59分59秒
    this.todayEnd = (() => {
      const now = new Date();
      now.setHours(23);
      now.setMinutes(59);
      now.setSeconds(59);
      return isFormat ? this.dateFormat(now) : now;
    })();

    // 指定月的最后第一天和最后一天
    this.getNowTheMothEnd = (M) => {
      if (typeof M !== 'number') {
        throw new Error('輸入數(shù)字');
      }
      if (M < 0 || M > 12) {
        console.error('日期大于1小于12');
        return false;
      }

      const now = new Date();
      let y = now.getFullYear();
      let m = M - 1;

      const firstDay = new Date(y, m, 1);
      const firstDays = new Date(y, m, 1);
      firstDays.setHours(23);
      firstDays.setMinutes(59);
      firstDays.setSeconds(59);

      const lastDay = new Date(y, m + 1, 0);
      const lastDays = new Date(y, m + 1, 0);
      lastDays.setHours(23);
      lastDays.setMinutes(59);
      lastDays.setSeconds(59);

      return {
        firstDay: isFormat ? this.dateFormat(firstDay) : firstDay,
        firstDays: isFormat ? this.dateFormat(firstDays) : firstDays,
        lastDay: isFormat ? this.dateFormat(lastDay) : lastDay,
        lastDays: isFormat ? this.dateFormat(lastDays) : lastDays
      };
    };

    // 當月的最后第一天和最后一天
    this.nowMothEnd = (() => {
      const now = new Date();
      let y = now.getFullYear();
      let m = now.getMonth();

      const firstDay = new Date(y, m, 1);
      const firstDays = new Date(y, m, 1);
      firstDays.setHours(23);
      firstDays.setMinutes(59);
      firstDays.setSeconds(59);

      const lastDay = new Date(y, m + 1, 0);
      const lastDays = new Date(y, m + 1, 0);
      lastDays.setHours(23);
      lastDays.setMinutes(59);
      lastDays.setSeconds(59);

      return {
        firstDay: isFormat ? this.dateFormat(firstDay) : firstDay,
        firstDays: isFormat ? this.dateFormat(firstDays) : firstDays,
        lastDay: isFormat ? this.dateFormat(lastDay) : lastDay,
        lastDays: isFormat ? this.dateFormat(lastDays) : lastDays
      };
    })();

    // 今年的第一天和今年的最后一天
    this.nowYearsEnd = (() => {
      const now = new Date();
      let y = now.getFullYear();
      let m = now.getMonth();
      console.log(m);

      const firstDay = new Date(y, 0, 1);
      const firstDays = new Date(y, 0, 1);
      firstDays.setHours(23);
      firstDays.setMinutes(59);
      firstDays.setSeconds(59);

      const lastDay = new Date(y, 12, 0);
      const lastDays = new Date(y, 12, 0);
      lastDays.setHours(23);
      lastDays.setMinutes(59);
      lastDays.setSeconds(59);
      return {
        firstDay: isFormat ? this.dateFormat(firstDay) : firstDay,
        firstDays: isFormat ? this.dateFormat(firstDays) : firstDays,
        lastDay: isFormat ? this.dateFormat(lastDay) : lastDay,
        lastDays: isFormat ? this.dateFormat(lastDays) : lastDays
      };
    })();

    // 指定年的第一天和今年的最后一天
    this.nowTheYearsEnd = (Y) => {
      const now = new Date();
      let y = Y;
      let m = now.getMonth();
      console.log(m);

      const firstDay = new Date(y, 0, 1);
      const firstDays = new Date(y, 0, 1);
      firstDays.setHours(23);
      firstDays.setMinutes(59);
      firstDays.setSeconds(59);

      const lastDay = new Date(y, 12, 0);
      const lastDays = new Date(y, 12, 0);
      lastDays.setHours(23);
      lastDays.setMinutes(59);
      lastDays.setSeconds(59);
      return {
        firstDay: isFormat ? this.dateFormat(firstDay) : firstDay,
        firstDays: isFormat ? this.dateFormat(firstDays) : firstDays,
        lastDay: isFormat ? this.dateFormat(lastDay) : lastDay,
        lastDays: isFormat ? this.dateFormat(lastDays) : lastDays
      };
    };

    // 當前時間最近前N天
    this.getNowBeforeNday = (N) => {
      const now = new Date().getTime();
      const before = new Date().getTime() - (24 * 60 * 60 * 1000) * N;
      return {
        now: isFormat ? this.dateFormat(new Date(now)) : new Date(now),
        before: isFormat ? this.dateFormat(new Date(before)) : new Date(before)
      };
    };

    // 當前時間后面N天
    this.getNowAfterNday = (N) => {
      const now = new Date().getTime();
      const after = new Date().getTime() + (24 * 60 * 60 * 1000) * N;
      return {
        now: isFormat ? this.dateFormat(new Date(now)) : new Date(now),
        after: isFormat ? this.dateFormat(new Date(after)) : new Date(after)
      };
    };
  }
  w.$Date = $Date;
})(window);
const date = window.$Date;
export const $Date = date;
<template>
  <div class="edit-hot_wrapper">
    <el-dialog
      v-model="dialogVisible"
      :title="`${hotSpot.id ? '修改' : '新增'}${spotTypeName(form.iconType)}標記`"
      :width="'360px'"
      :top="'10px'"
      :modal="false"
      :close-on-click-modal="false"
      :custom-class="'edit-hot_dialog'"
      :before-close="close"
    >
      <el-form :model="form" ref="ruleForm" :rules="rules">
        <el-form-item label="標記名稱" required prop="name">
          <el-input v-model="form.name" placeholder="輸入名稱" clearable/>
        </el-form-item>
        <!--基礎圖標綁定-->
        <template v-if="form.iconType == 1">
          <el-form-item label="綁定數(shù)據(jù)" required>
            <el-select
              v-model="form.devices"
              placeholder="選擇設備"
              filterable
              multiple
              collapse-tags
            >
              <el-option
                v-for="v in deviveData.data"
                :label="v.name"
                :value="v.id"
                :key="v.id">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="標記圖標" required prop="spotTypes">
            <el-image
              :class="['icon-types', form.spotTypes == v.id ? 'active' : '']"
              v-for="v in hotTypes"
              :key="v.id"
              :src="v.url"
              @click="form.spotTypes = v.id"
            />
          </el-form-item>
        </template>

        <!-- 文字圖標綁定-->
        <template v-if="form.iconType == 2">
          <el-form-item label="綁定數(shù)據(jù)" required prop="devices">
            <el-select
              v-model="form.devices"
              placeholder="選擇設備"
              filterable
              multiple
              collapse-tags
            >
              <el-option
                v-for="v in deviveData.data"
                :label="v.name"
                :value="v.id"
                :key="v.id">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="文字內容" required prop="text">
            <el-input
              v-model="form.text"
              :rows="4"
              type="textarea"
              placeholder="輸入文字內容"
            />
          </el-form-item>
        </template>

        <!-- 場景圖標綁定-->
        <template v-if="form.iconType == 3">
          <el-form-item label="綁定場景" required prop="sceneId">
            <el-select
              v-model="form.sceneId"
              placeholder="選擇場景"
            >
              <el-option
                v-for="v in scenes"
                :label="v.name"
                :value="v.id"
                :key="v.id">
              </el-option>
            </el-select>
          </el-form-item>
        </template>

        <!-- 位置圖標綁定-->
        <template v-if="form.iconType == 4">
          <el-form-item label="地圖位置" required prop="localtion">
            <el-input v-model="form.localtion" placeholder="輸入經緯度" clearable/>
          </el-form-item>
          <el-form-item label="經緯度查詢">
            <el-button type="success">查詢</el-button>
          </el-form-item>
        </template>

        <!-- 位置圖標綁定-->
        <template v-if="form.iconType == 5">
          <el-form-item label="媒體地址" required prop="media">
            <el-input v-model="form.media.url" placeholder="輸入媒體地址" clearable/>
          </el-form-item>
          <el-form-item label="媒體類型" required>
            <el-radio-group v-model="form.media.type" class="ml-4">
              <el-radio :label="0" size="large">音頻</el-radio>
              <el-radio :label="1" size="large">視頻</el-radio>
            </el-radio-group>
          </el-form-item>
        </template>

        <!-- 網(wǎng)址圖標綁定-->
        <template v-if="form.iconType == 6">
          <el-form-item label="網(wǎng)站地址" required prop="website">
            <el-input v-model="form.website" placeholder="輸入網(wǎng)址" clearable/>
          </el-form-item>
        </template>

        <!-- 網(wǎng)址圖標綁定-->
        <template v-if="form.iconType == 7">
          <el-form-item label="富文本" required prop="html">
            <el-input v-model="form.html" :rows="5" type="textarea" placeholder="輸入網(wǎng)址" clearable/>
          </el-form-item>
        </template>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="close">取消</el-button>
          <el-button type="primary" @click="save(ruleForm)">保存</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script setup>
import { res } from '../data/res.js';
// import store from '../../../store/index.js';
import { hotTypes } from '../utils/data.js';
import { defineEmits, defineProps } from 'vue';
import { reactive, ref, computed, onMounted } from 'vue';
import { useStore } from 'vuex';
import { ElMessage } from 'element-plus';
import store from '../vuex/vrViewer.js';
import { ICOM_TYPE } from '../utils/data.js';

const ruleForm = ref(null);
const rules = reactive({
  name: [
    {
      required: true,
      trigger: 'change',
      message: '標記名稱必填'
    }
  ],
  devices: [
    {
      required: true,
      trigger: 'change',
      message: '綁定設備必填'
    }
  ],
  spotTypes: [
    {
      required: true,
      trigger: 'change',
      message: '標記圖標類型必填'
    }
  ],
  text: [
    {
      required: true,
      trigger: 'change',
      message: '文本內容必填'
    }
  ],
  sceneId: [
    {
      required: true,
      trigger: 'change',
      message: '綁定場景必填'
    }
  ],
  localtion: [
    {
      required: true,
      trigger: 'change',
      message: '綁定位置必填'
    }
  ],
  media: [
    {
      required: true,
      trigger: 'change',
      message: '媒體地址必填'
    }
  ],
  website: [
    {
      required: true,
      trigger: 'change',
      message: '網(wǎng)站地址必填'
    }
  ],
  html: [
    {
      required: true,
      trigger: 'change',
      message: '富文本內容必填'
    }
  ],
});
const dialogVisible = ref(true);
const deviveData = ref(res);
const props = defineProps({
  hotSpot: {}, // 當前標記
  scenes: {}
});

let stores = useStore();
// 當前標記類型id
const iconType = computed(() => {
  return stores.state.vrViewer.type;
});

// 當前標記類型名稱
const spotTypeName = () => {
  const list = Object.values(ICOM_TYPE);
  return list.find(v => v.type == form.value.iconType).name;
};

const types = ref(hotTypes);
const emits = defineEmits([
  'success',
  'close',
  'save'
]);

onMounted(() => {
  // 編輯回顯示
  if (props.hotSpot.id) {
    form.value = props.hotSpot.data;
    // store.commit('vrViewer/setIconType', props.hotSpot.data.iconType);
  }
});


const form = ref({
  id: '', // 標記id
  name: '',
  devices: [],
  spotTypes: types.value[0].id, // 圖標類型
  spotUrl: types.value[0].url, // 標記圖表url
  iconType: stores.state.vrViewer.type,
  text: '', // 文字綁定
  sceneId: '', // 場景綁定
  localtion: '', // 位置經緯度綁定
  media: {
    type: 0, // 0代表音頻, 1代表視頻
    url: '' // url播放地址
  },
  website: '', // 網(wǎng)址
  html: '', // html綁定
});

const close = () => emits('close');

const save = async (formEl) => {
  // if (!form.value.name) {
  //   // 其他類型報錯
  //   ElMessage({
  //     showClose: true,
  //     message: '輸入名稱',
  //     type: 'error'
  //   });
  //   return;
  // }

  // if (!form.value.devices.length) {
  //   // 其他類型報錯
  //   ElMessage({
  //     showClose: true,
  //     message: '選擇設備',
  //     type: 'error'
  //   });
  //   return;
  // }
  console.log(formEl, 'formEl');
  await formEl.validate((valid, fields) => {
    if (valid) {
      emits('save', form.value, props.hotSpot);
      close();
    } else {
      console.log('error submit!', fields)
    }
  })
};

const success = () => {
  emits('success');
};
</script>
<style lang="scss">
  .edit-hot_dialog {
    .el-dialog__body {
      padding: 10px 20px;
      .el-select {
        width: 245px;
      }
    }
  }
</style>
<style lang="scss" scoped>
  .icon-types {
    width: 36px;
    height: 35px;
    margin: 2px;
    border: 1px solid #ccc;
    user-select: none;
    &.active {
      border: 2px solid blue;
    }
  }
</style>

到了這里,關于基于vue3.0實現(xiàn)vr全景編輯器的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉載,請注明出處: 如若內容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • 0基礎學習VR全景平臺篇第45篇:編輯器底部菜單- 關聯(lián)場景功能操作

    0基礎學習VR全景平臺篇第45篇:編輯器底部菜單- 關聯(lián)場景功能操作

    大家好,歡迎觀看蛙色VR官方系列——后臺使用課程! 本期為大家?guī)硗苌玍R平臺,底部菜單—關聯(lián)場景功能操作。 一、本功能將用在哪里? 關聯(lián)場景,是某個場景下的子場景,也可以理解為VR漫游作品的三級分組; 一級分組下顯示二級分組,二級分組下顯示場景,然后每個

    2024年02月16日
    瀏覽(49)
  • vue基于threejs實現(xiàn)的3D可視化編輯器

    vue基于threejs實現(xiàn)的3D可視化編輯器

    隨著5G網(wǎng)絡的漸漸普及,物聯(lián)網(wǎng)在人們的生活中漸漸廣泛使用,社會向著越來越智能化的方向發(fā)展。當康科技經過不懈努力,研發(fā)屬于自己的一款3D可視化編輯器,助力企業(yè)應用實現(xiàn)3D可視化服務。 編輯器界面如下: 操作視頻演示: 3D可視化編輯器v1.0版本完成 主要功能點如下

    2024年02月13日
    瀏覽(25)
  • vue3+ts+tinynce富文本編輯器+htmlDocx+file-saver 配合實現(xiàn)word下載

    vue3+ts+tinynce富文本編輯器+htmlDocx+file-saver 配合實現(xiàn)word下載

    vue3 請下載html-docx-js-typescript,否則會報錯類型問題 row.report效果及數(shù)據(jù) 調用

    2024年02月11日
    瀏覽(24)
  • Vue3 使用json編輯器

    Vue3 使用json編輯器

    安裝 npm install json-editor-vue3 main中引入 main.js 中加入下面代碼 不然會有報錯,如jsoneditor does not provide an export named ‘default’。 圖片信息來源-github 代碼示例 補充說明 json-editor-vue3支持多種配置,如可選模式(多選) modeList 、初始模式 currentMode ,歷史記錄開關 history ,搜索功能

    2024年02月12日
    瀏覽(29)
  • VUE3使用JSON編輯器

    VUE3使用JSON編輯器

    1、先看看效果圖,可以自行選擇展示效果 2、這是我在vue3項目中使用的JSON編輯器,首先引入第三方插件 3、引入到項目中 4、一般后端返回的是會將JSON轉為String形式,我們傳給后端也是通過這種形式,就可以通過后端拿到的數(shù)據(jù)進行JSON與String之間轉換 5、例子: 6、參數(shù) 參數(shù)

    2023年04月21日
    瀏覽(21)
  • Vue3項目中使用富文本編輯器

    tinymce簡介 一、 安裝 二、使用步驟 1. 封裝組件 2. 組件中掛載 3.應用富文本 總結 TinyMCE 是一款易用、且功能強大的所見即所得的富文本編輯器。跟其他富文本編輯器相比,有著豐富的插件,支持多種語言,能夠滿足日常的業(yè)務需求并且免費。 一、安裝Tinymce 注意:版本可根據(jù)

    2024年02月15日
    瀏覽(30)
  • vue3項目使用富文本編輯器-wangeditor

    vue3項目使用富文本編輯器-wangeditor

    1.下載依賴 2.插件版本 ?3.使用 引入css和組件 配置方法 模板(標簽)中插入 效果 ?

    2024年02月09日
    瀏覽(32)
  • Vue3 中vue-quill富文本編輯器圖片縮放

    Vue3 中vue-quill富文本編輯器圖片縮放

    ?導包 ? 添加配置? ?注: 該編輯器已經不在維護了,很古老了,打包后如果報錯,建議使用其他編輯器

    2024年04月25日
    瀏覽(101)
  • vue3代碼編輯器組件codemirror-editor-vue3

    官方文檔:https://github.com/RennCheung/codemirror-editor-vue3 國內鏡像:https://renncheung.github.io/codemirror-editor-vue3/zh-CN/guide/getting-started 參考文檔:https://codemirror.net/5/mode/index.html 點擊參考文檔,選擇語言并點擊在文章最后找到mode的格式 在配置項中修改mode,并引入對應語言js 如使用pyt

    2024年02月14日
    瀏覽(21)
  • Vue3 + Tsx 集成 ace-editor編輯器

    Vue3 + Tsx 集成 ace-editor編輯器

    Ace Editor介紹 Ace Editor(全名:Ajax.org Cloud9 Editor)是一個開源的代碼編輯器,旨在提供強大的代碼編輯功能,通常用于構建基于Web的代碼編輯應用程序。它最初由Cloud9 IDE開發(fā),現(xiàn)在由開源社區(qū)維護。 主要有以下特點: 超過110種語言的語法高亮 (可以導入TextMate/Sublime Text的.

    2024年02月08日
    瀏覽(63)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包