Browse Source

增加点位的新增带出

ops-management-platform-frontend-dev
wbc 2 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-col :span="24">
<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-col>
</a-row>
@ -75,7 +75,7 @@
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';
import { getInfo, add, update, getProjectInfo, getOrganizationType,getContractPartyBNameByProjectName } from './api';
export default {
setup(props,{emit}) {
const title = ref('新增');
@ -102,15 +102,17 @@
const res = await getOrganizationType();
organizationNameOptions.value = res.rows;
};
const showModal = async (type, id, projectId,dataSource) => {
console.log(dataSource);
const showModal = async (type, id, projectId,selectInfo) => {
console.log(selectInfo);
visible.value = true;
if (type == 1) {
title.value = '新增';
form.projectName = dataSource[0].projectName
form.organizationName = dataSource[0].organizationName
form.projectName = selectInfo.node.ownerName
form.organizationName = selectInfo.node.projectName
const res = await getContractPartyBNameByProjectName({projectName:selectInfo.node.ownerName})
form.maintenanceUnit = res
initMap();
} else if (type == 2) {
title.value = '编辑';

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

@ -12,6 +12,7 @@ enum Api {
getOrganizationType = '/platform/organizationType/list',
getContractNamesByProjectName = '/platform/contractInfo/getContractNamesByProjectName',
getIoCompanyByName = '/platform/contractInfo/getIoCompany',
getContractPartyBNameByProjectName = '/platform/projectInfo/getContractPartyBNameByProjectName',
}
export function list(params: any) {
@ -59,4 +60,7 @@ export function getContractNamesByProjectName(data:any) {
}
export function getIoCompanyByName(name: any) {
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' });
const [registerTable, { reload,getDataSource}] = useTable({
const [registerTable, { reload}] = useTable({
title: '点位信息',
api: list,
showIndexColumn: true,
@ -93,10 +93,10 @@
//
const addModalRef = ref();
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) => {
addModalRef.value.showModal(2, id,checkedTree.value[0],getDataSource());
addModalRef.value.showModal(2, id,checkedTree.value[0],selectInfo.value);
};
const handleDelete = async (id: any) => {
await removeByIds([id]);
@ -119,8 +119,10 @@
});
console.log(res);
};
const selectInfo = ref({})
const onSelect = (selectedKeys: any, info: any) => {
console.log('selected', selectedKeys, info);
selectInfo.value = info
console.log(checkedTree.value);
reload();
};

Loading…
Cancel
Save