Commit a41f417e by Jaxon

style: 格式调整

1 parent 64d41875
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"dist", "dist",
".git" ".git"
] ]
// 对齐 Webpack 的 extensions 优先级 // 对齐 Webpack 的 extensions 优先级
// "extensions": [".vue", ".js", ".ts", ".json"] // "extensions": [".vue", ".js", ".ts", ".json"]
} }
...@@ -115,7 +115,7 @@ let baseConfig = config; ...@@ -115,7 +115,7 @@ let baseConfig = config;
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取 // 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
fetch( fetch(
"https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config", "https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config-sj",
) )
.then( .then(
(response) => { (response) => {
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="品牌:"> <el-form-item label="品牌:">
<el-radio-group v-model="businessType" @change="handleChangeBusinessType"> <el-radio-group v-model="brandId" @change="handleChangeBrand">
<el-radio v-for="(item, index) in brandMerchant" <el-radio v-for="(item) in brandMerchant"
:key="`${item.businessType}${index}`" :key="item.id"
:label="item.businessType"> :label="item.id">
{{ item.childBrandNames }} {{ item.childBrandNames }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
...@@ -37,34 +37,36 @@ export default { ...@@ -37,34 +37,36 @@ export default {
data() { data() {
return { return {
businessType: undefined, businessType: undefined,
brandId: undefined,
}; };
}, },
computed: { computed: {
businessTypes() { businessTypes() {
return this.brandMerchant.map(item => item.businessType); return this.brandMerchant.map(item => item.businessType);
}, },
brandList() {
return this.brandMerchant.map(item => item.childBrandNames);
},
}, },
mounted() { mounted() {
}, },
methods: { methods: {
async handleSetDefaultType() { async handleSetDefaultType() {
console.log("执行");
if (this.brandMerchant[0]?.businessType !== undefined && this.brandMerchant[0].businessType !== null) { if (this.brandMerchant[0]?.businessType !== undefined && this.brandMerchant[0].businessType !== null) {
console.log("?", this.brandMerchant);
this.businessType = this.brandMerchant[0].businessType; this.businessType = this.brandMerchant[0].businessType;
console.log(this.businessType); this.brandId = this.brandMerchant[0].id;
this.handleChangeBusinessType(this.businessType); this.handleChangeBusinessType(this.businessType);
} }
}, },
handleChangeBusinessType(businessType) {
handleChangeBusinessType(e) { const item = this.brandMerchant.find(item => item.businessType === businessType);
console.log("handleChangeBusinessType", e); console.log("item", item);
console.log("this.brandMerchant", this.brandMerchant); if (item) {
const item = this.brandMerchant.find(item => item.businessType === e); this.brandId = item.id;
this.$emit("changeBusiness", item);
}
},
handleChangeBrand(brandId) {
const item = this.brandMerchant.find(item => item.id === brandId);
if (item) { if (item) {
this.businessType = item.businessType;
this.$emit("changeBusiness", item); this.$emit("changeBusiness", item);
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!