fcd18cf79c966f6d251f4c4b1b47947cec4a11f3.svn-base 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. <a-tabs default-active-key="attrs" @change="tabsChange">
  12. <a-tab-pane key="attrs" tab="属性信息">
  13. <rm-gxqktjb-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rm-gxqktjb-form>
  14. </a-tab-pane>
  15. <a-tab-pane key="map" tab="位置信息">
  16. <basic-map ref="locMap" layersUrl='/resManager.catalog/rescatalog/resList' :model="{...model,layerName:'泵站工程,岸线功能区'}"></basic-map>
  17. </a-tab-pane>
  18. </a-tabs>
  19. </j-modal>
  20. </template>
  21. <script>
  22. import RmGxqktjbForm from './RmGxqktjbForm'
  23. import BasicMap from "../../../../../../components/BasicMap/BasicMap";
  24. export default {
  25. name: 'RmGxqktjbModal',
  26. components: {
  27. BasicMap,
  28. RmGxqktjbForm
  29. },
  30. data () {
  31. return {
  32. title:'',
  33. width:896,
  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.lng = record.jd;
  47. this.lat = record.wd;
  48. this.model = record;
  49. this.visible = true
  50. this.$nextTick(() => {
  51. this.$refs.realForm.edit(record);
  52. })
  53. },
  54. close () {
  55. this.$emit('close');
  56. this.visible = false;
  57. },
  58. handleOk () {
  59. this.$refs.realForm.submitForm();
  60. },
  61. submitCallback(){
  62. this.$emit('ok');
  63. this.visible = false;
  64. },
  65. handleCancel () {
  66. this.close()
  67. },
  68. tabsChange(key) {
  69. let that = this;
  70. if (key == "map") {
  71. this.$nextTick(() => {
  72. this.$refs.locMap.locateByCoords({...this.model});
  73. })
  74. }
  75. },
  76. locateByCoords() {
  77. let loc_x = this.lng;
  78. let loc_y = this.lat;
  79. this.$refs.locMap.locateByCoords(loc_x, loc_y);
  80. }
  81. },
  82. beforeMount() {
  83. if (!this.height) {
  84. let calcHeight = window.document.documentElement.clientHeight - 225;
  85. let m_height = calcHeight.toString() + 'px';
  86. this.mapHeight = m_height;
  87. }
  88. }
  89. }
  90. </script>