模型、评论

Branch_d40a2540
yujialong 2 years ago
parent 743ff5e560
commit 44a321d6e1
  1. 14
      src/api/index.js
  2. BIN
      src/assets/img/love1.png
  3. BIN
      src/assets/img/love2.png
  4. 75
      src/pages/achievement/teach/index.vue
  5. 43
      src/pages/activity/list/index.vue
  6. 32
      src/pages/expSystem/backstage/compiler.vue
  7. 34
      src/pages/expSystem/backstage/index.vue
  8. 27
      src/pages/expSystem/backstage/model.vue
  9. 28
      src/pages/expSystem/backstage/modelType.vue
  10. 89
      src/pages/expSystem/backstage/sourceModel.vue
  11. 11
      src/pages/expSystem/backstage/sourceType.vue
  12. 2
      src/pages/expSystem/list/index.vue
  13. 76
      src/pages/match/manage/matchRank.vue
  14. 35
      src/pages/project/list/index.vue
  15. 481
      src/pages/station/preview/index.vue
  16. 559
      src/pages/system/list/role.vue
  17. 2
      src/setting.js
  18. 335
      src/styles/page/station.scss

@ -29,6 +29,7 @@ export default {
findLearningProgress: 'nakadai/nakadai/curriculum/learning/progressprogress/findById',
saveLearningProgress: 'nakadai/nakadai/curriculum/learning/progressprogress/save',
updateLearningProgress: 'nakadai/nakadai/curriculum/learning/progressprogress/update',
maximumPracticeScoreList: 'occupationlab/occupationlab/achievement/maximumPracticeScoreList',
// 课程笔记
addNote: `nakadai/curriculumNotes/addNote`,
curriculumNoteList: `nakadai/curriculumNotes/curriculumNoteList`,
@ -109,6 +110,9 @@ export default {
exportLabReport: `occupationlab/occupationlab/achievement/exportLabReport`,
exportBankExperimentReport: `occupationlab/occupationlab/achievement/exportBankExperimentReport`,
editExperimentalData: 'occupationlab/occupationlab/experimentalReport/editExperimentalData',
practiceActivity: 'occupationlab/occupationlab/achievement/practiceActivity',
exportAllActivity: `${host}occupationlab/occupationlab/achievement/exportAllData`,
exportActivity: `${host}occupationlab/occupationlab/achievement/exportDataInBatches`,
// 项目管理
getSystemIdBySchool: `occupationlab/occupationlab/projectManage/getSystemIdBySchool`, // 获取学校下拥有的系统
@ -124,6 +128,8 @@ export default {
updateProjectManage: `occupationlab/occupationlab/projectManage/updateProjectManage`, // 修改项目管理
editProjectDraft: `occupationlab/occupationlab/projectManage/editProjectDraft`, // 修改项目管理
copyProjectManage: `occupationlab/occupationlab/projectManage/copyProjectManage`, // 复制项目管理
schoolCreateProjectPromptsEnabled: `occupationlab/schoolProjectHintOpen/schoolCreateProjectPromptsEnabled`,
schoolProjectPromptsEnabled: `occupationlab/schoolProjectHintOpen/schoolProjectPromptsEnabled`,
// 判分点
getBcJudgmentPoint: `judgment/judgment/bcJudgmentPoint/getTeacherJudgmentPoint`, // 获取编程类判分点列表(分页)
@ -370,6 +376,8 @@ export default {
findActivityAnnouncement: `occupationlab/occupationlab/activity/announcement/queryAnnouncementDetails`,
delActivityAnnouncementAnnex: `occupationlab/occupationlab/activity/announcement/annex/delete`,
saveActivityAnnouncementAnnex: `occupationlab/occupationlab/activity/announcement/annex/save`,
collectionActivity: `occupationlab/occupationlab/activity/collectionActivity`,
concernedActivity: `occupationlab/occupationlab/activity/concernedActivity`,
// 数据看板
curriculumListForBeforeLogin: `nakadai/nakadai/curriculum/curriculumListForBeforeLogin`,
@ -440,6 +448,12 @@ export default {
builtInClassificationByNakadai: `nakadai/nakadai/model/reference/builtInClassificationByNakadai`,
disableModelDemo: `nakadai/nakadai/model/demo/disabledEvents`,
synchronizationMdelByOccupationlab: `nakadai/nakadai/model/reference/demo/synchronizationMdelByOccupationlab`,
controlPasteCode: `nakadai/nakadai/model/demo/controlPasteCode`,
whetherCanPaste: `nakadai/nakadai/model/demo/whetherCanPaste`,
builtInModelButtonDisplayByTeacher: `nakadai/nakadai/model/demo/builtInModelButtonDisplayByTeacher`,
displayListOrNotByTeacher: `nakadai/nakadai/model/demo/displayListOrNotByTeacher`,
builtInModelStateByTeacher: `nakadai/nakadai/model/demo/builtInModelStateByTeacher`,
modelRedis: `nakadai/nakadai/model/demo/getRedisCache`,
// 教师评语
addComment: `evaluation/cevaluation/comment/addComment`,

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

@ -87,6 +87,7 @@
</div>
<template v-if="curTab == 0">
<el-table :data="listData"
:key="1"
class="table"
ref="table"
stripe
@ -166,6 +167,7 @@
</template>
<template v-else>
<el-table :data="activations"
:key="2"
ref="table"
stripe
header-align="center"
@ -196,19 +198,19 @@
label="学号"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="score"
<el-table-column prop="practiceNum"
label="练习次数"
min-width="90"
align="center"></el-table-column>
<el-table-column prop="score"
<el-table-column prop="avgScore"
label="实验平均分"
min-width="90"
align="center"></el-table-column>
<el-table-column prop="score"
<el-table-column prop="highestScore"
label="实验最高分"
min-width="90"
align="center"></el-table-column>
<el-table-column prop="score"
<el-table-column prop="lowestMark"
label="实验最低分"
min-width="90"
align="center"></el-table-column>
@ -217,7 +219,7 @@
min-width="90"
align="center">
<template slot-scope="scope">
{{ scope.row.timeSum }}min
{{ scope.row.theLongestTime }}min
</template>
</el-table-column>
<el-table-column prop="timeSum"
@ -225,24 +227,14 @@
min-width="90"
align="center">
<template slot-scope="scope">
{{ scope.row.timeSum }}min
{{ scope.row.shortestTime }}min
</template>
</el-table-column>
<el-table-column prop="submitTime"
label="提交时间"
<el-table-column prop="lastSubmissionTime"
label="最近提交时间"
min-width="150"
align="center">
</el-table-column>
<el-table-column label="操作"
align="center"
width="160">
<template slot-scope="scope">
<el-button type="text"
@click="show(scope.row)">查看成绩报告</el-button>
<el-button type="text"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
@ -340,7 +332,7 @@ export default {
},
// tab
tabChange () {
this.curTab == 1 && this.getActivity()
},
//
async getData () {
@ -361,6 +353,13 @@ export default {
this.getChart()
this.errorChart()
},
//
async getActivity () {
//
const { message } = await this.$post(`${this.api.practiceActivity}?pageNum=${this.pageActivation}&pageSize=${this.pageSizeActivation}&projectId=${this.id}`)
this.activations = message.records
this.total = message.total
},
initData () {
this.$refs.table.clearSelection();
this.page = 1;
@ -466,24 +465,28 @@ export default {
},
// ()
exportDataActivation () {
//
let url = this.permissions
? `${this.api.exportAssessmentInfo}?assessmentId=${this.id}&classId=${this.classId}`
: `${this.api.exportPracticeInfo}?projectId=${this.id}`
// id
if (this.multipleSelection.length) {
const ids = this.multipleSelection.map(e => e.reportId)
url += `&ids=${ids.toString()}`
async exportDataActivation () {
const list = this.multipleSelectionActivation
let res
if (list.length) {
list.forEach((e, i) => {
e.rownum = i + 1
})
res = await axios.post(this.api.exportActivity, list, {
headers: {
token: this.token
},
responseType: 'blob'
})
} else {
res = await axios.get(`${this.api.exportAllActivity}?projectId=${this.id}`, {
headers: {
token: this.token
},
responseType: 'blob'
})
}
axios.get(url, {
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`学生${this.permissions ? '考核' : '练习'}成绩.xls`, new Blob([res.data]))
}).catch(res => { })
util.downloadFileDirect(`活跃度.xls`, new Blob([res.data]))
},
getChart () { // 线
const data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

@ -63,6 +63,18 @@
<span class="val">{{ item.initiator }}</span>
</div>
</template>
<div class="m-t-20"
@click.stop="follow(item)">
<template v-if="item.collectionStatus">
<img class="m-r-5"
src="@/assets/img/love2.png"
alt="">
{{ item.collectorsNum }}人关注
</template>
<img v-else
src="@/assets/img/love1.png"
alt="">
</div>
</div>
</div>
</div>
@ -145,6 +157,10 @@ export default {
{
id: 0,
name: "已报名"
},
{
id: 1,
name: "已关注项目"
}
],
form: {
@ -193,22 +209,21 @@ export default {
methods: {
getList () {
this.clearTimer()
const { form } = this
const data = {
pageNum: this.page,
pageSize: this.pageSize,
platformSource: 1,
platformSource: 2,
keyWords: this.keyword,
...this.form
...form
}
this.$post(this.api.schoolActivities, data).then(({ data }) => {
if (form.whetherToSignUp) data.whetherToSignUp = ''
this.$post(this.api[form.whetherToSignUp ? 'concernedActivity' : 'schoolActivities'], data).then(({ data }) => {
const { records } = data
this.listData = records
this.totals = data.total
this.handleStatus()
// this.loadIns.close();
}).catch(res => {
// this.loadIns.close()
})
}).catch(res => { })
},
//
handleStatus () {
@ -266,10 +281,10 @@ export default {
getData () {
// this.loadIns = Loading.service()
this.getList()
// if (!Setting.isDev) {
clearInterval(this.redisTimer)
this.redisTimer = setInterval(this.getRedis, 1000)
// }
if (!Setting.isDev) {
clearInterval(this.redisTimer)
this.redisTimer = setInterval(this.getRedis, 1000)
}
},
initData () {
this.page = 1
@ -305,6 +320,12 @@ export default {
this.page = val;
this.getData();
},
//
follow ({ id, collectionStatus }) {
this.$post(`${this.api.collectionActivity}?activityId=${id}&state=${collectionStatus ? 0 : 1}`).then(res => {
this.getData()
}).catch(res => { })
},
//
signupSubmit () {

@ -7,12 +7,10 @@
<div class="line">
<span class="field">粘贴代码</span>
<div class="field">
<el-switch v-model="isOpen"
:active-text="isOpen ? '关闭' : '启用'"
:active-value="0"
:inactive-value="1"
<el-switch v-model="isShow"
:active-text="isShow ? '启用' : '关闭'"
style="margin: 0 10px 0 10px"
@change="switchOff(scope.row)"></el-switch>
@change="switchOff"></el-switch>
</div>
</div>
@ -23,19 +21,23 @@ export default {
data () {
return {
systemId: this.$route.query.systemId,
isOpen: 0
isShow: false
};
},
mounted () { },
mounted () {
this.getStatus()
},
methods: {
switchOff (row) {
// this.$get(`${this.api.updateIsOpen}?isOpen=${row.ccupationlabOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => {
// util.successMsg("");
// this.getData();
// }).catch(err => {
// console.log(err);
// });
//
getStatus () {
this.$post(`${this.api.whetherCanPaste}?systemId=${this.systemId}`).then(res => {
this.isShow = res.data == 'true' ? true : fale
}).catch(err => { })
},
switchOff () {
this.$post(`${this.api.controlPasteCode}?isShow=${this.isShow}&systemId=${this.systemId}`).then(res => {
this.getStatus()
}).catch(err => { })
},
}
};

@ -23,30 +23,47 @@
</template>
<script>
import { mapState } from 'vuex'
import Setting from '@/setting'
import model from "./model";
import sourceModel from "./sourceModel";
import compiler from "./compiler";
export default {
data () {
return {
systemId: this.$route.query.systemId,
active: this.$route.query.type || 'model',
tabs: {
model: "模型列表管理",
sourceModel: "源模型管理",
compiler: '编译器管理'
}
},
modelIsShow: false
};
},
computed: {
...mapState('auth', [
'btns'
])
},
components: {
model,
sourceModel,
compiler
},
created () { },
created () {
this.getModelStatus()
},
methods: {
initTabs () {
const { btns } = this
const tab1 = btns.includes('/expSystem/list:进入:模型列表管理')
const tab2 = btns.includes('/expSystem/list:进入:源模型管理')
const tab3 = btns.includes('/expSystem/list:进入:编译器管理')
tab1 || delete this.tabs.model
tab2 || delete this.tabs.sourceModel
tab3 || delete this.tabs.compiler
},
tabChange (index) {
this.active = index
this.$router.push({
@ -59,6 +76,17 @@ export default {
}
})
},
//
getModelStatus () {
this.$post(`${this.api.builtInModelStateByTeacher}?systemId=${this.systemId}`).then(res => {
if (res.message == 'false') {
this.$delete(this.tabs, 'model')
this.$delete(this.tabs, 'sourceModel')
this.active = 'compiler'
}
Setting.dynamicRoute && this.initTabs()
}).catch(res => { })
},
back () {
this.$router.push('list')
}

@ -18,10 +18,12 @@
</li>
</ul>
<div>
<el-button type="primary"
<el-button v-auth="'/expSystem/list:进入:模型列表管理:导入模型'"
type="primary"
round
@click="add">导入模型</el-button>
<el-button type="primary"
<el-button v-auth="'/expSystem/list:进入:模型列表管理:批量移除'"
type="primary"
round
@click="batchDel">批量移除</el-button>
</div>
@ -61,9 +63,11 @@
width="200"
align="center">
<template slot-scope="scope">
<el-button type="text"
<el-button v-auth="'/expSystem/list:进入:模型列表管理:查看'"
type="text"
@click="show(scope.row)">查看</el-button>
<el-button type="text"
<el-button v-auth="'/expSystem/list:进入:模型列表管理:移除'"
type="text"
@click="del(scope.row)">移除</el-button>
</template>
</el-table-column>
@ -106,6 +110,7 @@
</template>
<script>
import org from "./modelType"
import Setting from '@/setting'
export default {
data () {
return {
@ -172,10 +177,20 @@ export default {
getData () {
clearInterval(this.timer)
this.getList()
// this.timer = setInterval(this.getList, 1000)
if (!Setting.isDev) {
this.timer = setInterval(this.getRedis, 1000)
}
},
// redis
getRedis () {
this.$post(this.api.modelRedis).then(({ data }) => {
if (data) {
localStorage.getItem('modelAdmin') !== data && this.getList() // redis
localStorage.setItem('modelAdmin', data)
}
}).catch(res => { })
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},

@ -2,17 +2,18 @@
<div>
<div>
<div class="front-switch">
<el-switch v-model="modelIsShow"
:active-value="0"
:inactive-value="1"
<el-switch v-auth="'/expSystem/list:进入:模型列表管理:内置模型按钮前台展示'"
v-model="modelIsShow"
active-text="内置模型按钮前台展示"
@change="changeModelStatus"></el-switch>
</div>
<div class="flex-between m-b-20">
<el-button type="text"
<el-button v-auth="'/expSystem/list:进入:模型列表管理:同步原始模型列表'"
type="text"
icon="el-icon-refresh"
@click="syncModel">同步原始模型列表</el-button>
<el-button type="text"
<el-button v-auth="'/expSystem/list:进入:模型列表管理:新增分类'"
type="text"
@click="addType(0)">添加</el-button>
</div>
<org-tree v-if="orgList.length"
@ -28,15 +29,18 @@
slot-scope="{ node, data }">
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span>
<span>
<el-button type="text"
<el-button v-auth="'/expSystem/list:进入:模型列表管理:编辑分类'"
type="text"
icon="el-icon-edit-outline"
@click="editType(data)">
</el-button>
<el-button type="text"
<el-button v-auth="'/expSystem/list:进入:模型列表管理:新增分类'"
type="text"
icon="el-icon-circle-plus-outline"
@click="addType(node, data)">
</el-button>
<el-button type="text"
<el-button v-auth="'/expSystem/list:进入:模型列表管理:删除分类'"
type="text"
icon="el-icon-delete"
@click="delType(data)">
</el-button>
@ -122,13 +126,15 @@ export default {
},
//
getModelStatus () {
this.$post(`${this.api.checkIsShowBySystemId}?systemId=${this.systemId}`).then(res => {
this.modelIsShow = res.isShow // 0 1
this.$post(`${this.api.displayListOrNotByTeacher}?systemId=${this.systemId}`).then(res => {
this.modelIsShow = res.teacherButtonStatus == 'true' ? true : fale
}).catch(res => { })
},
//
changeModelStatus (val) {
this.$post(`${this.api.modifyIsShowState}?systemId=${this.systemId}&isShow=${val}`).then(res => { }).catch(res => { })
this.$post(`${this.api.builtInModelButtonDisplayByTeacher}?systemId=${this.systemId}&isShow=${val}`).then(res => {
this.getModelStatus()
}).catch(res => { })
},
getSingle () {
this.$router.push({

@ -2,7 +2,7 @@
<div class="wrap">
<div class="side">
<org ref="tree"
@initData="initData"
@initData="catetoryClick"
@getData="getData"></org>
</div>
@ -18,16 +18,20 @@
</li>
</ul>
<div v-if="!isSystem">
<el-button type="primary"
<el-button v-auth="'/expSystem/list:进入:源模型管理:新增模型'"
type="primary"
round
@click="add">新增模型</el-button>
<el-button type="primary"
<el-button v-auth="'/expSystem/list:进入:源模型管理:批量删除'"
type="primary"
round
@click="batchDel">批量删除</el-button>
<el-button type="primary"
<el-button v-auth="'/expSystem/list:进入:源模型管理:批量禁用'"
type="primary"
round
@click="batchOff(1)">批量禁用</el-button>
<el-button type="primary"
<el-button v-auth="'/expSystem/list:进入:源模型管理:批量开启'"
type="primary"
round
@click="batchOff(0)">批量开启</el-button>
</div>
@ -80,13 +84,17 @@
label="操作"
width="230">
<template slot-scope="scope">
<el-button type="text"
<el-button v-auth="'/expSystem/list:进入:源模型管理:查看'"
type="text"
@click="show(scope.row)">查看</el-button>
<el-button type="text"
<el-button v-auth="'/expSystem/list:进入:源模型管理:编辑'"
type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button type="text"
<el-button v-auth="'/expSystem/list:进入:源模型管理:删除'"
type="text"
@click="del(scope.row)">删除</el-button>
<el-switch v-if="scope.row.postStatus"
<el-switch v-auth="'/expSystem/list:进入:源模型管理:禁用'"
v-if="scope.row.postStatus"
v-model="scope.row.isOpen"
:active-value="0"
:inactive-value="1"
@ -108,6 +116,7 @@
</template>
<script>
import org from "./sourceType"
import Setting from '@/setting'
export default {
data () {
return {
@ -141,48 +150,58 @@ export default {
},
methods: {
//
async getList (school = 0) {
this.isSystem = school
const curNode = this.$refs.tree.$refs[school ? 'systemTree' : 'tree'].getCurrentNode() || {}//
async getList () {
const curNode = this.$refs.tree.$refs[this.isSystem ? 'systemTree' : 'tree'].getCurrentNode() || {}//
this.isTopLevel = !curNode.level
let res
const data = {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
systemId: this.systemId,
founder: 0
}
if (curNode.level) data.categoryId = curNode.id
//
if (school) {
if (this.isSystem) {
//
const data = {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
systemId: this.systemId,
founder: 0
}
if (curNode.level) data.categoryId = curNode.id
res = await this.$post(this.api[!curNode.level ? 'getAllModelList' : 'referenceDemoList'], data)
} else {
data.founder = 1
//
res = await this.$post(this.api.InstitutionSourceModel, {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id,
systemId: this.systemId,
founder: 1
res = await this.$post(this.api.InstitutionSourceModel, data)
// ztOpen=1)
res.data.records.forEach(e => {
if (e.ztOpen) e.isOpen = 1
})
}
this.listData = res.data.records
this.total = res.data.total
},
getData (school) {
getData () {
clearInterval(this.timer)
this.getList(school)
// this.timer = setInterval(() => {
// this.getList(school)
// }, 1000)
this.getList()
if (!Setting.isDev) {
this.timer = setInterval(this.getRedis, 1000)
}
},
// redis
getRedis () {
this.$post(this.api.modelRedis).then(({ data }) => {
if (data) {
localStorage.getItem('modelAdmin') !== data && this.getList() // redis
localStorage.setItem('modelAdmin', data)
}
}).catch(res => { })
},
//
catetoryClick (school) {
this.isSystem = school
this.initData()
},
initData (school) {
this.$refs.table.clearSelection()
this.page = 1
this.getData(school)
this.getData()
},
//
add () {

@ -12,16 +12,19 @@
slot-scope="{ node, data }">
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span>
<span>
<el-button v-if="node.level > 1"
<el-button v-auth="'/expSystem/list:进入:源模型管理:编辑分类'"
v-if="node.level > 1"
type="text"
icon="el-icon-edit-outline"
@click="editType(data)">
</el-button>
<el-button type="text"
<el-button v-auth="'/expSystem/list:进入:源模型管理:新增分类'"
type="text"
icon="el-icon-circle-plus-outline"
@click="addType(node, data)">
</el-button>
<el-button v-if="node.level > 1"
<el-button v-auth="'/expSystem/list:进入:源模型管理:删除分类'"
v-if="node.level > 1"
type="text"
icon="el-icon-delete"
@click="delType(data)">
@ -98,7 +101,7 @@ export default {
const { data } = await this.$post(this.api.sourceModelClassification + '?founder=1')
this.orgList = data
data.length && this.$nextTick(() => {
const categoryId = this.$route.query.categoryId
const { categoryId } = this.$route.query
this.$refs.tree.setCurrentKey(categoryId || data[0].id)
this.$router.push({
path: 'backstage',

@ -58,7 +58,7 @@
<el-button type="text"
@click="toBackstage(scope.row)"
v-if="scope.row.systemId !== '11'"
v-auth="'/configure:系统后台进入'">进入</el-button>
v-auth>进入</el-button>
</template>
</el-table-column>
</el-table>

@ -36,16 +36,14 @@
@click="batchImport">上传文件</el-button>
</div>
<div>
<!-- <el-button v-if="(type && uploadData.length) || (!type && !published) || (!type && sourceType == 1)" type="primary" @click="cancelPublish(1)">发布排名</el-button> -->
<el-button v-if="!published"
type="primary"
@click="cancelPublish(1)">发布排名</el-button>
<div v-else>
<span>{{ publishTime }}发布排名</span>
<el-button class="m-l-5"
type="primary"
@click="cancelPublish(0)">取消发布</el-button>
</div>
<div v-else>
<span style="margin-right: 10px">{{ publishTime }}发布排名</span>
<el-button type="primary"
@click="cancelPublish(0)">取消发布</el-button>
</div>
</div>
</div>
<el-table :data="list"
@ -299,6 +297,7 @@ export default {
sourceType: '',
publishVisible: false,
publishTime: '',
timeId: '',
pickerOptions: {
//
disabledDate (time) {
@ -321,35 +320,6 @@ export default {
methods: {
//
getData () {
//
// this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ whetherToPublish }) => {
// const ids = this.grades.map(e => e.stageId)
// ids.pop()
// // >(:(1,0))
// whetherToPublish && this.$post(`${this.api.queryPublicationSource}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
// this.sourceType = source
// this.type = source == 1 ? 1 : 0
// }).catch(res => {})
// this.published = whetherToPublish
// this.getRank(whetherToPublish)
// }).catch(res => {})
// this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => {
// const ids = this.grades.map(e => e.stageId)
// ids.pop()
// // >(:(1,0))
// whetherToPublish ?
// this.$post(`${this.api.selectTheLastSortStatus}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
// this.sourceType = source
// this.type = source == 1 ? 1 : 0
// this.getRank(whetherToPublish)
// }).catch(res => {}) :
// this.getRank()
// this.published = whetherToPublish
// }).catch(res => {})
this.$post(`${this.api.selectTheLastSortStatus}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
this.sourceType = source
this.type = source == 1 ? 1 : 0
@ -372,6 +342,7 @@ export default {
this.sourceType = message.total ? message.records[0].isRelease : 0
this.list = message.records
this.total = message.total
this.getPublishTime()
}).catch(res => { })
} else { //
if (!this.active) {
@ -388,12 +359,14 @@ export default {
this.published = publishStatus
this.list = page
this.total = total
this.getPublishTime()
}).catch(res => { })
} else { //
this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}&publicationType=${this.type}`).then(({ page, total, publishStatus }) => {
this.published = publishStatus
this.list = page
this.total = total
this.getPublishTime()
}).catch(res => { })
}
}
@ -412,7 +385,6 @@ export default {
stageId: 0,
stageName: '总分'
})
this.getPublishTime()
this.getData()
}).catch(res => { });
},
@ -593,12 +565,17 @@ export default {
},
//
async getPublishTime () {
const res = this.$post(this.api.getCompetitionStageRankingTime, {
const res = await this.$post(this.api.getCompetitionStageRankingTime, {
competitionId: this.id,
isOverallRanking: this.active ? 0 : 1,
publicationType: this.type,
stageId: this.active || this.stageId,
})
if (res.releaseTime) {
this.published = true
this.timeId = res.releaseTime.id
this.publishTime = res.releaseTime.releaseTime
}
},
//
async publishTimeSubmit () {
@ -610,10 +587,11 @@ export default {
releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime)
})
util.successMsg('发布成功')
this.getData()
this.publishVisible = false
},
//
cancelPublish (publish) {
async cancelPublish (publish) {
const ids = this.grades.map(e => e.stageId)
const stageIds = ids.splice(0, ids.length - 1)
const query = []
@ -623,24 +601,22 @@ export default {
//
//
if (publish) {
// this.type ?
// this.publish()
this.publishTime = new Date()
this.publishVisible = true
// this.$post(this.api.deleteLastPublication, {
// competitionId: this.id,
// isOverallRanking: this.active ? 0 : 1,
// stageIds: this.active ? [this.active] : stageIds
// }).then(res => {
// this.publish()
// }).catch(res => {})
} else {
this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`).then(res => {
try {
//
if (this.timeId) {
await this.$post(`${this.api.cancelCompetitionStageRankingTime}?releaseId=${this.timeId}`)
} else {
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`)
}
this.publishTime = ''
this.sourceType = ''
this.type = 0
this.getData()
util.successMsg('取消发布成功!')
}).catch(res => { })
} catch (error) { }
}
},
//

@ -137,6 +137,30 @@
{{ stateKeys[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="实验提示"
width="120"
align="center">
<template slot-scope="scope">
<template v-if="scope.row.state">
<!-- 老师 -->
<el-switch v-if="scope.row.founder"
v-model="scope.row.hintOpen"
:active-text="scope.row.hintOpen ? '关闭' : '启用'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 10px"
@change="switchOffTips(scope.row, scope.row.hintOpen)"></el-switch>
<!-- 系统 -->
<el-switch v-else
v-model="scope.row.hintOpenBySchool"
:active-text="scope.row.hintOpenBySchool ? '关闭' : '启用'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 10px"
@change="switchOffTips(scope.row, scope.row.hintOpenBySchool)"></el-switch>
</template>
</template>
</el-table-column>
<el-table-column label="操作"
width="300"
align="center">
@ -440,7 +464,16 @@ export default {
this.$message.info("已取消删除");
});
},
switchOff (row) { //
//
switchOffTips (row, val) {
//
this.$post(`${this.api[row.founder ? 'schoolCreateProjectPromptsEnabled' : 'schoolProjectPromptsEnabled']}?hintOpen=${val}&projectId=${row.projectId}`).then(res => {
util.successMsg("修改成功");
this.getData();
}).catch(err => { });
},
//
switchOff (row) {
this.$get(`${this.api.updateIsOpen}?isOpen=${row.ccupationlabOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => {
util.successMsg("更新启用状态成功");
this.getData();

@ -147,189 +147,225 @@
:class="{active: item.id == active}"
@click="tabChange(item)">{{ item.name }}</a>
</div>
<div class="tab-content">
<template v-if="active === 1">
<el-card shadow="hover"
class="m-t-20 m-b-20">
<div v-html="briefIntroduction"></div>
</el-card>
</template>
<template v-if="active === 2">
<div class="page">
<template v-if="showNoteAdd">
<el-form class="form"
ref="form"
label-width="120px"
center>
<el-form-item class="required"
label="笔记标题">
<el-input placeholder="请输入笔记标题"
v-model="noteForm.noteName"
maxlength="30"
style="width: 400px"></el-input>
</el-form-item>
<el-form-item class="required"
label="笔记内容">
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
v-model="noteForm.noteContent"
:init="editorConfig" />
</el-form-item>
</el-form>
<div class="text-right">
<el-button @click="showNoteAdd = false">取消</el-button>
<el-button type="primary"
@click="submitNote">保存</el-button>
</div>
</template>
<template v-else>
<div class="tool">
<ul class="filter">
<li>
<label>搜索</label>
<el-input placeholder="请输入标题"
v-model="noteKeyword"
clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary"
@click="addNote">新增笔记</el-button>
</div>
</div>
<el-timeline class="timeline">
<el-timeline-item placement="top"
v-for="(item, i) in notes"
:key="i">
<p class="sign">{{ item.createTime }}</p>
<div class="ver">
<div>
{{ item.noteName }}
<span class="action">
<i class="el-icon-edit-outline"
@click="editNote(item)"></i>
<i class="el-icon-delete"
@click="delNote(item)"></i>
</span>
</div>
</div>
<div class="des"
v-html="item.noteContent"></div>
</el-timeline-item>
</el-timeline>
</template>
</div>
</template>
<template v-if="active === 4">
<div class="page">
<quill ref="quill"
:border="true"
v-model="comment"
:height="150"
:toTop="false" />
<div class="m-t-10 text-right">
<el-button type="primary"
size="mini"
@click="submitComment(0)">提交</el-button>
<div class="flex">
<div class="tab-content">
<template v-if="active === 1">
<div class="page">
<div v-html="briefIntroduction"></div>
</div>
<ul class="msg">
<li v-for="(item, i) in comments"
:key="i"
:id="'comment' + item.commentId">
<div class="li-wrap">
<img :src="item.createUserAvatars"
alt=""
class="avatar">
<div class="texts">
<h6>
<span class="name">{{ item.createUsername }}</span>
发表于 {{ item.createTime }}
</h6>
<div class="des"
v-html="item.content"></div>
</div>
<div class="action">
<i class="icon el-icon-chat-dot-square"
@click="showReplay(item)"></i>
<i v-if="deleteIdentity || item.currentAccountId == item.createAccountId"
class="icon el-icon-delete"
@click="delComment(item)"></i>
<img v-if="item.isLike"
class="icon"
src="@/assets/img/like-up.png"
alt=""
@click="like(item)">
<img v-else
class="icon"
src="@/assets/img/like.png"
alt=""
@click="like(item)">
</div>
</template>
<template v-if="active === 2">
<div class="page">
<template v-if="showNoteAdd">
<el-form class="form"
ref="form"
label-width="120px"
center>
<el-form-item class="required"
label="笔记标题">
<el-input placeholder="请输入笔记标题"
v-model="noteForm.noteName"
maxlength="30"
style="width: 400px"></el-input>
</el-form-item>
<el-form-item class="required"
label="笔记内容">
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
v-model="noteForm.noteContent"
:init="editorConfig" />
</el-form-item>
</el-form>
<div class="text-right">
<el-button @click="showNoteAdd = false">取消</el-button>
<el-button type="primary"
@click="submitNote">保存</el-button>
</div>
<div class="reply"
v-if="item.showReply">
<quill :border="true"
v-model="item.replyContent"
:toTop="false"
:height="150" />
<div class="m-t-10 text-right">
</template>
<template v-else>
<div class="tool">
<ul class="filter">
<li>
<label>搜索</label>
<el-input placeholder="请输入标题"
v-model="noteKeyword"
clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary"
size="mini"
@click="submitComment(item)">提交</el-button>
@click="addNote">新增笔记</el-button>
</div>
</div>
<ul class="msg children"
v-if="item.showChildren">
<li v-for="(reply,i) in item.children"
:key="i"
:id="'comment' + reply.commentId">
<div class="li-wrap">
<img class="avatar"
:src="reply.createUserAvatars"
alt="">
<div class="texts">
<div class="name">{{reply.createUsername}}</div>
<div class="des"
v-html="reply.content"></div>
<div class="date">{{reply.createTime}}</div>
<el-timeline class="timeline">
<el-timeline-item placement="top"
v-for="(item, i) in notes"
:key="i">
<p class="sign">{{ item.createTime }}</p>
<div class="ver">
<div>
{{ item.noteName }}
<span class="action">
<i class="el-icon-edit-outline"
@click="editNote(item)"></i>
<i class="el-icon-delete"
@click="delNote(item)"></i>
</span>
</div>
<div class="action">
<i class="icon el-icon-chat-dot-square"
@click="showReplay(reply)"></i>
<i v-if="deleteIdentity || reply.currentAccountId == reply.createAccountId"
class="icon el-icon-delete"
@click="delComment(reply)"></i>
<img v-if="reply.isLike"
class="icon"
</div>
<div class="des"
v-html="item.noteContent"></div>
</el-timeline-item>
</el-timeline>
</template>
</div>
</template>
<template v-if="active === 4">
<div class="page">
<quill ref="quill"
:border="true"
v-model="comment"
:height="150"
:toTop="false" />
<div class="m-t-10 text-right">
<el-button type="primary"
size="mini"
@click="submitComment(0)">提交</el-button>
</div>
<ul class="msg">
<li v-for="(item, i) in comments"
:key="i"
:id="'comment' + item.commentId">
<div class="li-wrap">
<img :src="item.createUserAvatars"
alt=""
class="avatar">
<div class="texts">
<h6>
<span class="name">{{ item.createUsername }}</span>
发表于 {{ item.createTime }}
</h6>
<div class="m-t-8"
v-html="item.content"></div>
</div>
<div class="action">
<i class="icon el-icon-chat-dot-square"
@click="showReplay(item)"></i>
<i v-if="deleteIdentity || item.currentAccountId == item.createAccountId"
class="icon el-icon-delete"
@click="delComment(item)"></i>
<template v-if="item.isLike">
<img class="icon"
src="@/assets/img/like-up.png"
alt=""
@click="like(reply)">
<img v-else
class="icon"
src="@/assets/img/like.png"
alt=""
@click="like(reply)">
</div>
@click="like(item)">
{{ item.likeCount }}
</template>
<img v-else
class="icon"
src="@/assets/img/like.png"
alt=""
@click="like(item)">
</div>
<div class="reply"
v-if="reply.showReply">
<quill :border="true"
v-model="reply.replyContent"
:toTop="false"
:height="150" />
<div class="m-t-10 text-right">
<el-button type="primary"
size="mini"
@click="submitComment(item, reply)">提交</el-button>
</div>
</div>
<div class="reply"
v-if="item.showReply">
<quill :border="true"
v-model="item.replyContent"
:toTop="false"
:height="150" />
<div class="m-v-10 text-right">
<el-button type="primary"
size="mini"
@click="submitComment(item)">提交</el-button>
</div>
</li>
</ul>
<div v-if="item.getCommentReplyNum"
class="toggle"><span @click="item.showChildren = !item.showChildren">{{item.showChildren ? '收起所有回复' : `查看所有${item.getCommentReplyNum}条回复`}} <i class="el-icon-arrow-down"></i></span></div>
</li>
</ul>
</div>
<ul class="msg children"
v-if="item.showChildren">
<li v-for="(reply,i) in item.children"
:key="i"
:id="'comment' + reply.commentId">
<div class="li-wrap">
<img class="avatar"
:src="reply.createUserAvatars"
alt="">
<div class="texts">
<div class="name">{{reply.createUsername}}</div>
<div class="flex m-v-8">
<template v-if="reply.showReplyName">
回复
<span class="reply-name">@{{ reply.replyUsername }}</span>
</template>
<div v-html="reply.content"></div>
</div>
<div class="date">{{reply.createTime}}</div>
</div>
<div class="action">
<i class="icon el-icon-chat-dot-square"
@click="showReplay(reply)"></i>
<i v-if="deleteIdentity || reply.currentAccountId == reply.createAccountId"
class="icon el-icon-delete"
@click="delComment(reply)"></i>
<template v-if="reply.isLike">
<img class="icon"
src="@/assets/img/like-up.png"
alt=""
@click="like(reply)">
{{ reply.likeCount }}
</template>
<img v-else
class="icon"
src="@/assets/img/like.png"
alt=""
@click="like(reply)">
</div>
</div>
<div class="reply"
v-if="reply.showReply">
<quill :border="true"
v-model="reply.replyContent"
:toTop="false"
:height="150" />
<div class="p-b-10 m-t-10 text-right">
<el-button type="primary"
size="mini"
@click="submitComment(item, reply)">提交</el-button>
</div>
</div>
</li>
</ul>
<div v-if="item.children"
class="toggle"><span @click="item.showChildren = !item.showChildren">{{item.showChildren ? '收起所有回复' : `查看所有${item.children.length}条回复`}} <i class="el-icon-arrow-down"></i></span></div>
</li>
</ul>
</div>
</template>
</div>
<div class="rank">
<el-select style="width: 100%"
v-model="archProject"
placeholder="请选择"
@change="getMaximumScore">
<el-option v-for="(item, i) in progressList"
:key="i"
:label="item.projectName"
:value="item.projectId"></el-option>
</el-select>
<div v-if="maximumScores.length"
class="arches">
<div v-for="(item, i) in maximumScores"
:key="i"
class="line">
<div>
<img :src="item.userAvatars"
alt=""
class="avatar">
<span class="name">{{ item.userName }}</span>
</div>
<span class="point">{{ item.highestScore }}</span>
</div>
</div>
</template>
</div>
</div>
<el-dialog title="请选择项目"
@ -470,7 +506,9 @@ export default {
comments: [],
comment: '',
deleteIdentity: false,
archProject: ''
archProject: '',
curReplyId: '',
maximumScores: []
};
},
computed: {
@ -547,16 +585,27 @@ export default {
const section = this.section === undefined ? 0 : +this.section
const clist = this.chapterList[chapter]
if (this.chapterList.length && clist.subsectionList && clist.subsectionList.length && !this.commentId) {
this.preview(clist.subsectionList[section], clist.name, 1);
// this.preview(clist.subsectionList[section], clist.name, 1);
}
},
//
async getProgress () {
let res = await this.$post(`${this.api.courseLearningProgress}?courseId=${this.courseId}&systemId=${this.systemIds}`);
this.progressList = res.list
if (res.list.length) this.archProject = res.list[0].projectId
this.maximumScores.length || this.getMaximumScore()
this.plan = res.plan
this.schedule = +(res.schedule.replace('%', ''))
},
//
async getMaximumScore () {
let { message } = await this.$post(`${this.api.maximumPracticeScoreList}?projectId=${this.archProject}&pageNum=1&pageSize=1000`);
const list = message.records
list.forEach(e => {
if (!e.userAvatars) e.userAvatars = 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'
})
this.maximumScores = list
},
//
percentFormat (val) {
return this.plan
@ -623,25 +672,35 @@ export default {
const list = res.rootComments
this.handleComments(list)
this.comments = list
if (this.commentId) {
this.active = 4
this.$nextTick(async () => {
document.getElementById('comment' + this.commentId).scrollIntoView(false)
await this.$post(`${this.api.noticeRead}?isRead=1&notifyId=${this.notifyId}`)
})
}
this.$nextTick(async () => {
if (this.curReplyId) {
const el = document.querySelector('#comment' + this.curReplyId)
el && el.scrollIntoView(false)
}
if (this.commentId) {
this.active = 4
const el = document.getElementById('comment' + this.commentId)
el && el.scrollIntoView(false)
await this.$post(`${this.api.noticeRead}?isRead=1&notifyId=${this.notifyId}`) //
this.commentId = ''
}
})
}).catch(res => { })
},
//
handleComments (list, parent = {}) {
list.forEach(e => {
if (!e.createUserAvatars) e.createUserAvatars = 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'
e.getCommentReplyNum = e.children && e.children.length
e.showChildren = false
if (e.commentId == this.commentId) parent.showChildren = true
if (e.commentId == this.curReplyId) e.showChildren = true
e.showReply = false
e.replyContent = ''
e.children && this.handleComments(e.children, e)
if (e.children && e.children.length && parent.children) {
e.children.forEach(n => n.showReplyName = true)
parent.children.push(...e.children)
}
e.children && this.handleComments(e.children, parent.commentId ? parent : e)
})
},
//
@ -671,6 +730,7 @@ export default {
status: row ? 2 : 1
}).then(res => {
this.comment = ''
this.curReplyId = row ? row.commentId : ''
this.getComment()
}).catch(res => { })
},
@ -926,7 +986,7 @@ export default {
@import '../../../styles/page/station.scss';
$height: 700px;
.page {
margin: 12px 0;
border-radius: 0;
.intro {
font-size: 14px;
color: #333;
@ -1218,10 +1278,36 @@ $height: 700px;
margin: 0 auto;
}
}
.tabs {
margin-bottom: 10px;
}
.tab-content {
width: 80%;
}
.rank {
width: calc(20% - 12px);
padding: 20px;
margin-left: 12px;
background-color: #fff;
.arches {
margin-top: 20px;
}
.line {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.avatar {
width: 35px;
height: 35px;
margin-right: 10px;
}
.point {
font-weight: 600;
color: #9278ff;
}
}
/deep/.project-dia {
.el-dialog__body {
padding: 28px 32px;
@ -1263,29 +1349,4 @@ $height: 700px;
color: #333;
}
}
.rank {
width: 296px;
padding: 20px;
margin: 12px 0 0 12px;
background-color: #fff;
.arches {
margin-top: 20px;
}
.line {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.avatar {
width: 35px;
height: 35px;
margin-right: 10px;
}
.point {
font-weight: 600;
color: #007eff;
}
}
</style>

@ -1,271 +1,328 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button v-auth="'角色权限:新增角色'" type="info" round @click="addRole">新增角色</el-button>
<el-button v-auth="'角色权限:批量删除'" type="primary" round @click="delAllSelection">批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys">
<el-table-column type="selection" width="55" align="center" :selectable="practiceSelectable" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="roleName" label="角色名称" align="center" min-width="250" show-overflow-tooltip></el-table-column>
<el-table-column label="角色描述" min-width="400" align="center">
<template slot-scope="scope">
<el-input placeholder="该角色用于管理全部功能权限" v-model="scope.row.remark" disabled></el-input>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button v-auth="'角色权限:查看'" type="text" @click="showRole(scope.row)">查看</el-button>
<el-button v-auth="'角色权限:编辑'" v-if="scope.row.roleName !== '超级管理员'" type="text" @click="editRole(scope.row)">编辑</el-button>
<el-button v-auth="'角色权限:删除'" v-if="scope.row.roleName !== '超级管理员' && scope.row.roleName !== '管理员'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<el-input placeholder="请输入角色名称"
prefix-icon="el-icon-search"
v-model.trim="keyword"
clearable></el-input>
</li>
</ul>
<div>
<el-button v-auth="'角色权限:新增角色'"
type="info"
round
@click="addRole">新增角色</el-button>
<el-button v-auth="'角色权限:批量删除'"
type="primary"
round
@click="delAllSelection">批量删除</el-button>
</div>
</div>
<el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" width="30%" @close="closeRole" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="80px" :disabled="isDetail">
<el-form-item label="角色名称">
<el-input v-model="form.roleName" placeholder="请输入角色名称"></el-input>
</el-form-item>
<el-form-item label="角色描述">
<el-input v-model="form.remark" placeholder="请输入角色描述" type="textarea" rows="5"></el-input>
</el-form-item>
<el-form-item prop="role" label="角色权限">
<div style="max-height: 300px; overflow: auto">
<el-tree
ref="per"
:data="permissions"
show-checkbox
default-expand-all
node-key="id"
:default-expanded-keys="checkedIds"
:default-checked-keys="checkedIds"
:props="defaultProps">
</el-tree>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="roleVisible = false"> </el-button>
<el-button type="primary" @click="saveData"> </el-button>
</span>
</el-dialog>
<el-table :data="listData"
class="table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
:row-key="getRowKeys">
<el-table-column type="selection"
width="55"
align="center"
:selectable="practiceSelectable"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center"></el-table-column>
<el-table-column prop="roleName"
label="角色名称"
align="center"
min-width="250"
show-overflow-tooltip></el-table-column>
<el-table-column label="角色描述"
min-width="400"
align="center">
<template slot-scope="scope">
<el-input placeholder="该角色用于管理全部功能权限"
v-model="scope.row.remark"
disabled></el-input>
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="200">
<template slot-scope="scope">
<el-button v-auth="'角色权限:查看'"
type="text"
@click="showRole(scope.row)">查看</el-button>
<el-button v-auth="'角色权限:编辑'"
v-if="scope.row.roleName !== '超级管理员'"
type="text"
@click="editRole(scope.row)">编辑</el-button>
<el-button v-auth="'角色权限:删除'"
v-if="scope.row.roleName !== '超级管理员' && scope.row.roleName !== '管理员'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
@current-change="currentChange"
:current-page="page"
layout="total, prev, pager, next"
:total="total"></el-pagination>
</div>
<el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')"
:visible.sync="roleVisible"
width="30%"
@close="closeRole"
class="dialog"
:close-on-click-modal="false">
<el-form ref="form"
label-width="80px"
:disabled="isDetail">
<el-form-item label="角色名称">
<el-input v-model="form.roleName"
placeholder="请输入角色名称"></el-input>
</el-form-item>
<el-form-item label="角色描述">
<el-input v-model="form.remark"
placeholder="请输入角色描述"
type="textarea"
rows="5"></el-input>
</el-form-item>
<el-form-item prop="role"
label="角色权限">
<div style="max-height: 300px; overflow: auto">
<el-tree ref="per"
:data="permissions"
show-checkbox
default-expand-all
node-key="id"
:default-expanded-keys="checkedIds"
:default-checked-keys="checkedIds"
:props="defaultProps">
</el-tree>
</div>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer"
v-if="!isDetail">
<el-button @click="roleVisible = false"> </el-button>
<el-button type="primary"
@click="saveData"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import Setting from "@/setting";
export default {
data() {
return {
keyword: "",
searchTimer: null,
isDetail: false,
form: {
id: "",
roleName: "",
remark: ""
},
listData: [],
defaultProps: {
children: "children",
label: "name"
},
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
isAdd: true,
roleVisible: false,
permissions: [],
checkedIds: [],
roleNameReapeat: false //
};
data () {
return {
keyword: "",
searchTimer: null,
isDetail: false,
form: {
id: "",
roleName: "",
remark: ""
},
listData: [],
defaultProps: {
children: "children",
label: "name"
},
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
isAdd: true,
roleVisible: false,
permissions: [],
checkedIds: [],
roleNameReapeat: false //
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getData();
}, 500);
}
},
mounted () {
this.getData();
},
methods: {
getData () {
this.$get(`${this.api.roleList}?page=${this.page}&size=${this.pageSize}&name=${util.encodeStr(this.keyword)}&platformId=1&port=0`).then(res => {
this.listData = res.rolePage.records;
this.total = res.rolePage.total;
}).catch(res => { });
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getData();
}, 500);
}
currentChange (val) {
this.page = val;
this.getData();
},
mounted() {
this.getData();
handleDelete (row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.batchRemove}?roleIds=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => { });
}).catch(() => { });
},
methods: {
getData() {
this.$get(`${this.api.roleList}?page=${this.page}&size=${this.pageSize}&name=${util.encodeStr(this.keyword)}&platformId=1&port=0`).then(res => {
this.listData = res.rolePage.records;
this.total = res.rolePage.total;
}).catch(res => {});
},
currentChange(val) {
this.page = val;
getRowKeys (row) {
return row.id;
},
handleSelectionChange (val) {
this.multipleSelection = val;
},
delAllSelection () {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => {
return item.id;
});
this.$post(`${this.api.batchRemove}?roleIds=${ids.toString()}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
},
handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.batchRemove}?roleIds=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {});
}).catch(() => {});
},
getRowKeys(row) {
return row.id;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllSelection() {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => {
return item.id;
});
this.$post(`${this.api.batchRemove}?roleIds=${ids.toString()}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {});
if(this.multipleSelection.length === this.listData.length && this.page>1) {
this.handleCurrentChange(this.page - 1)
}
}).catch(() => {});
} else {
util.errorMsg("请先选择数据!");
}
},
practiceSelectable(row, index){
let boolean = true;
if(row.roleName == '超级管理员'){
boolean = false
}else{
boolean = true
}
return boolean;
},
closeRole() {
this.isDetail = false;
this.form = {
id: "",
roleName: "",
remark: ""
};
this.checkedIds = [];
this.permissions = [];
},
//
getPer(row) {
if (!this.permissions.length) {
this.$get(`${this.api.queryAllMenus}?platformId=${Setting.platformId}`).then(res => {
let data = res.children;
//
let yw = data.findIndex(n => n.name == "业务后台");
yw != -1 && data.splice(yw, 1);
try {
let system = data.findIndex(n => n.name == "系统设置");
}).catch(res => { });
if (this.multipleSelection.length === this.listData.length && this.page > 1) {
this.handleCurrentChange(this.page - 1)
}
}).catch(() => { });
} else {
util.errorMsg("请先选择数据!");
}
},
practiceSelectable (row, index) {
let boolean = true;
if (row.roleName == '超级管理员') {
boolean = false
} else {
boolean = true
}
return boolean;
},
closeRole () {
this.isDetail = false;
this.form = {
id: "",
roleName: "",
remark: ""
};
this.checkedIds = [];
this.permissions = [];
},
//
getPer (row) {
if (!this.permissions.length) {
this.$get(`${this.api.queryAllMenus}?platformId=${Setting.platformId}`).then(res => {
let data = res.children;
//
let yw = data.findIndex(n => n.name == "业务后台");
yw != -1 && data.splice(yw, 1);
try {
let system = data.findIndex(n => n.name == "系统设置");
if (system != -1) {
data[system].children[1].children.splice(4, 1);
data[system].children[1].children.splice(1, 1);
data[system].children[1].children.splice(0, 1);
}
} catch (error) {
}
this.permissions = data;
if (row) {
this.getDetail(row);
}
}).catch(res => {
});
}
},
addRole() {
this.isAdd = true;
this.getPer();
this.checkedIds = [];
this.permissions.length && this.$refs.per.setCheckedNodes([]);
this.roleVisible = true;
},
//
handleRolePer(data, permissions) {
let result = data;
if (permissions.length) {
permissions.map(e => {
if (result.includes(e.id) && e.children) {
// ,idid,,,
e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id), 1);
}
e.children && e.children.length && this.handleRolePer(data, e.children);
});
if (system != -1) {
data[system].children[1].children.splice(4, 1);
data[system].children[1].children.splice(1, 1);
data[system].children[1].children.splice(0, 1);
}
return result;
},
async getDetail(row) { //
let res = await this.$get(`${this.api.obtainDetails}?id=${row.id}`);
this.form = res.role;
this.form.id = row.id;
this.checkedIds = this.handleRolePer(res.permissionList, this.permissions);
this.$refs.per.setCheckedNodes(this.checkedIds);
},
showRole(row) {
this.isDetail = true;
this.isAdd = false;
this.getPer(row);
this.roleVisible = true;
},
editRole(row) {
this.isAdd = false;
this.getPer(row);
this.roleVisible = true;
},
async saveData() {
if (!this.form.roleName) return util.warningMsg("请填写角色名称");
if (!this.form.remark) return util.warningMsg("请填写角色描述");
if (!this.$refs.per.getCheckedKeys().length) return util.warningMsg("请选择角色权限");
// ,(),
let permissionId = [...this.$refs.per.getHalfCheckedKeys(), ...this.$refs.per.getCheckedKeys()];
let data = {
...this.form,
permissionId,
platformId:1,
};
if (this.form.id) {
this.$post(this.api.saveOrUpdate, data).then(res => {
util.successMsg("修改成功");
this.getData();
this.roleVisible = false;
}).catch(res => {});
} else {
this.$post(this.api.saveOrUpdate, data).then(res => {
util.successMsg("新增成功");
this.getData();
this.roleVisible = false;
}).catch(res => {});
}
}
} catch (error) {
}
this.permissions = data;
if (row) {
this.getDetail(row);
}
}).catch(res => {
});
}
},
addRole () {
this.isAdd = true;
this.getPer();
this.checkedIds = [];
this.permissions.length && this.$refs.per.setCheckedNodes([]);
this.roleVisible = true;
},
//
handleRolePer (data, permissions) {
let result = data;
if (permissions.length) {
permissions.map(e => {
if (result.includes(e.id) && e.children) {
// ,idid,,,
e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id), 1);
}
e.children && e.children.length && this.handleRolePer(data, e.children);
});
}
return result;
},
async getDetail (row) { //
let res = await this.$get(`${this.api.obtainDetails}?id=${row.id}`);
this.form = res.role;
this.form.id = row.id;
this.checkedIds = this.handleRolePer(res.permissionList, this.permissions);
this.$refs.per.setCheckedNodes(this.checkedIds);
},
showRole (row) {
this.isDetail = true;
this.isAdd = false;
this.getPer(row);
this.roleVisible = true;
},
editRole (row) {
this.isAdd = false;
this.getPer(row);
this.roleVisible = true;
},
async saveData () {
if (!this.form.roleName) return util.warningMsg("请填写角色名称");
if (!this.form.remark) return util.warningMsg("请填写角色描述");
if (!this.$refs.per.getCheckedKeys().length) return util.warningMsg("请选择角色权限");
// ,(),
let permissionId = [...this.$refs.per.getHalfCheckedKeys(), ...this.$refs.per.getCheckedKeys()];
let data = {
...this.form,
permissionId,
platformId: 1,
};
if (this.form.id) {
this.$post(this.api.saveOrUpdate, data).then(res => {
util.successMsg("修改成功");
this.getData();
this.roleVisible = false;
}).catch(res => { });
} else {
this.$post(this.api.saveOrUpdate, data).then(res => {
util.successMsg("新增成功");
this.getData();
this.roleVisible = false;
}).catch(res => { });
}
}
}
};
</script>
<style lang="scss" scoped>
</style>

@ -87,7 +87,7 @@ const Setting = {
// 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false,
// 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮)
dynamicRoute: false,
dynamicRoute: true,
// 文件上传
upload: {
apiURL: uploadURL,

@ -1,173 +1,174 @@
.msg{
li{
margin-bottom: 10px;
border-top: 1px solid #f1f1f1;
&:first-child{
border-top: 0;
}
.li-wrap{
position: relative;
display: flex;
justify-content: space-between;
padding: 16px 0;
.avatar{
width: 48px;
height: 48px;
border-radius: 50%;
}
.texts{
flex: 1;
margin-left: 24px;
.name{
color: rgba(0, 0, 0, 0.85);
font-size: 16px;
}
.des{
margin: 8px 0;
}
.date{
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
}
}
.action{
display: inline-flex;
align-items: center;
margin-top: 15px;
.icon{
margin: 0 5px;
color: $main-color;
font-size: 18px;
cursor: pointer;
&:hover{
opacity: .8;
}
&:first-child{
margin-right: 5px;
}
&.del{
color: rgba(0, 0, 0, 0.65);
border: 1px solid rgba(0, 0, 0, 0.15);
}
}
}
}
.reply{
margin-top: 20px;
}
}
&.children{
margin-left: 72px;
padding-left: 24px;
background-color: rgba(0, 0, 0, 0.02);
border-radius: 8px;
li{
border-top-color: rgba(0, 0, 0, 0.06);
}
}
.msg {
li {
margin-bottom: 10px;
border-top: 1px solid #f1f1f1;
&:first-child {
border-top: 0;
}
.li-wrap {
position: relative;
display: flex;
justify-content: space-between;
padding: 16px 0;
.avatar {
width: 48px;
height: 48px;
border-radius: 50%;
}
.texts {
flex: 1;
margin-left: 24px;
.name {
color: rgba(0, 0, 0, 0.85);
font-size: 16px;
}
.date {
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
}
}
.reply-name {
color: #9076ff;
}
.action {
display: inline-flex;
align-items: center;
margin: 15px 10px 0 0;
.icon {
margin: 0 5px;
color: $main-color;
font-size: 18px;
cursor: pointer;
&:hover {
opacity: 0.8;
}
&:first-child {
margin-right: 5px;
}
&.del {
color: rgba(0, 0, 0, 0.65);
border: 1px solid rgba(0, 0, 0, 0.15);
}
}
}
}
.reply {
margin-top: 20px;
}
}
&.children {
margin-left: 72px;
padding-left: 24px;
background-color: rgba(0, 0, 0, 0.02);
border-radius: 8px;
li {
border-top-color: rgba(0, 0, 0, 0.06);
}
}
}
.toggle{
margin: 16px 0;
text-align: center;
color: $main-color;
font-size: 14px;
span{
cursor: pointer;
}
.toggle {
margin: 16px 0;
text-align: center;
color: $main-color;
font-size: 14px;
span {
cursor: pointer;
}
}
/deep/.quill{
background-color: #fff;
/deep/.quill {
background-color: #fff;
}
/deep/.timeline {
padding-left: 9%;
overflow: hidden;
.el-timeline-item {
padding-bottom: 40px;
}
.el-timeline-item__node--normal {
top: 30px;
}
.el-timeline-item__wrapper {
top: 15px;
padding-left: 40px;
}
.el-timeline-item__tail {
height: 250%;
border-left-width: 1px;
}
.sign {
position: relative;
display: inline-block;
margin-left: -12.5%;
font-size: 14px;
color: #9076FF;
}
.draft {
.ver, .sign {
color: #b1b1b1;
}
}
.ver {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 10px;
margin: -22px 0 20px;
font-size: 18px;
color: #9076FF;
border-bottom: 1px dashed #bfbfbf;
}
.withdraw {
margin-right: 10px;
font-size: 13px;
color: #979797;
}
.action {
margin-left: 15px;
i {
margin-left: 8px;
font-size: 14px;
color: #9076FF;
cursor: pointer;
&:hover {
opacity: .9;
}
}
}
.detail {
li {
margin-bottom: 20px;
}
.name {
display: flex;
align-items: center;
margin-bottom: 5px;
font-size: 15px;
font-weight: 600;
img {
width: 20px;
margin-right: 5px;
}
}
.val {
font-size: 14px;
line-height: 1.8;
white-space: pre-wrap;
p {
position: relative;
color: #6a6a6a;
&:before {
content: '';
display: inline-block;
width: 5px;
height: 5px;
margin: 0 10px 0 5px;
vertical-align: middle;
border-radius: 20px;
background-color: #c5b8ff;
padding-left: 9%;
overflow: hidden;
.el-timeline-item {
padding-bottom: 40px;
}
.el-timeline-item__node--normal {
top: 30px;
}
.el-timeline-item__wrapper {
top: 15px;
padding-left: 40px;
}
.el-timeline-item__tail {
height: 250%;
border-left-width: 1px;
}
.sign {
position: relative;
display: inline-block;
margin-left: -12.5%;
font-size: 14px;
color: #9076ff;
}
.draft {
.ver,
.sign {
color: #b1b1b1;
}
}
.ver {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 10px;
margin: -22px 0 20px;
font-size: 18px;
color: #9076ff;
border-bottom: 1px dashed #bfbfbf;
}
.withdraw {
margin-right: 10px;
font-size: 13px;
color: #979797;
}
.action {
margin-left: 15px;
i {
margin-left: 8px;
font-size: 14px;
color: #9076ff;
cursor: pointer;
&:hover {
opacity: 0.9;
}
}
}
.detail {
li {
margin-bottom: 20px;
}
.name {
display: flex;
align-items: center;
margin-bottom: 5px;
font-size: 15px;
font-weight: 600;
img {
width: 20px;
margin-right: 5px;
}
}
}
}
}
}
.val {
font-size: 14px;
line-height: 1.8;
white-space: pre-wrap;
p {
position: relative;
color: #6a6a6a;
&:before {
content: '';
display: inline-block;
width: 5px;
height: 5px;
margin: 0 10px 0 5px;
vertical-align: middle;
border-radius: 20px;
background-color: #c5b8ff;
}
}
}
}
}

Loading…
Cancel
Save