parent
890e81cd06
commit
25b32ffd12
|
@ -410,3 +410,22 @@ class LoginLog(CoreModel):
|
|||
verbose_name = "登录日志"
|
||||
verbose_name_plural = verbose_name
|
||||
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",)
|
||||
|
||||
|
|
|
@ -9,6 +9,10 @@ export default {
|
|||
props: {
|
||||
color: {
|
||||
require: false
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
|
@ -16,6 +20,13 @@ export default {
|
|||
currentValue: ''
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
value(nv,ov){
|
||||
const { row } = this.$parent.scope
|
||||
const valueBinding = this.$parent.valueBinding
|
||||
this.setValue(row[valueBinding])
|
||||
}
|
||||
},
|
||||
created () {
|
||||
const { row } = this.$parent.scope
|
||||
const valueBinding = this.$parent.valueBinding
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<template>
|
||||
<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>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -23,8 +26,8 @@ export default {
|
|||
key: 'name'
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
value(nv,ov){
|
||||
watch: {
|
||||
value (nv, ov) {
|
||||
const { row } = this.$parent.scope
|
||||
const { children } = this.$parent
|
||||
if (children) {
|
||||
|
|
Loading…
Reference in New Issue