Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 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. <v-footer class="pa-3" color="primary">
  54. <v-spacer></v-spacer>
  55.  
  56. </v-footer>
  57. </v-expansion-panel-content>
  58.  
  59. </v-expansion-panel>
  60.  
  61. <div id="coords"></div>
  62.  
  63. </v-container>
  64. <usersInOffice
  65. :officeId="item.id"
  66. ref="userRef"
  67. ></usersInOffice>
  68. <v-divider></v-divider>
  69. <v-card-actions class="primary">
  70. <v-spacer></v-spacer>
  71. <v-btn color="white" flat @click="close">Anuluj</v-btn>
  72. </v-card-actions>
  73.  
  74. <div class="module-loader" v-if="loading">
  75. <v-container fluid fill-height absolute>
  76. <v-layout row wrap align-center>
  77. <v-flex class="text-xs-center">
  78. <v-progress-circular indeterminate :size="150" :width="2" color="green"></v-progress-circular>
  79. </v-flex>
  80. </v-layout>
  81. </v-container>
  82. </div>
  83. </v-card>
  84. </v-dialog>
  85. </template>
  86.  
  87. <script>
  88. import usersInOffice from '../office/usersInOffice/index.vue'
  89.  
  90. export default {
  91. props:[
  92. 'branchOfCompanies'
  93. ],
  94. components: {
  95. usersInOffice
  96. },
  97. data() {
  98. return {
  99. lat:'',
  100. lng:'',
  101. mapI: null,
  102. coord:'',
  103. visible: false,
  104. loading: false,
  105. valid: true,
  106. default: {
  107. id: 0,
  108. path:'',
  109. },
  110. item: {},
  111. userSelect: ['Foo', 'Bar', 'Fizz', 'Buzz']
  112. }
  113. },
  114. mounted(){
  115. //this.initZoom();
  116. this.refreshGetContent();
  117. },
  118. created() {
  119. this.item = _.cloneDeep(this.default);
  120. },
  121. methods: {
  122. saveAs(x,y){
  123. this.lat=document.getElementById("lati").value;
  124. this.lng=document.getElementById("longi").value;
  125. },
  126. initZoom(val){
  127. if(this.mapI!=null)
  128. {
  129. this.mapI.off();
  130. this.mapI.remove();
  131. }
  132. this.mapI = L.map('mapI', {
  133. minZoom: -1,
  134. maxZoom: 2,
  135. center: [250, 500],
  136. dragging:false,
  137. zoom: 0 ,
  138. gestureHandling: true,
  139. crs: L.CRS.Simple
  140. });
  141.  
  142. var bounds = [[500,0], [0,1000]];
  143. var image = L.imageOverlay("/img/"+val, bounds).addTo(this.mapI);
  144. // var southWest = map.unproject([0, 6], 1);
  145. // var northEast = map.unproject([10, 0], 1);
  146.  
  147. this.mapI.fitBounds(bounds);
  148.  
  149. var sol = L.latLng([ 160, 455 ]);
  150. var sol2 = L.latLng([ 160, 533.5 ]);
  151. L.marker(sol).addTo(this.mapI);
  152. L.marker(sol2).addTo(this.mapI);
  153. this.mapI.setView( [270, 500], 0);
  154.  
  155. this.mapI.on('click',
  156. function(e){
  157. this.coord = e.latlng.toString().split(',');
  158. this.lat = this.coord[0].split('(');
  159. this.lng = this.coord[1].split(')');
  160. document.getElementById("lati").value=this.lat[1];
  161. document.getElementById("longi").value=this.lng[0];
  162. return this.lat = this.coord[0].split('(');
  163. });
  164. console.log(this.lat)
  165. console.log(this.messagea)
  166.  
  167. },
  168. refreshGetContent() {
  169. this.$refs.userRef.getContent();
  170. },
  171. show(item) {
  172. if (item) {
  173. this.item = _.cloneDeep(item);
  174.  
  175. } else {
  176. this.item = _.cloneDeep(this.default);
  177. }
  178. this.visible = true;
  179. },
  180. close() {
  181. this.visible = false;
  182. },
  183. }
  184. }
  185. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement