对接方案列表界面的接口

This commit is contained in:
zyl
2025-11-03 10:31:11 +08:00
parent 9bf4cd0adf
commit 509dd825b4
4 changed files with 255 additions and 0 deletions

View File

@ -0,0 +1,23 @@
import request from '@/axios/request'
import {data} from "jquery";
export const TsApi = {
addPlan: async (data: any) => {
return await request.post({
url: '/tsPlan/add',
data
})
},
planList: async (data: any) => {
return await request.post({
url: '/tsPlan/list',
data
})
},
delPlan: async (data: any) => {
return await request.post({
url: '/tsPlan/delete',
data
})
},
}

View File

@ -0,0 +1,172 @@
<template>
<div class="newPlan">
<el-dialog v-model="isShowPup" :modal="true" draggable :close-on-click-modal="false">
<template #header>
<div class="set_pup_header">
<div class="system_title">
<!--{{ t('model.title') }}-->
新建推演
</div>
</div>
</template>
<div class="set_detail">
<el-form
style="max-width: 600px"
:model="sizeForm"
label-width="auto"
:label-position="'top'"
>
<el-form-item label="推演名称">
<el-input v-model="sizeForm.name" placeholder="请填写名称"/>
</el-form-item>
<el-form-item label="仿真开始时间">
<el-date-picker
v-model="sizeForm.date1"
type="datetime"
placeholder="请选择日期时间"
/>
</el-form-item>
<el-form-item label="推演描述" prop="desc">
<el-input v-model="sizeForm.desc" type="textarea" placeholder="请输入内容描述"/>
</el-form-item>
<el-form-item>
<div class="optionbtn">
<el-button @click="addPlan">确定</el-button>
<el-button>取消</el-button>
</div>
</el-form-item>
</el-form>
</div>
</el-dialog>
</div>
</template>
<script lang="ts" setup>
import {ref, reactive,} from "vue";
import {ElMessage} from 'element-plus'
import {TsApi} from "../../api/ts";
const isShowPup = ref(true)
const sizeForm = reactive({
name: '',
// date1: '',
desc: '',
})
const addPlan = () => {
TsApi.addPlan({name: sizeForm.name, desc: sizeForm.desc}).then(res => {
console.log(res)
if (res.code == 200) {
ElMessage({
message: '操作成功',
type: 'success'
})
}
$(".newPlan")[0].style.display = "none"
})
}
const close = () => {
isShowPup.value = false
}
defineExpose({
open,
close
})
</script>
<style lang="scss" scoped>
.newPlan {
display: none;
.set_detail {
width: 90%;
margin: 0 auto;
height: 100%;
overflow-y: hidden;
}
:deep(.el-dialog) {
background: linear-gradient(180deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0) 100%),
rgba(0, 0, 0, 0.6);
border: 1px solid #00c9ff;
padding: 0 !important;
width: 380px;
//height: 630px;
height: 480px;
}
:deep(.el-dialog__headerbtn) {
height: 30px;
width: 30px;
border-bottom-left-radius: 80%;
background-color: #008989;
&:hover {
background-color: #00ffff;
.el-dialog__close {
color: rgba(0, 66, 66, 1); // 悬停时改变关闭图标为红色
}
}
}
:deep(.el-dialog__headerbtn .el-dialog__close) {
color: #fff;
}
.set_pup_header {
width: 100%;
height: 100%;
// background-color: #00ffff;
display: flex;
justify-content: center;
align-items: center;
//padding-bottom: 20px;
.system_title {
background: url('@/assets/images/titlebg.png') no-repeat;
background-size: 100% 100%;
width: 229px;
height: 34px;
line-height: 34px;
text-align: center;
font-family: 'alimamashuheiti';
font-size: 18px;
color: #fff;
//font-weight: 700;
}
}
.optionbtn {
margin: 0 auto;
}
}
:deep(.el-input__wrapper), :deep(.el-input__inner ) {
background: transparent;
--el-input-placeholder-color: #fff;
color: #fff;
//border: 1px solid #0ff;
}
:deep(.el-form-item__label) {
color: #fff;
}
:deep(.el-input ) {
--el-date-editor-width: 100%;
}
:deep(.el-dialog__body) {
padding: 0 !important;
height: calc(100% - 50px);
}
:deep(.el-textarea__inner) {
height: 150px;
}
</style>