mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-20 00:06:45 +08:00
教师端1期需求ui优化
This commit is contained in:
@@ -7,57 +7,58 @@
|
||||
4.有哪种几状态和哪几种操作,需要讨论定一下 。在哪种状态下可以有哪些操作<br/>
|
||||
</Remark> -->
|
||||
|
||||
<el-row style="margin: 0 20px 20px 15px;" :gutter="8">
|
||||
<el-col :span="8">
|
||||
<div class="grid-content bg-purple"><el-input :maxlength="50" v-model="params.name" clearable placeholder="课程名称" /></div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-select v-model="params.publish" placeholder="发布状态" clearable>
|
||||
<el-option label="未发布" :value="false"></el-option>
|
||||
<el-row style="margin: 0 20px 20px 15px;" :gutter="8">
|
||||
<el-col :span="8">
|
||||
<div class="grid-content bg-purple"><el-input :maxlength="50" v-model="params.name" clearable
|
||||
placeholder="课程名称" /></div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-select v-model="params.publish" placeholder="发布状态" clearable>
|
||||
<el-option label="未发布" :value="false"></el-option>
|
||||
<el-option label="已发布" :value="true"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="3">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-select v-model="params.enabled" placeholder="启停用状态" clearable>
|
||||
<el-option label="未发布" :value="false"></el-option>
|
||||
<el-option label="已发布" :value="true"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-select v-model="params.enabled" placeholder="启停用状态" clearable>
|
||||
<el-option label="停用" :value="false"></el-option>
|
||||
<el-option label="启用" :value="true"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="3">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-select v-model="params.status" placeholder="审核状态" clearable>
|
||||
<el-col :span="3">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-select v-model="params.status" placeholder="审核状态" clearable>
|
||||
<el-option label="审核中" :value="2"></el-option>
|
||||
<el-option label="审核驳回" :value="3"></el-option>
|
||||
<el-option label="审核通过" :value="5"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-button type="primary" @click="findList">查 询</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-button @click="reset">重 置</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2" >
|
||||
<div class="grid-content bg-purple" style="text-align: right;">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addNewCourse">新建课程</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-button type="primary" @click="findList">查 询</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-button @click="reset">重 置</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<div class="grid-content bg-purple" style="text-align: right;">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addNewCourse">新建课程</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!--课程列表内容-->
|
||||
<div v-infinite-scroll="load" style="overflow:auto;height:1000px" infinite-scroll-distance="50" :infinite-scroll-immediate="false" :infinite-scroll-disabled="disabled">
|
||||
<div v-infinite-scroll="load" style="overflow:auto;height:1000px" infinite-scroll-distance="50"
|
||||
:infinite-scroll-immediate="false" :infinite-scroll-disabled="disabled">
|
||||
<div class="uc-course" v-for="(item, idx) in couresList" :key="idx" @click="jumpRouter(item)">
|
||||
<div class="uc-course-img" style="width: 212px;height:119px">
|
||||
<course-image :course="item"></course-image>
|
||||
@@ -65,8 +66,8 @@
|
||||
</div>
|
||||
<div class="uc-course-info">
|
||||
<div class="uc-course-name">
|
||||
<el-tooltip class="item" effect="dark" :content="item.name" placement="top-start">
|
||||
<span style="font-size:18px;color:#333">{{ item.name }}</span>
|
||||
<el-tooltip class="item" effect="dark" :content="item.name" placement="top-start">
|
||||
<span style="font-size:18px;color:#333">{{ item.name }}</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="uc-course-item">
|
||||
@@ -75,19 +76,26 @@
|
||||
<div class="uc-course-item">
|
||||
<div class="status-item">发布状态:{{ item.published ? '发布' : '未发布' }}</div>
|
||||
<div class="status-item">启停用状态:{{ item.enabled ? '启用' : '停用' }}</div>
|
||||
<div class="status-item">审核状态:<el-link :type="getStatusLabel(item.status).type" @click.stop="" :underline="false">{{getStatusLabel(item.status).label}}</el-link></div>
|
||||
<div class="status-item">审核状态:<el-link :type="getStatusLabel(item.status).type" @click.stop=""
|
||||
:underline="false">{{getStatusLabel(item.status).label}}</el-link></div>
|
||||
</div>
|
||||
<div class="btn-container">
|
||||
<el-link class="btn-item" @mouseenter.native="$set(hoverStates, it.uniqueKey, true )" @mouseleave.native="$set(hoverStates, it.uniqueKey, false )" :style="{color: it.labelColor ? it.labelColor : (hoverStates[it.uniqueKey] ? '#4284F7' : '#000000')}" v-for="(it, idx) in availableActions(item)" :key="idx" :underline="false" type="primary" @click.stop="it.handler(item)"><svg-icon style="margin-right: 5px;font-size:19px;padding-top: 4px;color:#000000" :icon-class="hoverStates[it.uniqueKey] ? it.hoverIcon : it.icon"></svg-icon>{{it.label}}</el-link>
|
||||
<el-link class="btn-item" @mouseenter.native="$set(hoverStates, it.uniqueKey, true )"
|
||||
@mouseleave.native="$set(hoverStates, it.uniqueKey, false )"
|
||||
:style="{color: it.labelColor ? it.labelColor : (hoverStates[it.uniqueKey] ? '#4284F7' : '#000000')}"
|
||||
v-for="(it, idx) in availableActions(item)" :key="idx" :underline="false" type="primary"
|
||||
@click.stop="it.handler(item)"><svg-icon
|
||||
style="margin-right: 5px;font-size:19px;padding-top: 4px;color:#000000"
|
||||
:icon-class="hoverStates[it.uniqueKey] ? it.hoverIcon : it.icon"></svg-icon>{{it.label}}</el-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="loading" class="page-tip">加载中...</p>
|
||||
<div v-if="couresList.length == 0 && !loading">
|
||||
<div v-if="isSearh" class="zan-wu">没有查询到相关内容</div>
|
||||
<div v-else class="zan-wu">暂无数据</div>
|
||||
</div>
|
||||
<p v-else-if="noMore" class="page-tip">没有更多了</p>
|
||||
<p v-if="loading" class="page-tip">加载中...</p>
|
||||
<div v-if="couresList.length == 0 && !loading">
|
||||
<div v-if="isSearh" class="zan-wu">没有查询到相关内容</div>
|
||||
<div v-else class="zan-wu">暂无数据</div>
|
||||
</div>
|
||||
<p v-else-if="noMore" class="page-tip">没有更多了</p>
|
||||
</div>
|
||||
<!-- <div v-if="couresList.length > 0" style="text-align: center; margin-top:57px;">
|
||||
<el-pagination
|
||||
@@ -106,31 +114,31 @@
|
||||
</div> -->
|
||||
|
||||
<div></div>
|
||||
<el-dialog title="二维码" :visible.sync="qrCodedialogVisible" width="900px" @close="closeCode" custom-class="g-dialog">
|
||||
<el-dialog title="二维码" :visible.sync="qrCodedialogVisible" width="900px" @close="closeCode" custom-class="g-dialog">
|
||||
<div>
|
||||
<el-form size="medium" label-width="100px">
|
||||
<el-form-item label="二维码" >
|
||||
<div id="qrcode" ref="qrcode" class="qrcode-img" @mouseenter="showDownloadButton = true" @mouseleave="showDownloadButton = false">
|
||||
|
||||
<div v-show="showDownloadButton" @click="downloadQrcode" class="downloadn-container">
|
||||
<i class="el-icon-download" style="color: #409EFF;font-size:18px;margin-bottom:5px"></i>
|
||||
<span>下载</span>
|
||||
</div>
|
||||
<el-form size="medium" label-width="100px">
|
||||
<el-form-item label="二维码">
|
||||
<div id="qrcode" ref="qrcode" class="qrcode-img" @mouseenter="showDownloadButton = true"
|
||||
@mouseleave="showDownloadButton = false">
|
||||
|
||||
<div v-show="showDownloadButton" @click="downloadQrcode" class="downloadn-container">
|
||||
<i class="el-icon-download" style="color: #409EFF;font-size:18px;margin-bottom:5px"></i>
|
||||
<span>下载</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="链接">
|
||||
<el-input v-model="copyUrl" readonly class="input-with-select" id="text">
|
||||
<el-button slot="append" @click="handleCopyUrl">复制</el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="">上述内容兼容PC端与移动端,您可按需分享。</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="链接">
|
||||
<el-input v-model="copyUrl" readonly class="input-with-select" id="text">
|
||||
<el-button slot="append" @click="handleCopyUrl">复制</el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="">上述内容兼容PC端与移动端,您可按需分享。</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer"><el-button @click="closeCode">关 闭</el-button></span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- TODO 修改展示字段 -->
|
||||
<el-dialog title="审核记录" :visible.sync="dialogVisible" width="900px" custom-class="g-dialog">
|
||||
<div>
|
||||
@@ -146,7 +154,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="auditUser" label="审核人"></el-table-column>
|
||||
<el-table-column prop="auditTime" label="审核结果"></el-table-column>
|
||||
<el-table-column prop="auditTime" label="审核结果"></el-table-column>
|
||||
<el-table-column prop="auditTime" label="审核时间"></el-table-column>
|
||||
<el-table-column prop="auditRemark" label="审核意见"></el-table-column>
|
||||
</el-table>
|
||||
@@ -158,62 +166,88 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import QRCode from 'qrcodejs2';
|
||||
import courseImage from '@/components/Course/courseImage.vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import studyItem from '@/components/Course/studyItem.vue';
|
||||
import courseForm from '@/components/Course/courseForm.vue';
|
||||
import apiCourse from '@/api/modules/course.js';
|
||||
import { courseType } from '@/utils/tools.js';
|
||||
import apiAudit from '@/api/system/audit.js';
|
||||
import apiHRBP from '@/api/boe/HRBP.js';
|
||||
import apiOrg from '@/api/system/organiza.js';
|
||||
import apiUserBasic from '@/api/boe/userbasic.js';
|
||||
import QRCode from "qrcodejs2";
|
||||
import courseImage from "@/components/Course/courseImage.vue";
|
||||
import { mapGetters } from "vuex";
|
||||
import studyItem from "@/components/Course/studyItem.vue";
|
||||
import courseForm from "@/components/Course/courseForm.vue";
|
||||
import apiCourse from "@/api/modules/course.js";
|
||||
import { courseType } from "@/utils/tools.js";
|
||||
import apiAudit from "@/api/system/audit.js";
|
||||
import apiHRBP from "@/api/boe/HRBP.js";
|
||||
import apiOrg from "@/api/system/organiza.js";
|
||||
import apiUserBasic from "@/api/boe/userbasic.js";
|
||||
|
||||
// 状态权限映射
|
||||
const STATUS_PERMISSIONS = {
|
||||
// 未发布状态
|
||||
unpublished: {
|
||||
1: ['edit', 'delete'], // 无审核状态
|
||||
2: ['auditRecord'], // 审核中'withdraw'
|
||||
3: ['edit', 'delete', 'auditRecord'] // 审核驳回
|
||||
1: ["edit", "delete"], // 无审核状态
|
||||
2: ["auditRecord"], // 审核中'withdraw'
|
||||
3: ["edit", "delete", "auditRecord"], // 审核驳回
|
||||
},
|
||||
// 已发布状态
|
||||
published: {
|
||||
enabled: {
|
||||
1: ['edit', 'manage', 'auditRecord', 'qrcode'], //'offShelfApply', 'viewCurrent'
|
||||
2: ['manage', 'auditRecord', 'qrcode'], // withdraw , 'viewCurrent'
|
||||
3: ['edit', 'manage', 'auditRecord', 'qrcode'], //'offShelfApply', 'viewCurrent'
|
||||
5: ['edit', 'manage', 'auditRecord', 'qrcode'] //'offShelfApply', 'viewCurrent'
|
||||
1: ["edit", "manage", "auditRecord", "qrcode"], //'offShelfApply', 'viewCurrent'
|
||||
2: ["manage", "auditRecord", "qrcode"], // withdraw , 'viewCurrent'
|
||||
3: ["edit", "manage", "auditRecord", "qrcode"], //'offShelfApply', 'viewCurrent'
|
||||
5: ["edit", "manage", "auditRecord", "qrcode"], //'offShelfApply', 'viewCurrent'
|
||||
},
|
||||
disabled: {
|
||||
// 所有状态在停用时操作一致
|
||||
1: ['manage', 'auditRecord'], //, 'viewCurrent'
|
||||
2: ['manage', 'auditRecord'], //, 'viewCurrent'
|
||||
3: ['manage', 'auditRecord'], //, 'viewCurrent'
|
||||
5: ['manage', 'auditRecord'] //, 'viewCurrent'
|
||||
}
|
||||
}
|
||||
}
|
||||
1: ["manage", "auditRecord"], //, 'viewCurrent'
|
||||
2: ["manage", "auditRecord"], //, 'viewCurrent'
|
||||
3: ["manage", "auditRecord"], //, 'viewCurrent'
|
||||
5: ["manage", "auditRecord"], //, 'viewCurrent'
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// 操作配置映射表
|
||||
const ACTION_CONFIG = {
|
||||
edit: { label: '编辑', handler: 'editCourse', icon: 'edit', hoverIcon: 'editHover' },
|
||||
manage: { label: '管理', handler: 'handleManage', icon: 'manage', hoverIcon: 'manageHover'},
|
||||
edit: {
|
||||
label: "编辑",
|
||||
handler: "editCourse",
|
||||
icon: "edit",
|
||||
hoverIcon: "editHover",
|
||||
},
|
||||
manage: {
|
||||
label: "管理",
|
||||
handler: "handleManage",
|
||||
icon: "manage",
|
||||
hoverIcon: "manageHover",
|
||||
},
|
||||
// withdraw: { label: '撤回', handler: 'handleWithdraw' },
|
||||
auditRecord: { label: '审核记录', handler: 'toExamine', icon: 'check', hoverIcon: 'checkHover' },
|
||||
qrcode: { label: '二维码', handler: 'handleQrcode', icon: 'ercode', hoverIcon: 'ercodeHover' },
|
||||
auditRecord: {
|
||||
label: "审核记录",
|
||||
handler: "toExamine",
|
||||
icon: "check",
|
||||
hoverIcon: "checkHover",
|
||||
},
|
||||
qrcode: {
|
||||
label: "二维码",
|
||||
handler: "handleQrcode",
|
||||
icon: "ercode",
|
||||
hoverIcon: "ercodeHover",
|
||||
},
|
||||
// offShelfApply: { label: '下架申请', handler: 'handleOffShelfApply' },
|
||||
// viewCurrent: { label: '查看当前版本', handler: 'handleViewCurrent', icon: 'detail' },
|
||||
delete: { label: '删除', labelColor: '#FF1718', handler: 'delItem', icon: 'del', hoverIcon: 'del' },
|
||||
}
|
||||
delete: {
|
||||
label: "删除",
|
||||
labelColor: "#FF1718",
|
||||
handler: "delItem",
|
||||
icon: "del",
|
||||
hoverIcon: "del",
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'ucStudyIndex',
|
||||
name: "ucStudyIndex",
|
||||
components: { studyItem, courseForm, courseImage },
|
||||
computed: {
|
||||
...mapGetters(['userInfo']),
|
||||
disabled() {
|
||||
...mapGetters(["userInfo"]),
|
||||
disabled() {
|
||||
return this.loading || this.noMore;
|
||||
},
|
||||
},
|
||||
@@ -225,31 +259,42 @@ export default {
|
||||
courseType: courseType,
|
||||
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||
count: 0,
|
||||
params: { name: '', publish: '', status: '', enabled: '', pageIndex: 0, pageSize: 10 },
|
||||
params: {
|
||||
name: "",
|
||||
publish: "",
|
||||
status: "",
|
||||
enabled: "",
|
||||
pageIndex: 0,
|
||||
pageSize: 10,
|
||||
},
|
||||
couresList: [],
|
||||
flag: true,
|
||||
isSearh:false,
|
||||
isSearh: false,
|
||||
qrCodedialogVisible: false,
|
||||
copyUrl: '',
|
||||
qrcodeImgUrl: '',
|
||||
copyUrl: "",
|
||||
qrcodeImgUrl: "",
|
||||
showDownloadButton: false, // 是否显示下载按钮
|
||||
loading: false,
|
||||
noMore: false,
|
||||
auditEnum: {
|
||||
1: '未审核',
|
||||
2: '审核不通过',
|
||||
9: '审核通过'
|
||||
1: "未审核",
|
||||
2: "审核不通过",
|
||||
9: "审核通过",
|
||||
},
|
||||
hoverStates: {}
|
||||
hoverStates: {},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
if(this.$route.query && this.$route.query.open && this.$route.query.open == 'new') {
|
||||
this.addNewCourse();
|
||||
if (
|
||||
this.$route.query &&
|
||||
this.$route.query.open &&
|
||||
this.$route.query.open == "new"
|
||||
) {
|
||||
this.addNewCourse();
|
||||
}
|
||||
// this.getList();
|
||||
},
|
||||
watch:{
|
||||
watch: {
|
||||
// '$route.query.open':function(val){
|
||||
// if(val == 'new') {
|
||||
// this.addNewCourse();
|
||||
@@ -257,13 +302,13 @@ export default {
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
handleM(){
|
||||
console.log('handleM')
|
||||
handleM() {
|
||||
console.log("handleM");
|
||||
},
|
||||
load() {
|
||||
this.loading = true
|
||||
this.params.pageIndex++
|
||||
this.getList()
|
||||
this.loading = true;
|
||||
this.params.pageIndex++;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
getNewList() {
|
||||
@@ -272,46 +317,50 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
getStatusLabel(code) {
|
||||
if (code == '1') {
|
||||
return {type:'info',label:'-'}
|
||||
} else if (code == '2') {
|
||||
return {type:'warning',label:'审核中'}
|
||||
} else if (code == '3') {
|
||||
return {type:'danger',label:'审核驳回'}
|
||||
} else if (code == '5') {
|
||||
return {type:'success',label:'审核通过'}
|
||||
if (code == "1") {
|
||||
return { type: "info", label: "-" };
|
||||
} else if (code == "2") {
|
||||
return { type: "warning", label: "审核中" };
|
||||
} else if (code == "3") {
|
||||
return { type: "danger", label: "审核驳回" };
|
||||
} else if (code == "5") {
|
||||
return { type: "success", label: "审核通过" };
|
||||
}
|
||||
},
|
||||
// 获取可用的操作配置
|
||||
// 获取可用的操作配置
|
||||
availableActions(item) {
|
||||
const { status, published, enabled } = item
|
||||
let actionKeys = []
|
||||
|
||||
const { status, published, enabled } = item;
|
||||
let actionKeys = [];
|
||||
|
||||
if (!published) {
|
||||
// 未发布状态
|
||||
actionKeys = STATUS_PERMISSIONS.unpublished[status] || []
|
||||
actionKeys = STATUS_PERMISSIONS.unpublished[status] || [];
|
||||
} else {
|
||||
// 已发布状态
|
||||
const stateKey = enabled ? 'enabled' : 'disabled'
|
||||
actionKeys = STATUS_PERMISSIONS.published[stateKey][status] || []
|
||||
const stateKey = enabled ? "enabled" : "disabled";
|
||||
actionKeys = STATUS_PERMISSIONS.published[stateKey][status] || [];
|
||||
}
|
||||
|
||||
return actionKeys.map((key,index) => ({
|
||||
name: key,
|
||||
label: ACTION_CONFIG[key].label,
|
||||
handler: this[ACTION_CONFIG[key].handler],
|
||||
icon: ACTION_CONFIG[key].icon,
|
||||
hoverIcon: ACTION_CONFIG[key].hoverIcon,
|
||||
labelColor: ACTION_CONFIG[key].labelColor,
|
||||
uniqueKey: `${item.id}-${key}-${index}`
|
||||
})).filter(Boolean)
|
||||
|
||||
return actionKeys
|
||||
.map((key, index) => ({
|
||||
name: key,
|
||||
label: ACTION_CONFIG[key].label,
|
||||
handler: this[ACTION_CONFIG[key].handler],
|
||||
icon: ACTION_CONFIG[key].icon,
|
||||
hoverIcon: ACTION_CONFIG[key].hoverIcon,
|
||||
labelColor: ACTION_CONFIG[key].labelColor,
|
||||
uniqueKey: `${item.id}-${key}-${index}`,
|
||||
}))
|
||||
.filter(Boolean);
|
||||
},
|
||||
handleManage(item) {
|
||||
sessionStorage.setItem('courseDetail',JSON.stringify(item));
|
||||
this.$router.push({ path: '/course/coursemanage' });
|
||||
sessionStorage.setItem("courseDetail", JSON.stringify(item));
|
||||
this.$router.push({ path: "/course/coursemanage" });
|
||||
},
|
||||
downloadQrcode() {
|
||||
let img = document.getElementById("qrcode").getElementsByTagName("img")[0];
|
||||
let img = document
|
||||
.getElementById("qrcode")
|
||||
.getElementsByTagName("img")[0];
|
||||
let canvas = document.createElement("canvas");
|
||||
canvas.width = img.width;
|
||||
canvas.height = img.height;
|
||||
@@ -320,25 +369,26 @@ export default {
|
||||
let tempUrl = canvas.toDataURL("image/png");
|
||||
// 创建a标签下载
|
||||
|
||||
let link = document.createElement('a'); //创建a标签
|
||||
link.style.display = 'none'; //使其隐藏
|
||||
let link = document.createElement("a"); //创建a标签
|
||||
link.style.display = "none"; //使其隐藏
|
||||
link.download = tempUrl;
|
||||
link.setAttribute('target', '_blank');
|
||||
link.setAttribute("target", "_blank");
|
||||
link.href = tempUrl; //赋予文件下载地址
|
||||
link.setAttribute('download', '二维码.jpg'); //设置下载属性 以及文件名
|
||||
link.setAttribute("download", "二维码.jpg"); //设置下载属性 以及文件名
|
||||
document.body.appendChild(link); //a标签插至页面中
|
||||
link.click(); //强制触发a标签事件
|
||||
document.body.removeChild(link);
|
||||
},
|
||||
handleCopyUrl() {
|
||||
document.getElementById("text").select()
|
||||
document.execCommand("Copy")
|
||||
this.$message.success("复制成功")
|
||||
document.getElementById("text").select();
|
||||
document.execCommand("Copy");
|
||||
this.$showMessage('复制成功', 'success')
|
||||
|
||||
},
|
||||
|
||||
|
||||
handleQrcode(row) {
|
||||
this.qrCodedialogVisible = true;
|
||||
let urlPre=window.location.protocol+'//'+window.location.host;
|
||||
let urlPre = window.location.protocol + "//" + window.location.host;
|
||||
|
||||
//动态的地址
|
||||
//urlPre=urlPre+'/m?returnUrl='+urlPre+'/mobile/pages/login/loading?returnUrl=';
|
||||
@@ -350,52 +400,54 @@ export default {
|
||||
// if(row.type==20){
|
||||
// this.copyUrl=urlPre+this.webBaseUrl+'/course/detail?id='+row.id;
|
||||
// }
|
||||
this.copyUrl = this.qrcodeImgUrl = process.env.VUE_APP_BOE_WEB_URL + '/systemapi/xboe/m/course/manage/redirectDetail?courseId=' + row.id
|
||||
console.log('qrcodeImgUrl', this.qrcodeImgUrl)
|
||||
console.log('webBaseUrl', this.webBaseUrl)
|
||||
this.copyUrl = this.qrcodeImgUrl =
|
||||
process.env.VUE_APP_BOE_WEB_URL +
|
||||
"/systemapi/xboe/m/course/manage/redirectDetail?courseId=" +
|
||||
row.id;
|
||||
console.log("qrcodeImgUrl", this.qrcodeImgUrl);
|
||||
console.log("webBaseUrl", this.webBaseUrl);
|
||||
// 使用$nextTick确保数据渲染
|
||||
this.$nextTick(() => {
|
||||
this.crateQrcode();
|
||||
});
|
||||
|
||||
},
|
||||
// 生成二维码
|
||||
// 生成二维码
|
||||
crateQrcode() {
|
||||
let qrcode = new QRCode('qrcode', {
|
||||
let qrcode = new QRCode("qrcode", {
|
||||
width: 150,
|
||||
height: 150, // 高度
|
||||
text: this.qrcodeImgUrl // 二维码内容
|
||||
text: this.qrcodeImgUrl, // 二维码内容
|
||||
// render: 'canvas' // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
|
||||
// background: '#f0f'
|
||||
// foreground: '#ff0'
|
||||
});
|
||||
console.log('qrcode', qrcode)
|
||||
console.log("qrcode", qrcode);
|
||||
},
|
||||
// 关闭弹框,清除已经生成的二维码
|
||||
closeCode() {
|
||||
this.qrCodedialogVisible = false
|
||||
this.qrCodedialogVisible = false;
|
||||
|
||||
// 逐个节点移除防止事件一起移除
|
||||
let images = document.querySelectorAll('.qrcode-img img');
|
||||
images.forEach(img => img.remove());
|
||||
let images = document.querySelectorAll(".qrcode-img img");
|
||||
images.forEach((img) => img.remove());
|
||||
|
||||
let canvas = document.querySelectorAll('.qrcode-img canvas');
|
||||
canvas.forEach(canvas => canvas.remove());
|
||||
let canvas = document.querySelectorAll(".qrcode-img canvas");
|
||||
canvas.forEach((canvas) => canvas.remove());
|
||||
},
|
||||
// 撤回接口
|
||||
withdraw(item) {
|
||||
this.$confirm('此操作将撤回审核中的课程, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
this.$confirm("此操作将撤回审核中的课程, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
apiCourse.revokeSubmit(item.id).then(res => {
|
||||
apiCourse.revokeSubmit(item.id).then((res) => {
|
||||
if (res.status == 200) {
|
||||
if (res.result) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '撤回成功!'
|
||||
type: "success",
|
||||
message: "撤回成功!",
|
||||
});
|
||||
this.getNewList();
|
||||
}
|
||||
@@ -404,16 +456,16 @@ export default {
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消撤回'
|
||||
type: "info",
|
||||
message: "已取消撤回",
|
||||
});
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.params.name = ''
|
||||
this.params.publish = ''
|
||||
this.params.status = ''
|
||||
this.params.enabled = ''
|
||||
this.params.name = "";
|
||||
this.params.publish = "";
|
||||
this.params.status = "";
|
||||
this.params.enabled = "";
|
||||
this.params.pageIndex = 1;
|
||||
// this.getList();
|
||||
this.isSearh = false;
|
||||
@@ -421,158 +473,114 @@ export default {
|
||||
toExamine(row) {
|
||||
// this.detailType = row.type;
|
||||
this.dialogVisible = true;
|
||||
apiCourse.auditCourseRecords({
|
||||
courseId: row.id
|
||||
}).then(res => {
|
||||
if (res.status === 200) {
|
||||
this.inviteTeacher = res.result;
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
apiCourse
|
||||
.auditCourseRecords({
|
||||
courseId: row.id,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
this.inviteTeacher = res.result;
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
examine(row) {
|
||||
if(!row.orgId){
|
||||
this.$message.error("课程还未设置资源归属,请先设置资源归属");
|
||||
return;
|
||||
}
|
||||
let $this=this;
|
||||
this.$confirm('您确定要直接提交审核所选课程吗?', '友情提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(()=>{
|
||||
//新的提交流程
|
||||
apiUserBasic.getOrgHrbpInfo(row.orgId).then(rs=>{
|
||||
if(rs.status==200 && rs.result){
|
||||
let req={
|
||||
courseId:row.id,
|
||||
email:rs.result.email,
|
||||
courseUser:row.sysCreateBy,
|
||||
courseName:row.name,
|
||||
ucode:rs.result.userNo,
|
||||
auditUser:rs.result.name,
|
||||
//ukid:hrbpUser.user_id,
|
||||
orgId:row.orgId,
|
||||
orgName:rs.result.orgNamePath +'/'+rs.result.name
|
||||
}
|
||||
apiCourse.sumbits(req).then(res=>{
|
||||
if(res.status==200){
|
||||
$this.$message.success('提交成功');
|
||||
row.status=2
|
||||
}
|
||||
if(res.status==400){
|
||||
$this.$message.error('提交失败:'+res.message);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
$this.$message.error("获取HRBP审核人员失败:"+rs.message);
|
||||
}
|
||||
});
|
||||
|
||||
// apiOrg.getSimple(row.orgId).then(rrs=>{
|
||||
// if(rrs.status==200){
|
||||
// apiHRBP.getHRBP(rrs.result.kid).then(rs=>{
|
||||
// if(rs.status==200 && rs.result.length>0){
|
||||
// let hrbpUser=rs.result[0];
|
||||
// let req={
|
||||
// courseId:row.id,
|
||||
// email:hrbpUser.email,
|
||||
// courseUser:row.sysCreateBy,
|
||||
// courseName:row.name,
|
||||
// ucode:hrbpUser.user_no,
|
||||
// auditUser:hrbpUser.real_name,
|
||||
// ukid:hrbpUser.user_id,
|
||||
// orgId:row.orgId,
|
||||
// orgName:rs.result.orgnization_name_path+'/'+rrs.result.name
|
||||
// }
|
||||
// apiCourse.sumbits(req).then(res=>{
|
||||
// if(res.status==200){
|
||||
// $this.$message.success('提交成功');
|
||||
// row.status=2
|
||||
// }
|
||||
// if(res.status==400){
|
||||
// $this.$message.error('提交失败:'+res.message);
|
||||
// }
|
||||
// })
|
||||
// }else{
|
||||
// $this.$message.error("获取HRBP审核人员失败:"+rs.message);
|
||||
// }
|
||||
// })
|
||||
// }else{
|
||||
// $this.$message.error("处理资源归属失败,请重新设置资源归属");
|
||||
// }
|
||||
// })
|
||||
})
|
||||
if (!row.orgId) {
|
||||
this.$message.error("课程还未设置资源归属,请先设置资源归属");
|
||||
return;
|
||||
}
|
||||
let $this = this;
|
||||
this.$confirm("您确定要直接提交审核所选课程吗?", "友情提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
//新的提交流程
|
||||
apiUserBasic.getOrgHrbpInfo(row.orgId).then((rs) => {
|
||||
if (rs.status == 200 && rs.result) {
|
||||
let req = {
|
||||
courseId: row.id,
|
||||
email: rs.result.email,
|
||||
courseUser: row.sysCreateBy,
|
||||
courseName: row.name,
|
||||
ucode: rs.result.userNo,
|
||||
auditUser: rs.result.name,
|
||||
//ukid:hrbpUser.user_id,
|
||||
orgId: row.orgId,
|
||||
orgName: rs.result.orgNamePath + "/" + rs.result.name,
|
||||
};
|
||||
apiCourse.sumbits(req).then((res) => {
|
||||
if (res.status == 200) {
|
||||
$this.$message.success("提交成功");
|
||||
row.status = 2;
|
||||
}
|
||||
if (res.status == 400) {
|
||||
$this.$message.error("提交失败:" + res.message);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$this.$message.error("获取HRBP审核人员失败:" + rs.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
delItem(row) {
|
||||
console.log('delItem', row);
|
||||
this.$confirm(`确认删除${row.name}吗?`, '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(async () => {
|
||||
async delItem(row) {
|
||||
this.$messageBox.confirm({
|
||||
title: "删除确认",
|
||||
message: `确认删除${row.name}吗?`,
|
||||
handleConfirm: async () => {
|
||||
let params = {
|
||||
id: row.id,
|
||||
title: row.name
|
||||
title: row.name,
|
||||
};
|
||||
try {
|
||||
// {id:课程id,多个使用逗号分隔,Boolean erasable 是否物理删除,title:课程的名称, remark 备注}
|
||||
const { status } = await apiCourse.del(params);
|
||||
if (status === 200) {
|
||||
this.$message.success('操作成功!');
|
||||
//事件移到后端处理
|
||||
// if(!row.erasable){
|
||||
// let event = {
|
||||
// key: "DeleteCourse",//被管理员删除
|
||||
// title: '自己删除课程',//事件的标题
|
||||
// parameters:"author:"+this.userInfo.aid,//自己删除自己的课程,作者就是当前人
|
||||
// content: '自己删除课程',//事件的内容
|
||||
// objId: row.id,//关联的id
|
||||
// objType: "1",//关联的类型
|
||||
// objInfo:row.name,
|
||||
// aid: this.userInfo.aid, //当前登录人的id
|
||||
// aname: this.userInfo.name,//当前人的姓名
|
||||
// status: 1 //状态,直接写1
|
||||
// }
|
||||
// this.$store.dispatch("userTrigger", event);
|
||||
// }
|
||||
|
||||
this.$showMessage('删除成功', 'success')
|
||||
// this.$message.success("操作成功!");
|
||||
this.getNewList();
|
||||
} else {
|
||||
this.$message.success('操作失败!');
|
||||
this.$showMessage('删除失败', 'error')
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
this.$message({ type: 'info', message: '已取消删除', offset: 50 });
|
||||
});
|
||||
},
|
||||
handleCancel: () => {
|
||||
this.$showMessage('已取消删除', 'warning')
|
||||
},
|
||||
});
|
||||
},
|
||||
jumpRouter(item) {
|
||||
if (item.published) {
|
||||
// if (item.type == 10) {
|
||||
// let routeData = this.$router.resolve({ path: '/course/micro?id='+item.id});
|
||||
// window.open(this.webBaseUrl+routeData.href, '_blank');
|
||||
// let routeData = this.$router.resolve({ path: '/course/micro?id='+item.id});
|
||||
// window.open(this.webBaseUrl+routeData.href, '_blank');
|
||||
// window.open(this.webBaseUrl + '/course/micro?id=' + item.id, '_blank');
|
||||
// this.$router.push({path:'/course/micro',query:{id:item.id}})
|
||||
// this.$router.push({path:'/course/micro',query:{id:item.id}})
|
||||
// }
|
||||
// if (item.type == 20) {
|
||||
// let routeData = this.$router.resolve({ path: '/course/detail?id='+item.id});
|
||||
// window.open(this.webBaseUrl+routeData.href, '_blank');
|
||||
// window.open(this.webBaseUrl + '/course/detail?id=' + item.id, '_blank');
|
||||
//this.$router.push({path:'/course/detail',query:{id:item.id}})
|
||||
this.$router.push({path:'/course/studyindex',query:{id:item.id}})
|
||||
// }
|
||||
// let routeData = this.$router.resolve({ path: '/course/detail?id='+item.id});
|
||||
// window.open(this.webBaseUrl+routeData.href, '_blank');
|
||||
// window.open(this.webBaseUrl + '/course/detail?id=' + item.id, '_blank');
|
||||
//this.$router.push({path:'/course/detail',query:{id:item.id}})
|
||||
this.$router.push({
|
||||
path: "/course/studyindex",
|
||||
query: { id: item.id },
|
||||
});
|
||||
// }
|
||||
} else {
|
||||
// if (item.type == 10) {
|
||||
// // window.open(`${this.webBaseUrl}/course/microPreview?id=${item.id}`);
|
||||
// this.$router.push({path:'/course/microPreview',query:{id:item.id}})
|
||||
// } else {
|
||||
// window.open(`${this.webBaseUrl}/course/rePreview?id=${item.id}`);
|
||||
this.$router.push({path:'/course/rePreview',query:{id:item.id}})
|
||||
this.$router.push({
|
||||
path: "/course/rePreview",
|
||||
query: { id: item.id },
|
||||
});
|
||||
// }
|
||||
}
|
||||
},
|
||||
@@ -582,19 +590,19 @@ export default {
|
||||
},
|
||||
getList() {
|
||||
this.noMore = false;
|
||||
this.params.teacherId = this.userInfo.aid;
|
||||
apiCourse.courseList(this.params).then(res => {
|
||||
// this.params.teacherId = this.userInfo.aid;
|
||||
apiCourse.courseList(this.params).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.status == 200) {
|
||||
this.couresList = [...this.couresList, ...res.result.list];
|
||||
|
||||
|
||||
this.count = res.result.count;
|
||||
console.log(this.couresList.length, 'this.count', this.count);
|
||||
if (this.couresList.length >= this.count){
|
||||
console.log(this.couresList.length, "this.count", this.count);
|
||||
if (this.couresList.length >= this.count) {
|
||||
this.noMore = true;
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
this.$showMessage(res.message, 'error')
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -602,13 +610,13 @@ export default {
|
||||
this.$refs.courseForm.initShow();
|
||||
},
|
||||
editCourse(row) {
|
||||
console.log(row, 'editCourse');
|
||||
console.log(row, "editCourse");
|
||||
this.$refs.courseForm.initShow(row);
|
||||
},
|
||||
lastTabChange(tab, event) {
|
||||
console.log(tab.name);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -618,7 +626,7 @@ export default {
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
}
|
||||
.list-wu{
|
||||
.list-wu {
|
||||
text-align: center;
|
||||
margin: 40px;
|
||||
color: #333;
|
||||
@@ -683,7 +691,7 @@ export default {
|
||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
|
||||
cursor: pointer;
|
||||
span {
|
||||
color: #409EFF;
|
||||
color: #409eff;
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
@@ -697,10 +705,11 @@ export default {
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
padding: 20px 0px 15px 0px;
|
||||
margin: 0 32px 0 22px;
|
||||
::v-deep .uc-course-img {
|
||||
::v-deep .uc-course-img {
|
||||
width: 212px;
|
||||
img {
|
||||
width: 212px;height:119px;
|
||||
width: 212px;
|
||||
height: 119px;
|
||||
border: 1px solid #f4f4f5;
|
||||
}
|
||||
}
|
||||
@@ -716,7 +725,7 @@ export default {
|
||||
font-size: 14px;
|
||||
overflow: hidden;
|
||||
width: 90%;
|
||||
word-break:break-all;
|
||||
word-break: break-all;
|
||||
display: -webkit-box;
|
||||
// overflow: hidden;
|
||||
-webkit-box-orient: vertical;
|
||||
@@ -725,13 +734,13 @@ export default {
|
||||
.uc-course-name {
|
||||
font-size: 16px;
|
||||
display: -webkit-box;
|
||||
white-space:pre-wrap;
|
||||
// word-wrap: break-word;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
word-break:break-all;
|
||||
white-space: pre-wrap;
|
||||
// word-wrap: break-word;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
word-break: break-all;
|
||||
// font-weight: 700;
|
||||
}
|
||||
.uc-course-item {
|
||||
@@ -752,11 +761,9 @@ export default {
|
||||
.btn-item {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.uc-course-btns {
|
||||
|
||||
text-align: right;
|
||||
.btn1 {
|
||||
height: 44px;
|
||||
|
||||
Reference in New Issue
Block a user