update code
parent
a6536b1d93
commit
3c24f82b78
|
@ -5,7 +5,6 @@
|
|||
<link rel="icon" href="favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>算法测试验证软件平台</title>
|
||||
<link rel="stylesheet" href="./css/main.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
.dev-state{
|
||||
background-size: 100% 100%;
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
&.dev-s{
|
||||
background-image: url('../images/dev/dev-s.png');
|
||||
}
|
||||
&.dev-w{
|
||||
background-image: url('../images/dev/dev-w.png');
|
||||
}
|
||||
&.dev-e{
|
||||
background-image: url('../images/dev/dev-e.png');
|
||||
}
|
||||
}
|
|
@ -4,10 +4,11 @@ import router from "@/router";
|
|||
import { setupStore } from "@/store";
|
||||
import { setupDirective } from "@/directive";
|
||||
import { setupElIcons, setupI18n, setupPermission } from "@/plugins";
|
||||
// @ts-ignore
|
||||
import JsonViewer from "vue3-json-viewer"
|
||||
// 本地SVG图标
|
||||
import "virtual:svg-icons-register";
|
||||
|
||||
import './styles/main.css'
|
||||
// 样式
|
||||
import "element-plus/theme-chalk/dark/css-vars.css";
|
||||
import "vue3-json-viewer/dist/index.css"
|
||||
|
|
|
@ -39,7 +39,7 @@ export const useUserStore = defineStore("user", () => {
|
|||
function getUserInfo() {
|
||||
return new Promise<UserInfo>((resolve, reject) => {
|
||||
UserAPI.getInfo()
|
||||
.then((data) => {
|
||||
.then((data:any) => {
|
||||
if (!data) {
|
||||
reject("Verification failed, please Login again.");
|
||||
return;
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
|
@ -5,11 +5,11 @@
|
|||
height: 40px;
|
||||
}
|
||||
.dev-state.dev-s {
|
||||
background-image: url('../images/dev/dev-s.png');
|
||||
background-image: url('./dev/dev-s.png');
|
||||
}
|
||||
.dev-state.dev-w {
|
||||
background-image: url('../images/dev/dev-w.png');
|
||||
background-image: url('./dev/dev-w.png');
|
||||
}
|
||||
.dev-state.dev-e {
|
||||
background-image: url('../images/dev/dev-e.png');
|
||||
background-image: url('./dev/dev-e.png');
|
||||
}
|
|
@ -26,7 +26,7 @@ service.interceptors.request.use(
|
|||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use(
|
||||
(response: AxiosResponse) => {
|
||||
(response: any) => {
|
||||
// 检查配置的响应类型是否为二进制类型('blob' 或 'arraybuffer'), 如果是,直接返回响应对象
|
||||
if (
|
||||
response.config.responseType === "blob" ||
|
||||
|
|
|
@ -122,13 +122,13 @@ onMounted(() => {
|
|||
.flow-card {
|
||||
height: 80%;
|
||||
width: calc(100% - 450px);
|
||||
|
||||
margin: 0px 12px;
|
||||
.el-card__body {
|
||||
height: 100%;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
margin: 0px 12px;
|
||||
|
||||
}
|
||||
|
||||
.node-panel {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="index-notice" v-if="loadNotice!=null">
|
||||
<div v-for="(it,idx) in noticeList" :key="idx" class="notice-item">
|
||||
<div style="font-size: 12px;color: #333;" v-if="1==2">
|
||||
<div style="font-size: 12px;color: #333;" v-if="false">
|
||||
<svg-icon class="icon-info" icon-class="info" v-if="it.type=='info'" color="orange"></svg-icon>
|
||||
<svg-icon class="icon-warn" icon-class="warn" v-if="it.type=='warn'" color="red"></svg-icon>
|
||||
{{ it.type=="info"?"系统信息":"告警信息" }}
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
<script setup>
|
||||
import LogApi from '@/api/log'
|
||||
let info = reactive({
|
||||
cnt1: 0,
|
||||
|
|
|
@ -177,11 +177,11 @@ onMounted(() => {
|
|||
.flow-card{
|
||||
height: 80%;
|
||||
width:calc(100% - 450px);
|
||||
margin: 0px 12px;
|
||||
.el-card__body{
|
||||
height:100%;
|
||||
padding:4px;
|
||||
}
|
||||
margin: 0px 12px;
|
||||
}
|
||||
.node-panel{
|
||||
width:240px;
|
||||
|
|
|
@ -67,13 +67,10 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import md5 from 'js-md5';
|
||||
import { useSettingsStore, useUserStore } from "@/store";
|
||||
import AuthAPI from "@/api/auth";
|
||||
import { LoginData } from "@/api/auth/model";
|
||||
import type { FormInstance } from "element-plus";
|
||||
import { LocationQuery, LocationQueryValue, useRoute } from "vue-router";
|
||||
import { useRoute } from "vue-router";
|
||||
import router from "@/router";
|
||||
import defaultSettings from "@/settings";
|
||||
import { ThemeEnum } from "@/enums/ThemeEnum";
|
||||
|
@ -91,10 +88,10 @@ const icpVisible = ref(true);
|
|||
const loading = ref(false); // 按钮loading
|
||||
const isCapslock = ref(false); // 是否大写锁定
|
||||
const captchaBase64 = ref(); // 验证码图片Base64字符串
|
||||
const loginFormRef = ref<FormInstance>(); // 登录表单ref
|
||||
const loginFormRef = ref(); // 登录表单ref
|
||||
const { height } = useWindowSize();
|
||||
|
||||
const loginData = ref<LoginData>({
|
||||
const loginData = ref({
|
||||
username: "admin",
|
||||
password: "12345678",
|
||||
pass: "12345678",
|
||||
|
@ -144,7 +141,7 @@ function getCaptcha() {
|
|||
/** 登录 */
|
||||
const route = useRoute();
|
||||
function handleLogin() {
|
||||
loginFormRef.value?.validate((valid: boolean) => {
|
||||
loginFormRef.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
loginData.value.pasw = loginData.value.password;
|
||||
|
@ -152,10 +149,10 @@ function handleLogin() {
|
|||
userStore
|
||||
.login(loginData.value)
|
||||
.then(() => {
|
||||
const query: LocationQuery = route.query;
|
||||
const redirect = (query.redirect as LocationQueryValue) ?? "/";
|
||||
const query = route.query;
|
||||
const redirect = (query.redirect) ?? "/";
|
||||
const otherQueryParams = Object.keys(query).reduce(
|
||||
(acc: any, cur: string) => {
|
||||
(acc, cur) => {
|
||||
if (cur !== "redirect") {
|
||||
acc[cur] = query[cur];
|
||||
}
|
||||
|
@ -194,7 +191,7 @@ watchEffect(() => {
|
|||
});
|
||||
|
||||
/** 检查输入大小写 */
|
||||
function checkCapslock(event: KeyboardEvent) {
|
||||
function checkCapslock(event) {
|
||||
// 防止浏览器密码自动填充时报错
|
||||
if (event instanceof KeyboardEvent) {
|
||||
isCapslock.value = event.getModifierState("CapsLock");
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import ConstApi from "@/api/const";
|
||||
import OperatorApi from "@/api/operator";
|
||||
import { toJson } from '@/utils/'
|
||||
|
@ -79,7 +79,7 @@ const fileStatus = ref(false); // 文件状态
|
|||
const codeHtml = ref(""); // 文件信息
|
||||
|
||||
// 上传组件
|
||||
const uploadRef = ref<UploadInstance>();
|
||||
const uploadRef = ref();
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
status: 1,
|
||||
|
@ -108,7 +108,7 @@ function handleChangeRules() {
|
|||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
OperatorApi.add(formData)
|
||||
|
|
|
@ -5,78 +5,51 @@
|
|||
<template #header>
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<el-button type="primary" @click="handleAdd"
|
||||
><i-ep-plus />添加算子</el-button
|
||||
>
|
||||
<el-button type="primary" @click="handleAdd"><i-ep-plus />添加算子</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="算子名称" prop="operator_name">
|
||||
<el-input
|
||||
v-model="queryParams.operator_name"
|
||||
placeholder="请输入算子名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.operator_name" placeholder="请输入算子名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery"
|
||||
><i-ep-search />搜索</el-button
|
||||
>
|
||||
<el-button type="primary" @click="handleQuery"><i-ep-search />搜索</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<i-ep-refresh />
|
||||
重置</el-button
|
||||
>
|
||||
重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="pageData"
|
||||
stripe
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table v-loading="loading" :data="pageData" stripe @selection-change="handleSelectionChange">
|
||||
<el-table-column label="算子名称" align="left" prop="operator_name" width="300" />
|
||||
<el-table-column label="算子主类型" align="left" prop="oper_main_type_name" width="180"/>
|
||||
<el-table-column label="算子主类型" align="left" prop="oper_main_type_name" width="180" />
|
||||
<el-table-column label="算子子类型" align="left" prop="oper_sub_type_name" width="180" />
|
||||
<el-table-column label="算子说明" align="left" prop="operator_desc" />
|
||||
<el-table-column label="创建时间" width="180" align="left" prop="create_time" />
|
||||
<el-table-column label="操作" fixed="right" align="center" width="280">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
text
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleDetail(scope.row.operator_id)"
|
||||
><i-ep-view />查看</el-button
|
||||
>
|
||||
<el-button text type="primary" size="small" @click="handleDelete(scope.row.operator_id)"
|
||||
><i-ep-delete />删除</el-button
|
||||
>
|
||||
<el-button text type="primary" size="small" @click="handlePushParams(scope.row)"
|
||||
><i-ep-plus />添加算子程序</el-button
|
||||
>
|
||||
<el-button text type="primary" size="small"
|
||||
@click="handleDetail(scope.row.operator_id)"><i-ep-view />查看</el-button>
|
||||
<el-button text type="primary" size="small"
|
||||
@click="handleDelete(scope.row.operator_id)"><i-ep-delete />删除</el-button>
|
||||
<el-button text type="primary" size="small"
|
||||
@click="handlePushParams(scope.row)"><i-ep-plus />添加算子程序</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"
|
||||
/>
|
||||
<pagination v-if="total > 0" v-model:total="total" v-model:page="queryParams.page_num"
|
||||
v-model:limit="queryParams.page_size" @pagination="handleQuery" />
|
||||
</el-card>
|
||||
<paramDialog ref="paramDialogRef"></paramDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import OperatorApi from '@/api/operator'
|
||||
import paramDialog from "../calculateParam/dialog.vue";
|
||||
|
||||
|
@ -90,10 +63,10 @@ const queryFormRef = ref(ElForm); // 查询表单
|
|||
const queryParams = reactive({
|
||||
page_num: 1,
|
||||
page_size: 10,
|
||||
order_type:null,
|
||||
order_by:null,
|
||||
operator_name:null,
|
||||
oper_main_type:null
|
||||
order_type: null,
|
||||
order_by: null,
|
||||
operator_name: null,
|
||||
oper_main_type: null
|
||||
});
|
||||
const paramDialogRef = ref(""); // 算子程序子组件
|
||||
|
||||
|
@ -122,12 +95,12 @@ function resetQuery() {
|
|||
}
|
||||
|
||||
/** 行选中 */
|
||||
function handleSelectionChange(selection: any) {
|
||||
removeIds.value = selection.map((item: any) => item.operator_id);
|
||||
function handleSelectionChange(selection) {
|
||||
removeIds.value = selection.map((item) => item.operator_id);
|
||||
}
|
||||
|
||||
/** 删除数据 */
|
||||
function handleDelete(id?: number) {
|
||||
function handleDelete(id) {
|
||||
ElMessageBox.confirm("删除时也会删除对应的算子软件,是否确认删除算子?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
|
@ -141,13 +114,13 @@ function handleDelete(id?: number) {
|
|||
}
|
||||
|
||||
/** 添加算子程序 */
|
||||
function handlePushParams(data){
|
||||
function handlePushParams(data) {
|
||||
paramDialogRef.value.show(data);
|
||||
}
|
||||
|
||||
/** 查看算子 */
|
||||
function handleDetail(operator_id?: number) {
|
||||
router.push({path:"/operatorLibrary/calculateDetail",query:{id:operator_id}})
|
||||
function handleDetail(operator_id) {
|
||||
router.push({ path: "/operatorLibrary/calculateDetail", query: { id: operator_id } })
|
||||
}
|
||||
|
||||
/** 新增算子 */
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import OperatorApi from "@/api/operator";
|
||||
import paramDialog from "../calculateParam/dialog.vue";
|
||||
import { toJson } from '@/utils/'
|
||||
|
|
|
@ -3,49 +3,30 @@
|
|||
<div class="app-container model-detail">
|
||||
<!-- 新增/编辑表单 -->
|
||||
<el-card v-loading="loading">
|
||||
<template #header
|
||||
><svg-icon icon-class="pause" style="width: 20px; height: 20px" />
|
||||
<template #header><svg-icon icon-class="pause" style="width: 20px; height: 20px" />
|
||||
算子程序基本信息
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col :lg="12" :xs="24">
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="80px">
|
||||
<el-form-item label="算子类型" prop="oper_main_type">
|
||||
<el-select
|
||||
v-model="formData.oper_main_type"
|
||||
placeholder="请选择算子主类型"
|
||||
style="width: 100%"
|
||||
@change="handleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in listOpt.operTypeList"
|
||||
:key="item.oper_main_type"
|
||||
:label="item.oper_main_type_name"
|
||||
:value="item.oper_main_type"
|
||||
/>
|
||||
<el-select v-model="formData.oper_main_type" placeholder="请选择算子主类型" style="width: 100%"
|
||||
@change="handleChange">
|
||||
<el-option v-for="item in listOpt.operTypeList" :key="item.oper_main_type"
|
||||
:label="item.oper_main_type_name" :value="item.oper_main_type" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="算子名称" prop="operator_id">
|
||||
<el-select
|
||||
v-model="formData.operator_id"
|
||||
placeholder="请选择算子名称"
|
||||
style="width: 100%"
|
||||
@change="handleChangeOperator"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in listOpt.operatorList"
|
||||
:key="item.operator_id"
|
||||
:label="item.operator_name"
|
||||
:value="item.operator_id"
|
||||
>
|
||||
<el-select v-model="formData.operator_id" placeholder="请选择算子名称" style="width: 100%"
|
||||
@change="handleChangeOperator">
|
||||
<el-option v-for="item in listOpt.operatorList" :key="item.operator_id" :label="item.operator_name"
|
||||
:value="item.operator_id">
|
||||
<span style="float: left">{{ item.operator_name }}</span>
|
||||
<span
|
||||
style="
|
||||
<span style="
|
||||
float: right;
|
||||
color: var(--el-text-color-secondary);
|
||||
font-size: 13px;
|
||||
"
|
||||
>
|
||||
">
|
||||
{{ item.oper_sub_type_name }}
|
||||
</span>
|
||||
</el-option>
|
||||
|
@ -83,42 +64,21 @@
|
|||
</el-select> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="适配硬件" prop="cmpt_hardware_type">
|
||||
<el-select
|
||||
v-model="formData.cmpt_hardware_type"
|
||||
placeholder="请选择适配硬件类型"
|
||||
style="width: 100%"
|
||||
@change="handleChangeCmpt"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in listOpt.cmptHardwareTypeList"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
<el-select v-model="formData.cmpt_hardware_type" placeholder="请选择适配硬件类型" style="width: 100%"
|
||||
@change="handleChangeCmpt">
|
||||
<el-option v-for="item in listOpt.cmptHardwareTypeList" :key="item" :label="item" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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 label="程序文件" prop="program_file_name">
|
||||
<el-upload
|
||||
v-model:file-list="fileList"
|
||||
action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
|
||||
ref="uploadRef"
|
||||
class="upload-demo"
|
||||
:on-exceed="handleFileExceed"
|
||||
:auto-upload="false"
|
||||
:limit="1"
|
||||
accept="application/x-tar"
|
||||
>
|
||||
<el-button type="primary"
|
||||
><el-icon class="el-icon--upload"> <i-ep-upload-filled /> </el-icon
|
||||
>选择文件</el-button
|
||||
>
|
||||
<el-upload v-model:file-list="fileList"
|
||||
action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" ref="uploadRef"
|
||||
class="upload-demo" :on-exceed="handleFileExceed" :auto-upload="false" :limit="1"
|
||||
accept="application/x-tar">
|
||||
<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>,格式为
|
||||
|
@ -132,9 +92,7 @@
|
|||
<el-col :lg="12" :xs="24">
|
||||
<div style="padding-left: 35px" v-if="fileStatus">
|
||||
<el-form label-width="100px" size="small">
|
||||
<el-divider content-position="left"
|
||||
><strong style="color: #409eff">算子文件预览</strong></el-divider
|
||||
>
|
||||
<el-divider content-position="left"><strong style="color: #409eff">算子文件预览</strong></el-divider>
|
||||
<el-input v-model="codeJson" :disabled="true" type="textarea" :rows="20" />
|
||||
</el-form>
|
||||
</div>
|
||||
|
@ -148,7 +106,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import ConstApi from "@/api/const";
|
||||
import { useUserStore } from "@/store";
|
||||
import OperatorApi from "@/api/operator";
|
||||
|
@ -161,7 +119,7 @@ const fileStatus = ref(false); // 文件状态
|
|||
const codeJson = ref(""); // 文件信息
|
||||
|
||||
// 上传组件
|
||||
const uploadRef = ref<UploadInstance>();
|
||||
const uploadRef = ref();
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
status: 1,
|
||||
|
@ -186,7 +144,7 @@ const rules = reactive({
|
|||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
formData.user_id = userStore.user?.id;
|
||||
|
@ -217,7 +175,7 @@ function closeBack() {
|
|||
}
|
||||
|
||||
/** 搜索算子 */
|
||||
const remoteMethod = (query: string) => {
|
||||
const remoteMethod = (query) => {
|
||||
if (query) {
|
||||
selLoading.value = true;
|
||||
setTimeout(() => {
|
||||
|
@ -259,9 +217,9 @@ function handleChangeOperator() {
|
|||
OperatorApi.findOne(formData.operator_id).then((res) => {
|
||||
//JSON转换
|
||||
codeJson.value = JSON.stringify(res.data.data.parameters);
|
||||
if(codeJson.value=='{}'){
|
||||
if (codeJson.value == '{}') {
|
||||
fileStatus.value = false;
|
||||
}else{
|
||||
} else {
|
||||
fileStatus.value = true;
|
||||
}
|
||||
});
|
||||
|
@ -294,21 +252,27 @@ onMounted(() => {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
<div class="app-container model-detail">
|
||||
<!-- 算子程序详情 -->
|
||||
<el-card>
|
||||
<template #header
|
||||
><svg-icon icon-class="pause" style="width: 20px; height: 20px" />
|
||||
<template #header><svg-icon icon-class="pause" style="width: 20px; height: 20px" />
|
||||
算子参数基本信息
|
||||
</template>
|
||||
<el-row>
|
||||
|
@ -12,25 +11,14 @@
|
|||
<el-form v-loading="loading" label-width="100px" size="small">
|
||||
<el-form-item label="参数名称" prop="username"> 目标分类模型 </el-form-item>
|
||||
<el-form-item label="算子类型" prop="nickname33">
|
||||
前处理/缩放算子</el-form-item
|
||||
>
|
||||
前处理/缩放算子</el-form-item>
|
||||
<el-form-item label="参数说明" prop="nickname33">
|
||||
<el-input
|
||||
v-model="formData.usernamedd1"
|
||||
:disabled="true"
|
||||
placeholder="请输入数据集名称"
|
||||
:rows="3"
|
||||
type="textarea"
|
||||
/>
|
||||
<el-input v-model="formData.usernamedd1" :disabled="true" placeholder="请输入数据集名称" :rows="3"
|
||||
type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="算子参数" prop="nickname33">
|
||||
<el-input
|
||||
v-model="formData.usernamedd2"
|
||||
:disabled="true"
|
||||
placeholder="请输入数据集名称"
|
||||
:rows="12"
|
||||
type="textarea"
|
||||
/>
|
||||
<el-input v-model="formData.usernamedd2" :disabled="true" placeholder="请输入数据集名称" :rows="12"
|
||||
type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
|
@ -43,7 +31,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import OperatorApi from "@/api/operator";
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -53,7 +41,7 @@ const loading = ref(false); // 加载状态
|
|||
const dataInfo = ref({});
|
||||
|
||||
// 用户表单数据
|
||||
const formData = reactive<UserForm>({
|
||||
const formData = reactive({
|
||||
status: 1,
|
||||
usernamedd1: "参数说明说明参数",
|
||||
usernamedd2: `{
|
||||
|
@ -117,21 +105,27 @@ onMounted(() => {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup >
|
||||
import ConstApi from "@/api/const";
|
||||
import DataSetApi from "@/api/dataSet";
|
||||
|
||||
|
@ -117,7 +117,7 @@ const fileStatus = ref(false); // 文件状态
|
|||
const codeHtml = ref(""); // 文件信息
|
||||
|
||||
// 上传组件
|
||||
const uploadRef = ref<UploadInstance>();
|
||||
const uploadRef = ref();
|
||||
|
||||
// 基础数据列表
|
||||
let listOpt = reactive({
|
||||
|
@ -145,7 +145,7 @@ const rules = reactive({
|
|||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
if (!form.value.image_width) {
|
||||
ElMessage.error("请输入图片分辨率宽度!");
|
||||
|
|
|
@ -138,10 +138,9 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import ConstApi from "@/api/const";
|
||||
import DataSetApi from "@/api/dataSet";
|
||||
import { json } from 'stream/consumers';
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
|
@ -159,7 +158,7 @@ const imgCount = ref(0); // 图片信息
|
|||
const imageList = ref([]); // 图片列表
|
||||
const remImageList = ref([]); // 删除图片列表
|
||||
// 上传组件
|
||||
const uploadRef = ref<UploadInstance>();
|
||||
const uploadRef = ref();
|
||||
|
||||
const autoTime = ref(""); // 自动上传
|
||||
const autoUpload = ref(false); // 自动上传
|
||||
|
@ -195,7 +194,7 @@ const rules = reactive({
|
|||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
if (!form.value.image_width) {
|
||||
ElMessage.error("请输入图片分辨率宽度!");
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import DeviceApi from "@/api/device";
|
||||
|
||||
const router = useRouter();
|
||||
|
@ -95,7 +95,7 @@ const queryParams = reactive({
|
|||
});
|
||||
|
||||
/** 选中未注册设备 */
|
||||
function getCurrentRow(row: { [key: string]: any }) {
|
||||
function getCurrentRow(row) {
|
||||
form.uuid = row.uuid;
|
||||
form.infomation = row.manufacturer;
|
||||
form.manufacturer = row.manufacturer;
|
||||
|
@ -108,7 +108,7 @@ function getCurrentRow(row: { [key: string]: any }) {
|
|||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
if (!form.unregisted) {
|
||||
ElMessage.error("请选择要注册的设备");
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import DeviceApi from "@/api/device";
|
||||
|
||||
const router = useRouter();
|
||||
|
@ -71,7 +71,7 @@ const queryParams = reactive({
|
|||
});
|
||||
|
||||
/** 选中未注册设备 */
|
||||
function getCurrentRow(row: { [key: string]: any }) {
|
||||
function getCurrentRow(row) {
|
||||
form.uuid = row.uuid;
|
||||
form.pcie_index = row.pcie_index;
|
||||
form.infomation = row.manufacturer;
|
||||
|
@ -85,7 +85,7 @@ function getCurrentRow(row: { [key: string]: any }) {
|
|||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
if (!form.unregisted) {
|
||||
ElMessage.error("请选择要注册的设备");
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import DeviceApi from "@/api/device";
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -76,7 +76,7 @@ const rules = reactive({
|
|||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
DeviceApi.updateDevices(form.value.device_id,form.value)
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup >
|
||||
import DeviceApi from "@/api/device";
|
||||
|
||||
const router = useRouter();
|
||||
|
@ -114,12 +114,12 @@ function resetQuery() {
|
|||
}
|
||||
|
||||
/** 行选中 */
|
||||
function handleSelectionChange(selection: any) {
|
||||
removeIds.value = selection.map((item: any) => item.id);
|
||||
function handleSelectionChange(selection) {
|
||||
removeIds.value = selection.map((item) => item.id);
|
||||
}
|
||||
|
||||
/** 删除数据 */
|
||||
function handleDelete(row: { [key: string]: any }) {
|
||||
function handleDelete(row) {
|
||||
ElMessageBox.confirm("确认删除设备信息?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
|
@ -145,17 +145,17 @@ function handleAddNet() {
|
|||
}
|
||||
|
||||
/** 修改设备信息 */
|
||||
function handleUpdate(row: { [key: string]: any }) {
|
||||
function handleUpdate(row) {
|
||||
router.push({ path: "/tester/equipmentEdit", query: { id: row.device_id } });
|
||||
}
|
||||
|
||||
/** 设备信息详情 */
|
||||
function handleDetail(row: { [key: string]: any }) {
|
||||
function handleDetail(row) {
|
||||
router.push({ path: "/tester/equipmentDetail", query: { id: row.device_id } });
|
||||
}
|
||||
|
||||
/** 设备升级 */
|
||||
function openUpGrades(row: { [key: string]: any }) {
|
||||
function openUpGrades(row) {
|
||||
ElMessage.error("【error】待提供!");
|
||||
}
|
||||
|
||||
|
|
|
@ -105,19 +105,16 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
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 calTypeList = ref(); // 角色下拉数据源
|
||||
|
||||
// 用户表单数据
|
||||
const formData = reactive<UserForm>({
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import DeviceApi from "@/api/device";
|
||||
|
||||
const route = useRoute();
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import ToolChainshApi from "@/api/tool";
|
||||
const router = useRouter();
|
||||
const formRef = ref(ElForm); // 表单
|
||||
|
@ -102,7 +102,7 @@ const formData = reactive({
|
|||
unregisted: null,
|
||||
});
|
||||
// 上传组件
|
||||
const uploadRef = ref<UploadInstance>();
|
||||
const uploadRef = ref();
|
||||
|
||||
// 基础数据列表
|
||||
let listOpt = reactive({
|
||||
|
@ -135,7 +135,7 @@ const rules = reactive({
|
|||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
if (!formData.unregisted) {
|
||||
ElMessage.error("请选择要注册的工具链");
|
||||
|
@ -157,7 +157,7 @@ const handleSubmit = useThrottleFn(() => {
|
|||
}, 3000);
|
||||
|
||||
/** 选中未注册工具链 */
|
||||
function getCurrentRow(row: { [key: string]: any }) {
|
||||
function getCurrentRow(row) {
|
||||
formData.uuid = row.uuid;
|
||||
formData.tool_type = row.tool_type;
|
||||
formData.cmpt_hardware_type = row.cmpt_hardware_type;
|
||||
|
|
|
@ -3,12 +3,7 @@
|
|||
<div class="app-container model-detail">
|
||||
<!-- 用户新增/编辑表单 -->
|
||||
<el-card v-loading="loading">
|
||||
<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-form ref="baseFormRef" :model="baseForm" :rules="baseRules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :lg="12" :xs="12">
|
||||
|
@ -18,29 +13,15 @@
|
|||
</el-col>
|
||||
<el-col :lg="12" :xs="12">
|
||||
<el-form-item label="厂商名称" prop="manufacturer">
|
||||
<el-input
|
||||
v-model="baseForm.manufacturer"
|
||||
disabled
|
||||
placeholder="请输入厂商名称"
|
||||
/>
|
||||
<el-input v-model="baseForm.manufacturer" 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 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>
|
||||
</el-col>
|
||||
|
@ -53,32 +34,19 @@
|
|||
<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-input v-model="baseForm.tool_version" 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-input v-model="baseForm.cmpt_hardware_type" 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-input v-model="baseForm.tool_desc" :rows="2" type="textarea" placeholder="请输入工具链描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :xs="12"></el-col>
|
||||
|
@ -87,18 +55,11 @@
|
|||
</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-button type="primary" @click="handlePushParams"><i-ep-plus />添加运行参数</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-card v-loading="loading" style="padding-bottom: 50px">
|
||||
<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-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" />
|
||||
|
@ -107,75 +68,37 @@
|
|||
<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
|
||||
>
|
||||
<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"
|
||||
/>
|
||||
<pagination v-if="total > 0" v-model:total="total" v-model:page="queryParams.page_num"
|
||||
v-model:limit="queryParams.page_size" @pagination="handleQuery" />
|
||||
</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">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
v-loading="formLoading"
|
||||
:rules="rules"
|
||||
label-width="108px"
|
||||
>
|
||||
<el-form ref="formRef" :model="form" v-loading="formLoading" :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-input v-model="form.params_desc" :rows="3" type="textarea" placeholder="请输入运行参数描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="适用模型类型" prop="modl_sub_type">
|
||||
<el-select
|
||||
v-model="form.modl_sub_type"
|
||||
placeholder="请选择适用模型类型"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in listOpt.modlSubTypeList"
|
||||
:key="item.modl_sub_type"
|
||||
:label="item.modl_sub_type_name"
|
||||
:value="item.modl_sub_type"
|
||||
/>
|
||||
<el-select v-model="form.modl_sub_type" placeholder="请选择适用模型类型" style="width: 100%">
|
||||
<el-option v-for="item in listOpt.modlSubTypeList" :key="item.modl_sub_type"
|
||||
:label="item.modl_sub_type_name" :value="item.modl_sub_type" />
|
||||
</el-select>
|
||||
</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
|
||||
>
|
||||
<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>,格式为
|
||||
|
@ -203,20 +126,10 @@
|
|||
{{ dataInfo.modl_sub_type_name }}
|
||||
</el-form-item>
|
||||
<el-form-item label="运行参数名称">
|
||||
<el-input
|
||||
v-model="dataInfo.params_name"
|
||||
disabled
|
||||
placeholder="请输入运行参数名称"
|
||||
/>
|
||||
<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-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="paramsContent" :rows="10" type="textarea" disabled />
|
||||
|
@ -231,7 +144,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup >
|
||||
import ConstApi from "@/api/const";
|
||||
import ToolChainshApi from "@/api/tool";
|
||||
|
||||
|
@ -309,7 +222,7 @@ const dialogInfoVisible = ref(false); // 弹窗加载状态
|
|||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
baseFormRef.value.validate((valid: any) => {
|
||||
baseFormRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
ToolChainshApi.editTool(baseForm.value.tool_id, baseForm.value)
|
||||
|
@ -328,7 +241,7 @@ const handleSubmit = useThrottleFn(() => {
|
|||
|
||||
/** 表单提交 */
|
||||
const handleSubmitFile = useThrottleFn(() => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
formLoading.value = true;
|
||||
ToolChainshApi.addToolParams(form)
|
||||
|
@ -434,7 +347,7 @@ function closeBack() {
|
|||
}
|
||||
|
||||
/** 查看运行参数详情 */
|
||||
function handleDetail(row: { [key: string]: any }) {
|
||||
function handleDetail(row) {
|
||||
infoLoading.value = true;
|
||||
ToolChainshApi.paramsInfo(row.params_id)
|
||||
.then((res) => {
|
||||
|
@ -454,7 +367,7 @@ function handleDetail(row: { [key: string]: any }) {
|
|||
}
|
||||
|
||||
/** 删除运行参数数据 */
|
||||
function handleDelete(row: { [key: string]: any }) {
|
||||
function handleDelete(row) {
|
||||
ElMessageBox.confirm("确认删除运行参数信息?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
|
@ -516,21 +429,27 @@ onMounted(() => {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -44,21 +44,19 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
defineOptions({
|
||||
name: "calculateIndex",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
import ModelApi from '@/api/models'
|
||||
|
||||
import { UserQuery } from "@/api/user/model";
|
||||
|
||||
const queryFormRef = ref(ElForm); // 查询表单
|
||||
const router = useRouter();
|
||||
|
||||
const loading = ref(false); // 加载状态
|
||||
const removeIds = ref([]); // 删除用户ID集合 用于批量删除
|
||||
let queryParams = reactive<any>({
|
||||
let queryParams = reactive({
|
||||
page_num: 1,
|
||||
page_size: 10,
|
||||
model_name: ''
|
||||
|
@ -102,12 +100,12 @@ function resetQuery() {
|
|||
}
|
||||
|
||||
/** 行选中 */
|
||||
function handleSelectionChange(selection: any) {
|
||||
removeIds.value = selection.map((item: any) => item.model_id);
|
||||
function handleSelectionChange(selection) {
|
||||
removeIds.value = selection.map((item) => item.model_id);
|
||||
}
|
||||
|
||||
/** 删除数据 */
|
||||
function handleDelete(row: { [key: string]: any }) {
|
||||
function handleDelete(row) {
|
||||
ElMessageBox.confirm("确认删除模型?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
|
@ -123,7 +121,7 @@ function handleDelete(row: { [key: string]: any }) {
|
|||
});
|
||||
}
|
||||
|
||||
const doShowModelDetail = (row: any) => {
|
||||
const doShowModelDetail = (row) => {
|
||||
router.push({ path: "/modelMgr/modelDetail", query: { id: row.model_id, from: 'model' } })
|
||||
}
|
||||
/**
|
||||
|
@ -132,7 +130,7 @@ const doShowModelDetail = (row: any) => {
|
|||
* @param type 弹窗类型 用户表单:user-form | 用户导入:user-import
|
||||
* @param id 用户ID
|
||||
*/
|
||||
async function openDialog(type: string, id?: number) {
|
||||
async function openDialog(type, id) {
|
||||
router.push({ path: "/operatorLibrary/calculateEdit" });
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ const options = {
|
|||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
valueFormatter:v=>v+"%",
|
||||
valueFormatter:(v:any)=>v+"%",
|
||||
axisPointer: {
|
||||
type: "cross",
|
||||
crossStyle: {
|
||||
|
|
|
@ -134,7 +134,10 @@ const info = reactive({
|
|||
const doExport=async () => {
|
||||
try{
|
||||
let dom=document.querySelector("#print_simulation_report_desc");
|
||||
const canvas = await html2canvas(dom);
|
||||
const canvas = await html2canvas(dom,{
|
||||
allowTaint: true,
|
||||
useCORS: true,
|
||||
});
|
||||
const img = canvas.toDataURL('image/png');
|
||||
const link = document.createElement('a');
|
||||
link.href = img;
|
||||
|
@ -328,9 +331,13 @@ html.report-print {
|
|||
height: unset !important;
|
||||
|
||||
.simulation-report-desc {
|
||||
|
||||
.el-scrollbar__view{
|
||||
vertical-align: unset !important;
|
||||
}
|
||||
.el-table {
|
||||
table {
|
||||
width: 100% !important;
|
||||
width: unset !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,24 +2,13 @@
|
|||
<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
|
||||
>
|
||||
<template #header><svg-icon icon-class="pause" style="width: 20px; height: 20px" />菜单基本信息</template>
|
||||
<el-row>
|
||||
<el-col :lg="12" :xs="24">
|
||||
<el-form ref="menuFormRef" :model="formData" :rules="rules" label-width="160px">
|
||||
<el-form-item label="父级菜单" prop="parentId">
|
||||
<el-tree-select
|
||||
v-model="formData.parentId"
|
||||
placeholder="选择上级菜单"
|
||||
:data="menuOptions"
|
||||
filterable
|
||||
check-strictly
|
||||
:render-after-expand="false"
|
||||
/>
|
||||
<el-tree-select v-model="formData.parentId" placeholder="选择上级菜单" :data="menuOptions" filterable
|
||||
check-strictly :render-after-expand="false" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="菜单名称" prop="name">
|
||||
|
@ -37,46 +26,26 @@
|
|||
<!-- v-if="
|
||||
formData.type == MenuTypeEnum.CATALOG || formData.type == MenuTypeEnum.MENU
|
||||
" -->
|
||||
<el-form-item
|
||||
label="路由路径"
|
||||
prop="path"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.path"
|
||||
placeholder="system"
|
||||
/>
|
||||
<el-form-item label="路由路径" prop="path">
|
||||
<el-input v-model="formData.path" placeholder="system" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 组件页面完整路径 -->
|
||||
<el-form-item
|
||||
label="页面路径"
|
||||
prop="component"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.component"
|
||||
placeholder="system/user/index"
|
||||
style="width: 95%"
|
||||
>
|
||||
<template #prepend
|
||||
>src/views/</template
|
||||
>
|
||||
<el-form-item label="页面路径" prop="component">
|
||||
<el-input v-model="formData.component" placeholder="system/user/index" style="width: 95%">
|
||||
<template #prepend>src/views/</template>
|
||||
<template #append>.vue</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
prop="visible"
|
||||
label="显示状态"
|
||||
>
|
||||
<el-form-item prop="visible" label="显示状态">
|
||||
<el-radio-group v-model="formData.visible">
|
||||
<el-radio :label="1">显示</el-radio>
|
||||
<el-radio :label="0">隐藏</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="是否始终显示"
|
||||
>
|
||||
<el-form-item label="是否始终显示">
|
||||
<template #label>
|
||||
<div>
|
||||
是否始终显示
|
||||
|
@ -103,26 +72,15 @@
|
|||
</el-form-item>
|
||||
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number
|
||||
v-model="formData.sort"
|
||||
style="width: 100px"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
/>
|
||||
<el-input-number v-model="formData.sort" style="width: 100px" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 权限标识 -->
|
||||
<el-form-item
|
||||
label="权限标识"
|
||||
prop="perm"
|
||||
>
|
||||
<el-form-item label="权限标识" prop="perm">
|
||||
<el-input v-model="formData.perm" placeholder="sys:user:add" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="图标"
|
||||
prop="icon"
|
||||
>
|
||||
<el-form-item label="图标" prop="icon">
|
||||
<!-- 图标选择器 -->
|
||||
<icon-select v-model="formData.icon" />
|
||||
</el-form-item>
|
||||
|
@ -140,31 +98,28 @@
|
|||
<el-button @click="closeBack"><i-ep-close />取 消</el-button>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
<script setup>
|
||||
defineOptions({
|
||||
name: "User",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
});
|
||||
|
||||
import UserAPI from "@/api/user";
|
||||
import { UserForm } from "@/api/user/model";
|
||||
const router = useRouter();
|
||||
const loading = ref(false); // 加载状态
|
||||
|
||||
const router = useRouter();
|
||||
const loading = ref(false); // 加载状态
|
||||
const calTypeList = ref(); // 角色下拉数据源
|
||||
|
||||
const calTypeList = ref<OptionType[]>(); // 角色下拉数据源
|
||||
|
||||
// 用户表单数据
|
||||
const formData = reactive<UserForm>({
|
||||
// 用户表单数据
|
||||
const formData = reactive({
|
||||
status: 1,
|
||||
});
|
||||
});
|
||||
|
||||
const radioSelected = ref('');
|
||||
const radioSelected = ref('');
|
||||
|
||||
// 校验规则
|
||||
const rules = reactive({
|
||||
// 校验规则
|
||||
const rules = reactive({
|
||||
username: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
nickname: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
deptId: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
|
@ -183,9 +138,9 @@
|
|||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
const list = [
|
||||
const list = [
|
||||
{
|
||||
csmc: "10.0.8.12",
|
||||
csms: "DOCKER-TOOL",
|
||||
|
@ -202,54 +157,59 @@
|
|||
csmc3: "1.2",
|
||||
csmc4: "已连接",
|
||||
},
|
||||
];
|
||||
];
|
||||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
loading.value = true;
|
||||
setTimeout(() => {
|
||||
ElMessage.success("保存成功");
|
||||
loading.value = false;
|
||||
closeBack();
|
||||
}, 1000);
|
||||
}, 3000);
|
||||
}, 3000);
|
||||
|
||||
/** 返回默认页面 */
|
||||
function closeBack() {
|
||||
/** 返回默认页面 */
|
||||
function closeBack() {
|
||||
router.push({ path: "/system/menu" });
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(() => {
|
||||
//handleQuery();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.model-detail {
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.model-detail {
|
||||
:deep(.el-card__header) {
|
||||
padding: 8px 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.sp-file {
|
||||
}
|
||||
|
||||
.sp-file {
|
||||
color: #29d;
|
||||
}
|
||||
.tb-base-info {
|
||||
}
|
||||
|
||||
.tb-base-info {
|
||||
line-height: 30px;
|
||||
}
|
||||
:deep(.svg-icon) {
|
||||
}
|
||||
|
||||
: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 {
|
||||
justify-content: end;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
}
|
||||
</style>
|
|
@ -4,47 +4,30 @@
|
|||
<template #header>
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<el-button type="primary" @click="openDialog('user-form')"
|
||||
><i-ep-plus />新增菜单</el-button
|
||||
>
|
||||
<el-button type="primary" @click="openDialog('user-form')"><i-ep-plus />新增菜单</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="菜单名称" prop="keywords">
|
||||
<el-input
|
||||
v-model="queryParams.keywords"
|
||||
placeholder="请输入菜单名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.keywords" placeholder="请输入菜单名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery"
|
||||
><i-ep-search />搜索</el-button
|
||||
>
|
||||
<el-button type="primary" @click="handleQuery"><i-ep-search />搜索</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<i-ep-refresh />
|
||||
重置</el-button
|
||||
>
|
||||
重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
highlight-current-row
|
||||
row-key="id"
|
||||
:expand-row-keys="['1']"
|
||||
@row-click="onRowClick"
|
||||
:tree-props="{
|
||||
<el-table v-loading="loading" :data="tableData" highlight-current-row row-key="id" :expand-row-keys="['1']"
|
||||
@row-click="onRowClick" :tree-props="{
|
||||
children: 'children',
|
||||
hasChildren: 'hasChildren',
|
||||
}"
|
||||
>
|
||||
}">
|
||||
<el-table-column label="菜单名称" min-width="200">
|
||||
<template #default="scope">
|
||||
<svg-icon :icon-class="scope.row.icon" />
|
||||
|
@ -54,18 +37,10 @@
|
|||
|
||||
<el-table-column label="类型" align="center" width="80">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.type === MenuTypeEnum.CATALOG" type="warning"
|
||||
>目录</el-tag
|
||||
>
|
||||
<el-tag v-if="scope.row.type === MenuTypeEnum.MENU" type="success"
|
||||
>菜单</el-tag
|
||||
>
|
||||
<el-tag v-if="scope.row.type === MenuTypeEnum.BUTTON" type="danger"
|
||||
>按钮</el-tag
|
||||
>
|
||||
<el-tag v-if="scope.row.type === MenuTypeEnum.EXTLINK" type="info"
|
||||
>外链</el-tag
|
||||
>
|
||||
<el-tag v-if="scope.row.type === MenuTypeEnum.CATALOG" type="warning">目录</el-tag>
|
||||
<el-tag v-if="scope.row.type === MenuTypeEnum.MENU" type="success">菜单</el-tag>
|
||||
<el-tag v-if="scope.row.type === MenuTypeEnum.BUTTON" type="danger">按钮</el-tag>
|
||||
<el-tag v-if="scope.row.type === MenuTypeEnum.EXTLINK" type="info">外链</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -86,30 +61,15 @@
|
|||
|
||||
<el-table-column fixed="right" align="center" label="操作" width="220">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="scope.row.type == 'CATALOG' || scope.row.type == 'MENU'"
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
@click.stop="openDialog(scope.row.id)"
|
||||
>
|
||||
<el-button v-if="scope.row.type == 'CATALOG' || scope.row.type == 'MENU'" type="primary" link size="small"
|
||||
@click.stop="openDialog(scope.row.id)">
|
||||
<i-ep-plus />新增
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
@click.stop="openDialog(undefined, scope.row.id)"
|
||||
>
|
||||
<el-button type="primary" link size="small" @click.stop="openDialog(undefined, scope.row.id)">
|
||||
<i-ep-edit />编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
@click.stop="handleDelete(scope.row.id)"
|
||||
><i-ep-delete />
|
||||
<el-button type="primary" link size="small" @click.stop="handleDelete(scope.row.id)"><i-ep-delete />
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -117,25 +77,12 @@
|
|||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
v-model="dialog.visible"
|
||||
:title="dialog.title"
|
||||
destroy-on-close
|
||||
append-to-body
|
||||
width="1000px"
|
||||
@close="closeDialog"
|
||||
top="5vh"
|
||||
>
|
||||
<el-dialog v-model="dialog.visible" :title="dialog.title" destroy-on-close append-to-body width="1000px"
|
||||
@close="closeDialog" top="5vh">
|
||||
<el-form ref="menuFormRef" :model="formData" :rules="rules" label-width="160px">
|
||||
<el-form-item label="父级菜单" prop="parentId">
|
||||
<el-tree-select
|
||||
v-model="formData.parentId"
|
||||
placeholder="选择上级菜单"
|
||||
:data="menuOptions"
|
||||
filterable
|
||||
check-strictly
|
||||
:render-after-expand="false"
|
||||
/>
|
||||
<el-tree-select v-model="formData.parentId" placeholder="选择上级菜单" :data="menuOptions" filterable check-strictly
|
||||
:render-after-expand="false" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="菜单名称" prop="name">
|
||||
|
@ -155,56 +102,31 @@
|
|||
<el-input v-model="formData.path" placeholder="请输入外链完整路径" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
v-if="
|
||||
<el-form-item v-if="
|
||||
formData.type == MenuTypeEnum.CATALOG || formData.type == MenuTypeEnum.MENU
|
||||
"
|
||||
label="路由路径"
|
||||
prop="path"
|
||||
>
|
||||
<el-input
|
||||
v-if="formData.type == MenuTypeEnum.CATALOG"
|
||||
v-model="formData.path"
|
||||
placeholder="system"
|
||||
/>
|
||||
" label="路由路径" prop="path">
|
||||
<el-input v-if="formData.type == MenuTypeEnum.CATALOG" v-model="formData.path" placeholder="system" />
|
||||
<el-input v-else v-model="formData.path" placeholder="user" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 组件页面完整路径 -->
|
||||
<el-form-item
|
||||
v-if="formData.type == MenuTypeEnum.MENU"
|
||||
label="页面路径"
|
||||
prop="component"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.component"
|
||||
placeholder="system/user/index"
|
||||
style="width: 95%"
|
||||
>
|
||||
<template v-if="formData.type == MenuTypeEnum.MENU" #prepend
|
||||
>src/views/</template
|
||||
>
|
||||
<el-form-item v-if="formData.type == MenuTypeEnum.MENU" label="页面路径" prop="component">
|
||||
<el-input v-model="formData.component" placeholder="system/user/index" style="width: 95%">
|
||||
<template v-if="formData.type == MenuTypeEnum.MENU" #prepend>src/views/</template>
|
||||
<template v-if="formData.type == MenuTypeEnum.MENU" #append>.vue</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
v-if="formData.type !== MenuTypeEnum.BUTTON"
|
||||
prop="visible"
|
||||
label="显示状态"
|
||||
>
|
||||
<el-form-item v-if="formData.type !== MenuTypeEnum.BUTTON" prop="visible" label="显示状态">
|
||||
<el-radio-group v-model="formData.visible">
|
||||
<el-radio :label="1">显示</el-radio>
|
||||
<el-radio :label="0">隐藏</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
v-if="
|
||||
<el-form-item v-if="
|
||||
formData.type === MenuTypeEnum.CATALOG || formData.type === MenuTypeEnum.MENU
|
||||
"
|
||||
label="是否始终显示"
|
||||
>
|
||||
" label="是否始终显示">
|
||||
<template #label>
|
||||
<div>
|
||||
是否始终显示
|
||||
|
@ -231,28 +153,15 @@
|
|||
</el-form-item>
|
||||
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number
|
||||
v-model="formData.sort"
|
||||
style="width: 100px"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
/>
|
||||
<el-input-number v-model="formData.sort" style="width: 100px" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 权限标识 -->
|
||||
<el-form-item
|
||||
v-if="formData.type == MenuTypeEnum.BUTTON"
|
||||
label="权限标识"
|
||||
prop="perm"
|
||||
>
|
||||
<el-form-item v-if="formData.type == MenuTypeEnum.BUTTON" label="权限标识" prop="perm">
|
||||
<el-input v-model="formData.perm" placeholder="sys:user:add" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
v-if="formData.type !== MenuTypeEnum.BUTTON"
|
||||
label="图标"
|
||||
prop="icon"
|
||||
>
|
||||
<el-form-item v-if="formData.type !== MenuTypeEnum.BUTTON" label="图标" prop="icon">
|
||||
<!-- 图标选择器 -->
|
||||
<icon-select v-model="formData.icon" />
|
||||
</el-form-item>
|
||||
|
@ -272,14 +181,13 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
defineOptions({
|
||||
name: "Menu",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
||||
import MenuAPI from "@/api/menu";
|
||||
import { MenuQuery, MenuForm, MenuVO } from "@/api/menu/model";
|
||||
import { MenuTypeEnum } from "@/enums/MenuTypeEnum";
|
||||
const router = useRouter();
|
||||
const queryFormRef = ref(ElForm);
|
||||
|
@ -291,12 +199,12 @@ const dialog = reactive({
|
|||
visible: false,
|
||||
});
|
||||
|
||||
const queryParams = reactive<MenuQuery>({});
|
||||
const menuList = ref<MenuVO[]>([]);
|
||||
const queryParams = reactive({});
|
||||
const menuList = ref([]);
|
||||
|
||||
const menuOptions = ref<OptionType[]>([]);
|
||||
const menuOptions = ref([]);
|
||||
|
||||
const formData = reactive<MenuForm>({
|
||||
const formData = reactive({
|
||||
parentId: 0,
|
||||
visible: 1,
|
||||
sort: 1,
|
||||
|
@ -316,7 +224,7 @@ const rules = reactive({
|
|||
});
|
||||
|
||||
// 选择表格的行菜单ID
|
||||
const selectedRowMenuId = ref<number | undefined>();
|
||||
const selectedRowMenuId = ref();
|
||||
|
||||
const menuCacheData = reactive({
|
||||
type: "",
|
||||
|
@ -330,7 +238,7 @@ const tableData = [
|
|||
name: "算法分割管理",
|
||||
type: "MENU",
|
||||
path: "/modelMgr",
|
||||
component:"/modelMgr/index",
|
||||
component: "/modelMgr/index",
|
||||
perm: "system:deployment:list",
|
||||
visible: 1,
|
||||
sort: 1,
|
||||
|
@ -383,7 +291,7 @@ const tableData = [
|
|||
name: "互联协议管理",
|
||||
type: "MENU",
|
||||
path: "/modelMgr",
|
||||
component:"/modelMgr/index",
|
||||
component: "/modelMgr/index",
|
||||
perm: "system:deployment:list",
|
||||
visible: 1,
|
||||
sort: 2,
|
||||
|
@ -456,7 +364,7 @@ function resetQuery() {
|
|||
}
|
||||
|
||||
/**行点击事件 */
|
||||
function onRowClick(row: MenuVO) {
|
||||
function onRowClick(row) {
|
||||
selectedRowMenuId.value = row.id;
|
||||
}
|
||||
|
||||
|
@ -466,7 +374,7 @@ function onRowClick(row: MenuVO) {
|
|||
* @param parentId 父菜单ID
|
||||
* @param menuId 菜单ID
|
||||
*/
|
||||
function openDialog(parentId?: number, menuId?: number) {
|
||||
function openDialog(parentId, menuId) {
|
||||
router.push({ path: "/system/menuEdit" });
|
||||
// MenuAPI.getOptions()
|
||||
// .then((data) => {
|
||||
|
@ -500,7 +408,7 @@ function onMenuTypeChange() {
|
|||
|
||||
/** 菜单保存提交 */
|
||||
function submitForm() {
|
||||
menuFormRef.value.validate((isValid: boolean) => {
|
||||
menuFormRef.value.validate((isValid) => {
|
||||
if (isValid) {
|
||||
const menuId = formData.id;
|
||||
if (menuId) {
|
||||
|
@ -521,7 +429,7 @@ function submitForm() {
|
|||
}
|
||||
|
||||
/** 删除菜单 */
|
||||
function handleDelete(menuId: number) {
|
||||
function handleDelete(menuId) {
|
||||
// if (!menuId) {
|
||||
// ElMessage.warning("请勾选删除项");
|
||||
// return false;
|
||||
|
|
|
@ -2,20 +2,10 @@
|
|||
<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
|
||||
>
|
||||
<template #header><svg-icon icon-class="pause" style="width: 20px; height: 20px" />角色基本信息</template>
|
||||
<el-row>
|
||||
<el-col :lg="12" :xs="24">
|
||||
<el-form
|
||||
ref="roleFormRef"
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form ref="roleFormRef" :model="formData" :rules="rules" label-width="100px">
|
||||
<el-form-item label="角色名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入角色名称" />
|
||||
</el-form-item>
|
||||
|
@ -41,12 +31,7 @@
|
|||
</el-form-item>
|
||||
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number
|
||||
v-model="formData.sort"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
style="width: 100px"
|
||||
/>
|
||||
<el-input-number v-model="formData.sort" controls-position="right" :min="0" style="width: 100px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
|
@ -58,31 +43,28 @@
|
|||
<el-button @click="closeBack"><i-ep-close />取 消</el-button>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
<script setup>
|
||||
defineOptions({
|
||||
name: "User",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
});
|
||||
|
||||
import UserAPI from "@/api/user";
|
||||
import { UserForm } from "@/api/user/model";
|
||||
const router = useRouter();
|
||||
const loading = ref(false); // 加载状态
|
||||
|
||||
const router = useRouter();
|
||||
const loading = ref(false); // 加载状态
|
||||
const calTypeList = ref(); // 角色下拉数据源
|
||||
|
||||
const calTypeList = ref<OptionType[]>(); // 角色下拉数据源
|
||||
|
||||
// 用户表单数据
|
||||
const formData = reactive<UserForm>({
|
||||
// 用户表单数据
|
||||
const formData = reactive({
|
||||
status: 1,
|
||||
});
|
||||
});
|
||||
|
||||
const radioSelected = ref('');
|
||||
const radioSelected = ref('');
|
||||
|
||||
// 校验规则
|
||||
const rules = reactive({
|
||||
// 校验规则
|
||||
const rules = reactive({
|
||||
username: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
nickname: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
deptId: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
|
@ -101,9 +83,9 @@
|
|||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
const list = [
|
||||
const list = [
|
||||
{
|
||||
csmc: "10.0.8.12",
|
||||
csms: "DOCKER-TOOL",
|
||||
|
@ -120,54 +102,59 @@
|
|||
csmc3: "1.2",
|
||||
csmc4: "已连接",
|
||||
},
|
||||
];
|
||||
];
|
||||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
loading.value = true;
|
||||
setTimeout(() => {
|
||||
ElMessage.success("保存成功");
|
||||
loading.value = false;
|
||||
closeBack();
|
||||
}, 1000);
|
||||
}, 3000);
|
||||
}, 3000);
|
||||
|
||||
/** 返回默认页面 */
|
||||
function closeBack() {
|
||||
/** 返回默认页面 */
|
||||
function closeBack() {
|
||||
router.push({ path: "/system/role" });
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(() => {
|
||||
//handleQuery();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.model-detail {
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.model-detail {
|
||||
:deep(.el-card__header) {
|
||||
padding: 8px 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.sp-file {
|
||||
}
|
||||
|
||||
.sp-file {
|
||||
color: #29d;
|
||||
}
|
||||
.tb-base-info {
|
||||
}
|
||||
|
||||
.tb-base-info {
|
||||
line-height: 30px;
|
||||
}
|
||||
:deep(.svg-icon) {
|
||||
}
|
||||
|
||||
: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 {
|
||||
justify-content: end;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
}
|
||||
</style>
|
|
@ -5,41 +5,26 @@
|
|||
<template #header>
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<el-button type="primary" @click="openDialog('user-form')"
|
||||
><i-ep-plus />新增角色</el-button
|
||||
>
|
||||
<el-button type="primary" @click="openDialog('user-form')"><i-ep-plus />新增角色</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="角色名称" prop="keywords">
|
||||
<el-input
|
||||
v-model="queryParams.keywords"
|
||||
placeholder="请输入角色名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.keywords" placeholder="请输入角色名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery"
|
||||
><i-ep-search />搜索</el-button
|
||||
>
|
||||
<el-button type="primary" @click="handleQuery"><i-ep-search />搜索</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<i-ep-refresh />
|
||||
重置</el-button
|
||||
>
|
||||
重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table
|
||||
ref="dataTableRef"
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table ref="dataTableRef" v-loading="loading" :data="tableData" highlight-current-row>
|
||||
<el-table-column label="角色名称" prop="name" />
|
||||
<el-table-column label="角色编码" prop="code" />
|
||||
<el-table-column label="状态" align="center">
|
||||
|
@ -51,56 +36,26 @@
|
|||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column fixed="right" label="操作" width="220">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
@click="openMenuDialog(scope.row)"
|
||||
>
|
||||
<el-button type="primary" size="small" link @click="openMenuDialog(scope.row)">
|
||||
<i-ep-position />分配权限
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
@click="openDialog(scope.row.id)"
|
||||
>
|
||||
<el-button type="primary" size="small" link @click="openDialog(scope.row.id)">
|
||||
<i-ep-edit />编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
@click="handleDelete(scope.row.id)"
|
||||
>
|
||||
<el-button type="primary" size="small" link @click="handleDelete(scope.row.id)">
|
||||
<i-ep-delete />删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-if="total > 0"
|
||||
v-model:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="handleQuery"
|
||||
/>
|
||||
<pagination v-if="total > 0" v-model:total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="handleQuery" />
|
||||
</el-card>
|
||||
|
||||
<!-- 角色表单弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialog.visible"
|
||||
:title="dialog.title"
|
||||
width="500px"
|
||||
@close="closeDialog"
|
||||
>
|
||||
<el-form
|
||||
ref="roleFormRef"
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-dialog v-model="dialog.visible" :title="dialog.title" width="500px" @close="closeDialog">
|
||||
<el-form ref="roleFormRef" :model="formData" :rules="rules" label-width="100px">
|
||||
<el-form-item label="角色名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入角色名称" />
|
||||
</el-form-item>
|
||||
|
@ -126,12 +81,7 @@
|
|||
</el-form-item>
|
||||
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number
|
||||
v-model="formData.sort"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
style="width: 100px"
|
||||
/>
|
||||
<el-input-number v-model="formData.sort" controls-position="right" :min="0" style="width: 100px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
@ -144,19 +94,9 @@
|
|||
</el-dialog>
|
||||
|
||||
<!-- 分配菜单弹窗 -->
|
||||
<el-dialog
|
||||
v-model="menuDialogVisible"
|
||||
:title="'【' + checkedRole.name + '】权限分配'"
|
||||
width="800px"
|
||||
>
|
||||
<el-dialog v-model="menuDialogVisible" :title="'【' + checkedRole.name + '】权限分配'" width="800px">
|
||||
<el-scrollbar v-loading="loading" max-height="600px">
|
||||
<el-tree
|
||||
ref="menuRef"
|
||||
node-key="value"
|
||||
show-checkbox
|
||||
:data="tableData2"
|
||||
:default-expand-all="true"
|
||||
>
|
||||
<el-tree ref="menuRef" node-key="value" show-checkbox :data="tableData2" :default-expand-all="true">
|
||||
<template #default="{ data }">
|
||||
{{ data.label }}
|
||||
</template>
|
||||
|
@ -165,9 +105,7 @@
|
|||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="handleRoleMenuSubmit"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button type="primary" @click="handleRoleMenuSubmit">确 定</el-button>
|
||||
<el-button @click="menuDialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -175,12 +113,8 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import RoleAPI from "@/api/role";
|
||||
import MenuAPI from "@/api/menu";
|
||||
|
||||
import { RolePageVO, RoleForm, RoleQuery } from "@/api/role/model";
|
||||
|
||||
defineOptions({
|
||||
name: "Role",
|
||||
inheritAttrs: false,
|
||||
|
@ -191,7 +125,7 @@ const roleFormRef = ref(ElForm);
|
|||
const menuRef = ref(ElTree);
|
||||
|
||||
const loading = ref(false);
|
||||
const ids = ref<number[]>([]);
|
||||
const ids = ref([]);
|
||||
const total = ref(0);
|
||||
|
||||
const queryParams = reactive<RoleQuery>({
|
||||
|
@ -199,7 +133,7 @@ const queryParams = reactive<RoleQuery>({
|
|||
pageSize: 10,
|
||||
});
|
||||
|
||||
const roleList = ref<RolePageVO[]>();
|
||||
const roleList = ref();
|
||||
|
||||
const dialog = reactive({
|
||||
title: "",
|
||||
|
@ -237,7 +171,7 @@ const tableData2 = [
|
|||
label: "算法分割管理",
|
||||
type: "MENU",
|
||||
path: "/modelMgr",
|
||||
component:"/modelMgr/index",
|
||||
component: "/modelMgr/index",
|
||||
perm: "system:deployment:list",
|
||||
visible: 1,
|
||||
sort: 1,
|
||||
|
@ -290,7 +224,7 @@ const tableData2 = [
|
|||
label: "互联协议管理",
|
||||
type: "MENU",
|
||||
path: "/modelMgr",
|
||||
component:"/modelMgr/index",
|
||||
component: "/modelMgr/index",
|
||||
perm: "system:deployment:list",
|
||||
visible: 1,
|
||||
sort: 2,
|
||||
|
@ -355,13 +289,9 @@ const rules = reactive({
|
|||
|
||||
const menuDialogVisible = ref(false);
|
||||
|
||||
const menuList = ref<OptionType[]>([]);
|
||||
const menuList = ref([]);
|
||||
|
||||
interface CheckedRole {
|
||||
id?: number;
|
||||
name?: string;
|
||||
}
|
||||
let checkedRole: CheckedRole = reactive({});
|
||||
let checkedRole= reactive({});
|
||||
|
||||
/** 查询 */
|
||||
function handleQuery() {
|
||||
|
@ -385,12 +315,12 @@ function resetQuery() {
|
|||
}
|
||||
|
||||
/** 行checkbox 选中事件 */
|
||||
function handleSelectionChange(selection: any) {
|
||||
ids.value = selection.map((item: any) => item.id);
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
}
|
||||
|
||||
/** 打开角色表单弹窗 */
|
||||
function openDialog(roleId?: number) {
|
||||
function openDialog(roleId) {
|
||||
router.push({ path: "/system/roleEdit" });
|
||||
// dialog.visible = true;
|
||||
// if (roleId) {
|
||||
|
@ -405,7 +335,7 @@ function openDialog(roleId?: number) {
|
|||
|
||||
/** 角色保存提交 */
|
||||
function handleSubmit() {
|
||||
roleFormRef.value.validate((valid: any) => {
|
||||
roleFormRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
const roleId = formData.id;
|
||||
|
@ -447,7 +377,7 @@ function resetForm() {
|
|||
}
|
||||
|
||||
/** 删除角色 */
|
||||
function handleDelete(roleId?: number) {
|
||||
function handleDelete(roleId) {
|
||||
const roleIds = [roleId || ids.value].join(",");
|
||||
if (!roleIds) {
|
||||
ElMessage.warning("请勾选删除项");
|
||||
|
@ -470,8 +400,8 @@ function handleDelete(roleId?: number) {
|
|||
}
|
||||
|
||||
/** 打开分配菜单弹窗 */
|
||||
async function openMenuDialog(row: RolePageVO) {
|
||||
checkedRole.name="管理员";
|
||||
async function openMenuDialog(row) {
|
||||
checkedRole.name = "管理员";
|
||||
menuDialogVisible.value = true;
|
||||
// const roleId = row.id;
|
||||
// if (roleId) {
|
||||
|
@ -503,9 +433,9 @@ async function openMenuDialog(row: RolePageVO) {
|
|||
function handleRoleMenuSubmit() {
|
||||
const roleId = checkedRole.id;
|
||||
if (roleId) {
|
||||
const checkedMenuIds: number[] = menuRef.value
|
||||
const checkedMenuIds = menuRef.value
|
||||
.getCheckedNodes(false, true)
|
||||
.map((node: any) => node.value);
|
||||
.map((node) => node.value);
|
||||
|
||||
loading.value = true;
|
||||
RoleAPI.updateRoleMenus(roleId, checkedMenuIds)
|
||||
|
|
|
@ -2,59 +2,32 @@
|
|||
<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
|
||||
>
|
||||
<template #header><svg-icon icon-class="pause" style="width: 20px; height: 20px" />用户基本信息</template>
|
||||
<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-input v-model="formData.username" :readonly="!!formData.id" placeholder="请输入用户名" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="formData.gender" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in roleList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option v-for="item in roleList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="角色" prop="roleIds">
|
||||
<el-select v-model="formData.roleIds" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in roleList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option v-for="item in roleList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="手机号码" prop="mobile">
|
||||
<el-input
|
||||
v-model="formData.mobile"
|
||||
placeholder="请输入手机号码"
|
||||
maxlength="11"
|
||||
/>
|
||||
<el-input v-model="formData.mobile" placeholder="请输入手机号码" maxlength="11" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input
|
||||
v-model="formData.email"
|
||||
placeholder="请输入邮箱"
|
||||
maxlength="50"
|
||||
/>
|
||||
<el-input v-model="formData.email" placeholder="请输入邮箱" maxlength="50" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态" prop="status">
|
||||
|
@ -75,22 +48,19 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
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 calTypeList = ref(); // 角色下拉数据源
|
||||
|
||||
// 用户表单数据
|
||||
const formData = reactive<UserForm>({
|
||||
const formData = reactive({
|
||||
status: 1,
|
||||
});
|
||||
|
||||
|
@ -145,21 +115,27 @@ onMounted(() => {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -6,9 +6,7 @@
|
|||
<template #header>
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<el-button type="primary" @click="openDialog()"
|
||||
><i-ep-plus />新增用户</el-button
|
||||
>
|
||||
<el-button type="primary" @click="openDialog()"><i-ep-plus />新增用户</el-button>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
|
@ -35,85 +33,43 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="pageData"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table v-loading="loading" :data="pageData" @selection-change="handleSelectionChange">
|
||||
<el-table-column key="id" label="编号" align="left" prop="user_id" />
|
||||
<el-table-column label="用户名" align="left" prop="user_name" />
|
||||
<el-table-column label="角色编号" align="left" prop="user_role" />
|
||||
<el-table-column label="角色名称" align="left" prop="user_role_name" />
|
||||
<el-table-column label="操作" align="center" fixed="right" width="320">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="small" text @click="resetPassword(scope.row)"
|
||||
><i-ep-refresh-left />修改密码</el-button
|
||||
>
|
||||
<el-button type="primary" size="small" text @click="openDialogEdit(scope.row)"
|
||||
><i-ep-edit />修改角色</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
size="small"
|
||||
@click="handleDelete(scope.row.user_id)"
|
||||
><i-ep-delete />删除</el-button
|
||||
>
|
||||
<el-button type="primary" size="small" text
|
||||
@click="resetPassword(scope.row)"><i-ep-refresh-left />修改密码</el-button>
|
||||
<el-button type="primary" size="small" text @click="openDialogEdit(scope.row)"><i-ep-edit />修改角色</el-button>
|
||||
<el-button type="primary" text size="small"
|
||||
@click="handleDelete(scope.row.user_id)"><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"
|
||||
/>
|
||||
<pagination v-if="total > 0" v-model:total="total" v-model:page="queryParams.page_num"
|
||||
v-model:limit="queryParams.page_size" @pagination="handleQuery" />
|
||||
</el-card>
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<el-dialog v-model="formVisible" :title="title" width="680">
|
||||
<!-- 用户新增/编辑表单 -->
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="用户名" prop="user_name">
|
||||
<el-input
|
||||
v-model="form.user_name"
|
||||
:disabled="form.user_id != null"
|
||||
placeholder="请输入用户名"
|
||||
/>
|
||||
<el-input v-model="form.user_name" :disabled="form.user_id != null" placeholder="请输入用户名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户角色" prop="user_role">
|
||||
<el-select v-model="form.user_role" placeholder="请选择用户角色">
|
||||
<el-option
|
||||
v-for="item in listOpt.roleList"
|
||||
:key="item.key"
|
||||
:label="item.name"
|
||||
:value="item.key"
|
||||
/>
|
||||
<el-option v-for="item in listOpt.roleList" :key="item.key" :label="item.name" :value="item.key" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="登录密码" prop="user_password" v-if="form.user_id == null">
|
||||
<el-input
|
||||
v-model="form.user_password"
|
||||
type="password"
|
||||
placeholder="请输入登录密码"
|
||||
show-password
|
||||
/>
|
||||
<el-input v-model="form.user_password" type="password" placeholder="请输入登录密码" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码" prop="password" v-if="form.user_id == null">
|
||||
<el-input
|
||||
v-model="form.password"
|
||||
type="password"
|
||||
placeholder="请输入确认密码"
|
||||
show-password
|
||||
/>
|
||||
<el-input v-model="form.password" type="password" placeholder="请输入确认密码" show-password />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 弹窗底部操作按钮 -->
|
||||
|
@ -127,7 +83,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
import md5 from 'js-md5';
|
||||
import UserAPI from "@/api/myUser";
|
||||
|
||||
|
@ -207,12 +163,12 @@ function resetQuery() {
|
|||
}
|
||||
|
||||
/** 行选中 */
|
||||
function handleSelectionChange(selection: any) {
|
||||
removeIds.value = selection.map((item: any) => item.id);
|
||||
function handleSelectionChange(selection) {
|
||||
removeIds.value = selection.map((item) => item.id);
|
||||
}
|
||||
|
||||
/** 重置密码 */
|
||||
function resetPassword(row: { [key: string]: any }) {
|
||||
function resetPassword(row) {
|
||||
ElMessageBox.prompt("请输入用户「" + row.user_name + "」的新密码", "重置密码", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
|
@ -244,7 +200,7 @@ function openDialog() {
|
|||
/**
|
||||
* 打开弹窗
|
||||
*/
|
||||
function openDialogEdit(row: { [key: string]: any }) {
|
||||
function openDialogEdit(row) {
|
||||
reset();
|
||||
title.value = "修改用户角色";
|
||||
form.user_id = row.user_id;
|
||||
|
@ -262,7 +218,7 @@ function closeDialog() {
|
|||
|
||||
/** 表单提交 */
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.user_id) {
|
||||
//修改角色
|
||||
|
@ -312,7 +268,7 @@ function reset() {
|
|||
}
|
||||
|
||||
/** 删除用户 */
|
||||
function handleDelete(id?: number) {
|
||||
function handleDelete(id) {
|
||||
ElMessageBox.confirm("确认删除用户?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
|
|
|
@ -10,7 +10,7 @@ import IconsResolver from "unplugin-icons/resolver";
|
|||
|
||||
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
|
||||
import mockDevServerPlugin from "vite-plugin-mock-dev-server";
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import { terser } from "rollup-plugin-terser";
|
||||
import UnoCSS from "unocss/vite";
|
||||
import { resolve } from "path";
|
||||
import {
|
||||
|
@ -217,14 +217,6 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
|
|||
},
|
||||
},
|
||||
rollupOptions: {
|
||||
minify: 'terser', // 使用terser插件进行代码混淆
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true, // 混淆时去除console语句
|
||||
drop_debugger: true, // 去除debugger语句
|
||||
},
|
||||
|
||||
},
|
||||
plugins: [terser()],
|
||||
output: {
|
||||
// manualChunks: {
|
||||
|
|
Loading…
Reference in New Issue