37c83d5c1b194ec2f0c8f3269b7a8a4de6bd10f2.svn-base 2.6 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-zbgc-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rm-zbgc-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 RmZbgcForm from './RmZbgcForm'
  23. import BasicMap from "../../../../../components/BasicMap/BasicMap";
  24. export default {
  25. name: 'RmZbgcModal',
  26. components: {
  27. RmZbgcForm,
  28. BasicMap
  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.locMap.locateByCoords({...this.model});
  75. })
  76. }
  77. },
  78. locateByCoords() {
  79. let loc_x = this.lng;
  80. let loc_y = this.lat;
  81. this.$refs.locMap.locateByCoords(loc_x, loc_y);
  82. }
  83. },
  84. beforeMount() {
  85. if(!this.height){
  86. let calcHeight = window.document.documentElement.clientHeight - 225;
  87. let m_height = calcHeight.toString()+'px';
  88. this.mapHeight = m_height;
  89. }
  90. }
  91. }
  92. </script>