mirror of https://gitee.com/xiaonuobase/snowy
【优化】sys模块下主管name回显使用翻译插件代替ext_json
parent
6025d685d7
commit
63d23045cd
|
@ -42,7 +42,7 @@
|
|||
<a-form-item label="指定主管:" name="directorId">
|
||||
<a-button type="link" style="padding-left: 0px" @click="openSelector(formData.directorId)">选择</a-button>
|
||||
<a-tag v-if="formData.directorId && formData.directorName" color="orange" closable @close="closeUserTag">{{
|
||||
formData.directorName
|
||||
formData.directorName
|
||||
}}</a-tag>
|
||||
<a-input v-show="false" v-model:value="formData.directorId" />
|
||||
</a-form-item>
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
</a-form-item>
|
||||
<a-form-item label="指定主管:" name="directorId">
|
||||
<a-button type="link" style="padding-left: 0px" @click="openSelector(formData.directorId)">选择</a-button>
|
||||
<a-tag v-if="formData.directorId && extJson.length > 0" color="orange" closable @close="closeUserTag">{{
|
||||
extJson[0].name
|
||||
<a-tag v-if="formData.directorId && formData.directorName" color="orange" closable @close="closeUserTag">{{
|
||||
formData.directorName
|
||||
}}</a-tag>
|
||||
<a-input v-show="false" v-model:value="formData.directorId" />
|
||||
</a-form-item>
|
||||
|
@ -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 @@
|
|||
}
|
||||
orgApi.orgDetail(param).then((data) => {
|
||||
formData.value = Object.assign({}, data)
|
||||
extJson.value = JSON.parse(formData.value.extJson) || []
|
||||
})
|
||||
}
|
||||
// 获取机构树并加入顶级
|
||||
|
@ -133,23 +130,23 @@
|
|||
}
|
||||
// 人员选择器回调
|
||||
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 = () => {
|
||||
formRef.value.validate().then(() => {
|
||||
submitLoading.value = true
|
||||
formData.value.extJson = JSON.stringify(extJson.value)
|
||||
orgApi
|
||||
.submitForm(formData.value, formData.value.id)
|
||||
.then(() => {
|
||||
|
|
|
@ -15,11 +15,14 @@ package vip.xiaonuo.sys.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.common.pojo.CommonEntity;
|
||||
import vip.xiaonuo.sys.modular.user.entity.SysUser;
|
||||
|
||||
/**
|
||||
* 组织实体
|
||||
|
@ -43,6 +46,7 @@ public class SysOrg extends CommonEntity implements TransPojo {
|
|||
/** 主管id */
|
||||
@ApiModelProperty(value = "主管id", position = 3)
|
||||
@TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
|
||||
@Trans(type = TransType.SIMPLE, target = SysUser.class, fields = "name", alias = "director", ref = "directorName")
|
||||
private String directorId;
|
||||
|
||||
/** 名称 */
|
||||
|
|
Loading…
Reference in New Issue