Compare commits
No commits in common. "36bda7c75b63a339d57f4d5b36f4c199ff8754f8" and "9b21964136d37e62fe819104aeee2eec9c00a644" have entirely different histories.
36bda7c75b
...
9b21964136
|
@ -1,73 +0,0 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
//获取参数列表
|
||||
const paramsList=(data)=>{
|
||||
return request({
|
||||
url: `/tool_chains/params`,
|
||||
method: "get",
|
||||
params:data
|
||||
});
|
||||
}
|
||||
//新增第三方工具链信息
|
||||
const addTool=(data)=>{
|
||||
return request({
|
||||
url: `/tool_chains`,
|
||||
method: "post",
|
||||
data:data
|
||||
});
|
||||
}
|
||||
//获取第三方工具链的详细参数
|
||||
const paramsInfo=(id)=>{
|
||||
return request({
|
||||
url: `/tool_chains/params/${id}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
//获取第三方工具链的工作状态列表
|
||||
const toolStatusList=(data)=>{
|
||||
return request({
|
||||
url: `/tool_chains/status`,
|
||||
method: "get",
|
||||
params:data
|
||||
});
|
||||
}
|
||||
//获取未注册第三方工具链列表
|
||||
const unregistedList=()=>{
|
||||
return request({
|
||||
url: `/tool_chains/unregisted`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
//删除工具链
|
||||
const deleteTool=(id)=>{
|
||||
return request({
|
||||
url: `/tool_chains/${id}`,
|
||||
method: "delete"
|
||||
});
|
||||
}
|
||||
//获取第三方工具链的工作状态列表
|
||||
const toolChains=(id)=>{
|
||||
return request({
|
||||
url: `/tool_chains/${id}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
//修改工具链信息
|
||||
const editTool=(id,data)=>{
|
||||
return request({
|
||||
url: `/tool_chains/${id}`,
|
||||
method: "put",
|
||||
data:data
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
paramsList,
|
||||
addTool,
|
||||
paramsInfo,
|
||||
toolStatusList,
|
||||
unregistedList,
|
||||
deleteTool,
|
||||
toolChains,
|
||||
editTool
|
||||
}
|
|
@ -13,63 +13,36 @@
|
|||
<el-row>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="工具链名称" prop="tool_name">
|
||||
<el-input
|
||||
v-model="baseForm.tool_name"
|
||||
placeholder="请输入工具链名称"
|
||||
/>
|
||||
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入工具链名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="厂商名称" prop="manufacturer">
|
||||
<el-input
|
||||
v-model="baseForm.manufacturer"
|
||||
disabled
|
||||
placeholder="请输入厂商名称"
|
||||
/>
|
||||
<el-form-item label="厂商名称" prop="tool_type_name">
|
||||
<el-input v-model="baseForm.tool_type_name" disabled placeholder="请输入厂商名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="工具链类型" prop="tool_type">
|
||||
<el-select
|
||||
v-model="baseForm.tool_type"
|
||||
disabled
|
||||
placeholder="请选择工具链类型"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in listOpt.typeList"
|
||||
:key="item.type"
|
||||
:label="item.name"
|
||||
:value="item.type"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item label="工具链类型" prop="cmpt_hardware_type">
|
||||
<el-input v-model="baseForm.cmpt_hardware_type" disabled placeholder="请输入工具链类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="ID编号" prop="user_id">
|
||||
<el-input v-model="baseForm.user_id" disabled placeholder="请输入ID编号" />
|
||||
<el-form-item label="ID编号" prop="tool_name">
|
||||
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入ID编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="工具链版本" prop="tool_version">
|
||||
<el-input
|
||||
v-model="baseForm.tool_version"
|
||||
disabled
|
||||
placeholder="请输入工具链版本"
|
||||
/>
|
||||
<el-form-item label="工具链版本" prop="tool_name">
|
||||
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入工具链版本" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="硬件类型" prop="cmpt_hardware_type">
|
||||
<el-input
|
||||
v-model="baseForm.cmpt_hardware_type"
|
||||
disabled
|
||||
placeholder="请输入硬件类型"
|
||||
/>
|
||||
<el-form-item label="硬件类型" prop="tool_name">
|
||||
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入硬件类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -88,11 +61,9 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-row style="padding: 10px 15px">
|
||||
<el-row style="padding: 10px 15px;">
|
||||
<el-col :lg="24" :xs="24">
|
||||
<el-button type="primary" @click="handlePushParams"
|
||||
><i-ep-plus />添加运行参数</el-button
|
||||
>
|
||||
<el-button type="primary" @click="handlePushParams"><i-ep-plus />添加运行参数</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-card v-loading="loading">
|
||||
|
@ -102,45 +73,66 @@
|
|||
style="width: 20px; height: 20px"
|
||||
/>工具链运行参数信息</template
|
||||
>
|
||||
<el-table :data="pageData" style="width: 100%" stripe v-loading="queryLoading">
|
||||
<el-table-column prop="params_name" label="运行参数名称" align="left" />
|
||||
<el-table-column prop="params_desc" label="运行参数描述" align="left" />
|
||||
<el-table-column prop="params_desc1" label="匹配模型网络名称" align="left" />
|
||||
<el-table-column prop="user_name" label="创建用户" align="left" />
|
||||
<el-table-column prop="create_time" label="创建时间" align="left" />
|
||||
<el-table-column label="操作" fixed="right" align="center">
|
||||
<template #default="scope">
|
||||
<el-button text type="primary" size="small" @click="handleDetail(scope.row)"
|
||||
><i-ep-view />查看</el-button
|
||||
>
|
||||
<el-button text type="primary" size="small" @click="handleDelete(scope.row)"
|
||||
><i-ep-delete />删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-if="total > 0"
|
||||
v-model:total="total"
|
||||
v-model:page="queryParams.page_num"
|
||||
v-model:limit="queryParams.page_size"
|
||||
@pagination="handleQuery"
|
||||
<el-form ref="formRef" :model="baseForm" :rules="rules" label-width="100px">
|
||||
|
||||
<el-row>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="工具链名称" prop="tool_name">
|
||||
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入工具链名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="厂商名称" prop="tool_name">
|
||||
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入厂商名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="工具链类型" prop="tool_name">
|
||||
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入工具链类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="ID编号" prop="tool_name">
|
||||
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入ID编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="工具链版本" prop="tool_name">
|
||||
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入工具链版本" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="硬件类型" prop="tool_name">
|
||||
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入硬件类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="工具链描述" prop="tool_desc">
|
||||
<el-input
|
||||
v-model="baseForm.tool_desc"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
placeholder="请输入工具链描述"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :xs="12"></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="card-footer">
|
||||
<el-button type="primary" @click="handleSubmit"><i-ep-check />确 定</el-button>
|
||||
<el-button @click="closeBack"><i-ep-close />取 消</el-button>
|
||||
</el-card>
|
||||
<el-dialog
|
||||
v-model="dialogFormVisible"
|
||||
title="添加工具链运行参数"
|
||||
width="880"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-dialog v-model="dialogFormVisible" title="添加工具链运行参数" width="880" v-loading="formLoading">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="108px">
|
||||
<el-form-item label="运行参数名称" prop="params_name">
|
||||
<el-input v-model="form.params_name" placeholder="请输入运行参数名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="运行参数描述" prop="params_desc">
|
||||
<el-input
|
||||
v-model="form.params_desc"
|
||||
|
@ -177,53 +169,18 @@
|
|||
v-model="form.params_content_v2"
|
||||
:rows="10"
|
||||
type="textarea"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false"><i-ep-close />取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">
|
||||
<el-button type="primary" @click="handleSubmitFile">
|
||||
<i-ep-check />确认
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-model="dialogInfoVisible"
|
||||
title="查看工具链运行参数"
|
||||
width="880"
|
||||
v-loading="infoLoading"
|
||||
>
|
||||
<el-form label-width="108px">
|
||||
<el-form-item label="运行参数名称">
|
||||
<el-input v-model="dataInfo.params_name" disabled placeholder="请输入运行参数名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="运行参数描述">
|
||||
<el-input
|
||||
v-model="dataInfo.params_desc"
|
||||
:rows="3"
|
||||
type="textarea"
|
||||
disabled
|
||||
placeholder="请输入运行参数描述"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="运行参数文件" prop="params_content">
|
||||
<el-input
|
||||
v-model="form.params_content_v2"
|
||||
:rows="10"
|
||||
type="textarea"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogInfoVisible = false"><i-ep-close />取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -233,18 +190,8 @@ import ToolChainshApi from "@/api/tool";
|
|||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const ID = ref(""); // 编号
|
||||
const queryLoading = ref(false); // 加载状态
|
||||
const total = ref(0); // 数据总数
|
||||
const pageData = ref([]); // 分页数据
|
||||
const queryParams = reactive({
|
||||
page_num: 1,
|
||||
page_size: 10,
|
||||
tool_id: null,
|
||||
});
|
||||
|
||||
// 基础表单
|
||||
const baseForm = ref({});
|
||||
const baseForm = reactive({});
|
||||
const baseFormRef = ref(ElForm); // 表单
|
||||
const loading = ref(false); // 加载状态
|
||||
// 校验规则
|
||||
|
@ -288,32 +235,29 @@ let listOpt = reactive({
|
|||
],
|
||||
});
|
||||
|
||||
// 参数详情查看
|
||||
const dataInfo = ref({});
|
||||
const infoLoading = ref(false); // 表单加载状态
|
||||
const dialogInfoVisible = ref(false); // 弹窗加载状态
|
||||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
baseFormRef.value.validate((valid: any) => {
|
||||
const handleSubmitFile = useThrottleFn(() => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
ToolChainshApi.editTool(baseForm.tool_id,baseForm)
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success("修改成功");
|
||||
closeBack();
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
ElMessage.success("保存成功");
|
||||
//formLoading.value = true;
|
||||
// ToolChainshApi.editTool(form.tool_id,form)
|
||||
// .then((res) => {
|
||||
// if (res.data.code == 0) {
|
||||
// ElMessage.success("修改成功");
|
||||
// handleQuery();
|
||||
// }
|
||||
// })
|
||||
// .finally(() => {
|
||||
// dialogFormVisible.value = false;
|
||||
// formLoading.value = false;
|
||||
// });
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
|
||||
/** 添加运行参数 */
|
||||
function handlePushParams() {
|
||||
function handlePushParams(){
|
||||
form.value = {};
|
||||
dialogFormVisible.value = true;
|
||||
}
|
||||
|
@ -392,62 +336,18 @@ function closeBack() {
|
|||
router.push({ path: "/tester/otherTool" });
|
||||
}
|
||||
|
||||
/** 查看运行参数详情 */
|
||||
function handleDetail(row: { [key: string]: any }) {
|
||||
infoLoading.value = true;
|
||||
ToolChainshApi.paramsInfo(row.params_id)
|
||||
/** 初始化数据 */
|
||||
function initData(){
|
||||
let id=route.query.id;
|
||||
loading.value = true;
|
||||
OperatorApi.toolChains(id)
|
||||
.then((res) => {
|
||||
//JSON转换
|
||||
res.data.data.params_content_v2 = JSON.stringify(res.data.data.params_content);
|
||||
dataInfo.value = res.data.data;
|
||||
dialogInfoVisible.value = true;
|
||||
})
|
||||
.finally(() => {
|
||||
infoLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除运行参数数据 */
|
||||
function handleDelete(row: { [key: string]: any }) {
|
||||
ElMessageBox.confirm("确认删除运行参数信息?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(function () {
|
||||
ToolChainshApi.deleteTool(row.tool_id).then((res) => {
|
||||
ElMessage.error("缺少接口");
|
||||
handleQuery();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/** 初始化数据 */
|
||||
function initData() {
|
||||
let id = route.query.id;
|
||||
ID.value = id;
|
||||
loading.value = true;
|
||||
ToolChainshApi.toolChains(id)
|
||||
.then((res) => {
|
||||
baseForm.value = res.data.data;
|
||||
baseForm = res.data.data;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 查询运行参数列表 */
|
||||
function handleQuery() {
|
||||
queryLoading.value = true;
|
||||
queryParams.tool_id = ID;
|
||||
ToolChainshApi.paramsList(queryParams)
|
||||
.then((res) => {
|
||||
pageData.value = res.data.data.ParamsList;
|
||||
total.value = res.data.data.total;
|
||||
})
|
||||
.finally(() => {
|
||||
queryLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
|
Loading…
Reference in New Issue