update:
1. update release-version
This commit is contained in:
@@ -1,63 +1,73 @@
|
||||
import request from '@/axios';
|
||||
|
||||
export const getList = (current, size, params) => {
|
||||
return request({
|
||||
url: '/common/release-version/page',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params,
|
||||
current,
|
||||
size,
|
||||
}
|
||||
})
|
||||
return request({
|
||||
url: '/common/release-version/page',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params,
|
||||
current,
|
||||
size,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const getDetail = (id) => {
|
||||
return request({
|
||||
url: '/common/release-version/detail',
|
||||
method: 'get',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
})
|
||||
return request({
|
||||
url: '/common/release-version/detail',
|
||||
method: 'get',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const remove = (ids) => {
|
||||
return request({
|
||||
url: '/common/release-version/remove',
|
||||
method: 'post',
|
||||
params: {
|
||||
ids,
|
||||
}
|
||||
})
|
||||
return request({
|
||||
url: '/common/release-version/remove',
|
||||
method: 'post',
|
||||
params: {
|
||||
ids,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const add = (row) => {
|
||||
return request({
|
||||
url: '/common/release-version/save',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
return request({
|
||||
url: '/common/release-version/save',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
}
|
||||
|
||||
export const update = (row) => {
|
||||
return request({
|
||||
url: '/common/release-version/submit',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
return request({
|
||||
url: '/common/release-version/submit',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const applyStatus = (id) => {
|
||||
return request({
|
||||
url: '/common/release-version/applyStatus',
|
||||
method: 'post',
|
||||
params: {
|
||||
id,
|
||||
}
|
||||
})
|
||||
export const getDetailList = (params) => {
|
||||
return request({
|
||||
url: '/common/release-version/detail-list',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const fillUrl = (id, value) => {
|
||||
return request({
|
||||
url: '/common/release-version/publish',
|
||||
method: 'post',
|
||||
data: {
|
||||
id: id,
|
||||
downloadUrl: value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -24,103 +24,188 @@
|
||||
|
||||
<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 {
|
||||
data() {
|
||||
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,
|
||||
page: {
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
total: 0
|
||||
},
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: [],
|
||||
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: {
|
||||
...mapGetters(["permission"]),
|
||||
permissionList() {
|
||||
return {
|
||||
form: {},
|
||||
query: {},
|
||||
search: {},
|
||||
loading: true,
|
||||
page: {
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
total: 0
|
||||
},
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: [],
|
||||
versionCode : "",
|
||||
direction : "rtl",
|
||||
addBtn: this.validData(this.permission.commonReleaseversion_add, false),
|
||||
viewBtn: this.validData(this.permission.commonReleaseversion_view, false),
|
||||
delBtn: this.validData(this.permission.commonReleaseversion_delete, false),
|
||||
editBtn: this.validData(this.permission.commonReleaseversion_edit, false)
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["permission"]),
|
||||
permissionList() {
|
||||
return {
|
||||
addBtn: this.validData(this.permission.commonReleaseversion_add, false),
|
||||
viewBtn: this.validData(this.permission.commonReleaseversion_view, false),
|
||||
delBtn: this.validData(this.permission.commonReleaseversion_delete, false),
|
||||
editBtn: this.validData(this.permission.commonReleaseversion_edit, false)
|
||||
};
|
||||
},
|
||||
ids() {
|
||||
let ids = [];
|
||||
this.selectionList.forEach(ele => {
|
||||
ids.push(ele.id);
|
||||
});
|
||||
return ids.join(",");
|
||||
}
|
||||
ids() {
|
||||
let ids = [];
|
||||
this.selectionList.forEach(ele => {
|
||||
ids.push(ele.id);
|
||||
});
|
||||
return ids.join(",");
|
||||
},
|
||||
methods: {
|
||||
rowSave(row, done, loading) {
|
||||
add(row).then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
done();
|
||||
}, error => {
|
||||
loading();
|
||||
window.console.log(error);
|
||||
},
|
||||
methods: {
|
||||
rowSave(row, done, loading) {
|
||||
add(row).then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
},
|
||||
rowUpdate(row, index, done, loading) {
|
||||
update(row).then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
done();
|
||||
}, error => {
|
||||
loading();
|
||||
console.log(error);
|
||||
done();
|
||||
}, error => {
|
||||
loading();
|
||||
window.console.log(error);
|
||||
});
|
||||
},
|
||||
rowUpdate(row, index, done, loading) {
|
||||
update(row).then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
},
|
||||
rowDel(row) {
|
||||
this.$confirm("确定将选择数据删除?", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
done();
|
||||
}, error => {
|
||||
loading();
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
rowDel(row) {
|
||||
this.$confirm("确定将选择数据删除?", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
return remove(row.id);
|
||||
})
|
||||
@@ -131,17 +216,73 @@ import {
|
||||
message: "操作成功!"
|
||||
});
|
||||
});
|
||||
},
|
||||
handleDelete() {
|
||||
if (this.selectionList.length === 0) {
|
||||
this.$message.warning("请选择至少一条数据");
|
||||
},
|
||||
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;
|
||||
}
|
||||
this.$confirm("确定将选择数据删除?", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
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("请选择至少一条数据");
|
||||
return;
|
||||
}
|
||||
this.$confirm("确定将选择数据删除?", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
return remove(this.ids);
|
||||
})
|
||||
@@ -153,81 +294,74 @@ import {
|
||||
});
|
||||
this.$refs.crud.toggleSelection();
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
let downloadUrl = `/common/release-version/commonReleaseversion/export-commonReleaseversion?${this.website.tokenHeader}=${getToken()}`;
|
||||
const {
|
||||
} = this.query;
|
||||
let values = {
|
||||
};
|
||||
this.$confirm("是否导出数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
NProgress.start();
|
||||
exportBlob(downloadUrl, values).then(res => {
|
||||
downloadXls(res.data, `APP版本发布管理${dateNow()}.xlsx`);
|
||||
NProgress.done();
|
||||
})
|
||||
},
|
||||
handleExport() {
|
||||
let downloadUrl = `/common/release-version/commonReleaseversion/export-commonReleaseversion?${this.website.tokenHeader}=${getToken()}`;
|
||||
const {} = this.query;
|
||||
let values = {};
|
||||
this.$confirm("是否导出数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
NProgress.start();
|
||||
exportBlob(downloadUrl, values).then(res => {
|
||||
downloadXls(res.data, `APP版本发布管理${dateNow()}.xlsx`);
|
||||
NProgress.done();
|
||||
})
|
||||
});
|
||||
},
|
||||
beforeOpen(done, type) {
|
||||
if (["edit", "view"].includes(type)) {
|
||||
getDetail(this.form.id).then(res => {
|
||||
this.form = res.data.data;
|
||||
});
|
||||
},
|
||||
beforeOpen(done, type) {
|
||||
if (["edit", "view"].includes(type)) {
|
||||
getDetail(this.form.id).then(res => {
|
||||
this.form = res.data.data;
|
||||
});
|
||||
}
|
||||
done();
|
||||
},
|
||||
searchReset() {
|
||||
this.query = {};
|
||||
this.onLoad(this.page);
|
||||
},
|
||||
searchChange(params, done) {
|
||||
this.query = params;
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page, params);
|
||||
done();
|
||||
},
|
||||
selectionChange(list) {
|
||||
this.selectionList = list;
|
||||
},
|
||||
selectionClear() {
|
||||
this.selectionList = [];
|
||||
this.$refs.crud.toggleSelection();
|
||||
},
|
||||
currentChange(currentPage){
|
||||
this.page.currentPage = currentPage;
|
||||
},
|
||||
sizeChange(pageSize){
|
||||
this.page.pageSize = pageSize;
|
||||
},
|
||||
refreshChange() {
|
||||
this.onLoad(this.page, this.query);
|
||||
},
|
||||
onLoad(page, params = {}) {
|
||||
this.loading = true;
|
||||
}
|
||||
done();
|
||||
},
|
||||
searchReset() {
|
||||
this.query = {};
|
||||
this.onLoad(this.page);
|
||||
},
|
||||
searchChange(params, done) {
|
||||
this.query = params;
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page, params);
|
||||
done();
|
||||
},
|
||||
selectionChange(list) {
|
||||
this.selectionList = list;
|
||||
},
|
||||
selectionClear() {
|
||||
this.selectionList = [];
|
||||
this.$refs.crud.toggleSelection();
|
||||
},
|
||||
currentChange(currentPage) {
|
||||
this.page.currentPage = currentPage;
|
||||
},
|
||||
sizeChange(pageSize) {
|
||||
this.page.pageSize = pageSize;
|
||||
},
|
||||
refreshChange() {
|
||||
this.onLoad(this.page, this.query);
|
||||
},
|
||||
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;
|
||||
this.page.total = data.total;
|
||||
this.data = data.records;
|
||||
this.loading = false;
|
||||
this.selectionClear();
|
||||
});
|
||||
},
|
||||
openVersionDetail(row){
|
||||
|
||||
},
|
||||
}
|
||||
};
|
||||
getList(page.currentPage, page.pageSize, values).then(res => {
|
||||
const data = res.data.data;
|
||||
this.page.total = data.total;
|
||||
this.data = data.records;
|
||||
this.loading = false;
|
||||
this.selectionClear();
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user