对接方案列表界面的接口
This commit is contained in:
60
electron.vite.config.1761880900863.mjs
Normal file
60
electron.vite.config.1761880900863.mjs
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
// electron.vite.config.ts
|
||||||
|
import { resolve } from "path";
|
||||||
|
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
|
||||||
|
import vue from "@vitejs/plugin-vue";
|
||||||
|
import AutoImport from "unplugin-auto-import/vite";
|
||||||
|
import Components from "unplugin-vue-components/vite";
|
||||||
|
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
|
||||||
|
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
|
||||||
|
import path from "path";
|
||||||
|
var electron_vite_config_default = defineConfig({
|
||||||
|
main: {
|
||||||
|
plugins: [externalizeDepsPlugin()]
|
||||||
|
},
|
||||||
|
preload: {
|
||||||
|
plugins: [externalizeDepsPlugin()]
|
||||||
|
},
|
||||||
|
renderer: {
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@renderer": resolve("src/renderer/src"),
|
||||||
|
"@": resolve("src/renderer/src")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
vue(),
|
||||||
|
AutoImport({
|
||||||
|
imports: ["vue"],
|
||||||
|
dts: "src/auto-imports.d.ts",
|
||||||
|
// 自动生成类型声明文件
|
||||||
|
resolvers: [ElementPlusResolver()]
|
||||||
|
}),
|
||||||
|
Components({
|
||||||
|
resolvers: [ElementPlusResolver()]
|
||||||
|
}),
|
||||||
|
// SVG图标插件配置
|
||||||
|
// 配置SVG图标插件
|
||||||
|
createSvgIconsPlugin({
|
||||||
|
iconDirs: [path.resolve(process.cwd(), "src/renderer/src/icons/svg")],
|
||||||
|
symbolId: "icon-[name]",
|
||||||
|
// 自动清除 SVG 中的 fill 和 stroke 属性
|
||||||
|
svgoOptions: {
|
||||||
|
plugins: [{ name: "removeAttrs", params: { attrs: ["fill", "stroke", "stroke-width"] } }]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]
|
||||||
|
/*server: {
|
||||||
|
port: 8848,
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: localStorage.getItem('ip') || 'http://127.0.0.1:8848',
|
||||||
|
changeOrigin: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
});
|
||||||
|
export {
|
||||||
|
electron_vite_config_default as default
|
||||||
|
};
|
||||||
Binary file not shown.
23
src/renderer/src/api/ts/index.ts
Normal file
23
src/renderer/src/api/ts/index.ts
Normal 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
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
172
src/renderer/src/views/TS/newPlan.vue
Normal file
172
src/renderer/src/views/TS/newPlan.vue
Normal 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>
|
||||||
Reference in New Issue
Block a user