Commit e3060510 by ym

config

1 parent e329f0dc
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
"env": { "env": {
"node": true "node": true
}, },
"globals": {
"AMap": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"], "extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": { "rules": {
"no-console": "off", "no-console": "off",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %> <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" /> <link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" />
<% } %> <% } %>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder"></script>
<title>微前端子应用:博客</title> <title>微前端子应用:博客</title>
</head> </head>
......
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http({
url: '/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
pictureUpload
}
\ No newline at end of file \ No newline at end of file
...@@ -25,7 +25,37 @@ const findAllDictData = params => { ...@@ -25,7 +25,37 @@ const findAllDictData = params => {
sign: true sign: true
}) })
} }
const getCarbrandTree = params => {
params.method = 'cn.com.glsx.merchants.merchantCommon.getCarbrandTree'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const findMerchantDetail = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMerchantDetail'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const saveMerchant = params => {
params.method = 'cn.com.glsx.merchants.merchant.saveMerchant'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
findMerchantByPage, findMerchantByPage,
findAllDictData findAllDictData,
getCarbrandTree,
findMerchantDetail,
saveMerchant
} }
\ No newline at end of file \ No newline at end of file
...@@ -104,6 +104,26 @@ img { ...@@ -104,6 +104,26 @@ img {
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.10); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.10);
} }
.scrm-flex {
display: flex;
}
.scrm-grid {
display: grid;
}
.scrm-flex-center {
display: flex;
align-items: center;
justify-content: center;
}
.scrm-flex-between {
display: flex;
align-items: center;
justify-content: space-between;
}
::-webkit-scrollbar { ::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width: 6px; width: 6px;
......
<template>
<div class="btn-unselect" :class="{ 'selectd-type': typeStatus }" @click="tabType">
<span class="select-type-title">{{ btnLabel }}</span
><i class="btn-icon" :class="{ 'el-icon-check': typeStatus }"></i>
</div>
</template>
<script>
export default {
name: "auto-button",
props: {
btnLabel: {
type: String,
default: "",
},
typeStatus: {
type: Boolean,
default: false,
}
},
data() {
return {
};
},
methods: {
tabType() {
this.typeStatus = !this.typeStatus;
this.$emit('getBtnStatus',this.typeStatus)
},
}
};
</script>
<style lang="scss" scoped>
.btn-unselect {
display: inline-block;
cursor: pointer;
position: relative;
height: 30px;
line-height: 30px;
margin-top: 6px;
padding-right: 30px;
cursor: pointer;
font-size: 0;
-webkit-transition: 0.1s linear;
transition: 0.1s linear;
box-sizing: border-box;
&.selectd-type {
.select-type-title {
background: #5850ff;
}
}
.select-type-title {
display: inline-block;
padding: 0 16px;
height: 100%;
font-size: 14px;
border-radius: 2px 0 0 2px;
background-color: #d2d2d2;
color: #fff;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.btn-icon {
display: inline-block;
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 28px;
line-height: 28px;
border: 1px solid #dcdfe6;
border-left: none;
border-radius: 2px 0px 0px 2px;
color: #5850ff;
font-size: 20px;
text-align: center;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="map-box" :style="{height: mapHeight+ 'px'}">
<div id="container" style="width: 100%; height: 100%"></div>
<div class="map-address">{{ address }}</div>
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%">
<el-input placeholder="请输入关键字" v-model="input" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button>
</el-input>
</div>
</div>
</template>
<script>
import AMap from "AMap";
let map, placeSearch;
export default {
name: "map",
props: {
mapHeight: {
type: Number,
default: 300
}
},
data() {
return {
input: "",
address: "",
};
},
methods: {
mapInit() {
map = new AMap.Map("container", {
resizeEnable: true,
zoom: 10,
});
AMap.service(["AMap.PlaceSearch"], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
citylimit: false, //是否强制限制在设置的城市内搜索
map: map, // 展现结果的地图实例
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: "default",
});
});
// 添加列表点选监听事件
AMap.event.addListener(map, "click", this.getAddress);
AMap.event.addListener(placeSearch, "selectChanged", this.getAddress);
},
getAddress(e) {
let self = this;
let lnglat;
if (e.type == "click") {
lnglat = e.lnglat
} else {
console.log(e.selected.data.location)
let { lng, lat } = e.selected.data.location;
lnglat = [lng, lat];
}
AMap.plugin("AMap.Geocoder", () => {
const geocoder = new AMap.Geocoder();
geocoder.getAddress(lnglat, (status, result) => {
self.address = result.regeocode.formattedAddress;
});
});
},
searchAddress() {
placeSearch.search(this.input, function (status, result) {
if (status == "complete") {
// console.log(result.poiList.pois);
}
});
},
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress();
},
},
mounted() {
this.mapInit();
}
};
</script>
<style scoped lang="scss">
.map-box {
position: relative;
width: 100%;
}
#container {
position: absolute;
height: 100%;
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
position: absolute;
line-height: 20px;
bottom: -30px;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -17,7 +17,7 @@ module.exports = { ...@@ -17,7 +17,7 @@ module.exports = {
code_message_map: {} code_message_map: {}
}, },
request: { request: {
baseURL: 'http://rop-merchant.test.glsx.com.cn', baseURL: '/api',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
...@@ -33,5 +33,8 @@ module.exports = { ...@@ -33,5 +33,8 @@ module.exports = {
}, },
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static' cdn: 'https://www.xxx.cn/static',
headers: {
sessionId: '123'
}
} }
\ No newline at end of file \ No newline at end of file
const staticRoutes = Object.freeze([ const staticRoutes = Object.freeze([{
{
name: 'home', name: 'home',
path: '/', path: '/',
meta: {}, meta: {},
component: resolve => require([`@/views/home/index.vue`], resolve) component: resolve => require([`@/views/home/index.vue`], resolve)
},
{
name: 'addAccount',
path: '/acount/addAccount',
meta: {},
component: resolve => require([`@/views/home/addAccount.vue`], resolve)
} }
]) ])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
...@@ -41,7 +41,8 @@ module.exports = { ...@@ -41,7 +41,8 @@ module.exports = {
'vue-router': 'VueRouter', 'vue-router': 'VueRouter',
'vuex': 'Vuex', 'vuex': 'Vuex',
'axios': 'axios', 'axios': 'axios',
'echarts': 'echarts' 'echarts': 'echarts',
'AMap': 'AMap'
} }
}, },
devServer: { devServer: {
...@@ -52,15 +53,17 @@ module.exports = { ...@@ -52,15 +53,17 @@ module.exports = {
headers: { headers: {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头 'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
}, },
// proxy: { proxy: {    
//     '/api': { '/api': {        
//         target: 'http://rop-merchant.test.glsx.com.cn', target: 'http://rop-merchant.test.glsx.com.cn',
//         changeOrigin: true,         
//         pathRewrite: { changeOrigin: true,
//             '^/api': '/'         
//         } pathRewrite: {            
//     } '^/api': '/'        
// }, }    
},
},
}, },
chainWebpack: config => { chainWebpack: config => {
config.plugin('html') config.plugin('html')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!