第一次发布
This commit is contained in:
405
src/views/system/version/VersionControl.vue
Normal file
405
src/views/system/version/VersionControl.vue
Normal file
@@ -0,0 +1,405 @@
|
||||
<!--
|
||||
版本管理页面
|
||||
create by 骆超
|
||||
2022年3月7日 15点05分
|
||||
-->
|
||||
<template>
|
||||
<div class="version-control table-header table-div el-scrollbar">
|
||||
<ListLayout :table-columns="tableColumns">
|
||||
<div slot="search" class="mt10">
|
||||
<el-form label-width="90px" :inline="true" :model="page" class="search-form">
|
||||
<el-form-item>
|
||||
<el-select v-model="page.params.sysSourceCode" placeholder="请选择系统" clearable>
|
||||
<el-option v-for="(item,index) in clientData" :key="index" :label="item.typeName"
|
||||
:value="item.typeCode"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="page.params.searchType" placeholder="版本类型" clearable>
|
||||
<el-option label="稳定版" value="1"/>
|
||||
<el-option label="开发版" value="0"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="page.params.currentEditionRemark" clearable
|
||||
placeholder="输入更新说明模糊搜索"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row slot="button-group" class="mt5">
|
||||
<el-col :span="16">
|
||||
<!--这里放添加导出等按钮-->
|
||||
<el-button
|
||||
class="button-left"
|
||||
type="success"
|
||||
@click="addVersionInfo"
|
||||
>
|
||||
<svg-icon icon-class="iconduihao"/>
|
||||
新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="searchData"
|
||||
>查询
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="el-icon-refresh"
|
||||
type="info"
|
||||
@click="clearSearchData"
|
||||
>重置
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div slot="table">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
fit
|
||||
:height="tableHeight"
|
||||
stripe
|
||||
>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
/>
|
||||
<template v-for="(item, index) in tableColumns">
|
||||
<el-table-column
|
||||
v-if="item.show"
|
||||
:key="index"
|
||||
:fixed="item.fixed"
|
||||
:align="item.align"
|
||||
header-align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
:min-width="item.minWidth"
|
||||
:width="item.width"
|
||||
:prop="item.prop"
|
||||
:sortable="item.sortable"
|
||||
:label="item.label"
|
||||
:formatter="item.render"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<el-table-column fixed="right" label="操作" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown>
|
||||
<el-button type="text">
|
||||
更多<i class="el-icon-arrow-down el-icon--right"/>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item
|
||||
@click.native="editClick(scope.row)"
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
>
|
||||
<svg-icon icon-class="iconicon-"/>
|
||||
更新版本
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
@click.native="versionRecord(scope.row)"
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
>
|
||||
<svg-icon icon-class="iconrizhi1"/>
|
||||
版本历史
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div slot="page">
|
||||
<el-pagination
|
||||
:current-page="page.currentPage"
|
||||
:page-sizes="[10,15,20,30]"
|
||||
:page-size="page.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="page.totalCount"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</ListLayout>
|
||||
|
||||
|
||||
<el-drawer
|
||||
:size="drawerInfo.width"
|
||||
:title="drawerInfo.title"
|
||||
class="table-detail-drawer"
|
||||
:visible.sync="drawerInfo.show"
|
||||
direction="ltr"
|
||||
>
|
||||
<!-- 新增版本信息 -->
|
||||
<version-form v-if="drawerInfo.show&&drawerInfo.type==='form'"
|
||||
:clientData="clientData"
|
||||
:versionInfo="currentRow"
|
||||
@closeDrawer="closeVersionDrawer"
|
||||
@freshTable="getTableData"/>
|
||||
<!-- 查看版本记录 -->
|
||||
<version-record v-if="drawerInfo.show&&drawerInfo.type==='record'"
|
||||
:version-id="currentRow.id"
|
||||
@closeDrawer="closeVersionDrawer"
|
||||
/>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dictApi from "@/api/dict/oilDicMark.js"
|
||||
import VersionForm from "./VersionForm"
|
||||
import VersionRecord from "./VersionRecord"
|
||||
import versionApi from "@/api/dict/versionControl.js"
|
||||
|
||||
export default {
|
||||
name: "VersionControl",
|
||||
components: {VersionForm, VersionRecord},
|
||||
data() {
|
||||
return {
|
||||
page: {
|
||||
pageSize: 10, // 每页显示条数
|
||||
currentPage: 1, // 默认页
|
||||
params: {}, // 查询参数
|
||||
totalCount: 0, // 总数
|
||||
},
|
||||
drawerInfo: {
|
||||
show: false,
|
||||
type: '',
|
||||
title: '',
|
||||
width: '40%'
|
||||
},
|
||||
currentRow: {},
|
||||
tableData: [],
|
||||
clientData: [],
|
||||
tableColumns: [
|
||||
{
|
||||
prop: 'sysSourceName',
|
||||
align: 'left',
|
||||
label: '系统名称',
|
||||
width: 160,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'sysSourceCode',
|
||||
align: 'left',
|
||||
label: '系统编码',
|
||||
width: 180,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
{
|
||||
align: 'center', label: '版本类型', width: 100, show: true, render: (row, column, cell) => {
|
||||
if (row.editionType === 1) {
|
||||
return '稳定版'
|
||||
} else if (row.editionType === 0) {
|
||||
return '开发版'
|
||||
} else {
|
||||
return '未知'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'currentEdition',
|
||||
align: 'center',
|
||||
label: '当前版本号',
|
||||
width: 100,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'currentEditionTime',
|
||||
align: 'left',
|
||||
label: '当前版本更新时间',
|
||||
width: 140,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'currentEditionRemark',
|
||||
align: 'left',
|
||||
label: '当前版本更新说明',
|
||||
width: 140,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'createUserName',
|
||||
align: 'left',
|
||||
label: '创建人',
|
||||
width: 100,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
if (row.createUserName) {
|
||||
return cell
|
||||
} else {
|
||||
return row.createUser
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
align: 'left',
|
||||
label: '创建时间',
|
||||
width: 100,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'updateUserName',
|
||||
align: 'left',
|
||||
label: '修改人',
|
||||
width: 100,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
if (row.updateUserName) {
|
||||
return cell
|
||||
} else {
|
||||
return row.updateUser
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'updateTime',
|
||||
align: 'left',
|
||||
label: '修改时间',
|
||||
width: 100,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'updateNum', label: '当前更新次数', width: 120, show: true, render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
tableHeight() {
|
||||
return (window.innerHeight - 365);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getClientDictsByType()
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
|
||||
getClientDictsByType() {
|
||||
dictApi.getByType('CLIENT_GROUP').then(res => {
|
||||
if (res.code === 20000) {
|
||||
this.clientData = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getTableData() {
|
||||
console.log("获取列表数据")
|
||||
versionApi.getByPage(this.page).then(res => {
|
||||
if (res.code === 20000) {
|
||||
this.tableData = res.data.list
|
||||
this.page.totalCount = parseInt(res.data.totalCount)
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
pageChange(currentPage) {
|
||||
this.page.currentPage = currentPage
|
||||
this.getTableData()
|
||||
},
|
||||
|
||||
sizeChange(pageSize) {
|
||||
this.page.pageSize = pageSize
|
||||
this.getTableData()
|
||||
},
|
||||
|
||||
editClick(row) {
|
||||
this.currentRow = Object.assign({}, row)
|
||||
this.drawerInfo.show = true
|
||||
this.drawerInfo.title = '编辑版本信息'
|
||||
this.drawerInfo.type = 'form'
|
||||
this.drawerInfo.width = "40%"
|
||||
},
|
||||
|
||||
versionRecord(row) {
|
||||
this.currentRow = Object.assign({}, row)
|
||||
this.drawerInfo.show = true
|
||||
this.drawerInfo.title = '版本历史记录'
|
||||
this.drawerInfo.type = 'record'
|
||||
this.drawerInfo.width = "60%"
|
||||
},
|
||||
|
||||
addVersionInfo() {
|
||||
this.drawerInfo.show = true
|
||||
this.drawerInfo.title = '新增版本信息'
|
||||
this.drawerInfo.type = 'form'
|
||||
this.drawerInfo.width = "40%"
|
||||
this.currentRow = {}
|
||||
},
|
||||
|
||||
closeVersionDrawer() {
|
||||
this.drawerInfo.show = false
|
||||
this.drawerInfo.title = ''
|
||||
this.drawerInfo.type = ''
|
||||
this.drawerInfo.width = "40%"
|
||||
this.currentRow = {}
|
||||
},
|
||||
|
||||
searchData() {
|
||||
this.getTableData()
|
||||
},
|
||||
|
||||
clearSearchData(){
|
||||
this.page.currentPage = 1
|
||||
this.page.params={}
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.version-control {
|
||||
.mt10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.mt5 {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.button-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.button-right {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
296
src/views/system/version/VersionForm.vue
Normal file
296
src/views/system/version/VersionForm.vue
Normal file
@@ -0,0 +1,296 @@
|
||||
<!--
|
||||
版本信息表单页面
|
||||
create by 骆超
|
||||
2022年3月7日 15点32分
|
||||
-->
|
||||
<template>
|
||||
<div class="version-form">
|
||||
<el-form label-width="130px" ref="form" :rules="rules" :inline="true" :model="formData">
|
||||
<el-row>
|
||||
<div class="short-width-area">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="系统名称" prop="sysSourceName">
|
||||
<el-select v-model="formData.sysSourceName" :disabled="disabled" @change="changeSource" placeholder="请选择系统">
|
||||
<el-option v-for="(item,index) in clientData" :key="index" :label="item.typeName"
|
||||
:value="item.typeName"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="系统编码" prop="sysSourceCode">
|
||||
<el-input v-model="formData.sysSourceCode" disabled placeholder="请选择系统"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="版本类型">
|
||||
<el-radio-group v-model="formData.editionType" :disabled="disabled">
|
||||
<el-radio :label="1">稳定版</el-radio>
|
||||
<el-radio :label="0">开发版</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="当前版本号" prop="currentEdition">
|
||||
<el-input v-model="formData.currentEdition" placeholder="版本号,格式为x.x.x"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="当前版本更新时间">
|
||||
<el-date-picker
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
v-model="formData.currentEditionTime"
|
||||
type="datetime"
|
||||
placeholder="请选择日期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="long-width-area">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="当前版本更新说明" class="wd100">
|
||||
<el-input type="textarea" rows="5" v-model="formData.currentEditionRemark"
|
||||
placeholder="请输入更新说明"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="upload-area">
|
||||
<el-col :span="24">
|
||||
<el-form-item v-if="versionInfo&&versionInfo.downloadUrl&&showApp" label="已上传应用">
|
||||
<span class="app-download">
|
||||
<img src="@/assets/img/应用.svg"><br/>
|
||||
<a :href="versionInfo.downloadUrl">{{
|
||||
versionInfo.downloadUrl.substr(versionInfo.downloadUrl.lastIndexOf('/') + 1)
|
||||
}}</a>
|
||||
</span><br/>
|
||||
<el-button class="mt10" @click="showApp=false">重新上传</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item v-else label="应用上传">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
drag
|
||||
:action="updateFileUrl"
|
||||
:on-progress="uploadProgress"
|
||||
:on-error="uploadError"
|
||||
:on-success="uploadSuccess"
|
||||
:data="{'ossKey':'xingyou','pathKey':'appVersion','encrypt':'PUBLIC','noCheckSize':1,'joinName':'-v'+formData.currentEdition}"
|
||||
multiple>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
<span v-if="versionInfo.downloadUrl&&!showApp">
|
||||
<br/>
|
||||
<el-button @click="showApp=true">取消上传</el-button>
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</div>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-col :span="24" class="foot-button">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submitData"
|
||||
>保存
|
||||
</el-button>
|
||||
<el-button @click="closeDrawer">取消</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dictApi from "@/api/dict/oilDicMark.js"
|
||||
import versionApi from "@/api/dict/versionControl.js"
|
||||
|
||||
export default {
|
||||
name: "VersionForm",
|
||||
props: {
|
||||
versionInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
}
|
||||
},
|
||||
clientData:{
|
||||
type:Array,
|
||||
default:[]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showApp: true,
|
||||
uploadStatus:false,
|
||||
disabled:false,
|
||||
formData: {
|
||||
sysSourceName: '', // 系统名称
|
||||
sysSourceCode: '', // 系统编码
|
||||
editionType: 1, // 版本类型 1:稳定版 ;0:开发版
|
||||
currentEdition: '', // 当前版本号,格式为x.x.x
|
||||
currentEditionRemark: '', // 当前版本更新说明
|
||||
currentEditionTime: '', // 当前版本更新时间
|
||||
downloadUrl: '', // 版本下载链接
|
||||
},
|
||||
rules: {
|
||||
sysSourceName: [
|
||||
{ required: true, message: '请选择系统名称', trigger: 'change' }
|
||||
],
|
||||
sysSourceCode: [
|
||||
{ required: true, message: '系统编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
currentEdition: [
|
||||
{ required: true, message: '请输入版本号', trigger: 'blur' },
|
||||
{ pattern: /(^([1-9]\d|[1-9])(.([1-9]\d|\d)){2}$)/g, message: '版本号格式有误' }
|
||||
],
|
||||
},
|
||||
updateFileUrl: process.env.VUE_APP_UPLOAD_URL,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.showApp = true
|
||||
if (this.versionInfo) {
|
||||
this.formData = Object.assign(this.formData, this.versionInfo)
|
||||
if (this.versionInfo.id){
|
||||
this.disabled = true
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitData() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
console.log(valid)
|
||||
if (valid) {
|
||||
if (this.uploadStatus){
|
||||
this.$message.error("文件正在上传中,请等待")
|
||||
return
|
||||
}
|
||||
versionApi.save(this.formData).then(res => {
|
||||
if (res.code === 20000) {
|
||||
this.$message.success("保存成功!")
|
||||
this.$emit("freshTable")
|
||||
this.closeDrawer()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
this.closeDrawer()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
closeDrawer() {
|
||||
this.$emit("closeDrawer")
|
||||
},
|
||||
|
||||
changeSource(value) {
|
||||
let obj = this.clientData.find(f => f.typeName === value)
|
||||
if (obj) {
|
||||
this.formData.sysSourceCode = obj.typeCode
|
||||
}
|
||||
},
|
||||
|
||||
uploadError(res) {
|
||||
this.uploadStatus = false
|
||||
this.$message.error(res)
|
||||
},
|
||||
|
||||
uploadSuccess(res) {
|
||||
this.uploadStatus = false
|
||||
this.formData.downloadUrl = res.data.publicUrl
|
||||
},
|
||||
|
||||
uploadProgress() {
|
||||
this.uploadStatus = true
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.version-form {
|
||||
width: 100%;
|
||||
|
||||
form {
|
||||
padding: 20px;
|
||||
|
||||
.short-width-area {
|
||||
/deep/ .el-form-item__content {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: calc(100% - 130px);
|
||||
|
||||
.el-date-editor {
|
||||
width: calc(100% - 30px);
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .el-select {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: calc(100% - 15px);
|
||||
}
|
||||
}
|
||||
|
||||
.long-width-area {
|
||||
/deep/ .el-form-item {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
vertical-align: top;
|
||||
width: 100%;
|
||||
|
||||
.el-form-item__content {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: calc(100% - 180px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.upload-area {
|
||||
width: 100%;
|
||||
.mt10{
|
||||
margin-top: 10px;
|
||||
}
|
||||
.app-download {
|
||||
//cursor:pointer;
|
||||
img {
|
||||
width: 75px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #06d3f6;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .el-form-item--medium {
|
||||
width: 100%;
|
||||
|
||||
.el-form-item__content {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: calc(100% - 180px);
|
||||
|
||||
.el-upload {
|
||||
width: 100%;
|
||||
|
||||
.el-upload-dragger {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.foot-button {
|
||||
border-top: 1px solid #d9e4e7 !important;
|
||||
text-align: center;
|
||||
bottom: 0px;
|
||||
padding: 30px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.el-radio-group {
|
||||
box-shadow: unset !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
161
src/views/system/version/VersionRecord.vue
Normal file
161
src/views/system/version/VersionRecord.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<!--
|
||||
版本信息表单页面
|
||||
create by 骆超
|
||||
2022年3月9日 16点02分
|
||||
-->
|
||||
<template>
|
||||
<div class="version-record">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
fit
|
||||
:height="tableHeight"
|
||||
stripe
|
||||
>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
/>
|
||||
<template v-for="(item, index) in tableColumns">
|
||||
<el-table-column
|
||||
v-if="item.show"
|
||||
:key="index"
|
||||
:fixed="item.fixed"
|
||||
:align="item.align"
|
||||
header-align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
:min-width="item.minWidth"
|
||||
:width="item.width"
|
||||
:prop="item.prop"
|
||||
:sortable="item.sortable"
|
||||
:label="item.label"
|
||||
:formatter="item.render"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<el-table-column fixed="right" label="操作" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<a v-if="scope.row.downloadUrl" :href="scope.row.downloadUrl">
|
||||
<svg-icon icon-class="icondaoru"/>
|
||||
</a>
|
||||
<span v-else>
|
||||
{{scope.row.downloadUrl}}
|
||||
未上传文件
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import versionRecordApi from '@/api/dict/versionRecord.js'
|
||||
|
||||
export default {
|
||||
name: "VersionRecord",
|
||||
props:{
|
||||
versionId:{
|
||||
type:String,
|
||||
default:''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
tableHeight() {
|
||||
return (window.innerHeight - 165);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTableData()
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
tableData:[],
|
||||
tableColumns:[
|
||||
{
|
||||
prop: 'sysSourceName',
|
||||
align: 'left',
|
||||
label: '系统名称',
|
||||
width: 180,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'currentEdition',
|
||||
align: 'center',
|
||||
label: '版本号',
|
||||
width: 100,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'currentEditionTime',
|
||||
align: 'left',
|
||||
label: '版本更新时间',
|
||||
width: 160,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'currentEditionRemark',
|
||||
align: 'left',
|
||||
label: '版本更新说明',
|
||||
width: 200,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'createUserName',
|
||||
align: 'center',
|
||||
label: '创建人',
|
||||
width: 120,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
if (row.createUserName) {
|
||||
return cell
|
||||
} else {
|
||||
return row.createUser
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
align: 'left',
|
||||
label: '创建时间',
|
||||
width: 160,
|
||||
show: true,
|
||||
render: (row, column, cell) => {
|
||||
return cell
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
getTableData(){
|
||||
versionRecordApi.getAllRecords(this.versionId).then(res=>{
|
||||
if (res.code===20000){
|
||||
this.tableData = res.data
|
||||
}else{
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.version-record{
|
||||
padding: 20px;
|
||||
a{
|
||||
color: #00afff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user