Merge branch 'zyl' of http://xny.yj-3d.com:3000/zhouyulong/electron-4 into zyl
This commit is contained in:
@ -51,7 +51,7 @@
|
||||
<el-button @click="reset">重置</el-button>
|
||||
</div>
|
||||
<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="Upload">导出</el-button>
|
||||
</div>
|
||||
@ -89,9 +89,33 @@
|
||||
</el-popconfirm>-->
|
||||
|
||||
<div style="display: flex;justify-content: space-evenly">
|
||||
<Edit style="width: 16px; height: 16px; cursor:pointer;" @click="toTSEdit(scope.row)"></Edit>
|
||||
<Warning style="width: 16px; height: 16px; cursor:pointer; "></Warning>
|
||||
<Delete style="width: 16px; height: 16px; cursor:pointer;" @click="delPlanBtn(scope.row.id)"/>
|
||||
<el-tooltip
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
content="编辑推演"
|
||||
placement="top"
|
||||
>
|
||||
<Edit style="width: 16px; height: 16px; cursor:pointer;" @click="toTSEdit(scope.row)"></Edit>
|
||||
</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)"/>
|
||||
</el-tooltip>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</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'
|
||||
// $(".el-overlay")[0].style.display = 'block'
|
||||
eventBus.emit('openAddPlan', true)
|
||||
eventBus.emit('openAddPlan', true, row)
|
||||
}
|
||||
/*
|
||||
const generateData = (
|
||||
|
||||
@ -2,12 +2,21 @@
|
||||
<div class="newPlan">
|
||||
<el-dialog v-model="isShowPup" draggable :close-on-click-modal="false" :modal="true">
|
||||
<template #header>
|
||||
<div class="set_pup_header">
|
||||
<div class="system_title">
|
||||
<!--{{ t('model.title') }}-->
|
||||
新建推演
|
||||
<template v-if="!currentPlanId">
|
||||
<div class="set_pup_header">
|
||||
<div class="system_title">
|
||||
<!--{{ t('model.title') }}-->
|
||||
新建推演
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="detailTitle">
|
||||
推演详情
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
</template>
|
||||
<div class="set_detail">
|
||||
<el-form
|
||||
@ -23,6 +32,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="仿真开始时间" prop="simulationStartTime" required>
|
||||
<el-date-picker
|
||||
:readonly="Boolean(currentPlanId)"
|
||||
v-model="sizeForm.simulationStartTime"
|
||||
type="datetime"
|
||||
timezone="Asia/Shanghai"
|
||||
@ -55,7 +65,7 @@ import {TsApi} from "../../api/ts";
|
||||
const eventBus: any = inject('bus')
|
||||
const emit = defineEmits(['addCallback']);
|
||||
const isShowPup = ref(false)
|
||||
|
||||
let currentPlanId = ref('')
|
||||
|
||||
interface RuleForm {
|
||||
name: string,
|
||||
@ -64,7 +74,7 @@ interface RuleForm {
|
||||
}
|
||||
|
||||
const ruleFormRef = ref<FormInstance>()
|
||||
const sizeForm = reactive<RuleForm>({
|
||||
let sizeForm = reactive<RuleForm>({
|
||||
name: '',
|
||||
simulationStartTime: '',
|
||||
desc: '',
|
||||
@ -95,33 +105,66 @@ const addPlan = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
await formEl.validate((valid, fields) => {
|
||||
if (valid) {
|
||||
TsApi.addPlan(sizeForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
})
|
||||
emit('addCallback');
|
||||
}
|
||||
isShowPup.value = false
|
||||
formEl.resetFields()
|
||||
// $(".newPlan")[0].style.display = "none"
|
||||
})
|
||||
if (currentPlanId.value == '') {
|
||||
TsApi.addPlan(sizeForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
})
|
||||
emit('addCallback');
|
||||
}
|
||||
isShowPup.value = false
|
||||
formEl.resetFields()
|
||||
// $(".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 {
|
||||
console.log('提交失败', fields)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
eventBus.on('openAddPlan', (data, cb, type) => {
|
||||
// selectCallback = cb
|
||||
// addType.value = type
|
||||
eventBus.on('openAddPlan', (data, plan) => {
|
||||
console.log("plan", plan)
|
||||
|
||||
Object.assign(sizeForm, {
|
||||
name: '',
|
||||
simulationStartTime: '',
|
||||
desc: ''
|
||||
})
|
||||
currentPlanId.value = ''
|
||||
isShowPup.value = data
|
||||
// if (data) {
|
||||
// getModelList()
|
||||
// getSetting()
|
||||
// }
|
||||
// 存在方案,显示详情做修改,或者做新建
|
||||
if (plan) {
|
||||
currentPlanId.value = plan.id
|
||||
Object.assign(sizeForm, {
|
||||
name: plan.name,
|
||||
simulationStartTime: plan.simulationStartTime,
|
||||
desc: plan.desc,
|
||||
})
|
||||
}
|
||||
console.log("currentPlanId.value", currentPlanId.value)
|
||||
|
||||
|
||||
})
|
||||
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 {
|
||||
margin: 0 auto;
|
||||
}
|
||||
@ -256,5 +311,7 @@ defineExpose({
|
||||
|
||||
:deep(.el-textarea__inner) {
|
||||
height: 150px;
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user