企微构建新增指定默认首页

This commit is contained in:
aixianling
2022-08-08 14:07:53 +08:00
parent 8eda688d37
commit 488e2298de

View File

@@ -60,6 +60,9 @@
<el-form-item label="接口是否单服务"> <el-form-item label="接口是否单服务">
<el-checkbox v-model="form.isSingleService"/> <el-checkbox v-model="form.isSingleService"/>
</el-form-item> </el-form-item>
<el-form-item label="默认首页">
<el-input v-model="form.homePage" clearable placeholder="默认首页"/>
</el-form-item>
</template> </template>
</template> </template>
</ai-card> </ai-card>
@@ -158,11 +161,11 @@ export default {
submit() { submit() {
this.$refs.AddForm.validate(v => { this.$refs.AddForm.validate(v => {
if (v) { if (v) {
const {tabBar, form: {type, appId, isSingleService}} = this const {tabBar, form: {type, appId, isSingleService, homePage}} = this
if (type == 'mp') { if (type == 'mp') {
this.form.extra = {tabBar, appId} this.form.extra = {tabBar, appId}
} else if (v == 'wxwork') { } else if (v == 'wxwork') {
this.form.extra = {isSingleService} this.form.extra = {isSingleService, homePage}
} }
this.instance.post("/node/custom/addOrUpdate", this.form).then(res => { this.instance.post("/node/custom/addOrUpdate", this.form).then(res => {
if (res?.code == 0) { if (res?.code == 0) {
@@ -173,13 +176,15 @@ export default {
} }
}) })
}, },
handleSysTypeChange(v, data) { handleSysTypeChange(v, data = {}) {
let values = this.$copy(data)
if (v == 'mp') { if (v == 'mp') {
this.form.appId = data.appId if (values?.tabBar) {
this.tabBar = data?.tabBar || this.tabBar this.tabBar = values.tabBar || this.tabBar
} else if (v == 'wxwork') { delete values.tabBar
this.form.isSingleService = data.isSingleService }
} }
Object.keys(values).map(e => this.$set(this.form, e, values[e]))
}, },
handleTabbarChange(row, {name, label}) { handleTabbarChange(row, {name, label}) {
row.text = label row.text = label