Commit 7be6e49d by cwq0219

合并

2 parents ed00357d 816b4831
...@@ -134,11 +134,7 @@ export default { ...@@ -134,11 +134,7 @@ export default {
type: 'text', type: 'text',
label: '详情', label: '详情',
callback: (index, rows) => { callback: (index, rows) => {
// const url = encodeURI(`./businessDetails.html?id=${rows[index].businessId}&name=${rows[index].businessName}`)
// location.href = url
const url = jumpLink('./businessDetails.html?', { id: rows[index].businessId, name: rows[index].businessName }, _this)
this.$parent.to(['商户数据平台', '商户数据平台', '商户数据平台', '业务管理', '商户详情'], { id: rows[index].businessId, name: rows[index].businessName }) this.$parent.to(['商户数据平台', '商户数据平台', '商户数据平台', '业务管理', '商户详情'], { id: rows[index].businessId, name: rows[index].businessName })
// console.log(url)
} }
} }
] ]
......
<template> <template>
<div> <!-- <div> -->
<gl-select style="width: 20%;margin-right: 20px" v-model="province" @click="selectProvince" @focus="selectProvince" placeholder="请选择省"> <gl-row style="margin-left: 0" :gutter="10">
<gl-option <gl-col :span="8">
v-for="item in options" <gl-select filterable clearable v-model="province" @focus="selectProvince" placeholder="请选择省">
:key="item.value" <gl-option
:label="item.label" v-for="(item, k) in provinceList"
:value="item.value"> :key="k"
</gl-option> :label="item.provinceName"
</gl-select> :value="item.provinceId">
<gl-select style="width: 20%;margin-right: 20px" v-model="province" placeholder="请选择市"> </gl-option>
<gl-option </gl-select>
v-for="item in options" </gl-col>
:key="item.value" <gl-col :span="8">
:label="item.label" <gl-select filterable clearable v-model="province" placeholder="请选择市">
:value="item.value"> <gl-option
</gl-option> v-for="item in cityList"
</gl-select> :key="item.cityId"
<gl-select style="width: 20%" v-model="province" placeholder="请选择区"> :label="item.cityName"
<gl-option :value="item.cityId">
v-for="item in options" </gl-option>
:key="item.value" </gl-select>
:label="item.label" </gl-col>
:value="item.value"> <gl-col :span="8">
</gl-option> <gl-select filterable clearable v-model="province" placeholder="请选择区">
</gl-select> <gl-option
</div> v-for="item in areaList"
:key="item.value"
:label="item.label"
:value="item.value">
</gl-option>
</gl-select>
</gl-col>
</gl-row>
<!-- </div> -->
</template> </template>
<script> <script>
...@@ -32,32 +40,47 @@ export default { ...@@ -32,32 +40,47 @@ export default {
name: 'CityArea', name: 'CityArea',
data() { data() {
return { return {
options: [ AllData: [],
{ provinceList: [],
value: '选项1', cityList: [],
label: '黄金糕黄金糕黄金糕黄金糕' areaList: [],
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}
],
province: '', // 省值 province: '', // 省值
city: '', // 市值 city: '', // 市值
area: '' // 区值 area: '' // 区值
} }
}, },
mounted() {
const URL = ' http://192.168.3.171:7300/mock/5be17454f31545347559d499/config'
const getConfig = (url = URL + '/area_config') => {
return new Promise(resolve => {
const xhr = new XMLHttpRequest()
xhr.onreadystatechange = () => {
if (xhr.readyState === 4 && xhr.status === 200) {
resolve({'config': JSON.parse(xhr.responseText) })
}
}
xhr.open('GET', url)
xhr.send()
})
}
getConfig().then(data => {
console.log(data.config)
this.AllData = JSON.parse(JSON.stringify(data.config.provinceInfoList))
this.AllData.forEach(element => {
this.provinceList.push({provinceId: element.provinceId, provinceName: element.provinceName})
})
// this.getCity()
})
},
methods: { methods: {
selectProvince() { selectProvince() {
console.log('我选择了省') console.log('我选择了省')
},
// 获取市
getCity(index) {
this.AllData[0].forEach(element => {
this.cityList.push({cityId: element.cityId, cityName: element.cityName})
})
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!