feat: add order

This commit is contained in:
2025-10-08 18:13:53 +08:00
parent a290db8b35
commit 39b9e0c6f4
4 changed files with 61 additions and 56 deletions

View File

@@ -31,7 +31,7 @@
<el-button
icon="el-icon-setting"
@click="handleRole"
v-if="userInfo.authority.includes('admin')"
v-if="userInfo.authority.includes('admin')||userInfo.authority.includes('manager')"
plain
>Authority
</el-button>
@@ -41,7 +41,7 @@
type="primary"
text
icon="el-icon-setting"
v-if="userInfo.authority.includes('admin')"
v-if="userInfo.authority.includes('admin')||userInfo.authority.includes('manager')"
plain
style="border: 0; background-color: transparent !important"
@click.stop="handleRowRole(row)"

View File

@@ -38,7 +38,7 @@
type="primary"
icon="el-icon-plus"
@click="$refs.crud.rowAdd()"
>Add
>Add
</el-button>
<el-button
type="danger"
@@ -46,39 +46,39 @@
icon="el-icon-delete"
v-if="permission.user_delete && !auditMode"
@click="handleDelete"
>Delete
>Delete
</el-button>
<el-button
type="primary"
plain
icon="el-icon-operation"
v-if="userInfo.authority.includes('admin') && !auditMode"
v-if="(userInfo.authority.includes('admin') || userInfo.authority.includes('manager')) && !auditMode"
@click="handleAudit"
>Audit
>Audit
</el-button>
<el-button
type="success"
plain
icon="el-icon-check"
v-if="userInfo.authority.includes('admin') && auditMode"
v-if="(userInfo.authority.includes('admin') || userInfo.authority.includes('manager'))&& auditMode"
@click="handleAuditPass"
>Pass
>Pass
</el-button>
<el-button
type="danger"
plain
icon="el-icon-close"
v-if="userInfo.authority.includes('admin') && auditMode"
v-if="(userInfo.authority.includes('admin') || userInfo.authority.includes('manager')) && auditMode"
@click="handleAuditRefuse"
>Reject
>Reject
</el-button>
<el-button
type="primary"
plain
icon="el-icon-refresh-left"
v-if="userInfo.authority.includes('admin') && auditMode"
v-if="(userInfo.authority.includes('admin') || userInfo.authority.includes('manager')) && auditMode"
@click="handleAuditBack"
>Back
>Back
</el-button>
<el-button
type="info"
@@ -86,7 +86,7 @@
v-if="permission.user_role && !auditMode"
icon="el-icon-user"
@click="handleGrant"
>Role
>Role
</el-button>
<el-button
type="info"
@@ -94,7 +94,7 @@
v-if="permission.user_reset && !auditMode"
icon="el-icon-refresh"
@click="handleReset"
>Reset
>Reset
</el-button>
<el-button
type="info"
@@ -102,7 +102,7 @@
v-if="userInfo.authority.includes('admin') && !auditMode"
icon="el-icon-setting"
@click="handlePlatform"
>Platform
>Platform
</el-button>
<el-button
type="info"
@@ -110,7 +110,7 @@
v-if="userInfo.authority.includes('admin') && !auditMode"
icon="el-icon-coordinate"
@click="handleLock"
>Unlock
>Unlock
</el-button>
<el-button
type="success"
@@ -118,7 +118,7 @@
v-if="userInfo.authority.includes('admin') && !auditMode"
icon="el-icon-upload"
@click="handleImport"
>Import
>Import
</el-button>
<el-button
type="warning"
@@ -126,7 +126,7 @@
v-if="userInfo.authority.includes('admin') && !auditMode"
icon="el-icon-download"
@click="handleExport"
>Export
>Export
</el-button>
</template>
<template #menu="{ row, index, size }">
@@ -136,7 +136,7 @@
icon="el-icon-view"
v-if="this.permission.user_view"
@click.stop="$refs.crud.rowView(row, index)"
>View
>View
</el-button>
<el-button
text
@@ -144,18 +144,23 @@
icon="el-icon-edit"
v-if="this.permission.user_edit"
@click.stop="$refs.crud.rowEdit(row, index)"
>Edit
>Edit
</el-button>
<el-dropdown @command="command => handleDropdownCommand(command, row, index)">
<el-button text type="primary" icon="el-icon-setting">More</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="setLeader" v-if="userInfo.authority.includes('admin')">
<el-icon><circle-close v-if="row.isLeader === 1" /><user v-else /></el-icon>
<el-icon>
<circle-close v-if="row.isLeader === 1" />
<user v-else />
</el-icon>
{{ row.isLeader === 1 ? 'Cancel leader' : 'Set leader' }}
</el-dropdown-item>
<el-dropdown-item command="delete" v-if="this.permission.user_delete">
<el-icon><delete /></el-icon>
<el-icon>
<delete />
</el-icon>
Delete
</el-dropdown-item>
</el-dropdown-menu>
@@ -250,7 +255,7 @@ import {
auditPass,
auditRefuse,
setLeader,
getLeaderList,
getLeaderList
} from '@/api/system/user';
import { exportBlob } from '@/api/common';
import { getDeptTree } from '@/api/system/dept';
@@ -284,20 +289,20 @@ export default {
page: {
pageSize: 10,
currentPage: 1,
total: 0,
total: 0
},
platformPage: {
pageSize: 10,
currentPage: 1,
total: 0,
total: 0
},
init: {
roleTree: [],
deptTree: [],
deptTree: []
},
props: {
label: 'title',
value: 'key',
value: 'key'
},
roleGrantList: [],
roleTreeObj: [],
@@ -312,7 +317,7 @@ export default {
platformForm: {},
platformOption: platformOption,
excelForm: {},
excelOption: excelOption,
excelOption: excelOption
};
},
watch: {
@@ -326,7 +331,7 @@ export default {
const column = this.findObject(this.excelOption.column, 'excelFile');
column.action = `/blade-system/user/import-user?isCovered=${this.excelForm.isCovered}`;
}
},
}
},
computed: {
...mapGetters(['userInfo', 'permission']),
@@ -335,7 +340,7 @@ export default {
addBtn: this.validData(this.permission.user_add, false),
viewBtn: false,
delBtn: false,
editBtn: false,
editBtn: false
};
},
platformPermissionList() {
@@ -343,7 +348,7 @@ export default {
addBtn: false,
viewBtn: false,
delBtn: false,
editBtn: this.validData(this.permission.user_edit, false),
editBtn: this.validData(this.permission.user_edit, false)
};
},
ids() {
@@ -352,7 +357,7 @@ export default {
ids.push(ele.id);
});
return ids.join(',');
},
}
},
mounted() {
// 非租户模式默认加载管理组数据
@@ -365,7 +370,7 @@ export default {
created() {
// 创建脱敏工具实例
this.sensitiveManager = sensitive.create({
fields: ['phone', 'email'], // 配置需要脱敏的字段
fields: ['phone', 'email'] // 配置需要脱敏的字段
});
},
methods: {
@@ -387,7 +392,7 @@ export default {
this.$confirm(tip, {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning',
type: 'warning'
})
.then(() => {
return setLeader(row.id);
@@ -395,7 +400,7 @@ export default {
.then(() => {
this.$message({
type: 'success',
message: message,
message: message
});
this.onLoad(this.page);
});
@@ -424,7 +429,7 @@ export default {
this.roleBox = false;
this.$message({
type: 'success',
message: 'Success!',
message: 'Success!'
});
this.onLoad(this.page);
});
@@ -440,7 +445,7 @@ export default {
this.onLoad(this.page);
this.$message({
type: 'success',
message: 'Success!',
message: 'Success!'
});
done();
},
@@ -463,7 +468,7 @@ export default {
this.onLoad(this.page);
this.$message({
type: 'success',
message: 'Success!',
message: 'Success!'
});
done();
},
@@ -477,7 +482,7 @@ export default {
this.$confirm('Confirmation for Delete?', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning',
type: 'warning'
})
.then(() => {
return remove(row.id);
@@ -486,7 +491,7 @@ export default {
this.onLoad(this.page);
this.$message({
type: 'success',
message: 'Success!',
message: 'Success!'
});
});
},
@@ -516,7 +521,7 @@ export default {
this.$confirm('Confirmation for DEL?', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning',
type: 'warning'
})
.then(() => {
return remove(this.ids);
@@ -525,7 +530,7 @@ export default {
this.onLoad(this.page);
this.$message({
type: 'success',
message: 'Success!',
message: 'Success!'
});
this.$refs.crud.toggleSelection();
});
@@ -542,7 +547,7 @@ export default {
this.$confirm('确定将选择数据通过审核?', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning',
type: 'warning'
})
.then(() => {
return auditPass(this.ids);
@@ -551,7 +556,7 @@ export default {
this.onLoad(this.page);
this.$message({
type: 'success',
message: 'Success!',
message: 'Success!'
});
this.$refs.crud.toggleSelection();
});
@@ -564,7 +569,7 @@ export default {
this.$confirm('确定将选择数据拒绝审核?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
})
.then(() => {
return auditRefuse(this.ids);
@@ -573,7 +578,7 @@ export default {
this.onLoad(this.page);
this.$message({
type: 'success',
message: 'Success!',
message: 'Success!'
});
this.$refs.crud.toggleSelection();
});
@@ -590,7 +595,7 @@ export default {
this.$confirm('确定将选择账号密码重置为初始密码?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
})
.then(() => {
return resetPassword(this.ids);
@@ -598,7 +603,7 @@ export default {
.then(() => {
this.$message({
type: 'success',
message: '操作成功!',
message: '操作成功!'
});
this.$refs.crud.toggleSelection();
});
@@ -628,7 +633,7 @@ export default {
this.$confirm('确定将选择账号解封?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
})
.then(() => {
return unlock(this.ids);
@@ -636,7 +641,7 @@ export default {
.then(() => {
this.$message({
type: 'success',
message: '操作成功!',
message: '操作成功!'
});
});
},
@@ -655,7 +660,7 @@ export default {
this.$confirm('是否导出用户数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
}).then(() => {
NProgress.start();
exportBlob(
@@ -731,7 +736,7 @@ export default {
this.platformOnLoad(this.platformPage);
this.$message({
type: 'success',
message: '操作成功!',
message: '操作成功!'
});
done();
},
@@ -789,8 +794,8 @@ export default {
this.platformLoading = false;
this.selectionClear();
});
},
},
}
}
};
</script>