新版小程序打包

This commit is contained in:
aixianling
2022-12-23 18:02:29 +08:00
parent e270cb25ee
commit 9ca1f09fc5
2 changed files with 24 additions and 13 deletions

View File

@@ -4,9 +4,9 @@
<ai-title slot="title" title="小程序部署发布" isShowBottomBorder/> <ai-title slot="title" title="小程序部署发布" isShowBottomBorder/>
<template #content> <template #content>
<ai-search-bar> <ai-search-bar>
<!-- <template #left>--> <template #left>
<!-- <el-button type="primary" icon="iconfont iconAdd" @click="dialog=true">增加</el-button>--> <el-button type="primary" @click="handleSyncData">同步数据</el-button>
<!-- </template>--> </template>
<template #right> <template #right>
<el-input size="small" placeholder="搜索项目/系统/appId/上传版本" v-model="search.name" clearable <el-input size="small" placeholder="搜索项目/系统/appId/上传版本" v-model="search.name" clearable
@change="page.current=1,getTableData()"/> @change="page.current=1,getTableData()"/>
@@ -17,7 +17,7 @@
<el-table-column type="expand" slot="expand"> <el-table-column type="expand" slot="expand">
<template slot-scope="{row}"> <template slot-scope="{row}">
<ai-wrapper> <ai-wrapper>
<ai-info-item labelWidth="200px" v-for="op in desConfigs" :key="op.prop" :value="row[op.prop]" <ai-info-item labelWidth="200px" v-for="op in desConfigs" :key="op.prop" :value="row.dvcpConfig[op.prop]"
v-bind="op"/> v-bind="op"/>
</ai-wrapper> </ai-wrapper>
</template> </template>
@@ -43,10 +43,11 @@
<ai-dialog :visible.sync="dialog" title="部署设置" width="600px" @close="form={}" @onConfirm="submit"> <ai-dialog :visible.sync="dialog" title="部署设置" width="600px" @close="form={}" @onConfirm="submit">
<el-form ref="DialogForm" :model="form" size="small" label-width="120px" :rules="rules"> <el-form ref="DialogForm" :model="form" size="small" label-width="120px" :rules="rules">
<el-form-item label="项目/系统" prop="name"> <el-form-item label="项目/系统" prop="name">
{{ form.name }}(appid:<b v-text="form.miniapp_appid"/>) {{ form.name }}(appid:<b v-text="form.appid"/>)
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> <el-form-item label="版本号" prop="version">
<ai-select v-model="form.version" :instance="instance" action="/node/custom/list?type=mp" :prop="{label:'name'}"/> <ai-select v-model="form.version" :instance="instance" action="/node/custom/list?type=mp" :prop="{label:'name'}"
@select="v=>form.versionName=v.name"/>
</el-form-item> </el-form-item>
<el-form-item label="小程序上传私钥" prop="privateKey"> <el-form-item label="小程序上传私钥" prop="privateKey">
<el-input v-model="form.privateKey" clearable placeholder="请输入"/> <el-input v-model="form.privateKey" clearable placeholder="请输入"/>
@@ -102,8 +103,8 @@ export default {
colConfigs: [ colConfigs: [
{slot: "expand"}, {slot: "expand"},
{label: "项目/系统名称", prop: "name", width: 300}, {label: "项目/系统名称", prop: "name", width: 300},
{label: "appId", prop: "miniapp_appid", width: 180}, {label: "appId", prop: "appid", width: 180},
{label: "管理后台", prop: "web_url"}, {label: "管理后台", prop: "webUrl"},
{label: "上传版本", render: (h, {row}) => h('p', row.versionName || row.version)}, {label: "上传版本", render: (h, {row}) => h('p', row.versionName || row.version)},
{slot: "process"}, {slot: "process"},
{slot: "options"} {slot: "options"}
@@ -119,20 +120,26 @@ export default {
} }
}, },
methods: { methods: {
handleSyncData() {
this.instance.post("/node/wxmp/sync").then(this.getTableData)
},
getTableData() { getTableData() {
this.instance.post("/node/wxmp/list", null, { this.instance.post("/node/wxmp/list", null, {
params: {...this.page, ...this.search} params: {...this.page, ...this.search}
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
this.tableData = res.data?.records.map(e => ({...e, count: 0})) this.tableData = res.data?.records.map(e => {
e.dvcpConfig = JSON.parse(e.dvcpConfig)
return {...e, count: 0}
})
this.page.total = res.data.total this.page.total = res.data.total
} }
}) })
}, },
handleDownload(row) { handleDownload(row) {
let {appid, pid} = row let {id} = row
this.instance.post("/node/wxmp/download", null, { this.instance.post("/node/wxmp/download", null, {
params: {appid, pid}, params: {id},
responseType: "blob" responseType: "blob"
}).then(res => { }).then(res => {
if (res?.code == 1) { if (res?.code == 1) {
@@ -150,7 +157,7 @@ export default {
}) })
}, },
handleZip(row) { handleZip(row) {
let {miniapp_appid: appid, version, id} = row let {appid, version, id} = row
if (!version) return this.$message.error("请先维护要上传的版本!") if (!version) return this.$message.error("请先维护要上传的版本!")
appid && this.instance.post("/node/wxmp/getZip", null, { appid && this.instance.post("/node/wxmp/getZip", null, {
params: {appid, id} params: {appid, id}

View File

@@ -37,6 +37,10 @@ export default {
handler(v) { handler(v) {
v && this.isAction && !this.options.toString() && this.getOptions() v && this.isAction && !this.options.toString() && this.getOptions()
} }
},
value(v) {
this.$emit("select", this.isAction ? this.options.find(e => e[this.actionProp.value] == v) :
this.selectList.find(e => e.dictValue == v))
} }
}, },
props: { props: {
@@ -100,7 +104,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep( .ai-select .el-select ){ :deep( .ai-select .el-select ) {
width: 100%; width: 100%;
} }
</style> </style>