提交代码
parent
c67385b592
commit
9ceff45975
|
@ -438,9 +438,9 @@ class MenuAPI {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "otherToolEdit",
|
path: "otherToolAdd",
|
||||||
component: "manage/otherTool/edit",
|
component: "manage/otherTool/add",
|
||||||
name: "otherToolEdit",
|
name: "otherToolAdd",
|
||||||
meta: {
|
meta: {
|
||||||
title: "第三方工具编辑",
|
title: "第三方工具编辑",
|
||||||
hidden: true,
|
hidden: true,
|
||||||
|
@ -450,9 +450,9 @@ class MenuAPI {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "otherToolView",
|
path: "otherToolDetail",
|
||||||
component: "manage/otherTool/view",
|
component: "manage/otherTool/view",
|
||||||
name: "otherToolView",
|
name: "otherToolDetail",
|
||||||
meta: {
|
meta: {
|
||||||
title: "查看第三方工具",
|
title: "查看第三方工具",
|
||||||
hidden: true,
|
hidden: true,
|
||||||
|
|
|
@ -1,19 +1,14 @@
|
||||||
<!-- 用户管理 -->
|
<!-- 算子管理 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container model-detail">
|
<div class="app-container model-detail">
|
||||||
<!-- 用户新增/编辑表单 -->
|
<!-- 算子新增表单 -->
|
||||||
<el-card v-loading="loading">
|
<el-card v-loading="loading">
|
||||||
<template #header
|
<template #header
|
||||||
><svg-icon icon-class="pause" style="width: 20px; height: 20px" /> 算子基本信息
|
><svg-icon icon-class="pause" style="width: 20px; height: 20px" /> 算子基本信息
|
||||||
</template>
|
</template>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :lg="12" :xs="24">
|
<el-col :lg="12" :xs="24">
|
||||||
<el-form
|
<el-form ref="formRef" :model="formData" :rules="rules" label-width="80px">
|
||||||
ref="formRef"
|
|
||||||
:model="formData"
|
|
||||||
:rules="rules"
|
|
||||||
label-width="80px"
|
|
||||||
>
|
|
||||||
<el-form-item label="算子名称" prop="operator_name">
|
<el-form-item label="算子名称" prop="operator_name">
|
||||||
<el-input v-model="formData.operator_name" placeholder="请输入算子名称" />
|
<el-input v-model="formData.operator_name" placeholder="请输入算子名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -89,10 +84,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="12" :xs="24">
|
<el-col :lg="12" :xs="24">
|
||||||
<div style="padding-left: 35px" v-if="fileStatus">
|
<div style="padding-left: 35px" v-if="fileStatus">
|
||||||
<el-form
|
<el-form label-width="100px" size="small">
|
||||||
label-width="100px"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
<el-divider content-position="left"
|
<el-divider content-position="left"
|
||||||
><strong style="color: #409eff">算子文件预览</strong></el-divider
|
><strong style="color: #409eff">算子文件预览</strong></el-divider
|
||||||
>
|
>
|
||||||
|
@ -121,7 +113,7 @@ const codeHtml = ref(""); // 文件信息
|
||||||
|
|
||||||
// 上传组件
|
// 上传组件
|
||||||
const uploadRef = ref<UploadInstance>();
|
const uploadRef = ref<UploadInstance>();
|
||||||
// 用户表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
status: 1,
|
status: 1,
|
||||||
});
|
});
|
||||||
|
@ -143,9 +135,9 @@ const rules = reactive({
|
||||||
});
|
});
|
||||||
|
|
||||||
// 主动验证
|
// 主动验证
|
||||||
function handleChangeRules(){
|
function handleChangeRules() {
|
||||||
formRef.value.validateField('oper_main_type');
|
formRef.value.validateField("oper_main_type");
|
||||||
formRef.value.validateField('oper_sub_type');
|
formRef.value.validateField("oper_sub_type");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表单提交 */
|
/** 表单提交 */
|
||||||
|
@ -155,12 +147,15 @@ const handleSubmit = useThrottleFn(() => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
formData.user_id = userStore.user?.id;
|
formData.user_id = userStore.user?.id;
|
||||||
formData.create_time = new Date();
|
formData.create_time = new Date();
|
||||||
OperatorApi.add(formData).then((res) => {
|
OperatorApi.add(formData)
|
||||||
|
.then((res) => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
ElMessage.success("保存成功");
|
ElMessage.success("保存成功");
|
||||||
loading.value = false;
|
|
||||||
closeBack();
|
closeBack();
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -196,7 +191,7 @@ function handleFileChange(file) {
|
||||||
if (isJSON(res)) {
|
if (isJSON(res)) {
|
||||||
let jsonStr = JSON.stringify(res);
|
let jsonStr = JSON.stringify(res);
|
||||||
formData.parameters = jsonStr;
|
formData.parameters = jsonStr;
|
||||||
formRef.value.validateField('parameters');
|
formRef.value.validateField("parameters");
|
||||||
let json = JSON.parse(jsonStr);
|
let json = JSON.parse(jsonStr);
|
||||||
codeHtml.value = highlightJSON(json);
|
codeHtml.value = highlightJSON(json);
|
||||||
fileStatus.value = true;
|
fileStatus.value = true;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!-- 用户管理 -->
|
<!-- 算子管理 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card shadow="never" class="table-container">
|
<el-card shadow="never" class="table-container">
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
<!-- 用户管理 -->
|
<!-- 算子管理 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container model-detail">
|
<div class="app-container model-detail">
|
||||||
<!-- 用户新增/编辑表单 -->
|
<!-- 算子管理详情 -->
|
||||||
<el-card>
|
<el-card>
|
||||||
<template #header><svg-icon icon-class="pause" style="width:20px;height:20px;" />算子基本信息</template>
|
<template #header
|
||||||
|
><svg-icon
|
||||||
|
icon-class="pause"
|
||||||
|
style="width: 20px; height: 20px"
|
||||||
|
/>算子基本信息</template
|
||||||
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :lg="12" :xs="24">
|
<el-col :lg="12" :xs="24">
|
||||||
<el-form
|
<el-form ref="formRef" v-loading="loading" label-width="100px" size="small">
|
||||||
ref="formRef"
|
<el-form-item label="算子名称">{{ dataInfo.operator_name }}</el-form-item>
|
||||||
v-loading="loading"
|
|
||||||
label-width="100px"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
<el-form-item label="算子名称">{{dataInfo.operator_name}}</el-form-item>
|
|
||||||
<el-form-item label="算子主类型">
|
<el-form-item label="算子主类型">
|
||||||
{{dataInfo.oper_main_type_name}}</el-form-item
|
{{ dataInfo.oper_main_type_name }}</el-form-item
|
||||||
>
|
>
|
||||||
<el-form-item label="算子子类型">
|
<el-form-item label="算子子类型">
|
||||||
{{dataInfo.oper_sub_type_name}}</el-form-item
|
{{ dataInfo.oper_sub_type_name }}</el-form-item
|
||||||
>
|
>
|
||||||
<el-form-item label="算子说明">
|
<el-form-item label="算子说明">
|
||||||
<el-input
|
<el-input
|
||||||
|
@ -28,12 +28,8 @@
|
||||||
type="textarea"
|
type="textarea"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="创建人">
|
<el-form-item label="创建人"> {{ dataInfo.user_name }}</el-form-item>
|
||||||
{{dataInfo.user_name}}</el-form-item
|
<el-form-item label="创建时间"> {{ dataInfo.create_time }}</el-form-item>
|
||||||
>
|
|
||||||
<el-form-item label="创建时间">
|
|
||||||
{{dataInfo.create_time}}</el-form-item
|
|
||||||
>
|
|
||||||
<el-form-item label="算子参数">
|
<el-form-item label="算子参数">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="dataInfo.parametersJson"
|
v-model="dataInfo.parametersJson"
|
||||||
|
@ -64,9 +60,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import OperatorApi from '@/api/operator'
|
import OperatorApi from "@/api/operator";
|
||||||
|
|
||||||
const route =useRoute()
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const loading = ref(false); // 加载状态
|
const loading = ref(false); // 加载状态
|
||||||
// 算子表单数据
|
// 算子表单数据
|
||||||
|
@ -78,13 +74,16 @@ function closeBack() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 初始化数据 */
|
/** 初始化数据 */
|
||||||
function initData(){
|
function initData() {
|
||||||
let id=route.query.id;
|
let id = route.query.id;
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
OperatorApi.findOne(id).then(res =>{
|
OperatorApi.findOne(id)
|
||||||
|
.then((res) => {
|
||||||
//JSON转换
|
//JSON转换
|
||||||
res.data.data.parametersJson = JSON.stringify(res.data.data.parameters);
|
res.data.data.parametersJson = JSON.stringify(res.data.data.parameters);
|
||||||
dataInfo.value = res.data.data;
|
dataInfo.value = res.data.data;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -93,30 +92,30 @@ onMounted(() => {
|
||||||
initData();
|
initData();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang='scss'>
|
<style scoped lang="scss">
|
||||||
.model-detail{
|
.model-detail {
|
||||||
:deep(.el-card__header){
|
:deep(.el-card__header) {
|
||||||
padding:8px 4px;
|
padding: 8px 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center
|
align-items: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.sp-file{
|
.sp-file {
|
||||||
color:#29d;
|
color: #29d;
|
||||||
}
|
}
|
||||||
.tb-base-info{
|
.tb-base-info {
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
}
|
}
|
||||||
:deep(.svg-icon){
|
:deep(.svg-icon) {
|
||||||
margin-right:8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
.card-footer{
|
.card-footer {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: calc(100% - 215px);
|
width: calc(100% - 215px);
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
:deep(.el-card__body){
|
:deep(.el-card__body) {
|
||||||
padding:10px;
|
padding: 10px;
|
||||||
.el-pagination{
|
.el-pagination {
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!-- 用户管理 -->
|
<!-- 算子程序管理 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container model-detail">
|
<div class="app-container model-detail">
|
||||||
<!-- 用户新增/编辑表单 -->
|
<!-- 新增/编辑表单 -->
|
||||||
<el-card v-loading="loading">
|
<el-card v-loading="loading">
|
||||||
<template #header
|
<template #header
|
||||||
><svg-icon icon-class="pause" style="width: 20px; height: 20px" />
|
><svg-icon icon-class="pause" style="width: 20px; height: 20px" />
|
||||||
|
@ -98,7 +98,11 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="程序版本" prop="program_version">
|
<el-form-item label="程序版本" prop="program_version">
|
||||||
<el-input v-model="formData.program_version" type="number" placeholder="请输入程序版本" />
|
<el-input
|
||||||
|
v-model="formData.program_version"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入程序版本"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="程序文件" prop="program_file_name">
|
<el-form-item label="程序文件" prop="program_file_name">
|
||||||
<el-upload
|
<el-upload
|
||||||
|
@ -158,7 +162,7 @@ const codeJson = ref(""); // 文件信息
|
||||||
|
|
||||||
// 上传组件
|
// 上传组件
|
||||||
const uploadRef = ref<UploadInstance>();
|
const uploadRef = ref<UploadInstance>();
|
||||||
// 用户表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
status: 1,
|
status: 1,
|
||||||
});
|
});
|
||||||
|
@ -187,12 +191,15 @@ const handleSubmit = useThrottleFn(() => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
formData.user_id = userStore.user?.id;
|
formData.user_id = userStore.user?.id;
|
||||||
formData.create_time = new Date();
|
formData.create_time = new Date();
|
||||||
OperatorApi.addPrograms(formData).then((res) => {
|
OperatorApi.addPrograms(formData)
|
||||||
|
.then((res) => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
ElMessage.success("保存成功");
|
ElMessage.success("保存成功");
|
||||||
loading.value = false;
|
|
||||||
closeBack();
|
closeBack();
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -235,7 +242,7 @@ const remoteMethod = (query: string) => {
|
||||||
|
|
||||||
/** 算子主类型改变 */
|
/** 算子主类型改变 */
|
||||||
function handleChange() {
|
function handleChange() {
|
||||||
formRef.value.validateField('oper_main_type');
|
formRef.value.validateField("oper_main_type");
|
||||||
let param = {
|
let param = {
|
||||||
page_num: 1,
|
page_num: 1,
|
||||||
page_size: 999,
|
page_size: 999,
|
||||||
|
@ -248,7 +255,7 @@ function handleChange() {
|
||||||
|
|
||||||
/** 选择算子名称 */
|
/** 选择算子名称 */
|
||||||
function handleChangeOperator() {
|
function handleChangeOperator() {
|
||||||
formRef.value.validateField('operator_id');
|
formRef.value.validateField("operator_id");
|
||||||
OperatorApi.findOne(formData.operator_id).then((res) => {
|
OperatorApi.findOne(formData.operator_id).then((res) => {
|
||||||
//JSON转换
|
//JSON转换
|
||||||
codeJson.value = JSON.stringify(res.data.data.parameters);
|
codeJson.value = JSON.stringify(res.data.data.parameters);
|
||||||
|
@ -257,8 +264,8 @@ function handleChangeOperator() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 选择适配硬件 */
|
/** 选择适配硬件 */
|
||||||
function handleChangeCmpt(){
|
function handleChangeCmpt() {
|
||||||
formRef.value.validateField('cmpt_hardware_type');
|
formRef.value.validateField("cmpt_hardware_type");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化选项列表
|
// 初始化选项列表
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!-- 用户管理 -->
|
<!-- 算子程序管理 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card shadow="never" class="table-container">
|
<el-card shadow="never" class="table-container">
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
text type="primary" size="small"
|
text type="primary" size="small"
|
||||||
@click="handleDetail(scope.row.program_id)"
|
@click="handleDetail(scope.row.program_id)"
|
||||||
><i-ep-view />查看参数</el-button
|
><i-ep-view />查看</el-button
|
||||||
>
|
>
|
||||||
<el-button text type="primary" size="small" @click="handleDelete(scope.row.program_id)"
|
<el-button text type="primary" size="small" @click="handleDelete(scope.row.program_id)"
|
||||||
><i-ep-delete />删除</el-button
|
><i-ep-delete />删除</el-button
|
||||||
|
|
|
@ -1,18 +1,15 @@
|
||||||
<!-- 用户管理 -->
|
<!-- 算子程序管理 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container model-detail">
|
<div class="app-container model-detail">
|
||||||
<!-- 用户新增/编辑表单 -->
|
<!-- 算子程序详情 -->
|
||||||
<el-card>
|
<el-card>
|
||||||
<template #header><svg-icon icon-class="pause" style="width:20px;height:20px;" /> 算子参数基本信息 </template>
|
<template #header
|
||||||
|
><svg-icon icon-class="pause" style="width: 20px; height: 20px" />
|
||||||
|
算子参数基本信息
|
||||||
|
</template>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :lg="12" :xs="24">
|
<el-col :lg="12" :xs="24">
|
||||||
<el-form
|
<el-form v-loading="loading" label-width="100px" size="small">
|
||||||
ref="userFormRef"
|
|
||||||
:model="formData"
|
|
||||||
v-loading="loading"
|
|
||||||
label-width="100px"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
<el-form-item label="参数名称" prop="username"> 目标分类模型 </el-form-item>
|
<el-form-item label="参数名称" prop="username"> 目标分类模型 </el-form-item>
|
||||||
<el-form-item label="算子类型" prop="nickname33">
|
<el-form-item label="算子类型" prop="nickname33">
|
||||||
前处理/缩放算子</el-form-item
|
前处理/缩放算子</el-form-item
|
||||||
|
@ -47,18 +44,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
defineOptions({
|
import OperatorApi from "@/api/operator";
|
||||||
name: "User",
|
|
||||||
inheritAttrs: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
import UserAPI from "@/api/user";
|
|
||||||
import { UserForm } from "@/api/user/model";
|
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const loading = ref(false); // 加载状态
|
const loading = ref(false); // 加载状态
|
||||||
|
// 算子表单数据
|
||||||
const calTypeList = ref<OptionType[]>(); // 角色下拉数据源
|
const dataInfo = ref({});
|
||||||
|
|
||||||
// 用户表单数据
|
// 用户表单数据
|
||||||
const formData = reactive<UserForm>({
|
const formData = reactive<UserForm>({
|
||||||
|
@ -93,101 +85,54 @@ const formData = reactive<UserForm>({
|
||||||
}`,
|
}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 校验规则
|
|
||||||
const rules = reactive({
|
|
||||||
username: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
|
|
||||||
nickname: [{ required: true, message: "用户昵称不能为空", trigger: "blur" }],
|
|
||||||
deptId: [{ required: true, message: "所属部门不能为空", trigger: "blur" }],
|
|
||||||
roleIds: [{ required: true, message: "用户角色不能为空", trigger: "blur" }],
|
|
||||||
email: [
|
|
||||||
{
|
|
||||||
pattern: /\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/,
|
|
||||||
message: "请输入正确的邮箱地址",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
mobile: [
|
|
||||||
{
|
|
||||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
||||||
message: "请输入正确的手机号码",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
const list = [
|
|
||||||
{
|
|
||||||
csmc: "10.0.8.12",
|
|
||||||
csms: "异腾310",
|
|
||||||
csmc1: "Atlas 2000 DK A2",
|
|
||||||
csmc2: "PCIE-AI-NPU",
|
|
||||||
csmc3: "华为",
|
|
||||||
csmc4: "1.2",
|
|
||||||
csmc5: "已连接",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
csmc: "192.168.1.44",
|
|
||||||
csms: "思源220",
|
|
||||||
csmc1: "Atlas 2000 DK A2",
|
|
||||||
csmc2: "PCIE-AI-NPU",
|
|
||||||
csmc3: "华为",
|
|
||||||
csmc4: "1.2",
|
|
||||||
csmc5: "已连接",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
csmc: "192.168.1.66",
|
|
||||||
csms: "RTX4090",
|
|
||||||
csmc1: "Atlas 2000 DK A2",
|
|
||||||
csmc2: "PCIE-AI-NPU",
|
|
||||||
csmc3: "华为",
|
|
||||||
csmc4: "1.2",
|
|
||||||
csmc5: "已连接",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
/** 表单提交 */
|
|
||||||
const handleSubmit = useThrottleFn(() => {
|
|
||||||
loading.value = true;
|
|
||||||
setTimeout(() => {
|
|
||||||
ElMessage.success("修改用户成功");
|
|
||||||
loading.value = false;
|
|
||||||
closeBack();
|
|
||||||
}, 1000);
|
|
||||||
}, 3000);
|
|
||||||
|
|
||||||
/** 返回默认页面 */
|
/** 返回默认页面 */
|
||||||
function closeBack() {
|
function closeBack() {
|
||||||
router.replace({ path: "/operatorLibrary/calculateParam" });
|
router.replace({ path: "/operatorLibrary/calculateParam" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 初始化数据 */
|
||||||
|
function initData() {
|
||||||
|
let id = route.query.id;
|
||||||
|
loading.value = true;
|
||||||
|
OperatorApi.findOne(id)
|
||||||
|
.then((res) => {
|
||||||
|
//JSON转换
|
||||||
|
res.data.data.parametersJson = JSON.stringify(res.data.data.parameters);
|
||||||
|
dataInfo.value = res.data.data;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
//handleQuery();
|
initData();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang='scss'>
|
<style scoped lang="scss">
|
||||||
.model-detail{
|
.model-detail {
|
||||||
:deep(.el-card__header){
|
:deep(.el-card__header) {
|
||||||
padding:8px 4px;
|
padding: 8px 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center
|
align-items: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.sp-file{
|
.sp-file {
|
||||||
color:#29d;
|
color: #29d;
|
||||||
}
|
}
|
||||||
.tb-base-info{
|
.tb-base-info {
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
}
|
}
|
||||||
:deep(.svg-icon){
|
:deep(.svg-icon) {
|
||||||
margin-right:8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
.card-footer{
|
.card-footer {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: calc(100% - 215px);
|
width: calc(100% - 215px);
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
:deep(.el-card__body){
|
:deep(.el-card__body) {
|
||||||
padding:10px;
|
padding: 10px;
|
||||||
.el-pagination{
|
.el-pagination {
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,6 +92,26 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import OperatorApi from '@/api/operator'
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const loading = ref(false); // 加载状态
|
||||||
|
const total = ref(0); // 数据总数
|
||||||
|
const pageData = ref([]); // 分页数据
|
||||||
|
const removeIds = ref([]); // 删除ID集合 用于批量删除
|
||||||
|
const queryFormRef = ref(ElForm); // 查询表单
|
||||||
|
const queryParams = reactive({
|
||||||
|
page_num: 1,
|
||||||
|
page_size: 10,
|
||||||
|
operation_id: null,
|
||||||
|
oper_main_type: null,
|
||||||
|
oper_sub_type: null,
|
||||||
|
cmpt_hardware_type: null,
|
||||||
|
operator_name: null,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "calculateIndex",
|
name: "calculateIndex",
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
|
|
|
@ -1,168 +0,0 @@
|
||||||
<!-- 用户管理 -->
|
|
||||||
<template>
|
|
||||||
<div class="app-container model-detail">
|
|
||||||
<!-- 用户新增/编辑表单 -->
|
|
||||||
<el-card v-loading="loading">
|
|
||||||
<template #header
|
|
||||||
><svg-icon
|
|
||||||
icon-class="pause"
|
|
||||||
style="width: 20px; height: 20px"
|
|
||||||
/>工具链基本信息</template
|
|
||||||
>
|
|
||||||
<el-row>
|
|
||||||
<el-col :lg="24" :xs="24">
|
|
||||||
<el-form ref="userFormRef" :model="formData" :rules="rules" label-width="100px">
|
|
||||||
<el-table :data="list" style="width: 100%" stripe>
|
|
||||||
<el-table-column label="选择" width="60" align="center">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-radio v-model="radioSelected" :label="scope.row.csmc" @change.native="getCurrentRow(scope.row.csmc)">{{ '' }}</el-radio>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="csmc" label="IP地址" align="left" />
|
|
||||||
<el-table-column prop="csmc" label="类型" align="left" />
|
|
||||||
<el-table-column prop="csmc1" label="ID编号" align="left" />
|
|
||||||
<el-table-column prop="csmc2" label="厂商名称" align="left" />
|
|
||||||
<el-table-column prop="csmc3" label="服务程序版本" align="left" />
|
|
||||||
<el-table-column prop="csmc4" label="连接状态" align="left" />
|
|
||||||
</el-table>
|
|
||||||
</el-form>
|
|
||||||
</el-col>
|
|
||||||
<el-col :lg="12" :xs="24"> </el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
<el-card v-loading="loading" style="margin-top: 12px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :lg="12" :xs="24">
|
|
||||||
<el-form ref="userFormRef" :model="formData" :rules="rules" label-width="100px">
|
|
||||||
<el-form-item label="工具链名称" prop="username">
|
|
||||||
<el-input
|
|
||||||
v-model="formData.username"
|
|
||||||
:readonly="!!formData.id"
|
|
||||||
placeholder="请输入工具链名称"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="工具链标签" prop="nickname">
|
|
||||||
<el-input v-model="formData.nickname" placeholder="请输入工具链标签" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-col>
|
|
||||||
<el-col :lg="12" :xs="24"> </el-col>
|
|
||||||
</el-row>
|
|
||||||
</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>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
defineOptions({
|
|
||||||
name: "User",
|
|
||||||
inheritAttrs: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
import UserAPI from "@/api/user";
|
|
||||||
import { UserForm } from "@/api/user/model";
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const loading = ref(false); // 加载状态
|
|
||||||
|
|
||||||
const calTypeList = ref<OptionType[]>(); // 角色下拉数据源
|
|
||||||
|
|
||||||
// 用户表单数据
|
|
||||||
const formData = reactive<UserForm>({
|
|
||||||
status: 1,
|
|
||||||
});
|
|
||||||
|
|
||||||
const radioSelected = ref('');
|
|
||||||
|
|
||||||
// 校验规则
|
|
||||||
const rules = reactive({
|
|
||||||
username: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
||||||
nickname: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
||||||
deptId: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
||||||
roleIds: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
||||||
email: [
|
|
||||||
{
|
|
||||||
pattern: /\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/,
|
|
||||||
message: "请输入正确的邮箱地址",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
mobile: [
|
|
||||||
{
|
|
||||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
||||||
message: "请输入正确的手机号码",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
const list = [
|
|
||||||
{
|
|
||||||
csmc: "10.0.8.12",
|
|
||||||
csms: "DOCKER-TOOL",
|
|
||||||
csmc1: "acd0032a-6833-4348-b0fc-04798f94354c",
|
|
||||||
csmc2: "华为",
|
|
||||||
csmc3: "1.2",
|
|
||||||
csmc4: "已连接",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
csmc: "192.10.71.44",
|
|
||||||
csms: "ETL",
|
|
||||||
csmc1: "ac1232a-6233-4348-b0fc-04798f94551",
|
|
||||||
csmc2: "华为",
|
|
||||||
csmc3: "1.2",
|
|
||||||
csmc4: "已连接",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
/** 表单提交 */
|
|
||||||
const handleSubmit = useThrottleFn(() => {
|
|
||||||
loading.value = true;
|
|
||||||
setTimeout(() => {
|
|
||||||
ElMessage.success("保存成功");
|
|
||||||
loading.value = false;
|
|
||||||
closeBack();
|
|
||||||
}, 1000);
|
|
||||||
}, 3000);
|
|
||||||
|
|
||||||
/** 返回默认页面 */
|
|
||||||
function closeBack() {
|
|
||||||
router.replace({ path: "/tester/otherTool" });
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
//handleQuery();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.model-detail {
|
|
||||||
:deep(.el-card__header) {
|
|
||||||
padding: 8px 4px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.sp-file {
|
|
||||||
color: #29d;
|
|
||||||
}
|
|
||||||
.tb-base-info {
|
|
||||||
line-height: 30px;
|
|
||||||
}
|
|
||||||
:deep(.svg-icon) {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
.card-footer {
|
|
||||||
position: fixed;
|
|
||||||
width: calc(100% - 215px);
|
|
||||||
bottom: 0px;
|
|
||||||
:deep(.el-card__body) {
|
|
||||||
padding: 10px;
|
|
||||||
.el-pagination {
|
|
||||||
justify-content: end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -5,20 +5,25 @@
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="openDialog('user-form')"
|
<el-button type="primary" @click="handleAdd()"><i-ep-plus />工具链</el-button>
|
||||||
><i-ep-plus />工具链</el-button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
<el-form-item label="工具链名称" prop="keywords">
|
<el-form-item label="工具链名称" prop="keywords">
|
||||||
<el-input
|
<el-select
|
||||||
v-model="queryParams.keywords"
|
v-model="queryParams.tool_type"
|
||||||
placeholder="请输入工具链名称"
|
placeholder="请选择工具类型"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
@keyup.enter="handleQuery"
|
@change="handleQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in listOpt.typeList"
|
||||||
|
:key="item.type"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.type"
|
||||||
/>
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleQuery"
|
<el-button type="primary" @click="handleQuery"
|
||||||
|
@ -35,30 +40,19 @@
|
||||||
</template>
|
</template>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="tableData"
|
:data="pageData"
|
||||||
stripe
|
stripe
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<el-table-column label="工具链名称" align="left" prop="szmc" width="250" />
|
<el-table-column label="工具链名称" align="left" prop="tool_name" width="250" />
|
||||||
<el-table-column label="标签" align="left" prop="szlx" />
|
<el-table-column label="工具类型" align="left" prop="tool_type_name" />
|
||||||
<el-table-column label="连接状态" align="left" prop="szzlx" />
|
<el-table-column label="匹配硬件" align="left" prop="cmpt_hardware_type" />
|
||||||
<el-table-column label="工作状态" width="180" align="left" prop="bb" />
|
<el-table-column label="工作状态" align="left" prop="working_state_name" />
|
||||||
<el-table-column label="创建时间" width="180" align="left" prop="hlcjsj" />
|
<el-table-column label="连接状态" align="left" prop="connection_state" />
|
||||||
<el-table-column label="操作" fixed="right" width="280">
|
<el-table-column label="操作" fixed="right" width="280">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button text type="primary" size="small" @click="handleDetail(scope.row)"
|
||||||
text
|
><i-ep-edit />查看</el-button
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
@click="openDialogView('user-form', scope.row.id)"
|
|
||||||
><i-ep-view />查看</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
text
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
@click="openDialog('user-form', scope.row.id)"
|
|
||||||
><i-ep-edit />修改</el-button
|
|
||||||
>
|
>
|
||||||
<el-button text type="primary" size="small" @click="handleDelete(scope.row)"
|
<el-button text type="primary" size="small" @click="handleDelete(scope.row)"
|
||||||
><i-ep-delete />删除</el-button
|
><i-ep-delete />删除</el-button
|
||||||
|
@ -70,8 +64,8 @@
|
||||||
<pagination
|
<pagination
|
||||||
v-if="total > 0"
|
v-if="total > 0"
|
||||||
v-model:total="total"
|
v-model:total="total"
|
||||||
v-model:page="queryParams.pageNum"
|
v-model:page="queryParams.page_num"
|
||||||
v-model:limit="queryParams.pageSize"
|
v-model:limit="queryParams.page_size"
|
||||||
@pagination="handleQuery"
|
@pagination="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
@ -79,73 +73,61 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
defineOptions({
|
import ToolChainshApi from "@/api/tool";
|
||||||
name: "calculateIndex",
|
|
||||||
inheritAttrs: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
import { UserQuery } from "@/api/user/model";
|
|
||||||
|
|
||||||
const queryFormRef = ref(ElForm); // 查询表单
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const loading = ref(false); // 加载状态
|
const loading = ref(false); // 加载状态
|
||||||
const removeIds = ref([]); // 删除用户ID集合 用于批量删除
|
|
||||||
const queryParams = reactive<UserQuery>({
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
const dateTimeRange = ref("");
|
|
||||||
const total = ref(0); // 数据总数
|
const total = ref(0); // 数据总数
|
||||||
|
const pageData = ref([]); // 分页数据
|
||||||
watch(dateTimeRange, (newVal) => {
|
const removeIds = ref([]); // 删除ID集合 用于批量删除
|
||||||
if (newVal) {
|
const queryFormRef = ref(ElForm); // 查询表单
|
||||||
queryParams.startTime = newVal[0];
|
const queryParams = reactive({
|
||||||
queryParams.endTime = newVal[1];
|
page_num: 1,
|
||||||
}
|
page_size: 10,
|
||||||
|
tool_type: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
const tableData = [
|
// 基础数据列表
|
||||||
|
let listOpt = reactive({
|
||||||
|
typeList: [
|
||||||
{
|
{
|
||||||
szmc: "华为Atlas工具链",
|
type: "quantizer",
|
||||||
szlx: "atlas",
|
name: "量化工具",
|
||||||
szzlx: "已连接",
|
|
||||||
bb: "空闲",
|
|
||||||
hlcjsj: "2024-05-03",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
szmc: "寒武纪思元工具链",
|
type: "compiler",
|
||||||
szlx: "寒武纪",
|
name: "编译工具",
|
||||||
szzlx: "已断开",
|
|
||||||
bb: "- -",
|
|
||||||
hlcjsj: "2024-06-07",
|
|
||||||
},
|
},
|
||||||
];
|
{
|
||||||
|
type: "label",
|
||||||
|
name: "标注工具",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "other",
|
||||||
|
name: "其他工具",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
/** 查询 */
|
/** 查询 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
ElMessage.success("查询成功");
|
ToolChainshApi.toolStatusList(queryParams)
|
||||||
|
.then((res) => {
|
||||||
|
pageData.value = res.data.data.tool_status_list;
|
||||||
|
total.value = res.data.data.total;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
// UserAPI.getPage(queryParams)
|
});
|
||||||
// .then((data) => {
|
|
||||||
// console.log("handleQuery", data);
|
|
||||||
// pageData.value = data.list;
|
|
||||||
// total.value = data.total;
|
|
||||||
// })
|
|
||||||
// .finally(() => {
|
|
||||||
// loading.value = false;
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置查询 */
|
/** 重置查询 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
queryFormRef.value.resetFields();
|
queryFormRef.value.resetFields();
|
||||||
dateTimeRange.value = "";
|
queryParams.page_num = 1;
|
||||||
queryParams.pageNum = 1;
|
queryParams.tool_type = null;
|
||||||
queryParams.deptId = undefined;
|
|
||||||
queryParams.startTime = undefined;
|
|
||||||
queryParams.endTime = undefined;
|
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,34 +143,25 @@ function handleDelete(row: { [key: string]: any }) {
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
|
ToolChainshApi.deleteTool(row.tool_id).then((res) => {
|
||||||
ElMessage.success("删除成功");
|
ElMessage.success("删除成功");
|
||||||
|
resetQuery();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 查看第三方工具链 */
|
||||||
* 打开弹窗
|
function handleDetail(row: { [key: string]: any }) {
|
||||||
*
|
localStorage.setItem('toolChainsKey-'+row.tool_id, JSON.stringify(row));
|
||||||
* @param type 弹窗类型 用户表单:user-form | 用户导入:user-import
|
router.replace({ path: "/tester/otherToolDetail", query: { id: row.tool_id } });
|
||||||
* @param id 用户ID
|
}
|
||||||
*/
|
|
||||||
async function openDialog(type: string, id?: number) {
|
/** 新增第三方工具链 */
|
||||||
|
function handleAdd() {
|
||||||
router.replace({ path: "/tester/otherToolEdit" });
|
router.replace({ path: "/tester/otherToolEdit" });
|
||||||
}
|
}
|
||||||
async function openDialogView(type: string, id?: number) {
|
|
||||||
router.replace({ path: "/tester/otherToolView" });
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 下载导入模板 */
|
|
||||||
function downloadTemplate() {
|
|
||||||
ElMessage.success("下载模板成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 导出用户 */
|
|
||||||
function handleExport() {
|
|
||||||
ElMessage.success("导出成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
//handleQuery();
|
handleQuery();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -2,142 +2,329 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container model-detail">
|
<div class="app-container model-detail">
|
||||||
<!-- 用户新增/编辑表单 -->
|
<!-- 用户新增/编辑表单 -->
|
||||||
<el-card>
|
<el-card v-loading="loading">
|
||||||
<template #header
|
<template #header
|
||||||
><svg-icon
|
><svg-icon
|
||||||
icon-class="pause"
|
icon-class="pause"
|
||||||
style="width: 20px; height: 20px"
|
style="width: 20px; height: 20px"
|
||||||
/>工具链基本信息</template
|
/>工具链基本信息</template
|
||||||
>
|
>
|
||||||
|
<el-form ref="baseFormRef" :model="baseForm" :rules="baseRules" label-width="100px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :lg="12" :xs="24">
|
<el-col :lg="12" :xs="12">
|
||||||
<el-form
|
<el-form-item label="工具链名称" prop="tool_name">
|
||||||
ref="userFormRef"
|
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入工具链名称" />
|
||||||
:model="formData"
|
</el-form-item>
|
||||||
v-loading="loading"
|
</el-col>
|
||||||
label-width="100px"
|
<el-col :lg="12" :xs="12">
|
||||||
size="small"
|
<el-form-item label="厂商名称" prop="tool_name">
|
||||||
>
|
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入厂商名称" />
|
||||||
<el-form-item label="工具链名称" prop="username"> 目标分类模型 </el-form-item>
|
|
||||||
<el-form-item label="工具链标签" prop="nickname22">
|
|
||||||
<div class="flex gap-2">
|
|
||||||
<el-tag type="info">设备标签</el-tag>
|
|
||||||
<el-tag type="info">对讲机</el-tag>
|
|
||||||
<el-tag type="info">头像识别</el-tag>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备状态" prop="nickname">
|
|
||||||
<el-tag type="success">已连接</el-tag>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="工作状态" prop="nickname">
|
|
||||||
<el-tag type="success">空闲</el-tag>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="设备类型" prop="nickname33"> PCIE-AI-NPU </el-form-item>
|
|
||||||
<el-form-item label="IP地址" prop="nickname33"> 192.168.1.32 </el-form-item>
|
|
||||||
<el-form-item label="ID编号" prop="nickname33">
|
|
||||||
6c647c8d-774j-sdjksk-fdof67
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="厂商名称" prop="nickname33"> HUAWEI </el-form-item>
|
|
||||||
<el-form-item label="程序版本" prop="nickname33"> V3.0 </el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="12" :xs="24"> </el-col>
|
|
||||||
</el-row>
|
</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-row style="padding: 10px 15px;">
|
||||||
|
<el-col :lg="24" :xs="24">
|
||||||
|
<el-button type="primary" @click="handlePushParams"><i-ep-plus />添加运行参数</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-card v-loading="loading">
|
||||||
|
<template #header
|
||||||
|
><svg-icon
|
||||||
|
icon-class="pause"
|
||||||
|
style="width: 20px; height: 20px"
|
||||||
|
/>工具链运行参数信息</template
|
||||||
|
>
|
||||||
|
<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>
|
||||||
<el-card class="card-footer">
|
<el-card class="card-footer">
|
||||||
<el-button @click="closeBack"><i-ep-close />取 消</el-button>
|
<el-button @click="closeBack"><i-ep-close />取 消</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<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"
|
||||||
|
:rows="3"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入运行参数描述"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="运行参数文件" prop="params_content">
|
||||||
|
<el-upload
|
||||||
|
ref="uploadRef"
|
||||||
|
class="upload-demo"
|
||||||
|
:on-change="handleFileChange"
|
||||||
|
:on-remove="handleFileRemove"
|
||||||
|
:on-exceed="handleFileExceed"
|
||||||
|
:auto-upload="false"
|
||||||
|
:limit="1"
|
||||||
|
accept="application/json"
|
||||||
|
>
|
||||||
|
<el-button type="primary"
|
||||||
|
><el-icon class="el-icon--upload"> <i-ep-upload-filled /> </el-icon
|
||||||
|
>选择文件</el-button
|
||||||
|
>
|
||||||
|
<template #tip>
|
||||||
|
<div class="el-upload__tip">
|
||||||
|
请上传大小不超过 <strong style="color: red">10M</strong>,格式为
|
||||||
|
<strong style="color: red">json</strong> 的文件
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="fileStatus">
|
||||||
|
<el-input
|
||||||
|
v-model="form.params_content"
|
||||||
|
:rows="10"
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
|
</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="handleSubmitFile">
|
||||||
|
<i-ep-check />确认
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
defineOptions({
|
import ToolChainshApi from "@/api/tool";
|
||||||
name: "User",
|
|
||||||
inheritAttrs: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
import UserAPI from "@/api/user";
|
|
||||||
import { UserForm } from "@/api/user/model";
|
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
// 基础表单
|
||||||
|
const baseForm = reactive({});
|
||||||
|
const baseFormRef = ref(ElForm); // 表单
|
||||||
const loading = ref(false); // 加载状态
|
const loading = ref(false); // 加载状态
|
||||||
|
// 校验规则
|
||||||
const calTypeList = ref<OptionType[]>(); // 角色下拉数据源
|
const baseRules = reactive({
|
||||||
|
tool_name: [{ required: true, message: "工具链名称不能为空", trigger: "blur" }],
|
||||||
// 用户表单数据
|
tool_desc: [{ required: true, message: "工具链描述不能为空", trigger: "blur" }],
|
||||||
const formData = reactive<UserForm>({
|
|
||||||
status: 1,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const form = reactive({});
|
||||||
|
const formRef = ref(ElForm); // 表单
|
||||||
|
const fileStatus = ref(false); // 文件状态
|
||||||
|
const formLoading = ref(false); // 表单加载状态
|
||||||
|
const dialogFormVisible = ref(false); // 弹窗加载状态
|
||||||
// 校验规则
|
// 校验规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
username: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
|
params_name: [{ required: true, message: "运行参数名称不能为空", trigger: "blur" }],
|
||||||
nickname: [{ required: true, message: "用户昵称不能为空", trigger: "blur" }],
|
params_desc: [{ required: true, message: "运行参数描述不能为空", trigger: "blur" }],
|
||||||
deptId: [{ required: true, message: "所属部门不能为空", trigger: "blur" }],
|
params_content: [{ required: true, message: "运行参数文件不能为空", trigger: "blur" }],
|
||||||
roleIds: [{ required: true, message: "用户角色不能为空", trigger: "blur" }],
|
|
||||||
email: [
|
|
||||||
{
|
|
||||||
pattern: /\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/,
|
|
||||||
message: "请输入正确的邮箱地址",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
mobile: [
|
|
||||||
{
|
|
||||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
||||||
message: "请输入正确的手机号码",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const list = [
|
|
||||||
{
|
|
||||||
csmc: "10.0.8.12",
|
|
||||||
csms: "异腾310",
|
|
||||||
csmc1: "Atlas 2000 DK A2",
|
|
||||||
csmc2: "PCIE-AI-NPU",
|
|
||||||
csmc3: "华为",
|
|
||||||
csmc4: "1.2",
|
|
||||||
csmc5: "已连接",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
csmc: "192.168.1.44",
|
|
||||||
csms: "思源220",
|
|
||||||
csmc1: "Atlas 2000 DK A2",
|
|
||||||
csmc2: "PCIE-AI-NPU",
|
|
||||||
csmc3: "华为",
|
|
||||||
csmc4: "1.2",
|
|
||||||
csmc5: "已连接",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
csmc: "192.168.1.66",
|
|
||||||
csms: "RTX4090",
|
|
||||||
csmc1: "Atlas 2000 DK A2",
|
|
||||||
csmc2: "PCIE-AI-NPU",
|
|
||||||
csmc3: "华为",
|
|
||||||
csmc4: "1.2",
|
|
||||||
csmc5: "已连接",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
/** 表单提交 */
|
/** 表单提交 */
|
||||||
const handleSubmit = useThrottleFn(() => {
|
const handleSubmitFile = useThrottleFn(() => {
|
||||||
loading.value = true;
|
formRef.value.validate((valid: any) => {
|
||||||
setTimeout(() => {
|
if (valid) {
|
||||||
ElMessage.success("修改用户成功");
|
ElMessage.success("保存成功");
|
||||||
loading.value = false;
|
//formLoading.value = true;
|
||||||
closeBack();
|
// ToolChainshApi.editTool(form.tool_id,form)
|
||||||
}, 1000);
|
// .then((res) => {
|
||||||
|
// if (res.data.code == 0) {
|
||||||
|
// ElMessage.success("修改成功");
|
||||||
|
// handleQuery();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// dialogFormVisible.value = false;
|
||||||
|
// formLoading.value = false;
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
});
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
|
||||||
|
/** 添加运行参数 */
|
||||||
|
function handlePushParams(){
|
||||||
|
form.value = {};
|
||||||
|
dialogFormVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 文件上传
|
||||||
|
function handleFileChange(file) {
|
||||||
|
//先创建一个读文件的对象 FileReader
|
||||||
|
let reader = new FileReader();
|
||||||
|
//判断浏览器是否支持 FileReader
|
||||||
|
if (typeof FileReader === "undefined") {
|
||||||
|
this.$message({
|
||||||
|
type: "info",
|
||||||
|
message: "您的浏览器不支持文件读取。",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uploadFile(file).then((res) => {
|
||||||
|
if (isJSON(res)) {
|
||||||
|
let jsonStr = JSON.stringify(res);
|
||||||
|
form.params_content = jsonStr;
|
||||||
|
formRef.value.validateField("params_content");
|
||||||
|
fileStatus.value = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 解析json */
|
||||||
|
function isJSON(str) {
|
||||||
|
try {
|
||||||
|
// 尝试解析输入的字符串
|
||||||
|
JSON.parse(str);
|
||||||
|
ElMessage.success("JSON文件解析成功");
|
||||||
|
return true;
|
||||||
|
// 成功解析
|
||||||
|
} catch (error) {
|
||||||
|
// 解析失败
|
||||||
|
ElMessage.error("JSON文件解析失败");
|
||||||
|
uploadRef.value.clearFiles();
|
||||||
|
fileStatus.value = false;
|
||||||
|
form.params_content = "";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 文件读取
|
||||||
|
function uploadFile(file) {
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
let reader = new FileReader();
|
||||||
|
reader.readAsArrayBuffer(file.raw);
|
||||||
|
reader.onload = function (e) {
|
||||||
|
var ints = new Uint8Array(e.target.result); //要使用读取的内容,所以将读取内容转化成Uint8Array
|
||||||
|
let snippets = new TextDecoder("UTF-8").decode(ints); //二进制缓存区内容转化成中文(即也就是读取到的内容)
|
||||||
|
resolve(snippets);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 文件删除
|
||||||
|
function handleFileRemove() {
|
||||||
|
form.params_content = "";
|
||||||
|
fileStatus.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 超出限制,清空文件列表
|
||||||
|
function handleFileExceed() {
|
||||||
|
uploadRef.value.clearFiles();
|
||||||
|
ElMessage.warning("已清空文件列表,请重新上传!");
|
||||||
|
handleFileRemove();
|
||||||
|
}
|
||||||
|
|
||||||
/** 返回默认页面 */
|
/** 返回默认页面 */
|
||||||
function closeBack() {
|
function closeBack() {
|
||||||
router.replace({ path: "/tester/otherTool" });
|
router.replace({ path: "/tester/otherTool" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 初始化数据 */
|
||||||
|
function initData(){
|
||||||
|
let id=route.query.id;
|
||||||
|
var row = localStorage.getItem('toolChainsKey-'+id);
|
||||||
|
if(!row){
|
||||||
|
ElMessage.error("未找到相关数据,请从列表页进入详情");
|
||||||
|
closeBack();
|
||||||
|
}
|
||||||
|
baseForm = row;
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
//handleQuery();
|
//initData();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
Loading…
Reference in New Issue