Merge remote-tracking branch 'origin/init' into init

init
zhusiyu 3 years ago
commit 977e6b5081

@ -0,0 +1,78 @@
/*
* 数据中心接口调用
* */
import axios from 'axios'
const querystring = require('querystring');
import {Modal} from 'ant-design-vue';
// function getContextHtmlPath (){//获取桶名信息
// let pathName = document.location.pathname;
// let index = pathName.substr(1).indexOf("/");
// let result = pathName.substr(0, index + 1);
// if (result != "/dsideal_yy") {
// result = pathName.substr(0, 0);
// }
// console.log("result:",result)
// return result;
// }
// axios.defaults.baseURL = getContextHtmlPath();
// function createRandomNum(){
// let random_num = 0;
// for(let i=0;i<6;i++) {
// random_num+=Math.floor(Math.random()*100000);
// }
// return random_num;
// }
let interUrl = "http://10.10.14.186:9009/dataex/report/QuerySimpleGP";
export default {
/*
* interfaceConfigAry[{
* urlstring 接口地址 从dsideal_yy/(ypt/) 开始的接口地址
* methodstring 掉用方法 "get" "post"
* params:{} 参数
* isTestLogin 是否检测登录状态(是否加"ypt/")
* isOfficeInterface 是否是办公的接口 弹出提示的时候用来判断接口结构 默认为true
* }]
* callBack:(result)=>{}回调方法 result为返回值数组
*
* */
callInterface:(interfaceConfigAry=[],callBack=null,)=>{
console.log("开始调用接口")
//let randomCount = createRandomNum();
if (interfaceConfigAry && Array.isArray(interfaceConfigAry) && interfaceConfigAry.length > 0){
let ary = [];
interfaceConfigAry.forEach((interfaceConfig)=>{
if (interfaceConfig.method === "get"){
ary.push(axios.get(interUrl,{params:interfaceConfig.params}))
}else{
ary.push(axios.post(interUrl,interfaceConfig.params))
}
});
axios.all(ary)
.then(axios.spread(function (res){
let success = true;
for(let i = 0;i < interfaceConfigAry.length; i++){
//let item = interfaceConfigAry[i];
let result = arguments[i].data;
if (!result.success){
Modal.warning({
title:"接口调用错误",
content:result.message,
centered:true
})
success = result.success;
break;
}
}
if (success && callBack){
callBack(arguments)
}
}))
.catch(function(error){
console.log("接口调用失败status"+error.response.status);
})
}
}
}

@ -2,6 +2,7 @@ import Vue from 'vue'
import cookie from '../global-llibs/cookie'
import baseConfig from '../global-llibs/base-config'
import interfaceConfig from '../global-llibs/axios-config'
import dataexReportInterface from '../global-llibs/dataex-report-axios'
import Common from './common';
import TypesCheck from '../global-llibs/under-score/types-check';
import Base64 from '../global-llibs/base64';
@ -10,6 +11,7 @@ import StaticParams from '../global-llibs/staticParams'
Vue.prototype.Cookie = cookie
Vue.prototype.BaseConfig = baseConfig
Vue.prototype.InterfaceConfig = interfaceConfig
Vue.prototype.DataexReportInterface = dataexReportInterface
Vue.prototype.Common = Common
Vue.prototype.TypesCheck = TypesCheck
Vue.prototype.Base64 = Base64

@ -1,56 +1,70 @@
<template>
<CommonBox title="品牌创建" class="party-center-brand-creation-style">
<div class="brandCreat">
<a-spin class="brandCreat" :spinning="spinning">
<a-row type="flex" justify="space-between" style="margin-bottom: 13px;">
<a-col style="width: 48.8%;">
<img src="./images/topBigPic1.png" class="rowImg">
<a-col style="width: 48.8%;height: 160px">
<!--<img src="./images/topBigPic1.png" class="rowImg" style="width: 100%;height: 100%">-->
<img :src="getImgURL(imgList[0])" class="rowImg" style="width: 100%;height: 100%" @click="previewData(imgList[0])">
</a-col>
<a-col style="width: 48.8%;">
<img src="./images/topBigPic2.png" class="rowImg">
<a-col style="width: 48.8%;height: 160px">
<!--<img src="./images/topBigPic2.png" class="rowImg" style="width: 100%;height: 100%">-->
<img :src="getImgURL(imgList[1])" class="rowImg" style="width: 100%;height: 100%">
</a-col>
</a-row>
<a-row type="flex" justify="space-between" style="margin-bottom: 30px;">
<a-col style="width: 23.1%">
<img src="./images/topSmallPic1.png" class="rowImg">
<a-row type="flex" justify="space-between" style="margin-bottom: 25px;">
<a-col style="width: 23.1%;height: 85px">
<!--<img src="./images/topSmallPic1.png" class="rowImg">-->
<img :src="getImgURL(imgList[2])" class="rowImg" style="width: 100%;height: 100%">
</a-col>
<a-col style="width: 23.1%">
<img src="./images/topSmallPic2.png" class="rowImg">
<a-col style="width: 23.1%;height: 85px">
<!--<img src="./images/topSmallPic2.png" class="rowImg">-->
<img :src="getImgURL(imgList[3])" class="rowImg" style="width: 100%;height: 100%">
</a-col>
<a-col style="width: 23.1%">
<img src="./images/topSmallPic3.png" class="rowImg">
<a-col style="width: 23.1%;height: 85px">
<!--<img src="./images/topSmallPic3.png" class="rowImg">-->
<img :src="getImgURL(imgList[4])" class="rowImg" style="width: 100%;height: 100%">
</a-col>
<a-col style="width: 23.1%">
<img src="./images/topSmallPic4.png" class="rowImg">
<a-col style="width: 23.1%;height: 85px">
<!--<img src="./images/topSmallPic4.png" class="rowImg">-->
<img :src="getImgURL(imgList[5])" class="rowImg" style="width: 100%;height: 100%">
</a-col>
</a-row>
<div class="brandList">
<vue-scroll :ops="listScroll" :style="showPage?'height:35rem':'height:35rem'" class="score-list-div">
<a-list item-layout="horizontal" :data-source="brandList">
<a-list item-layout="horizontal" :data-source="dataList">
<a-list-item slot="renderItem" slot-scope="item" class="listItem">
<a-avatar :src="item.avatar"/>
<a-avatar :src="getImgURL(item.imgObj)"/>
<p class="p1">
<span style="width: 7px;height: 7px;border-radius: 50%;background: #fff;margin-left: -5px;display: inline-block;"></span>
{{item.title}}</p>
{{item.info_title}}</p>
<br>
<p class="p2">{{item.time}}</p>
<p class="p2">{{item.create_time}}</p>
</a-list-item>
</a-list>
</vue-scroll>
</div>
</div>
</a-spin>
</CommonBox>
</template>
<script>
/*
* 品牌创建
* */
import {List, Icon, Avatar, Row, Col, Modal} from 'ant-design-vue';
import {List, Icon, Avatar, Row, Col, Modal,Spin} from 'ant-design-vue';
import CommonBox from '../secondPages/commonBox.vue';
import axios from 'axios';
const querystring = require('querystring');
import Upload from '../../../../components/common/uploader/Upload.vue';
import PreviewBox from '../../../../components/common/preview/PreviewBox';
import PreviewManager from '../../../../components/common/preview/previewManager';
export default{
data(){
return {
spinning:false,
listScroll: this.StaticParams.scrollOption,
showPage: true,
imgList: [],
dataList:[],
brandList: [
{
avatar: require("./images/listPic1.png"),
@ -106,6 +120,72 @@
modalTitle: '查看详情',
}
},
mounted(){
this.getDataexReport();
},
methods: {
getDataexReport: function () {
let url = "http://10.10.14.186:9009/dataex/report/QuerySimpleGP";
let param = {
"access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab",
"query": {
"query_id": "query_dangjian_pinpai",
"query_param": [
this.BaseConfig.person_info_my.bureau_id + ""
]
},
"query_cache": 0,
"query_count": [],
"query_format": "json",
"query_group": []
}
this.spinning = true;
this.DataexReportInterface.callInterface([{
params: param,
method: "post",
}], (result) => {
this.spinning = false;
if (result[0].data.success) {
this.dataList = [];
this.imgList = [];
let dataList = JSON.parse(result[0].data.result);
//console.log("dataList:", dataList)
for (let i = 0, len = dataList.length; i < len; i++) {
let item = dataList[i];
let coverJson = JSON.parse(item.cover_json);
let info = {
info_title:item.info_title,
create_time:item.create_time.replace('T',' ').replace('Z',''),
}
if (coverJson && coverJson.length > 0) {
info.imgObj = coverJson[0];
for (let j = 0, jLen = coverJson.length; j < jLen; j++) {
if (this.imgList.length === 6) {
break;
}
this.imgList.push(coverJson[j])
}
}
if (this.dataList.length === 6) {
break;
}
this.dataList.push(info);
}
console.log("imgList:",this.imgList);
console.log("dataList:",this.dataList);
}
})
},
getImgURL:function (img) {
if(img){
return this.BaseConfig.url_path_down + img.key;
}
},
previewData: function (item) {
console.log("item",item)
PreviewManager.analysisPreview(item,this.$refs.previewBox)
},
},
components: {
CommonBox,
ARow: Row,
@ -115,9 +195,9 @@
AAvatar: Avatar,
AIcon: Icon,
AModal: Modal,
ASpin:Spin,
Upload
},
methods: {
}
}
</script>
<style scoped lang="scss" type="text/scss">
@ -132,10 +212,11 @@
}
.rowImg {
width: 100%;
border-radius: 5px;
}
.brandList {
width: 100%;
height: 600px;
height: 560px;
.score-list-div {
width: 100%;
height: 23rem;

@ -80,7 +80,6 @@
.party-center-team-help-style {
width: 605px !important;
height: 400px !important;
.teamBoost {
width: 100%;
height: 100%;

Loading…
Cancel
Save