-
+
+
+
+
+
+
-
- 选择
-
+
@@ -147,22 +153,22 @@
{{ formatSysTypeChain(scope.row) }}
-
+
- {{ scope.row.teacherName }}
+ {{ scope.row.teacherName }}
-
+
{{ formatCourseDuration(scope.row) }}
-
+
{{ scope.row.studys || '-' }}
-
+
{{ formatScore(scope.row) }}
@@ -175,22 +181,22 @@
审核驳回
-
+
{{ scope.row.published == true ? '已发布' : '未发布' }}
-
+
{{ scope.row.enabled == true ? '启用' : '停用' }}
-
+
{{ scope.row.openCourse == 1 ? '是' : '否' }}
-
+
{{ scope.row.orgName }}
@@ -219,9 +225,14 @@
-
- 撤回
+
+ 编辑
+
+
+
+ 二维码
@@ -229,11 +240,13 @@
class="action-link--primary">管理
-
- 编辑
+
+
+ 撤回
+
删除
@@ -250,8 +263,7 @@
class="action-link--bold">{{
scope.row.enabled ?
'停用' : '启用' }}
- 二维码
+
{{
scope.row.isTop ? '取消置顶' : '置顶' }}
@@ -405,7 +417,6 @@
-
@@ -417,7 +428,6 @@ import auditCourse1 from '@/components/Course/auditCourse1.vue';
import auditCourse2 from '@/components/Course/auditCourse2.vue';
import adminPage from '@/components/Administration/adminPage.vue';
import TopCourseSorter from '@/components/Course/TopCourseSorter.vue';
-import chooseOrg from '@/components/System/chooseOrg.vue';
import apiResowner from '../../api/modules/resowner.js';
import apiType from '../../api/modules/type.js'
import { courseType } from '../../utils/tools.js';
@@ -428,9 +438,20 @@ import apiUserbasic from "@/api/boe/userbasic.js"
import apiTeacher from '../../api/modules/teacher.js';
export default {
name: 'manageCourse',
- components: { courseForm, manager, auditCourse1, auditCourse2, adminPage, TopCourseSorter, chooseOrg },
+ components: { courseForm, manager, auditCourse1, auditCourse2, adminPage, TopCourseSorter },
computed: {
...mapGetters(['resOwnerMap', 'sysTypeMap', 'userInfo', 'identity']),
+ resOwnerCascaderProps() {
+ return {
+ value: 'id',
+ label: 'name',
+ children: 'children',
+ lazy: true,
+ lazyLoad: this.loadResOwnerNode,
+ leaf: 'leaf',
+ checkStrictly: true // 允许选择任意一级选项
+ };
+ },
},
data() {
return {
@@ -448,6 +469,8 @@ export default {
sysTypeListMap: [],
sysTypeList: [],
resOwnerListMap: [],
+ resOwnerSelected: [],
+ resOwnerCascaderOptions: [],
showSetTopFeature: false,
page: {
pageIndex: 1,//第几页
@@ -504,6 +527,8 @@ export default {
createUserId: '',
createFrom: '',
},
+ orderField: '', // 排序字段
+ orderAsc: true, // 排序顺序:true-升序,false-降序
pageData: [],
courseChooseShow: false,
courseChooseId: '',
@@ -803,14 +828,14 @@ export default {
// }
const duration = row.courseDuration
if (duration === undefined || duration === null || duration === 0) {
- return '0分钟';
+ return '0';
}
const minutes = Math.round(duration / 60);
- if (minutes >= 60) {
- const hours = (minutes / 60).toFixed(1);
- return `${hours}小时`;
- }
- return `${minutes || 0}分钟`;
+ //if (minutes >= 60) {
+ //const hours = (minutes / 60).toFixed(1);
+ //return `${hours}小时`;
+ //}
+ return `${minutes || 0}`;
},
formatStudyCount(row) {
const count = row.studyCount !== undefined
@@ -947,6 +972,13 @@ export default {
query.audiences = this.audiences.join(',');
}
query.isCreateCourse = !this.pageManage;
+
+ // 添加排序参数
+ if (this.orderField) {
+ query.orderField = this.orderField;
+ query.orderAsc = this.orderAsc;
+ }
+
return query;
},
async handleExport() {
@@ -1015,43 +1047,26 @@ export default {
}
})
} else if (row.isTop == true) {
- this.$confirm('此操作将取消置顶此课程, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- customClass: 'custom-confirm-dialog'
- }).then(() => {
- apiCourse.setTop(params).then(res => {
- if (res.status === 200 && res.result === true) {
- this.$message.success('取消成功!')
- this.searchData();
- } else {
- this.$message({
- type: 'error',
- message: res.message
- });
- }
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '取消置顶失败'
- });
- });
+ apiCourse.setTop(params).then(res => {
+ if (res.status === 200 && res.result === true) {
+ this.$message.success('取消成功!')
+ this.searchData();
+ } else {
+ this.$message({
+ type: 'error',
+ message: res.message
+ });
+ }
+ })
}
-
-
-
-
-
-
},
// 复制
copyCourse(item) {
- const confirmText = `确认复制${item.name}吗?`;
+ const confirmText = `
确认复制${item.name}吗?`;
this.$confirm(confirmText, '复制确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
+ dangerouslyUseHTMLString: true,
type: 'warning',
customClass: 'custom-confirm-dialog'
}).then(() => {
@@ -1098,6 +1113,7 @@ export default {
this.learningTimeRange = [];
this.orgId = '';
this.orgName = '';
+ this.resOwnerSelected = [];
this.teacherFilterList = [];
this.teacherSelected = [];
this.teacherOptions = [];
@@ -1116,6 +1132,9 @@ export default {
createUserId: '',
createFrom: '',
});
+ // 重置排序
+ this.orderField = '';
+ this.orderAsc = true;
this.searchData(true);
},
...mapActions({
@@ -1128,15 +1147,6 @@ export default {
if (code == '') { return ''; }
return this.resOwnerMap.get(code);
},
- resOwnerFilterMethod(node, keyword = '') {
- const limited = keyword.slice(0, 200);
- if (this.$refs.resOwnerCascader && this.$refs.resOwnerCascader.inputValue !== limited) {
- this.$refs.resOwnerCascader.inputValue = limited;
- }
- if (!limited) return true;
- const text = node.label || node.text || '';
- return text.toLowerCase().includes(limited.toLowerCase());
- },
// 直接审核
examineData() {
if (this.isExamine == 1) {
@@ -1171,10 +1181,11 @@ export default {
const nextEnabled = !row.enabled;
const actionText = nextEnabled ? '启用' : '停用';
try {
- await this.$confirm(`确定${actionText}${row.name}吗?`, `${actionText}确认`, {
+ await this.$confirm(`
确定${actionText}${row.name}吗?`, `${actionText}确认`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
+ dangerouslyUseHTMLString: true,
customClass: 'custom-confirm-dialog'
});
} catch (error) {
@@ -1226,9 +1237,19 @@ export default {
handleSortChange({ column, prop, order }) {
// order: ascending(升序) | descending(降序) | null(取消排序)
console.log('排序变化:', { column, prop, order });
- // TODO: 后续可以使用接口进行排序
- // 如果需要接口排序,可以在这里调用 searchData 方法重新查询
- // this.searchData(true);
+
+ if (order) {
+ // 有排序:保存排序字段和顺序
+ this.orderField = prop;
+ this.orderAsc = order === 'ascending';
+ } else {
+ // 取消排序:清空排序字段
+ this.orderField = '';
+ this.orderAsc = true;
+ }
+
+ // 重新查询数据
+ this.searchData(true);
},
viewTopic(row) {
if (row.status == 1) {
@@ -1333,18 +1354,81 @@ export default {
sessionStorage.setItem('courseDetail', JSON.stringify(row));
this.$router.push({ path: '/iframe/course/coursemanage-remote' });
},
- showChooseOrg() {
- if (this.$refs.refChooseOrg) {
- this.$refs.refChooseOrg.dlgShow = true;
+ async loadResOwnerNode(node, resolve) {
+ const { level } = node;
+ let parentId = '';
+
+ if (level === 0) {
+ // 第一层:获取根节点
+ try {
+ const res = await apiUserbasic.findOrgsByKeyword('');
+ if (res && res.result) {
+ const nodes = res.result.map(item => ({
+ id: item.id,
+ name: item.name,
+ hrbpId: item.hrbpId,
+ leaf: false, // 懒加载模式下,先假设所有节点都可能有子节点
+ children: [] // 空数组表示需要懒加载
+ }));
+ resolve(nodes);
+ } else {
+ resolve([]);
+ }
+ } catch (error) {
+ console.error('加载资源归属失败:', error);
+ resolve([]);
+ }
+ } else {
+ // 子节点:根据父节点ID加载
+ parentId = node.value || (node.data && node.data.id);
+ if (!parentId) {
+ resolve([]);
+ return;
+ }
+ try {
+ const res = await apiUserbasic.getOrgInfo(parentId);
+ if (res && res.status === 200 && res.result) {
+ let treeList = [];
+ if (res.result.directChildList && res.result.directChildList.length > 0) {
+ treeList = res.result.directChildList.map(item => ({
+ id: item.id,
+ name: item.name,
+ hrbpId: item.hrbpId,
+ leaf: false, // 懒加载模式下,先假设所有节点都可能有子节点
+ children: [] // 空数组表示需要懒加载
+ }));
+ }
+ resolve(treeList);
+ } else {
+ // 如果没有子节点,返回空数组,级联选择器会自动将其视为叶子节点
+ resolve([]);
+ }
+ } catch (error) {
+ console.error('加载资源归属子节点失败:', error);
+ resolve([]);
+ }
}
},
- confirmChooseOrg(orgInfo) {
- if (!orgInfo) return;
- this.orgId = orgInfo.id || '';
- this.orgName = orgInfo.name || '';
- if (this.$refs.refChooseOrg) {
- this.$refs.refChooseOrg.dlgShow = false;
+ handleResOwnerChange(value) {
+ if (!value || value.length === 0) {
+ this.orgId = '';
+ this.orgName = '';
+ return;
}
+ // value 是选中的路径数组,最后一个元素是选中的节点ID
+ const selectedId = value[value.length - 1];
+ this.orgId = selectedId;
+
+ // 通过级联选择器的 getCheckedNodes 方法获取选中的节点信息
+ this.$nextTick(() => {
+ if (this.$refs.resOwnerCascader) {
+ const checkedNodes = this.$refs.resOwnerCascader.getCheckedNodes();
+ if (checkedNodes && checkedNodes.length > 0) {
+ const lastNode = checkedNodes[checkedNodes.length - 1];
+ this.orgName = lastNode.label || lastNode.name || '';
+ }
+ }
+ });
},
showChooseCourse() {
this.courseChooseShow = true;
@@ -1521,314 +1605,6 @@ export default {
margin-top: 10px;
}
-.filter-field--name {
- ::v-deep .el-input__inner {
- width: 444px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 6px;
- border: 1px solid rgba(0, 0, 0, .2);
- line-height: 32px;
- padding: 0 10px;
- &:focus {
- border: 1px solid #4284F7;
- }
- }
-}
-
-.filter-field--category {
- ::v-deep.el-cascader {
- line-height: 32px;
- .el-input__inner {
- width: 180px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 6px;
- border: 1px solid rgba(0, 0, 0, .2);
- line-height: 32px;
- padding: 0 10px;
- color: #000000;
- &:focus {
- border: 1px solid #4284F7;
- }
- }
-
- .el-input {
- line-height: 32px;
- }
-
- .el-input__suffix {
- line-height: 32px;
- }
-
- .el-input__icon {
- line-height: 32px;
- }
- }
-
-
-}
-
-.filter-field--teacher {
- ::v-deep.el-select {
- .el-select__input {
- margin-left: 10px;
- }
- .el-input {
- &:focus {
- border: 1px solid #4284F7;
- }
- }
- .el-input__inner {
- width: 180px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 6px;
- border: 1px solid rgba(0, 0, 0, .2);
- line-height: 32px;
- padding: 0 10px;
-
- }
- }
-}
-
-.filter-field--status {
- ::v-deep.el-select {
- .el-select__input {
- margin-left: 10px;
- }
-
- .el-input__inner {
- width: 136px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 6px;
- border: 1px solid rgba(0, 0, 0, .2);
- line-height: 32px;
- padding: 0 10px;
- &:focus {
- border: 1px solid #4284F7;
- }
- }
-
- .el-input__icon {
- line-height: 32px;
- }
- }
-}
-
-.filter-field--publish {
- ::v-deep.el-select {
- .el-select__input {
- margin-left: 10px;
- }
-
- .el-input__inner {
- width: 136px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 6px;
- border: 1px solid rgba(0, 0, 0, .2);
- line-height: 32px;
- padding: 0 10px;
- &:focus {
- border: 1px solid #4284F7;
- }
- }
-
- .el-input__icon {
- line-height: 32px;
- }
- }
-}
-
-.filter-field--enabled {
- ::v-deep.el-select {
- .el-select__input {
- margin-left: 10px;
- }
-
- .el-input__inner {
- width: 136px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 6px;
- border: 1px solid rgba(0, 0, 0, .2);
- line-height: 32px;
- padding: 0 10px;
- &:focus {
- border: 1px solid #4284F7;
- }
- }
-
- .el-input__icon {
- line-height: 32px;
- }
- }
-
-}
-
-.filter-field--open {
- ::v-deep.el-select {
- .el-select__input {
- margin-left: 10px;
- }
-
- .el-input__inner {
- width: 124px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 6px;
- border: 1px solid rgba(0, 0, 0, .2);
- line-height: 32px;
- padding: 0 10px;
- &:focus {
- border: 1px solid #4284F7;
- }
- }
-
- .el-input__icon {
- line-height: 32px;
- }
- }
-
-}
-
-
-// .filter-field--resowner ::v-deep.el-cascader {
-// line-height: 32px;
-// .el-input__inner {
-// width: 180px;
-// height: 32px;
-// background: #FFFFFF;
-// border-radius: 6px;
-// border: 1px solid rgba(0, 0, 0, .2);
-// line-height: 32px;
-// padding: 0 10px;
-// }
-// .el-input {
-// line-height: 32px;
-// }
-// .el-input__suffix {
-// line-height: 32px;
-// }
-// .el-input__icon {
-// line-height: 32px;
-// }
-// }
-
-.filter-field--resowner {
-
- // line-height: 32px;
- ::v-deep .el-input__inner {
- width: 180px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 6px 0 0 6px;
- border: 1px solid rgba(0, 0, 0, .2);
- line-height: 32px;
- padding: 0 10px;
- }
-
- // .el-input {
- // line-height: 32px;
- // }
- // .el-input__suffix {
- // line-height: 32px;
- // }
- // .el-input__icon {
- // line-height: 32px;
- // }
-}
-
-.filter-field--creator {
- ::v-deep.el-select {
- .el-select__input {
- margin-left: 10px;
- }
-
- .el-input__inner {
- width: 136px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 6px;
- border: 1px solid rgba(0, 0, 0, .2);
- line-height: 32px;
- padding: 0 10px;
- &:focus {
- border: 1px solid #4284F7;
- }
- }
- }
-
-}
-
-.filter-field--create-from {
- ::v-deep.el-select {
- .el-select__input {
- margin-left: 10px;
- }
-
- .el-input__inner {
- width: 180px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 6px;
- border: 1px solid rgba(0, 0, 0, .2);
- line-height: 32px;
- padding: 0 10px;
- &:focus {
- border: 1px solid #4284F7;
- }
- }
-
- .el-input__icon {
- line-height: 32px;
- }
- }
-
-}
-
-.filter-field--time {
- ::v-deep .el-input__inner {
- width: 210px;
- height: 32px;
- background: #FFFFFF;
- border-radius: 6px;
- border: 1px solid rgba(0, 0, 0, .2);
- line-height: 32px;
- padding: 0 10px;
- &:focus {
- border: 1px solid #4284F7;
- }
-
- .el-input__icon {
- line-height: 32px;
-
- &.el-icon-date {
- position: absolute;
- right: 0;
- }
-
- &.el-icon-close {
- margin-right: 8px;
- }
- }
-
- .el-range-input {
- text-align: left;
- }
-
- .el-range-separator {
- line-height: 30px;
- }
-
- .el-range-input {
- line-height: 30px;
- }
- }
-}
-
.toggle-link {
padding: 0;
font-size: 14px;
@@ -2174,6 +1950,12 @@ export default {
}
}
}
+ &.ascending .sort-caret.ascending {
+ border-bottom-color: #409EFF;
+ }
+ &.descending .sort-caret.descending{
+ border-top-color: #409EFF;
+ }
&.el-table--medium .el-table__cell {
padding: 5px 0;
@@ -2236,6 +2018,307 @@ export default {