fixLog
yujialong 2 years ago
parent ff78ab0a19
commit 8bf63fc2f1
  1. 4
      src/utils/api.js
  2. 4
      src/views/serve/addModel.vue
  3. 33
      src/views/serve/backstage/model.vue
  4. 11
      src/views/serve/backstage/modelType.vue
  5. 143
      src/views/serve/backstage/sourceModel.vue
  6. 32
      src/views/serve/backstage/sourceType.vue
  7. 2
      src/views/shop/addProduct/index.vue

@ -126,6 +126,7 @@ export default {
runPythonCode: `nakadai/nakadai/model/demo/runPythonCode`,
getAllModelListBySys: `nakadai/nakadai/model/demo/getAllModelListBySys`,
InstitutionSourceModel: `nakadai/nakadai/model/demo/InstitutionSourceModel`,
disableModelDemo: `nakadai/nakadai/model/demo/disabledEvents`,
// 课程管理三级联查
courseDiscipline: `nakadai/nakadai/subject/courseDiscipline`, //课程学科类别
@ -398,6 +399,9 @@ export default {
toggleTheSortingMode: `competition/competition/rank/toggleTheSortingMode`,
selectTheLastSortStatus: `competition/competition/rank/selectTheLastSortStatus`,
cancelImport: `competition/competition/rank/cancelImport`,
addCompetitionStageRankingTime: `competition/competitionReleaseTime/addCompetitionStageRankingTime`,
cancelCompetitionStageRankingTime: `competition/competitionReleaseTime/cancelCompetitionStageRankingTime`,
getCompetitionStageRankingTime: `competition/competitionReleaseTime/getCompetitionStageRankingTime`,
gradeImport: `https://www.occupationlab.com/template/赛事成绩导入模板.xlsx`,
rankImportTeam: `https://www.occupationlab.com/template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `https://www.occupationlab.com/template/赛事排名导入模板(个人赛).xlsx`,

@ -121,9 +121,7 @@ export default {
},
//
getType () {
this.$post(this.api.sourceModelClassification, {
founder: 0
}).then(res => {
this.$post(this.api.sourceModelClassification + '?founder=0').then(res => {
const { data } = res
// children
const handleLeaf = list => {

@ -54,7 +54,7 @@
<el-table-column label="状态"
align="center">
<template slot-scope="scope">
{{ scope.row.isOpen ? '禁用' : '启用' }}
{{ scope.row.ztOpen ? '禁用' : '启用' }}
</template>
</el-table-column>
<el-table-column label="操作"
@ -120,7 +120,8 @@ export default {
modelVisible: false,
modelLoading: false,
modelData: [],
submiting: false
submiting: false,
timer: null
};
},
components: {
@ -134,18 +135,23 @@ export default {
}, 500)
}
},
mounted () { },
mounted () {
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
})
},
methods: {
getData () {
getList () {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
this.isTopLevel = !curNode.level && curNode.categoryName === '全部'
this.isTopLevel = !curNode.level
//
if (this.isTopLevel) {
this.$post(this.api.getAllModelList, {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
systemId: this.systemId
systemId: this.systemId,
founder: 0
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
@ -163,6 +169,11 @@ export default {
}).catch(res => { })
}
},
getData () {
clearInterval(this.timer)
this.getList()
// this.timer = setInterval(this.getList, 1000)
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
@ -178,12 +189,13 @@ export default {
this.$post(this.api.getAllModelList, {
pageNum: 1,
pageSize: 10000,
systemId: this.systemId
systemId: this.systemId,
founder: 0,
}).then(res => {
const modelList = res.data.records
//
this.$post(this.api.sourceModelClassification).then(res => {
this.$post(this.api.sourceModelClassification + '?founder=0').then(res => {
let { data } = res
const promises = []
const addType = list => {
@ -194,7 +206,10 @@ export default {
this.$post(this.api.sysModelDemoList, {
pageNum: 1,
pageSize: 10000,
categoryId: e.id
categoryId: e.id,
founder: 0,
postStatus: 1,
ztOpen: 0
}).then(res => {
const { records } = res.data
const modelChildren = []

@ -103,7 +103,7 @@ export default {
methods: {
//
getType () {
this.$post(`${this.api.modelClassList}?systemId=${this.systemId}`).then(res => {
this.$post(`${this.api.modelClassList}?systemId=${this.systemId}&founder=0`).then(res => {
const { data } = res
this.orgList = data
data.length && this.$nextTick(() => {
@ -142,7 +142,7 @@ export default {
},
syncModelData () {
//
this.$post(`${this.api.delModelInfoBySystemId}?systemId=${this.systemId}`).then(res => {
this.$post(`${this.api.delModelInfoBySystemId}?systemId=${this.systemId}&founder=0`).then(res => {
this.$post(`${this.api.synchronizationMdel}?systemId=${this.systemId}`).then(res => {
this.$router.push({
path: 'backstage',
@ -169,9 +169,7 @@ export default {
//
async addData (id) {
//
this.$post(this.api.sourceModelClassification, {
founder: 0
}).then(res => {
this.$post(this.api.sourceModelClassification + '?founder=0').then(res => {
const { data } = res
const systemId = this.systemId
const promises = []
@ -196,7 +194,8 @@ export default {
this.$post(this.api.sysModelDemoList, {
pageNum: 1,
pageSize: 10000,
categoryId: e.id
categoryId: e.id,
founder: 0
}).then(res => {
let { records } = res.data
records = records.filter(e => e.postStatus && !e.isOpen) //

@ -59,7 +59,7 @@
align="center">
<template slot-scope="scope">
{{ scope.row.schoolName || scope.row.modifyName }}
{{ scope.row.schoolName || scope.row.modifyName }}
</template>
</el-table-column>
<el-table-column prop="updateTime"
@ -75,7 +75,7 @@
</template>
</el-table-column>
<el-table-column label="操作"
width="230">
width="260">
<template slot-scope="scope">
<el-button type="text"
@click="show(scope.row)">查看</el-button>
@ -83,12 +83,14 @@
@click="edit(scope.row)">编辑</el-button>
<el-button type="text"
@click="del(scope.row)">删除</el-button>
<el-button type="text"
@click="copy(scope.row)">复制</el-button>
<el-switch v-if="scope.row.postStatus"
v-model="scope.row.isOpen"
v-model="scope.row.ztOpen"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.isOpen ? '禁用' : '启用'"
:active-text="scope.row.ztOpen ? '禁用' : '启用'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template>
</el-table-column>
@ -101,6 +103,34 @@
:total="total"></el-pagination>
</div>
</div>
<el-dialog title="复制"
:visible.sync="copyVisible"
width="400px"
center
:close-on-click-modal="false">
<el-form label-position="left">
<el-form-item label="模型名称">
<el-input placeholder="请输入模型名称"
v-model="curRow.modelName"
style="width: 280px"></el-input>
</el-form-item>
<el-form-item label="模型分类">
<el-cascader :options="categoryList"
v-model="categoryIdCus"
:props="categoryProps"
clearable
style="width: 280px">
</el-cascader>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<el-button @click="copyVisible = false"> </el-button>
<el-button type="primary"
@click="copySubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -114,7 +144,17 @@ export default {
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
multipleSelection: []
multipleSelection: [],
copyVisible: false,
curRow: {},
categoryIdCus: [],
categoryList: [],
categoryProps: {
checkStrictly: true,
label: 'categoryName',
value: 'id'
},
timer: null
};
},
components: {
@ -129,12 +169,14 @@ export default {
}
},
mounted () {
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
})
},
methods: {
//
async getData (school) {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
async getList (school) {
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'], {
@ -142,11 +184,18 @@ export default {
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id,
founder: 0
founder: school ? 1 : 0
})
this.listData = data.records
this.total = data.total
},
getData (school) {
clearInterval(this.timer)
this.getList(school)
// this.timer = setInterval(() => {
// this.getList(school)
// }, 1000)
},
initData (school) {
this.$refs.table.clearSelection()
this.page = 1
@ -173,24 +222,6 @@ export default {
this.$message.error("请先选择模型 !")
}
},
//
batchOff (isOpen) {
const off = isOpen === 0
if (this.multipleSelection.length) {
//
let ids = this.multipleSelection.map(e => e.id)
this.$confirm(`确定要${off ? '启用' : '禁用'}吗?`, "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.bulkDisable}?isOpen=${isOpen}`, ids).then(res => {
this.$message.success(`${off ? '启用' : '禁用'}成功`)
this.getData()
}).catch(res => { })
}).catch(() => { })
} else {
this.$message.error("请先选择模型 !")
}
},
//
show (row) {
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1`)
@ -198,6 +229,31 @@ export default {
//
edit (row) {
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&postStatus=${row.postStatus}`)
},
//
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 () {
},
del (row) {
this.$confirm("确定要删除吗?", "提示", {
@ -209,8 +265,39 @@ export default {
}).catch(res => { })
}).catch(() => { })
},
//
batchOff (ztOpen) {
const off = ztOpen === 0
if (this.multipleSelection.length) {
//
let list = []
this.multipleSelection.map(e => {
list.push({
isOpen: ztOpen,
modelId: e.id,
type: 0
})
})
this.$confirm(`确定要${off ? '启用' : '禁用'}吗?`, "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.disableModelDemo, list).then(res => {
this.$message.success(`${off ? '启用' : '禁用'}成功`)
this.getData()
}).catch(res => { })
}).catch(() => { })
} else {
this.$message.error("请先选择模型 !")
}
},
//
switchOff (val, row, index) {
this.$post(`${this.api.bulkDisable}?isOpen=${val}`, [row.id]).then(res => {
this.$post(this.api.disableModelDemo, [{
isOpen: val,
modelId: row.id,
type: 0
}]).then(res => {
this.$message.success(val ? '禁用成功' : '启用成功')
}).catch(res => { })
},

@ -1,14 +1,13 @@
<template>
<div>
<div>
<org-tree :data="orgList"
default-expand-all
ref="tree"
node-key="id"
highlight-current
:expand-on-click-node="false"
@node-click="getSingle"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
<el-tree :data="orgList"
ref="tree"
node-key="id"
highlight-current
:expand-on-click-node="false"
@node-click="getSingle"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
<span class="custom-tree-node"
slot-scope="{ node, data }">
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span>
@ -29,7 +28,7 @@
</el-button>
</span>
</span>
</org-tree>
</el-tree>
<div :class="['school-create', {active: schoolActive}]"
@click="schoolClick">院校创建</div>
</div>
@ -58,7 +57,6 @@
</div>
</template>
<script>
import OrgTree from "@/components/org-tree/src/tree";
export default {
props: ["Data"],
data () {
@ -77,21 +75,16 @@ export default {
{ required: true, message: "请输入分类名称", trigger: "blur" }
]
},
schoolActive: 0
schoolActive: false
};
},
components: {
OrgTree
},
mounted () {
this.getType()
},
methods: {
//
getType () {
this.$post(this.api.sourceModelClassification, {
founder: 0
}).then(res => {
this.$post(this.api.sourceModelClassification + '?founder=0').then(res => {
const { data } = res
this.orgList = data
data.length && this.$nextTick(() => {
@ -110,7 +103,7 @@ export default {
},
//
getSingle () {
this.schoolActive = 0
this.schoolActive = false
this.$router.push({
path: 'backstage',
query: {
@ -122,7 +115,8 @@ export default {
},
//
schoolClick () {
this.schoolActive = 1
this.$refs.tree.setCurrentKey(null)
this.schoolActive = true
this.$emit('initData', 1)
},
//

@ -603,9 +603,7 @@
<ul class="sort-line"
slot-scope="{ node, data }">
<li>
<i class="el-icon-rank"></i>
{{ data.index + 1 }}
</li>
<li>
<el-input v-if="data.edit"

Loading…
Cancel
Save