Commit 7d87e724 authored by xinzhedeai's avatar xinzhedeai

level处理

parent 76594b9a
...@@ -135,56 +135,17 @@ var baseAPI = ...@@ -135,56 +135,17 @@ var baseAPI =
? process.env.VUE_APP_LOCAL_API + "/" ? process.env.VUE_APP_LOCAL_API + "/"
: (VUE_APP_API.ServiceURL || process.env.VUE_APP_LOCAL_API) + "/"; : (VUE_APP_API.ServiceURL || process.env.VUE_APP_LOCAL_API) + "/";
import crudHome from "@/api/system/home"; import crudHome from "@/api/system/home";
import IconSelect from "@/components/IconSelect";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { LOAD_CHILDREN_OPTIONS } from "@riophae/vue-treeselect";
import CRUD, { presenter, header, form, crud } from "@crud/crud";
import rrOperation from "@crud/RR.operation";
import crudOperation from "@crud/CRUD.operation";
import udOperation from "@crud/UD.operation";
import DateRangePicker from "@/components/DateRangePicker";
import dic from "@/api/system/dict"; import dic from "@/api/system/dict";
import cuAmap from "@/components/AMap"; import cuAmap from "@/components/AMap";
// crud交由presenter持有
const defaultForm = {
id: null,
title: null,
menuSort: 999,
path: null,
component: null,
componentName: null,
iframe: false,
roles: [],
pid: 0,
icon: null,
cache: false,
hidden: false,
type: 0,
permission: null,
};
export default { export default {
name: "Menu", name: "Home",
components: { components: {
cuAmap, cuAmap,
Treeselect,
IconSelect,
crudOperation,
rrOperation,
udOperation,
DateRangePicker,
},
cruds() {
return CRUD({
title: "菜单",
url: "api/menus",
crudMethod: { ...crudHome },
});
}, },
mixins: [presenter(), header(), form(defaultForm), crud()],
data() { data() {
return { return {
baseAPI: baseAPI, baseAPI: baseAPI,
...@@ -192,6 +153,7 @@ export default { ...@@ -192,6 +153,7 @@ export default {
fileList: [], fileList: [],
cmap: null, cmap: null,
Dict: { selectList: [] }, Dict: { selectList: [] },
companyLevelList: [],
formInline: { formInline: {
address: "", address: "",
contactPerson: "", contactPerson: "",
...@@ -206,17 +168,6 @@ export default { ...@@ -206,17 +168,6 @@ export default {
operatingAgency: "", operatingAgency: "",
totalArea: "", totalArea: "",
}, },
menus: [],
permission: {
add: ["admin", "menu:add"],
edit: ["admin", "menu:edit"],
del: ["admin", "menu:del"],
},
rules: {
title: [{ required: true, message: "请输入标题", trigger: "blur" }],
path: [{ required: true, message: "请输入地址", trigger: "blur" }],
},
}; };
}, },
computed: { computed: {
...@@ -226,10 +177,6 @@ export default { ...@@ -226,10 +177,6 @@ export default {
}, },
mounted() { mounted() {
// this.getData(); // this.getData();
dic.getCompanyDicts().then((res) => {
console.log(res);
this.companyLevelList = res.body.incubatorLevel || [];
});
}, },
methods: { methods: {
handleSuccess(response, file) { handleSuccess(response, file) {
...@@ -291,30 +238,17 @@ export default { ...@@ -291,30 +238,17 @@ export default {
title: "", title: "",
draggable: true, draggable: true,
dragend: function (e) { dragend: function (e) {
// var lnglat = e.lnglat; VUE.getAddrPlus(e, cmap);
// cmap.deGeocode([lnglat.lng, lnglat.lat], function (addr) {
// form.address = addr;
// form.longitude = lnglat.lng;
// form.latitude = lnglat.lat;
// self.$forceUpdate();
// });
VUE.getAddrPlus(e, cmap)
}, },
}); });
} }
VUE.getData(function () {}); VUE.getData();
}, },
click: function (e, cmap) { click: function (e, cmap) {
// 经纬度坐标 // 经纬度坐标
VUE.getAddrPlus(e, cmap); VUE.getAddrPlus(e, cmap);
// var lnglat = e.lnglat;
// cmap.deGeocode([lnglat.lng, lnglat.lat], function (addr) {
// form.address = addr;
// form.longitude = lnglat.lng;
// form.latitude = lnglat.lat;
// });
cmap.marker && cmap.removeMarker(); cmap.marker && cmap.removeMarker();
// 添加标记 // 添加标记
...@@ -323,12 +257,6 @@ export default { ...@@ -323,12 +257,6 @@ export default {
title: "", title: "",
draggable: true, draggable: true,
dragend: function (e) { dragend: function (e) {
// var lnglat = e.lnglat;
// cmap.deGeocode([lnglat.lng, lnglat.lat], function (addr) {
// form.address = addr;
// form.longitude = lnglat.lng;
// form.latitude = lnglat.lat;
// });
VUE.getAddrPlus(e, cmap, form); VUE.getAddrPlus(e, cmap, form);
}, },
}); });
...@@ -349,7 +277,7 @@ export default { ...@@ -349,7 +277,7 @@ export default {
}); });
console.log(); console.log();
// 根据经纬度进行逆地理编码查询 // 根据经纬度进行逆地理编码查询
geocoder.getAddress([longitude, latitude], (status, result) => { geocoder.getAddress([longitude, latitude], (status, result) => {
if (status === "complete" && result.info === "OK") { if (status === "complete" && result.info === "OK") {
if (result.regeocode && result.regeocode.formattedAddress) { if (result.regeocode && result.regeocode.formattedAddress) {
let address = result.regeocode.formattedAddress; let address = result.regeocode.formattedAddress;
...@@ -372,27 +300,30 @@ export default { ...@@ -372,27 +300,30 @@ export default {
crudHome.edit(this.formInline).then((res) => { crudHome.edit(this.formInline).then((res) => {
if (res && res.code === 200) { if (res && res.code === 200) {
this.$message.success("保存成功"); // res.msg this.$message.success("保存成功"); // res.msg
this.getData() this.getData();
} }
}); });
}, },
getData(fn) { getData() {
crudHome.getData().then((res) => { crudHome.getData().then((res) => {
this.formInline = res.body; dic.getCompanyDicts().then((res1) => {
this.formInline.incubatorImage = res.body.incubatorImage; this.companyLevelList = res1.body.incubatorLevel || [];
const lat = this.formInline.latitude;
const lng = this.formInline.longitude; this.formInline = res.body;
// this.$refs.amap.init(amapOptions()); this.formInline.incubatorImage = res.body.incubatorImage;
const center = [lng, lat]; const lat = this.formInline.latitude;
// setTimeout(() => { const lng = this.formInline.longitude;
// 定位中心地址 // this.$refs.amap.init(amapOptions());
this.$refs.amap.setCenter(center); const center = [lng, lat];
console.log("map", this.cmap); // setTimeout(() => {
// 定位marker设置 // 定位中心地址
this.cmap.marker.setPosition(new AMap.LngLat(lng, lat)); this.$refs.amap.setCenter(center);
// }, 3000); console.log("map", this.cmap);
console.log(); // 定位marker设置
fn && fn(); this.cmap.marker.setPosition(new AMap.LngLat(lng, lat));
// }, 3000);
console.log();
});
}); });
}, },
// 选中图标 // 选中图标
......
...@@ -89,7 +89,6 @@ ...@@ -89,7 +89,6 @@
<li>运营机构:{{ data4panel0.operatingAgency }}</li> <li>运营机构:{{ data4panel0.operatingAgency }}</li>
<li>联 系人:{{ data4panel0.contactPerson }}</li> <li>联 系人:{{ data4panel0.contactPerson }}</li>
<li>联系电话:{{ data4panel0.contactPhone }}</li> <li>联系电话:{{ data4panel0.contactPhone }}</li>
<li>{{}}</li>
</ul> </ul>
</div> </div>
<div class="_bottom"> <div class="_bottom">
...@@ -118,7 +117,7 @@ ...@@ -118,7 +117,7 @@
></el-input> ></el-input>
<ul> <ul>
<li v-for="item1 in tableData4panel1" :key="item1.companyId" @click="changeCompany(item1.companyId)"> <li v-for="item1 in tableData4panel1" :key="item1.companyId" :class="{active: currentSelectedCompanyId===item1.companyId}" @click="changeCompany(item1.companyId)">
{{ item1.companyName }} {{ item1.companyName }}
</li> </li>
</ul> </ul>
...@@ -570,12 +569,20 @@ export default { ...@@ -570,12 +569,20 @@ export default {
this.incubatorId = this.$route.query.id; this.incubatorId = this.$route.query.id;
// this.getData4panel0(); // this.getData4panel0();
// this.getData4panel4(); // this.getData4panel4();
this.getData4panel1() this.getData4panel0()
}, },
methods: { methods: {
changeNav(index) { changeNav(index) {
this.activeIndex = ~~index; this.activeIndex = ~~index;
if(~~this.activeIndex === 1 || ~~this.activeIndex === 2 || ~~this.activeIndex === 3){
this.getData4panel1()
}else if(~~this.activeIndex === 0){
this.getData4panel0()
}else if(~~this.activeIndex === 4){
this.getData4panel4()
}
}, },
/** /**
* getData4enterprise * getData4enterprise
...@@ -603,7 +610,7 @@ export default { ...@@ -603,7 +610,7 @@ export default {
}, },
getData4panel1() { // 获取panel2,3,4企业列表 getData4panel1() { // 获取panel2,3,4企业列表
let companyType = '' let companyType = ''
if(~~this.activeIndex === 0){ if(~~this.activeIndex === 1){
companyType = '1' companyType = '1'
}else if(~~this.activeIndex === 2){ }else if(~~this.activeIndex === 2){
companyType = '2' companyType = '2'
...@@ -809,6 +816,7 @@ export default { ...@@ -809,6 +816,7 @@ export default {
console.log(res, "getData4panel04tech"); console.log(res, "getData4panel04tech");
this.data4panel0 = res.body; this.data4panel0 = res.body;
this.initChart4panel0_1(); this.initChart4panel0_1();
this.initChart4panel0_2()
}); });
}, },
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment