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

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

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

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

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

@ -1,45 +1,55 @@
<template> <template>
<div class="page"> <div>
<div class="tool"> <el-card shadow="hover" class="mgb20">
<div class="filters"> <div class="flex-between">
<h6>日志更新</h6> <div class="per_title" v-preventReClick @click="$router.back()">
<div class="filter"> <i class="el-icon-arrow-left"></i>
<label>版本查询</label> <span class="per_back">返回</span>
<el-select v-model="versionName" size="small" placeholder="请选择版本" filterable @change="verChange"> <span class="per_school">日志更新</span>
<el-option </div>
v-for="item in vers" </div>
:key="item.id" </el-card>
:label="item.name" <div class="page">
:value="item.id"> <div class="tool">
</el-option> <div class="filters">
</el-select> <div class="filter">
</div> <label>版本查询</label>
</div> <el-select v-model="versionName" size="small" placeholder="请选择版本" filterable @change="verChange">
<div> <el-option
<el-button type="primary" @click="add">新增日志</el-button> v-for="item in vers"
</div> :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> </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> </div>
</template> </template>
@ -127,9 +137,6 @@ export default {
h6 { h6 {
font-size: 18px; font-size: 18px;
} }
.filter {
margin-left: 100px;
}
} }
.timeline { .timeline {
margin-left: 20%; margin-left: 20%;

Loading…
Cancel
Save