教学互动、消息通知等

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`,
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`,
@ -395,9 +404,36 @@ export default {
referenceFindById: `nakadai/nakadai/model/reference/demo/findById`,
modelFindById: `nakadai/nakadai/model/demo/findById`,
queryTheModelOfOurSchool: `nakadai/nakadai/model/reference/demo/queryTheModelOfOurSchool`,
sourceModelClassification: `nakadai/nakadai/model/category/sourceModelClassification`,
getAllModelListBySys: `nakadai/nakadai/model/demo/getAllModelListBySys`,
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`,

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>
<div class="header">
<div style="line-height: 60px">
<img class="logo" :src="logoUrl" />
<span class="title">{{ title }}</span>
</div>
<div class="action">
<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>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="!customerName" command="person">个人中心</el-dropdown-item>
<el-dropdown-item v-else command="resetPw">修改密码</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-divider direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="logout">退出</el-button>
<div class="header">
<div style="line-height: 60px">
<img class="logo"
:src="logoUrl" />
<span class="title">{{ title }}</span>
</div>
<div class="action">
<el-popover placement="top"
:disabled="!notices.length">
<p v-for="(item, i) in notices"
:key="i"
class="p-v-5 cursor-pointer"
@click="toComment(item)">{{ item.commentUsername }} 回复了你的评论</p>
<el-badge class="msg"
:is-dot="notices.length"
slot="reference">消息</el-badge>
</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>
<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>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="!customerName"
command="person">个人中心</el-dropdown-item>
<el-dropdown-item v-else
command="resetPw">修改密码</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-divider direction="vertical"></el-divider>
<el-button type="text"
class="ml20"
@click="logout">退出</el-button>
</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>
<script>
import { mapState, mapMutations, mapActions } from "vuex";
import util from "@/libs/util";
export default {
data() {
return {
passwordVisible: false,
passwordForm: {
password: "",
newPassword: "",
reNewPassword: ""
}
};
data () {
return {
passwordVisible: false,
passwordForm: {
password: "",
newPassword: "",
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", [
"avatar", "userName", "title", "logoUrl", "customer", "customerName", 'fromClient'
])
//
getNotice () {
this.$get(this.api.messageNotificationList, {
type: 2
}).then(res => {
this.notices = res.notificationList
}).catch(res => { });
},
mounted() {
this.getSystemDetail();
this.getUserDetail();
//
toComment (item) {
this.$router.push(`/station/preview?courseId=${item.cid}&commentId=${item.commentId}&notifyId=${item.notifyId}`)
},
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 => {})
},
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 => {
});
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 => {
});
}
}
};
</script>
<style lang="scss" scoped>
@ -175,5 +222,11 @@ export default {
background-color: #333;
}
}
.msg {
margin-right: 30px;
font-size: 12px;
cursor: pointer;
}
}
</style>

@ -397,7 +397,8 @@ export default {
},
//
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 list = userScores
list.map((e, i) => {

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

@ -1,281 +1,327 @@
<template>
<div class="wrap">
<div class="side">
<org ref="tree" @initData="initData" @getData="getData"></org>
</div>
<div class="right">
<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>
<div class="wrap">
<div class="side">
<org ref="tree"
@initData="initData"
@getData="getData"></org>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" label="序号" width="55" align="center"></el-table-column>
<el-table-column prop="modelName" label="模型名称" align="center"></el-table-column>
<el-table-column v-if="isTopLevel" 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 class="right">
<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-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>
<el-table :data="listData"
class="table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55"
align="center"></el-table-column>
<el-table-column type="index"
label="序号"
width="55"
align="center"></el-table-column>
<el-table-column prop="modelName"
label="模型名称"
align="center"></el-table-column>
<el-table-column v-if="isTopLevel"
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>
<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>
<script>
import org from "./modelType"
export default {
data() {
return {
systemId: this.$route.query.systemId,
isTopLevel: true, //
listData: [],
keyword: '',
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
multipleSelection: [],
modelVisible: false,
modelLoading: false,
modelData: [],
submiting: false
};
},
components: {
org
data () {
return {
systemId: this.$route.query.systemId,
isTopLevel: true, //
listData: [],
keyword: '',
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
multipleSelection: [],
modelVisible: false,
modelLoading: false,
modelData: [],
submiting: false
};
},
components: {
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: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
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
}).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
//
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 => {
let { data } = res
const promises = []
const addType = list => {
list.map((e, i) => {
// promise
promises.push(new Promise((resolve,reject) => {
//
this.$post(this.api.sysModelDemoList, {
pageNum: 1,
pageSize: 10000,
categoryId: e.id
}).then(res => {
const { records } = res.data
const modelChildren = []
// copyIdid
records.map(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
})
//
this.$post(this.api.sourceModelClassification, {
founder: 1
}).then(res => {
let { data } = res
const promises = []
const addType = list => {
list.map((e, i) => {
// promise
promises.push(new Promise((resolve, reject) => {
//
this.$post(this.api.sysModelDemoList, {
pageNum: 1,
pageSize: 10000,
categoryId: e.id
}).then(res => {
const { records } = res.data
const modelChildren = []
// copyIdid
records.map(n => {
if (!modelList.find(e => e.copyId === n.id)) {
n.categoryName = n.modelName
modelChildren.push(n)
}
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()
}).catch(res => {})
}).catch(() => {})
} else {
this.$message.error("请先选择模型 !")
}
},
handleCurrentChange(val) {
this.page = val
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
page: val
})
// 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)
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()
},
//
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
}
}).catch(res => { })
}).catch(() => { })
} else {
this.$message.error("请先选择模型 !")
}
},
handleCurrentChange (val) {
this.page = val
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
page: val
}
})
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>
<style lang="scss" scoped>
@ -294,15 +340,15 @@ export default {
padding: 24px;
}
}
.el-input__inner{
.el-input__inner {
height: 32px;
}
.model-wrap {
max-height: 400px;
overflow: auto;
.none {
text-align: center;
color: #8b8b8b;
}
max-height: 400px;
overflow: auto;
.none {
text-align: center;
color: #8b8b8b;
}
}
</style>

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

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

@ -1,6 +1,12 @@
<template>
<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"
default-expand-all
ref="tree"
@ -85,7 +91,9 @@ export default {
},
methods: {
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
this.orgList = data
data.length && this.$nextTick(() => {
@ -134,7 +142,8 @@ export default {
id: form.id,
parentId: form.parentId,
categoryName: form.categoryName,
systemId: this.systemId
systemId: this.systemId,
founder: 1
}
if (data.id) {
this.$post(this.api.updateSourceModelCategory, data).then(res => {

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

@ -4,7 +4,7 @@
class="m-b-20">
<div class="flex-between">
<el-page-header @back="goBack"
:content="curriculumName"></el-page-header>
:content="courseName"></el-page-header>
</div>
</el-card>
<el-card shadow="hover"
@ -223,30 +223,46 @@
<div class="page">
<quill ref="quill"
:border="true"
v-model="msg"
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 msgs"
:key="i">
<li v-for="(item, i) in comments"
:key="i"
:id="'comment' + item.commentId">
<div class="li-wrap">
<img :src="item.avatar"
<img :src="item.createUserAvatars"
alt=""
class="avatar">
<div class="texts">
<h6>
<span class="name">{{ item.userName }}</span>
发表于 {{ item.createDate }}
<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"></i>
<i class="icon el-icon-delete"></i>
<img class="icon"
<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="">
alt=""
@click="like(item)">
</div>
</div>
<div class="reply"
@ -257,29 +273,41 @@
:height="150" />
<div class="m-t-10 text-right">
<el-button type="primary"
size="mini">提交</el-button>
size="mini"
@click="submitComment(item)">提交</el-button>
</div>
</div>
<ul class="msg children"
v-if="item.showChildren">
<li v-for="(reply,i) in item.children"
:key="i">
:key="i"
:id="'comment' + reply.commentId">
<div class="li-wrap">
<img class="avatar"
:src="reply.avatar"
:src="reply.createUserAvatars"
alt="">
<div class="texts">
<div class="name">{{reply.userName}}</div>
<div class="name">{{reply.createUsername}}</div>
<div class="des"
v-html="reply.content"></div>
<div class="date">{{reply.createDate}}</div>
<div class="date">{{reply.createTime}}</div>
</div>
<div class="action">
<i class="icon el-icon-chat-dot-square"></i>
<i class="icon el-icon-delete"></i>
<img class="icon"
<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"
src="@/assets/img/like-up.png"
alt=""
@click="like(reply)">
<img v-else
class="icon"
src="@/assets/img/like.png"
alt="">
alt=""
@click="like(reply)">
</div>
</div>
<div class="reply"
@ -290,7 +318,8 @@
:height="150" />
<div class="m-t-10 text-right">
<el-button type="primary"
size="mini">提交</el-button>
size="mini"
@click="submitComment(item, reply)">提交</el-button>
</div>
</div>
</li>
@ -366,6 +395,8 @@ export default {
courseId: this.$route.query.courseId,
mallId: this.$route.query.mallId || '',
curriculumName: this.$route.query.curriculumName,
commentId: this.$route.query.commentId, //
notifyId: this.$route.query.notifyId,
chapter: this.$route.query.chapter,
section: this.$route.query.section,
fromAdmin: this.$route.query.admin, // or
@ -415,10 +446,10 @@ export default {
id: 2,
name: '课程笔记'
},
{
id: 3,
name: '全国排行榜'
},
// {
// id: 3,
// name: ''
// },
{
id: 4,
name: '教学互动'
@ -436,27 +467,10 @@ export default {
noteContent: '',
noteName: '',
},
msg: '',
msgs: [
{
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
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,
}
]
}
]
comments: [],
comment: '',
deleteIdentity: false,
archProject: ''
};
},
computed: {
@ -477,6 +491,7 @@ export default {
this.getData();
this.addRecord()
this.getNote()
this.getComment()
},
methods: {
goBack () {
@ -517,7 +532,7 @@ export default {
const chapter = this.chapter === undefined ? 0 : +this.chapter
const section = this.section === undefined ? 0 : +this.section
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);
}
},
@ -583,6 +598,75 @@ export default {
this.noteForm = JSON.parse(JSON.stringify(row))
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 () {
const linkTag = document.createElement("link");
@ -1165,4 +1249,29 @@ $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>

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

Loading…
Cancel
Save