From 356638ebf7201ec6a8a59a39e30762f71770edfb Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Thu, 6 Feb 2025 18:04:50 +0800 Subject: [PATCH] init --- src/components/RichTextModal/index.vue | 42 +++++++++---------- src/views/Hospital/Hospital.vue | 20 ++++----- src/views/Hospital/components/AddHospital.vue | 14 +++---- src/views/Product/components/AddProduct.vue | 1 + src/views/ProductCategory/ProductCategory.vue | 10 ++--- .../components/AddProductCategory.vue | 36 ++++++++-------- 6 files changed, 59 insertions(+), 64 deletions(-) diff --git a/src/components/RichTextModal/index.vue b/src/components/RichTextModal/index.vue index f79957a..5baabe2 100644 --- a/src/components/RichTextModal/index.vue +++ b/src/components/RichTextModal/index.vue @@ -2,6 +2,7 @@
diff --git a/src/views/Hospital/Hospital.vue b/src/views/Hospital/Hospital.vue index a6664cf..5c7997d 100644 --- a/src/views/Hospital/Hospital.vue +++ b/src/views/Hospital/Hospital.vue @@ -79,6 +79,14 @@ :edit-render="{ name: 'VxeSelect', options: site, props: { multiple: false }, optionProps: { value: 'id', label: 'name' } }" /> + + 0){ + if (Array.isArray(row['cover']) && row['cover'].length > 0) { form['cover_id'] = row['cover'][0]?.response?.id ?? '' } this.loading = true diff --git a/src/views/Hospital/components/AddHospital.vue b/src/views/Hospital/components/AddHospital.vue index 8d64a97..c4f27d4 100644 --- a/src/views/Hospital/components/AddHospital.vue +++ b/src/views/Hospital/components/AddHospital.vue @@ -24,6 +24,10 @@ + + + + @@ -106,23 +110,15 @@ export default { loading: false, visible: false, form: { - name: '', - + tags: '', site_id: '', - lat: '', - lng: '', - good_at: '', - content: '', - cover_id: [], - status: 1 - }, rules: { diff --git a/src/views/Product/components/AddProduct.vue b/src/views/Product/components/AddProduct.vue index 19be1d5..8301eb4 100644 --- a/src/views/Product/components/AddProduct.vue +++ b/src/views/Product/components/AddProduct.vue @@ -84,6 +84,7 @@ diff --git a/src/views/ProductCategory/ProductCategory.vue b/src/views/ProductCategory/ProductCategory.vue index 26d4eea..e5c9231 100644 --- a/src/views/ProductCategory/ProductCategory.vue +++ b/src/views/ProductCategory/ProductCategory.vue @@ -207,13 +207,10 @@ export default { tableData: [], form: { id: '', - name: '', - pid: '', - - image_id: [] - + image_id: '', + image: [] }, validRules: { @@ -355,12 +352,13 @@ export default { } form['image_id'] = row['image'][0]?.response?.id ?? '' - + console.log('form', form) this.loading = true await save(form, false) await this.getList() this.loading = false } catch (err) { + console.error(err) this.loading = false } }, diff --git a/src/views/ProductCategory/components/AddProductCategory.vue b/src/views/ProductCategory/components/AddProductCategory.vue index 172fbe5..1a36b89 100644 --- a/src/views/ProductCategory/components/AddProductCategory.vue +++ b/src/views/ProductCategory/components/AddProductCategory.vue @@ -12,15 +12,15 @@
- + - + - + - + 文件不超过{{ formatFileSize(uploadSize) }}
- +
@@ -64,12 +64,12 @@ default: false, required: true }, - + tableData: { type: Array, default: () => [] }, - + }, data() { return { @@ -78,16 +78,16 @@ loading: false, visible: false, form: { - + name: '', - + pid: '', - + image_id: [], - + }, rules: { - + }, } }, @@ -142,13 +142,13 @@ reset() { this.form = { - + name: '', - + pid: '', - + image_id: [], - + } this.$refs['elForm'].resetFields() }, @@ -157,10 +157,10 @@ this.$message.warning("文件正在上传中") return } - + this.form['image_id'] = this.form['image_id'][0]?.response?.id ?? '' - + this.$refs['elForm'].validate(async valid => { if (valid) { this.loading = true