|
@@ -56,7 +56,7 @@ const emit = defineEmits(['choose']);
|
|
|
|
|
|
// 定义变量内容
|
|
|
const state = reactive({
|
|
|
- tableData: [], // 表格数据
|
|
|
+ tableData: [] as any [], // 表格数据
|
|
|
total: 0, // 总条数
|
|
|
loading: false, // 加载
|
|
|
queryParams: {
|
|
@@ -64,7 +64,7 @@ const state = reactive({
|
|
|
PageSize: 10, // 每页条数
|
|
|
name: null, // 关键字
|
|
|
},
|
|
|
- tableCheckbox: '', // 选择的ID
|
|
|
+ tableCheckbox: [] as any[], // 选择的ID
|
|
|
});
|
|
|
const ruleDialogFormRef = ref<FormInstance>(); // 表单
|
|
|
const dialogVisible = ref(false); // 弹窗
|
|
@@ -77,7 +77,7 @@ const openDialog = async (row: any[]) => {
|
|
|
if (row) {
|
|
|
state.tableCheckbox = row;
|
|
|
} else {
|
|
|
- state.tableCheckbox = '';
|
|
|
+ state.tableCheckbox = [];
|
|
|
}
|
|
|
queryList();
|
|
|
} catch (error) {
|
|
@@ -96,9 +96,9 @@ const queryList = () => {
|
|
|
getCoursewareData(state.queryParams)
|
|
|
.then((res: any) => {
|
|
|
state.tableData = res.result?.items ?? [];
|
|
|
- state.total = res.result?.total ?? 0;
|
|
|
+ state.total = res.result?.pagination.totalCount ?? 0;
|
|
|
state.loading = false;
|
|
|
- const rows = [];
|
|
|
+ const rows = [] as any[];
|
|
|
state.tableCheckbox.forEach(item => {
|
|
|
rows.push(state.tableData.find((it) => it.id === item.sourcewareId));
|
|
|
})
|