2024-06-18 01:04:33 +08:00
|
|
|
|
<!-- 用户管理 -->
|
2024-06-17 23:47:02 +08:00
|
|
|
|
<template>
|
2024-06-18 01:04:33 +08:00
|
|
|
|
<div class="app-container">
|
|
|
|
|
<div class="search-container">
|
|
|
|
|
<el-button type="primary" @click="doUploadModel" ><i-ep-plus />上传模型</el-button>
|
|
|
|
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" style="flex-grow: 1;text-align: right;">
|
|
|
|
|
<el-form-item label="" prop="keywords">
|
2024-07-06 22:58:31 +08:00
|
|
|
|
<el-input v-model="queryParams.model_name" placeholder="请输入模型名称" clearable style="width: 200px"
|
2024-06-18 01:04:33 +08:00
|
|
|
|
@keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" @click="handleQuery"><i-ep-search />搜索</el-button>
|
|
|
|
|
<el-button @click="resetQuery">
|
|
|
|
|
<i-ep-refresh />
|
|
|
|
|
重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
2024-06-17 23:47:02 +08:00
|
|
|
|
|
2024-06-18 01:04:33 +08:00
|
|
|
|
<el-card shadow="never" class="table-container">
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="tableData" stripe @selection-change="handleSelectionChange">
|
2024-07-06 22:58:31 +08:00
|
|
|
|
<el-table-column label="模型名称" align="left" prop="model_name" width="300"/>
|
|
|
|
|
<el-table-column label="网络名称" align="left" prop="model_network" />
|
|
|
|
|
<el-table-column label="模型类型" align="left" prop="modl_sub_type_name" />
|
|
|
|
|
<el-table-column label="版本" align="left" prop="model_version" />
|
|
|
|
|
<el-table-column label="说明" width="300" align="left" prop="model_desc" />
|
|
|
|
|
<el-table-column label="上传时间" width="120" align="left" prop="create_time" />
|
|
|
|
|
<el-table-column label="上传用户" width="100" align="left" prop="user_name" />
|
2024-06-18 01:04:33 +08:00
|
|
|
|
<el-table-column label="操作" fixed="right" width="250">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button text type="primary" size="small"
|
2024-06-19 00:20:35 +08:00
|
|
|
|
@click="doShowModelDetail(scope.row)"><i-ep-edit />查看</el-button>
|
2024-06-18 01:04:33 +08:00
|
|
|
|
<el-button text type="primary" size="small"
|
2024-07-07 00:29:07 +08:00
|
|
|
|
@click="doProtocol()"><i-ep-link/>互联</el-button>
|
2024-06-18 01:04:33 +08:00
|
|
|
|
<el-button text type="primary" size="small" @click="handleDelete(scope.row)"><i-ep-delete />删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-card>
|
|
|
|
|
<el-card class="card-footer">
|
|
|
|
|
<pagination v-if="total > 0" v-model:total="total" v-model:page="queryParams.pageNum"
|
|
|
|
|
v-model:limit="queryParams.pageSize" @pagination="handleQuery" />
|
|
|
|
|
</el-card>
|
2024-06-17 23:47:02 +08:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-06-18 01:04:33 +08:00
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
defineOptions({
|
|
|
|
|
name: "calculateIndex",
|
|
|
|
|
inheritAttrs: false,
|
|
|
|
|
});
|
2024-07-06 22:58:31 +08:00
|
|
|
|
import ModelApi from '@/api/models'
|
2024-06-18 01:04:33 +08:00
|
|
|
|
|
|
|
|
|
import { UserQuery } from "@/api/user/model";
|
|
|
|
|
|
|
|
|
|
const queryFormRef = ref(ElForm); // 查询表单
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
const loading = ref(false); // 加载状态
|
|
|
|
|
const removeIds = ref([]); // 删除用户ID集合 用于批量删除
|
2024-07-06 22:58:31 +08:00
|
|
|
|
let queryParams = reactive<any>({
|
|
|
|
|
page_num: 1,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
model_name:''
|
2024-06-18 01:04:33 +08:00
|
|
|
|
});
|
|
|
|
|
const dateTimeRange = ref("");
|
2024-07-06 22:58:31 +08:00
|
|
|
|
let total = ref(100); // 数据总数
|
2024-06-18 01:04:33 +08:00
|
|
|
|
|
|
|
|
|
watch(dateTimeRange, (newVal) => {
|
|
|
|
|
if (newVal) {
|
|
|
|
|
queryParams.startTime = newVal[0];
|
|
|
|
|
queryParams.endTime = newVal[1];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2024-07-06 22:58:31 +08:00
|
|
|
|
let tableData = ref([])
|
2024-06-18 01:04:33 +08:00
|
|
|
|
/** 查询 */
|
|
|
|
|
function handleQuery() {
|
2024-07-06 22:58:31 +08:00
|
|
|
|
ModelApi.list(queryParams).then(d=>{
|
|
|
|
|
total.value=d.data.data.total||0;
|
|
|
|
|
tableData.value=d.data.data.model_list||[];
|
|
|
|
|
});
|
2024-06-18 01:04:33 +08:00
|
|
|
|
loading.value = true;
|
2024-07-07 00:29:07 +08:00
|
|
|
|
//ElMessage.success("查询成功");
|
2024-06-18 01:04:33 +08:00
|
|
|
|
loading.value = false;
|
|
|
|
|
|
|
|
|
|
}
|
2024-07-07 00:29:07 +08:00
|
|
|
|
const doUploadModel=()=>{
|
2024-06-18 01:04:33 +08:00
|
|
|
|
router.replace({ path: "/modelMgr/uploadModel" });
|
|
|
|
|
}
|
2024-07-07 00:29:07 +08:00
|
|
|
|
function doProtocol(){
|
|
|
|
|
router.replace({ path: "/protocol/index" });
|
|
|
|
|
}
|
2024-06-18 01:04:33 +08:00
|
|
|
|
|
|
|
|
|
/** 重置查询 */
|
|
|
|
|
function resetQuery() {
|
|
|
|
|
queryFormRef.value.resetFields();
|
|
|
|
|
dateTimeRange.value = "";
|
2024-07-06 22:58:31 +08:00
|
|
|
|
queryParams.page_num = 1;
|
|
|
|
|
queryParams.model_name='';
|
2024-06-18 01:04:33 +08:00
|
|
|
|
handleQuery();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 行选中 */
|
|
|
|
|
function handleSelectionChange(selection: any) {
|
2024-07-06 22:58:31 +08:00
|
|
|
|
removeIds.value = selection.map((item: any) => item.model_id);
|
2024-06-18 01:04:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 删除数据 */
|
|
|
|
|
function handleDelete(row: { [key: string]: any }) {
|
2024-07-07 00:29:07 +08:00
|
|
|
|
ElMessageBox.confirm("确认删除模型?", "警告", {
|
2024-06-18 01:04:33 +08:00
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
}).then(function () {
|
2024-07-07 00:29:07 +08:00
|
|
|
|
ModelApi.deleteModel(row.model_id).then(d=>{
|
|
|
|
|
if(d.data.code==0){
|
|
|
|
|
ElMessage.success("删除成功");
|
|
|
|
|
handleQuery();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
2024-06-18 01:04:33 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-19 00:20:35 +08:00
|
|
|
|
const doShowModelDetail=(row:any)=>{
|
2024-07-06 22:58:31 +08:00
|
|
|
|
router.replace({path:"/modelMgr/modelDetail",query:{id:row.model_id,from:'model'}})
|
2024-06-19 00:20:35 +08:00
|
|
|
|
}
|
2024-06-18 01:04:33 +08:00
|
|
|
|
/**
|
|
|
|
|
* 打开弹窗
|
|
|
|
|
*
|
|
|
|
|
* @param type 弹窗类型 用户表单:user-form | 用户导入:user-import
|
|
|
|
|
* @param id 用户ID
|
|
|
|
|
*/
|
|
|
|
|
async function openDialog(type: string, id?: number) {
|
|
|
|
|
router.replace({ path: "/operatorLibrary/calculateEdit" });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 下载导入模板 */
|
|
|
|
|
function downloadTemplate() {
|
|
|
|
|
ElMessage.success("下载模板成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 导出用户 */
|
|
|
|
|
function handleExport() {
|
|
|
|
|
ElMessage.success("导出成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
2024-07-06 22:58:31 +08:00
|
|
|
|
handleQuery();
|
2024-06-18 01:04:33 +08:00
|
|
|
|
});
|
2024-06-17 23:47:02 +08:00
|
|
|
|
</script>
|
2024-06-18 01:04:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang='scss'>
|
|
|
|
|
.search-container{
|
|
|
|
|
display:flex;
|
|
|
|
|
}
|
|
|
|
|
.card-footer{
|
|
|
|
|
position: fixed;
|
|
|
|
|
width: calc(100% - 215px);
|
|
|
|
|
bottom: 0px;
|
|
|
|
|
:deep(.el-card__body){
|
|
|
|
|
padding:0px;
|
|
|
|
|
.el-pagination{
|
|
|
|
|
justify-content: end;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|