6a24de98e4ba05b78fb8153c632a6cb6f370a8f3.svn-base 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="width"
  5. :visible="visible"
  6. switchFullscreen
  7. @ok="handleOk"
  8. :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  9. @cancel="handleCancel"
  10. cancelText="关闭">
  11. <div class="attrPane">
  12. <rm-gcxxcj-form ref="realForm" :lng="this.lng" :lat="this.lat" @ok="submitCallback"
  13. :disabled="disableSubmit" @coordsChange="coordsChange"></rm-gcxxcj-form>
  14. </div>
  15. <div class="geomPane">
  16. <basic-map ref="locMap" height='702px' layersUrl='/resManager.catalog/rescatalog/resList'
  17. :model="{...model,layerName:'临时采集'}"></basic-map>
  18. </div>
  19. </j-modal>
  20. </template>
  21. <script>
  22. import RmGcxxcjForm from './RmGcxxcjForm'
  23. import BasicMap from "../../../../../components/BasicMap/BasicMap";
  24. export default {
  25. name: 'RmGcxxcjModal',
  26. components: {
  27. RmGcxxcjForm,
  28. BasicMap
  29. },
  30. data () {
  31. return {
  32. title:'',
  33. width:800,
  34. visible: false,
  35. disableSubmit: false
  36. }
  37. },
  38. methods: {
  39. add () {
  40. this.visible=true
  41. this.$nextTick(()=>{
  42. this.$refs.realForm.add();
  43. })
  44. },
  45. edit (record) {
  46. this.visible=true
  47. this.lng = record.jd;
  48. this.lat = record.wd;
  49. this.model=record;
  50. this.visible = true
  51. this.$nextTick(()=>{
  52. this.$refs.realForm.edit(record);
  53. })
  54. },
  55. close () {
  56. this.$emit('close');
  57. this.visible = false;
  58. },
  59. handleOk () {
  60. this.$refs.realForm.submitForm();
  61. },
  62. submitCallback(){
  63. this.$emit('ok');
  64. this.visible = false;
  65. },
  66. handleCancel () {
  67. this.close()
  68. },
  69. tabsChange(key) {
  70. let that = this;
  71. if (key == "map") {
  72. this.$nextTick(() => {
  73. this.$refs.locMap.locateByCoords({...this.model});
  74. })
  75. }
  76. },
  77. locateByCoords() {
  78. let loc_x = this.lng;
  79. let loc_y = this.lat;
  80. this.$refs.locMap.locateByCoords(loc_x, loc_y);
  81. }
  82. },
  83. beforeMount() {
  84. if(!this.height){
  85. let calcHeight = window.document.documentElement.clientHeight - 225;
  86. let m_height = calcHeight.toString()+'px';
  87. this.mapHeight = m_height;
  88. }
  89. }
  90. }
  91. </script>
  92. <style scoped>
  93. .attrPane {
  94. width: 33%;
  95. display: inline-block;
  96. overflow-y: auto;
  97. height: 703px;
  98. }
  99. .geomPane {
  100. width: 66%;
  101. display: inline-block;
  102. }
  103. </style>