修复BUG:

修复一对多,多对多组件的bug
pull/66/head
猿小天 2022-06-24 17:07:19 +08:00
parent 890e81cd06
commit 25b32ffd12
3 changed files with 36 additions and 3 deletions

View File

@ -410,3 +410,22 @@ class LoginLog(CoreModel):
verbose_name = "登录日志" verbose_name = "登录日志"
verbose_name_plural = verbose_name verbose_name_plural = verbose_name
ordering = ("-create_datetime",) ordering = ("-create_datetime",)
class MessageCenter(CoreModel):
title = models.CharField(max_length=100,verbose_name="标题",help_text="标题")
content = models.TextField(verbose_name="内容",help_text="内容")
target_type=models.IntegerField(default=0,verbose_name="目标类型",help_text="目标类型")
target_user = models.ForeignKey(to=Users,related_name="target_user",null=True,blank=True,db_constraint=False,on_delete=models.CASCADE,verbose_name="目标用户",help_text="目标用户")
target_dept = models.ForeignKey(to=Dept, null=True, blank=True, db_constraint=False, on_delete=models.CASCADE,
verbose_name="目标部门", help_text="目标部门")
target_role = models.ForeignKey(to=Role, null=True, blank=True, db_constraint=False, on_delete=models.CASCADE,
verbose_name="目标角色", help_text="目标角色")
is_read=models.BooleanField(default=False,blank=True,verbose_name="是否已读",help_text="是否已读")
class Meta:
db_table = table_prefix + "message_center"
verbose_name = "消息中心"
verbose_name_plural = verbose_name
ordering = ("-create_datetime",)

View File

@ -9,6 +9,10 @@ export default {
props: { props: {
color: { color: {
require: false require: false
},
value: {
type: String,
required: false
} }
}, },
data () { data () {
@ -16,6 +20,13 @@ export default {
currentValue: '' currentValue: ''
} }
}, },
watch:{
value(nv,ov){
const { row } = this.$parent.scope
const valueBinding = this.$parent.valueBinding
this.setValue(row[valueBinding])
}
},
created () { created () {
const { row } = this.$parent.scope const { row } = this.$parent.scope
const valueBinding = this.$parent.valueBinding const valueBinding = this.$parent.valueBinding

View File

@ -1,6 +1,9 @@
<template> <template>
<div> <div>
<el-tag style="margin-right: 10px" :type="color" v-for="(item,index) in currentValue" :key="index">{{ item[key] }}</el-tag> <el-tag style="margin-right: 10px" :type="color" v-for="(item,index) in currentValue" :key="index">{{
item[key]
}}
</el-tag>
</div> </div>
</template> </template>
<script> <script>
@ -23,8 +26,8 @@ export default {
key: 'name' key: 'name'
} }
}, },
watch:{ watch: {
value(nv,ov){ value (nv, ov) {
const { row } = this.$parent.scope const { row } = this.$parent.scope
const { children } = this.$parent const { children } = this.$parent
if (children) { if (children) {