1. update release-version
This commit is contained in:
2026-04-04 14:25:45 +08:00
parent 6aa916e9a4
commit e243f3a86d
3 changed files with 357 additions and 209 deletions

View File

@@ -49,15 +49,25 @@ export const update = (row) => {
}
export const applyStatus = (id) => {
export const getDetailList = (params) => {
return request({
url: '/common/release-version/applyStatus',
method: 'post',
url: '/common/release-version/detail-list',
method: 'get',
params: {
id,
...params,
}
})
}
export const fillUrl = (id, value) => {
return request({
url: '/common/release-version/publish',
method: 'post',
data: {
id: id,
downloadUrl: value
}
})
}

View File

@@ -24,37 +24,54 @@
<template #menu="{ row }">
<el-button type="text"
icon="el-icon-circle-check"
@click.stop="openVersionDetail(row)">
上 架
icon="el-icon-data-analysis"
@click.stop="handleDetailList(row)">
详 情
</el-button>
</template>
</avue-crud>
<el-drawer :title="`[${appTypeText}] [${versionName}] 发布详情`" v-model="detailListVisible" :direction="direction"
append-to-body
:before-close="handleDetailListClose" size="50%">
<basic-container>
<avue-crud :option="optionDetailList"
:data="dataDetailList"
v-model="formDetailList"
:table-loading="loadingDetailList"
ref="crudDetailList"
@refresh-change="refreshChangeDetailList"
@on-load="onLoadDetailList">
<template #menu="{ row }">
<el-button type="text"
icon="el-icon-circle-check"
v-if="row.status === 1"
@click="handleUrl(row)">上 架
</el-button>
</template>
</avue-crud>
</basic-container>
</el-drawer>
</basic-container>
</template>
<script>
import {
getList,
getDetail,
add,
update,
remove,
applyStatus
} from '@/api/common/commonReleaseversion';
import option from "@/option/common/commonReleaseversion";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
import {getToken} from '@/utils/auth';
import {downloadXls} from "@/utils/util";
import {dateNow} from "@/utils/date";
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
export default {
import {add, fillUrl, getDetail, getDetailList, getList, remove, update,} from '@/api/common/commonReleaseversion';
import option from "@/option/common/commonReleaseversion";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
import {getToken} from '@/utils/auth';
import {downloadXls} from "@/utils/util";
import {dateNow} from "@/utils/date";
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
export default {
data() {
return {
form: {},
formDetailList: {},
query: {},
search: {},
loading: true,
@@ -66,8 +83,76 @@ import {
selectionList: [],
option: option,
data: [],
versionCode : "",
direction : "rtl",
versionCode: "",
direction: "rtl",
detailListVisible: false,
versionName: "",
appType: "",
appTypeText: "",
dataDetailList: [],
loadingDetailList: true,
optionDetailList: {
height: 'auto',
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
viewBtn: false,
addBtn: false,
delBtn: false,
editBtn: false,
selection: false,
dialogClickModal: false,
column: [
{
label: "主键",
prop: "id",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "渠道标识",
prop: "channelCode",
type: "radio",
dicUrl: '/blade-system/dict/dictionary?code=release_version_channel_code',
props: {
label: 'dictValue',
value: 'dictKey',
},
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: "更新地址",
prop: "downloadUrl",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
overHidden: true,
},
{
label: "状态",
prop: "status",
type: "radio",
dicUrl: '/blade-system/dict/dictionary?code=release_version_status',
props: {
label: 'dictValue',
value: 'dictKey',
},
dataType: 'number',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
]
}
};
},
computed: {
@@ -86,7 +171,7 @@ import {
ids.push(ele.id);
});
return ids.join(",");
}
},
},
methods: {
rowSave(row, done, loading) {
@@ -132,6 +217,62 @@ import {
});
});
},
handleDetailList(row) {
this.detailListVisible = true;
this.versionName = row.versionName;
this.appType = row.appType;
this.appTypeText = row.appType === "1" ? "亿茶一路" : "硒茶商汇";
this.onLoadDetailList();
},
onLoadDetailList() {
this.loadingDetailList = true;
let values = {
versionName: this.versionName,
appType: this.appType,
};
getDetailList(Object.assign(values)).then(res => {
this.dataDetailList = res.data.data;
this.loadingDetailList = false;
});
},
handleDetailListClose(hide) {
hide();
},
handleUrl(row) {
let defaultUrl = '';
if (this.appType === 1 && row.channelCode === 'pgyer'){
defaultUrl = 'https://www.pgyer.com/yichayilu';
}
if (this.appType === 2 && row.channelCode === 'pgyer'){
defaultUrl = 'https://www.pgyer.com/xichashanghui';
}
this.$prompt('请输入更新链接', '更新链接', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPlaceholder: '请输入更新链接',
inputValue: defaultUrl,
}).then(({ value }) => {
if (value.trim() === '') {
this.$message.warning('更新链接不能为空');
return;
}
fillUrl(row.id, value)
.then(()=>{
this.$message.success('上架成功');
this.onLoadDetailList();
})
.catch((error)=>{
console.error('fillUrl failed:', error);
this.$message.error('上架失败,请重试');
});
}).catch(() => {
this.$message.info('已取消输入');
});
},
refreshChangeDetailList() {
this.onLoadDetailList();
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
@@ -156,10 +297,8 @@ import {
},
handleExport() {
let downloadUrl = `/common/release-version/commonReleaseversion/export-commonReleaseversion?${this.website.tokenHeader}=${getToken()}`;
const {
} = this.query;
let values = {
};
const {} = this.query;
let values = {};
this.$confirm("是否导出数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -197,10 +336,10 @@ import {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
@@ -209,11 +348,9 @@ import {
onLoad(page, params = {}) {
this.loading = true;
const {
} = this.query;
const {} = this.query;
let values = {
};
let values = {};
getList(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
@@ -223,11 +360,8 @@ import {
this.selectionClear();
});
},
openVersionDetail(row){
},
}
};
};
</script>
<style>

View File

@@ -304,14 +304,18 @@ import {getList, getDetail, add, update, remove, confirmPayment, fillExpress} fr
// inputErrorMessage: '快递单号格式不正确'
}).then(({ value }) => {
fillExpress(row.id, value)
// 用户点击“确定”
.then(()=>{
this.$message.success('单号录入成功');
this.onLoad(this.page, this.query);
})
.catch((error)=>{
console.error('fillUrl failed:', error);
this.$message.error('单号录入失败,请重试');
});
console.log('用户输入:', value);
// 在这里处理你的逻辑,比如调用 API
}).catch(() => {
// 用户点击“取消”或关闭弹窗
this.$message.info('已取消输入');
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {