fix(dict): fixed system dictionary data's sync error

pull/60/head
Angelo 2022-05-25 17:30:05 +08:00
parent 231437fae1
commit a0ba964478
5 changed files with 35 additions and 21 deletions

View File

@ -321,6 +321,11 @@ class SystemConfig(CoreModel):
super().save(force_insert, force_update, using, update_fields)
dispatch.refresh_system_config() # 有更新则刷新系统配置
def delete(self, using=None, keep_parents=False):
res = super().delete(using, keep_parents)
dispatch.refresh_dictionary()
return res
class LoginLog(CoreModel):
LOGIN_TYPE_CHOICES = (

View File

@ -7,6 +7,7 @@ export const crudOptions = (vm) => {
},
options: {
tableType: 'vxe-table',
stripe: false,
rowKey: true, // 必须设置true or false
rowId: 'id',
height: '100%', // 表格高度100%, 使用toolbar必须设置

View File

@ -1,15 +1,12 @@
<!--
* @创建文件时间: 2021-06-01 22:41:21
* @Auther: 猿小天
* @最后修改人: 猿小天
* @最后修改时间: 2021-08-09 20:27:09
* 联系Qq:1638245306
* @文件介绍: 字典管理
-->
<template>
<d2-container :class="{ 'page-compact': crud.pageOptions.compact }">
<!-- <template slot="header">测试页面1</template>-->
<d2-crud-x ref="d2Crud" v-bind="_crudProps" v-on="_crudListeners" @dictionaryConfigure="dictionaryConfigure">
<d2-crud-x
ref="d2Crud"
v-bind="_crudProps"
v-on="_crudListeners"
@dictionaryConfigure="dictionaryConfigure"
>
<div slot="header">
<crud-search
ref="search"
@ -30,14 +27,18 @@
/>
</div>
</d2-crud-x>
<el-drawer
:visible.sync="drawer"
:size="700">
<el-drawer :visible.sync="drawer" :size="700">
<div slot="title">
<span>字典列表</span>
<el-tag size="small" style="margin-left: 10px">{{dictionaryRow.label}}</el-tag>
<el-tag size="small" style="margin-left: 10px">{{
dictionaryRow.label
}}</el-tag>
</div>
<sub-dictionary style="margin-top: 80px;margin-left: 10px" :dictionaryRow="dictionaryRow"></sub-dictionary>
<sub-dictionary
style="margin-top: 80px; margin-left: 10px"
:dictionaryRow="dictionaryRow"
>
</sub-dictionary>
</el-drawer>
</d2-container>
</template>
@ -80,6 +81,10 @@ export default {
dictionaryConfigure (scope) {
this.drawer = true
this.dictionaryRow = scope.row
},
doAfterRowChange (row) {
this.doRefresh({ from: 'afterRowChange' })
this.$store.dispatch('d2admin/dictionary/load')
}
}
}

View File

@ -44,8 +44,7 @@ export default {
}
},
data () {
return {
}
return {}
},
methods: {
getCrudOptions () {
@ -70,6 +69,10 @@ export default {
},
delRequest (row) {
return api.DelObj(row.id)
},
doAfterRowChange (row) {
this.doRefresh({ from: 'afterRowChange' })
this.$store.dispatch('d2admin/dictionary/load')
}
}
}

View File

@ -170,7 +170,7 @@ export const crudOptions = (vm) => {
}
}
},
width: 180,
minWidth: 180,
type: 'input',
form: {
rules: [ // 表单校验规则
@ -389,7 +389,7 @@ export const crudOptions = (vm) => {
search: {
disabled: false
},
width: 50,
width: 60,
type: 'radio',
dict: {
data: vm.dictionary('button_whether_bool')