模型、日志联调

dev_2022-03-03
yujialong 3 years ago
parent 2c6fe60b1d
commit b04fa6a44b
  1. 4
      src/views/order/AddOrder.vue
  2. 19
      src/views/serve/backstage/model.vue
  3. 7
      src/views/serve/backstage/modelType.vue
  4. 3
      src/views/serve/backstage/sourceType.vue
  5. 89
      src/views/system/addLog.vue
  6. 6
      src/views/system/log.vue
  7. 49
      src/views/system/manageLog.vue

@ -300,7 +300,7 @@
<span v-if="scope.row.startTime"><span v-if='scope.row.endTime'> - </span>{{ scope.row.endTime }}</span></p> <span v-if="scope.row.startTime"><span v-if='scope.row.endTime'> - </span>{{ scope.row.endTime }}</span></p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="剩余期限" align="center" min-width="65"> <el-table-column label="剩余期限" align="center" min-width="70">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input disabled v-model="scope.row.remainingPeriod" placeholder="" <el-input disabled v-model="scope.row.remainingPeriod" placeholder=""
@ -1361,7 +1361,7 @@ export default {
let optionsData = '' let optionsData = ''
if(e > 0){ if(e > 0){
if (options == 1){ if (options == 1){
optionsData = e*30*24*60*60*1000 optionsData = e === '12' ? 31536000000 : e*30*24*60*60*1000
}else if(options == 2){ }else if(options == 2){
optionsData = e*365*24*60*60*1000 optionsData = e*365*24*60*60*1000
}else{ }else{

@ -105,6 +105,15 @@ export default {
// //
add() { add() {
this.modelVisible = true this.modelVisible = true
const categoryId = this.$refs.tree.$refs.tree.getCurrentKey() //
//
this.$post(this.api.referenceDemoList, {
pageNum: 1,
pageSize: 10000,
categoryId
}).then(res => {
const modelList = res.data.records
// //
this.$post(this.api.sourceModelClassification).then(res => { this.$post(this.api.sourceModelClassification).then(res => {
const { data } = res const { data } = res
@ -113,16 +122,22 @@ export default {
list.map(e => { list.map(e => {
// promise // promise
promises.push(new Promise((resolve,reject) => { promises.push(new Promise((resolve,reject) => {
//
this.$post(this.api.sysModelDemoList, { this.$post(this.api.sysModelDemoList, {
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
categoryId: e.id categoryId: e.id
}).then(res => { }).then(res => {
const { records } = res.data const { records } = res.data
const modelChildren = []
// copyIdid
records.map(n => { records.map(n => {
if (!modelList.find(e => e.copyId === n.id)) {
n.categoryName = n.modelName n.categoryName = n.modelName
modelChildren.push(n)
}
}) })
e.children = [...e.children, ...records] e.children = [...e.children, ...modelChildren]
// console.log(11, e) // console.log(11, e)
resolve() resolve()
}).catch(res => { }).catch(res => {
@ -139,6 +154,8 @@ export default {
this.modelData = data this.modelData = data
}).catch(res => {}) }).catch(res => {})
}).catch(res => {}) }).catch(res => {})
}).catch(res => {})
}, },
// //
show(row) { show(row) {

@ -119,7 +119,7 @@ export default {
// //
async addData(id) { async addData(id) {
// //
this.$post(this.api.sourceModelClassification).then((res) => { this.$post(this.api.sourceModelClassification).then(res => {
const { data } = res const { data } = res
const systemId = this.systemId const systemId = this.systemId
const promises = [] const promises = []
@ -149,7 +149,7 @@ export default {
records = records.filter(e => e.postStatus && !e.isOpen) // records = records.filter(e => e.postStatus && !e.isOpen) //
if (records.length) { if (records.length) {
const modelData = [] const modelData = []
// //
records.map(e => { records.map(e => {
modelData.push({ modelData.push({
systemId, systemId,
@ -199,6 +199,7 @@ export default {
// //
editType(data) { editType(data) {
this.Form.id = data.id this.Form.id = data.id
this.Form.parentId = data ? data.parentId : 0
this.Form.categoryName = data.categoryName this.Form.categoryName = data.categoryName
this.typeVisible = true this.typeVisible = true
}, },
@ -209,6 +210,7 @@ export default {
const form = this.Form const form = this.Form
const data = { const data = {
id: form.id, id: form.id,
parentId: form.parentId,
categoryName: form.categoryName, categoryName: form.categoryName,
systemId: this.systemId systemId: this.systemId
} }
@ -220,7 +222,6 @@ export default {
}).catch(res => {}) }).catch(res => {})
} else { } else {
data.level = form.level data.level = form.level
data.parentId = form.parentId
this.$post(this.api.saveReferenceCategory, data).then(res => { this.$post(this.api.saveReferenceCategory, data).then(res => {
this.$message.success("添加成功") this.$message.success("添加成功")
this.typeVisible = false this.typeVisible = false

@ -100,6 +100,7 @@ export default {
// //
editType(data) { editType(data) {
this.Form.id = data.id this.Form.id = data.id
this.Form.parentId = data ? data.parentId : 0
this.Form.categoryName = data.categoryName this.Form.categoryName = data.categoryName
this.typeVisible = true this.typeVisible = true
}, },
@ -110,6 +111,7 @@ export default {
const form = this.Form const form = this.Form
const data = { const data = {
id: form.id, id: form.id,
parentId: form.parentId,
categoryName: form.categoryName, categoryName: form.categoryName,
systemId: this.systemId systemId: this.systemId
} }
@ -121,7 +123,6 @@ export default {
}).catch(res => {}) }).catch(res => {})
} else { } else {
data.level = form.level data.level = form.level
data.parentId = form.parentId
this.$post(this.api.categorySave, data).then(res => { this.$post(this.api.categorySave, data).then(res => {
this.$message.success("添加成功") this.$message.success("添加成功")
this.typeVisible = false this.typeVisible = false

@ -7,15 +7,15 @@
<span class="per_back">返回</span> <span class="per_back">返回</span>
<span class="per_school" v-text="id ? '编辑更新日志' : '新增更新日志'"></span> <span class="per_school" v-text="id ? '编辑更新日志' : '新增更新日志'"></span>
</div> </div>
<div v-if="!isDetail"> <div>
<el-button type="primary" round v-preventReClick @click="submit(0)">发布</el-button> <el-button type="primary" round v-preventReClick @click="submit(0)">发布</el-button>
<el-button v-if="!postStatus" type="primary" round v-preventReClick @click="submit(1)">草稿</el-button> <el-button v-if="draft || !id" type="primary" round v-preventReClick @click="submit(1)">草稿</el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover"> <el-card shadow="hover">
<el-form ref="form" label-width="120px" :disabled="isDetail"> <el-form ref="form" label-width="120px">
<el-form-item label="版本标题"> <el-form-item label="版本标题">
<el-input placeholder="请输入版本标题" v-model="form.versionName" maxlength="30" style="width: 400px"></el-input> <el-input placeholder="请输入版本标题" v-model="form.versionName" maxlength="30" style="width: 400px"></el-input>
</el-form-item> </el-form-item>
@ -42,26 +42,26 @@
</el-form-item> </el-form-item>
<el-form-item label="更新内容"> <el-form-item label="更新内容">
<ul class="contents"> <ul class="contents">
<li v-for="(item, i) in form.content" :key="i"> <li v-for="(item, i) in form.logContents" :key="i">
<div class="action"> <div class="action">
<el-select v-model="value" size="small" placeholder="请选择版本"> <el-select v-model="item.type" size="small" placeholder="请选择">
<el-option <el-option
v-for="item in vers" v-for="item in funcList"
:key="item.value" :key="item.id"
:label="item.label" :label="item.name"
:value="item.value"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
<div class="btns"> <div class="btns">
<i v-if="i === form.content.length - 1" class="el-icon-circle-plus-outline" @click="add"></i> <i v-if="i === form.logContents.length - 1" class="el-icon-circle-plus-outline" @click="add"></i>
<i class="el-icon-delete" @click="del"></i> <i class="el-icon-delete" @click="del(i)"></i>
</div> </div>
</div> </div>
<el-input <el-input
type="textarea" type="textarea"
:rows="5" :rows="5"
placeholder="请输入" placeholder="请输入"
v-model="textarea"> v-model="item.content">
</el-input> </el-input>
</li> </li>
</ul> </ul>
@ -76,15 +76,38 @@ export default {
data() { data() {
return { return {
id : this.$route.query.id, id : this.$route.query.id,
platformId: this.$route.query.platformId,
draft : this.$route.query.draft === '1',
headers: {
token: sessionStorage.getItem("token")
},
funcList: [
{
id: 0,
name: '新功能'
},
{
id: 1,
name: '修复'
},
{
id: 2,
name: '优化'
}
],
form: { form: {
versionName: '', versionName: '',
coverUrl: '', coverUrl: '',
content: [{}] logContents: []
},
originContent: {
type: '',
content: ''
} }
}; };
}, },
mounted() { mounted() {
this.id && this.getData() this.id ? this.getData() : this.form.logContents.push(JSON.parse(JSON.stringify(this.originContent)))
}, },
methods: { methods: {
// //
@ -93,27 +116,53 @@ export default {
const { log } = res const { log } = res
this.form.versionName = log.versionName this.form.versionName = log.versionName
this.form.coverUrl = log.coverUrl this.form.coverUrl = log.coverUrl
this.form.logContents = log.logContents.length ? log.logContents : [JSON.parse(JSON.stringify(this.originContent))]
}).catch(res => {}) }).catch(res => {})
}, },
// //
add() { add() {
this.form.content.push({}) this.form.logContents.push(JSON.parse(JSON.stringify(this.originContent)))
}, },
// //
del() { del(i) {
this.form.logContents.splice(i, 1)
},
handleExceed(files, fileList) { //
util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!");
},
uploadSuccess(res, file, fileList) {
this.form.coverUrl = res.data.filesResult.fileUrl
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = ''
}).catch(res => {});
}, },
// //
submit(draft){ submit(draft){
const { versionName, coverUrl } = this.form const { versionName, logContents } = this.form
const id = this.id const id = this.id
if (!versionName) return this.$message.error('请输入版本标题') if (!versionName) return this.$message.error('请输入版本标题')
if (!coverUrl) return this.$message.error('请输入更新内容') if (!logContents.length || !logContents.find(e => e.type !== '' && e.content)) return this.$message.error('请输入更新内容')
const data = { const data = {
platformId: this.platformId,
versionName, versionName,
coverUrl, coverUrl: this.form.coverUrl,
logContents,
draft draft
} }
debugger
if (id) { if (id) {
data.logId = id data.logId = id
this.$post(this.api.listUpdate, data).then(res => { this.$post(this.api.listUpdate, data).then(res => {

@ -13,7 +13,7 @@
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="roleName" label="平台名称" align="center" min-width="250" show-overflow-tooltip> <el-table-column prop="roleName" label="平台名称" align="center" min-width="250" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
{{ platformList.find(e => e.id === scope.row.platformId).name }} {{ platformList.find(e => e.id === scope.row.platformId) && platformList.find(e => e.id === scope.row.platformId).name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="versionName" label="最新版本名称" align="center"></el-table-column> <el-table-column prop="versionName" label="最新版本名称" align="center"></el-table-column>
@ -49,9 +49,7 @@ export default {
roleName: "", roleName: "",
remark: "" remark: ""
}, },
listData: [ listData: [],
{}
],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0 total: 0

@ -5,12 +5,12 @@
<h6>日志更新</h6> <h6>日志更新</h6>
<div class="filter"> <div class="filter">
<label>版本查询</label> <label>版本查询</label>
<el-select v-model="versionName" size="small" placeholder="请选择版本"> <el-select v-model="versionName" size="small" placeholder="请选择版本" filterable @change="verChange">
<el-option <el-option
v-for="item in vers" v-for="item in vers"
:key="item.value" :key="item.id"
:label="item.label" :label="item.name"
:value="item.value"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@ -21,16 +21,16 @@
</div> </div>
<el-timeline class="timeline"> <el-timeline class="timeline">
<el-timeline-item placement="top" v-for="(item, i) in listData" :key="i"> <el-timeline-item placement="top" v-for="(item, i) in listData" :key="i">
<p class="sign">{{ item.updateTime }}</p> <p class="sign" :id="'ver' + i">{{ item.updateTime }}</p>
<div class="ver"> <div class="ver">
<div> <div>
{{ platformList.find(e => e.id === item.platformId).name + item.versionName }} {{ platformName + item.versionName }}
<span class="action"> <span class="action">
<i class="el-icon-edit-outline" @click="edit(item)"></i> <i class="el-icon-edit-outline" @click="edit(item)"></i>
<i class="el-icon-delete" @click="del(item)"></i> <i class="el-icon-delete" @click="del(item)"></i>
</span> </span>
</div> </div>
<el-switch v-model="frontShow" :active-value="0" :inactive-value="1"></el-switch> <el-switch v-model="item.open" :active-value="0" :inactive-value="1" @change="switchOff($event, item)"></el-switch>
</div> </div>
<ul class="detail"> <ul class="detail">
<li> <li>
@ -49,7 +49,7 @@ export default {
data() { data() {
return { return {
platformId: this.$route.query.platformId, platformId: this.$route.query.platformId,
platformList: Setting.platformList, platformName: '',
versionName: '', versionName: '',
vers: [], vers: [],
listData: [] listData: []
@ -59,18 +59,32 @@ export default {
this.getData() this.getData()
}, },
methods: { methods: {
//
getData() { getData() {
this.$get(`${this.api.platformLogList}?platformId=${this.platformId}&versionName=${this.versionName}`).then(res => { this.$get(`${this.api.platformLogList}?platformId=${this.platformId}&versionName=${this.versionName}`).then(res => {
this.listData = res.logList const { logList } = res
if (logList.length) {
const vers = []
const platformName = Setting.platformList.find(e => e.id === logList[0].platformId).name
this.platformName = platformName
this.listData = logList
logList.map((e, i) => {
vers.push({
id: i,
name: e.versionName
})
})
this.vers = vers
}
}).catch(res => {}) }).catch(res => {})
}, },
// //
add() { add() {
this.$router.push(`/addLog`) this.$router.push(`/addLog?platformId=${this.platformId}`)
}, },
// //
edit(item) { edit(item) {
this.$router.push(`/addLog?id=${item.logId}`) this.$router.push(`/addLog?platformId=${this.platformId}&id=${item.logId}&draft=${item.draft}`)
}, },
// //
del(item) { del(item) {
@ -82,6 +96,19 @@ export default {
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}).catch(() => {}) }).catch(() => {})
},
//
switchOff(val, row) {
this.$post(this.api.listUpdate, {
logId: row.logId,
open: val
}).then(res => {
this.$message.success(val ? '禁用成功' : '启用成功')
}).catch(res => {})
},
//
verChange(i) {
document.querySelector(`#ver${i}`).scrollIntoView()
} }
} }
}; };

Loading…
Cancel
Save