Browse Source

增加点位的新增带出

ops-management-platform-frontend-dev
wbc 3 days ago
parent
commit
fb060dab8a
  1. 14
      src/views/property/point/addModal.vue
  2. 4
      src/views/property/point/api.ts
  3. 8
      src/views/property/point/index.vue

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

@ -37,7 +37,7 @@
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="维护单位" name="maintenanceUnit"> <a-form-item label="维护单位" name="maintenanceUnit">
<a-input v-model:value="form.maintenanceUnit" placeholder="请输入" /> <a-input v-model:value="form.maintenanceUnit" placeholder="请输入" disabled/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -75,7 +75,7 @@
import { reactive, ref ,toRefs} 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,getContractPartyBNameByProjectName } from './api';
export default { export default {
setup(props,{emit}) { setup(props,{emit}) {
const title = ref('新增'); const title = ref('新增');
@ -102,15 +102,17 @@
const res = await getOrganizationType(); const res = await getOrganizationType();
organizationNameOptions.value = res.rows; organizationNameOptions.value = res.rows;
}; };
const showModal = async (type, id, projectId,dataSource) => { const showModal = async (type, id, projectId,selectInfo) => {
console.log(dataSource); console.log(selectInfo);
visible.value = true; visible.value = true;
if (type == 1) { if (type == 1) {
title.value = '新增'; title.value = '新增';
form.projectName = dataSource[0].projectName form.projectName = selectInfo.node.ownerName
form.organizationName = dataSource[0].organizationName form.organizationName = selectInfo.node.projectName
const res = await getContractPartyBNameByProjectName({projectName:selectInfo.node.ownerName})
form.maintenanceUnit = res
initMap(); initMap();
} else if (type == 2) { } else if (type == 2) {
title.value = '编辑'; title.value = '编辑';

4
src/views/property/point/api.ts

@ -12,6 +12,7 @@ enum Api {
getOrganizationType = '/platform/organizationType/list', getOrganizationType = '/platform/organizationType/list',
getContractNamesByProjectName = '/platform/contractInfo/getContractNamesByProjectName', getContractNamesByProjectName = '/platform/contractInfo/getContractNamesByProjectName',
getIoCompanyByName = '/platform/contractInfo/getIoCompany', getIoCompanyByName = '/platform/contractInfo/getIoCompany',
getContractPartyBNameByProjectName = '/platform/projectInfo/getContractPartyBNameByProjectName',
} }
export function list(params: any) { export function list(params: any) {
@ -60,3 +61,6 @@ export function getContractNamesByProjectName(data:any) {
export function getIoCompanyByName(name: any) { export function getIoCompanyByName(name: any) {
return defHttp.get({ url: `${Api.getIoCompanyByName}?name=${name}` }); return defHttp.get({ url: `${Api.getIoCompanyByName}?name=${name}` });
} }
export function getContractPartyBNameByProjectName(params: any) {
return defHttp.get({ url: Api.getContractPartyBNameByProjectName, params });
}

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

@ -59,7 +59,7 @@
defineOptions({ name: 'Point' }); defineOptions({ name: 'Point' });
const [registerTable, { reload,getDataSource}] = useTable({ const [registerTable, { reload}] = 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],getDataSource()); addModalRef.value.showModal(1,null,checkedTree.value[0],selectInfo.value);
}; };
const handleEdit = (id: any) => { const handleEdit = (id: any) => {
addModalRef.value.showModal(2, id,checkedTree.value[0],getDataSource()); addModalRef.value.showModal(2, id,checkedTree.value[0],selectInfo.value);
}; };
const handleDelete = async (id: any) => { const handleDelete = async (id: any) => {
await removeByIds([id]); await removeByIds([id]);
@ -119,8 +119,10 @@
}); });
console.log(res); console.log(res);
}; };
const selectInfo = ref({})
const onSelect = (selectedKeys: any, info: any) => { const onSelect = (selectedKeys: any, info: any) => {
console.log('selected', selectedKeys, info); console.log('selected', selectedKeys, info);
selectInfo.value = info
console.log(checkedTree.value); console.log(checkedTree.value);
reload(); reload();
}; };

Loading…
Cancel
Save