1fe136d1137baea9018fd6a524ab0f19e3eeca90.svn-base 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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-dfgc-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rm-dfgc-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 RmDfgcForm from './RmDfgcForm'
  23. import {getAction} from "../../../../../api/manage";
  24. import BasicMap from "../../../../../components/BasicMap/BasicMap";
  25. export default {
  26. name: 'RmDfgcModal',
  27. components: {
  28. RmDfgcForm,
  29. BasicMap
  30. },
  31. data() {
  32. return {
  33. title: '',
  34. width: 896,
  35. visible: false,
  36. disableSubmit: false,
  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.buss_id = record.id;
  49. this.visible = true;
  50. this.model = record;
  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. locateByGeom() {
  70. let id = this.buss_id;
  71. let url = "/hzz.shjsgc.dfgc/rmDfgc/getGeojsonById";
  72. getAction(url, {
  73. id: id
  74. }).then(res => {
  75. if (res.success) {
  76. this.$refs.locMap.locateByGeometry(res.result);
  77. }
  78. })
  79. },
  80. tabsChange(key) {
  81. let that = this;
  82. if (key == "map") {
  83. this.$nextTick(() => {
  84. this.$refs.locMap.locateByCoords({...this.model});
  85. })
  86. }
  87. },
  88. }
  89. }
  90. </script>