Browse Source

点位带出项目机构

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

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

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

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

@ -59,7 +59,7 @@
defineOptions({ name: 'Point' }); defineOptions({ name: 'Point' });
const [registerTable, { reload }] = useTable({ const [registerTable, { reload,getDataSource}] = useTable({
title: '点位信息', title: '点位信息',
api: list, api: list,
showIndexColumn: true, showIndexColumn: true,
@ -93,10 +93,10 @@
// //
const addModalRef = ref(); const addModalRef = ref();
const handleAdd = () => { const handleAdd = () => {
addModalRef.value.showModal(1,null,checkedTree.value[0]); addModalRef.value.showModal(1,null,checkedTree.value[0],getDataSource());
}; };
const handleEdit = (id: any) => { 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) => { const handleDelete = async (id: any) => {
await removeByIds([id]); await removeByIds([id]);

Loading…
Cancel
Save