Commit 93fc69e0 by srq18211

feat:A 新增 线上推广基础信息接口

1 parent 898d8f39
......@@ -8,7 +8,7 @@
<div class="bi-mobile-base-info_content">
<div
class="bi-mobile-base-info_content_item"
v-for="(item, index) in info"
v-for="(item, index) in infoCn"
:key="index"
>
<div class="bi-mobile-base-info_content_item_label">
......@@ -24,20 +24,83 @@
<script>
import BiMobileTitle from './title.vue';
// label 字典
const fieldsDic = {
projectName: {
cn: '项目名称',
order: 1
},
fullName: {
cn: '项目参与人',
order: 2
},
industryEnterpriseName: {
cn: '发起方',
order: 3
},
enterpriseName: {
cn: '服务商',
order: 4
},
submitDt: {
cn: '提交日期',
order: 5
},
informationNum: {
cn: '咨询数',
order: 6
},
finishSum: {
cn: '本期采购量',
order: 7
},
startDt: {
cn: '任务开始时间',
order: 8
},
createDt: {
cn: '报表生成时间',
order: 9
}
};
export default {
name: 'bi-mobile-base-info',
props: {
info: {
type: Array,
default: () => []
}
},
inject: ['Bi'],
components: { BiMobileTitle },
data() {
return {
info: []
};
},
computed: {
orderInfo() {
let res = JSON.parse(JSON.stringify(this.info));
res.sort((a, b) => {
return fieldsDic[a.label].order - fieldsDic[b.label].order;
});
return res;
},
infoCn() {
return this.orderInfo.map(i => {
return {
label: fieldsDic[i.label].cn,
value: i.value
};
});
}
},
mounted() {
this.Bi.getBaseInfo()
.then(res => {
console.log(res);
const [info] = res.data.data;
for (let key in info) {
let value = info[key];
this.info.push({
label: key,
value: value
});
}
})
.catch(err => {
console.log(err);
......@@ -57,17 +120,22 @@ export default {
&_item {
font-size: 0.35rem;
color: #9d9d9d;
& > div {
display: inline-block;
display: flex;
justify-content: space-between;
&_label {
min-width: 8em;
}
&_value {
float: right;
//float: right;
color: #2d2d2d;
}
& + .bi-mobile-base-info_content_item {
margin-top: 0.5rem;
}
}
//&_item:not(last-chiled){
//border-bottom: 1px solid #000;
//}
}
}
</style>
......@@ -101,6 +101,8 @@ export default {
}
},
created() {
console.log(this.projectType)
console.log(this.getBaseInfo)
this.setFontSize();
}
};
......
......@@ -91,40 +91,6 @@ export default {
value: '2000'
}
],
baseInfo: [
{
label: '项目参与人:',
value: '张三'
},
{
label: '发起方:',
value: '葵花医疗集团'
},
{
label: '服务商:',
value: '杭州大江工作室'
},
{
label: '提交日期:',
value: '2021-05-30'
},
{
label: '可供采购量:',
value: '100'
},
{
label: '本期采购量:',
value: '20'
},
{
label: '数据收集:',
value: '20'
},
{
label: '报表成时间:',
value: '2021-05-21 22:21:12'
}
],
textData: [
[
{
......
......@@ -35,13 +35,15 @@
<script src="https://cdn.yxvzb.com/WEB/SaaS/bi/0.1.0/static/js/vue.js"></script>
<script src="https://cdn.yxvzb.com/WEB/SaaS/bi/0.1.0/static/js/qs.js"></script>
<script src="https://cdn.yxvzb.com/WEB/SaaS/bi/0.1.0/static/js/axios.js"></script>
<script src="http://192.168.199.206:8080/dist/bundler.js"></script>
<script src="http://127.0.0.1:8080/dist/bundler.js"></script>
<script>
//加参数
if (!window.location.search.length){
// const query = '?fenpeiIds=9335188&userId=2771&type=person&projectType=20&id=42&url=http://saas-cso-pc-1.jimijiayuan.cn'
const query = '?fenpeiIds=9335188&userId=2771&type=person&projectType=6&id=42&url=http://yapi.jimijiayuan.cn/mock/657'
if (window.location.search!== query){
//对应参数说明:http://bug.yxvzb.com/zentao/task-view-353.html
window.location.search = '?fenpeiIds=9335188&userId=2771&type=person&projectType=20&id=42&url=http://saas-cso-pc-1.jimijiayuan.cn'
window.location.search = query
}
/**
......@@ -66,7 +68,7 @@
return false;
};
var baseUrl = getQueryVariable('url') + '/rest/cso/saas';
var baseUrl = getQueryVariable('url') + '/rest/cso/saas/';
var service = axios.create({
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
......@@ -80,7 +82,7 @@
// 创建场景BI相关接口
var makeSceneBi = {
baseInfo: function baseInfo(data) {
return service.post(''.concat(baseUrl,'/person/base/info'),data);
return service.post(''.concat(baseUrl,'/bi/person/base/info'),data);
},
fixedInfo: function fixedInfo(data) {
return service.post(''.concat(baseUrl,'/bi/data/fixed/info'),data);
......@@ -96,7 +98,7 @@
var hgtgBi = {
baseInfo: function baseInfo(data) {
return service.post(
''.concat(baseUrl,'/bi/hgtgData/getHgtgBaseInfo'),
''.concat(baseUrl,'bi/person/base/info'),
data
);
},
......@@ -169,16 +171,16 @@
7: makeSceneAndSurvey,
6: {
getBaseInfo: function getBaseInfo(data) {
return that.addAuthToAjax(hgtgBi.baseInfo,data)();
return _this.addAuthToAjax(hgtgBi.baseInfo,data)();
},
getFixedInfo: function getFixedInfo(data) {
return that.addAuthToAjax(hgtgBi.fixedInfo,data)();
return _this.addAuthToAjax(hgtgBi.fixedInfo,data)();
},
getTopicInfo: function getTopicInfo(data) {
return that.addAuthToAjax(hgtgBi.topicInfo,data)();
return _this.addAuthToAjax(hgtgBi.topicInfo,data)();
},
getGroupInfo: function getGroupInfo(data) {
return that.addAuthToAjax(hgtgBi.groupInfo,data)();
return _this.addAuthToAjax(hgtgBi.groupInfo,data)();
}
}
}[this.projectType];
......
......@@ -61,13 +61,16 @@ module.exports = {
extensions: ['*', '.js', '.vue', '.json']
},
devServer: {
host: '0.0.0.0',
host: '127.0.0.1',
historyApiFallback: true,
noInfo: true,
overlay: true,
proxy: {
'/relaCustomer': {
target: 'http://172.28.61.8:8888/'
},
'/api':{
target: 'http://saas-cso-pc-1.jimijiayuan.cn'
}
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!