|
@@ -39,7 +39,7 @@
|
|
</n-modal>
|
|
</n-modal>
|
|
<n-grid x-gap="300" :cols="2">
|
|
<n-grid x-gap="300" :cols="2">
|
|
<n-gi>
|
|
<n-gi>
|
|
- <n-input placeholder="搜索">
|
|
|
|
|
|
+ <n-input placeholder="搜索" autofocus clearable round show-count @change="changeInput">
|
|
<template #prefix>
|
|
<template #prefix>
|
|
<n-icon :component="FlashOutline" />
|
|
<n-icon :component="FlashOutline" />
|
|
</template>
|
|
</template>
|
|
@@ -73,15 +73,13 @@ import {
|
|
FormInst,
|
|
FormInst,
|
|
FormItemInst,
|
|
FormItemInst,
|
|
FormItemRule,
|
|
FormItemRule,
|
|
- FormRules,
|
|
|
|
- messageDark,
|
|
|
|
|
|
+ FormRules
|
|
} from 'naive-ui'
|
|
} from 'naive-ui'
|
|
import { FlashOutline } from '@vicons/ionicons5'
|
|
import { FlashOutline } from '@vicons/ionicons5'
|
|
import { h, defineComponent, ref, onMounted } from 'vue'
|
|
import { h, defineComponent, ref, onMounted } from 'vue'
|
|
import { NButton, useMessage } from 'naive-ui'
|
|
import { NButton, useMessage } from 'naive-ui'
|
|
import type { DataTableColumns } from 'naive-ui'
|
|
import type { DataTableColumns } from 'naive-ui'
|
|
-import { selectTotal, addClass, deleteClass, updateClass } from '~/src/service/api/lesson'
|
|
|
|
-import { setTimeout } from 'timers/promises'
|
|
|
|
|
|
+import { selectTotal, addClass, deleteClass, updateClass, selectCondition } from '~/src/service/api/lesson'
|
|
//获取所有班级类
|
|
//获取所有班级类
|
|
type RowData = {
|
|
type RowData = {
|
|
id: number
|
|
id: number
|
|
@@ -95,7 +93,9 @@ type RowData = {
|
|
tag?: []
|
|
tag?: []
|
|
}
|
|
}
|
|
const tableData = ref([]);
|
|
const tableData = ref([]);
|
|
-function getTableData() {
|
|
|
|
|
|
+async function getTableData() {
|
|
|
|
+ console.log("再次调用");
|
|
|
|
+
|
|
selectTotal().then(r => {
|
|
selectTotal().then(r => {
|
|
tableData.value = r.data;
|
|
tableData.value = r.data;
|
|
// console.log(tableData.value);
|
|
// console.log(tableData.value);
|
|
@@ -198,7 +198,7 @@ let params: easEduClass = {
|
|
createUid: 0,
|
|
createUid: 0,
|
|
disabled: null
|
|
disabled: null
|
|
}
|
|
}
|
|
-function AddClassInter(params) {
|
|
|
|
|
|
+async function AddClassInter(params:any) {
|
|
if (params != "") {
|
|
if (params != "") {
|
|
addClass(params).then(r => {
|
|
addClass(params).then(r => {
|
|
console.log(r);
|
|
console.log(r);
|
|
@@ -242,12 +242,36 @@ const modelUpdateRef = ref({
|
|
name: null,
|
|
name: null,
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+//查询
|
|
|
|
+let SelectConditionParams = {
|
|
|
|
+ id: "",
|
|
|
|
+ name: "",
|
|
|
|
+ manageId: "",
|
|
|
|
+ assistantId: "",
|
|
|
|
+ createTime: "",
|
|
|
|
+ modifyTime: "",
|
|
|
|
+ createUid: "",
|
|
|
|
+ disabled: "",
|
|
|
|
+}
|
|
|
|
|
|
-function UpdateClass(params: UpdateClassParams) {
|
|
|
|
- // updateClass(params);
|
|
|
|
- //更改时间为获取当前时间
|
|
|
|
- params.modifyTime = getLocalTime();
|
|
|
|
- // console.log(params.modifyTime);//2023-08-09 09:31:26
|
|
|
|
|
|
+async function changeInput(e: any) {
|
|
|
|
+ // console.log(e);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ SelectConditionParams.name = e;
|
|
|
|
+ selectCondition(1, 10000, SelectConditionParams).then(r => {
|
|
|
|
+ // console.log(r);
|
|
|
|
+ if(r.data.length==0)
|
|
|
|
+ {
|
|
|
|
+ getTableData();
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ tableData.value=r.data;
|
|
|
|
+ console.log(tableData.value);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
|
|
}
|
|
}
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
@@ -294,10 +318,11 @@ export default defineComponent({
|
|
console.log(r);
|
|
console.log(r);
|
|
})
|
|
})
|
|
message.success('更新成功');
|
|
message.success('更新成功');
|
|
- showModalUpdate.value=!showModalUpdate;
|
|
|
|
-
|
|
|
|
|
|
+ showModalUpdate.value = !showModalUpdate;
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
|
|
+ tableData,
|
|
|
|
+ changeInput,
|
|
handleUpdateClick,
|
|
handleUpdateClick,
|
|
showModalUpdate,
|
|
showModalUpdate,
|
|
handlePositiveClick() {
|
|
handlePositiveClick() {
|
|
@@ -307,6 +332,7 @@ export default defineComponent({
|
|
message.info('并不')
|
|
message.info('并不')
|
|
},
|
|
},
|
|
message,
|
|
message,
|
|
|
|
+ getTableData,
|
|
getDeleteInfo,
|
|
getDeleteInfo,
|
|
formRef,
|
|
formRef,
|
|
formRefUpdate,
|
|
formRefUpdate,
|