mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 11:56:46 +08:00
修改问题
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -110,7 +110,7 @@
|
|||||||
<template #actions="{ text, record, index }">
|
<template #actions="{ text, record, index }">
|
||||||
<a-space :key="record.id">
|
<a-space :key="record.id">
|
||||||
<a-button @click="() => handleMark(record)" type="link" v-if="!record.qualityStatus">
|
<a-button @click="() => handleMark(record)" type="link" v-if="!record.qualityStatus">
|
||||||
标记课程
|
标记精品课
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button @click="() => handleNo(record)" type="link" v-if="record.qualityStatus">
|
<a-button @click="() => handleNo(record)" type="link" v-if="record.qualityStatus">
|
||||||
取消标记
|
取消标记
|
||||||
@@ -173,9 +173,6 @@ export default defineComponent({
|
|||||||
noMark: "是否确认取消标记当前课程为精品课?",
|
noMark: "是否确认取消标记当前课程为精品课?",
|
||||||
noTop: "是否确认取消置顶当前课程?"
|
noTop: "是否确认取消置顶当前课程?"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
tableLoading: false,
|
tableLoading: false,
|
||||||
// 添加年份相关数据
|
// 添加年份相关数据
|
||||||
@@ -293,48 +290,51 @@ export default defineComponent({
|
|||||||
key: "qualityTopSort",
|
key: "qualityTopSort",
|
||||||
align: "center",
|
align: "center",
|
||||||
customRender: ({ text, record, index }) => {
|
customRender: ({ text, record, index }) => {
|
||||||
// 如果处于编辑状态,显示输入框
|
if (record.qualityTop) {
|
||||||
if (record.editingTopOrder) {
|
// 如果处于编辑状态,显示输入框
|
||||||
return (
|
if (record.editingTopOrder) {
|
||||||
<a-input
|
return (
|
||||||
value={text || ''}
|
<a-input
|
||||||
style={{ width: '60px' }}
|
value={text || ''}
|
||||||
onBlur={() => {
|
style={{ width: '60px' }}
|
||||||
// 失去焦点时取消编辑状态
|
onBlur={() => {
|
||||||
record.editingTopOrder = false;
|
// 失去焦点时取消编辑状态
|
||||||
try {
|
|
||||||
// 这里应该调用实际的API接口
|
|
||||||
let res = getToTopSort({ courseId: record.courseId, qualityTopSort: record.qualityTopSort });
|
|
||||||
if (res.data.status == 200) {
|
|
||||||
message.success(res.data.message);
|
|
||||||
// 重新加载数据
|
|
||||||
getTableDate();
|
|
||||||
} else {
|
|
||||||
message.error(res.data.message);
|
|
||||||
}
|
|
||||||
// 重新加载数据
|
|
||||||
// getTableDate();
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
// 这里可以添加保存到服务器的逻辑
|
|
||||||
}}
|
|
||||||
onChange={(e) => {
|
|
||||||
// 更新数据
|
|
||||||
record.qualityTopSort = e.target.value;
|
|
||||||
|
|
||||||
}}
|
|
||||||
onKeydown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
// 按回车时保存并取消编辑状态
|
|
||||||
record.editingTopOrder = false;
|
record.editingTopOrder = false;
|
||||||
|
try {
|
||||||
|
// 这里应该调用实际的API接口
|
||||||
|
let res = getToTopSort({ courseId: record.courseId, qualityTopSort: record.qualityTopSort });
|
||||||
|
if (res.data.status == 200) {
|
||||||
|
message.success(res.data.message);
|
||||||
|
// 重新加载数据
|
||||||
|
getTableDate();
|
||||||
|
} else {
|
||||||
|
message.error(res.data.message);
|
||||||
|
}
|
||||||
|
// 重新加载数据
|
||||||
|
// getTableDate();
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
// 这里可以添加保存到服务器的逻辑
|
// 这里可以添加保存到服务器的逻辑
|
||||||
}
|
}}
|
||||||
}}
|
onChange={(e) => {
|
||||||
/>
|
// 更新数据
|
||||||
);
|
record.qualityTopSort = e.target.value;
|
||||||
|
|
||||||
|
}}
|
||||||
|
onKeydown={(e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
// 按回车时保存并取消编辑状态
|
||||||
|
record.editingTopOrder = false;
|
||||||
|
// 这里可以添加保存到服务器的逻辑
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 否则显示文本,点击后进入编辑状态
|
// 否则显示文本,点击后进入编辑状态
|
||||||
return (
|
return (
|
||||||
<div onClick={() => { record.editingTopOrder = true; }}>
|
<div onClick={() => { record.editingTopOrder = true; }}>
|
||||||
@@ -357,69 +357,69 @@ export default defineComponent({
|
|||||||
],
|
],
|
||||||
//列表表格
|
//列表表格
|
||||||
tableData1: [
|
tableData1: [
|
||||||
// {
|
{
|
||||||
// id: 2,
|
id: 2,
|
||||||
// name: "React核心概念详解",
|
name: "React核心概念详解",
|
||||||
// sysType1: "A01",
|
sysType1: "A01",
|
||||||
// sysType2: "B02",
|
sysType2: "B02",
|
||||||
// sysTypeId: "A01",
|
sysTypeId: "A01",
|
||||||
// keywords: "前端,React,JavaScript",
|
keywords: "前端,React,JavaScript",
|
||||||
// teacherName: "王五",
|
teacherName: "王五",
|
||||||
// sysCreateTime: "2023-01-20",
|
sysCreateTime: "2023-01-20",
|
||||||
// exquisiteTime: "2023-02-05",
|
exquisiteTime: "2023-02-05",
|
||||||
// exquisiteRecommender: "赵六",
|
exquisiteRecommender: "赵六",
|
||||||
// qualityTop: true,
|
qualityTop: true,
|
||||||
// courseSource: 1,
|
courseSource: 1,
|
||||||
// qualityStatus: true,
|
qualityStatus: true,
|
||||||
// qualityTopSort: 2
|
qualityTopSort: 2
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// id: 2,
|
id: 2,
|
||||||
// name: "React核心概念详解",
|
name: "React核心概念详解",
|
||||||
// sysType1: "A01",
|
sysType1: "A01",
|
||||||
// sysType2: "B02",
|
sysType2: "B02",
|
||||||
// sysTypeId: "A01",
|
sysTypeId: "A01",
|
||||||
// keywords: "前端,React,JavaScript",
|
keywords: "前端,React,JavaScript",
|
||||||
// teacherName: "王五",
|
teacherName: "王五",
|
||||||
// sysCreateTime: "2023-01-20",
|
sysCreateTime: "2023-01-20",
|
||||||
// exquisiteTime: "2023-02-05",
|
exquisiteTime: "2023-02-05",
|
||||||
// exquisiteRecommender: "赵六",
|
exquisiteRecommender: "赵六",
|
||||||
// courseSource: 2,
|
courseSource: 2,
|
||||||
// getExport: null,
|
getExport: null,
|
||||||
// qualityStatus: true,
|
qualityStatus: true,
|
||||||
// qualityTopSort: 2
|
qualityTopSort: 2
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// id: 1,
|
id: 1,
|
||||||
// name: "Vue从入门到精通",
|
name: "Vue从入门到精通",
|
||||||
// sysType1: "A01",
|
sysType1: "A01",
|
||||||
// sysType2: "B01",
|
sysType2: "B01",
|
||||||
// sysType3: "C01",
|
sysType3: "C01",
|
||||||
// keywords: "前端,Vue,JavaScript",
|
keywords: "前端,Vue,JavaScript",
|
||||||
// teacherName: "",
|
teacherName: "",
|
||||||
// sysCreateTime: "2023-01-15",
|
sysCreateTime: "2023-01-15",
|
||||||
// exquisiteTime: "2023-02-01",
|
exquisiteTime: "2023-02-01",
|
||||||
// exquisiteRecommender: "李四",
|
exquisiteRecommender: "李四",
|
||||||
// qualityTop: false,
|
qualityTop: false,
|
||||||
// qualityStatus: false,
|
qualityStatus: false,
|
||||||
// qualityTopSort: 1
|
qualityTopSort: 1
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// courseId: "965356498114842624",
|
courseId: "965356498114842624",
|
||||||
// name: "走进京东方",
|
name: "走进京东方",
|
||||||
// courseSource: 1,
|
courseSource: 1,
|
||||||
// sysType1: "966458773186465792",
|
sysType1: "966458773186465792",
|
||||||
// sysType2: "0",
|
sysType2: "0",
|
||||||
// sysType3: "0",
|
sysType3: "0",
|
||||||
// keywords: "新员工 职场,定目标,传文化,带团队",
|
keywords: "新员工 职场,定目标,传文化,带团队",
|
||||||
// teacherName: "齐铮",
|
teacherName: "齐铮",
|
||||||
// sysCreateTime: "2022-04-17 21:02:05",
|
sysCreateTime: "2022-04-17 21:02:05",
|
||||||
// qualityTime: "2022-04-17 21:02:05",
|
qualityTime: "2022-04-17 21:02:05",
|
||||||
// qualityPeople: "齐铮",
|
qualityPeople: "齐铮",
|
||||||
// qualityTop: false,
|
qualityTop: false,
|
||||||
// qualityStatus: true,
|
qualityStatus: true,
|
||||||
// qualityTopSort: 2
|
qualityTopSort: 2
|
||||||
// },
|
},
|
||||||
],
|
],
|
||||||
currentPage1: 1,
|
currentPage1: 1,
|
||||||
tableDataTotal1: 3,
|
tableDataTotal1: 3,
|
||||||
@@ -566,7 +566,7 @@ export default defineComponent({
|
|||||||
console.log("state.tableData1", state.tableData1);
|
console.log("state.tableData1", state.tableData1);
|
||||||
|
|
||||||
};
|
};
|
||||||
getTableDate();
|
// getTableDate();
|
||||||
|
|
||||||
// 初始化年份选项
|
// 初始化年份选项
|
||||||
const initializeYearOptions = async () => {
|
const initializeYearOptions = async () => {
|
||||||
@@ -587,7 +587,7 @@ export default defineComponent({
|
|||||||
const getSysTypeMap = (code) => {
|
const getSysTypeMap = (code) => {
|
||||||
if (code == "") return
|
if (code == "") return
|
||||||
// console.log(store.state.sysTypeMap, 'map集合');
|
// console.log(store.state.sysTypeMap, 'map集合');
|
||||||
return state.sysTypeMap.get(code)
|
// return state.sysTypeMap.get(code)
|
||||||
}
|
}
|
||||||
getSysTypeMap()
|
getSysTypeMap()
|
||||||
|
|
||||||
@@ -604,7 +604,7 @@ export default defineComponent({
|
|||||||
console.log('搜索参数:', {
|
console.log('搜索参数:', {
|
||||||
courseNameOrTeacherName: state.courseNameOrTeacherName,
|
courseNameOrTeacherName: state.courseNameOrTeacherName,
|
||||||
courseSource: state.courseSource,
|
courseSource: state.courseSource,
|
||||||
sysType: state.sysType,
|
sysType: state.sysTypeId,
|
||||||
years: state.years // 添加年份参数
|
years: state.years // 添加年份参数
|
||||||
})
|
})
|
||||||
getTableDate();
|
getTableDate();
|
||||||
@@ -612,17 +612,23 @@ export default defineComponent({
|
|||||||
// 全部导出
|
// 全部导出
|
||||||
const exportAll = async () => {
|
const exportAll = async () => {
|
||||||
try {
|
try {
|
||||||
await getExport(
|
let res = await getExport(
|
||||||
{
|
{
|
||||||
courseNameOrTeacherName: state.courseNameOrTeacherName,
|
courseNameOrTeacherName: state.courseNameOrTeacherName,
|
||||||
courseSource: state.courseSource,
|
courseSource: state.courseSource,
|
||||||
years: state.years,
|
years: state.years,
|
||||||
sysType: state.sysType,
|
sysType: state.sysTypeId,
|
||||||
},
|
},
|
||||||
"精品课程导出",
|
"精品课程导出",
|
||||||
"xlsx"
|
"xlsx"
|
||||||
);
|
);
|
||||||
message.success("导出成功");
|
if (res.data.status == 200) {
|
||||||
|
message.success(res.data.message);
|
||||||
|
// 重新加载数据
|
||||||
|
getTableDate();
|
||||||
|
} else {
|
||||||
|
message.error(res.data.message);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("导出失败:", error);
|
console.error("导出失败:", error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user