Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.26 KB | None | 0 0
  1. <template>
  2. <v-dialog v-model="visible" persistent max-width="1400px">
  3. <v-card>
  4. <v-toolbar flat dark color="primary">
  5. <v-toolbar-title v-if="item.id">Detale biura</v-toolbar-title>
  6. <v-spacer></v-spacer>
  7. <v-btn flat icon color="white" @click="close">
  8. <v-icon>close</v-icon>
  9. </v-btn>
  10. </v-toolbar>
  11. <v-container>
  12. <v-layout row wrap>
  13. <v-flex class="text-xs-center">
  14. <div id="mapI" class="mapI">
  15. <v-flex d-flex>
  16. <img
  17. height="600px"
  18. >
  19. </v-flex>
  20. </div>
  21. <img v-bind:src="`/img/${item.path}`" alt="" height="0" v-on:load="refreshGetContent(item.path )">
  22. <img v-bind:src="`/img/${item.path}`" alt="" height="0" @load="initZoom(item.path)">
  23. </v-flex>
  24. </v-layout>
  25.  
  26. <v-expansion-panel>
  27. <v-expansion-panel-content>
  28. <div slot="header">Przypisz miejsce użytkownikowi</div>
  29. <v-container grid-list-md text-xs-center>
  30. <v-layout row wrap>
  31. <v-flex xs3>
  32. wysokość: <input v-model="this.messagea" id="lati">
  33. </v-flex>
  34. <v-flex xs3>
  35. szerokość: <input v-model="this.messages" id="longi">
  36. </v-flex>
  37. <v-flex xs3>
  38. <v-select
  39. :items="userSelect"
  40. label="Pracownicy"
  41. prepend-icon="perm_identity"
  42. ></v-select>
  43. </v-flex>
  44. <v-flex xs3>
  45. <div>
  46. tutaj na zmiennych
  47. /{{ lat }}/{{lng}}
  48. <v-btn color="black" flat @click="saveAs()">Zapisz</v-btn>
  49. </div>
  50. </v-flex>
  51. </v-layout>
  52. </v-container>
  53.  
  54. </v-expansion-panel-content>
  55.  
  56. </v-expansion-panel>
  57.  
  58. <div id="coords"></div>
  59.  
  60. </v-container>
  61. <usersInOffice
  62. :officeId="item.id"
  63. ref="userRef"
  64. ></usersInOffice>
  65. <v-divider></v-divider>
  66. <v-card-actions class="primary">
  67. <v-spacer></v-spacer>
  68. <v-btn color="white" flat @click="close">Anuluj</v-btn>
  69. </v-card-actions>
  70.  
  71. <div class="module-loader" v-if="loading">
  72. <v-container fluid fill-height absolute>
  73. <v-layout row wrap align-center>
  74. <v-flex class="text-xs-center">
  75. <v-progress-circular indeterminate :size="150" :width="2" color="green"></v-progress-circular>
  76. </v-flex>
  77. </v-layout>
  78. </v-container>
  79. </div>
  80. </v-card>
  81. </v-dialog>
  82. </template>
  83.  
  84. <script>
  85. import usersInOffice from '../office/usersInOffice/index.vue'
  86.  
  87. export default {
  88. props:[
  89. 'branchOfCompanies'
  90. ],
  91. components: {
  92. usersInOffice
  93. },
  94. data() {
  95. return {
  96. lat:'',
  97. lng:'',
  98. mapI: null,
  99. coord:'',
  100. visible: false,
  101. loading: false,
  102. valid: true,
  103. default: {
  104. id: 0,
  105. path:'',
  106. },
  107. item: {},
  108. userSelect: ['Foo', 'Bar', 'Fizz', 'Buzz']
  109. }
  110. },
  111. mounted(){
  112. //this.initZoom();
  113. this.refreshGetContent();
  114. },
  115. created() {
  116. this.item = _.cloneDeep(this.default);
  117. },
  118. methods: {
  119. saveAs(x,y){
  120. this.lat=document.getElementById("lati").value;
  121. this.lng=document.getElementById("longi").value;
  122. },
  123. initZoom(val){
  124. if(this.mapI!=null)
  125. {
  126. this.mapI.off();
  127. this.mapI.remove();
  128. }
  129. this.mapI = L.map('mapI', {
  130. minZoom: -1,
  131. maxZoom: 2,
  132. center: [250, 500],
  133. dragging:false,
  134. zoom: 0 ,
  135. gestureHandling: true,
  136. crs: L.CRS.Simple
  137. });
  138.  
  139. var bounds = [[500,0], [0,1000]];
  140. var image = L.imageOverlay("/img/"+val, bounds).addTo(this.mapI);
  141. // var southWest = map.unproject([0, 6], 1);
  142. // var northEast = map.unproject([10, 0], 1);
  143.  
  144. this.mapI.fitBounds(bounds);
  145.  
  146. var sol = L.latLng([ 160, 455 ]);
  147. var sol2 = L.latLng([ 160, 533.5 ]);
  148. L.marker(sol).addTo(this.mapI);
  149. L.marker(sol2).addTo(this.mapI);
  150. this.mapI.setView( [270, 500], 0).addHooks();
  151.  
  152. this.mapI.on('click',
  153. function(e){
  154. this.coord = e.latlng.toString().split(',');
  155. this.lat = this.coord[0].split('(');
  156. this.lng = this.coord[1].split(')');
  157. document.getElementById("lati").value=this.lat[1];
  158. document.getElementById("longi").value=this.lng[0];
  159. return this.lat = this.coord[0].split('(');
  160. });
  161. console.log(this.lat)
  162. console.log(this.messagea)
  163.  
  164. },
  165. refreshGetContent() {
  166. this.$refs.userRef.getContent();
  167. },
  168. show(item) {
  169. if (item) {
  170. this.item = _.cloneDeep(item);
  171.  
  172. } else {
  173. this.item = _.cloneDeep(this.default);
  174. }
  175. this.visible = true;
  176. },
  177. close() {
  178. this.visible = false;
  179. },
  180. }
  181. }
  182. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement