dev_review
yujialong 10 months ago
parent 292d73a222
commit 717b8a08dd
  1. 31
      public/index.html
  2. 1
      src/assets/css/main.css
  3. 4
      src/setting.js
  4. 4
      src/utils/editor.js
  5. 2
      src/views/course/AddCurriculum.vue
  6. 430
      src/views/data/Introduce.vue
  7. 11
      src/views/match/add/step2.vue
  8. 3
      src/views/serve/Configure.vue
  9. 596
      src/views/theoreticalCourse/list/buildPlatform/index.vue

@ -1,18 +1,19 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="keywords" content="深圳或然科技中台"> <meta name="keywords" content="深圳或然科技中台" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<script src="/styles/tinymce/tinymce.min.js"></script> <meta name="viewport" content="width=device-width, user-scalable=yes, shrink-to-fit=no" />
<title>深圳或然科技中台</title> <script src="/styles/tinymce/tinymce.min.js"></script>
</head> <title>深圳或然科技中台</title>
<body> </head>
<noscript> <body>
<strong>We're sorry but vms doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <noscript>
</noscript> <strong>We're sorry but vms doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<div id="app"></div> </noscript>
<!-- built files will be auto injected --> <div id="app"></div>
</body> <!-- built files will be auto injected -->
</body>
</html> </html>

@ -14,6 +14,7 @@ body,
} }
body { body {
min-width: 1200px;
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif; font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif;
font-size: 14px; font-size: 14px;
} }

@ -12,8 +12,8 @@ if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
sandPath = `http://${location.hostname}:9520` sandPath = `http://${location.hostname}:9520`
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' host = 'https://huorantech.cn/'
host = 'http://192.168.31.217:9000/'// 榕 // host = 'http://192.168.31.217:9000/'// 榕
// host = 'http://192.168.31.51:9000/'// 赓 // host = 'http://192.168.31.51:9000/'// 赓
} else if (isPro) { } else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/' jumpPath = 'https://www.huorantech.cn/judgmentPoint/'

@ -307,7 +307,7 @@ export default {
} }
// Return new URL // Return new URL
return url return url
}, },
// 自定义上传 // 自定义上传
images_upload_handler: function (blobInfo, succFun, failFun) { images_upload_handler: function (blobInfo, succFun, failFun) {
const blob = blobInfo.blob() const blob = blobInfo.blob()
@ -315,7 +315,7 @@ export default {
const file = new File([blob], blobInfo.filename(), { const file = new File([blob], blobInfo.filename(), {
type: 'application/json', type: 'application/json',
lastModified: Date.now() lastModified: Date.now()
}); });
Oss.upload(file).then(res => { Oss.upload(file).then(res => {
succFun(res.url) succFun(res.url)
}) })

@ -1177,7 +1177,7 @@ $avatar-width: 104px;
} }
.systems { .systems {
margin-top: 10px; margin-top: 10px;
max-height: 550px; max-height: 520px;
overflow: auto; overflow: auto;
li { li {
display: flex; display: flex;

@ -1,212 +1,238 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="side"> <div class="side">
<el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" :highlight-current="true" @current-change="typeClick"></el-tree> <el-tree ref="type"
</div> :data="typeList"
node-key="id"
accordion
:default-expanded-keys="defaultActive"
:current-node-key="categoryId"
:props="defaultProps"
:highlight-current="true"
@current-change="typeClick"></el-tree>
</div>
<div class="right"> <div class="right">
<div class="flex-between" style="margin-bottom: 10px;"> <div class="flex-between"
<p>数据简介</p> style="margin-bottom: 10px;">
<el-button v-if="introduceText && !editing" type="primary" @click="editing = !editing" v-auth="'/data:数据简介:编辑'">编辑</el-button> <p>数据简介</p>
</div> <el-button v-if="introduceText && !editing"
<div class="intro" v-if="!introduceText && !editing"> type="primary"
<p class="text">请添加简介</p> @click="editing = !editing"
<div class="btn"> v-auth="'/data:数据简介:编辑'">编辑</el-button>
<el-button type="primary" @click="edit">添加</el-button> </div>
</div> <div class="intro"
</div> v-if="!introduceText && !editing">
<template v-if="introduceText || editing"> <p class="text">请添加简介</p>
<el-input placeholder="请输入简介" v-model="introduce" type="textarea" rows="5" :disabled="!editing"></el-input> <div class="btn">
<div class="field"> <el-button type="primary"
<p class="label">数据源</p> @click="edit">添加</el-button>
<el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text" :disabled="!editing"></el-input> </div>
</div> </div>
</template> <template v-if="introduceText || editing">
<div class="field"> <el-input placeholder="请输入简介"
<p class="label">关键字</p> v-model="introduce"
<div class="tag-add" v-if="editing"> type="textarea"
<el-input placeholder="请输入关键字" size="small" v-model="newKeyword"></el-input> rows="5"
<span v-if="editing"> :disabled="!editing"></el-input>
<el-button @click="save" style="color: #9076FF;border: 1px solid #9076FF;border-radius:5px;height: 25px;line-height: 0px"> </el-button> <div class="field">
</span> <p class="label">数据源</p>
</div> <el-input style="width: 250px"
<div class="tag-wrap"> placeholder="请输入数据源"
<el-tag v-model="dataSource"
:key="tag.id" type="text"
:type="editing ? '' : 'info'" :disabled="!editing"></el-input>
v-for="tag in keywordList"
:closable="editing"
:disable-transitions="false"
@close="delKeyword(tag)">
{{tag.keyword}}
</el-tag>
</div>
</div>
<div class="btns" v-if="editing">
<el-button @click="editing = false"> </el-button>
<el-button type="primary" @click="confirmData"> </el-button>
</div>
</div> </div>
</template>
<div class="field">
<p class="label">关键字</p>
<div class="tag-add"
v-if="editing">
<el-input placeholder="请输入关键字"
size="small"
v-model="newKeyword"></el-input>
<span v-if="editing">
<el-button @click="save"
style="color: #9076FF;border: 1px solid #9076FF;border-radius:5px;height: 25px;line-height: 0px"> </el-button>
</span>
</div>
<div class="tag-wrap">
<el-tag :key="tag.id"
:type="editing ? '' : 'info'"
v-for="tag in keywordList"
:closable="editing"
:disable-transitions="false"
@close="delKeyword(tag)">
{{tag.keyword}}
</el-tag>
</div>
</div>
<div class="btns"
v-if="editing">
<el-button @click="editing = false"> </el-button>
<el-button type="primary"
@click="confirmData"> </el-button>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
export default { export default {
data() { data () {
return { return {
typeList: [], typeList: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
}, },
defaultActive: [], defaultActive: [],
editing: false, editing: false,
edited: false, edited: false,
introduce: '', introduce: '',
dataSource: '', dataSource: '',
introduceText: '', introduceText: '',
categoryId: '', categoryId: '',
keywordList: [], keywordList: [],
newKeyword: '' newKeyword: ''
}; };
}, },
watch: { watch: {
keyword: function(val) { keyword: function (val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.getData()
},500)
}
},
mounted(){
this.getData() this.getData()
}, }, 500)
methods: { }
getData(){ },
// mounted () {
this.$post(this.api.getTableByClassification).then(res => { this.getData()
// idlabel },
function handleId(data){ methods: {
data.map(n => { getData () {
n.id = String(n.id) //
n.label = n.categoryName this.$post(this.api.getTableByClassification).then(res => {
if(n.children.length){ // idlabel
handleId(n.children) function handleId (data) {
} data.map(n => {
}) n.id = String(n.id)
} n.label = n.categoryName
handleId(res) if (n.children.length) {
console.log(res) handleId(n.children)
this.typeList = res
// id
if (!this.edited) {
if(res[0].children.length){
let item = res[0].children[0]
this.categoryId = item.id
this.dataSource = res[0].children[0].dataSource
this.defaultActive = [res[0].children[0].id]
// this.defaultActive = [item.id]
this.introduceText = item.introduce
this.introduce = item.introduce
}else{
this.categoryId = res[0].id
this.dataSource = res[0].dataSource
this.defaultActive = [res[0].children[0].id]
// this.defaultActive = [res[0].id]
this.introduceText = res[0].introduce
this.introduce = res[0].introduce
}
this.$nextTick(() => {
this.$refs.type.setCurrentKey(this.categoryId)
})
}
this.getKeyword()
}).catch(res => {})
},
//
typeClick(data,node){
console.log(data)
this.editing = false
this.categoryId = data.id
this.defaultActive = [data.id]
this.introduceText = data.introduce
this.introduce = data.introduce
this.dataSource = data.dataSource
this.getKeyword()
},
//
getKeyword(){
this.$get(this.api.getKeywordByCategoryId,{
categoryId: this.categoryId
}).then(res => {
this.keywordList = res.keywords
}).catch(res => {})
},
//
edit(){
this.editing = true
this.introduce = this.introduceText
},
//
saveType(){
const id = this.categoryId // id
this.$post(this.api.updateCategory,{
id,
introduce: this.introduce,
dataSource: this.dataSource
}).then(res => {
this.$message.success(this.introduceText ? '编辑成功' : '新增成功')
this.introduceText = this.introduce
this.editing = false
this.edited = true
// this.getData()
}).catch(res => {})
},
//
delKeyword(item) {
this.$post(`${this.api.deleteKeyword}?categoryId=${this.categoryId}&keyword=${item.keyword}`).then(res => {
this.$message.success('删除成功')
this.getKeyword()
}).catch(res => {})
},
save(){
const keyword = this.newKeyword
if (keyword) {
if (this.keywordList.find(e => e.keyword === keyword)) return this.$message.error('请不要输入重复关键字!')
// this.confirmEdit()
this.$post(this.api.addKeyword,{
categoryId: this.categoryId,
keyword
}).then(res => {
this.newKeyword = ''
this.getKeyword()
}).catch(res => {})
} else {
this.confirmEdit()
}
},
//
confirmData() {
const keyword = this.newKeyword //
//
if (keyword) {
//
if (this.keywordList.find(e => e.keyword === keyword)) return this.$message.error('请不要输入重复关键字!')
this.saveType()
//
this.$post(this.api.addKeyword,{
categoryId: this.categoryId,
keyword
}).then(res => {
this.newKeyword = '' //
this.getKeyword()
}).catch(res => {})
} else {
this.saveType()
} }
})
}
handleId(res)
console.log(res)
this.typeList = res
// id
if (!this.edited) {
if (res[0].children.length) {
let item = res[0].children[0]
this.categoryId = item.id
this.dataSource = res[0].children[0].dataSource
this.defaultActive = [res[0].children[0].id]
// this.defaultActive = [item.id]
this.introduceText = item.introduce
this.introduce = item.introduce
} else {
this.categoryId = res[0].id
this.dataSource = res[0].dataSource
this.defaultActive = [res[0].children[0].id]
// this.defaultActive = [res[0].id]
this.introduceText = res[0].introduce
this.introduce = res[0].introduce
}
this.$nextTick(() => {
this.$refs.type.setCurrentKey(this.categoryId)
})
} }
this.getKeyword()
}).catch(res => { })
},
//
typeClick (data, node) {
console.log(data)
this.editing = false
this.categoryId = data.id
this.defaultActive = [data.id]
this.introduceText = data.introduce
this.introduce = data.introduce
this.dataSource = data.dataSource
this.getKeyword()
},
//
getKeyword () {
this.$get(this.api.getKeywordByCategoryId, {
categoryId: this.categoryId
}).then(res => {
this.keywordList = res.keywords
}).catch(res => { })
},
//
edit () {
this.editing = true
this.introduce = this.introduceText
},
//
saveType () {
const id = this.categoryId // id
this.$post(this.api.updateCategory, {
id,
introduce: this.introduce,
dataSource: this.dataSource
}).then(res => {
this.$message.success(this.introduceText ? '编辑成功' : '新增成功')
this.introduceText = this.introduce
this.editing = false
this.edited = true
// this.getData()
}).catch(res => { })
},
//
delKeyword (item) {
this.$post(`${this.api.deleteKeyword}?categoryId=${this.categoryId}&keyword=${item.keyword}`).then(res => {
this.$message.success('删除成功')
this.getKeyword()
}).catch(res => { })
},
save () {
const keyword = this.newKeyword
if (keyword) {
if (this.keywordList.find(e => e.keyword === keyword)) return this.$message.error('请不要输入重复关键字!')
// this.confirmEdit()
this.$post(this.api.addKeyword, {
categoryId: this.categoryId,
keyword
}).then(res => {
this.newKeyword = ''
this.getKeyword()
}).catch(res => { })
} else {
this.confirmEdit()
}
},
//
confirmData () {
const keyword = this.newKeyword //
//
if (keyword) {
//
if (this.keywordList.find(e => e.keyword === keyword)) return this.$message.error('请不要输入重复关键字!')
this.saveType()
//
this.$post(this.api.addKeyword, {
categoryId: this.categoryId,
keyword
}).then(res => {
this.newKeyword = '' //
this.getKeyword()
}).catch(res => { })
} else {
this.saveType()
}
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -224,12 +250,12 @@ export default {
width: calc(100% - 374px); width: calc(100% - 374px);
padding: 24px 0; padding: 24px 0;
} }
.intro{ .intro {
padding: 20px; padding: 20px;
margin: 20px 0; margin: 20px 0;
border: 1px solid #dcdcdc; border: 1px solid #dcdcdc;
border-radius: 4px; border-radius: 4px;
.text{ .text {
margin-bottom: 20px; margin-bottom: 20px;
} }
} }
@ -244,7 +270,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.btns{ .btns {
margin-top: 20px; margin-top: 20px;
} }
} }
@ -259,7 +285,7 @@ export default {
margin-left: 5px; margin-left: 5px;
} }
} }
.mag{ .mag {
margin-right: 20px; margin-right: 20px;
margin-left: 20px; margin-left: 20px;
} }

@ -80,7 +80,8 @@
<span class="req">*</span> <span class="req">*</span>
团队参赛人数限制 团队参赛人数限制
<el-radio v-model="item.teamNumLimitOpt" <el-radio v-model="item.teamNumLimitOpt"
:label="0">不限制</el-radio> :label="0"
@change="item.teamNumLimit = 0">不限制</el-radio>
<el-radio v-model="item.teamNumLimitOpt" <el-radio v-model="item.teamNumLimitOpt"
:label="1">自定义</el-radio> :label="1">自定义</el-radio>
<el-input v-model.number="item.teamNumLimit" <el-input v-model.number="item.teamNumLimit"
@ -397,6 +398,8 @@ export default {
} }
form.competitionStageList = stages.slice(0, 1) // form.competitionStageList = stages.slice(0, 1) //
} else { // } else { //
let teamNumLimit = 0
const { competitionType, minTeamSize, maxTeamSize } = step1.completeCompetitionSetup // 01
for (const i in stages) { for (const i in stages) {
const e = stages[i] const e = stages[i]
if (rule !== 2 && !e.stageName) { if (rule !== 2 && !e.stageName) {
@ -404,7 +407,6 @@ export default {
util.errorMsg('请输入阶段名称') util.errorMsg('请输入阶段名称')
break break
} }
const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 01
// rule: 012 // rule: 012
// //
if (!rule) { if (!rule) {
@ -452,8 +454,13 @@ export default {
} }
e.resultAnnouncementTime = +e.resultAnnouncementTime e.resultAnnouncementTime = +e.resultAnnouncementTime
} }
if (e.teamNumLimit) teamNumLimit += e.teamNumLimit //
} }
if (invalid) return if (invalid) return
if (form.teamLimit && competitionType) {
if (stages.length > minTeamSize) return util.errorMsg('阶段数不得大于团队人数下限')
if (teamNumLimit > minTeamSize) return util.errorMsg('各阶段自定义的参赛人数之和不得大于团队人数下限')
}
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入') if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入')
} }
} else { // 稿 } else { // 稿

@ -126,6 +126,7 @@
<el-pagination background <el-pagination background
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:current-page="pageNo"
:total="totals"> :total="totals">
</el-pagination> </el-pagination>
</div> </div>
@ -227,7 +228,7 @@ export default {
// //
toBackstage (row) { toBackstage (row) {
if (row.systemId == 19) { if (row.systemId == 19) {
location.href = `${Setting.sandPath}/#/config?token=${sessionStorage.getItem('token')}&referrer=${encodeURIComponent(location.href)}` location.href = `${Setting.sandPath}/#/config?token=${sessionStorage.getItem('token')}&admin=1&referrer=${encodeURIComponent(location.href)}`
} else { } else {
this.$router.push(`/backstage?systemId=${row.systemId}&show=1&name=${row.systemName}`) this.$router.push(`/backstage?systemId=${row.systemId}&show=1&name=${row.systemName}`)
} }

@ -1,281 +1,353 @@
<template> <template>
<!-- 平台自建 --> <!-- 平台自建 -->
<div style="padding-top: 24px"> <div style="padding-top: 24px">
<div class="tool"> <div class="tool">
<ul class="filter" style="align-items: flex-start"> <ul class="filter"
<li> style="align-items: flex-start">
<label>可见范围</label> <li>
<el-select v-model="form.visibleRange" clearable placeholder="请选择可见范围" @change="getData"> <label>可见范围</label>
<el-option v-for="(item,index) in regions" :key="index" :label="item.name" :value="item.id"></el-option> <el-select v-model="form.visibleRange"
</el-select> clearable
</li> placeholder="请选择可见范围"
<li> @change="getData">
<label>课程分类</label> <el-option v-for="(item,index) in regions"
<el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData"> :key="index"
<el-option label="不限" value=""></el-option> :label="item.name"
<el-option label="暂无分类" value="0"></el-option> :value="item.id"></el-option>
<el-option v-for="(item,index) in classificationList" :key="index" :label="item.classificationName" :value="item.id"></el-option> </el-select>
</el-select> </li>
</li> <li>
<li> <label>课程分类</label>
<label>课程类型</label> <el-select v-model="form.categoryId"
<el-select v-model="form.courseType" clearable placeholder="请选择课程类型" @change="getData"> clearable
<el-option v-for="(item,index) in types" :key="index" :label="item.name" :value="item.id"></el-option> placeholder="请选择课程分类"
</el-select> @change="getData">
</li> <el-option label="不限"
<li> value=""></el-option>
<label>搜索</label> <el-option label="暂无分类"
<el-input placeholder="请输入理论课程名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input> value="0"></el-option>
</li> <el-option v-for="(item,index) in classificationList"
</ul> :key="index"
<div> :label="item.classificationName"
<el-button v-auth="'平台自建:新增'" type="primary" round @click="addCourse">新增</el-button> :value="item.id"></el-option>
<el-button v-auth="'平台自建:批量删除'" type="primary" round @click="delAllData">批量删除</el-button> </el-select>
</div> </li>
</div> <li>
<label>课程类型</label>
<el-select v-model="form.courseType"
clearable
placeholder="请选择课程类型"
@change="getData">
<el-option v-for="(item,index) in types"
:key="index"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入理论课程名称/创建人"
suffix-icon="el-icon-search"
v-model="keyword"
clearable
size="small"></el-input>
</li>
</ul>
<div>
<el-button v-auth="'平台自建:新增'"
type="primary"
round
@click="addCourse">新增</el-button>
<el-button v-auth="'平台自建:批量删除'"
type="primary"
round
@click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table :data="list"
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> class="table"
<el-table-column type="index" width="100" label="序号" align="center"> ref="table"
<template slot-scope="scope"> stripe
{{ scope.$index + (page - 1) * pageSize + 1 }} header-align="center"
</template> @selection-change="handleSelectionChange"
</el-table-column> row-key="id">
<el-table-column prop="courseName" label="课程名称" align="center"> <el-table-column type="selection"
</el-table-column> width="80"
<el-table-column label="可见范围" align="center"> align="center"
<template slot-scope="scope"> :reserve-selection="true"></el-table-column>
{{ regionName[scope.row.visibleRange] }} <el-table-column type="index"
</template> width="100"
</el-table-column> label="序号"
<el-table-column prop="createTime" label="创建时间" align="center"> align="center">
</el-table-column> <template slot-scope="scope">
<el-table-column prop="courseClassification" label="课程类型" align="center"> {{ scope.$index + (page - 1) * pageSize + 1 }}
<template slot-scope="scope"> </template>
{{ scope.row.courseType == 1 ? '付费' : '免费' }} </el-table-column>
</template> <el-table-column prop="courseName"
</el-table-column> label="课程名称"
<el-table-column prop="founder" label="创建人" align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column prop="courseClassification" label="课程分类" align="center" show-overflow-tooltip> <el-table-column label="可见范围"
</el-table-column> align="center">
<el-table-column label="操作" align="center" width="250"> <template slot-scope="scope">
<template slot-scope="scope"> {{ regionName[scope.row.visibleRange] }}
<el-button v-auth="'平台自建:编辑信息'" type="text" @click="editCourse(scope.row)">编辑信息</el-button> </template>
<el-divider v-auth="'平台自建:编辑信息'" direction="vertical"></el-divider> </el-table-column>
<el-button v-auth="'平台自建:内容设置'" type="text" @click="config(scope.row)">内容设置</el-button> <el-table-column prop="createTime"
<el-divider v-auth="'平台自建:内容设置'" direction="vertical"></el-divider> label="创建时间"
<el-button v-auth="'平台自建:预览'" type="text" @click="preview(scope.row)">预览</el-button> align="center">
<el-divider v-auth="'平台自建:预览'" direction="vertical"></el-divider> </el-table-column>
<el-button v-auth="'平台自建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-table-column prop="courseClassification"
</template> label="课程类型"
</el-table-column> align="center">
<el-table-column label="可授权状态" align="center" width="120"> <template slot-scope="scope">
<template slot-scope="scope"> {{ scope.row.courseType == 1 ? '付费' : '免费' }}
<el-switch </template>
v-auth="'平台自建:禁用'" </el-table-column>
v-model="scope.row.ztOpen" <el-table-column prop="founder"
:active-value="0" label="创建人"
:inactive-value="1" align="center">
style="margin: 0 10px 0 5px" </el-table-column>
:active-text="scope.row.ztOpen ? '关' : '开'" <el-table-column prop="courseClassification"
@change="switchOff($event,scope.row,scope.$index)" label="课程分类"
></el-switch> align="center"
</template> show-overflow-tooltip>
</el-table-column> </el-table-column>
</el-table> <el-table-column label="操作"
<div class="pagination"> align="center"
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> width="250">
</el-pagination> <template slot-scope="scope">
</div> <el-button v-auth="'平台自建:编辑信息'"
type="text"
@click="editCourse(scope.row)">编辑信息</el-button>
<el-divider v-auth="'平台自建:编辑信息'"
direction="vertical"></el-divider>
<el-button v-auth="'平台自建:内容设置'"
type="text"
@click="config(scope.row)">内容设置</el-button>
<el-divider v-auth="'平台自建:内容设置'"
direction="vertical"></el-divider>
<el-button v-auth="'平台自建:预览'"
type="text"
@click="preview(scope.row)">预览</el-button>
<el-divider v-auth="'平台自建:预览'"
direction="vertical"></el-divider>
<el-button v-auth="'平台自建:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="可授权状态"
align="center"
width="120">
<template slot-scope="scope">
<el-switch v-auth="'平台自建:禁用'"
v-model="scope.row.ztOpen"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div> </div>
</div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from '@/setting' import Setting from '@/setting'
export default { export default {
data() { data () {
return { return {
timer: null, timer: null,
regionName: ['本校内', '全平台可见', '指定院校区域'], regionName: ['本校内', '全平台可见', '指定院校区域'],
regions: [ regions: [
{ {
id: '', id: '',
name: '不限' name: '不限'
},
{
id: 1,
name: '全平台'
},
{
id: 2,
name: '指定院校区域'
}
],
types: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '付费'
},
{
id: 0,
name: '免费'
}
],
form: {
visibleRange: '',
categoryId: '',
courseType: ''
},
keyword: "",
classificationId: "",
list: [],
multipleSelection: [],
classificationList: [],
page: +this.$route.query.page || 1, //
pageSize: 10,
total: 0
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
this.getClassification();
this.getData();
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
})
},
methods: {
//:
//
// 使
//1.
getList() {
this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page,
pageSize: this.pageSize,
keyWord: this.keyword,
createPlatform: 0,
platformSource: Setting.platformSource,
...this.form
}).then(({ page }) => {
this.list = page.records;
this.total = page.total;
if (!this.list.length && this.total) {
this.page--;
this.getData();
}
}).catch(res => {
});
},
// redis
getRedis() {
this.$post(this.api.getRedisCache).then(({ data }) => {
data && this.getList()
}).catch(res => {})
}, },
getData() { {
this.getList() id: 1,
if (!Setting.isDev) { name: '全平台'
clearInterval(this.timer)
this.timer = setInterval(this.getRedis, 1000)
}
}, },
initData() { {
this.page = 1; id: 2,
this.getData(); name: '指定院校区域'
}
],
types: [
{
id: '',
name: '不限'
}, },
getClassification() { {
this.$post(this.api.listClassification, { id: 1,
pageNum: 1, name: '付费'
pageSize: 1000,
platformSource: Setting.platformSource
}).then(({ page }) => {
this.classificationList = page.records
}).catch(res => {})
}, },
changeType(type) { {
this.classificationId = type; id: 0,
name: '免费'
}
],
form: {
visibleRange: '',
categoryId: '',
courseType: ''
},
keyword: "",
classificationId: "",
list: [],
multipleSelection: [],
classificationList: [],
page: +this.$route.query.page || 1, //
pageSize: 10,
total: 0
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getClassification();
this.getData();
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
})
},
methods: {
//:
//
// 使
//1.
getList () {
this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page,
pageSize: this.pageSize,
keyWord: this.keyword,
createPlatform: 0,
platformSource: Setting.platformSource,
...this.form
}).then(({ page }) => {
this.list = page.records;
this.total = page.total;
if (!this.list.length && this.total) {
this.page--;
this.getData();
}
}).catch(res => {
});
},
// redis
getRedis () {
this.$post(this.api.getRedisCache).then(({ data }) => {
data && this.getList()
}).catch(res => { })
},
getData () {
this.getList()
// if (!Setting.isDev) {
// clearInterval(this.timer)
// this.timer = setInterval(this.getRedis, 1000)
// }
},
initData () {
this.page = 1;
this.getData();
},
getClassification () {
this.$post(this.api.listClassification, {
pageNum: 1,
pageSize: 1000,
platformSource: Setting.platformSource
}).then(({ page }) => {
this.classificationList = page.records
}).catch(res => { })
},
changeType (type) {
this.classificationId = type;
this.initData();
},
preview (row) {
this.$router.push(`/previewTheoreticalCourse?id=${row.id}`);
},
config (row) {
this.$router.push(`/setTheoreticalCourse?id=${row.id}`);
},
addCourse () {
this.$router.push("/addTheoreticalCourse");
},
editCourse (row) {
this.$router.push(`/addTheoreticalCourse?id=${row.id}`);
},
handleDelete (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$post(`${this.api.delTheoreticalCourse}?ids=${row.id}`).then(res => {
util.successMsg("删除成功");
this.initData(); this.initData();
}, }).catch(res => {
preview(row) { });
this.$router.push(`/previewTheoreticalCourse?id=${row.id}`); })
}, .catch(() => {
config(row) { });
this.$router.push(`/setTheoreticalCourse?id=${row.id}`); },
}, handleSelectionChange (val) {
addCourse() { this.multipleSelection = val;
this.$router.push("/addTheoreticalCourse"); },
}, delAllData () {
editCourse(row) { const list = this.multipleSelection
this.$router.push(`/addTheoreticalCourse?id=${row.id}`); if (list.length != "") {
}, this.$confirm(`确定要删除吗?`, "提示", {
handleDelete(row) { type: "warning"
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { })
type: "warning" .then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
}) })
.then(() => { this.$post(`${this.api.delTheoreticalCourse}?${data.join('&')}`).then(res => {
this.$post(`${this.api.delTheoreticalCourse}?ids=${row.id}`).then(res => { this.$refs.table.clearSelection();
util.successMsg("删除成功"); util.successMsg("删除成功");
this.initData(); this.initData();
}).catch(res => { }).catch(res => {
}); });
}) }).catch(() => {
.catch(() => { });
}); } else {
}, util.errorMsg("请先选择数据 !");
handleSelectionChange(val) { }
this.multipleSelection = val; },
}, handleCurrentChange (val) {
delAllData() { this.page = val;
const list = this.multipleSelection this.getData();
if (list.length != "") { },
this.$confirm(`确定要删除吗?`, "提示", { switchOff (val, row) {
type: "warning" this.$post(this.api.disabledTheoreticalCourse, {
}) courseId: row.id,
.then(() => { isOpen: val,
const data = [] type: 0 // (01)
list.map(e => { }).then(res => {
data.push('ids=' + e.id) val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
}) }).catch(err => { })
this.$post(`${this.api.delTheoreticalCourse}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.initData();
}).catch(res => {
});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
switchOff(val, row) {
this.$post(this.api.disabledTheoreticalCourse, {
courseId: row.id,
isOpen: val,
type: 0 // (01)
}).then(res => {
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
}).catch(err => {})
}
} }
}
}; };
</script> </script>

Loading…
Cancel
Save