fixLog
yujialong 2 years ago
parent 8bf63fc2f1
commit 3e17c1b5bd
  1. 4
      src/utils/api.js
  2. 330
      src/views/match/manage/matchRank.vue
  3. 19
      src/views/order/AddOrder.vue
  4. 15
      src/views/serve/backstage/model.vue
  5. 8
      src/views/serve/backstage/modelType.vue
  6. 79
      src/views/serve/backstage/sourceModel.vue
  7. 1
      src/views/serve/backstage/sourceType.vue

@ -127,6 +127,10 @@ export default {
getAllModelListBySys: `nakadai/nakadai/model/demo/getAllModelListBySys`,
InstitutionSourceModel: `nakadai/nakadai/model/demo/InstitutionSourceModel`,
disableModelDemo: `nakadai/nakadai/model/demo/disabledEvents`,
copyTheModelToTheNakadai: `nakadai/nakadai/model/demo/copyTheModelToTheNakadai`,
builtInModelButtonDisplayByNakadai: `nakadai/nakadai/model/demo/builtInModelButtonDisplayByNakadai`,
builtInModelState: `nakadai/nakadai/model/demo/builtInModelState`,
modelRedis: `nakadai/nakadai/model/demo/getRedisCache`,
// 课程管理三级联查
courseDiscipline: `nakadai/nakadai/subject/courseDiscipline`, //课程学科类别

@ -1,62 +1,121 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20 head-card">
<el-card shadow="hover"
class="m-b-20 head-card">
<div class="flex-between m-b-20">
<el-page-header v-if="grades.length" @back="$router.back()" :content="grades[index].stageName + '/排名'"></el-page-header>
<el-page-header v-if="grades.length"
@back="$router.back()"
:content="grades[index].stageName + '/排名'"></el-page-header>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<el-card shadow="hover"
class="m-b-20">
<div class="tabs">
<template v-for="(item, i) in grades">
<a v-if="i === index || !item.stageId" :key="i" class="item" :class="{active: item.stageId == active}" @click="tabChange(item.stageId)">{{ item.stageName }}排名</a>
<a v-if="i === index || !item.stageId"
:key="i"
class="item"
:class="{active: item.stageId == active}"
@click="tabChange(item.stageId)">{{ item.stageName }}排名</a>
</template>
</div>
<div class="flex-between" style="margin: 20px 0">
<div class="flex-between"
style="margin: 20px 0">
<div style="display: inline-flex;align-items: center">
<el-radio v-model="type" :label="0" @change="typeChange">默认系统排序</el-radio>
<el-radio v-model="type" :label="1" @change="typeChange">手动上传</el-radio>
<el-button type="primary" :disabled="type === 0" class="ml20" @click="batchImport">上传文件</el-button>
<el-radio v-model="type"
:label="0"
@change="typeChange">默认系统排序</el-radio>
<el-radio v-model="type"
:label="1"
@change="typeChange">手动上传</el-radio>
<el-button type="primary"
:disabled="type === 0"
class="ml20"
@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>
<el-button v-else type="primary" @click="cancelPublish(0)">取消发布</el-button>
<el-button v-if="!published"
type="primary"
@click="cancelPublish(1)">发布排名</el-button>
<div v-else>
<span style="margin-right: 10px">{{ publishTime }}发布排名</span>
<el-button type="primary"
@click="cancelPublish(0)">取消发布</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center">
<el-table-column type="index" width="60" label="排名" align="center">
</div>
<el-table :data="list"
class="table"
ref="table"
stripe
header-align="center">
<el-table-column type="index"
width="60"
label="排名"
align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<template v-if="competitionType == 1">
<el-table-column prop="teamName" label="团队名称" min-width="150" align="center"></el-table-column>
<el-table-column prop="leaderName" label="队长" min-width="150" align="center"></el-table-column>
<el-table-column prop="teamName"
label="团队名称"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="leaderName"
label="队长"
min-width="150"
align="center"></el-table-column>
</template>
<el-table-column v-else prop="userName" label="学生姓名" min-width="100" align="center"></el-table-column>
<el-table-column prop="schoolName" label="学校" min-width="100" align="center"></el-table-column>
<el-table-column prop="timeSum" label="用时" width="90" align="center">
<el-table-column v-else
prop="userName"
label="学生姓名"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="schoolName"
label="学校"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="timeSum"
label="用时"
width="90"
align="center">
<template slot-scope="scope">
{{ scope.row.timeSum + (scope.row.timeSum === '—' ? '' : 'min') }}
</template>
</el-table-column>
<el-table-column prop="score" label="分数" width="90" align="center"></el-table-column>
<el-table-column label="得分详情" align="center" width="160">
<el-table-column prop="score"
label="分数"
width="90"
align="center"></el-table-column>
<el-table-column label="得分详情"
align="center"
width="160">
<template slot-scope="scope">
<el-button v-if="(!competitionType && scope.row.reportId) || competitionType" type="text" @click="show(scope.row, scope.$index)">查看</el-button>
<el-button v-if="(!competitionType && scope.row.reportId) || competitionType"
type="text"
@click="show(scope.row, scope.$index)">查看</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div>
</el-card>
<el-dialog title="团队得分详情" :visible.sync="teamVisible" width="900px" :close-on-click-modal="false">
<h6 v-if="active" style="margin-bottom: 10px;font-size: 16px;">团队名称{{ curRow.teamName }} 阶段名称{{ stageName }}</h6>
<el-dialog title="团队得分详情"
:visible.sync="teamVisible"
width="900px"
:close-on-click-modal="false">
<h6 v-if="active"
style="margin-bottom: 10px;font-size: 16px;">团队名称{{ curRow.teamName }} 阶段名称{{ stageName }}</h6>
<table class="table tc">
<tr>
<template v-if="!active">
@ -71,10 +130,12 @@
<th width="100">得分详情</th>
</tr>
<template v-if="teams.length">
<tr v-for="(item, i) in teams" :key="i">
<tr v-for="(item, i) in teams"
:key="i">
<template v-if="!active && item.rowspan">
<td :rowspan="item.rowspan">{{ item.stageName }}</td>
<td class="scores" :rowspan="item.rowspan">
<td class="scores"
:rowspan="item.rowspan">
<p class="score">{{ item.teamScore }}</p>
<p>{{ item.teamCalculationMethodName }}</p>
<p>权重</p>
@ -88,10 +149,13 @@
<td>{{ item.timeSum }}min</td>
<td>{{ item.score }}</td>
<td>
<el-button v-if="item.reportId" type="text" @click="toReport(item)">查看</el-button>
<el-button v-if="item.reportId"
type="text"
@click="toReport(item)">查看</el-button>
</td>
</template>
<td v-else colspan="6"></td>
<td v-else
colspan="6"></td>
</tr>
</template>
<tr v-else>
@ -103,18 +167,24 @@
<td colspan="6">总排名{{ curRow.index }}</td>
</tr>
</table>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="teamVisible = false">确定</el-button>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="teamVisible = false">确定</el-button>
</span>
</el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false">
<el-dialog title="批量导入"
:visible.sync="importVisible"
width="24%"
:close-on-click-modal="false">
<div style="text-align: center">
<div style="margin-bottom: 10px;">
<el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
<el-button type="primary"
@click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
</div>
<el-upload
ref="upload"
<el-upload ref="upload"
name="file"
accept=".xls,.xlsx"
:on-remove="handleRemove"
@ -132,27 +202,54 @@
isOverallRanking: active ? 0 : 1,
schoolId: ''
}"
:auto-upload="false"
>
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
:auto-upload="false">
<el-button type="primary"
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link>
<el-link v-if="uploadFaild"
type="primary"
@click="showFaild">部分数据导入失败查看失败原因</el-link>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="importVisible = false"> </el-button>
<el-button size="small" type="primary" @click="uploadSure"> </el-button>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
@click="importVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="uploadSure"> </el-button>
</span>
</el-dialog>
<el-dialog title="请选择发布排名时间"
:visible.sync="publishVisible"
width="260px"
:close-on-click-modal="false"
custom-class="publish-dia">
<el-date-picker popper-class="no-atTheMoment"
v-model="publishTime"
placeholder="请选择结束时间"
type="datetime"
:picker-options="pickerOptions">
</el-date-picker>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
@click="publishVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="publishTimeSubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Setting from "@/setting";
import Setting from '@/setting'
import util from "@/libs/util";
import echarts from "echarts";
import axios from 'axios';
export default {
data() {
data () {
return {
id: +this.$route.query.id,
stageId: +this.$route.query.stageId,
@ -197,15 +294,32 @@ export default {
totalScore: 0,
published: false,
uploadData: [],
sourceType: ''
sourceType: '',
publishVisible: false,
publishTime: '',
timeId: '',
pickerOptions: {
//
disabledDate (time) {
return time.getTime() < Date.now() - 8.64e7;
},
//
selectableRange: (() => {
let data = new Date();
let hour = data.getHours();
let minute = data.getMinutes();
let second = data.getSeconds();
return [`${hour}:${minute}:${second} - 23:59:59`]
})(),
}
};
},
mounted() {
mounted () {
this.getStage()
},
methods: {
//
getData() {
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)
@ -239,10 +353,10 @@ export default {
this.sourceType = source
this.type = source == 1 ? 1 : 0
this.getRank()
}).catch(res => {})
}).catch(res => { })
},
//
getRank() {
getRank () {
//
if (this.type) {
this.$post(this.api.manuallyUploadedRankings, {
@ -257,7 +371,8 @@ export default {
this.sourceType = message.total ? message.records[0].isRelease : 0
this.list = message.records
this.total = message.total
}).catch(res => {})
this.getPublishTime()
}).catch(res => { })
} else { //
if (!this.active) {
//
@ -273,18 +388,20 @@ export default {
this.published = publishStatus
this.list = page
this.total = total
}).catch(res => {})
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
}).catch(res => {})
this.getPublishTime()
}).catch(res => { })
}
}
},
//
getStage() {
getStage () {
this.$post(this.api.detailsOfCompetitionStage, {
pageNum: 1,
pageSize: 100,
@ -298,11 +415,11 @@ export default {
stageName: '总分'
})
this.getData()
}).catch(res => {});
}).catch(res => { });
},
//
typeChange(val) {
this.$post(`${this.api.toggleTheSortingMode}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => {}).catch(res => {})
typeChange (val) {
this.$post(`${this.api.toggleTheSortingMode}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => { }).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 }) => {
@ -311,18 +428,18 @@ export default {
// this.published = whetherToPublish
// }).catch(res => {})
},
initData() {
initData () {
this.page = 1
this.getData()
},
// tab
tabChange(i) {
tabChange (i) {
this.type = 0
this.active = i
this.initData()
},
//
show(row, i) {
show (row, i) {
this.teams = []
//
if (this.competitionType == 1) {
@ -341,7 +458,7 @@ export default {
data.stageId = this.active
this.$post(this.api.stageTeamScoreDetails, data).then(({ page }) => {
this.teams = page.records
}).catch(res => {})
}).catch(res => { })
} else {
const ids = this.grades.map(e => e.stageId)
ids.pop()
@ -369,7 +486,7 @@ export default {
})
this.teams = result
}
}).catch(res => {})
}).catch(res => { })
// } else { //
// this.$post(this.api.totalRankingScoreDetails, data).then(({ page }) => {
// const list = page.records
@ -401,22 +518,22 @@ export default {
}
},
//
toReport(row) {
toReport (row) {
this.$router.push(`/matchReport?reportId=${row.reportId}`)
},
handleCurrentChange(val) { //
handleCurrentChange (val) { //
this.page = val;
this.getData();
},
//
publishSubmit() {
publishSubmit () {
const { startTime, endTime } = this.grades[this.index]
if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!')
if (this.type) { //
this.$post(this.api.batchRelease, this.list.map(e => e.id)).then(res => {
this.getData()
util.successMsg('发布成功!')
}).catch(res => {})
}).catch(res => { })
} else {
let data = [] // data
if (!this.type) { //
@ -446,12 +563,12 @@ export default {
this.uploadData = []
this.getData()
util.successMsg('发布成功!')
}).catch(res => {})
}).catch(res => { })
// }).catch(res => {})
}
},
//
publish() {
publish () {
//
// if (this.published && this.sourceType != this.type) {
// this.$confirm(this.sourceType == 1 && !this.type ?
@ -471,13 +588,40 @@ export default {
type: 'success'
}).then(() => {
this.publishSubmit()
}).catch(() => {}) :
}).catch(() => { }) :
this.publishSubmit()
}).catch(res => {})
}).catch(res => { })
// this.publishSubmit()
},
//
async getPublishTime () {
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 () {
this.$post(this.api.addCompetitionStageRankingTime, {
competitionId: this.id,
isOverallRanking: this.active ? 0 : 1,
publicationType: this.type,
stageId: this.active || this.stageId,
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 = []
@ -487,50 +631,49 @@ export default {
//
//
if (publish) {
// this.type ?
this.publish()
// 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 => {})
this.publishTime = new Date()
this.publishVisible = true
} 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.sourceType = ''
this.type = 0
this.getData()
util.successMsg('取消发布成功!')
}).catch(res => {})
} catch (error) { }
}
},
//
batchImport() {
batchImport () {
this.importVisible = true
this.uploadList = []
this.uploadFaild = false
},
//
download() {
download () {
location.href = this.api[this.competitionType == 1 ? 'rankImportTeam' : 'rankImportPerson']
},
//
handleExceed(files, fileList) {
handleExceed (files, fileList) {
util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
)
},
//
showFaild() {
showFaild () {
axios.get(`${this.api.rankExportFailure}?exportCode=${this.exportCode}&competitionId=${this.id}`, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`批量导入排名管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => {})
}).catch(res => { })
},
uploadSuccess(res, file, fileList) {
uploadSuccess (res, file, fileList) {
this.uploadFaild = false
if (res.status === 200) {
const { exportCode } = res.data
@ -547,25 +690,25 @@ export default {
util.errorMsg(res.message || "上传失败,请检查数据")
}
},
uploadError(err, file, fileList) {
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
beforeRemove(file, fileList) {
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`)
},
handleRemove(file, fileList) {
handleRemove (file, fileList) {
this.uploadList = fileList
this.uploadFaild = false
},
uploadSure() {
uploadSure () {
this.list.length ?
this.$post(this.api.cancelImport, this.list.map(e => e.id)).then(res => {
this.$refs.upload.submit()
}).catch(res => {}) :
}).catch(res => { }) :
this.$refs.upload.submit()
}
}
@ -576,7 +719,8 @@ export default {
.table {
width: 100%;
border-collapse: collapse;
th, td {
th,
td {
padding: 12px;
border: 1px solid #ebeef5;
}
@ -593,7 +737,7 @@ export default {
.score {
font-size: 16px;
font-weight: 600;
color: #9076FF;
color: #9076ff;
}
}
</style>

@ -1668,12 +1668,6 @@
width="380px"
class="ship-dia"
:close-on-click-modal="false">
<!-- <div v-if="curRow.mallNonAssociatedLinks"
class="ship">
<p class="line"
v-for="(link, i) in curRow.mallNonAssociatedLinks"
:key="i">{{ link.urlName }}{{ link.url }}</p>
</div> -->
<el-input :disabled="viewDisabled"
v-model="shipContent"
placeholder="请填写需交付的产品登录地址、账号、密码等内容...(300个字以内)"
@ -2851,7 +2845,8 @@ export default {
showShip (row) {
this.curRow = row
let val = ''
row.mallNonAssociatedLinks.forEach(e => {
//
row.mallNonAssociatedLinks && row.mallNonAssociatedLinks.forEach(e => {
val += e.urlName + ':' + e.url + '\n'
})
this.shipInfo = val
@ -2859,16 +2854,6 @@ export default {
this.shipVisible = true
},
copyLink () {
// const oInput = document.createElement('input')
// oInput.value = this.shipInfo
// document.body.appendChild(oInput)
// oInput.select()
// document.execCommand('Copy')
// this.$message({
// message: '',
// type: 'success'
// })
// oInput.remove()
this.shipContent += this.shipInfo
},
//

@ -106,6 +106,7 @@
</template>
<script>
import org from "./modelType"
import Setting from '@/setting'
export default {
data () {
return {
@ -172,10 +173,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('modelNakadai') !== data && this.getList() // redis
localStorage.setItem('modelNakadai', data)
}
}).catch(res => { })
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},

@ -3,8 +3,6 @@
<div>
<div class="front-switch">
<el-switch v-model="modelIsShow"
:active-value="0"
:inactive-value="1"
active-text="内置模型按钮前台展示"
@change="changeModelStatus"></el-switch>
</div>
@ -122,13 +120,13 @@ export default {
},
//
getModelStatus () {
this.$post(`${this.api.checkIsShowBySystemId}?systemId=${this.systemId}`).then(res => {
this.modelIsShow = res.isShow // 0 1
this.$post(`${this.api.builtInModelState}?systemId=${this.systemId}`).then(res => {
this.modelIsShow = res.message == '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.builtInModelButtonDisplayByNakadai}?systemId=${this.systemId}&isShow=${val}`).then(res => { }).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>
@ -83,7 +83,8 @@
@click="edit(scope.row)">编辑</el-button>
<el-button type="text"
@click="del(scope.row)">删除</el-button>
<el-button type="text"
<el-button v-if="isSchool"
type="text"
@click="copy(scope.row)">复制</el-button>
<el-switch v-if="scope.row.postStatus"
v-model="scope.row.ztOpen"
@ -116,7 +117,7 @@
style="width: 280px"></el-input>
</el-form-item>
<el-form-item label="模型分类">
<el-cascader :options="categoryList"
<el-cascader :options="categories"
v-model="categoryIdCus"
:props="categoryProps"
clearable
@ -135,9 +136,11 @@
</template>
<script>
import org from "./sourceType"
import Setting from '@/setting'
export default {
data () {
return {
systemId: this.$route.query.systemId,
isTopLevel: true, //
listData: [],
keyword: "",
@ -154,7 +157,9 @@ export default {
label: 'categoryName',
value: 'id'
},
timer: null
timer: null,
isSchool: 0,
categories: []
};
},
components: {
@ -175,31 +180,44 @@ export default {
},
methods: {
//
async getList (school) {
async getList () {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() || {}//
this.isTopLevel = !curNode.level
//
const { data } = await this.$post(this.api[school ? 'InstitutionSourceModel' : !curNode.level ? 'getAllModelListBySys' : 'sysModelDemoList'], {
const { data } = await this.$post(this.api[this.isSchool ? 'InstitutionSourceModel' : !curNode.level ? 'getAllModelListBySys' : 'sysModelDemoList'], {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id,
founder: school ? 1 : 0
founder: this.isSchool ? 1 : 0
})
this.listData = data.records
this.total = 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('modelNakadai') !== data && this.getList() // redis
localStorage.setItem('modelNakadai', data)
}
}).catch(res => { })
},
//
catetoryClick (school) {
this.isSchool = school
this.initData()
},
initData (school) {
this.$refs.table.clearSelection()
initData () {
this.page = 1
this.getData(school)
this.getData()
},
//
add () {
@ -232,28 +250,23 @@ export default {
},
//
copy (row) {
this.$post(this.api.sourceModelClassification + '?founder=0').then(res => {
const { data } = res
// children
const handleLeaf = list => {
list.map(e => {
if (e.children.length) {
handleLeaf(e.children)
} else {
delete e.children
}
})
}
handleLeaf(data)
this.categoryList = data[0].children
}).catch(res => { })
this.curRow = JSON.parse(JSON.stringify(row))
this.copyVisible = true
},
//
copySubmit () {
async copySubmit () {
const ids = this.categoryIdCus
const row = this.curRow
if (!row.modelName) return this.$message.error('请输入模型名称!')
if (!ids.length) return this.$message.error('请选择模型分类!')
await this.$post(this.api.copyTheModelToTheNakadai, {
beCopiedModelId: row.id,
categoryId: ids[ids.length - 1],
modelName: row.modelName,
systemId: this.systemId
})
this.$message.success('复制成功!')
this.copyVisible = false
},
del (row) {
this.$confirm("确定要删除吗?", "提示", {

@ -87,6 +87,7 @@ export default {
this.$post(this.api.sourceModelClassification + '?founder=0').then(res => {
const { data } = res
this.orgList = data
this.$parent.categories = data
data.length && this.$nextTick(() => {
const categoryId = this.$route.query.categoryId
this.$refs.tree.setCurrentKey(categoryId || data[0].id)

Loading…
Cancel
Save