38a2ffcb412c694a677ff0265aefc8889d836752.svn-base 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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-bzgc-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rm-bzgc-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 RmBzgcForm from './RmBzgcForm'
  23. import BasicMap from "../../../../../components/BasicMap/BasicMap";
  24. export default {
  25. name: 'RmBzgcModal',
  26. components: {
  27. BasicMap,
  28. RmBzgcForm
  29. },
  30. data() {
  31. return {
  32. title: '',
  33. width: 896,
  34. visible: false,
  35. disableSubmit: false,
  36. mapHeight: "700px",
  37. model:''
  38. }
  39. },
  40. methods: {
  41. add() {
  42. this.visible = true
  43. this.$nextTick(() => {
  44. this.$refs.realForm.add();
  45. })
  46. },
  47. edit(record) {
  48. this.lng = record.jd;
  49. this.lat = record.wd;
  50. this.model = record;
  51. this.visible = true
  52. this.$nextTick(() => {
  53. this.$refs.realForm.edit(record);
  54. })
  55. },
  56. close() {
  57. this.$emit('close');
  58. this.visible = false;
  59. },
  60. handleOk() {
  61. this.$refs.realForm.submitForm();
  62. },
  63. submitCallback() {
  64. this.$emit('ok');
  65. this.visible = false;
  66. },
  67. handleCancel() {
  68. this.close()
  69. },
  70. tabsChange(key) {
  71. let that = this;
  72. if (key == "map") {
  73. this.$nextTick(() => {
  74. // this.$refs.queryTool.handleCoord(this.geoinfo);
  75. this.$refs.locMap.locateByCoords({...this.model});
  76. })
  77. }
  78. },
  79. locateByCoords() {
  80. let loc_x = this.lng;
  81. let loc_y = this.lat;
  82. this.$refs.locMap.locateByCoords(loc_x, loc_y);
  83. }
  84. },
  85. beforeMount() {
  86. if (!this.height) {
  87. let calcHeight = window.document.documentElement.clientHeight - 225;
  88. let m_height = calcHeight.toString() + 'px';
  89. this.mapHeight = m_height;
  90. }
  91. }
  92. }
  93. </script>