staging #27

Merged
hy merged 3 commits from staging into master 2025-10-16 10:51:15 +08:00
4 changed files with 34 additions and 13 deletions
Showing only changes of commit 3fd4026170 - Show all commits

View File

@ -1,3 +1,4 @@
import { Ref } from "vue";
import { array } from "vue-types";
export interface Dialog {
@ -329,6 +330,8 @@ export interface TableConfig {
searchCallback?: (s: SearchConditions) => void;
/** 新增/修改回调函数 */
editCallback?: (from: any) => void;
/** 编辑表单初始化回调函数 */
editInitCallback?: (from: Ref<Record<string, TableColumn>>) => void;
/** 展开行的回调 */
expandChange?: (row: any, expandedRows: any[]) => void;
/** API地址 */

View File

@ -46,6 +46,9 @@ onMounted(() => {
intiColumn();
fetchInitData();
fetchFormData();
//
if (editData.value.table.editInitCallback)
editData.value.table.editInitCallback(column);
});
function execute(obj, btn) {

View File

@ -69,13 +69,13 @@ const tableData: TableConfig = intTableData({
{
topBtn: true, //
label: "导入",
click:entryAdminnfo,
click: entryAdminnfo,
btnStyle: "info", // topBtn: true success danger
},
{
topBtn: true, //
label: "导入模板",
click:DwImportTemplate,
click: DwImportTemplate,
btnStyle: "info", // topBtn: true success danger
},
],
@ -149,16 +149,16 @@ function entryAdminnfo(eid: number) {
const url = res && window.URL.createObjectURL(res);
const link = document.createElement("a");
link.href = url;
link.setAttribute("download","导入失败管理员信息.xlsx");
link.setAttribute("download", "导入失败管理员信息.xlsx");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
ElMessage.warning("导入失败,已导出错误数据");
};
try {
fileE.click();
} catch (error) { }
} catch (error) {}
}
function DwImportTemplate(obj, row, callBack) {
const baseUrl = import.meta.env.VITE_API_BASEURL;

View File

@ -108,16 +108,27 @@ const tableData: TableConfig = intTableData({
rules: ruleClassName,
},
},
type: {
label: "类型",
elective1: {
label: "主修",
width: "100px",
type: "dropdown",
edit: {
edit: true,
},
},
elective2: {
label: "选修1",
width: "100px",
type: "dropdown",
edit: {
edit: true,
},
},
elective3: {
label: "选修2",
type: "dropdown",
search: {
yes: true,
},
edit: {
add: true,
edit: true,
rules: ruleRequired,
},
},
},
@ -131,9 +142,13 @@ const tableData: TableConfig = intTableData({
const showTable = ref(false);
onMounted(async () => {
//
const subjectC = (await getenum("SubjectEnum")).data;
tableData.column.elective1.setting.datasource = subjectC;
tableData.column.elective2.setting.datasource = subjectC;
tableData.column.elective3.setting.datasource = subjectC;
tableData.column.Grade.setting.datasource = gradeComboModel();
tableData.column.type.setting.datasource = (await getenum("ClassTypeEnum")).data;
// tableData.column.type.setting.datasource = (await getenum("ClassTypeEnum")).data;
tableData.column.schoolId.setting.datasource = (
await SchoolApi.querycombo({ TextName: "Name", ValueName: "Id" })
).data;