update code
parent
1b6dca100a
commit
3da7053984
|
@ -54,6 +54,7 @@
|
|||
"color": "^4.2.3",
|
||||
"echarts": "^5.5.0",
|
||||
"element-plus": "^2.7.2",
|
||||
"js-md5": "^0.8.3",
|
||||
"lodash-es": "^4.17.21",
|
||||
"net": "^1.0.2",
|
||||
"nprogress": "^0.2.0",
|
||||
|
|
|
@ -1 +1,57 @@
|
|||
function init(){var s=location.search;var url="";var onnxModelName="";if(s.indexOf("=")>=0){url=s.substring(s.indexOf("=")+1);if(url.toLocaleLowerCase().indexOf(".onnx")>=0){onnxModelName=url.substring(url.lastIndexOf("/")+1)}else{console.error("使用方法:onnx.html?url=[onnx路径]");return}}else{console.error("使用方法:onnx.html?url=[onnx路径]");return}document.body.title=onnxModelName;var http=new XMLHttpRequest;http.responseType="arraybuffer";http.open("GET",url);http.onload=function(){if(http.status==200){var reader=proto.protobuf.Reader.create(new Uint8Array(http.response));var onnxProtoModel=window.proto.onnx.ModelProto.decode(reader);let{locations,graphs}=window.getExternalLocations(onnxProtoModel);let model=new window.onnx.Model(onnxProtoModel,graphs,new Map);let host=window;let view=new window.View(host);view.start().then(data=>{view.open(model,onnxModelName)}).catch(err=>{console.log(err)});window.mainView=view}};http.send()}function exportImg(file,blob){const element=this.document.createElement("a");element.download=file;element.href=URL.createObjectURL(blob);this.document.body.appendChild(element);element.click();this.document.body.removeChild(element)}function toggleMenu(){let el=document.getElementById("menu");if(el.style.display=="none"){el.style.display="block";updateState()}else{el.style.display="none"}}function doToggle(att){mainView.toggle(att);updateState()}function updateState(){var op=mainView.options;document.getElementById("opAtt").innerText=op.attributes?"Hide Attributes":"Show Attributes";document.getElementById("opWeight").innerText=op.weights?"Hide Weights":"Show Weights";document.getElementById("opName").innerText=op.names?"Hide Names":"Show Names";document.getElementById("opDir").innerText=op.direction=="vertical"?"Show Horizontal":"Show Vertical";document.getElementById("opMouse").innerText=op.mousewheel=="scroll"?"Mouse Wheel: Zoom":"Mouse Wheel: Scroll"}init();
|
||||
function init() {
|
||||
var s = location.search;
|
||||
var url = "";
|
||||
var onnxModelName = "";
|
||||
if (s.indexOf("=") >= 0) {
|
||||
url = s.substring(s.indexOf("=") + 1);
|
||||
} else {
|
||||
console.error("使用方法:onnx.html?id=[模型ID]")
|
||||
return;
|
||||
}
|
||||
|
||||
document.body.title = onnxModelName;
|
||||
var accessToken = localStorage.getItem("accessToken");
|
||||
var http = new XMLHttpRequest();
|
||||
http.responseType = "json"
|
||||
|
||||
http.open('GET', MODELDOWNLOADAPI + `${url}/download`);
|
||||
http.setRequestHeader("Authorization", accessToken);
|
||||
http.onload = function () {
|
||||
if (http.status == 200) {
|
||||
var reader = proto.protobuf.Reader.create(base64ToUint8Array(http.response.data.file_content));
|
||||
var onnxProtoModel = window.proto.onnx.ModelProto.decode(reader);
|
||||
let { locations, graphs } = window.getExternalLocations(onnxProtoModel);
|
||||
let model = new window.onnx.Model(onnxProtoModel, graphs, new Map());
|
||||
|
||||
let host = window;
|
||||
let view = new window.View(host);
|
||||
view.start().then((data) => {
|
||||
view.open(model, onnxModelName);
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
window.mainView = view;
|
||||
}
|
||||
};
|
||||
http.send();
|
||||
}
|
||||
|
||||
function base64ToUint8Array(base64String) {
|
||||
try {
|
||||
let padding = '='.repeat((4 - base64String.length % 4) % 4);
|
||||
let base64 = (base64String + padding)
|
||||
.replace(/\-/g, '+')
|
||||
.replace(/_/g, '/');
|
||||
let rawData = atob(base64);
|
||||
let outputArray = new Uint8Array(rawData.length);
|
||||
for (let i = 0; i < rawData.length; ++i) {
|
||||
outputArray[i] = rawData.charCodeAt(i);
|
||||
}
|
||||
return outputArray;
|
||||
}
|
||||
catch (e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
init();
|
File diff suppressed because it is too large
Load Diff
|
@ -1,34 +1,35 @@
|
|||
import request from "@/utils/request";
|
||||
//获取任务列表
|
||||
const tasks=()=>{
|
||||
const tasks = () => {
|
||||
return request({
|
||||
url:'/tasks',
|
||||
method:'get'
|
||||
url: '/tasks',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//获取可用的设备状态
|
||||
const availableDevices=()=>{
|
||||
const availableDevices = (data) => {
|
||||
return request({
|
||||
url:'/tasks/available_devices',
|
||||
method:'get'
|
||||
url: '/tasks/available_devices',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
//获取正在执行的任务
|
||||
const running=()=>{
|
||||
//获取正在执行的任务
|
||||
const running = () => {
|
||||
return request({
|
||||
url:'/tasks/running',
|
||||
method:'get'
|
||||
url: '/tasks/running',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//创建推理任务
|
||||
const addTask=(data)=>{
|
||||
const addTask = (data) => {
|
||||
return request({
|
||||
url:'/tasks',
|
||||
url: '/tasks',
|
||||
method: 'post',
|
||||
data:data
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export default{
|
||||
export default {
|
||||
tasks,
|
||||
availableDevices,
|
||||
running,
|
||||
|
|
|
@ -81,12 +81,11 @@
|
|||
<span class="sp-label">输入参数:</span>
|
||||
<div class="div-param">
|
||||
<div v-if="info.param.inputs.length > 1" class="div-navs">
|
||||
<span v-for="(it, idx) in info.param.inputs" @click="doInputSelected(idx)" :key="idx"
|
||||
class="sp-nav" :class="it.selected ? 'active' : ''">{{ it.input_id }}</span>
|
||||
<span v-for="(it, idx) in info.param.inputs" @click="doInputSelected(idx)" :key="idx" class="sp-nav"
|
||||
:class="it.selected ? 'active' : ''">{{ it.input_id }}</span>
|
||||
</div>
|
||||
<span class="sp-text sp-paramter scroll">
|
||||
<span v-for="(it, idx) in info.param.inputs " :key="idx" v-show="it.selected"
|
||||
class="param-item">
|
||||
<span v-for="(it, idx) in info.param.inputs " :key="idx" v-show="it.selected" class="param-item">
|
||||
<paramShow :paramInfo="it"></paramShow>
|
||||
</span>
|
||||
</span>
|
||||
|
@ -96,13 +95,12 @@
|
|||
<span class="sp-label">输出参数:</span>
|
||||
<div class="div-param">
|
||||
<div v-if="info.param.outputs.length > 1" class="div-navs">
|
||||
<span v-for="(it, idx) in info.param.outputs" @click="doOutputSelected(idx)"
|
||||
:key="idx" class="sp-nav" :class="it.selected ? 'active' : ''">{{ it.output_id
|
||||
<span v-for="(it, idx) in info.param.outputs" @click="doOutputSelected(idx)" :key="idx" class="sp-nav"
|
||||
:class="it.selected ? 'active' : ''">{{ it.output_id
|
||||
}}</span>
|
||||
</div>
|
||||
<span class="sp-text sp-paramter scroll">
|
||||
<span v-for="(it, idx) in info.param.outputs " :key="idx" v-show="it.selected"
|
||||
class="param-item">
|
||||
<span v-for="(it, idx) in info.param.outputs " :key="idx" v-show="it.selected" class="param-item">
|
||||
<paramShow :paramInfo="it"></paramShow>
|
||||
</span>
|
||||
</span>
|
||||
|
@ -170,14 +168,14 @@ const doNodeClick = (node) => {
|
|||
onMounted(() => {
|
||||
loadData();
|
||||
});
|
||||
const doInputSelected=idx=>{
|
||||
info.param.inputs.forEach((it,i)=>{
|
||||
it.selected=i==idx;
|
||||
const doInputSelected = idx => {
|
||||
info.param.inputs.forEach((it, i) => {
|
||||
it.selected = i == idx;
|
||||
});
|
||||
}
|
||||
const doOutputSelected=idx=>{
|
||||
info.param.outputs.forEach((it,i)=>{
|
||||
it.selected=i==idx;
|
||||
const doOutputSelected = idx => {
|
||||
info.param.outputs.forEach((it, i) => {
|
||||
it.selected = i == idx;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -190,10 +188,11 @@ const doOutputSelected=idx=>{
|
|||
}
|
||||
|
||||
.detail-content {
|
||||
.sp-text{
|
||||
.sp-text {
|
||||
display: inline-block;
|
||||
margin-left:4px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.sp-paramter {
|
||||
height: 100px;
|
||||
border: solid 1px #409EFF;
|
||||
|
@ -257,7 +256,7 @@ const doOutputSelected=idx=>{
|
|||
.sp-text {
|
||||
flex-grow: 1;
|
||||
display: block;
|
||||
margin-left:4px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.div-param {
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
|
||||
<el-table v-loading="loading" :data="info.data" stripe @selection-change="handleSelectionChange">
|
||||
<el-table-column label="模型名称" align="left" prop="model_name" />
|
||||
<el-table-column label="网络名称" align="left" prop="modl_net_type" width="120"/>
|
||||
<el-table-column label="模型类型" align="left" prop="modl_main_type_name">
|
||||
<template #default="{row}">{{ row.modl_main_type_name }}/{{row.modl_sub_type_name }}</template>
|
||||
<el-table-column label="网络名称" align="left" prop="modl_net_type" width="120" />
|
||||
<el-table-column label="模型类型" align="left" prop="modl_net_type">
|
||||
<template #default="{ row }">{{ row.modl_main_type_name }}/{{ row.modl_sub_type_name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="版本" align="left" prop="connection_version" />
|
||||
<el-table-column label="互联名称" align="left" prop="connection_name" width="120"/>
|
||||
<el-table-column label="互联名称" align="left" prop="connection_name" width="120" />
|
||||
<el-table-column label="互联说明" align="left" prop="connection_desc" />
|
||||
<el-table-column label="互联创建时间" width="120" align="left" prop="create_time" />
|
||||
<el-table-column label="创建用户" width="100" align="left" prop="user_name" />
|
||||
|
@ -38,15 +38,13 @@
|
|||
<el-table-column label="操作" fixed="right" align="center" width="270">
|
||||
<template #default="scope">
|
||||
<template v-if="scope.row.connection_created">
|
||||
<el-button text type="primary" size="small" @click="doShowDetail(scope.row)"><i-ep-edit />查看</el-button>
|
||||
<el-button text type="primary" size="small"
|
||||
@click="doShowDetail(scope.row)"><i-ep-edit />查看</el-button>
|
||||
<el-button text type="primary" size="small"
|
||||
@click="doEdit(scope.row.connection_id)"><i-ep-link/>修改互联</el-button>
|
||||
@click="doEdit(scope.row.connection_id)"><i-ep-link />修改互联</el-button>
|
||||
<el-button text type="primary" size="small" @click="handleDelete(scope.row)"><i-ep-delete />删除</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button text type="primary" size="small"
|
||||
@click="doAdd(scope.row)">新建互联</el-button>
|
||||
<el-button text type="primary" size="small" @click="doAdd(scope.row)">新建互联</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -72,13 +70,13 @@ const removeIds = ref([]); // 删除用户ID集合 用于批量删除
|
|||
const queryParams = reactive<any>({
|
||||
page_num: 1,
|
||||
page_size: 10,
|
||||
connection_name:''
|
||||
connection_name: ''
|
||||
});
|
||||
const dateTimeRange = ref("");
|
||||
const total = ref(100); // 数据总数
|
||||
const info=reactive({
|
||||
total:0,
|
||||
data:[]
|
||||
const info = reactive({
|
||||
total: 0,
|
||||
data: []
|
||||
})
|
||||
watch(dateTimeRange, (newVal) => {
|
||||
if (newVal) {
|
||||
|
@ -90,15 +88,15 @@ watch(dateTimeRange, (newVal) => {
|
|||
/** 查询 */
|
||||
function handleQuery() {
|
||||
loading.value = true;
|
||||
ConnApi.list(queryParams).then(d=>{
|
||||
ConnApi.list(queryParams).then(d => {
|
||||
loading.value = false;
|
||||
info.total=d.data?.total||0;
|
||||
info.data=d.data?.data||[];
|
||||
info.total = d.data?.data?.total || 0;
|
||||
info.data = d.data?.data?.connection_list || [];
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function doUploadModel(){
|
||||
function doUploadModel() {
|
||||
router.push({ path: "/modelMgr/uploadModel" });
|
||||
}
|
||||
|
||||
|
@ -125,24 +123,24 @@ function handleDelete(row: { [key: string]: any }) {
|
|||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(function () {
|
||||
ConnApi.deleteConnect(row.connection_id).then(d=>{
|
||||
if(d.data.code==0){
|
||||
ConnApi.deleteConnect(row.connection_id).then(d => {
|
||||
if (d.data.code == 0) {
|
||||
ElMessage.success("删除互联成功");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const doShowDetail=(row:any)=>{
|
||||
router.push({path:"/connection/detail",query:{id:row.connection_id}})
|
||||
const doShowDetail = (row: any) => {
|
||||
router.push({ path: "/connection/detail", query: { id: row.connection_id } })
|
||||
}
|
||||
|
||||
const doEdit=(row:any)=>{
|
||||
router.push({path:"/connection/edit",query:{id:row.connection_id,type:'edit'}})
|
||||
const doEdit = (row: any) => {
|
||||
router.push({ path: "/connection/edit", query: { id: row.connection_id, type: 'edit' } })
|
||||
}
|
||||
|
||||
const doAdd=(row:any)=>{
|
||||
router.push({path:"/connection/edit",query:{id:row.connection_id,type:'add'}})
|
||||
const doAdd = (row: any) => {
|
||||
router.push({ path: "/connection/edit", query: { id: row.connection_id, type: 'add' } })
|
||||
}
|
||||
|
||||
|
||||
|
@ -153,19 +151,21 @@ onMounted(() => {
|
|||
|
||||
|
||||
<style scoped lang='scss'>
|
||||
.search-container{
|
||||
display:flex;
|
||||
.search-container {
|
||||
display: flex;
|
||||
}
|
||||
.card-footer{
|
||||
|
||||
.card-footer {
|
||||
position: fixed;
|
||||
width: calc(100% - 215px);
|
||||
bottom: 0px;
|
||||
:deep(.el-card__body){
|
||||
padding:0px;
|
||||
.el-pagination{
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 0px;
|
||||
|
||||
.el-pagination {
|
||||
justify-content: end;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ defineExpose({
|
|||
})
|
||||
|
||||
const initData = () => {
|
||||
OperApi.list().then(d => {
|
||||
OperApi.list({ page_num: 1, page_size: 100 }).then(d => {
|
||||
let tmps = (d.data?.data?.operator_list || []).map(it => {
|
||||
it.show = true;
|
||||
it.text = it.operator_name;
|
||||
|
@ -186,6 +186,7 @@ onMounted(() => {
|
|||
&.item4 {
|
||||
background: #A7BEE7;
|
||||
}
|
||||
|
||||
&.item5 {
|
||||
background: #4C8DD1;
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
<tr>
|
||||
<td style="width: 50%;">
|
||||
<span class="sp-title">模型名称:</span>
|
||||
<span class="sp-text">{{modelInfo.info.model_name}}</span>
|
||||
<span class="sp-text">{{ modelInfo.info.model_name }}</span>
|
||||
</td>
|
||||
<td style="width: 50%;">
|
||||
<span class="sp-title">模型类型:</span>
|
||||
<span class="sp-text">{{modelInfo.info.modl_main_type_name}}
|
||||
/{{modelInfo.info.modl_sub_type_name}}
|
||||
<span class="sp-text">{{ modelInfo.info.modl_main_type_name }}
|
||||
/{{ modelInfo.info.modl_sub_type_name }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -21,13 +21,13 @@
|
|||
<td style="width: 50%;">
|
||||
<span class="sp-title">模型版本:</span>
|
||||
<span class="sp-text">
|
||||
{{modelInfo.info.model_version}}
|
||||
{{ modelInfo.info.model_version }}
|
||||
</span>
|
||||
</td>
|
||||
<td style="width: 50%;">
|
||||
<span class="sp-title">版本描述:</span>
|
||||
<span class="sp-text">
|
||||
{{modelInfo.info.model_desc}}
|
||||
{{ modelInfo.info.model_desc }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -35,25 +35,25 @@
|
|||
<td style="width: 50%;">
|
||||
<span class="sp-title">模型网络:</span>
|
||||
<span class="sp-text">
|
||||
{{modelInfo.info.modl_net_type}}
|
||||
{{ modelInfo.info.model_net_type }}
|
||||
</span>
|
||||
</td>
|
||||
<td style="width: 50%;">
|
||||
<span class="sp-title">上传用户:</span>
|
||||
<span class="sp-text"> {{modelInfo.info.user_name}}</span>
|
||||
<span class="sp-text"> {{ modelInfo.info.user_name }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%;">
|
||||
<span class="sp-title">算法框架:</span>
|
||||
<span class="sp-text">
|
||||
{{modelInfo.info.modl_framework}}
|
||||
{{ modelInfo.info.modl_framework }}
|
||||
</span>
|
||||
</td>
|
||||
<td style="width: 50%;">
|
||||
<span class="sp-title">上传时间:</span>
|
||||
<span class="sp-text">
|
||||
{{modelInfo.info.create_time}}
|
||||
{{ modelInfo.info.create_time }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -61,13 +61,15 @@
|
|||
<td style="width: 50%;">
|
||||
<span class="sp-title">文件格式:</span>
|
||||
<span class="sp-text">
|
||||
{{modelInfo.info.modl_file_type}}
|
||||
{{ modelInfo.info.modl_file_type }}
|
||||
</span>
|
||||
</td>
|
||||
<td style="width: 50%;">
|
||||
<span class="sp-title">网络配置:</span>
|
||||
<span class="sp-text sp-file">
|
||||
<a style="line-height:24px;"ref="#"><el-icon><Document /></el-icon>查看配置文件</a>
|
||||
<a style="line-height:24px;" ref="#"><el-icon>
|
||||
<Document />
|
||||
</el-icon>查看配置文件</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -76,7 +78,7 @@
|
|||
<el-card style="margin-top: 12px;">
|
||||
<template #header>
|
||||
<svg-icon icon-class="pause" style="width:20px;height:20px;" />可适配算子</template>
|
||||
<el-button v-for="(it,idx) in modelInfo.opers" :key="idx">{{ it.oper_type_name }}</el-button>
|
||||
<el-button v-for="(it, idx) in modelInfo.opers" :key="idx">{{ it.operator_name }}</el-button>
|
||||
|
||||
</el-card>
|
||||
<el-card style="margin-top: 12px;margin-bottom:60px;">
|
||||
|
@ -84,7 +86,8 @@
|
|||
<svg-icon icon-class="pause" style="width:20px;height:20px;" />
|
||||
模型结构</template>
|
||||
<div style="position: relative;min-height:50vh;" class="scroll">
|
||||
<iframe frameborder="0" scrolling="no" :src="url" style="width:100%;height:100%;position: absolute;top:0px;"></iframe>
|
||||
<iframe frameborder="0" scrolling="no" :src="url"
|
||||
style="width:100%;height:100%;position: absolute;top:0px;"></iframe>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="card-footer">
|
||||
|
@ -97,61 +100,69 @@
|
|||
import ModelApi from '@/api/models'
|
||||
import request from 'axios'
|
||||
const router = useRouter();
|
||||
const route =useRoute()
|
||||
let url=ref("")
|
||||
let modelInfo=reactive({
|
||||
info:{},
|
||||
opers:[]
|
||||
const route = useRoute()
|
||||
let url = ref("")
|
||||
let modelInfo = reactive({
|
||||
info: {},
|
||||
opers: []
|
||||
})
|
||||
const initData=()=>{
|
||||
let id=route.query.id;
|
||||
let ajaxs=[];
|
||||
const initData = () => {
|
||||
let id = route.query.id;
|
||||
let ajaxs = [];
|
||||
ajaxs.push(ModelApi.findOne(id))
|
||||
ajaxs.push(ModelApi.adaptOperators(id));
|
||||
request.all(ajaxs).then(res=>{
|
||||
modelInfo.info=res[0].data?.data||{};
|
||||
modelInfo.opers=res[1].data?.data?.adapt_operator_list||[];
|
||||
request.all(ajaxs).then(res => {
|
||||
modelInfo.info = res[0].data?.data || {};
|
||||
modelInfo.opers = res[1].data?.data?.adapt_operator_list || [];
|
||||
});
|
||||
};
|
||||
onMounted(()=>{
|
||||
url.value="./onnx/onnx.html?url=/ai/siamRPN_192.onnx";
|
||||
onMounted(() => {
|
||||
let id = route.query.id;
|
||||
url.value = "./onnx/onnx.html?id=" + id;
|
||||
initData();
|
||||
});
|
||||
const doBack=()=>{
|
||||
if(route.query.from=='simulation'){
|
||||
router.push({path:"/simulationEvaluation/index"})
|
||||
const doBack = () => {
|
||||
if (route.query.from == 'simulation') {
|
||||
router.push({ path: "/simulationEvaluation/index" })
|
||||
return;
|
||||
}
|
||||
router.push({path:"/modelMgr/index"})
|
||||
router.push({ path: "/modelMgr/index" })
|
||||
}
|
||||
</script>
|
||||
<style scoped lang='scss'>
|
||||
.model-detail{
|
||||
:deep(.el-card__header){
|
||||
padding:8px 4px;
|
||||
.model-detail {
|
||||
:deep(.el-card__header) {
|
||||
padding: 8px 4px;
|
||||
display: flex;
|
||||
align-items: center
|
||||
}
|
||||
}
|
||||
.sp-file{
|
||||
color:#29d;
|
||||
|
||||
.sp-file {
|
||||
color: #29d;
|
||||
}
|
||||
.tb-base-info{
|
||||
|
||||
.tb-base-info {
|
||||
line-height: 30px;
|
||||
:deep(span){
|
||||
|
||||
:deep(span) {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
:deep(.svg-icon){
|
||||
margin-right:8px;
|
||||
|
||||
:deep(.svg-icon) {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.card-footer{
|
||||
|
||||
.card-footer {
|
||||
position: fixed;
|
||||
width: calc(100% - 215px);
|
||||
bottom: 0px;
|
||||
:deep(.el-card__body){
|
||||
padding:10px;
|
||||
.el-pagination{
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 10px;
|
||||
|
||||
.el-pagination {
|
||||
justify-content: end;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,51 +28,52 @@
|
|||
import connApi from '@/api/connection'
|
||||
const loading = ref(false);
|
||||
const modelSelection = ref("")//单选id
|
||||
const info=reactive({
|
||||
data:[]
|
||||
const info = reactive({
|
||||
data: []
|
||||
})
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
connection_name:''
|
||||
connection_name: ''
|
||||
});
|
||||
const total = ref(100); // 数据总数
|
||||
|
||||
const handleChange = (row) => {
|
||||
modelSelection.value = row.id + "";
|
||||
}
|
||||
const doRowClick=(row)=>{
|
||||
modelSelection.value=row.id+"";
|
||||
const doRowClick = (row) => {
|
||||
modelSelection.value = row.id + "";
|
||||
}
|
||||
/** 查询 */
|
||||
function handleQuery(a) {
|
||||
if(a){
|
||||
queryParams.pageSize=a.limit;
|
||||
queryParams.pageNum=a.page;
|
||||
if (a) {
|
||||
queryParams.pageSize = a.limit;
|
||||
queryParams.pageNum = a.page;
|
||||
}
|
||||
//ElMessage.success("查询成功");
|
||||
loading.value = true;
|
||||
connApi.list(queryParams).then(d=>{
|
||||
loading.value=false;
|
||||
info.data=(d.data?.data||[]).map(it=>{
|
||||
it.id=it.connection_id;
|
||||
it.modelType=it.modl_main_type_name+"/"+it.modl_sub_type_name;
|
||||
connApi.list(queryParams).then(d => {
|
||||
loading.value = false; debugger
|
||||
info.data = (d.data?.data?.connection_list || []).map(it => {
|
||||
|
||||
it.id = it.model_id;
|
||||
it.modelType = it.modl_net_type;
|
||||
return it;
|
||||
});
|
||||
total.value=d.data?.total||0;
|
||||
total.value = d.data?.data?.total || 0;
|
||||
});
|
||||
|
||||
}
|
||||
const checkForm=()=>{
|
||||
if(modelSelection.value){
|
||||
let tmps=info.data.filter(d=>d.id==modelSelection.value);
|
||||
return tmps.length>0?tmps[0]:null;
|
||||
const checkForm = () => {
|
||||
if (modelSelection.value) {
|
||||
let tmps = info.data.filter(d => d.id == modelSelection.value);
|
||||
return tmps.length > 0 ? tmps[0] : null;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
onMounted(()=>{
|
||||
onMounted(() => {
|
||||
handleQuery();
|
||||
});
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@ const doChoiceSuccess = item => {
|
|||
function handleQuery() {
|
||||
loading.value = true;
|
||||
let m = props.modelInfo;
|
||||
debugger
|
||||
taskApi
|
||||
.availableDevices({
|
||||
connection_id: m.connection_id,
|
||||
|
|
|
@ -6045,6 +6045,11 @@ js-base64@^2.1.9:
|
|||
resolved "https://registry.npmmirror.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4"
|
||||
integrity sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==
|
||||
|
||||
js-md5@^0.8.3:
|
||||
version "0.8.3"
|
||||
resolved "https://registry.npmmirror.com/js-md5/-/js-md5-0.8.3.tgz#921bab7efa95bfc9d62b87ee08a57f8fe4305b69"
|
||||
integrity sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ==
|
||||
|
||||
js-tokens@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
||||
|
|
Loading…
Reference in New Issue