12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <template>
- <j-modal
- :title="title"
- :width="width"
- :visible="visible"
- switchFullscreen
- @ok="handleOk"
- :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
- @cancel="handleCancel"
- cancelText="关闭">
- <a-tabs default-active-key="attrs" @change="tabsChange">
- <a-tab-pane key="attrs" tab="属性信息">
- <rm-dfgc-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rm-dfgc-form>
- </a-tab-pane>
- <a-tab-pane key="map" tab="位置信息">
- <basic-map ref="locMap" layersUrl='/resManager.catalog/rescatalog/resList' :model="{...model,layerName:'堤防工程'}"></basic-map>
- </a-tab-pane>
- </a-tabs>
- </j-modal>
- </template>
- <script>
- import RmDfgcForm from './RmDfgcForm'
- import {getAction} from "../../../../../api/manage";
- import BasicMap from "../../../../../components/BasicMap/BasicMap";
- export default {
- name: 'RmDfgcModal',
- components: {
- RmDfgcForm,
- BasicMap
- },
- data() {
- return {
- title: '',
- width: 896,
- visible: false,
- disableSubmit: false,
- model:{}
- }
- },
- methods: {
- add() {
- this.visible = true
- this.$nextTick(() => {
- this.$refs.realForm.add();
- })
- },
- edit(record) {
- this.buss_id = record.id;
- this.visible = true;
- this.model = record;
- this.$nextTick(() => {
- this.$refs.realForm.edit(record);
- })
- },
- close() {
- this.$emit('close');
- this.visible = false;
- },
- handleOk() {
- this.$refs.realForm.submitForm();
- },
- submitCallback() {
- this.$emit('ok');
- this.visible = false;
- },
- handleCancel() {
- this.close()
- },
- locateByGeom() {
- let id = this.buss_id;
- let url = "/hzz.shjsgc.dfgc/rmDfgc/getGeojsonById";
- getAction(url, {
- id: id
- }).then(res => {
- if (res.success) {
- this.$refs.locMap.locateByGeometry(res.result);
- }
- })
- },
- tabsChange(key) {
- let that = this;
- if (key == "map") {
- this.$nextTick(() => {
- this.$refs.locMap.locateByCoords({...this.model});
- })
- }
- },
- }
- }
- </script>
|