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

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

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

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

@ -59,7 +59,7 @@
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.schoolName || scope.row.modifyName }} {{ scope.row.schoolName || scope.row.modifyName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="updateTime" <el-table-column prop="updateTime"
@ -75,7 +75,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
width="230"> width="260">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <el-button type="text"
@click="show(scope.row)">查看</el-button> @click="show(scope.row)">查看</el-button>
@ -83,12 +83,14 @@
@click="edit(scope.row)">编辑</el-button> @click="edit(scope.row)">编辑</el-button>
<el-button type="text" <el-button type="text"
@click="del(scope.row)">删除</el-button> @click="del(scope.row)">删除</el-button>
<el-button type="text"
@click="copy(scope.row)">复制</el-button>
<el-switch v-if="scope.row.postStatus" <el-switch v-if="scope.row.postStatus"
v-model="scope.row.isOpen" v-model="scope.row.ztOpen"
:active-value="0" :active-value="0"
:inactive-value="1" :inactive-value="1"
style="margin: 0 10px 0 5px" 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> @change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template> </template>
</el-table-column> </el-table-column>
@ -101,6 +103,34 @@
:total="total"></el-pagination> :total="total"></el-pagination>
</div> </div>
</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> </div>
</template> </template>
<script> <script>
@ -114,7 +144,17 @@ export default {
page: +this.$route.query.page || 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
multipleSelection: [] multipleSelection: [],
copyVisible: false,
curRow: {},
categoryIdCus: [],
categoryList: [],
categoryProps: {
checkStrictly: true,
label: 'categoryName',
value: 'id'
},
timer: null
}; };
}, },
components: { components: {
@ -129,12 +169,14 @@ export default {
} }
}, },
mounted () { mounted () {
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
})
}, },
methods: { methods: {
// //
async getData (school) { async getList (school) {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() // const curNode = this.$refs.tree.$refs.tree.getCurrentNode() || {}//
this.isTopLevel = !curNode.level this.isTopLevel = !curNode.level
// //
const { data } = await this.$post(this.api[school ? 'InstitutionSourceModel' : !curNode.level ? 'getAllModelListBySys' : 'sysModelDemoList'], { const { data } = await this.$post(this.api[school ? 'InstitutionSourceModel' : !curNode.level ? 'getAllModelListBySys' : 'sysModelDemoList'], {
@ -142,11 +184,18 @@ export default {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
categoryId: curNode.id, categoryId: curNode.id,
founder: 0 founder: school ? 1 : 0
}) })
this.listData = data.records this.listData = data.records
this.total = data.total this.total = data.total
}, },
getData (school) {
clearInterval(this.timer)
this.getList(school)
// this.timer = setInterval(() => {
// this.getList(school)
// }, 1000)
},
initData (school) { initData (school) {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.page = 1 this.page = 1
@ -173,24 +222,6 @@ export default {
this.$message.error("请先选择模型 !") 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) { 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`)
@ -198,6 +229,31 @@ export default {
// //
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}`)
},
//
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) { del (row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
@ -209,8 +265,39 @@ export default {
}).catch(res => { }) }).catch(res => { })
}).catch(() => { }) }).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) { 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 ? '禁用成功' : '启用成功') this.$message.success(val ? '禁用成功' : '启用成功')
}).catch(res => { }) }).catch(res => { })
}, },

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

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

Loading…
Cancel
Save