From 0f092ba47702dbc1812a074d85146aeb6fd7aaae Mon Sep 17 00:00:00 2001 From: 877617829 <877617829@qq.com> Date: Mon, 31 Jul 2023 22:54:14 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E4=B8=BB?= =?UTF-8?q?=E7=AE=A1name=E5=9B=9E=E6=98=BE=E4=BD=BF=E7=94=A8=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E6=8F=92=E4=BB=B6=E4=BB=A3=E6=9B=BFext=5Fjson?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- snowy-admin-web/src/views/biz/org/form.vue | 13 +++++-------- .../vip/xiaonuo/biz/modular/org/entity/BizOrg.java | 4 ++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/snowy-admin-web/src/views/biz/org/form.vue b/snowy-admin-web/src/views/biz/org/form.vue index 9f563f86..543563b7 100644 --- a/snowy-admin-web/src/views/biz/org/form.vue +++ b/snowy-admin-web/src/views/biz/org/form.vue @@ -41,8 +41,8 @@ 选择 - {{ - extJson[0].name + {{ + formData.directorName }} @@ -79,13 +79,11 @@ const formData = ref({}) // 定义机构元素 const treeData = ref([]) - const extJson = ref([]) const submitLoading = ref(false) // 打开抽屉 const onOpen = (record, parentId) => { visible = true - extJson.value = ref([]) formData.value = { sortCode: 99 } @@ -98,7 +96,6 @@ } bizOrgApi.orgDetail(param).then((data) => { formData.value = Object.assign({}, data) - extJson.value = JSON.parse(formData.value.extJson) || [] }) } // 获取机构树并加入顶级 @@ -133,17 +130,18 @@ } // 人员选择器回调 const userBack = (value) => { - extJson.value = value if (value.length > 0) { formData.value.directorId = value[0].id + formData.value.directorName = value[0].name } else { formData.value.directorId = '' + formData.value.directorName = '' } } // 通过小标签删除主管 const closeUserTag = () => { - extJson.value = [] formData.value.directorId = '' + formData.value.directorName = '' } // 验证并提交数据 const onSubmit = () => { @@ -151,7 +149,6 @@ .validate() .then(() => { submitLoading.value = true - formData.value.extJson = JSON.stringify(extJson.value) bizOrgApi .submitForm(formData.value, formData.value.id) .then(() => { diff --git a/snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/org/entity/BizOrg.java b/snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/org/entity/BizOrg.java index 5134af0c..af6ab7ea 100644 --- a/snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/org/entity/BizOrg.java +++ b/snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/org/entity/BizOrg.java @@ -15,10 +15,13 @@ package vip.xiaonuo.biz.modular.org.entity; import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; +import com.fhs.core.trans.anno.Trans; +import com.fhs.core.trans.constant.TransType; import com.fhs.core.trans.vo.TransPojo; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; +import vip.xiaonuo.biz.modular.user.entity.BizUser; import vip.xiaonuo.common.pojo.CommonEntity; /** @@ -43,6 +46,7 @@ public class BizOrg extends CommonEntity implements TransPojo { /** 主管id */ @ApiModelProperty(value = "主管id", position = 3) @TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED) + @Trans(type = TransType.SIMPLE, target = BizUser.class, fields = "name", alias = "director", ref = "directorName") private String directorId; /** 名称 */