Commit 05b5c3e9 by Chao Sun

房屋计算器入参

parent c9da2d70
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
align-items: center; align-items: center;
background-color: #fff; background-color: #fff;
padding-bottom: 30rpx; padding-bottom: 30rpx;
z-index: 1;
} }
.optionContent button{ .optionContent button{
flex: 0 0 46%; flex: 0 0 46%;
......
export default {
// 数据处理
action(data){ // 使用递归函数
// if(!(data?.length <= 0)){
// 等价于
if(!data || data.length <= 0){ // 递归的出口
return null;
}
return data.map(x => { // 循环数据
const model = { // 把后端返回过来的数据里面的键给替换成我想要的键
source: x,
text: x.provinceName ? x.provinceName : x.cityName,
value: x.provinceId ? x.provinceId : x.cityId,
};
const children = this.action(x.citys); // 子级数据
if(children){ // 一直往下循环查找有没有children这个键,如果有就直接添加一个子级字段名,这个字段名就是存子级数据
model.children = children;
}
return model; // 返回这个数据
});
}
}
\ No newline at end of file
...@@ -19,7 +19,7 @@ const config = { ...@@ -19,7 +19,7 @@ const config = {
stage, stage,
prod prod
} }
let env = 'prod'; let env = 'dev';
// if (process.env.NODE_ENV === 'development') { // if (process.env.NODE_ENV === 'development') {
// env = 'dev'; // env = 'dev';
// }else if (process.env.NODE_ENV === 'production') { // }else if (process.env.NODE_ENV === 'production') {
......
{ {
"name": "sfp-program",
"lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "lockfileVersion": 1,
"": {
"dependencies": {
"echarts": "^5.3.3",
"jweixin-module": "^1.6.0"
}
},
"node_modules/echarts": {
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.3.tgz",
"integrity": "sha512-BRw2serInRwO5SIwRviZ6Xgm5Lb7irgz+sLiFMmy/HOaf4SQ+7oYqxKzRHAKp4xHQ05AuHw1xvoQWJjDQq/FGw==",
"dependencies": {
"tslib": "2.3.0",
"zrender": "5.3.2"
}
},
"node_modules/jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
},
"node_modules/tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"node_modules/zrender": {
"version": "5.3.2",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.3.2.tgz",
"integrity": "sha512-8IiYdfwHj2rx0UeIGZGGU4WEVSDEdeVCaIg/fomejg1Xu6OifAL1GVzIPHg2D+MyUkbNgPWji90t0a8IDk+39w==",
"dependencies": {
"tslib": "2.3.0"
}
}
},
"dependencies": { "dependencies": {
"echarts": { "echarts": {
"version": "5.3.3", "version": "5.3.3",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.3.tgz", "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.3.3.tgz",
"integrity": "sha512-BRw2serInRwO5SIwRviZ6Xgm5Lb7irgz+sLiFMmy/HOaf4SQ+7oYqxKzRHAKp4xHQ05AuHw1xvoQWJjDQq/FGw==", "integrity": "sha512-BRw2serInRwO5SIwRviZ6Xgm5Lb7irgz+sLiFMmy/HOaf4SQ+7oYqxKzRHAKp4xHQ05AuHw1xvoQWJjDQq/FGw==",
"requires": { "requires": {
"tslib": "2.3.0", "tslib": "2.3.0",
...@@ -52,6 +16,11 @@ ...@@ -52,6 +16,11 @@
"resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz", "resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==" "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
}, },
"nanoid": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-4.0.0.tgz",
"integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg=="
},
"tslib": { "tslib": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
......
{ {
"dependencies": { "dependencies": {
"echarts": "^5.3.3", "echarts": "^5.3.3",
"jweixin-module": "^1.6.0" "jweixin-module": "^1.6.0",
"nanoid": "^4.0.0"
} }
} }
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
<script> <script>
import api from '../../api/api'; import api from '../../api/api';
import common from '../../common/common'
export default{ export default{
data(){ data(){
return { return {
...@@ -70,30 +71,10 @@ ...@@ -70,30 +71,10 @@
api.provCityQry({insurerId:888}).then((res)=>{ api.provCityQry({insurerId:888}).then((res)=>{
console.log(res) console.log(res)
if(res['success']){ if(res['success']){
this.provinceList = this.action(res['data']['provinces']); this.provinceList = common.action(res['data']['provinces']);
} }
}) })
}, },
// 数据处理
action(data){ // 使用递归函数
// if(!(data?.length <= 0)){
// 等价于
if(!data || data.length <= 0){ // 递归的出口
return null;
}
return data.map(x => { // 循环数据
const model = { // 把后端返回过来的数据里面的键给替换成我想要的键
source: x,
text: x.provinceName ? x.provinceName : x.cityName,
value: x.salesAreaCode ? x.salesAreaCode : x.zipCode,
};
const children = this.action(x.citys); // 子级数据
if(children){ // 一直往下循环查找有没有children这个键,如果有就直接添加一个子级字段名,这个字段名就是存子级数据
model.children = children;
}
return model; // 返回这个数据
});
}
}, },
mounted() { mounted() {
this.editParamLists = JSON.parse(JSON.stringify(this.paramsLists)); this.editParamLists = JSON.parse(JSON.stringify(this.paramsLists));
......
...@@ -441,7 +441,7 @@ ...@@ -441,7 +441,7 @@
.title-area { .title-area {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; /* display: flex; */
/* #endif */ /* #endif */
align-items: center; align-items: center;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
......
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