style: 部门改为班级
This commit is contained in:
@@ -32,9 +32,9 @@ let dict: {
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**部门名称 */
|
||||
/**班级名称 */
|
||||
deptName: '',
|
||||
/**部门状态 */
|
||||
/**班级状态 */
|
||||
status: undefined,
|
||||
});
|
||||
|
||||
@@ -135,7 +135,7 @@ function fnTableExpandedRowsChange(expandedRows: (string | number)[]) {
|
||||
tableState.expandedRowKeys = expandedRows;
|
||||
}
|
||||
|
||||
/**初始上级部门选择树 */
|
||||
/**初始上级班级选择树 */
|
||||
let treeDataAll: Record<string, any>[] = [];
|
||||
|
||||
/**对话框对象信息状态类型 */
|
||||
@@ -150,7 +150,7 @@ type ModalStateType = {
|
||||
from: Record<string, any>;
|
||||
/**确定按钮 loading */
|
||||
confirmLoading: boolean;
|
||||
/**上级部门选择树 */
|
||||
/**上级班级选择树 */
|
||||
treeData: Record<string, any>[];
|
||||
};
|
||||
|
||||
@@ -158,7 +158,7 @@ type ModalStateType = {
|
||||
let modalState: ModalStateType = reactive({
|
||||
visibleByView: false,
|
||||
visibleByEdit: false,
|
||||
title: '部门',
|
||||
title: '班级',
|
||||
from: {
|
||||
deptId: undefined,
|
||||
deptName: '',
|
||||
@@ -212,7 +212,7 @@ const modalStateFrom = Form.useForm(
|
||||
|
||||
/**
|
||||
* 对话框弹出显示为 查看
|
||||
* @param deptId 部门编号id
|
||||
* @param deptId 班级编号id
|
||||
*/
|
||||
function fnModalVisibleByVive(deptId: string | number) {
|
||||
if (!deptId) {
|
||||
@@ -244,8 +244,8 @@ function fnModalVisibleByVive(deptId: string | number) {
|
||||
|
||||
/**
|
||||
* 对话框弹出显示为 新增或者修改
|
||||
* @param deptId 部门编号id, 不传为新增
|
||||
* @param parentId 上级部门id
|
||||
* @param deptId 班级编号id, 不传为新增
|
||||
* @param parentId 上级班级id
|
||||
*/
|
||||
function fnModalVisibleByEdit(
|
||||
deptId?: string | number,
|
||||
@@ -263,7 +263,7 @@ function fnModalVisibleByEdit(
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
// 获取部门信息同时查询部门列表(排除节点)
|
||||
// 获取班级信息同时查询班级列表(排除节点)
|
||||
Promise.all([getDept(deptId), listDeptExcludeChild(deptId)])
|
||||
.then(resArr => {
|
||||
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
|
||||
@@ -318,7 +318,7 @@ function fnModalOk() {
|
||||
duration: 2,
|
||||
});
|
||||
modalState.visibleByEdit = false;
|
||||
// 新增时清空上级部门树重新获取
|
||||
// 新增时清空上级班级树重新获取
|
||||
if (!from.deptId) {
|
||||
treeDataAll = [];
|
||||
}
|
||||
@@ -352,8 +352,8 @@ function fnModalCancel() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门删除
|
||||
* @param deptId 部门编号id
|
||||
* 班级删除
|
||||
* @param deptId 班级编号id
|
||||
*/
|
||||
function fnRecordDelete(deptId: string | number) {
|
||||
Modal.confirm({
|
||||
@@ -380,14 +380,14 @@ function fnRecordDelete(deptId: string | number) {
|
||||
});
|
||||
}
|
||||
|
||||
/**查询部门列表 */
|
||||
/**查询班级列表 */
|
||||
function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listDept(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
const treeData = parseDataToTree(res.data, 'deptId');
|
||||
// 初始上级部门和展开编号key
|
||||
// 初始上级班级和展开编号key
|
||||
if (treeDataAll.length <= 0) {
|
||||
// 转换树状数据
|
||||
treeDataAll = treeData;
|
||||
|
||||
Reference in New Issue
Block a user