From e305d06c2294d4fed8d4c89bf46ca1f189bdfa0a Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Mon, 5 Jun 2023 11:18:52 +0800
Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/index.js | 4 ++
src/pages/expSystem/backstage/model.vue | 7 +-
src/pages/expSystem/backstage/sourceModel.vue | 68 ++++++++++++-------
src/pages/expSystem/backstage/sourceType.vue | 33 ++++++---
src/pages/expSystem/list/index.vue | 2 +-
src/pages/match/manage/matchRank.vue | 19 +++++-
src/pages/station/preview/index.vue | 49 ++++++-------
src/styles/page/station.scss | 5 ++
8 files changed, 121 insertions(+), 66 deletions(-)
diff --git a/src/api/index.js b/src/api/index.js
index 34f4cf4..875b53d 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -443,6 +443,7 @@ export default {
deleteReferenceDemo: `nakadai/nakadai/model/reference/demo/deleteReferenceDemo`,
saveReferenceDemo: `nakadai/nakadai/model/reference/demo/saveReferenceDemo`,
referenceDemoList: `nakadai/nakadai/model/reference/demo/referenceDemoList`,
+ sortReadingModelByTeacherSideSystem: `nakadai/nakadai/model/reference/demo/sortReadingModelByTeacherSideSystem`,
getAllModelList: `nakadai/nakadai/model/reference/demo/getAllModelList`,
synchronizationMdel: `nakadai/nakadai/model/reference/demo/synchronizationMdel`,
builtInClassificationByNakadai: `nakadai/nakadai/model/reference/builtInClassificationByNakadai`,
@@ -454,6 +455,9 @@ export default {
displayListOrNotByTeacher: `nakadai/nakadai/model/demo/displayListOrNotByTeacher`,
builtInModelStateByTeacher: `nakadai/nakadai/model/demo/builtInModelStateByTeacher`,
modelRedis: `nakadai/nakadai/model/demo/getRedisCache`,
+ systemModelByTeacher: `nakadai/nakadai/model/reference/demo/systemModelByTeacher`,
+ demoHiddenOpen: `nakadai/model/demo/hidden/batchOpen`,
+ demoHiddenClose: `nakadai/model/demo/hidden/batchShutdown`,
// 教师评语
addComment: `evaluation/cevaluation/comment/addComment`,
diff --git a/src/pages/expSystem/backstage/model.vue b/src/pages/expSystem/backstage/model.vue
index 06752bf..6068b41 100644
--- a/src/pages/expSystem/backstage/model.vue
+++ b/src/pages/expSystem/backstage/model.vue
@@ -205,13 +205,14 @@ export default {
founder: 1,
pageNum: 1,
pageSize: 10000,
- systemId: this.systemId
+ systemId: this.systemId,
+ isOpen: 0
}).then(res => {
const modelList = res.data.records
+ // 本校分类及模型
// 查询源模型分类
- this.$post(this.api.sourceModelClassification + '?founder=1').then(res => {
- let { data } = res
+ this.$post(this.api.sourceModelClassification + '?founder=1').then(({ data }) => {
const promises = []
const addType = list => {
list.map((e, i) => {
diff --git a/src/pages/expSystem/backstage/sourceModel.vue b/src/pages/expSystem/backstage/sourceModel.vue
index 80d778f..acfcf56 100644
--- a/src/pages/expSystem/backstage/sourceModel.vue
+++ b/src/pages/expSystem/backstage/sourceModel.vue
@@ -80,27 +80,37 @@
(scope.row.postStatus ? '已发布' : '草稿') }}
-
查看
- 编辑
- 删除
-
+ 编辑
+ 删除
+
+
+
+
+ @change="switchOffSystem($event,scope.row,scope.$index)">
@@ -165,16 +175,16 @@ export default {
// 系统内置
if (this.isSystem) {
// 如果是首级,要调另一个接口
- res = await this.$post(this.api[!curNode.level ? 'getAllModelList' : 'referenceDemoList'], data)
+ res = await this.$post(this.api[!curNode.level ? 'systemModelByTeacher' : 'sortReadingModelByTeacherSideSystem'], data)
} else {
data.founder = 1
// 本校模型
res = await this.$post(this.api.InstitutionSourceModel, data)
- // 中台禁用了(ztOpen=1),则直接显示禁用
- res.data.records.forEach(e => {
- if (e.ztOpen) e.isOpen = 1
- })
}
+ // 中台禁用了(ztOpen=1),则直接显示禁用
+ res.data.records.forEach(e => {
+ if (e.ztOpen) e.isOpen = 1
+ })
this.listData = res.data.records
this.total = res.data.total
},
@@ -216,6 +226,7 @@ export default {
type: "warning"
}).then(() => {
this.$post(this.api.deleteSysModelDemo, ids).then(res => {
+ this.$refs.table.clearSelection()
this.$message.success('删除成功')
this.getData()
}).catch(res => { })
@@ -246,19 +257,20 @@ export default {
batchOff (ztOpen) {
const off = ztOpen === 0
if (this.multipleSelection.length) {
- // 批量删除
- let list = []
- this.multipleSelection.map(e => {
- list.push({
+ const { isSystem } = this
+ const list = this.multipleSelection.map(e => {
+ return isSystem ? e.id : {
isOpen: ztOpen,
modelId: e.id,
type: 1
- })
+ }
})
this.$confirm(`确定要${off ? '启用' : '禁用'}吗?`, "提示", {
type: "warning"
}).then(() => {
- this.$post(this.api.disableModelDemo, list).then(res => {
+ // 本校跟系统的禁用接口不一样,系统的禁用启用接口分为两个
+ this.$post(this.api[isSystem ? (off ? 'demoHiddenOpen' : 'demoHiddenClose') : 'disableModelDemo'], list).then(res => {
+ this.$refs.table.clearSelection()
this.$message.success(`${off ? '启用' : '禁用'}成功`)
this.getData()
}).catch(res => { })
@@ -267,8 +279,8 @@ export default {
this.$message.error("请先选择模型 !")
}
},
- // 禁用
- switchOff (val, row, index) {
+ // 本校禁用
+ switchOff (val, row,) {
this.$post(this.api.disableModelDemo, [{
isOpen: val,
modelId: row.id,
@@ -277,6 +289,12 @@ export default {
this.$message.success(val ? '禁用成功' : '启用成功')
}).catch(res => { })
},
+ // 系统内置禁用
+ switchOffSystem (val, row) {
+ this.$post(this.api[val ? 'demoHiddenClose' : 'demoHiddenOpen'], [row.id]).then(res => {
+ this.$message.success(val ? '禁用成功' : '启用成功')
+ }).catch(res => { })
+ },
handleSelectionChange (val) {
this.multipleSelection = val
},
diff --git a/src/pages/expSystem/backstage/sourceType.vue b/src/pages/expSystem/backstage/sourceType.vue
index 114b7ae..3fabc14 100644
--- a/src/pages/expSystem/backstage/sourceType.vue
+++ b/src/pages/expSystem/backstage/sourceType.vue
@@ -3,6 +3,7 @@
{
- const { categoryId } = this.$route.query
- this.$refs.tree.setCurrentKey(categoryId || data[0].id)
+
+ // 系统内置模型
+ const res = await this.$post(`${this.api.builtInClassificationByNakadai}?systemId=${this.systemId}`)
+ this.orgListSystem = res.data
+
+ this.$nextTick(() => {
+ this.$refs[isSystem == 1 ? 'systemTree' : 'tree'].setCurrentKey(categoryId || data[0].id)
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
- categoryId: this.$refs.tree.getCurrentKey()
+ categoryId: this.$refs[isSystem == 1 ? 'systemTree' : 'tree'].getCurrentKey(),
+ isSystem
}
}).catch(err => { })
- this.$emit('getData')
+ this.$emit('initData', +isSystem)
})
-
- // 系统内置模型
- const res = await this.$post(`${this.api.builtInClassificationByNakadai}?systemId=${this.systemId}`)
- this.orgListSystem = res.data
},
// 本校模型点击回调
nodeClick () {
@@ -124,7 +128,8 @@ export default {
path: 'backstage',
query: {
...this.$route.query,
- categoryId: this.$refs.tree.getCurrentKey()
+ categoryId: this.$refs.tree.getCurrentKey(),
+ isSystem: 0
}
}).catch(err => { })
this.$emit('initData')
@@ -132,6 +137,14 @@ export default {
// 系统内置点击回调
nodeSystemClick () {
this.$refs.tree.setCurrentKey(null)
+ this.$router.push({
+ path: 'backstage',
+ query: {
+ ...this.$route.query,
+ categoryId: this.$refs.systemTree.getCurrentKey(),
+ isSystem: 1
+ }
+ }).catch(err => { })
this.$emit('initData', 1)
},
// 添加分类
diff --git a/src/pages/expSystem/list/index.vue b/src/pages/expSystem/list/index.vue
index 62ade21..30644cd 100644
--- a/src/pages/expSystem/list/index.vue
+++ b/src/pages/expSystem/list/index.vue
@@ -57,7 +57,7 @@
进入
diff --git a/src/pages/match/manage/matchRank.vue b/src/pages/match/manage/matchRank.vue
index 6636278..616f1db 100644
--- a/src/pages/match/manage/matchRank.vue
+++ b/src/pages/match/manage/matchRank.vue
@@ -311,7 +311,8 @@ export default {
let second = data.getSeconds();
return [`${hour}:${minute}:${second} - 23:59:59`]
})(),
- }
+ },
+ uploaded: 0
};
},
mounted () {
@@ -575,6 +576,10 @@ export default {
this.published = true
this.timeId = res.releaseTime.id
this.publishTime = res.releaseTime.releaseTime
+ } else {
+ this.published = false
+ this.timeId = ''
+ this.publishTime = ''
}
},
// 定时发布排名
@@ -588,6 +593,7 @@ export default {
})
util.successMsg('发布成功')
this.getData()
+ this.uploaded = 0
this.publishVisible = false
},
// 取消发布排名
@@ -601,8 +607,13 @@ export default {
// 如果是发布排名,则先删除已发布的排名,再调发布排名的接口
// 如果是取消发布,则直接调取消发布的接口
if (publish) {
- this.publishTime = new Date()
- this.publishVisible = true
+ // 如果是手动发布,并且没有上传排名,则提示
+ if (this.type && !this.uploaded) {
+ return util.errorMsg('请先上传数据!')
+ } else {
+ this.publishTime = new Date()
+ this.publishVisible = true
+ }
} else {
try {
// 取消定时发布的接口跟取消普通发布的接口不一样
@@ -646,6 +657,7 @@ export default {
},
uploadSuccess (res, file, fileList) {
this.uploadFaild = false
+ this.uploaded = 0
if (res.status === 200) {
const { exportCode } = res.data
if (exportCode) {
@@ -653,6 +665,7 @@ export default {
this.uploadFaild = true
util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`)
} else {
+ this.uploaded = 1
this.importVisible = false
this.getRank()
util.successMsg('请检查数据后,点击发布排名以发布数据!')
diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue
index dce8c92..52854d0 100644
--- a/src/pages/station/preview/index.vue
+++ b/src/pages/station/preview/index.vue
@@ -254,18 +254,18 @@
class="icon el-icon-delete"
@click="delComment(item)">
-
-
- {{ item.likeCount }}
-
-
+
+
+ {{ item.likeCount || '' }}
+ -->
{{reply.createUsername}}
-->
{
this.comment = ''
diff --git a/src/styles/page/station.scss b/src/styles/page/station.scss
index 21e33b9..0e9c739 100644
--- a/src/styles/page/station.scss
+++ b/src/styles/page/station.scss
@@ -51,6 +51,11 @@
}
}
}
+ .like-wrap {
+ display: inline-flex;
+ align-items: center;
+ cursor: pointer;
+ }
}
.reply {
margin-top: 20px;