|
@@ -1,13 +1,18 @@
|
|
|
<template>
|
|
|
<div class="container">
|
|
|
<div class="left">
|
|
|
- <Anchor @goAnchor="goAnchor" />
|
|
|
+ <Anchor @goAnchor="goAnchor" :anchorList="anchorList" />
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
- <Basic name="基本信息" :info="info.basic" />
|
|
|
- <Geo :propInfo="info.geo" />
|
|
|
+ <Basic
|
|
|
+ v-for="(item, index) in anchorList"
|
|
|
+ :key="index"
|
|
|
+ :itemProps="item"
|
|
|
+ :info="info"
|
|
|
+ />
|
|
|
+ <!-- <Geo :PropInfo="info.geo" />
|
|
|
<Project />
|
|
|
- <Business />
|
|
|
+ <Business /> -->
|
|
|
<div class="bottom">
|
|
|
<Button type="primary">保存</Button>
|
|
|
</div>
|
|
@@ -22,6 +27,19 @@ import Project from "./components/project.vue";
|
|
|
import Business from "./components/business.vue";
|
|
|
import { mapState } from "vuex";
|
|
|
import ScanController from "@/controller/old-adm/ScanController";
|
|
|
+import Dic from "@/controller/old-adm/dicController";
|
|
|
+import Form from "./form/index.vue";
|
|
|
+export const dataTypeEnum = {
|
|
|
+ INTEGER: "input",
|
|
|
+ DOUBLE: "input",
|
|
|
+ BOOLEAN: "BOOLEAN",
|
|
|
+ STRING: "input",
|
|
|
+ DATETIME: "DATETIME",
|
|
|
+ ENUM: "select",
|
|
|
+ MENUM: "select",
|
|
|
+ ATTACHMENT: "upload",
|
|
|
+ OBJECT: "OBJECT",
|
|
|
+};
|
|
|
export default {
|
|
|
components: {
|
|
|
Anchor,
|
|
@@ -29,22 +47,12 @@ export default {
|
|
|
Geo,
|
|
|
Project,
|
|
|
Business,
|
|
|
+ Form,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- info: {
|
|
|
- basic: {
|
|
|
- id: "",
|
|
|
- localName: "",
|
|
|
- },
|
|
|
- geo: {
|
|
|
- district: "", // 省市区县
|
|
|
- address: "", // 详细地址
|
|
|
- lng: "", // 经度
|
|
|
- lat: "", // 纬度
|
|
|
- level: null, // 抗震设防烈度
|
|
|
- },
|
|
|
- },
|
|
|
+ anchorList: [],
|
|
|
+ info: {},
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -52,10 +60,40 @@ export default {
|
|
|
...mapState("layout", ["projectId"]),
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log(this.selectProject, this.projectId);
|
|
|
this.getInfo();
|
|
|
+ this.getDict();
|
|
|
},
|
|
|
methods: {
|
|
|
+ getDict() {
|
|
|
+ Dic.getDataDictionary({
|
|
|
+ type: "project",
|
|
|
+ filters: `projectId=${this.projectId}`,
|
|
|
+ }).then((res) => {
|
|
|
+ let keys = [];
|
|
|
+ res.content
|
|
|
+ .filter((i) => i.visible)
|
|
|
+ .forEach((i) => {
|
|
|
+ const index = keys.findIndex((i2) => i2.label === i.firstTag);
|
|
|
+ const obj = {
|
|
|
+ label: i.firstTag,
|
|
|
+ value: `a-${encodeURI(i.firstTag)}`,
|
|
|
+ child: [i],
|
|
|
+ };
|
|
|
+ if (index === -1) {
|
|
|
+ keys.push(obj);
|
|
|
+ } else {
|
|
|
+ keys[index].child.push(i);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.anchorList = keys;
|
|
|
+ console.log(
|
|
|
+ "%c [ res ]: ",
|
|
|
+ "color: #bf2c9f; background: pink; font-size: 13px;",
|
|
|
+ res
|
|
|
+ );
|
|
|
+ console.log(keys);
|
|
|
+ });
|
|
|
+ },
|
|
|
getInfo() {
|
|
|
ScanController.getAllProject({
|
|
|
filters: `projectId=${this.projectId}`,
|
|
@@ -63,20 +101,21 @@ export default {
|
|
|
console.log(res);
|
|
|
if (res.content.length) {
|
|
|
let info = res.content[0];
|
|
|
- const { id, localName, infos } = info;
|
|
|
- this.info.basic.id = id;
|
|
|
- this.info.basic.localName = localName;
|
|
|
+ // const { id, localName, infos } = info;
|
|
|
+ // this.info.basic.id = id;
|
|
|
+ // this.info.basic.localName = localName;
|
|
|
|
|
|
- this.info.geo.lng = infos.longitude;
|
|
|
- this.info.geo.lat = infos.latitude;
|
|
|
+ // this.info.geo.lng = infos.longitude;
|
|
|
+ // this.info.geo.lat = infos.latitude;
|
|
|
+ this.info = info;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
goAnchor(anchor) {
|
|
|
- let name = anchor + "-container";
|
|
|
+ let name = anchor;
|
|
|
let dom = document.querySelector(`.${name}`);
|
|
|
let right = document.querySelector(".right");
|
|
|
- if (dom) {
|
|
|
+ if (dom && right) {
|
|
|
right.scrollTop = dom.offsetTop - 120;
|
|
|
}
|
|
|
},
|