前台模型按钮控制,全部模型查询等

dev_2022-03-03
yujialong 3 years ago
parent b04fa6a44b
commit 5ab1e1d55c
  1. 4
      src/utils/api.js
  2. 28
      src/views/serve/backstage/model.vue
  3. 36
      src/views/serve/backstage/modelType.vue
  4. 40
      src/views/serve/backstage/sourceModel.vue
  5. 93
      src/views/system/manageLog.vue

@ -102,12 +102,15 @@ export default {
modelClassList: `${host}/nakadai/model/reference/modelClassList`,
saveReferenceCategory: `${host}/nakadai/model/reference/saveReferenceCategory`,
updateModelClass: `${host}/nakadai/model/reference/updateModelClass`,
checkIsShowBySystemId: `${host}/nakadai/model/reference/checkIsShowBySystemId`,
modifyIsShowState: `${host}/nakadai/model/reference/modifyIsShowState`,
delModelInfoBySystemId: `${host}/nakadai/model/reference/demo/delModelInfoBySystemId`,
deleteReferenceDemo: `${host}/nakadai/model/reference/demo/deleteReferenceDemo`,
referenceFindById: `${host}/nakadai/model/reference/demo/findById`,
saveReferenceDemo: `${host}/nakadai/model/reference/demo/saveReferenceDemo`,
referenceDemoList: `${host}/nakadai/model/reference/demo/referenceDemoList`,
getAllModelList: `${host}/nakadai/model/reference/demo/getAllModelList`,
deleteSourceModelCategory: `${host}/nakadai/model/category/deleteSourceModelCategory`,
categorySave: `${host}/nakadai/model/category/save`,
@ -121,6 +124,7 @@ export default {
sysModelDemoList: `${host}/nakadai/model/demo/sysModelDemoList`,
updateSysModelDemo: `${host}/nakadai/model/demo/updateSysModelDemo`,
runPythonCode: `${host}/nakadai/model/demo/runPythonCode`,
getAllModelListBySys: `${host}/nakadai/model/demo/getAllModelListBySys`,
// 课程管理三级联查
courseDiscipline: `${host}/nakadai/nakadai/subject/courseDiscipline`, //课程学科类别

@ -87,15 +87,28 @@ export default {
mounted() {},
methods: {
getData() {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
//
if (!curNode.level) {
this.$post(this.api.getAllModelList, {
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: this.$refs.tree.$refs.tree.getCurrentKey()
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
this.listData = res.data.records
this.total = res.data.total
}).catch(res => {})
}
},
initData() {
this.$refs.table.clearSelection()
@ -138,7 +151,6 @@ export default {
}
})
e.children = [...e.children, ...modelChildren]
// console.log(11, e)
resolve()
}).catch(res => {
reject()
@ -148,8 +160,6 @@ export default {
})
}
addType(data)
// debugger
console.log(data, promises)
Promise.all(promises).then(_ => {
this.modelData = data
}).catch(res => {})

@ -2,7 +2,7 @@
<div>
<div>
<div class="front-switch">
<el-switch v-model="frontShow" :active-value="0" :inactive-value="1" active-text="内置模型按钮前台展示"></el-switch>
<el-switch v-model="modelIsShow" :active-value="0" :inactive-value="1" active-text="内置模型按钮前台展示" @change="changeModelStatus"></el-switch>
</div>
<div class="flex-between m-b-20">
<el-button type="text" icon="el-icon-refresh" @click="syncModel">同步原始模型列表</el-button>
@ -61,7 +61,7 @@ export default {
data() {
return {
systemId: this.$route.query.systemId,
frontShow: false,
modelIsShow: false,
orgList: [],
typeVisible: false,
Form: {
@ -82,8 +82,10 @@ export default {
},
mounted() {
this.getType()
this.getModelStatus()
},
methods: {
//
getType() {
this.$post(`${this.api.modelClassList}?systemId=${this.systemId}`).then(res => {
const { data } = res
@ -94,6 +96,16 @@ export default {
})
}).catch(res => {})
},
//
getModelStatus() {
this.$post(`${this.api.checkIsShowBySystemId}?systemId=${this.systemId}`).then(res => {
this.modelIsShow = res.isShow // 0 1
}).catch(res => {})
},
//
changeModelStatus(val) {
this.$post(`${this.api.modifyIsShowState}?systemId=${this.systemId}&isShow=${val}`).then(res => {}).catch(res => {})
},
getSingle() {
this.$emit('initData')
},
@ -124,10 +136,10 @@ export default {
const systemId = this.systemId
const promises = []
//
const addType = (list, refId) => {
list.map(e => {
const addType = async (list, refId) => {
for (const e of list) {
// promise
promises.push(new Promise(async (resolve, reject) => {
// promises.push(new Promise(async (resolve, reject) => {
//
await this.$post(this.api.saveReferenceCategory, {
id: '',
@ -159,18 +171,18 @@ export default {
})
//
this.$post(this.api.saveReferenceDemo, modelData).then(res => {
resolve()
// resolve()
resolve1()
}).catch(res => {
reject()
// reject()
reject1()
})
} else {
resolve()
// resolve()
}
e.children = [...e.children, ...records]
}).catch(res => {
reject()
// reject()
})
}))
@ -179,10 +191,10 @@ export default {
e.children && e.children.length && addType(e.children, res.referenceCategoryId)
})
}).catch(res => {
reject()
// reject()
})
}))
})
// }))
}
}
addType(data[0].children, id)
Promise.all(promises).then(_ => {

@ -13,7 +13,7 @@
</li>
</ul>
<div>
<el-button type="primary" round @click="add">新增</el-button>
<el-button v-if="!isTopLevel" type="primary" round @click="add">新增</el-button>
<el-button type="primary" round @click="batchDel">批量删除</el-button>
<el-button type="primary" round @click="batchOff(1)">批量禁用</el-button>
<el-button type="primary" round @click="batchOff(0)">批量开启</el-button>
@ -51,12 +51,13 @@ import org from "./sourceType"
export default {
data() {
return {
listData: [], //
keyword: "",
page: 1,
pageSize: 10,
total: 0,
multipleSelection: []
isTopLevel: true, //
listData: [],
keyword: "",
page: 1,
pageSize: 10,
total: 0,
multipleSelection: []
};
},
components: {
@ -76,15 +77,28 @@ export default {
methods: {
//
getData() {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
this.isTopLevel = !curNode.level
//
if (!curNode.level) {
this.$post(this.api.getAllModelListBySys, {
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.sysModelDemoList, {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: this.$refs.tree.$refs.tree.getCurrentKey()
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
this.listData = res.data.records
this.total = res.data.total
}).catch(res => {})
}
},
initData() {
this.$refs.table.clearSelection()

@ -1,45 +1,55 @@
<template>
<div class="page">
<div class="tool">
<div class="filters">
<h6>日志更新</h6>
<div class="filter">
<label>版本查询</label>
<el-select v-model="versionName" size="small" placeholder="请选择版本" filterable @change="verChange">
<el-option
v-for="item in vers"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div>
<el-button type="primary" @click="add">新增日志</el-button>
</div>
<div>
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="$router.back()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">日志更新</span>
</div>
</div>
</el-card>
<div class="page">
<div class="tool">
<div class="filters">
<div class="filter">
<label>版本查询</label>
<el-select v-model="versionName" size="small" placeholder="请选择版本" filterable @change="verChange">
<el-option
v-for="item in vers"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div>
<el-button type="primary" @click="add">新增日志</el-button>
</div>
</div>
<el-timeline class="timeline">
<el-timeline-item placement="top" v-for="(item, i) in listData" :key="i">
<p class="sign" :id="'ver' + i">{{ item.updateTime }}</p>
<div class="ver">
<div>
{{ platformName + item.versionName }}
<span class="action">
<i class="el-icon-edit-outline" @click="edit(item)"></i>
<i class="el-icon-delete" @click="del(item)"></i>
</span>
</div>
<el-switch v-model="item.open" :active-value="0" :inactive-value="1" @change="switchOff($event, item)"></el-switch>
</div>
<ul class="detail">
<li>
<p class="name">修复</p>
<div class="val">测试测试测试测试测试测试</div>
</li>
</ul>
</el-timeline-item>
</el-timeline>
</div>
<el-timeline class="timeline">
<el-timeline-item placement="top" v-for="(item, i) in listData" :key="i">
<p class="sign" :id="'ver' + i">{{ item.updateTime }}</p>
<div class="ver">
<div>
{{ platformName + item.versionName }}
<span class="action">
<i class="el-icon-edit-outline" @click="edit(item)"></i>
<i class="el-icon-delete" @click="del(item)"></i>
</span>
</div>
<el-switch v-model="item.open" :active-value="0" :inactive-value="1" @change="switchOff($event, item)"></el-switch>
</div>
<ul class="detail">
<li>
<p class="name">修复</p>
<div class="val">测试测试测试测试测试测试</div>
</li>
</ul>
</el-timeline-item>
</el-timeline>
</div>
</template>
@ -127,9 +137,6 @@ export default {
h6 {
font-size: 18px;
}
.filter {
margin-left: 100px;
}
}
.timeline {
margin-left: 20%;

Loading…
Cancel
Save