优化 学校预览界面

This commit is contained in:
小肥羊 2025-09-25 16:57:12 +08:00
parent f7276250f4
commit 7210002c69
2 changed files with 2 additions and 84 deletions

View File

@ -38,11 +38,13 @@ const tableData: TableConfig = intTableData({
//
topBtn: false, //
label: "修改",
perms: "学校修改",
btnType: "edit", // add edit del custom
},
{
topBtn: true, //
label: "新增学校",
perms: "学校新增",
btnType: "custom", // add edit del custom
btnStyle: "success", // topBtn: true success danger
custom: {
@ -79,10 +81,8 @@ const tableData: TableConfig = intTableData({
label: "学校项目",
width: "200px",
type: "dropdown",
search: new TableColumnSearch(true),
edit: {
multiple: true,
edit: true,
},
},

View File

@ -1,82 +0,0 @@
<script setup lang="ts">
import ahTable from "@/components/hTable/index.vue";
import {
ConditionalType,
intTableData,
TableColumnSearch,
TableConfig,
} from "@/components/hTable/hTable";
import { onMounted, ref } from "vue";
import { fa } from "element-plus/es/locales.mjs";
defineOptions({
name: "SchoolPreview",
});
const showTable = ref(false);
onMounted(() => {
showTable.value = true;
});
function searchCallback(data) {
//let c = data.Conditions.find((s) => s.FieldName == "Pname");
}
const table = ref<{ initTable: (config: TableConfig) => void }>(null);
const tableData: TableConfig = intTableData({
apiUrl: "usercenter/back/schools",
selectColumn: false, //
border: false, //
searchCallback: searchCallback,
search: {
//
show: true,
PageIndex: 0,
PageSize: 20,
OrderBy: "CreateTime", //
defaultConditions: [], //
Conditions: [],
},
operationColumn: true, //
operationColumnData: [],
column: {
//
id: {
label: "编号",
width: "150px",
search: new TableColumnSearch(true),
},
name: {
label: "学校名称",
width: "300px",
search: new TableColumnSearch(true),
edit: {
add: true,
edit: true,
},
},
pname: {
label: "地区",
width: "300px",
custom: (row) => `${row.pname}-${row.cname}-${row.rname}`,
},
enable: {
label: "启用",
type: "switch",
custom: (row) => (row.enable ? "启用" : "禁用"),
search: new TableColumnSearch(true),
edit: {
add: true,
edit: true,
},
},
},
data: [],
pageData: {
total: 0,
},
selectRows: [],
});
</script>
<template>
<div>
<ahTable v-if="showTable" ref="table" :tableConfig="tableData" />
</div>
</template>