Commit 99315757 authored by xinzhedeai's avatar xinzhedeai

Merge branch 'master' into dp

parents 9e36f7cf 0d604452
var ServiceURL = 'http://192.168.3.216:9002';
// var ServiceURL = 'http://192.168.3.216:9002';
// var ServiceURL = 'http://192.168.3.250:9103';
var ServiceURL = 'http://gqfhq.gemho.cn:9103';
window.VUE_APP_API = {ServiceURL:ServiceURL}
......@@ -490,7 +490,7 @@ var reqApis = function(){
baseInfo: {
// "incubatorId": {name:"孵化器名称", must:true, 'type':'select', val:'id', key:'name',},
"year": {
name:"年度", must:true, 'type':'date', 'datetype':'year','format':'yyyy',
name:"年度", must:true, 'type':'date', 'datetype':'year','format':'yyyy'
},
"totalRevenue": {name:"孵化器总收入(万元)", must:true },
"serviceRevenue": {name:"综合服务收入(万元)", },
......@@ -539,11 +539,11 @@ var reqApis = function(){
rightBtn: [
],
search: [
{
'type': 'string', 'name': '孵化器名称', 'word': 'incubatorName', 'mode': 0, 'width': '180px', 'clear': function () {
this.loadData()
}
},
// {
// 'type': 'string', 'name': '孵化器名称', 'word': 'incubatorName', 'mode': 0, 'width': '180px', 'clear': function () {
// this.loadData()
// }
// },
{
'type': 'date', 'datetype':'year','defaultTime': ['2024'], 'name': '年度', 'word': 'year', 'mode': 0, 'width':'140px',
'change': function(a, b){
......@@ -639,13 +639,13 @@ var reqApis = function(){
},
},
},
"longitude": {name:"经度", must:true, table:0, form:0 },
"latitude": {name:"纬度", must:true, table:0, form:0 },
// "longitude": {name:"经度", must:true, table:0, form:0 },
// "latitude": {name:"纬度", must:true, table:0, form:0 },
"mentorId": {name:"创业导师", table:0, 'type':'select', key:'name',},
"occupiedArea": {name:"占用孵化场地面积", table:0 },
"principal": {name:"企业负责人", must:true },
"contactPhone": {name:"联系方式", must:true },
"intellectualProperty": {name:"知识产权", table:0, 'type':'select', key:'name',},
// "intellectualProperty": {name:"知识产权", table:0, 'type':'select', key:'name',},
"totalFunding": {name:"累计获得融资总额(万元)", table:0},
"incubationStatus": {name:"企业孵化状态", 'type':'select',
change: function (val){
......@@ -1048,6 +1048,17 @@ var reqApis = function(){
],
},
request: function (type, param) {
var searchParam = new URLSearchParams(window.location.search);
var companyId = searchParam.get('companyId');
if(companyId){
if(param.exact){ // 有exact则直接追加companyId 没有则新增值
param.exact.companyId = companyId
}else{
param.exact = {
companyId
}
}
}
return reqPublic('api/companyProduct', type, param)
},
upload: function (data) {
......@@ -1122,6 +1133,18 @@ var reqApis = function(){
],
},
request: function (type, param) {
var searchParam = new URLSearchParams(window.location.search);
var companyId = searchParam.get('companyId');
if(companyId){
if(param.exact){ // 有exact则直接追加companyId 没有则新增值
param.exact.companyId = companyId
}else{
param.exact = {
companyId
}
}
}
return reqPublic('api/companyAnnualInfo', type, param)
},
},
......
......@@ -54,20 +54,35 @@ export const constantRouterMap = [
]
},
// {
// path: "/home/enterprise",
// path: "/home",
// //component: Layout,
// component: HomeLayout,
// redirect: "noredirect",
// hidden:true,
// hidden:false,
// children: [
// {
// path: "center",
// path: "enterprise",
// component: resolve => require(["@/views/system/home/enterprise"], resolve),
// name: "首页-企业",
// meta: { title: "首页", affix:true }
// meta: { title: "首页", affix:true , icon: "index"}
// }
// ]
// },
{
path: "/home",
//component: Layout,
component: HomeLayout,
redirect: "noredirect",
hidden:false,
children: [
{
path: "tech",
component: resolve => require(["@/views/system/home/tech"], resolve),
name: "首页-科技局",
meta: { title: "首页", affix:true , icon: "index"}
}
]
},
{
path: "/edge/Screen",
component: (resolve) => {
......
......@@ -28,7 +28,7 @@
</ul>
</div> -->
<div class="go-back">
<a href="/business/incubator">进入后台</a>
<a href="/home/enterprise">进入后台</a>
</div>
</header>
</div>
......
......@@ -125,7 +125,7 @@
<el-tab-pane label="企业基本信息" name="0">
<div class="rel-flex">
<div class="scrolling4">
<div v-for="(item, key) in Dict.baseInfo" style="">
<div v-for="(item, key) in Dict.baseInfo" style="" :class="{'isHide': item.mode===7, [key]: item.mode===7}">
<div class="item">
<span class="name">{{ item.name }}</span>
<template v-if="item.type === 'select'">
......@@ -261,7 +261,49 @@ export default {
});
},
watch: {
'basicActv':{
handler(newValue) {
// console.log('模态框显隐!!!', this.catchItem['isHighGrowthInnovative'])
setTimeout(()=>{ // 用于详情弹窗显隐处理
[{
key: 'isHighGrowthInnovative', // 主元素
subKey: 'highGrowthInnovativeDate' // 子元素(随着主元素值改变而显隐处理)
},
{
key: 'isHighTech',
subKey: 'highTechDate'
},
{
key: 'isAdvancedTechService',
subKey: 'advancedTechServiceDate'
},
{
key: 'isSpecializedSpecialEnterprises',
subKey: 'specializedSpecialEnterprisesDate'
},
{
key: 'isTechSme',
subKey: 'techSmeDate'
},
{
key: 'isLittleGiant',
subKey: 'littleGiantDate'
},
{
key: 'isGazelle',
subKey: 'gazelleDate'
}
].forEach((item, index)=>{
this.toggleDateElement(item.subKey, this.catchItem[item.key]);
})
// this.toggleDateElement("highGrowthInnovativeDate", this.form.item.isHighGrowthInnovative);
},1000)
},
immediate: true // 立即调用处理函数
},
// "form.item.isHighGrowthInnovative"(newVal, oldVal) {
// this.toggleDateElement("highGrowthInnovativeDate");
// },
......@@ -350,16 +392,21 @@ export default {
this.dialogVisible = false;
},
toggleDateElement(targetEleClass, flag) {
// console.log(targetEleClass, flag, '切换样式')
const elements = document.getElementsByClassName(targetEleClass);
// console.log(elements)
if (elements.length) {
const element = elements[0];
for (let i = 0; i < elements.length; i++) {
const element = elements[i];
flag ? element.classList.remove("isHide") : element.classList.add("isHide");
}
// console.log('值改变了,日期切换', element.classList,element.classList.contains("isHide"))
// if (element.classList.contains("isHide")) {
// element.classList.remove("isHide"); // 移除 'hidden' 类
// } else {
// element.classList.add("isHide");
// }
flag ? element.classList.remove("isHide") : element.classList.add("isHide");
}
},
......@@ -471,6 +518,9 @@ export default {
};
</script>
<style rel="stylesheet/scss" lang="scss" scope>
.isHide{
display: none !important;
}
.p-head {
position: absolute;
height: 100%;
......
......@@ -27,7 +27,12 @@
style="width: 320px"
size="middle"
>
<el-option :label="item.name" :value="item.value" v-for="item in companyLevelList" :key="item.name"></el-option>
<el-option
:label="item.name"
:value="item.value"
v-for="item in companyLevelList"
:key="item.name"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="联系人">
......@@ -63,7 +68,7 @@
</el-row>
<el-row>
<el-form-item label="剩余企业孵化的面积(m²)">
{{ remainingArea }}
{{ formInline.remainingArea }}
</el-form-item>
</el-row>
<el-row>
......@@ -140,7 +145,6 @@ import crudOperation from "@crud/CRUD.operation";
import udOperation from "@crud/UD.operation";
import DateRangePicker from "@/components/DateRangePicker";
import dic from "@/api/system/dict";
import cuAmap from "@/components/AMap";
......@@ -216,16 +220,16 @@ export default {
};
},
computed: {
remainingArea() {
return this.formInline.totalArea - this.formInline.incubationArea;
},
// remainingArea() {
// return this.formInline.totalArea - this.formInline.incubationArea;
// },
},
mounted() {
// this.getData();
dic.getCompanyDicts().then((res) => {
console.log(res)
this.companyLevelList = res.body.companyLevel || []
});
console.log(res);
this.companyLevelList = res.body.incubatorLevel || [];
});
},
methods: {
handleSuccess(response, file) {
......@@ -273,67 +277,102 @@ export default {
//showLabel: true,
//pitch: 40,
onload: function (cmap) {
// debugger
VUE.cmap = cmap;
var center = cmap.options.center;
var lng = form.longitude || center[0],
lat = form.latitude || center[1];
if (lng && lat) {
cmap.setCenter([lng, lat]);
// debugger
VUE.cmap = cmap;
var center = cmap.options.center;
var lng = form.longitude || center[0],
lat = form.latitude || center[1];
if (lng && lat) {
cmap.setCenter([lng, lat]);
// 添加标记
cmap.addMarker({
lnglat: [lng, lat],
title: "",
draggable: true,
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;
self.$forceUpdate();
});
},
});
}
VUE.getData(function () {});
// 添加标记
cmap.addMarker({
lnglat: [lng, lat],
title: "",
draggable: true,
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;
// self.$forceUpdate();
// });
VUE.getAddrPlus(e, cmap)
},
});
}
VUE.getData(function () {});
},
click: function (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;
});
// 经纬度坐标
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.addMarker({
lnglat: [lnglat.lng, lnglat.lat],
lnglat: [e.lnglat.lng, e.lnglat.lat],
title: "",
draggable: true,
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;
});
// 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);
},
});
},
};
},
getAddrPlus(e, cmap, form) {
var lnglat = e.lnglat;
let longitude = lnglat.lng;
let latitude = lnglat.lat;
// 创建逆地理编码对象
let geocoder;
AMap.plugin("AMap.Geocoder", () => {
geocoder = new AMap.Geocoder({
radius: 1000,
extensions: "all",
});
console.log();
// 根据经纬度进行逆地理编码查询
geocoder.getAddress([longitude, latitude], (status, result) => {
if (status === "complete" && result.info === "OK") {
if (result.regeocode && result.regeocode.formattedAddress) {
let address = result.regeocode.formattedAddress;
this.formInline.address = address;
this.formInline.longitude = longitude;
this.formInline.latitude = latitude;
this.$forceUpdate();
console.log("精确地址获取", address);
}
} else {
console.error("获取地址失败");
}
});
});
},
onSubmit() {
console.log("submit!");
},
edit() {
crudHome.edit(this.formInline).then((res) => {
if (res && res.code === 200) {
this.$message.success('保存成功'); // res.msg
this.$message.success("保存成功"); // res.msg
this.getData()
}
});
},
......@@ -341,22 +380,19 @@ export default {
crudHome.getData().then((res) => {
this.formInline = res.body;
this.formInline.incubatorImage = res.body.incubatorImage;
const lat = this.formInline.latitude
const lng = this.formInline.longitude
const lat = this.formInline.latitude;
const lng = this.formInline.longitude;
// this.$refs.amap.init(amapOptions());
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)
);
// 定位中心地址
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()
fn && fn();
});
},
// 选中图标
......@@ -372,7 +408,7 @@ export default {
} */
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
.app-container{
.app-container {
background-color: #f5f6fb;
}
.header {
......@@ -416,7 +452,7 @@ export default {
}
}
}
::v-deep .el-input {
::v-deep .el-input {
width: 320px;
}
::v-deep .el-input__inner {
......
<template>
<div class="app-container">
<div class="header">
<ul>
<li>
<div class="title">孵化器</div>
<div class="content">8家</div>
</li>
<li>
<div class="title">在孵企业</div>
<div class="content">8家</div>
</li>
<li>
<div class="title">毕业企业</div>
<div class="content">8家</div>
</li>
<li>
<div class="title">中介机构</div>
<div class="content">8家</div>
</li>
<li>
<div class="title">创业导师</div>
<div class="content">8家</div>
</li>
<li>
<div class="title">孵化面积</div>
<div class="content">8家</div>
</li>
<li>
<div class="title">剩余孵化面积</div>
<div class="content">8家</div>
</li>
<li>
<div class="title" @click="dialogVisible = true">新增孵化器</div>
</li>
</ul>
</div>
<div class="body">
<ul class="list">
<li>
<img src="https://dummyimage.com/360x442" alt="" />
<div class="introduce">
<h2>威海高新区创业中心</h2>
<p>运营机构:威海高新创业园运营管理有限公司</p>
<p>联系人:联系人姓名</p>
<p>联系电话:0631-1234567</p>
<p>剩余孵化面积:0123m2</p>
</div>
</li>
<li>
<img src="https://dummyimage.com/360x442" alt="" />
<div class="introduce">
<h2>威海高新区创业中心</h2>
<p>运营机构:威海高新创业园运营管理有限公司</p>
<p>联系人:联系人姓名</p>
<p>联系电话:0631-1234567</p>
<p>剩余孵化面积:0123m2</p>
</div>
</li>
<li>
<img src="https://dummyimage.com/360x442" alt="" />
<div class="introduce">
<h2>威海高新区创业中心</h2>
<p>运营机构:威海高新创业园运营管理有限公司</p>
<p>联系人:联系人姓名</p>
<p>联系电话:0631-1234567</p>
<p>剩余孵化面积:0123m2</p>
</div>
</li>
<li>
<img src="https://dummyimage.com/360x442" alt="" />
<div class="introduce">
<h2>威海高新区创业中心</h2>
<p>运营机构:威海高新创业园运营管理有限公司</p>
<p>联系人:联系人姓名</p>
<p>联系电话:0631-1234567</p>
<p>剩余孵化面积:0123m2</p>
</div>
</li>
<li>
<img src="https://dummyimage.com/360x442" alt="" />
<div class="introduce">
<h2>威海高新区创业中心</h2>
<p>运营机构:威海高新创业园运营管理有限公司</p>
<p>联系人:联系人姓名</p>
<p>联系电话:0631-1234567</p>
<p>剩余孵化面积:0123m2</p>
</div>
</li>
<li>
<img src="https://dummyimage.com/360x442" alt="" />
<div class="introduce">
<h2>威海高新区创业中心</h2>
<p>运营机构:威海高新创业园运营管理有限公司</p>
<p>联系人:联系人姓名</p>
<p>联系电话:0631-1234567</p>
<p>剩余孵化面积:0123m2</p>
</div>
</li>
<li>
<img src="https://dummyimage.com/360x442" alt="" />
<div class="introduce">
<h2>威海高新区创业中心</h2>
<p>运营机构:威海高新创业园运营管理有限公司</p>
<p>联系人:联系人姓名</p>
<p>联系电话:0631-1234567</p>
<p>剩余孵化面积:0123m2</p>
</div>
</li>
</ul>
</div>
<el-dialog
title="新增孵化器信息"
:visible.sync="dialogVisible"
@close="resetForm"
>
<el-form
label-width="170px"
:inline="true"
:model="formInline"
class="demo-form-inline"
:label-position="labelPosition"
>
<el-row>
<el-form-item label="孵化器名称">
<el-input
v-model="formInline.incubatorName"
placeholder=""
size="middle"
></el-input>
</el-form-item>
<el-form-item label="运行机构">
<el-input
v-model="formInline.operatingAgency"
placeholder=""
size="middle"
></el-input>
</el-form-item>
<el-form-item label="孵化器等级">
<el-select
v-model="formInline.incubatorLevel"
style="width: 200px"
size="middle"
>
<el-option
:label="item.name"
:value="item.value"
v-for="item in companyLevelList"
:key="item.name"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="联系人">
<el-input
v-model="formInline.contactPerson"
placeholder=""
size="middle"
></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="联系电话">
<el-input
v-model="formInline.contactPhone"
placeholder=""
size="middle"
></el-input>
</el-form-item>
<el-form-item label="孵化器使用总面积(m²)">
<el-input
v-model="formInline.totalArea"
placeholder=""
size="middle"
></el-input>
</el-form-item>
<el-form-item label="用于企业孵化的面积(m²)">
<el-input
v-model="formInline.incubationArea"
placeholder=""
size="middle"
></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="孵化器地理位置">
<el-input
v-model="formInline.address"
placeholder=""
size="small"
style="width: 360px"
disabled
></el-input>
<div class="map-ctn" :style="'width:500px;' + 'height:300px' + ';'">
<cu-amap ref="amap" :options="amapOptions()" />
</div>
</el-form-item>
<el-form-item style="margin-left: 80px">
<el-upload
class="upload-demo"
:action="`${baseAPI}api/file/upload?modelName=incubator`"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:on-success="handleSuccess"
:on-error="handleError"
:limit="1"
:on-exceed="handleExceed"
:file-list="fileList"
:show-file-list="false"
style="margin-bottom: 6px"
>
<span
style="margin-right: 5px; margin-left: -17px; font-weight: bold"
>孵化器图片</span
>
<el-button size="mini" type="default">上传图片</el-button>
</el-upload>
<div :style="'width:500px;' + 'height:300px' + ';'">
<div class="imgShowraper">
<img
:src="`${baseAPI}file/${formInline.incubatorImage}`"
alt=""
width="500"
height="300px"
/>
</div>
</div>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="edit">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
var baseAPI =
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 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 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 {
name: "Menu",
components: {
cuAmap,
Treeselect,
IconSelect,
crudOperation,
rrOperation,
udOperation,
DateRangePicker,
},
cruds() {
return CRUD({
title: "菜单",
url: "api/menus",
crudMethod: { ...crudHome },
});
},
mixins: [presenter(), header(), form(defaultForm), crud()],
data() {
return {
dialogVisible: false,
baseAPI: baseAPI,
labelPosition: "right",
fileList: [],
cmap: null,
Dict: { selectList: [] },
formInline: {
address: "",
contactPerson: "",
contactPhone: "",
id: "",
incubationArea: "",
incubatorImage: "",
incubatorLevel: "",
incubatorName: "",
latitude: "",
longitude: "",
operatingAgency: "",
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: {
// remainingArea() {
// return this.formInline.totalArea - this.formInline.incubationArea;
// },
},
mounted() {
// this.getData();
dic.getCompanyDicts().then((res) => {
console.log(res);
this.companyLevelList = res.body.incubatorLevel || [];
});
},
methods: {
handleSuccess(response, file) {
// 处理上传成功
console.log("Upload success:", response, file);
this.formInline.incubatorImage = response.body;
// this.fileList.push(file); // 存储已上传文件
// this.tableData.push({
// name: file.name,
// status: '上传成功',
// });
},
handleError(err, file) {
// 处理上传错误
console.error("Upload failed:", err, file);
this.tableData.push({
name: file.name,
status: "上传失败",
});
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`);
},
amapOptions(cmap) {
var VUE = this;
var self = this,
form = this.formInline;
return {
zoom: 12,
center: [122.050189, 37.515189],
//showLabel: true,
//pitch: 40,
onload: function (cmap) {
// debugger
VUE.cmap = cmap;
var center = cmap.options.center;
var lng = form.longitude || center[0],
lat = form.latitude || center[1];
if (lng && lat) {
cmap.setCenter([lng, lat]);
// 添加标记
cmap.addMarker({
lnglat: [lng, lat],
title: "",
draggable: true,
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;
// self.$forceUpdate();
// });
VUE.getAddrPlus(e, cmap);
},
});
}
VUE.getData(function () {});
},
click: function (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.addMarker({
lnglat: [e.lnglat.lng, e.lnglat.lat],
title: "",
draggable: true,
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);
},
});
},
};
},
getAddrPlus(e, cmap, form) {
var lnglat = e.lnglat;
let longitude = lnglat.lng;
let latitude = lnglat.lat;
// 创建逆地理编码对象
let geocoder;
AMap.plugin("AMap.Geocoder", () => {
geocoder = new AMap.Geocoder({
radius: 1000,
extensions: "all",
});
console.log();
// 根据经纬度进行逆地理编码查询
geocoder.getAddress([longitude, latitude], (status, result) => {
if (status === "complete" && result.info === "OK") {
if (result.regeocode && result.regeocode.formattedAddress) {
let address = result.regeocode.formattedAddress;
this.formInline.address = address;
this.formInline.longitude = longitude;
this.formInline.latitude = latitude;
this.$forceUpdate();
console.log("精确地址获取", address);
}
} else {
console.error("获取地址失败");
}
});
});
},
onSubmit() {
console.log("submit!");
},
edit() {
crudHome.edit(this.formInline).then((res) => {
if (res && res.code === 200) {
this.$message.success("保存成功"); // res.msg
this.getData();
}
});
},
getData(fn) {
crudHome.getData().then((res) => {
this.formInline = res.body;
this.formInline.incubatorImage = res.body.incubatorImage;
const lat = this.formInline.latitude;
const lng = this.formInline.longitude;
// this.$refs.amap.init(amapOptions());
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) {
this.form.icon = name;
},
},
};
</script>
<style>
/* .app-main {
background-color: #fff !important;
} */
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
.app-container {
background-color: #f0f2f5;
font-family: Microsoft YaHei;
}
.header {
padding: 20px;
background: #fff;
ul {
display: flex;
justify-content: center;
height: 120px;
align-items: center;
border: 1px solid #d8dce5;
background-color: #fff;
li {
display: flex;
align-items: center;
flex-direction: column;
list-style: none;
flex: 1;
justify-content: center;
border-left: 1px solid #d8dce5;
height: 70px;
&:nth-child(2) {
.title {
background-image: url("~@/assets/images/iconNew/zfqy.png");
}
}
&:nth-child(3) {
.title {
background-image: url("~@/assets/images/iconNew/byqy.png");
}
}
&:nth-child(4) {
.title {
background-image: url("~@/assets/images/iconNew/zjjg.png");
}
}
&:nth-child(5) {
.title {
background-image: url("~@/assets/images/iconNew/cyds.png");
}
}
&:nth-child(6) {
.title {
background-image: url("~@/assets/images/iconNew/fhmj.png");
}
}
&:nth-child(7) {
.title {
background-image: url("~@/assets/images/iconNew/fhmj.png");
}
}
&:nth-child(8) {
.title {
background-image: url("~@/assets/images/iconNew/addfhq.png");
cursor: pointer;
}
}
.title {
background: no-repeat url("~@/assets/images/iconNew/fhq.png");
font-size: 17px;
color: #1890ff;
padding-top: 18px;
padding-bottom: 18px;
background-position: 0px 15px;
padding-left: 35px;
background-size: 29px;
}
.content {
font-size: 24px;
color: #303133;
}
}
}
}
.imgShowraper {
margin-left: 90px;
}
.list {
// ul元素
background: #f5f6fb;
display: flex;
flex-wrap: wrap;
padding-top: 18px;
padding-left: 80px;
// justify-content: center;
li {
width: 360px;
background: #ffffff;
border-radius: 10px;
margin-left: 23px;
margin-right: 23px;
margin-bottom: 16px;
position: relative;
.introduce {
padding: 20px;
border-radius: 10px;
position: absolute;
bottom: 0px;
background: #fff;
width: 100%;
padding-bottom: 10px;
}
img {
width: 100%;
height: 442px;
border-radius: 10px;
}
h2 {
text-align: center;
padding-top: 4px;
padding-bottom: 12px;
font-weight: bold;
}
p {
padding-top: 8px;
padding-bottom: 8px;
font-weight: bold;
font-size: 15px;
color: #666666;
}
}
}
.body {
background-color: #fff;
.title {
color: #1890ff;
height: 48px;
background: #e4f2ff;
font-weight: 400;
font-size: 16px;
line-height: 48px;
margin-bottom: 20px;
i {
width: 4px;
height: 16px;
background: #1890ff;
margin-right: 6px;
display: inline-block;
vertical-align: -2px;
margin-left: 18px;
}
}
}
::v-deep .el-input {
width: 200px;
}
::v-deep .el-input__inner {
height: 38px;
}
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
......@@ -61,7 +61,7 @@
</div>
<!--表单渲染-->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="570px">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="66px">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="用户名" prop="username">
<el-input v-model="form.username" />
</el-form-item>
......@@ -83,7 +83,7 @@
placeholder="选择部门"
/>
</el-form-item>
<el-form-item label="岗位" prop="jobs" class="is-required">
<el-form-item label="用户类型" prop="jobs" class="is-required">
<el-select
v-model="jobDatas"
style="width:178px"
......@@ -336,7 +336,7 @@ export default {
this.jobDatas = ''
this.roleDatas = []
},
// 初始化编辑时候的角色与岗位
// 初始化编辑时候的角色与用户类型
[CRUD.HOOK.beforeToEdit](crud, form) {
this.getJobs(this.form.dept.id)
this.jobDatas = ''
......@@ -370,7 +370,7 @@ export default {
return false
} else if (!this.jobDatas) {
this.$message({
message: '岗位不能为空',
message: '用户类型不能为空',
type: 'warning'
})
return false
......@@ -483,7 +483,7 @@ export default {
this.roles = res
}).catch(() => { })
},
// 获取弹窗内岗位数据
// 获取弹窗内用户类型数据
getJobs() {
getAllJob().then(res => {
this.jobs = res.content
......
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