add: 添加自动清理任务和指令,优化操作日志

This commit is contained in:
yanps
2024-02-02 16:56:42 +08:00
parent e2cfc536bb
commit bd2b3057ba
16 changed files with 313 additions and 141 deletions

View File

@@ -10,7 +10,7 @@
label-position="right"
label-suffix=":"
>
<el-form-item :label="$t('user.table_title.Department_name')">
<el-form-item :label="$t('user.table_title.Department_name')">
<el-input
v-model="deptName"
clearable
@@ -41,7 +41,7 @@
label-position="right"
label-suffix=":"
>
<el-form-item :label="$t('user.table_title.enter_department_name')">
<el-form-item :label="$t('user.table_title.enter_department_name')">
<el-input
v-model="query.blurry"
clearable
@@ -52,7 +52,7 @@
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item :label="$t('user.table_title.State')">
<el-form-item :label="$t('user.table_title.State')">
<el-select
v-model="query.is_used"
clearable
@@ -80,7 +80,7 @@
append-to-body
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0"
:visible.sync="crud.status.cu"
:title="crud.status.title"
width="800px"
>
@@ -135,7 +135,7 @@
multiple
active-value="1"
inactive-value="0"
:placeholder="$t('common.please')"
:placeholder="$t('auto.common.please')"
@remove-tag="deleteTag"
@change="changeRole"
>
@@ -150,8 +150,8 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">{{ $t('common.Cancel') }}</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">{{ $t('common.Confirm') }}</el-button>
<el-button type="text" @click="crud.cancelCU">{{ $t('auto.common.Cancel') }}</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">{{ $t('auto.common.Confirm') }}</el-button>
</div>
</el-dialog>
<!--表格渲染-->
@@ -349,7 +349,6 @@ import { getAll, getLevel } from '@/views/system/role/role'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import { mapGetters } from 'vuex'
@@ -373,7 +372,7 @@ const defaultForm = {
}
export default {
name: 'User',
components: { RelevanceDeptDialog, RelevanceUserDialog, Treeselect, crudOperation, rrOperation, udOperation, pagination },
components: { RelevanceDeptDialog, RelevanceUserDialog, Treeselect, crudOperation, rrOperation, pagination },
cruds() {
return CRUD({ title: i18n.t('user.table_value.User'), idField: 'user_id', url: 'api/users', crudMethod: { ...crudUser }})
},
@@ -682,7 +681,7 @@ export default {
this.$nextTick(function() {
for (let j = 0; j < row.roles.length; j++) {
for (let i = 0; i < this.rolesDatas.length; i++) {
if (this.rolesDatas[i].roleId == row.roles[j].roleId) {
if (this.rolesDatas[i].roleId === row.roles[j].roleId) {
this.$refs.roleTable.toggleRowSelection(this.rolesDatas[i], true)
break
}
@@ -718,7 +717,7 @@ export default {
this.$nextTick(function() {
for (var index = 0; index < res.length; index++) {
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
if (this.dataDialog.dataScopeType[i].value == res[index].permissionScopeType) {
if (this.dataDialog.dataScopeType[i].value === res[index].permissionScopeType) {
this.dataDialog.dataScopeType[i].permission_id = res[index].permission_id
if (res[index].users) this.dataDialog.dataScopeType[i].users = res[index].users
if (res[index].depts) this.dataDialog.dataScopeType[i].depts = res[index].depts
@@ -738,7 +737,7 @@ export default {
},
openRelevance(row, index) {
for (var i = 0; i < this.permissions.length; i++) {
if (this.permissions[i].permission_id != undefined && this.permissions[i].permission_id && this.permissions[i].permission_id != row.permission_id) {
if (this.permissions[i].permission_id !== undefined && this.permissions[i].permission_id && this.permissions[i].permission_id !== row.permission_id) {
this.$delete(this.dataDialog.dataScopeType[index], this.permissions[i].permission_id.toString())
}
}
@@ -746,15 +745,15 @@ export default {
this.rowData = {}
this.deptIds = []
this.userIds = []
if (row.permission_id == '1605129738328870912') { // 选择用户
if (row.permission_id === '1605129738328870912') { // 选择用户
this.userIds = this.dataDialog.dataScopeType[index].users
this.rowData = row
this.relevanceUser = true
} else if (row.permission_id == '1605129882164137984') { // 选择部门
} else if (row.permission_id === '1605129882164137984') { // 选择部门
this.deptIds = this.dataDialog.dataScopeType[index].depts
this.rowData = row
this.relevanceDept = true
} else if (row.permission_id == '1605128919449735168') { // 自身
} else if (row.permission_id === '1605128919449735168') { // 自身
const param = {
userId: this.dataDialog.userId
}
@@ -767,8 +766,8 @@ export default {
},
selectUsers(row) { // row对话框传来的数据
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
if (this.dataDialog.dataScopeType[i].dict_id == this.rowData.dict_id) {
if (this.dataDialog.dataScopeType[i].depts != undefined && this.dataDialog.dataScopeType[i].depts.length > 0) this.dataDialog.dataScopeType[i].depts = []
if (this.dataDialog.dataScopeType[i].dict_id === this.rowData.dict_id) {
if (this.dataDialog.dataScopeType[i].depts !== undefined && this.dataDialog.dataScopeType[i].depts.length > 0) this.dataDialog.dataScopeType[i].depts = []
this.dataDialog.dataScopeType[i].users = row
break
}
@@ -777,8 +776,8 @@ export default {
},
selectDepts(row) {
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
if (this.dataDialog.dataScopeType[i].dict_id == this.rowData.dictId) {
if (this.dataDialog.dataScopeType[i].users != undefined && this.dataDialog.dataScopeType[i].users.length > 0) this.dataDialog.dataScopeType[i].users = []
if (this.dataDialog.dataScopeType[i].dict_id === this.rowData.dictId) {
if (this.dataDialog.dataScopeType[i].users !== undefined && this.dataDialog.dataScopeType[i].users.length > 0) this.dataDialog.dataScopeType[i].users = []
this.dataDialog.dataScopeType[i].depts = row
break
}
@@ -875,7 +874,7 @@ export default {
checkNode.parent.indeterminate = false
}
// 如果取消所有第二节点的勾选状态,则第一层父节点也取消勾选
if (checkNode.level == 2 && checkNode.parent.childNodes.every(ele => !ele.checked)) {
if (checkNode.level === 2 && checkNode.parent.childNodes.every(ele => !ele.checked)) {
checkNode.parent.checked = false
checkNode.parent.indeterminate = false
}