From 9ad990ab97838b317792f1aaa15a30dba8637884 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Fri, 25 Apr 2025 10:22:50 +0800 Subject: [PATCH] genggai --- src/views/product/components/addFamily.vue | 127 +++++++++++---------- 1 file changed, 66 insertions(+), 61 deletions(-) diff --git a/src/views/product/components/addFamily.vue b/src/views/product/components/addFamily.vue index b6b55af..1e8857c 100644 --- a/src/views/product/components/addFamily.vue +++ b/src/views/product/components/addFamily.vue @@ -22,27 +22,17 @@ style="width: 100%;"> - - - - + + + @@ -89,7 +92,7 @@ }, data() { return { - isShow: false, + isShow: false, showWang: false, type: 'add', id: '', @@ -101,11 +104,12 @@ pictureList: [], form: { title: '', - sort: 0, - is_visible:1, - description: '', - file_ids:[], - content:'' + sort: 0, + is_visible: 1, + + file_ids: [], + description: '', + content: '' }, rules: { title: [{ @@ -116,7 +120,7 @@ } }, created() { - this.uploadOther.token = getToken(); + this.uploadOther.token = getToken(); }, methods: { handleRemoveP(file, fileList) { @@ -129,10 +133,10 @@ return } this.pictureList = fileList - }, - - changeEditor(e, type) { - this.form[type] = e + }, + + changeEditor(e, type) { + this.form[type] = e }, submit() { if (this.id) { @@ -173,19 +177,19 @@ // show_relation: ['picture'], }).then(res => { this.form = this.base.requestToForm(res, this.form) - this.form.description = res.description ? res.description : '' - this.form.content = res.content?res.content:'' - this.form.is_visible = res.is_visible?res.is_visible:0 - this.form.sort = res.sort?res.sort:0 + this.form.description = res.description ? res.description : '' + this.form.content = res.content ? res.content : '' + this.form.is_visible = res.is_visible ? res.is_visible : 0 + this.form.sort = res.sort ? res.sort : 0 this.showWang = true - if (res.files) { - let _arr = [] - res.files.map(item=>{ - _arr.push({ - name: item.original_name, - id: item.id, - url: item.url - }) + if (res.files) { + let _arr = [] + res.files.map(item => { + _arr.push({ + name: item.original_name, + id: item.id, + url: item.url + }) }) this.pictureList = _arr } @@ -197,21 +201,22 @@ if (newVal) { if (this.type === 'editor') { this.getDetail() - }else{ - this.showWang = true + } else { + this.showWang = true } } else { this.id = '' this.type = "add" - this.pictureList = [] + this.pictureList = [] this.showWang = false this.form = { title: '', - sort: 0, - is_visible:1, + sort: 0, + is_visible: 1, + + file_ids: '', description: '', - file_ids: '', - content:'' + content: '' } this.$refs['dialog'].reset() } @@ -224,7 +229,7 @@