Commit 8a3923ce authored by 王晓旭's avatar 王晓旭

修改业务数据分析,搜索为模糊提示搜索

No related merge requests found
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -60,4 +60,8 @@ export function productLlist(params) {
// 热力图对应的页面
export function pageLlist(params) {
return http.post(`${baseURL}/zwfw/page/info/list`, params);
}
\ No newline at end of file
}
// 通过业务名查询列表
export function userSiteBus(params) {
return http.get(`${BASEURL}/inter/statistic/busIdForName`, params);
}
......@@ -98,7 +98,7 @@ import {getBusInfoById} from '@/api/dataActuary.js'
],
lineData: {},
useNumber: '0',
checkName: '',
checkId: '',
formState: {},
testWay:[]
}
......@@ -110,14 +110,14 @@ import {getBusInfoById} from '@/api/dataActuary.js'
'$route.query': {
immediate: true,
handler(newVal, oldVal){
this.checkName= newVal.name
this.checkId= newVal.id
this.getAnalysisData()
}
}
},
methods: {
async getAnalysisData() {
const res = await getBusInfoById({bus_name: this.checkName, selected: this.useNumber || 0 })
const res = await getBusInfoById({busid: this.checkId, siteid: localStorage.getItem('siteId') })
if(res.code == 1){
if (res.data.phone) this.testWay.push('手机号')
if (res.data.idcardtake) this.testWay.push('身份证')
......
<template>
<div class="Container">
<div class="main">
<div class="first_card">
<div class="breadMenu">
<Breadcrumb/>
<div class="main">
<div class="first_card">
<div class="breadMenu">
<Breadcrumb/>
</div>
<div class="searchBox">
<a-auto-complete
v-model="businessName"
:data-source="dataSource"
optionLabelProp="value"
style="width: 35.625rem"
placeholder="请输入业务名称搜索"
@select="onSelect"
@search="onSearch"
/>
<a-button type="primary" class="addclass" v-if="!btnShow" @click="startAnalysis">开始分析</a-button>
<a-button type="primary" class="addclass" v-else @click="backBase">返回</a-button>
</div>
</div>
<div class="searchBox">
<a-auto-complete
v-model="businessName"
:data-source="dataSource"
optionLabelProp="value"
style="width: 35.625rem"
placeholder="请输入业务名称搜索"
@select="onSelect"
@search="onSearch"
/>
<a-button type="primary" class="addclass" @click="startAnalysis">开始分析</a-button>
<a-button type="primary" class="addclass" v-if="btnShow" @click="backBase">返回</a-button>
<div class="content_view">
<router-view keep-alive/>
</div>
</div>
<div class="content_view">
<router-view />
</div>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import axios from 'axios'
import Breadcrumb from "./breadcrumb/index.vue";
export default {
</template>
<script>
import _ from 'lodash';
import axios from 'axios';
import Breadcrumb from "./breadcrumb/index.vue";
import {userSiteBus} from '@/api/dataActuary'
export default {
components:{
Breadcrumb
},
......@@ -39,21 +39,29 @@
// 搜索框
businessName: '',
dataSource: [],
sourceList:[],
dataList: [],
btnShow: false,
}
},
mounted() {
mounted() {
this.getList()
},
methods:{
startAnalysis() {
created(){
},
computed:{
},
methods:{
startAnalysis() {
if(!this.businessName){
this.$message.error('请输入业务名称搜索')
}else{
this.$router.push({ path: 'analysiscontent', query:{name: this.businessName}})
this.btnShow= true
let item = this.sourceList.filter(i=>{return i.name == this.businessName})[0]
if(item){
this.$router.push({ path: 'analysiscontent', query:{id:item.id}})
this.btnShow= true
}
}
},
backBase() {
......@@ -72,20 +80,24 @@
},
onSearch: _.debounce(function(val){
this.dataSource= []
this.dataList.forEach(item=>{
if(item.indexOf(val) !== -1){
this.dataSource.push(item)
userSiteBus({siteid: localStorage.getItem('siteId'),bus_name:val}).then(res => {
if (res.code == 1) {
this.sourceList = res.data;
res.data.forEach(r => {
this.dataSource.push(
r.name
);
});
}
})
}, 1000),
})
},0),
onSelect(val){
this.businessName= val
}
}
},
}
</script>
<style lang="less" scoped>
</script>
<style lang="less" scoped>
@headerH: 4.5rem;
.Container {
height: 100% !important;
......@@ -159,6 +171,4 @@
.content_view{
padding: 0 5rem;
}
</style>
\ No newline at end of file
</style>
<template>
<div class="Container">
<div class="main">
<div class="first_card">
<div class="breadMenu">
<Breadcrumb/>
</div>
<div class="searchBox">
<!-- <a-auto-complete
v-model="businessName"
:data-source="dataSource"
optionLabelProp="value"
style="width: 35.625rem"
placeholder="请输入业务名称搜索"
@select="onSelect"
@search="onSearch"
/> -->
<!-- <a-select show-search placeholder="请输入业务名称搜索" style="width: 35.625rem"
:default-active-first-option="false" :show-arrow="false" :filter-option="false" allowClear
:not-found-content="null" :options="peopleArr" @search="peopelListFn"
@change="handleChange">
</a-select> -->
<a-button type="primary" class="addclass" v-if="!btnShow" @click="startAnalysis">开始分析</a-button>
<a-button type="primary" class="addclass" v-else @click="backBase">返回</a-button>
</div>
</div>
<div class="content_view">
<router-view keep-alive/>
</div>
</div>
</div>
</template>
<script>
import _ from 'lodash';
import axios from 'axios';
import Breadcrumb from "./breadcrumb/index.vue";
export default {
components:{
Breadcrumb
},
data() {
return {
// 搜索框
businessName: '',
dataSource: [],
dataList: [],
btnShow: false,
}
},
mounted() {
this.getList()
},
methods:{
startAnalysis() {
if(!this.businessName){
this.$message.error('请输入业务名称搜索')
}else{
this.$router.push({ path: 'analysiscontent', query:{name: this.businessName}})
this.btnShow= true
}
},
backBase() {
this.$router.push({ path: 'basecontent'})
this.btnShow= false
this.businessName= ''
},
async getList(){
await axios.get('http://192.168.0.98:8090/inter/statistic/busList',{params: {siteid: 1}}).then((res)=>{
if(res && res.status==200){
res.data.data.forEach(item=>{
this.dataList.push(item.name)
})
}
})
},
onSearch: _.debounce(function(val){
this.dataSource= []
this.dataList.forEach(item=>{
if(item.indexOf(val) !== -1){
this.dataSource.push(item)
}
})
}, 1000),
onSelect(val){
this.businessName= val
}
}
}
</script>
<style lang="less" scoped>
@headerH: 4.5rem;
.Container {
height: 100% !important;
// background: #fac;
background: #f5f5f5;
display: flex;
flex-direction: column;
.main {
// background: #afc;
border-radius: 6px;
flex: 1;
overflow-y: auto;
overflow-x: hidden;
}
&::before {
content: "";
display: block;
width: 100%;
height: @headerH;
background: rgb(59, 135, 255);
background: -moz-linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%
);
background: -webkit-linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%
);
background: linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%
);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#3b87ff",endColorstr="#6c35f7",GradientType=1);
}
/deep/.ant-tabs-nav {
.ant-tabs-tab {
margin: 0 !important;
}
}
/deep/.ant-tabs-tab {
font-size: 14px !important;
& + .ant-tabs-tab {
margin: 0 !important;
margin-left: 0.7rem !important;
}
}
/deep/.ant-tabs-bar{
margin: 0;
}
}
.first_card{
background: #FFF;
margin-bottom: .9375rem;
}
.breadMenu{
height: 2.8125rem;
line-height: 2.8125rem;
padding: 0 5rem;
border-bottom: 1px solid rgba(226, 226, 226, 1);
}
.searchBox{
height: 6.25rem;
display: flex;
justify-content: center;
align-items: center;
}
.content_view{
padding: 0 5rem;
}
</style>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
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