Merge pull request '新增 预览学校的功能' (#14) from dev into staging
Reviewed-on: #14
This commit is contained in:
commit
3ce926319b
|
|
@ -33,12 +33,14 @@ const tableData: TableConfig = {
|
||||||
operationColumn: true, // 显示操作按钮
|
operationColumn: true, // 显示操作按钮
|
||||||
operationColumnData: [
|
operationColumnData: [
|
||||||
{
|
{
|
||||||
|
perms: "班级修改",
|
||||||
// 操作按钮
|
// 操作按钮
|
||||||
topBtn: false, // 是头部按钮
|
topBtn: false, // 是头部按钮
|
||||||
label: "修改",
|
label: "修改",
|
||||||
btnType: "edit", // 按钮类型 add edit del custom
|
btnType: "edit", // 按钮类型 add edit del custom
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
perms: "班级新增",
|
||||||
topBtn: true, // 头部按钮
|
topBtn: true, // 头部按钮
|
||||||
label: "新增",
|
label: "新增",
|
||||||
btnType: "custom", // 按钮类型 add edit del custom
|
btnType: "custom", // 按钮类型 add edit del custom
|
||||||
|
|
@ -52,6 +54,7 @@ const tableData: TableConfig = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
perms: "班级删除",
|
||||||
topBtn: false, // 头部按钮
|
topBtn: false, // 头部按钮
|
||||||
show: true,
|
show: true,
|
||||||
label: "删除",
|
label: "删除",
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
show-checkbox
|
show-checkbox
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
|
:check-strictly="true"
|
||||||
:class="isAuthorized ? `menu-tree menu-tree1` : `menu-tree`"
|
:class="isAuthorized ? `menu-tree menu-tree1` : `menu-tree`"
|
||||||
>
|
>
|
||||||
<template #default="{ node, data }">
|
<template #default="{ node, data }">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import ahTable from "@/components/hTable/index.vue";
|
||||||
|
import { ConditionalType, 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 = {
|
||||||
|
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: "编号",
|
||||||
|
search: true,
|
||||||
|
add: false, // 字段允许添加
|
||||||
|
edit: false, // 字段允许修改
|
||||||
|
width: "150px",
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
label: "学校名称",
|
||||||
|
width: "300px",
|
||||||
|
search: true,
|
||||||
|
searchType: ConditionalType.Like,
|
||||||
|
add: true, // 字段允许添加
|
||||||
|
edit: true, // 字段允许修改
|
||||||
|
},
|
||||||
|
pname: {
|
||||||
|
label: "地区",
|
||||||
|
width: "300px",
|
||||||
|
search: false,
|
||||||
|
custom: (row) => `${row.pname}-${row.cname}-${row.rname}`,
|
||||||
|
add: false, // 字段允许添加
|
||||||
|
edit: false, // 字段允许修改
|
||||||
|
},
|
||||||
|
enable: {
|
||||||
|
label: "启用",
|
||||||
|
type: "switch",
|
||||||
|
search: true,
|
||||||
|
custom: (row) => (row.enable ? "启用" : "禁用"),
|
||||||
|
add: true, // 字段允许添加
|
||||||
|
edit: true, // 字段允许修改
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
pageData: {
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
selectRows: [],
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<ahTable v-if="showTable" ref="table" :tableConfig="tableData" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
Loading…
Reference in New Issue