Commit 829119a5 authored by xinzhedeai's avatar xinzhedeai

企业孵化首页

parent 3f7285f6
...@@ -31,4 +31,12 @@ export function edit(data) { ...@@ -31,4 +31,12 @@ export function edit(data) {
}) })
} }
export default { add, edit, del } export function getCompanyDicts() {
return request({
url: 'api/company/dic',
method: 'get'
})
}
export default { add, edit, del, getCompanyDicts }
...@@ -45,7 +45,8 @@ export default { ...@@ -45,7 +45,8 @@ export default {
display:flex; display:flex;
flex-direction:column; flex-direction:column;
//padding:.925vh 0; //padding:.925vh 0;
background-color:#00154e; // background-color:#00154e;
background-color:#fff;
height:100%; height:100%;
.common-page{margin-top:75px;} .common-page{margin-top:75px;}
box-sizing: border-box; box-sizing: border-box;
......
...@@ -53,6 +53,21 @@ export const constantRouterMap = [ ...@@ -53,6 +53,21 @@ export const constantRouterMap = [
} }
] ]
}, },
// {
// path: "/home/enterprise",
// //component: Layout,
// component: HomeLayout,
// redirect: "noredirect",
// hidden:true,
// children: [
// {
// path: "center",
// component: resolve => require(["@/views/system/home/enterprise"], resolve),
// name: "首页-企业",
// meta: { title: "首页", affix:true }
// }
// ]
// },
{ {
path: "/edge/Screen", path: "/edge/Screen",
component: (resolve) => { component: (resolve) => {
......
...@@ -27,8 +27,7 @@ ...@@ -27,8 +27,7 @@
style="width: 320px" style="width: 320px"
size="middle" size="middle"
> >
<el-option label="区域一" value="shanghai"></el-option> <el-option :label="item.name" :value="item.value" v-for="item in companyLevelList" :key="item.name"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="联系人"> <el-form-item label="联系人">
...@@ -64,7 +63,7 @@ ...@@ -64,7 +63,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="剩余企业孵化的面积(m²)"> <el-form-item label="剩余企业孵化的面积(m²)">
{{ remainingArea }} {{ remainingArea }}
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
...@@ -73,7 +72,7 @@ ...@@ -73,7 +72,7 @@
v-model="formInline.address" v-model="formInline.address"
placeholder="" placeholder=""
size="small" size="small"
style="width: 360px;" style="width: 360px"
disabled disabled
></el-input> ></el-input>
<div <div
...@@ -83,7 +82,7 @@ ...@@ -83,7 +82,7 @@
<cu-amap ref="amap" :options="amapOptions()" /> <cu-amap ref="amap" :options="amapOptions()" />
</div> </div>
</el-form-item> </el-form-item>
<el-form-item style="margin-left: 80px;"> <el-form-item style="margin-left: 80px">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:action="`${baseAPI}api/file/upload?modelName=incubator`" :action="`${baseAPI}api/file/upload?modelName=incubator`"
...@@ -96,30 +95,40 @@ ...@@ -96,30 +95,40 @@
:on-exceed="handleExceed" :on-exceed="handleExceed"
:file-list="fileList" :file-list="fileList"
:show-file-list="false" :show-file-list="false"
style="margin-bottom: 6px;" style="margin-bottom: 6px"
> >
<span style="margin-right: 14px">孵化器展示上传</span> <span style="margin-right: 14px">孵化器展示上传</span>
<el-button size="mini" type="default">上传图片</el-button> <el-button size="mini" type="default">上传图片</el-button>
</el-upload> </el-upload>
<div :style="'width:500px;' + 'height:300px' + ';'"> <div :style="'width:500px;' + 'height:300px' + ';'">
<div class="imgShowraper"> <div class="imgShowraper">
<img :src="`${baseAPI}file/${formInline.incubatorImage}`" alt="" width="500" height="300px" /> <img
:src="`${baseAPI}file/${formInline.incubatorImage}`"
alt=""
width="500"
height="300px"
/>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-row style=" display: flex; <el-row
justify-content: center; margin-top: 60px;"><el-button type="primary" size="small" @click="edit">保存修改信息</el-button></el-row> style="display: flex; justify-content: center; margin-top: 60px"
><el-button type="primary" size="small" @click="edit"
>保存修改信息</el-button
></el-row
>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
var baseAPI =
var baseAPI = process.env.NODE_ENV === 'development' ? process.env.VUE_APP_LOCAL_API + '/' : (VUE_APP_API.ServiceURL || process.env.VUE_APP_LOCAL_API) + '/'; process.env.NODE_ENV === "development"
? 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 IconSelect from "@/components/IconSelect";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
...@@ -131,6 +140,9 @@ import crudOperation from "@crud/CRUD.operation"; ...@@ -131,6 +140,9 @@ import crudOperation from "@crud/CRUD.operation";
import udOperation from "@crud/UD.operation"; import udOperation from "@crud/UD.operation";
import DateRangePicker from "@/components/DateRangePicker"; import DateRangePicker from "@/components/DateRangePicker";
import dic from "@/api/system/dict";
import cuAmap from "@/components/AMap"; import cuAmap from "@/components/AMap";
// crud交由presenter持有 // crud交由presenter持有
...@@ -171,24 +183,24 @@ export default { ...@@ -171,24 +183,24 @@ export default {
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
data() { data() {
return { return {
baseAPI:baseAPI, baseAPI: baseAPI,
labelPosition: "right", labelPosition: "right",
fileList: [], fileList: [],
cmap: null,
Dict: { selectList: [] }, Dict: { selectList: [] },
formInline: { formInline: {
address: "", address: "",
contactPerson: "", contactPerson: "",
contactPhone: "", contactPhone: "",
id:'', id: "",
incubationArea:'', incubationArea: "",
incubatorImage:'', incubatorImage: "",
incubatorLevel:'', incubatorLevel: "",
incubatorName:'', incubatorName: "",
latitude:'', latitude: "",
longitude:'', longitude: "",
operatingAgency:'', operatingAgency: "",
totalArea:'', totalArea: "",
}, },
menus: [], menus: [],
...@@ -206,17 +218,21 @@ export default { ...@@ -206,17 +218,21 @@ export default {
computed: { computed: {
remainingArea() { remainingArea() {
return this.formInline.totalArea - this.formInline.incubationArea; return this.formInline.totalArea - this.formInline.incubationArea;
} },
}, },
mounted(){ mounted() {
this.getData() // this.getData();
dic.getCompanyDicts().then((res) => {
console.log(res)
this.companyLevelList = res.body.companyLevel || []
});
}, },
methods: { methods: {
handleSuccess(response, file) { handleSuccess(response, file) {
// 处理上传成功 // 处理上传成功
console.log('Upload success:', response, file); console.log("Upload success:", response, file);
this.formInline.incubatorImage = response.body this.formInline.incubatorImage = response.body;
// this.fileList.push(file); // 存储已上传文件 // this.fileList.push(file); // 存储已上传文件
// this.tableData.push({ // this.tableData.push({
// name: file.name, // name: file.name,
...@@ -225,10 +241,10 @@ export default { ...@@ -225,10 +241,10 @@ export default {
}, },
handleError(err, file) { handleError(err, file) {
// 处理上传错误 // 处理上传错误
console.error('Upload failed:', err, file); console.error("Upload failed:", err, file);
this.tableData.push({ this.tableData.push({
name: file.name, name: file.name,
status: '上传失败', status: "上传失败",
}); });
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
...@@ -247,19 +263,9 @@ export default { ...@@ -247,19 +263,9 @@ export default {
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`); return this.$confirm(`确定移除 ${file.name}?`);
}, },
initMap(lng, lat){
// var opts = {
// center:[lng || 107.260044, lat || 36.737982],
// showLabel: true,
// pitch: 40,
// zoom: 4,
// mapStyle: 'amap://styles/blue',
// };
var cmap = this.$refs.amap.init(amapOptions());
},
amapOptions(cmap) { amapOptions(cmap) {
var item = this.formInline.item, var VUE = this;
self = this, var self = this,
form = this.formInline; form = this.formInline;
return { return {
zoom: 12, zoom: 12,
...@@ -267,29 +273,33 @@ export default { ...@@ -267,29 +273,33 @@ export default {
//showLabel: true, //showLabel: true,
//pitch: 40, //pitch: 40,
onload: function (cmap) { onload: function (cmap) {
this.Dict.cmap = cmap;
var center = cmap.options.center; // debugger
var lng = form.longitude || center[0], VUE.cmap = cmap;
lat = form.latitude || center[1]; var center = cmap.options.center;
if (lng && lat) { var lng = form.longitude || center[0],
cmap.setCenter([lng, lat]); lat = form.latitude || center[1];
if (lng && lat) {
cmap.setCenter([lng, lat]);
// 添加标记 // 添加标记
cmap.addMarker({ cmap.addMarker({
lnglat: [lng, lat], lnglat: [lng, lat],
title: "", title: "",
draggable: true, draggable: true,
dragend: function (e) { dragend: function (e) {
var lnglat = e.lnglat; var lnglat = e.lnglat;
cmap.deGeocode([lnglat.lng, lnglat.lat], function (addr) { cmap.deGeocode([lnglat.lng, lnglat.lat], function (addr) {
form.address = addr; form.address = addr;
form.longitude = lnglat.lng; form.longitude = lnglat.lng;
form.latitude = lnglat.lat; form.latitude = lnglat.lat;
self.$forceUpdate(); self.$forceUpdate();
}); });
}, },
}); });
} }
VUE.getData(function () {});
}, },
click: function (e, cmap) { click: function (e, cmap) {
var lnglat = e.lnglat; var lnglat = e.lnglat;
...@@ -320,22 +330,34 @@ export default { ...@@ -320,22 +330,34 @@ export default {
onSubmit() { onSubmit() {
console.log("submit!"); console.log("submit!");
}, },
edit(){ edit() {
crudHome.edit(this.formInline).then((res) => { crudHome.edit(this.formInline).then((res) => {
if(res && res.code === 200){ if (res && res.code === 200) {
this.$message.warning(res.msg) this.$message.success('保存成功'); // res.msg
} }
}); });
}, },
getData() { getData(fn) {
crudHome.getData().then((res) => { crudHome.getData().then((res) => {
this.formInline = res.body this.formInline = res.body;
this.formInline.incubatorImage = res.body.incubatorImage this.formInline.incubatorImage = res.body.incubatorImage;
// this.$refs.amap.init(amapOptions()); const lat = this.formInline.latitude
const center = [this.formInline.lat, this.formInline.lng ]; const lng = this.formInline.longitude
this.$refs.amap.map.setCenter(center); // this.$refs.amap.init(amapOptions());
this.Dict.cmap.marker.setPosition(new AMap.LngLat(this.formInline.lng, this.formInline.lat)); const center = [lng, lat];
}); // setTimeout(() => {
// 定位中心地址
this.$refs.amap.setCenter(center);
console.log("map", this.cmap);
// 定位marker设置
this.cmap.marker.setPosition(
new AMap.LngLat(lng, lat)
);
// }, 3000);
console.log();
fn && fn()
});
}, },
// 选中图标 // 选中图标
selected(name) { selected(name) {
...@@ -345,11 +367,14 @@ export default { ...@@ -345,11 +367,14 @@ export default {
}; };
</script> </script>
<style> <style>
.app-main { /* .app-main {
background-color: #fff !important; background-color: #fff !important;
} } */
</style> </style>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.app-container{
background-color: #f5f6fb;
}
.header { .header {
background: #f5f6fb; background: #f5f6fb;
height: 52px; height: 52px;
...@@ -363,7 +388,7 @@ export default { ...@@ -363,7 +388,7 @@ export default {
display: block; display: block;
background: no-repeat top left url("~@/assets/images/iconNew/icon1.png"); background: no-repeat top left url("~@/assets/images/iconNew/icon1.png");
position: absolute; position: absolute;
top: 25px; top: 32px;
left: 28px; left: 28px;
height: 100%; height: 100%;
width: 1.58rem; width: 1.58rem;
...@@ -371,7 +396,7 @@ export default { ...@@ -371,7 +396,7 @@ export default {
} }
} }
.body { .body {
background-color: #fff;
.title { .title {
color: #1890ff; color: #1890ff;
height: 48px; height: 48px;
...@@ -391,7 +416,10 @@ export default { ...@@ -391,7 +416,10 @@ export default {
} }
} }
} }
::v-deep .el-input__inner{ ::v-deep .el-input {
width: 320px;
}
::v-deep .el-input__inner {
height: 38px; height: 38px;
} }
::v-deep .el-input-number .el-input__inner { ::v-deep .el-input-number .el-input__inner {
......
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