Browse Source

点位带出项目机构

ops-management-platform-frontend-dev
wbc 4 weeks ago
parent
commit
f0e8fcda78
  1. 17
      src/views/property/point/addModal.vue
  2. 8
      src/views/property/point/index.vue

17
src/views/property/point/addModal.vue

@ -13,6 +13,7 @@
value: 'projectName',
options: 'options',
}"
disabled
/>
</a-form-item>
</a-col>
@ -28,6 +29,7 @@
value: 'organizationName',
options: 'options',
}"
disabled
/>
</a-form-item>
</a-col>
@ -53,9 +55,9 @@
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
<a-row :gutter="[16, 16]" v-show="false">
<a-col :span="24">
<div id="container" style="width: 100%; height: 500px" v-show="form.address"></div>
<div id="container" style="width: 100%; height: 500px" v-show="form.address" ></div>
</a-col>
</a-row>
<a-row :gutter="[16, 16]">
@ -70,7 +72,7 @@
</template>
<script>
import { reactive, ref } from 'vue';
import { reactive, ref ,toRefs} from 'vue';
import { message } from 'ant-design-vue';
import AMapLoader from '@amap/amap-jsapi-loader';
import { getInfo, add, update, getProjectInfo, getOrganizationType } from './api';
@ -90,7 +92,6 @@
id: null,
});
//
//
const projectNameOptions = ref([]);
const getProjectNameOptions = async () => {
const res = await getProjectInfo();
@ -101,11 +102,15 @@
const res = await getOrganizationType();
organizationNameOptions.value = res.rows;
};
const showModal = async (type, id, projectId) => {
console.log(projectId);
const showModal = async (type, id, projectId,dataSource) => {
console.log(dataSource);
visible.value = true;
if (type == 1) {
title.value = '新增';
form.projectName = dataSource[0].projectName
form.organizationName = dataSource[0].organizationName
initMap();
} else if (type == 2) {
title.value = '编辑';

8
src/views/property/point/index.vue

@ -40,7 +40,7 @@
</template>
</BasicTable>
<detailDrawer ref="detailDrawerRef" />
<addModal ref="addModalRef" @success="reload()" />
<addModal ref="addModalRef" @success="reload()"/>
<pointModal ref="pointModalRef" />
</a-col>
</a-row>
@ -59,7 +59,7 @@
defineOptions({ name: 'Point' });
const [registerTable, { reload }] = useTable({
const [registerTable, { reload,getDataSource}] = useTable({
title: '点位信息',
api: list,
showIndexColumn: true,
@ -93,10 +93,10 @@
//
const addModalRef = ref();
const handleAdd = () => {
addModalRef.value.showModal(1,null,checkedTree.value[0]);
addModalRef.value.showModal(1,null,checkedTree.value[0],getDataSource());
};
const handleEdit = (id: any) => {
addModalRef.value.showModal(2, id,checkedTree.value[0]);
addModalRef.value.showModal(2, id,checkedTree.value[0],getDataSource());
};
const handleDelete = async (id: any) => {
await removeByIds([id]);

Loading…
Cancel
Save