feat: 软件管理
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import {
|
||||
RESULT_CODE_ERROR,
|
||||
RESULT_CODE_SUCCESS,
|
||||
RESULT_MSG_ERROR,
|
||||
} from '@/constants/result-constants';
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
|
||||
@@ -95,6 +99,75 @@ export function uploadNeSoftware(data: FormData) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发文件
|
||||
* @param data 数据对象
|
||||
* @returns object
|
||||
*/
|
||||
export async function sendNeSoftware(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
method: 'post',
|
||||
});
|
||||
// 解析数据
|
||||
if (result.code === RESULT_CODE_SUCCESS && result.data.data) {
|
||||
let rows = result.data.data.affectedRows;
|
||||
if (rows) {
|
||||
delete result.data;
|
||||
return result;
|
||||
} else {
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活文件
|
||||
* @param data 数据对象
|
||||
* @returns object
|
||||
*/
|
||||
export async function runNeSoftware(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
method: 'put',
|
||||
});
|
||||
// 解析数据
|
||||
if (result.code === RESULT_CODE_SUCCESS && result.data.data) {
|
||||
let rows = result.data.data.affectedRows;
|
||||
if (rows) {
|
||||
delete result.data;
|
||||
return result;
|
||||
} else {
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 回退文件
|
||||
* @param data 数据对象
|
||||
* @returns object
|
||||
*/
|
||||
export async function backNeSoftware(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
method: 'patch',
|
||||
});
|
||||
// 解析数据
|
||||
if (result.code === RESULT_CODE_SUCCESS && result.data.data) {
|
||||
let rows = result.data.data.affectedRows;
|
||||
if (rows) {
|
||||
delete result.data;
|
||||
return result;
|
||||
} else {
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询版本列表
|
||||
* @param query 查询参数
|
||||
@@ -102,7 +175,7 @@ export function uploadNeSoftware(data: FormData) {
|
||||
*/
|
||||
export async function listNeVersion(query: Record<string, any>) {
|
||||
let totalSQL = 'select count(id) as total from ne_version ';
|
||||
let rowsSQL = ' select * from ne_version ';
|
||||
let rowsSQL = 'select * from ne_version ';
|
||||
|
||||
// 查询
|
||||
let querySQL = 'where 1=1';
|
||||
|
||||
Reference in New Issue
Block a user