教学互动、消息通知等

Branch_d40a2540
yujialong 2 years ago
parent a56305d8a1
commit 690554178d
  1. 38
      src/api/index.js
  2. BIN
      src/assets/img/like-up.png
  3. BIN
      src/assets/img/like.png
  4. 281
      src/layouts/header/index.vue
  5. 3
      src/pages/achievement/teach/index.vue
  6. 14
      src/pages/expSystem/backstage/addModel.vue
  7. 580
      src/pages/expSystem/backstage/model.vue
  8. 4
      src/pages/expSystem/backstage/modelType.vue
  9. 48
      src/pages/expSystem/backstage/sourceModel.vue
  10. 13
      src/pages/expSystem/backstage/sourceType.vue
  11. 2
      src/pages/product/show/index.vue
  12. 203
      src/pages/station/preview/index.vue
  13. 2
      src/setting.js

@ -35,6 +35,15 @@ export default {
deleteNotes: `nakadai/curriculumNotes/deleteNotes`, deleteNotes: `nakadai/curriculumNotes/deleteNotes`,
updateNote: `nakadai/curriculumNotes/updateNote`, updateNote: `nakadai/curriculumNotes/updateNote`,
// 教学互动
addCommentStation: `nakadai/comment/addComment`,
commentTreeList: `nakadai/comment/commentTreeList`,
deleteAComment: `nakadai/comment/deleteAComment`,
commentAndLike: `nakadai/commentLike/commentAndLike`,
unlike: `nakadai/commentLike/unlike`,
messageNotificationList: `nakadai/notify/messageNotificationList`,
noticeRead: `nakadai/notify/noticeRead`,
// 权限管理 // 权限管理
getUserRolesPermissionMenu: `users/users/user-role/getUserRolesPermissionMenu`, getUserRolesPermissionMenu: `users/users/user-role/getUserRolesPermissionMenu`,
@ -395,9 +404,36 @@ export default {
referenceFindById: `nakadai/nakadai/model/reference/demo/findById`, referenceFindById: `nakadai/nakadai/model/reference/demo/findById`,
modelFindById: `nakadai/nakadai/model/demo/findById`, modelFindById: `nakadai/nakadai/model/demo/findById`,
queryTheModelOfOurSchool: `nakadai/nakadai/model/reference/demo/queryTheModelOfOurSchool`, queryTheModelOfOurSchool: `nakadai/nakadai/model/reference/demo/queryTheModelOfOurSchool`,
sourceModelClassification: `nakadai/nakadai/model/category/sourceModelClassification`,
getAllModelListBySys: `nakadai/nakadai/model/demo/getAllModelListBySys`, getAllModelListBySys: `nakadai/nakadai/model/demo/getAllModelListBySys`,
runPythonCode: `nakadai/nakadai/model/demo/runPythonCode`, runPythonCode: `nakadai/nakadai/model/demo/runPythonCode`,
saveSysModelDemo: `nakadai/nakadai/model/demo/saveSysModelDemo`,
updateSysModelDemo: `nakadai/nakadai/model/demo/updateSysModelDemo`,
deleteSourceModelCategory: `nakadai/nakadai/model/category/deleteSourceModelCategory`,
categorySave: `nakadai/nakadai/model/category/save`,
sourceModelClassification: `nakadai/nakadai/model/category/sourceModelClassification`,
updateSourceModelCategory: `nakadai/nakadai/model/category/updateSourceModelCategory`,
builtInModelClassification: `nakadai/nakadai/model/category/builtInModelClassification`,
InstitutionSourceModel: `nakadai/nakadai/model/demo/InstitutionSourceModel`,
bulkDisable: `nakadai/nakadai/model/demo/bulkDisable`,
deleteSysModelDemo: `nakadai/nakadai/model/demo/deleteSysModelDemo`,
sysModelDemoList: `nakadai/nakadai/model/demo/sysModelDemoList`,
deleteModelClass: `nakadai/nakadai/model/reference/deleteModelClass`,
modelClassList: `nakadai/nakadai/model/reference/modelClassList`,
saveReferenceCategory: `nakadai/nakadai/model/reference/saveReferenceCategory`,
updateModelClass: `nakadai/nakadai/model/reference/updateModelClass`,
checkIsShowBySystemId: `nakadai/nakadai/model/reference/checkIsShowBySystemId`,
modifyIsShowState: `nakadai/nakadai/model/reference/modifyIsShowState`,
editProvinceCity: `nakadai/nakadai/partner-team/editProvinceCity`,
editPartnerTeamRates: `nakadai/nakadai/partner-team/editPartnerTeamRates`,
teamPartnerList: `nakadai/nakadai/partnerAccount/teamPartnerList`,
delModelInfoBySystemId: `nakadai/nakadai/model/reference/demo/delModelInfoBySystemId`,
deleteReferenceDemo: `nakadai/nakadai/model/reference/demo/deleteReferenceDemo`,
saveReferenceDemo: `nakadai/nakadai/model/reference/demo/saveReferenceDemo`,
referenceDemoList: `nakadai/nakadai/model/reference/demo/referenceDemoList`,
getAllModelList: `nakadai/nakadai/model/reference/demo/getAllModelList`,
synchronizationMdel: `nakadai/nakadai/model/reference/demo/synchronizationMdel`,
// 教师评语 // 教师评语
addComment: `evaluation/cevaluation/comment/addComment`, addComment: `evaluation/cevaluation/comment/addComment`,

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

After

Width:  |  Height:  |  Size: 475 B

@ -1,131 +1,178 @@
<template> <template>
<div class="header"> <div class="header">
<div style="line-height: 60px"> <div style="line-height: 60px">
<img class="logo" :src="logoUrl" /> <img class="logo"
<span class="title">{{ title }}</span> :src="logoUrl" />
</div> <span class="title">{{ title }}</span>
<div class="action"> </div>
<el-dropdown class="user-wrap" @command="userCommand"> <div class="action">
<div class="user">
<el-avatar :size="40" :src="avatar"></el-avatar> <el-popover placement="top"
<span class="m-l-10">{{ customerName || userName }}</span> :disabled="!notices.length">
</div> <p v-for="(item, i) in notices"
<el-dropdown-menu slot="dropdown"> :key="i"
<el-dropdown-item v-if="!customerName" command="person">个人中心</el-dropdown-item> class="p-v-5 cursor-pointer"
<el-dropdown-item v-else command="resetPw">修改密码</el-dropdown-item> @click="toComment(item)">{{ item.commentUsername }} 回复了你的评论</p>
</el-dropdown-menu> <el-badge class="msg"
</el-dropdown> :is-dot="notices.length"
<el-divider direction="vertical"></el-divider> slot="reference">消息</el-badge>
<el-button type="text" class="ml20" @click="logout">退出</el-button> </el-popover>
<el-dropdown class="user-wrap"
@command="userCommand">
<div class="user">
<el-avatar :size="40"
:src="avatar"></el-avatar>
<span class="m-l-10">{{ customerName || userName }}</span>
</div> </div>
<el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" :append-to-body="true" @close="resetPassword" width="30%"> <el-dropdown-menu slot="dropdown">
<el-form ref="passwordForm" label-width="82px"> <el-dropdown-item v-if="!customerName"
<el-form-item label="原密码"> command="person">个人中心</el-dropdown-item>
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input> <el-dropdown-item v-else
</el-form-item> command="resetPw">修改密码</el-dropdown-item>
<el-form-item label="新密码"> </el-dropdown-menu>
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码"></el-input> </el-dropdown>
</el-form-item> <el-divider direction="vertical"></el-divider>
<el-form-item label="确认新密码"> <el-button type="text"
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="submitPassword"></el-input> class="ml20"
</el-form-item> @click="logout">退出</el-button>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="passwordVisible = false"> </el-button>
<el-button type="primary" @click="submitPassword"> </el-button>
</span>
</el-dialog>
</div> </div>
<el-dialog title="修改密码"
:visible.sync="passwordVisible"
:close-on-click-modal="false"
:append-to-body="true"
@close="resetPassword"
width="30%">
<el-form ref="passwordForm"
label-width="82px">
<el-form-item label="原密码">
<el-input type="password"
v-model="passwordForm.password"
placeholder="请输入原密码"></el-input>
</el-form-item>
<el-form-item label="新密码">
<el-input type="password"
v-model="passwordForm.newPassword"
placeholder="请输入新密码"></el-input>
</el-form-item>
<el-form-item label="确认新密码">
<el-input type="password"
v-model="passwordForm.reNewPassword"
placeholder="请确认新密码"
@keyup.enter.native="submitPassword"></el-input>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<el-button @click="passwordVisible = false"> </el-button>
<el-button type="primary"
@click="submitPassword"> </el-button>
</span>
</el-dialog>
</div>
</template> </template>
<script> <script>
import { mapState, mapMutations, mapActions } from "vuex"; import { mapState, mapMutations, mapActions } from "vuex";
import util from "@/libs/util"; import util from "@/libs/util";
export default { export default {
data() { data () {
return { return {
passwordVisible: false, passwordVisible: false,
passwordForm: { passwordForm: {
password: "", password: "",
newPassword: "", newPassword: "",
reNewPassword: "" reNewPassword: ""
} },
}; notices: []
};
},
computed: {
...mapState("user", [
"avatar", "userName", "title", "logoUrl", "customer", "customerName", 'fromClient'
])
},
mounted () {
this.getSystemDetail();
this.getUserDetail();
this.getNotice()
},
methods: {
...mapMutations("user", [
'SET_SCHOOLID', 'setUserId'
]),
...mapActions("user", [
"setTitle", "setLogoUrl", "setAvatar", "setUserName", 'logout'
]),
getSystemDetail () { // logo
this.$get(this.api.logoDetail).then(res => {
const { data } = res
if (data) {
this.setTitle(data.title)
this.setLogoUrl(data.logoUrl)
this.SET_SCHOOLID(data.schoolId)
} else {
// schoolId
this.$post(this.api.getSchoolIdByToken).then(res => {
this.SET_SCHOOLID(res.schoolId)
}).catch(res => { })
}
}).catch(res => { })
}, },
computed: { //
...mapState("user", [ getNotice () {
"avatar", "userName", "title", "logoUrl", "customer", "customerName", 'fromClient' this.$get(this.api.messageNotificationList, {
]) type: 2
}).then(res => {
this.notices = res.notificationList
}).catch(res => { });
}, },
mounted() { //
this.getSystemDetail(); toComment (item) {
this.getUserDetail(); this.$router.push(`/station/preview?courseId=${item.cid}&commentId=${item.commentId}&notifyId=${item.notifyId}`)
}, },
methods: { getUserDetail () { //
...mapMutations("user", [ this.$get(this.api.queryUserInfoDetails).then(res => {
'SET_SCHOOLID', 'setUserId' let { hrUserInfo } = res.result
]), if (hrUserInfo) {
...mapActions("user", [ const { userAvatars, userName, userId } = hrUserInfo
"setTitle", "setLogoUrl", "setAvatar", "setUserName", 'logout' this.setUserId(userId)
]), userAvatars && this.setAvatar(userAvatars)
getSystemDetail() { // logo this.setUserName(userName)
this.$get(this.api.logoDetail).then(res => { } else {
const { data } = res this.$get(this.api.isClient).then(res => {
if (data) { res.customerName && this.setUserName(res.customerName)
this.setTitle(data.title) }).catch(res => { })
this.setLogoUrl(data.logoUrl)
this.SET_SCHOOLID(data.schoolId)
} else {
// schoolId
this.$post(this.api.getSchoolIdByToken).then(res => {
this.SET_SCHOOLID(res.schoolId)
}).catch(res => {})
}
}).catch(res => {})
},
getUserDetail() { //
this.$get(this.api.queryUserInfoDetails).then(res => {
let { hrUserInfo } = res.result
if (hrUserInfo) {
const { userAvatars, userName, userId } = hrUserInfo
this.setUserId(userId)
userAvatars && this.setAvatar(userAvatars)
this.setUserName(userName)
} else {
this.$get(this.api.isClient).then(res => {
res.customerName && this.setUserName(res.customerName)
}).catch(res => {})
}
}).catch(res => {})
},
userCommand(command) { //
if (command == "person") {
this.$router.push("/setting/person");
} else {
this.passwordVisible = true;
}
},
resetPassword() { //
this.passwordForm = {
password: "",
newPassword: "",
reNewPassword: ""
};
},
submitPassword() { //
if (!this.passwordForm.password) return util.warningMsg("请输入原密码");
if (!this.passwordForm.newPassword) return util.warningMsg("请输入新密码");
if (!this.passwordForm.reNewPassword) return util.warningMsg("请确认新密码");
if (this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return util.warningMsg("请输入6位数以上的密码");
if (this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return util.warningMsg("输入的新密码不一致,请重新确认");
if (this.passwordForm.password === this.passwordForm.newPassword) return util.warningMsg("原密码跟新密码不能一致");
this.$post(this.api.examinePassword, this.passwordForm).then(res => {
util.successMsg("修改成功");
this.passwordVisible = false;
}).catch(err => {
});
} }
}).catch(res => { })
},
userCommand (command) { //
if (command == "person") {
this.$router.push("/setting/person");
} else {
this.passwordVisible = true;
}
},
resetPassword () { //
this.passwordForm = {
password: "",
newPassword: "",
reNewPassword: ""
};
},
submitPassword () { //
if (!this.passwordForm.password) return util.warningMsg("请输入原密码");
if (!this.passwordForm.newPassword) return util.warningMsg("请输入新密码");
if (!this.passwordForm.reNewPassword) return util.warningMsg("请确认新密码");
if (this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return util.warningMsg("请输入6位数以上的密码");
if (this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return util.warningMsg("输入的新密码不一致,请重新确认");
if (this.passwordForm.password === this.passwordForm.newPassword) return util.warningMsg("原密码跟新密码不能一致");
this.$post(this.api.examinePassword, this.passwordForm).then(res => {
util.successMsg("修改成功");
this.passwordVisible = false;
}).catch(err => {
});
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -175,5 +222,11 @@ export default {
background-color: #333; background-color: #333;
} }
} }
.msg {
margin-right: 30px;
font-size: 12px;
cursor: pointer;
}
} }
</style> </style>

@ -397,7 +397,8 @@ export default {
}, },
// //
exportReport () { exportReport () {
this.listData.forEach(async e => { const list = this.multipleSelection.length ? this.multipleSelection : this.listData
list.forEach(async e => {
const { report, userScores } = await this.$get(`${this.api.reportDetail}?reportId=${e.reportId}`) const { report, userScores } = await this.$get(`${this.api.reportDetail}?reportId=${e.reportId}`)
const list = userScores const list = userScores
list.map((e, i) => { list.map((e, i) => {

@ -8,12 +8,10 @@
<div v-if="!isDetail"> <div v-if="!isDetail">
<el-button type="primary" <el-button type="primary"
round round
v-preventReClick
@click="submit(1)">发布</el-button> @click="submit(1)">发布</el-button>
<el-button v-if="!postStatus" <el-button v-if="!postStatus"
type="primary" type="primary"
round round
v-preventReClick
@click="submit(0)">草稿</el-button> @click="submit(0)">草稿</el-button>
</div> </div>
</div> </div>
@ -116,8 +114,9 @@ export default {
}, },
// //
getType () { getType () {
this.$post(this.api.sourceModelClassification).then(res => { this.$post(this.api.sourceModelClassification, {
const { data } = res founder: 1
}).then(({ data }) => {
// children // children
const handleLeaf = list => { const handleLeaf = list => {
list.map(e => { list.map(e => {
@ -129,7 +128,7 @@ export default {
}) })
} }
handleLeaf(data) handleLeaf(data)
this.categoryList = data[0].children this.categoryList = data
if (this.id) { if (this.id) {
this.getData() this.getData()
} else { } else {
@ -154,7 +153,8 @@ export default {
modelName, modelName,
modelDemo, modelDemo,
postStatus, postStatus,
systemId: this.systemId systemId: this.systemId,
founder: 1
} }
if (id) { if (id) {
data.id = id data.id = id
@ -165,7 +165,7 @@ export default {
this.submiting = false this.submiting = false
}) })
} else { } else {
this.$post(this.api.saveAcademyModelDemo, data).then(res => { this.$post(this.api.saveSysModelDemo, data).then(res => {
this.$message.success('新增成功') this.$message.success('新增成功')
fromBack || this.$router.back() fromBack || this.$router.back()
}).catch(res => { }).catch(res => {

@ -1,281 +1,327 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="side"> <div class="side">
<org ref="tree" @initData="initData" @getData="getData"></org> <org ref="tree"
</div> @initData="initData"
@getData="getData"></org>
<div class="right"> </div>
<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 type="primary" round @click="add">导入模型</el-button>
<el-button type="primary" round @click="batchDel">批量移除</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> <div class="right">
<el-table-column type="selection" width="55" align="center"></el-table-column> <h6 class="p-title">筛选</h6>
<el-table-column type="index" label="序号" width="55" align="center"></el-table-column> <div class="tool">
<el-table-column prop="modelName" label="模型名称" align="center"></el-table-column> <ul class="filter">
<el-table-column v-if="isTopLevel" prop="categoryName" label="分类" width="150" align="center"></el-table-column> <li>
<el-table-column prop="createTime" label="导入时间" align="center"></el-table-column> <el-input placeholder="请输入模型名称"
<el-table-column label="状态" align="center"> prefix-icon="el-icon-search"
<template slot-scope="scope"> v-model.trim="keyword"
{{ scope.row.isOpen ? '禁用' : '启用' }} clearable></el-input>
</template> </li>
</el-table-column> </ul>
<el-table-column label="操作" width="200" align="center"> <div>
<template slot-scope="scope"> <el-button type="primary"
<el-button type="text" @click="show(scope.row)">查看</el-button> round
<el-button type="text" @click="del(scope.row)">移除</el-button> @click="add">导入模型</el-button>
</template> <el-button type="primary"
</el-table-column> round
</el-table> @click="batchDel">批量移除</el-button>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination>
</div>
</div> </div>
</div>
<el-dialog title="请选择需要导入的模型" :visible.sync="modelVisible" width="500px" class="dialog" :close-on-click-modal="false"> <el-table :data="listData"
<div class="model-wrap"> class="table"
<el-tree ref="table"
v-if="modelData.length" stripe
:data="modelData" v-loading="modelLoading" header-align="center"
ref="model" @selection-change="handleSelectionChange">
default-expand-all <el-table-column type="selection"
show-checkbox width="55"
node-key="id" align="center"></el-table-column>
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}"> <el-table-column type="index"
</el-tree> label="序号"
<div class="none" v-else>暂无可导入的模型</div> width="55"
</div> align="center"></el-table-column>
<span slot="footer" class="dialog-footer"> <el-table-column prop="modelName"
<el-button @click="modelVisible = false"> </el-button> label="模型名称"
<el-button type="primary" @click="submit"> </el-button> align="center"></el-table-column>
</span> <el-table-column v-if="isTopLevel"
</el-dialog> prop="categoryName"
label="分类"
width="150"
align="center"></el-table-column>
<el-table-column prop="createTime"
label="导入时间"
align="center"></el-table-column>
<el-table-column label="状态"
align="center">
<template slot-scope="scope">
{{ scope.row.isOpen ? '禁用' : '启用' }}
</template>
</el-table-column>
<el-table-column label="操作"
width="200"
align="center">
<template slot-scope="scope">
<el-button type="text"
@click="show(scope.row)">查看</el-button>
<el-button type="text"
@click="del(scope.row)">移除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:current-page="page"
@current-change="handleCurrentChange"
:total="total"></el-pagination>
</div>
</div> </div>
<el-dialog title="请选择需要导入的模型"
:visible.sync="modelVisible"
width="500px"
class="dialog"
:close-on-click-modal="false">
<div class="model-wrap">
<el-tree v-if="modelData.length"
:data="modelData"
v-loading="modelLoading"
ref="model"
default-expand-all
show-checkbox
node-key="id"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
</el-tree>
<div class="none"
v-else>暂无可导入的模型</div>
</div>
<span slot="footer"
class="dialog-footer">
<el-button @click="modelVisible = false"> </el-button>
<el-button type="primary"
@click="submit"> </el-button>
</span>
</el-dialog>
</div>
</template> </template>
<script> <script>
import org from "./modelType" import org from "./modelType"
export default { export default {
data() { data () {
return { return {
systemId: this.$route.query.systemId, systemId: this.$route.query.systemId,
isTopLevel: true, // isTopLevel: true, //
listData: [], listData: [],
keyword: '', keyword: '',
page: +this.$route.query.page || 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
modelVisible: false, modelVisible: false,
modelLoading: false, modelLoading: false,
modelData: [], modelData: [],
submiting: false submiting: false
}; };
}, },
components: { components: {
org org
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted () { },
methods: {
getData () {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
this.isTopLevel = !curNode.level && curNode.categoryName === '全部'
//
if (this.isTopLevel) {
this.$post(this.api.getAllModelList, {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
systemId: this.systemId
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
}).catch(res => { })
} else {
this.$post(this.api.referenceDemoList, {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id,
founder: 1
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
}).catch(res => { })
}
}, },
watch: { initData () {
keyword: function(val) { this.$refs.table.clearSelection()
clearTimeout(this.searchTimer); this.page = 1
this.searchTimer = setTimeout(() => { this.getData()
this.initData()
}, 500)
}
}, },
mounted() {}, //
methods: { add () {
getData() { if (!this.$refs.tree.orgList.length) return this.$message.error('请先添加模型分类')
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() // if (this.isTopLevel) return this.$message.error('请选择子分类进入导入模型')
this.isTopLevel = !curNode.level && curNode.categoryName === '全部' this.modelVisible = true
// this.modelLoading = true
if (this.isTopLevel) { //
this.$post(this.api.getAllModelList, { this.$post(this.api.getAllModelList, {
modelName: this.keyword, pageNum: 1,
pageNum: this.page, pageSize: 10000,
pageSize: this.pageSize, systemId: this.systemId
systemId: this.systemId }).then(res => {
}).then(res => { const modelList = res.data.records
this.listData = res.data.records
this.total = res.data.total
}).catch(res => {})
} else {
this.$post(this.api.referenceDemoList, {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
}).catch(res => {})
}
},
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
add() {
if (!this.$refs.tree.orgList.length) return this.$message.error('请先添加模型分类')
if (this.isTopLevel) return this.$message.error('请选择子分类进入导入模型')
this.modelVisible = true
this.modelLoading = true
//
this.$post(this.api.getAllModelList, {
pageNum: 1,
pageSize: 10000,
systemId: this.systemId
}).then(res => {
const modelList = res.data.records
// //
this.$post(this.api.sourceModelClassification).then(res => { this.$post(this.api.sourceModelClassification, {
let { data } = res founder: 1
const promises = [] }).then(res => {
const addType = list => { let { data } = res
list.map((e, i) => { const promises = []
// promise const addType = list => {
promises.push(new Promise((resolve,reject) => { list.map((e, i) => {
// // promise
this.$post(this.api.sysModelDemoList, { promises.push(new Promise((resolve, reject) => {
pageNum: 1, //
pageSize: 10000, this.$post(this.api.sysModelDemoList, {
categoryId: e.id pageNum: 1,
}).then(res => { pageSize: 10000,
const { records } = res.data categoryId: e.id
const modelChildren = [] }).then(res => {
// copyIdid const { records } = res.data
records.map(n => { const modelChildren = []
if (!modelList.find(e => e.copyId === n.id)) { // copyIdid
n.categoryName = n.modelName records.map(n => {
modelChildren.push(n) if (!modelList.find(e => e.copyId === n.id)) {
} n.categoryName = n.modelName
}) modelChildren.push(n)
// disabled
if (modelChildren.length) {
e.children = [...e.children, ...modelChildren]
} else if (records.length) {
e.disabled = true
}
resolve()
}).catch(res => {
reject()
})
}))
e.children && e.children.length && addType(e.children)
})
}
addType(data)
// disabledtrue
const handleType = list => {
return list.filter((e, i) => {
return !e.disabled
}).map(e => {
if (e.children) {
e.children = handleType(e.children)
}
return e
})
} }
Promise.all(promises).then(_ => { })
data = handleType(data) // disabled
this.modelData = (data.length && data[0].children && data[0].children.length) ? data : [] if (modelChildren.length) {
this.modelLoading = false e.children = [...e.children, ...modelChildren]
}).catch(res => {}) } else if (records.length) {
}).catch(res => {}) e.disabled = true
}).catch(res => {}) }
}, resolve()
// }).catch(res => {
reject()
// })
show(row) { }))
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1&model=1`) e.children && e.children.length && addType(e.children)
}, })
// }
del(row) { addType(data)
this.$confirm("确定要删除吗?", "提示", { // disabledtrue
type: "warning" const handleType = list => {
}).then(() => { return list.filter((e, i) => {
this.$post(this.api.deleteReferenceDemo, [row.id]).then(res => { return !e.disabled
this.$message.success("删除成功") }).map(e => {
this.getData() if (e.children) {
}).catch(res => {}) e.children = handleType(e.children)
}).catch(() => {})
},
handleSelectionChange(val) {
this.multipleSelection = val
},
//
batchDel() {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(e => e.id)
this.$post(this.api.deleteReferenceDemo, ids).then(res => {
this.$refs.table.clearSelection()
this.$message.success("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
} else {
this.$message.error("请先选择模型 !")
}
},
handleCurrentChange(val) {
this.page = val
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
page: val
} }
return e
}) })
}
Promise.all(promises).then(_ => {
data = handleType(data)
this.modelData = (data.length && data[0].children && data[0].children.length) ? data : []
this.modelLoading = false
}).catch(res => { })
}).catch(res => { })
}).catch(res => { })
},
//
//
show (row) {
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1&model=1`)
},
//
del (row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteReferenceDemo, [row.id]).then(res => {
this.$message.success("删除成功")
this.getData()
}).catch(res => { })
}).catch(() => { })
},
handleSelectionChange (val) {
this.multipleSelection = val
},
//
batchDel () {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(e => e.id)
this.$post(this.api.deleteReferenceDemo, ids).then(res => {
this.$refs.table.clearSelection()
this.$message.success("删除成功")
this.getData() this.getData()
}, }).catch(res => { })
// }).catch(() => { })
submit() { } else {
if (this.submiting) return false this.$message.error("请先选择模型 !")
const data = [] }
const systemId = this.systemId },
if (this.$refs.model) { handleCurrentChange (val) {
const list = this.$refs.model.getCheckedNodes() // this.page = val
const categoryId = this.$refs.tree.$refs.tree.getCurrentKey() // this.$router.push({
if (!list.length) return this.$message.error('请选择模型') path: 'backstage',
this.submiting = true query: {
list.map(e => { ...this.$route.query,
// categoryId page: val
e.categoryId && data.push({
systemId,
categoryId,
copyId: e.id
})
})
this.$post(this.api.saveReferenceDemo, data).then(res => {
this.modelVisible = false
this.initData()
setTimeout(() => {
this.submiting = false
}, 2000)
}).catch(res => {
this.submiting = false
})
} else {
this.submiting = false
this.modelVisible = false
}
} }
})
this.getData()
},
//
submit () {
if (this.submiting) return false
const data = []
const systemId = this.systemId
if (this.$refs.model) {
const list = this.$refs.model.getCheckedNodes() //
const categoryId = this.$refs.tree.$refs.tree.getCurrentKey() //
if (!list.length) return this.$message.error('请选择模型')
this.submiting = true
list.map(e => {
// categoryId
e.categoryId && data.push({
systemId,
categoryId,
copyId: e.id
})
})
this.$post(this.api.saveReferenceDemo, data).then(res => {
this.modelVisible = false
this.initData()
setTimeout(() => {
this.submiting = false
}, 2000)
}).catch(res => {
this.submiting = false
})
} else {
this.submiting = false
this.modelVisible = false
}
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -294,15 +340,15 @@ export default {
padding: 24px; padding: 24px;
} }
} }
.el-input__inner{ .el-input__inner {
height: 32px; height: 32px;
} }
.model-wrap { .model-wrap {
max-height: 400px; max-height: 400px;
overflow: auto; overflow: auto;
.none { .none {
text-align: center; text-align: center;
color: #8b8b8b; color: #8b8b8b;
} }
} }
</style> </style>

@ -169,7 +169,9 @@ export default {
// //
async addData (id) { async addData (id) {
// //
this.$post(this.api.sourceModelClassification).then(res => { this.$post(this.api.sourceModelClassification, {
founder: 1
}).then(res => {
const { data } = res const { data } = res
const systemId = this.systemId const systemId = this.systemId
const promises = [] const promises = []

@ -133,27 +133,29 @@ export default {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() // const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
this.isTopLevel = !curNode.level this.isTopLevel = !curNode.level
// //
if (!curNode.level) { // if (!curNode.level) {
this.$post(this.api.getAllModelListBySys, { // this.$post(this.api.getAllModelListBySys, {
modelName: this.keyword, // modelName: this.keyword,
pageNum: this.page, // pageNum: this.page,
pageSize: this.pageSize // pageSize: this.pageSize,
}).then(res => { // founder: 1
this.listData = res.data.records // }).then(res => {
this.total = res.data.total // this.listData = res.data.records
}).catch(res => { }) // this.total = res.data.total
} else { // }).catch(res => { })
this.$post(this.api.queryTheModelOfOurSchool, { // } else {
modelName: this.keyword, this.$post(this.api.InstitutionSourceModel, {
pageNum: this.page, modelName: this.keyword,
pageSize: this.pageSize, pageNum: this.page,
categoryId: curNode.id, pageSize: this.pageSize,
systemId: this.systemId categoryId: curNode.id,
}).then(res => { systemId: this.systemId,
this.listData = res.data.records founder: 1
this.total = res.data.total }).then(res => {
}).catch(res => { }) this.listData = res.data.records
} this.total = res.data.total
}).catch(res => { })
// }
}, },
initData () { initData () {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
@ -201,11 +203,11 @@ export default {
}, },
// //
show (row) { show (row) {
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1`) this.$router.push(`addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1`)
}, },
// //
edit (row) { edit (row) {
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&postStatus=${row.postStatus}`) this.$router.push(`addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&postStatus=${row.postStatus}`)
}, },
del (row) { del (row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {

@ -1,6 +1,12 @@
<template> <template>
<div> <div>
<div> <div>
<!-- <div class="text-right">
<el-button type="text"
icon="el-icon-circle-plus-outline"
@click="addType(0)">
</el-button>
</div> -->
<org-tree :data="orgList" <org-tree :data="orgList"
default-expand-all default-expand-all
ref="tree" ref="tree"
@ -85,7 +91,9 @@ export default {
}, },
methods: { methods: {
getType () { getType () {
this.$post(`${this.api.schoolModelClassification}?systemId=${this.systemId}&type=1`).then(res => { this.$post(this.api.sourceModelClassification, {
founder: 1
}).then(res => {
const { data } = res const { data } = res
this.orgList = data this.orgList = data
data.length && this.$nextTick(() => { data.length && this.$nextTick(() => {
@ -134,7 +142,8 @@ export default {
id: form.id, id: form.id,
parentId: form.parentId, parentId: form.parentId,
categoryName: form.categoryName, categoryName: form.categoryName,
systemId: this.systemId systemId: this.systemId,
founder: 1
} }
if (data.id) { if (data.id) {
this.$post(this.api.updateSourceModelCategory, data).then(res => { this.$post(this.api.updateSourceModelCategory, data).then(res => {

@ -3,7 +3,7 @@
<el-card shadow="hover" <el-card shadow="hover"
class="m-b-20"> class="m-b-20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="$router.back()" <el-page-header @back="$router.push('list')"
:content="form.mall.productName"></el-page-header> :content="form.mall.productName"></el-page-header>
</div> </div>
</el-card> </el-card>

@ -4,7 +4,7 @@
class="m-b-20"> class="m-b-20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="goBack" <el-page-header @back="goBack"
:content="curriculumName"></el-page-header> :content="courseName"></el-page-header>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" <el-card shadow="hover"
@ -223,30 +223,46 @@
<div class="page"> <div class="page">
<quill ref="quill" <quill ref="quill"
:border="true" :border="true"
v-model="msg" v-model="comment"
:height="150" :height="150"
:toTop="false" /> :toTop="false" />
<div class="m-t-10 text-right">
<el-button type="primary"
size="mini"
@click="submitComment(0)">提交</el-button>
</div>
<ul class="msg"> <ul class="msg">
<li v-for="(item, i) in msgs" <li v-for="(item, i) in comments"
:key="i"> :key="i"
:id="'comment' + item.commentId">
<div class="li-wrap"> <div class="li-wrap">
<img :src="item.avatar" <img :src="item.createUserAvatars"
alt="" alt=""
class="avatar"> class="avatar">
<div class="texts"> <div class="texts">
<h6> <h6>
<span class="name">{{ item.userName }}</span> <span class="name">{{ item.createUsername }}</span>
发表于 {{ item.createDate }} 发表于 {{ item.createTime }}
</h6> </h6>
<div class="des" <div class="des"
v-html="item.content"></div> v-html="item.content"></div>
</div> </div>
<div class="action"> <div class="action">
<i class="icon el-icon-chat-dot-square"></i> <i class="icon el-icon-chat-dot-square"
<i class="icon el-icon-delete"></i> @click="showReplay(item)"></i>
<img class="icon" <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" src="@/assets/img/like.png"
alt=""> alt=""
@click="like(item)">
</div> </div>
</div> </div>
<div class="reply" <div class="reply"
@ -257,29 +273,41 @@
:height="150" /> :height="150" />
<div class="m-t-10 text-right"> <div class="m-t-10 text-right">
<el-button type="primary" <el-button type="primary"
size="mini">提交</el-button> size="mini"
@click="submitComment(item)">提交</el-button>
</div> </div>
</div> </div>
<ul class="msg children" <ul class="msg children"
v-if="item.showChildren"> v-if="item.showChildren">
<li v-for="(reply,i) in item.children" <li v-for="(reply,i) in item.children"
:key="i"> :key="i"
:id="'comment' + reply.commentId">
<div class="li-wrap"> <div class="li-wrap">
<img class="avatar" <img class="avatar"
:src="reply.avatar" :src="reply.createUserAvatars"
alt=""> alt="">
<div class="texts"> <div class="texts">
<div class="name">{{reply.userName}}</div> <div class="name">{{reply.createUsername}}</div>
<div class="des" <div class="des"
v-html="reply.content"></div> v-html="reply.content"></div>
<div class="date">{{reply.createDate}}</div> <div class="date">{{reply.createTime}}</div>
</div> </div>
<div class="action"> <div class="action">
<i class="icon el-icon-chat-dot-square"></i> <i class="icon el-icon-chat-dot-square"
<i class="icon el-icon-delete"></i> @click="showReplay(reply)"></i>
<img class="icon" <i v-if="deleteIdentity || reply.currentAccountId == reply.createAccountId"
class="icon el-icon-delete"
@click="delComment(reply)"></i>
<img v-if="reply.isLike"
class="icon"
src="@/assets/img/like-up.png"
alt=""
@click="like(reply)">
<img v-else
class="icon"
src="@/assets/img/like.png" src="@/assets/img/like.png"
alt=""> alt=""
@click="like(reply)">
</div> </div>
</div> </div>
<div class="reply" <div class="reply"
@ -290,7 +318,8 @@
:height="150" /> :height="150" />
<div class="m-t-10 text-right"> <div class="m-t-10 text-right">
<el-button type="primary" <el-button type="primary"
size="mini">提交</el-button> size="mini"
@click="submitComment(item, reply)">提交</el-button>
</div> </div>
</div> </div>
</li> </li>
@ -366,6 +395,8 @@ export default {
courseId: this.$route.query.courseId, courseId: this.$route.query.courseId,
mallId: this.$route.query.mallId || '', mallId: this.$route.query.mallId || '',
curriculumName: this.$route.query.curriculumName, curriculumName: this.$route.query.curriculumName,
commentId: this.$route.query.commentId, //
notifyId: this.$route.query.notifyId,
chapter: this.$route.query.chapter, chapter: this.$route.query.chapter,
section: this.$route.query.section, section: this.$route.query.section,
fromAdmin: this.$route.query.admin, // or fromAdmin: this.$route.query.admin, // or
@ -415,10 +446,10 @@ export default {
id: 2, id: 2,
name: '课程笔记' name: '课程笔记'
}, },
{ // {
id: 3, // id: 3,
name: '全国排行榜' // name: ''
}, // },
{ {
id: 4, id: 4,
name: '教学互动' name: '教学互动'
@ -436,27 +467,10 @@ export default {
noteContent: '', noteContent: '',
noteName: '', noteName: '',
}, },
msg: '', comments: [],
msgs: [ comment: '',
{ deleteIdentity: false,
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', archProject: ''
createDate: '2023-04-28 12:41:10',
userName: '刘恒',
content: '基础、个人、增值',
showReply: false,
getCommentReplyNum: 1,
showChildren: false,
children: [
{
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
createDate: '2023-04-29 09:22:13',
userName: '公瑾',
content: '基础、个人、增值',
showReply: false,
}
]
}
]
}; };
}, },
computed: { computed: {
@ -477,6 +491,7 @@ export default {
this.getData(); this.getData();
this.addRecord() this.addRecord()
this.getNote() this.getNote()
this.getComment()
}, },
methods: { methods: {
goBack () { goBack () {
@ -517,7 +532,7 @@ export default {
const chapter = this.chapter === undefined ? 0 : +this.chapter const chapter = this.chapter === undefined ? 0 : +this.chapter
const section = this.section === undefined ? 0 : +this.section const section = this.section === undefined ? 0 : +this.section
const clist = this.chapterList[chapter] const clist = this.chapterList[chapter]
if (this.chapterList.length && clist.subsectionList && clist.subsectionList.length) { 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);
} }
}, },
@ -583,6 +598,75 @@ export default {
this.noteForm = JSON.parse(JSON.stringify(row)) this.noteForm = JSON.parse(JSON.stringify(row))
this.showNoteAdd = true this.showNoteAdd = true
}, },
//
getComment () {
this.$get(this.api.commentTreeList, {
cid: this.courseId,
}).then(res => {
this.deleteIdentity = res.deleteIdentity
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}`)
})
}
}).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
e.showReply = false
e.replyContent = ''
e.children && this.handleComments(e.children, e)
})
},
//
showReplay (row) {
row.showReply = !row.showReply
},
//
delComment (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteAComment}?commentId=${row.commentId}`).then(res => {
util.successMsg("删除成功");
this.getComment();
}).catch(res => { })
}).catch(() => { })
},
//
submitComment (row, reply) {
const content = reply ? reply.replyContent : row ? row.replyContent : this.comment
if (!content) return util.errorMsg('请输入内容!')
this.$post(this.api.addCommentStation, {
cid: this.courseId,
content,
pid: row ? row.commentId : 0,
replyAccountId: row.createAccountId || '',
status: reply ? 2 : 1
}).then(res => {
this.comment = ''
this.getComment()
}).catch(res => { })
},
//
like (row) {
this.$post(`${this.api[row.isLike ? 'unlike' : 'commentAndLike']}?commentId=${row.commentId}`).then(res => {
row.isLike = row.isLike ? 0 : 1
}).catch(res => { })
},
// //
insertScript () { insertScript () {
const linkTag = document.createElement("link"); const linkTag = document.createElement("link");
@ -1165,4 +1249,29 @@ $height: 700px;
color: #333; 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> </style>

@ -27,7 +27,7 @@ if (isPro) {
host = "http://121.37.12.51/"; // 中台测试服 host = "http://121.37.12.51/"; // 中台测试服
// host = 'https://www.occupationlab.com/' // 正式服 // host = 'https://www.occupationlab.com/' // 正式服
host = "http://192.168.31.152:9000/"; // 榕 host = "http://192.168.31.152:9000/"; // 榕
// host = 'http://192.168.31.52:9000/'; // 赓 // host = 'http://192.168.31.53:9000/'; // 赓
} }
const Setting = { const Setting = {

Loading…
Cancel
Save