dev #16

Merged
hy merged 8 commits from dev into staging 2025-09-14 15:47:29 +08:00
14 changed files with 245 additions and 304 deletions
Showing only changes of commit 492a3e8163 - Show all commits

View File

@ -7,12 +7,12 @@ VITE_PUBLIC_PATH = /
# 开发环境路由历史模式Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数"
VITE_ROUTER_HISTORY = "hash"
# # 接口地址
# VITE_API_BASEURL = "http://192.168.2.33:5199/api"
# #数据中心后台地址
# VITE_API_USERCENTER_URL = "https://dca.w.23544.com:8843/api"
# 接口地址
VITE_API_BASEURL = "https://learn-archives-admin-dev.23544.com/api"
VITE_API_BASEURL = "http://192.168.2.33:5199/api"
#数据中心后台地址
VITE_API_USERCENTER_URL = "https://dca.w.23544.com:8843/api"
# # 接口地址
# VITE_API_BASEURL = "https://learn-archives-admin-dev.23544.com/api"
# #数据中心后台地址
# VITE_API_USERCENTER_URL = "https://dca.w.23544.com:8843/api"

View File

@ -181,7 +181,7 @@ export class TableColumnSearch {
* @param searchType
*/
constructor(yes: boolean = false,
searchType: ConditionalType = ConditionalType.Like,sort: boolean = false,){
searchType: ConditionalType = ConditionalType.Like,sort: boolean = false){
this.yes = yes;
this.sort = sort;
this.searchType = searchType;

View File

@ -15,7 +15,7 @@ import {
} from "vue";
import { Search } from "@element-plus/icons-vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { ElMessage, ElMessageBox, TableColumnCtx } from "element-plus";
import { defineAsyncComponent, AsyncComponentLoader } from "vue";
import {
ButtonCustomConfig,
@ -77,6 +77,7 @@ let Api: hTableAPI = null;
const init = ref(false);
const tableHeight = ref(0);
let defaultOrderBy = null;
const dialog = ref<Dialog>({
visible: false,
@ -251,6 +252,21 @@ function pageIndexChange(o) {
table.value.search.PageIndex = o - 1;
fetchPagedData();
}
/**
* 排序变化时
* @param selection
*/
function sortChange(data: { column: TableColumnCtx<any>; prop: string; order: any }) {
if (data.order == undefined) {
table.value.search.OrderBy = defaultOrderBy.OrderBy;
table.value.search.OrderByType = defaultOrderBy.OrderByType;
} else {
table.value.search.OrderBy = data.prop;
table.value.search.OrderByType = data.order === "ascending" ? 1 : 0;
}
handleReloadPaged();
}
//
function handleSelectionChange(selection) {
console.log("selection-change", selection);
@ -272,6 +288,12 @@ function searchReload() {
}
//
function handleReloadPaged(reload = true) {
if (defaultOrderBy == null) {
defaultOrderBy = {
OrderBy: table.value.search.OrderBy,
OrderByType: table.value.search.OrderByType,
};
}
if (table.value.search === undefined || table.value.search.PageIndex === undefined) {
table.value.search.PageIndex = 0;
table.value.search.PageSize = 20;
@ -358,7 +380,7 @@ function fetchPagedData() {
<div ref="appB_S" class="search-container1">
<!-- 搜索项目 -->
<el-form v-if="table.search.show" :inline="true" :model="table.search">
<el-form-item v-for="(o, n, i) in table.column" v-show="o.search" :key="i">
<el-form-item v-for="(o, n, i) in table.column" v-show="o.search.yes" :key="i">
<el-date-picker
v-if="o.type.trim() == 'datetime'"
v-model="o.search.value as Date"
@ -465,6 +487,7 @@ function fetchPagedData() {
style="width: 100%"
:row-key="rowKeyFun"
@selection-change="handleSelectionChange"
@sort-change="sortChange"
>
<el-table-column v-if="table.selectColumn" type="selection" width="40" />
<el-table-column
@ -500,6 +523,7 @@ function fetchPagedData() {
:prop="name"
:label="item.label"
:width="item.width"
:sortable="item.search.sort ? `custom` : false"
>
<template v-slot="scope">
<div class="columnTemplate">

View File

@ -1,6 +1,6 @@
<script setup lang="ts">
import ahTable from "@/components/hTable/index.vue";
import { ConditionalType, TableConfig } from "@/components/hTable/hTable";
import { ConditionalType, intTableData, TableConfig } from "@/components/hTable/hTable";
import { onMounted, ref, defineOptions } from "vue";
import { fa } from "element-plus/es/locales.mjs";
import { hTableAPI } from "@/api/hTable";
@ -29,7 +29,7 @@ function searchCallback(data) {
}
const RoleApi = new hTableAPI("AdminRole");
const table = ref<{ initTable: (config: TableConfig) => void }>(null);
const tableData: TableConfig = {
const tableData: TableConfig = intTableData({
apiUrl: ControllerName,
selectColumn: false, //
border: false, //
@ -70,63 +70,41 @@ const tableData: TableConfig = {
//
id: {
label: "编号",
search: true,
add: false, //
edit: false, //
search: { yes: true, searchType: ConditionalType.Equal },
width: "150px",
},
name: {
label: "名称",
width: "180px",
rules: ruleRequiredI(12, 2),
search: true,
searchType: ConditionalType.Like,
add: true, //
edit: true, //
search: { yes: true, searchType: ConditionalType.Like },
edit: { add: true, edit: true, rules: ruleRequiredI(12, 2) },
},
phone: {
label: "手机号",
rules: rulePhone,
width: "200px",
search: true,
add: true, //
edit: true, //
search: { yes: true, searchType: ConditionalType.Like },
edit: { add: true, edit: true, rules: rulePhone },
},
account: {
label: "账号",
rules: ruleRequiredI(20, 8),
search: true,
add: true, //
edit: false, //
search: { yes: true },
edit: { add: true, edit: false, rules: ruleRequiredI(20, 8) },
},
password: {
label: "密码",
show: false,
/**长度必须大于6 */
rules: ruleRequiredI(32, 6),
search: false,
add: true, //
edit: false, //
edit: { add: true, edit: false, rules: ruleRequiredI(32, 6) },
},
enable: {
label: "启用",
type: "switch",
search: false,
add: true, //
edit: true, //
valueE: true, //
edit: { add: true, edit: true, editDefault: true },
},
roleId: {
label: "角色",
type: "dropdown",
rules: ruleRequired,
search: true,
add: true, //
edit: false, //
setting: {
datasource: [],
},
search: { yes: true },
edit: { add: true, edit: false, rules: ruleRequired },
},
},
data: [],
@ -134,7 +112,7 @@ const tableData: TableConfig = {
total: 0,
},
selectRows: [],
};
});
const showTable = ref(false);
onMounted(async () => {

View File

@ -1,6 +1,11 @@
<script setup lang="ts">
import ahTable from "@/components/hTable/index.vue";
import { ConditionalType, TableConfig } from "@/components/hTable/hTable";
import {
ConditionalType,
intTableData,
TableColumnSearch,
TableConfig,
} from "@/components/hTable/hTable";
import { onMounted, ref, defineOptions } from "vue";
import { fa } from "element-plus/es/locales.mjs";
import { hTableAPI } from "@/api/hTable";
@ -21,7 +26,7 @@ const props = defineProps<{
function searchCallback(data) {}
const table = ref<{ initTable: (config: TableConfig) => void }>();
const tableData: TableConfig = {
const tableData: TableConfig = intTableData({
apiUrl: ControllerName,
selectColumn: false, //
border: false, //
@ -75,33 +80,22 @@ const tableData: TableConfig = {
//
schoolName: {
label: "学校",
search: true,
searchType: ConditionalType.Like, //
add: false, //
edit: false, //
width: "180px",
search: new TableColumnSearch(true, ConditionalType.Like),
},
grade: {
label: "年级",
width: "100px",
search: true,
add: false, //
edit: false, //
search: new TableColumnSearch(true),
},
className: {
label: "班级",
width: "150px",
search: true,
searchType: ConditionalType.Like, //
add: false, //
edit: false, //
search: new TableColumnSearch(true, ConditionalType.Like),
},
peopleCount: {
label: "参考人数",
width: "100px",
search: false,
add: false, //
edit: false, //
},
// entryPerson: {
// label: "",
@ -113,9 +107,6 @@ const tableData: TableConfig = {
createTime: {
label: "录入时间",
width: "200px",
search: false,
add: false, //
edit: false, //
},
},
data: [],
@ -123,7 +114,7 @@ const tableData: TableConfig = {
total: 0,
},
selectRows: [],
};
});
async function deleteInfo(o, row, c) {
try {

View File

@ -1,6 +1,11 @@
<script setup lang="ts">
import ahTable from "@/components/hTable/index.vue";
import { ConditionalType, TableConfig } from "@/components/hTable/hTable";
import {
ConditionalType,
intTableData,
TableColumnSearch,
TableConfig,
} from "@/components/hTable/hTable";
import { onMounted, ref } from "vue";
import { fa } from "element-plus/es/locales.mjs";
import { hTableAPI } from "@/api/hTable";
@ -18,7 +23,7 @@ const props = defineProps<{
function searchCallback(data) {}
const table = ref<{ initTable: (config: TableConfig) => void }>();
const tableData: TableConfig = {
const tableData: TableConfig = intTableData({
apiUrl: ControllerName,
selectColumn: false, //
border: false, //
@ -53,52 +58,39 @@ const tableData: TableConfig = {
//
schoolName: {
label: "学校",
search: true,
searchType: ConditionalType.Like, //
add: false, //
edit: false, //
width: "180px",
search: new TableColumnSearch(true, ConditionalType.Like),
},
grade: {
label: "年级",
width: "120px",
// custom: (s) => `${s.gradeLevel}${s.gradeYear}`,
search: true,
add: false, //
edit: false, //
search: new TableColumnSearch(true),
},
className: {
label: "班级",
width: "80px",
search: true,
searchType: ConditionalType.Like, //
add: false, //
edit: false, //
search: new TableColumnSearch(true, ConditionalType.Like),
},
examName: {
label: "最近考试",
width: "200px",
search: false,
},
peopleCount: {
label: "参考人数",
width: "100px",
search: false,
},
onLineCount: {
label: "重本人数",
width: "100px",
search: false,
},
onLineRate: {
label: "重本率",
width: "100px",
custom: (row) => `${row.onLineRate * 100}%`,
search: false,
},
onLineRanking: {
label: "重本率排名",
search: false,
width: "100px",
},
},
data: [],
@ -106,7 +98,7 @@ const tableData: TableConfig = {
total: 0,
},
selectRows: [],
};
});
const showTable = ref(false);
onMounted(async () => {

View File

@ -1,6 +1,11 @@
<script setup lang="ts">
import ahTable from "@/components/hTable/index.vue";
import { ConditionalType, TableConfig } from "@/components/hTable/hTable";
import {
ConditionalType,
intTableData,
TableColumnSearch,
TableConfig,
} from "@/components/hTable/hTable";
import { onMounted, ref, defineOptions } from "vue";
import { fa } from "element-plus/es/locales.mjs";
import { hTableAPI } from "@/api/hTable";
@ -22,7 +27,7 @@ const props = defineProps<{
function searchCallback(data) {}
const table = ref<{ initTable: (config: TableConfig) => void }>();
const tableData: TableConfig = {
const tableData: TableConfig = intTableData({
apiUrl: `ExamClassInfo`,
selectColumn: false, //
border: false, //
@ -63,76 +68,63 @@ const tableData: TableConfig = {
//
examName: {
label: "考试名称",
search: true,
width: "150px",
search: new TableColumnSearch(true),
},
type: {
label: "考试类型",
search: true,
type: "dropdown",
setting: {},
width: "80px",
type: "dropdown",
search: new TableColumnSearch(true),
},
testPaperType: {
label: "试卷类型",
search: true,
type: "dropdown",
setting: {},
width: "80px",
type: "dropdown",
search: new TableColumnSearch(true),
},
grade: {
label: "年级",
search: true,
// type: "dropdown",
// setting: {},
width: "60px",
search: new TableColumnSearch(true),
},
onLineCount: {
label: "重本人数",
search: false,
width: "80px",
},
onLineRate: {
label: "重本率",
search: false,
custom: (row) => `${Math.round(row.onLineRate * 100)}%`,
width: "80px",
},
onLineRanking: {
label: "重本率排名",
search: false,
width: "100px",
},
maxScore: {
label: "最高分[赋分]",
search: false,
width: "140px",
},
minScore: {
label: "最低分[赋分]",
search: false,
width: "140px",
},
average: {
label: "总平均分[赋分]",
search: false,
custom: (row) => `${Math.round(row.average)}`,
width: "140px",
},
average1: {
label: "资源校平均分[赋分]",
search: false,
width: "160px",
},
averageRank: {
label: "总平均分排名",
search: false,
width: "110px",
},
rank: {
label: "远端平均/资源校平均",
search: false,
width: "95px",
custom: (row) =>
`${
@ -147,7 +139,7 @@ const tableData: TableConfig = {
total: 0,
},
selectRows: [],
};
});
const showTable = ref(false);
onMounted(async () => {

View File

@ -1,6 +1,11 @@
<script setup lang="ts">
import ahTable from "@/components/hTable/index.vue";
import { ConditionalType, TableConfig } from "@/components/hTable/hTable";
import {
ConditionalType,
intTableData,
TableColumnSearch,
TableConfig,
} from "@/components/hTable/hTable";
import { onMounted, ref } from "vue";
import { fa } from "element-plus/es/locales.mjs";
import { hTableAPI } from "@/api/hTable";
@ -24,7 +29,7 @@ defineOptions({
function searchCallback(data) {}
const table = ref<{ initTable: (config: TableConfig) => void }>();
const tableData: TableConfig = {
const tableData: TableConfig = intTableData({
apiUrl: ControllerName,
selectColumn: false, //
border: false, //
@ -92,81 +97,85 @@ const tableData: TableConfig = {
//
id: {
label: "编号",
search: true,
add: false, //
edit: false, //
search: new TableColumnSearch(true),
width: "150px",
},
name: {
label: "考试名称",
rules: ruleRequired,
width: "200px",
search: true,
searchType: ConditionalType.Like, //
add: true, //
edit: true, //
setting: {},
search: new TableColumnSearch(true, ConditionalType.Like), //
edit: {
add: true,
edit: true,
rules: ruleRequired,
},
},
grade: {
label: "年级",
rules: ruleRequiredGrade,
width: "100px",
search: true,
add: true, //
edit: false, //
search: new TableColumnSearch(true),
edit: {
add: true,
edit: false,
rules: ruleRequiredGrade,
},
},
testPaperType: {
label: "试卷类型",
rules: ruleRequired,
width: "100px",
type: "dropdown",
setting: {},
search: true,
add: true, //
edit: true, //
search: new TableColumnSearch(true),
edit: {
add: true,
edit: true,
rules: ruleRequired,
},
},
type: {
label: "考试类型",
rules: ruleRequired,
width: "100px",
type: "dropdown",
setting: {},
search: true,
add: true, //
edit: true, //
search: new TableColumnSearch(true),
edit: {
add: true,
edit: true,
rules: ruleRequired,
},
},
scoreLine: {
label: "划线分数",
rules: ruleNumber,
search: false,
width: "100px",
add: true, //
edit: true, //
edit: {
add: true,
edit: true,
rules: ruleNumber,
},
},
baseSchoolScore: {
label: "资源校平均分",
rules: ruleNumber,
search: false,
width: "150px",
add: true, //
edit: true, //
edit: {
add: true,
edit: true,
rules: ruleNumber,
},
},
startTime: {
label: "考试时间",
width: "210px",
rules: ruleRequired,
search: true,
type: "datetime",
setting: {},
add: true, //
edit: true, //
custom: (row) => row.startTime?.replace("T", " ").substring(0, 10) ?? "",
search: new TableColumnSearch(true),
edit: {
add: true,
edit: true,
rules: ruleRequired,
},
},
createTime: {
label: "创建时间",
type: "datetime",
search: false,
add: false, //
edit: false, //
custom: (row) => row.startTime?.replace("T", " ").substring(0, 10) ?? "",
},
},
data: [],
@ -174,7 +183,7 @@ const tableData: TableConfig = {
total: 0,
},
selectRows: [],
};
});
function DwImportTemplate(obj, row, callBack) {
const baseUrl = import.meta.env.VITE_API_BASEURL;

View File

@ -1,6 +1,11 @@
<script setup lang="ts">
import ahTable from "@/components/hTable/index.vue";
import { ConditionalType, TableConfig } from "@/components/hTable/hTable";
import {
ConditionalType,
intTableData,
TableColumnSearch,
TableConfig,
} from "@/components/hTable/hTable";
import { onMounted, ref } from "vue";
import { fa } from "element-plus/es/locales.mjs";
import { hTableAPI } from "@/api/hTable";
@ -18,7 +23,7 @@ const props = defineProps<{
function searchCallback(data) {}
const table = ref<{ initTable: (config: TableConfig) => void }>();
const tableData: TableConfig = {
const tableData: TableConfig = intTableData({
apiUrl: ControllerName,
selectColumn: false, //
border: false, //
@ -44,26 +49,6 @@ const tableData: TableConfig = {
},
operationColumn: true, //
operationColumnData: [
{
//
topBtn: true, //
label: "成绩升序",
btnStyle: "primary",
click: (o, r, c) => {
tableData.search.OrderByType = 1;
c();
},
},
{
//
topBtn: true, //
label: "成绩降序",
btnStyle: "primary",
click: (o, r, c) => {
tableData.search.OrderByType = 0;
c();
},
},
{
topBtn: false, //
label: "个人详情",
@ -81,72 +66,61 @@ const tableData: TableConfig = {
//
userName: {
label: "姓名",
search: true,
searchType: ConditionalType.Like, //
width: "180px",
search: new TableColumnSearch(true, ConditionalType.Like),
},
语文: {
label: "语文",
search: false,
width: "100px",
custom: (row) => row.subjectDic.语文,
search: { sort: true },
},
数学: {
label: "数学",
search: false,
width: "100px",
custom: (row) => row.subjectDic.数学,
},
英语: {
label: "英语",
search: false,
width: "100px",
custom: (row) => row.subjectDic.英语,
},
物理: {
label: "物理",
search: false,
width: "100px",
custom: (row) => row.subjectDic.物理,
},
化学: {
label: "化学",
search: false,
width: "100px",
custom: (row) => row.subjectDic.化学,
},
生物: {
label: "生物",
search: false,
width: "100px",
custom: (row) => row.subjectDic.生物,
},
政治: {
label: "政治",
search: false,
width: "100px",
custom: (row) => row.subjectDic.政治,
},
历史: {
label: "历史",
search: false,
width: "100px",
custom: (row) => row.subjectDic.历史,
},
地理: {
label: "地理",
search: false,
width: "100px",
custom: (row) => row.subjectDic.地理 ?? "--",
},
assignScore: {
label: "赋分总分",
search: false,
width: "180px",
},
assignRanking: {
label: "赋分后的排名",
search: false,
width: "200px",
},
},
@ -155,12 +129,11 @@ const tableData: TableConfig = {
total: 0,
},
selectRows: [],
};
});
const showTable = ref(false);
onMounted(async () => {
//
showTable.value = true;
});
const exam = props.data[0];

View File

@ -1,6 +1,11 @@
<script setup lang="ts">
import ahTable from "@/components/hTable/index.vue";
import { ConditionalType, TableConfig } from "@/components/hTable/hTable";
import {
ConditionalType,
intTableData,
TableColumnSearch,
TableConfig,
} from "@/components/hTable/hTable";
import { onMounted, ref } from "vue";
import { fa } from "element-plus/es/locales.mjs";
import { hTableAPI } from "@/api/hTable";
@ -19,7 +24,7 @@ const props = defineProps<{
function searchCallback(data) {}
const table = ref<{ initTable: (config: TableConfig) => void }>();
const tableData: TableConfig = {
const tableData: TableConfig = intTableData({
apiUrl: ControllerName,
selectColumn: false, //
border: false, //
@ -28,7 +33,7 @@ const tableData: TableConfig = {
//
show: true,
PageIndex: 0,
PageSize: 60,
PageSize: 999,
OrderBy: "Id", //
OrderByType: 1,
defaultConditions: [
@ -45,94 +50,80 @@ const tableData: TableConfig = {
//
examName: {
label: "考试名称",
search: true,
searchType: ConditionalType.Like, //
search: new TableColumnSearch(true, ConditionalType.Like),
width: "180px",
},
//
type: {
label: "考试类型",
search: true,
type: "dropdown",
setting: {},
width: "150px",
type: "dropdown",
search: new TableColumnSearch(true),
},
//
grade: {
label: "考试阶段",
search: true,
searchType: ConditionalType.Like, //
width: "120px",
search: new TableColumnSearch(true, ConditionalType.Like),
}, //
testPaperType: {
label: "试卷类型",
search: true,
type: "dropdown",
setting: {},
width: "150px",
type: "dropdown",
search: new TableColumnSearch(true),
},
语文: {
label: "语文",
search: false,
width: "80px",
custom: (row) => row.subjectDic.语文 ?? "--",
search: { sort: true },
},
数学: {
label: "数学",
search: false,
width: "80px",
custom: (row) => row.subjectDic.数学 ?? "--",
},
英语: {
label: "英语",
search: false,
width: "80px",
custom: (row) => row.subjectDic.英语 ?? "--",
},
物理: {
label: "物理",
search: false,
width: "80px",
custom: (row) => row.subjectDic.物理 ?? "--",
},
化学: {
label: "化学",
search: false,
width: "80px",
custom: (row) => row.subjectDic.化学 ?? "--",
},
生物: {
label: "生物",
search: false,
width: "80px",
custom: (row) => row.subjectDic.生物 ?? "--",
},
政治: {
label: "政治",
search: false,
width: "80px",
custom: (row) => row.subjectDic.政治 ?? "--",
},
历史: {
label: "历史",
search: false,
width: "80px",
custom: (row) => row.subjectDic.历史 ?? "--",
},
地理: {
label: "地理",
search: false,
width: "80px",
custom: (row) => row.subjectDic.地理 ?? "--",
},
assignScore: {
label: "赋分总分",
search: false,
width: "80px",
},
assignRanking: {
label: "赋分后的排名",
search: false,
width: "120px",
},
},
@ -141,7 +132,7 @@ const tableData: TableConfig = {
total: 0,
},
selectRows: [],
};
});
const showTable = ref(false);
const exam = props.data[0];

View File

@ -9,7 +9,7 @@ import { ruleRequired } from "@/utils/rules";
const ControllerName = "Grade";
defineOptions({
name: ControllerName
name: ControllerName,
});
const SchoolApi = new hTableAPI("usercenter/back/schools");
@ -28,7 +28,7 @@ const tableData: TableConfig = {
PageSize: 20,
OrderBy: "CreateTime", //
defaultConditions: [], //
Conditions: []
Conditions: [],
},
operationColumn: true, //
operationColumnData: [
@ -36,92 +36,90 @@ const tableData: TableConfig = {
//
topBtn: false, //
label: "修改",
btnType: "edit" // add edit del custom
btnType: "edit", // add edit del custom
},
{
//
topBtn: true, //
label: "添加",
btnStyle: "success",
btnType: "add" // add edit del custom
btnType: "add", // add edit del custom
},
{
topBtn: false, //
show: true,
label: "删除",
btnType: "del", // add edit del
btnStyle: "danger" // topBtn: true success danger
}
btnStyle: "danger", // topBtn: true success danger
},
],
column: {
//
id: {
label: "编号",
search: true,
add: false, //
edit: false, //
width: "150px"
},
schoolId: {
label: "学校",
rules: ruleRequired,
width: "200px",
search: true,
type: "dropdown",
add: true, //
edit: true, //
setting: {}
},
name: {
label: "名称[动态]",
rules: ruleRequired,
width: "100px",
search: false,
searchType: ConditionalType.Like,
add: false, //
edit: false //
},
level: {
label: "年级",
rules: ruleRequired,
width: "80px",
type: "dropdown",
search: true,
setting: {},
add: true, //
edit: true //
},
year: {
label: "毕业届",
width: "80px",
rules: ruleRequired,
search: true,
setting: {},
add: true, //
edit: true //
},
createTime: {
label: "创建时间",
type: "datetime",
search: true,
add: false, //
edit: false //
}
// //
// id: {
// label: "",
// search: true,
// add: false, //
// edit: false, //
// width: "150px"
// },
// schoolId: {
// label: "",
// rules: ruleRequired,
// width: "200px",
// search: true,
// type: "dropdown",
// add: true, //
// edit: true, //
// setting: {}
// },
// name: {
// label: "[]",
// rules: ruleRequired,
// width: "100px",
// search: false,
// searchType: ConditionalType.Like,
// add: false, //
// edit: false //
// },
// level: {
// label: "",
// rules: ruleRequired,
// width: "80px",
// type: "dropdown",
// search: true,
// setting: {},
// add: true, //
// edit: true //
// },
// year: {
// label: "",
// width: "80px",
// rules: ruleRequired,
// search: true,
// setting: {},
// add: true, //
// edit: true //
// },
// createTime: {
// label: "",
// type: "datetime",
// search: true,
// add: false, //
// edit: false //
// }
},
data: [],
pageData: {
total: 0
total: 0,
},
selectRows: []
selectRows: [],
};
const showTable = ref(false);
onMounted(async () => {
//
tableData.column.level.setting.datasource = (
await getenum("GradeLevelEnum")
).data;
tableData.column.level.setting.datasource = (await getenum("GradeLevelEnum")).data;
tableData.column.schoolId.setting.datasource = (
await SchoolApi.querycombo({ TextName: "Name", ValueName: "Id" })

View File

@ -2,6 +2,7 @@
import ahTable from "@/components/hTable/index.vue";
import {
ConditionalType,
intTableData,
TableColumnSearch,
TableConfig,
} from "@/components/hTable/hTable";
@ -16,7 +17,7 @@ function searchCallback(data) {
//let c = data.Conditions.find((s) => s.FieldName == "Pname");
}
const table = ref<{ initTable: (config: TableConfig) => void }>(null);
const tableData: TableConfig = {
const tableData: TableConfig = intTableData({
apiUrl: "usercenter/back/schools",
selectColumn: false, //
border: false, //
@ -89,7 +90,7 @@ const tableData: TableConfig = {
total: 0,
},
selectRows: [],
};
});
</script>
<template>

View File

@ -1,6 +1,11 @@
<script setup lang="ts">
import ahTable from "@/components/hTable/index.vue";
import { ConditionalType, TableConfig } from "@/components/hTable/hTable";
import {
ConditionalType,
intTableData,
TableColumnSearch,
TableConfig,
} from "@/components/hTable/hTable";
import { onMounted, ref } from "vue";
import { fa } from "element-plus/es/locales.mjs";
defineOptions({
@ -15,7 +20,7 @@ function searchCallback(data) {
//let c = data.Conditions.find((s) => s.FieldName == "Pname");
}
const table = ref<{ initTable: (config: TableConfig) => void }>(null);
const tableData: TableConfig = {
const tableData: TableConfig = intTableData({
apiUrl: "usercenter/back/schools",
selectColumn: false, //
border: false, //
@ -35,34 +40,32 @@ const tableData: TableConfig = {
//
id: {
label: "编号",
search: true,
add: false, //
edit: false, //
width: "150px",
search: new TableColumnSearch(true),
},
name: {
label: "学校名称",
width: "300px",
search: true,
searchType: ConditionalType.Like,
add: true, //
edit: true, //
search: new TableColumnSearch(true),
edit: {
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, //
search: new TableColumnSearch(true),
edit: {
add: true,
edit: true,
},
},
},
data: [],
@ -70,7 +73,7 @@ const tableData: TableConfig = {
total: 0,
},
selectRows: [],
};
});
</script>
<template>
<div>

View File

@ -1,11 +0,0 @@
<script setup lang="ts" name="Testxb">
import { ref } from "vue";
// defineOptions({
// name: "Testxb"
// });
let name = ref("nihao");
</script>
<template>
<div>测试菜单</div>
</template>