From d7b4306b5b444c5f7ca4e1065496fdfed57db188 Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 28 Dec 2021 16:30:48 +0800 Subject: [PATCH] BUG 26118 --- src/apps/AppAskForm/AddForm.vue | 2 +- src/apps/AppAskForm/AppAskForm.vue | 2 +- src/apps/AppAskForm/FiledConfig.vue | 2 +- src/apps/AppAskForm/components/List.vue | 13 ++++--------- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/apps/AppAskForm/AddForm.vue b/src/apps/AppAskForm/AddForm.vue index 5b506d6b..f24a4727 100644 --- a/src/apps/AppAskForm/AddForm.vue +++ b/src/apps/AppAskForm/AddForm.vue @@ -184,7 +184,7 @@ export default { }) uni.$on('filedConfig', res => { - if (!res.index) { + if (res.index < 0) { this.targetList.push(res.config) } else { this.targetList.splice(res.index, 1, res.config) diff --git a/src/apps/AppAskForm/AppAskForm.vue b/src/apps/AppAskForm/AppAskForm.vue index 4cfd7a59..b2a0387e 100644 --- a/src/apps/AppAskForm/AppAskForm.vue +++ b/src/apps/AppAskForm/AppAskForm.vue @@ -37,7 +37,7 @@ export default { }, onShow() { document.title = "问卷表单" - this.$refs.TabPage?.show() + this.$refs?.TabPage?.show() this.$nextTick(() => { this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact', 'shareAppMessage', 'shareWechatMessage']).then(() => { this.$dict.load(['questionnaireStatus', 'questionnaireType', 'questionnaireFieldType']) diff --git a/src/apps/AppAskForm/FiledConfig.vue b/src/apps/AppAskForm/FiledConfig.vue index 4831f5b2..14aab4ec 100644 --- a/src/apps/AppAskForm/FiledConfig.vue +++ b/src/apps/AppAskForm/FiledConfig.vue @@ -157,7 +157,7 @@ export default { }, computed: { config() { - return !!this.index ? this.filed : JSON.parse(JSON.stringify(components.filter(v => v.type === this.filedType)[0])) + return this.index > -1 ? this.filed : components?.filter(v => v.type === this.filedType)?.[0] || {} }, pointTypeName() { if (!this.config.pointDict) return '' diff --git a/src/apps/AppAskForm/components/List.vue b/src/apps/AppAskForm/components/List.vue index 416818c9..b4423808 100644 --- a/src/apps/AppAskForm/components/List.vue +++ b/src/apps/AppAskForm/components/List.vue @@ -211,16 +211,11 @@ export default { toEdit() { if (this.info.dataCount !== 0) { return this.$u.toast('该表单已有数据,无法编辑!') + } else { + let {id} = this + this.isShow = false + uni.navigateTo({url: `./AddForm?id=${id}`}) } - - this.$emit('change', { - type: 'AddForm', - params: { - id: this.id - } - }) - - this.isShow = false }, share(id) {