123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- import Vue from 'vue'
- import config from '../config'
- import bus from '../utils/eventbus'
- import {
- Alert,
- Confirm,
- Tips
- } from '../components/shared/message'
- import clickoutside from './v-clickoutside'
- import clickwindow from './v-clickwindow'
- import * as api from '../api'
- Vue.prototype.$bus = bus
- Vue.prototype.$api = api
- Vue.prototype.$intranet = config.intranet
- Vue.prototype.$cdn = config.CDN
- Vue.prototype.$config = config
- Vue.prototype.$panoType = [{
- id:'building',
- name:'楼盘全景'
- },{
- id:'garden',
- name:'园林全景'
- },{
- id:'house',
- name:'户型'
- }]
- Vue.prototype.$nameStr = {
- 'building':'楼盘全景',
- 'garden':'园林全景',
- 'house':'户型'
- }
- Vue.prototype.$nameSort = {
- 'building':1,
- 'garden':2,
- 'house':3
- }
- Vue.prototype.$scrollbars = []
- let SettingPanel = require('@/framework/SettingPC').default
- Vue.mixin({
- components: {
- SettingPanel
- },
- directives: {
- 'clickoutside': clickoutside,
- 'clickwindow': clickwindow
- },
- data() {
- return {
- }
- },
- methods: {
- $alert(data = {}) {
- let instance = new Alert({
- data
- }).$mount()
- document.body.appendChild(instance.$el)
- Vue.nextTick(() => {
- instance.show = true
- })
- },
- $confirm(data = {}) {
- let instance = new Confirm({
- data
- }).$mount()
- document.body.appendChild(instance.$el)
- Vue.nextTick(() => {
- instance.show = true
- })
- },
- $tips(data = {}) {
- let instance = new Tips({
- data
- }).$mount()
- document.body.appendChild(instance.$el)
- Vue.nextTick(() => {
- instance.show = true
- })
- },
- $getStaticResource(url) {
- return config.getStaticResource(url)
- },
- $html_encode(str){
- return config.html_encode(str)
- },
- $getKrpano(str){
- return config.getKrpano(str)
- },
- $randomWord(randomFlag, min, max) {//随机字符串
- var str = "",
- range = min,
- arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
-
- if (randomFlag) { // 随机长度
- range = Math.round(Math.random() * (max - min)) + min;
- }
- for (var i = 0; i < range; i++) {
- var pos = Math.round(Math.random() * (arr.length - 1));
- str += arr[pos];
- }
- return str;
- },
- $htmlEncode(str) {
- var s = "";
- if (str.length == 0) return "";
- s = str.replace(/\'/g, "'");
- s = s.replace(/\"/g, """);
- s = s.replace(/\(/g, "(");
- s = s.replace(/\)/g, ")");
- s = s.replace(/,/g, ",");
- return s;
- },
- $deleteKRHotspot(data){
- let krpano = document.getElementById('krpanoSWFObject');
- let HV = window.__krfn.utils.getHotspotHV(krpano,data.name);
-
- krpano.call('removehotspot('+data.name+',true);');
- krpano.call('removeplugin(' + ('tooltip_' + data.name) + ',true);');
- return HV
- },
- $refreshHotspot(data){
- let HV = this.$deleteKRHotspot(data)
- data.ath = HV.ath
- data.atv = HV.atv
- this.$bus.emit("addhotspot", data);
- }
- }
- })
|