插件模型的版本

master
shenhan000 2025-06-13 14:46:14 +08:00
parent bd2eaf50ad
commit f041847b68
4 changed files with 388 additions and 5 deletions

View File

@ -0,0 +1,33 @@
import request from '@/utils/request'
export function getVersionList(data) {
return request({
url: '/ComfyUi/selectList',
method: 'get',
data: data
})
}
export function addVersion(data) {
return request({
url: '/ComfyUi/selectInsert',
method: 'post',
data: data
})
}
export function deleteVersion(data) {
return request({
url: '/ComfyUi/selectDelete',
method: 'get',
params: data
})
}
export function updateVersion(data) {
return request({
url: '/ComfyUi/selectUpdate',
method: 'post',
data: data
})
}

View File

@ -397,7 +397,7 @@ export default {
});
},
shwoEdite(row) {
this.editForm = row;
this.editForm = JSON.parse(JSON.stringify(row))
this.$nextTick(()=>{
this.editOpen = true;
})

View File

@ -0,0 +1,352 @@
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>发布新版本</el-button
>
</el-col>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
</el-row>
<el-table ref="tables" v-loading="loading" :data="list">
<el-table-column
label="发布时间"
align="center"
prop="createTime"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="更新内容"
align="center"
prop="remark"
:show-overflow-tooltip="true"
/>
<el-table-column
label="文件地址"
align="center"
prop="filePath"
:show-overflow-tooltip="true"
/>
<el-table-column
label="文件名"
align="center"
prop="fileName"
:show-overflow-tooltip="true"
/>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="handleDelete(scope.row)"></el-button>
<el-button type="text" size="mini" @click="handleEdit(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNumber"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 发布新版本 -->
<el-dialog title="发布新版本" :visible.sync="openAdd" width="600px" append-to-body>
<el-form ref="form" :model="form" label-width="120px">
<el-row>
<el-col :span="24">
<div class="upload-container" v-loading="uploadLoading" element-loading-text="上传中...">
<el-upload
multiple
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:limit="limit"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-success="handleUploadSuccess"
:show-file-list="false"
:headers="headers"
class="upload-file-uploader"
ref="fileUpload"
>
<!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button>
</el-upload>
</div>
<div style="margin-bottom: 10px;color: #f56c6c">
{{form.filePath}}
</div>
<el-form-item label="描述" required>
<el-input
v-model="form.remark"
type="input"
placeholder="请输入描述"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="onAdd"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 编辑版本 -->
<el-dialog title="修改版本" :visible.sync="openEdit" width="600px" append-to-body>
<el-form ref="editForm" :model="editForm" label-width="120px">
<el-row>
<el-col :span="24">
<div class="upload-container" v-loading="uploadLoading" element-loading-text="上传中...">
<el-upload
multiple
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:limit="limit"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-success="handleEditUploadSuccess"
:show-file-list="false"
:headers="headers"
class="upload-file-uploader"
ref="editFileUpload"
>
<!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button>
</el-upload>
</div>
<div style="margin-bottom: 10px;color: #f56c6c">
{{editForm.filePath}}
</div>
<el-form-item label="描述" required>
<el-input
v-model="editForm.remark"
type="input"
placeholder="请输入描述"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="onEdit"> </el-button>
<el-button @click="cancelEdit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getToken } from "@/utils/auth";
import {
getVersionList,
addVersion,
updateVersion,
deleteVersion
} from "@/api/pluginVersion/index";
export default {
name: "report",
data() {
return {
openEdit: false,
editForm: {},
uploadLoading: false,
openAdd: false,
uploadFileUrl: process.env.VUE_APP_BASE_API + '/file/fileUpload',
fileList: '',
limit: 1,
fileSize: 10,
fileType: ['exe'],
showTip: false,
headers: {
Authorization: 'Bearer ' + getToken(),
},
open: false,
form: {
remark: '',
filePath: ''
},
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
selectName: "",
//
showSearch: true,
//
total: 0,
//
list: [],
//
dateRange: [],
//
defaultSort: { prop: "loginTime", order: "descending" },
//
queryParams: {
pageNumber: 1,
pageSize: 10,
ipaddr: undefined,
userName: undefined,
status: undefined,
},
};
},
created() {
this.getList();
},
methods: {
handleEdit(row){
this.openEdit = true
this.editForm = JSON.parse(JSON.stringify(row))
},
onEdit(){
updateVersion(this.addDateRange(this.editForm)).then((response) => {
this.openEdit = false
this.$modal.msgSuccess("编辑成功");
this.getList();
});
},
cancelEdit(){
this.openEdit = false
},
handleEditUploadSuccess(response, file, fileList) {
this.editForm.filePath = response.data.path
this.editForm.fileName = file.fileName
this.uploadLoading = false;
this.$message.success('上传成功');
this.$refs.editFileUpload.clearFiles(); //
},
handleBeforeUpload(file) {
console.log('file1',file);
this.uploadLoading = true; // loading
return true; // true
},
handleUploadSuccess(response, file, fileList) {
this.form.filePath = response.data.path
this.form.fileName = file.fileName
this.uploadLoading = false;
this.$message.success('上传成功');
this.$refs.fileUpload.clearFiles(); //
},
handleUploadError(error, file, fileList) {
console.log('error3',error);
console.log('file3',file);
console.log('fileList3',fileList);
this.uploadLoading = false;
this.$message.error('上传失败,请重新上传');
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
},
cancel(){
this.form = {
versionNumber: '',
remark: '',
isBug: '',
path: ''
}
this.openAdd = false
},
handleUpdateStatus(row, status){
this.form.productId = row.productId
this.form.type = row.type
this.form.status = status
if(status === 1){
this.open = true
}else{
updateStatus(this.addDateRange(this.form)).then((response) => {
this.$modal.msgSuccess("已通过");
this.getList();
});
}
},
//
onAdd(){
addVersion(this.addDateRange(this.form)).then((response) => {
this.$modal.msgSuccess("发布成功");
this.getList();
this.cancel()
});
},
/** 查询登录日志列表 */
getList() {
this.loading = true;
getVersionList(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
this.list = response.data;
this.loading = false;
}).catch(() => {
this.loading = false;
this.list = [];
});
},
/** 搜索按钮操作 */
// handleQuery() {
// this.queryParams.pageNumber = 1;
// this.getList();
// },
/** 重置按钮操作 */
// resetQuery() {
// this.dateRange = [];
// this.resetForm("queryForm");
// this.queryParams.pageNumber = 1;
// this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
// },
/** 排序触发事件 */
handleSortChange(column, prop, order) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm("是否确认删除?")
.then(function () {
return deleteVersion({id:row.id});
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 新增发布 */
handleAdd() {
this.openAdd = true
},
},
};
</script>
<style lang="scss" scoped>
.upload-container {
position: relative;
min-height: 50px;
display: flex;
align-items: center;
justify-content: center;
}
.upload-file-uploader {
display: flex;
}
:deep(.el-loading-mask) {
background-color: rgba(255, 255, 255, 0.8);
}
</style>

View File

@ -38,10 +38,8 @@ module.exports = {
[process.env.VUE_APP_BASE_API]: {
// target: `http://1.13.246.108:8080`,
// target: 'http://113.45.190.154:8080', // 线上
// target: 'http://192.168.2.34:8080', // 代
target: 'http://192.168.2.21:8080', // 嗨
// target:'https://1e312ae8.r27.cpolar.top', // 嗨
// target: 'https://2d1a399f.r27.cpolar.top', // 嗨
target: 'http://192.168.2.34:8080', // 代
// target: 'http://192.168.2.21:8080', // 嗨
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''