方案详情
This commit is contained in:
60
electron.vite.config.1763722141233.mjs
Normal file
60
electron.vite.config.1763722141233.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
|
||||||
|
};
|
||||||
@ -51,7 +51,7 @@
|
|||||||
<el-button @click="reset">重置</el-button>
|
<el-button @click="reset">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="option">
|
<div class="option">
|
||||||
<el-button :icon="CirclePlus" @click="addPlan">新建推演</el-button>
|
<el-button :icon="CirclePlus" @click="()=>{addPlan()}">新建推演</el-button>
|
||||||
<el-button :icon="Download">导入</el-button>
|
<el-button :icon="Download">导入</el-button>
|
||||||
<el-button :icon="Upload">导出</el-button>
|
<el-button :icon="Upload">导出</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -89,9 +89,33 @@
|
|||||||
</el-popconfirm>-->
|
</el-popconfirm>-->
|
||||||
|
|
||||||
<div style="display: flex;justify-content: space-evenly">
|
<div style="display: flex;justify-content: space-evenly">
|
||||||
|
<el-tooltip
|
||||||
|
class="box-item"
|
||||||
|
effect="dark"
|
||||||
|
content="编辑推演"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
<Edit style="width: 16px; height: 16px; cursor:pointer;" @click="toTSEdit(scope.row)"></Edit>
|
<Edit style="width: 16px; height: 16px; cursor:pointer;" @click="toTSEdit(scope.row)"></Edit>
|
||||||
<Warning style="width: 16px; height: 16px; cursor:pointer; "></Warning>
|
</el-tooltip>
|
||||||
|
<el-tooltip
|
||||||
|
class="box-item"
|
||||||
|
effect="dark"
|
||||||
|
content="详情"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
|
<Warning style="width: 16px; height: 16px; cursor:pointer; "
|
||||||
|
@click="()=>{addPlan(scope.row)}"></Warning>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-tooltip
|
||||||
|
class="box-item"
|
||||||
|
effect="dark"
|
||||||
|
content="删除"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
<Delete style="width: 16px; height: 16px; cursor:pointer;" @click="delPlanBtn(scope.row.id)"/>
|
<Delete style="width: 16px; height: 16px; cursor:pointer;" @click="delPlanBtn(scope.row.id)"/>
|
||||||
|
</el-tooltip>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -231,10 +255,11 @@ const delPlan = (id) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const addPlan = () => {
|
const addPlan = (row = null) => {
|
||||||
|
console.log("row", row)
|
||||||
// $(".newPlan")[0].style.display = 'block'
|
// $(".newPlan")[0].style.display = 'block'
|
||||||
// $(".el-overlay")[0].style.display = 'block'
|
// $(".el-overlay")[0].style.display = 'block'
|
||||||
eventBus.emit('openAddPlan', true)
|
eventBus.emit('openAddPlan', true, row)
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
const generateData = (
|
const generateData = (
|
||||||
|
|||||||
@ -2,12 +2,21 @@
|
|||||||
<div class="newPlan">
|
<div class="newPlan">
|
||||||
<el-dialog v-model="isShowPup" draggable :close-on-click-modal="false" :modal="true">
|
<el-dialog v-model="isShowPup" draggable :close-on-click-modal="false" :modal="true">
|
||||||
<template #header>
|
<template #header>
|
||||||
|
<template v-if="!currentPlanId">
|
||||||
<div class="set_pup_header">
|
<div class="set_pup_header">
|
||||||
<div class="system_title">
|
<div class="system_title">
|
||||||
<!--{{ t('model.title') }}-->
|
<!--{{ t('model.title') }}-->
|
||||||
新建推演
|
新建推演
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div class="detailTitle">
|
||||||
|
推演详情
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<div class="set_detail">
|
<div class="set_detail">
|
||||||
<el-form
|
<el-form
|
||||||
@ -23,6 +32,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="仿真开始时间" prop="simulationStartTime" required>
|
<el-form-item label="仿真开始时间" prop="simulationStartTime" required>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
:readonly="Boolean(currentPlanId)"
|
||||||
v-model="sizeForm.simulationStartTime"
|
v-model="sizeForm.simulationStartTime"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
timezone="Asia/Shanghai"
|
timezone="Asia/Shanghai"
|
||||||
@ -55,7 +65,7 @@ import {TsApi} from "../../api/ts";
|
|||||||
const eventBus: any = inject('bus')
|
const eventBus: any = inject('bus')
|
||||||
const emit = defineEmits(['addCallback']);
|
const emit = defineEmits(['addCallback']);
|
||||||
const isShowPup = ref(false)
|
const isShowPup = ref(false)
|
||||||
|
let currentPlanId = ref('')
|
||||||
|
|
||||||
interface RuleForm {
|
interface RuleForm {
|
||||||
name: string,
|
name: string,
|
||||||
@ -64,7 +74,7 @@ interface RuleForm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ruleFormRef = ref<FormInstance>()
|
const ruleFormRef = ref<FormInstance>()
|
||||||
const sizeForm = reactive<RuleForm>({
|
let sizeForm = reactive<RuleForm>({
|
||||||
name: '',
|
name: '',
|
||||||
simulationStartTime: '',
|
simulationStartTime: '',
|
||||||
desc: '',
|
desc: '',
|
||||||
@ -95,6 +105,7 @@ const addPlan = async (formEl: FormInstance | undefined) => {
|
|||||||
if (!formEl) return
|
if (!formEl) return
|
||||||
await formEl.validate((valid, fields) => {
|
await formEl.validate((valid, fields) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
if (currentPlanId.value == '') {
|
||||||
TsApi.addPlan(sizeForm).then(res => {
|
TsApi.addPlan(sizeForm).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
@ -108,20 +119,52 @@ const addPlan = async (formEl: FormInstance | undefined) => {
|
|||||||
formEl.resetFields()
|
formEl.resetFields()
|
||||||
// $(".newPlan")[0].style.display = "none"
|
// $(".newPlan")[0].style.display = "none"
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
let params = sizeForm
|
||||||
|
params['id'] = currentPlanId
|
||||||
|
delete params['simulationStartTime']
|
||||||
|
TsApi.updatePlan(params).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
emit('addCallback');
|
||||||
|
}
|
||||||
|
isShowPup.value = false
|
||||||
|
formEl.resetFields()
|
||||||
|
})
|
||||||
|
console.log("更新接口")
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log('提交失败', fields)
|
console.log('提交失败', fields)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
eventBus.on('openAddPlan', (data, cb, type) => {
|
eventBus.on('openAddPlan', (data, plan) => {
|
||||||
// selectCallback = cb
|
console.log("plan", plan)
|
||||||
// addType.value = type
|
|
||||||
|
Object.assign(sizeForm, {
|
||||||
|
name: '',
|
||||||
|
simulationStartTime: '',
|
||||||
|
desc: ''
|
||||||
|
})
|
||||||
|
currentPlanId.value = ''
|
||||||
isShowPup.value = data
|
isShowPup.value = data
|
||||||
// if (data) {
|
// 存在方案,显示详情做修改,或者做新建
|
||||||
// getModelList()
|
if (plan) {
|
||||||
// getSetting()
|
currentPlanId.value = plan.id
|
||||||
// }
|
Object.assign(sizeForm, {
|
||||||
|
name: plan.name,
|
||||||
|
simulationStartTime: plan.simulationStartTime,
|
||||||
|
desc: plan.desc,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log("currentPlanId.value", currentPlanId.value)
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
const close = () => {
|
const close = () => {
|
||||||
|
|
||||||
@ -229,6 +272,18 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.detailTitle {
|
||||||
|
text-shadow: 0px 0px 9px rgba(20, 118, 255, 1);
|
||||||
|
/** 文本1 */
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 0px;
|
||||||
|
line-height: 32px;
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
text-align: left;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
.optionbtn {
|
.optionbtn {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
@ -256,5 +311,7 @@ defineExpose({
|
|||||||
|
|
||||||
:deep(.el-textarea__inner) {
|
:deep(.el-textarea__inner) {
|
||||||
height: 150px;
|
height: 150px;
|
||||||
|
color: #fff;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user