parent
23a215d980
commit
cae0715e7a
@ -0,0 +1,195 @@ |
||||
<template> |
||||
<div class="app-container"> |
||||
<el-form ref="postForm" :model="postForm" label-width="100px" :disabled="!is_edit"> |
||||
<el-row> |
||||
<el-col :span="12"> |
||||
<el-form-item label="Release_ID"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-input :value="postForm.release_id" disabled /> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item label="build版本"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-input v-model="postForm.build_version" /> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item label="app版本"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-input v-model="postForm.app_version" /> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item label="应用大小"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-input v-model="postForm.binary_size" disabled /> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item label="版本类型"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-select v-model="postForm.release_type" class="filter-item" placeholder="Please select" disabled> |
||||
<el-option v-for="item in postForm.release_choices" :key="item.id" :label="item.name" :value="item.id" /> |
||||
</el-select> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item label="创建时间" prop="timestamp"> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="8"> |
||||
<el-date-picker :value="postForm.created_time" type="datetime" disabled /> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item label="更新日志"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-input v-model="postForm.changelog" :autosize="{ minRows: 4, maxRows: 6}" type="textarea" placeholder="Please input" /> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="应用图标" label-width="200px"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-image :src="postForm.icon_url" :preview-src-list="[postForm.icon_url]" fit="contain" style="width: 100px; height: 100px" /> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item label="是否master版本" label-width="200px"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-tooltip :content="postForm.is_master|statusFilter" placement="top"> |
||||
<el-switch |
||||
v-model="postForm.is_master" |
||||
active-color="#13ce66" |
||||
inactive-color="#ff4949" |
||||
:active-value="true" |
||||
:inactive-value="false" |
||||
/> |
||||
</el-tooltip> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item label="企业签名名称" label-width="200px"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-input v-model="postForm.distribution_name" /> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item label="第三方下载URL" label-width="200px"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-input :value="postForm.binary_url" /> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item label="应用可安装的最低系统版本" label-width="200px"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-input v-model="postForm.minimum_os_version" /> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item label="ios内测版 udid" label-width="200px"> |
||||
<el-row :gutter="12"> |
||||
<el-col :span="16"> |
||||
<el-input v-model="postForm.udid" :autosize="{ minRows: 4, maxRows: 6}" type="textarea" disabled /> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form> |
||||
<el-col :span="9" style="float: right"> |
||||
<el-button v-if="!is_edit" type="primary" @click="is_edit=true">修改</el-button> |
||||
<div v-else> |
||||
<el-button type="primary" @click="is_edit=false">取消</el-button> |
||||
<el-button type="primary" @click="updateData">保存修改</el-button> |
||||
</div> |
||||
</el-col> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getAppReleaseInfos, updateReleaseAppInfo } from '@/api/app' |
||||
|
||||
const defaultForm = { |
||||
is_master: undefined, |
||||
udid: undefined, |
||||
distribution_name: undefined, |
||||
release_id: undefined, |
||||
build_version: undefined, |
||||
app_version: undefined, |
||||
release_type: undefined, |
||||
binary_size: undefined, |
||||
icon_url: undefined, |
||||
binary_url: undefined, |
||||
changelog: undefined, |
||||
created_time: undefined, |
||||
release_choices: undefined, |
||||
minimum_os_version: undefined |
||||
} |
||||
|
||||
export default { |
||||
name: 'AppReleaseDetail', |
||||
components: { }, filters: { |
||||
userStatusFilter(status) { |
||||
const statusMap = { |
||||
true: '激活,允许登录', |
||||
false: '禁用,禁止登录' |
||||
} |
||||
return statusMap[status] |
||||
}, |
||||
statusFilter(status) { |
||||
const statusMap = { |
||||
true: '启用,允许配置', |
||||
false: '禁用,禁止配置' |
||||
} |
||||
return statusMap[status] |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
postForm: Object.assign({}, defaultForm), |
||||
loading: false, |
||||
is_edit: false |
||||
} |
||||
}, |
||||
computed: { |
||||
}, |
||||
created() { |
||||
const id = this.$route.params && this.$route.params.id |
||||
const app_id = this.$route.params && this.$route.params.app_id |
||||
this.fetchData(id, app_id) |
||||
}, |
||||
methods: { |
||||
fetchData(id, app_id) { |
||||
getAppReleaseInfos({ id: id, app_id: app_id }).then(response => { |
||||
if (response.data.length === 1) { |
||||
this.postForm = response.data[0] |
||||
} |
||||
}).catch(err => { |
||||
console.log(err) |
||||
}) |
||||
}, |
||||
updateData() { |
||||
updateReleaseAppInfo(this.postForm).then(response => { |
||||
this.$message.success('更新成功') |
||||
this.postForm = response.data |
||||
}).catch(err => { |
||||
console.log(err) |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
@ -0,0 +1,167 @@ |
||||
<template> |
||||
<div class="app-container"> |
||||
<div class="filter-container"> |
||||
<el-input v-model="listQuery.release_id" placeholder="release_id" style="width: 250px;" class="filter-item" clearable @keyup.enter.native="handleFilter" /> |
||||
<el-select v-model="listQuery.sort" style="width: 140px" class="filter-item" @change="handleFilter"> |
||||
<el-option v-for="item in sortOptions" :key="item.key" :label="item.label" :value="item.key" /> |
||||
</el-select> |
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter"> |
||||
Search |
||||
</el-button> |
||||
</div> |
||||
<el-table |
||||
v-loading="listLoading" |
||||
:data="list" |
||||
element-loading-text="Loading" |
||||
border |
||||
fit |
||||
highlight-current-row |
||||
stripe |
||||
> |
||||
<el-table-column align="center" label="ID" width="90"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.id }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="应用图标" align="center" width="130"> |
||||
<template slot-scope="scope"> |
||||
<el-image :src="scope.row.icon_url" :preview-src-list="[scope.row.icon_url]" fit="contain" style="width: 80px; height: 80px" /> |
||||
</template> |
||||
</el-table-column> |
||||
|
||||
<el-table-column label="Release_Id" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span>{{ scope.row.release_id }}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="第三方下载URL" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.binary_url }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="更新日志" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.changelog }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column class-name="status-col" label="Master" width="120" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-tag :type="scope.row.is_master | statusFilter">{{ scope.row.is_master }}</el-tag> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column class-name="status-col" label="版本类型" width="120" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-tag :type="scope.row.release_type | appStatusFilter">{{ scope.row |appStatusNameFilter }}</el-tag> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="应用大小" align="center" width="80"> |
||||
<template slot-scope="scope"> |
||||
<span>{{ scope.row.binary_size }}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column align="center" prop="created_time" label="上传时间" width="180"> |
||||
<template slot-scope="scope"> |
||||
<i class="el-icon-time" /> |
||||
<el-tooltip :content="scope.row.created_time"> |
||||
<span>{{ scope.row.created_time|formatTime }}</span> |
||||
</el-tooltip> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width"> |
||||
<template slot-scope="scope"> |
||||
<router-link :to="{name: 'app_release_info_edit',params:{app_id:listQuery.app_id,id:scope.row.id}}"> |
||||
<el-button type="primary" size="mini"> |
||||
查看编辑 |
||||
</el-button> |
||||
</router-link> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="fetchData" /> |
||||
|
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getAppReleaseInfos } from '@/api/app' |
||||
import Pagination from '@/components/Pagination' // secondary package based on el-pagination |
||||
import waves from '@/directive/waves' // waves directive |
||||
|
||||
const sortOptions = [ |
||||
{ label: '上传时间 Ascending', key: 'created_time' }, |
||||
{ label: '上传时间 Descending', key: '-created_time' }, |
||||
] |
||||
|
||||
export default { |
||||
name: 'AppInfo', |
||||
components: { Pagination }, |
||||
directives: { waves }, |
||||
filters: { |
||||
formatTime(time) { |
||||
return time.replace('T', ' ').split('.')[0] |
||||
}, |
||||
statusFilter(status) { |
||||
const statusMap = { |
||||
true: 'success', |
||||
false: 'danger' |
||||
} |
||||
return statusMap[status] |
||||
}, |
||||
appStatusNameFilter(row) { |
||||
for (const r of row.release_choices) { |
||||
if (r.id === row.release_type) { |
||||
return r.name |
||||
} |
||||
} |
||||
}, |
||||
appStatusFilter(status) { |
||||
const statusMap = { |
||||
'0': 'info', |
||||
'1': 'success', |
||||
'2': 'gray', |
||||
'3': 'danger', |
||||
} |
||||
return statusMap[status] |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
list: null, |
||||
listLoading: true, |
||||
total: 0, |
||||
listQuery: { |
||||
page: 1, |
||||
limit: 10, |
||||
app_id: undefined, |
||||
release_id: undefined, |
||||
sort: '-created_time', |
||||
}, |
||||
sortOptions, |
||||
type_choices: [], |
||||
status_choices: [] |
||||
} |
||||
}, |
||||
created() { |
||||
this.listQuery.app_id = this.$route.params && this.$route.params.app_id |
||||
this.fetchData() |
||||
}, |
||||
methods: { |
||||
handleFilter() { |
||||
this.listQuery.page = 1 |
||||
this.fetchData() |
||||
}, |
||||
fetchData() { |
||||
this.listLoading = true |
||||
getAppReleaseInfos(this.listQuery).then(response => { |
||||
this.list = response.data |
||||
if (this.list && this.list.length > 0) { |
||||
this.type_choices = this.list[0].type_choices |
||||
this.status_choices = this.list[0].status_choices |
||||
} |
||||
this.total = response.total |
||||
this.listLoading = false |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
Loading…
Reference in new issue