Commit a41f417e by Jaxon

style: 格式调整

1 parent 64d41875
......@@ -39,7 +39,7 @@
"dist",
".git"
]
// 对齐 Webpack 的 extensions 优先级
// 对齐 Webpack 的 extensions 优先级
// "extensions": [".vue", ".js", ".ts", ".json"]
}
......@@ -115,7 +115,7 @@ let baseConfig = config;
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
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(
(response) => {
......
......@@ -14,10 +14,10 @@
</el-radio-group>
</el-form-item>
<el-form-item label="品牌:">
<el-radio-group v-model="businessType" @change="handleChangeBusinessType">
<el-radio v-for="(item, index) in brandMerchant"
:key="`${item.businessType}${index}`"
:label="item.businessType">
<el-radio-group v-model="brandId" @change="handleChangeBrand">
<el-radio v-for="(item) in brandMerchant"
:key="item.id"
:label="item.id">
{{ item.childBrandNames }}
</el-radio>
</el-radio-group>
......@@ -37,34 +37,36 @@ export default {
data() {
return {
businessType: undefined,
brandId: undefined,
};
},
computed: {
businessTypes() {
return this.brandMerchant.map(item => item.businessType);
},
brandList() {
return this.brandMerchant.map(item => item.childBrandNames);
},
},
mounted() {
},
methods: {
async handleSetDefaultType() {
console.log("执行");
if (this.brandMerchant[0]?.businessType !== undefined && this.brandMerchant[0].businessType !== null) {
console.log("?", this.brandMerchant);
this.businessType = this.brandMerchant[0].businessType;
console.log(this.businessType);
this.brandId = this.brandMerchant[0].id;
this.handleChangeBusinessType(this.businessType);
}
},
handleChangeBusinessType(e) {
console.log("handleChangeBusinessType", e);
console.log("this.brandMerchant", this.brandMerchant);
const item = this.brandMerchant.find(item => item.businessType === e);
handleChangeBusinessType(businessType) {
const item = this.brandMerchant.find(item => item.businessType === businessType);
console.log("item", item);
if (item) {
this.brandId = item.id;
this.$emit("changeBusiness", item);
}
},
handleChangeBrand(brandId) {
const item = this.brandMerchant.find(item => item.id === brandId);
if (item) {
this.businessType = item.businessType;
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!