Commit 3a59492c authored by 高宇's avatar 高宇

1.优化代码

parent 6c24d998
<template> <template>
<div class="tagfour"> <div class="tagfour">
<div class="tarButonArea"> <div class="tarButonArea" v-show="!isupload">
<el-button type="primary" class="tarButon" @click="upload">上传</el-button> <el-button type="primary" class="tarButon" @click="upload">上传</el-button>
</div> </div>
<!-- 第一个模板 --> <!-- 第一个模板 -->
<div v-if="showTable">
<div class="tableArea" v-if="index === 0 || index=== 4"> <div class="tableArea" v-if="index === 0 || index=== 4">
<div class="measureTable"> <div class="measureTable">
<!-- 测量 --> <!-- 测量 -->
...@@ -125,8 +126,8 @@ ...@@ -125,8 +126,8 @@
<div class="tableHear" style="border-right: 1px solid;border-top: 1px solid"> <div class="tableHear" style="border-right: 1px solid;border-top: 1px solid">
<div class="firstCell" style="border-bottom: 1px solid">WD2</div> <div class="firstCell" style="border-bottom: 1px solid">WD2</div>
<div class="secondCell" style="border-bottom: 1px solid"> <div class="secondCell" style="border-bottom: 1px solid">
<div class="cellContent">{{ form.WDBList[0] ? parseFloat(form.WDAList[0]).toFixed(3) : '-' }}</div> <div class="cellContent">{{ form.WDBList[0] ? parseFloat(form.WDBList[0]).toFixed(3) : '-' }}</div>
<div class="cellContent">{{ form.WDBList[1] ? parseFloat(form.WDAList[1]).toFixed(3) : '-' }}</div> <div class="cellContent">{{ form.WDBList[1] ? parseFloat(form.WDBList[1]).toFixed(3) : '-' }}</div>
</div> </div>
<div class="threeCell" style="border-bottom: 1px solid">{{ form.WDBList[2] ? parseFloat(form.WDBList[2]).toFixed(3) : '-' }}</div> <div class="threeCell" style="border-bottom: 1px solid">{{ form.WDBList[2] ? parseFloat(form.WDBList[2]).toFixed(3) : '-' }}</div>
<div class="threeCell" style="border-bottom: 1px solid">{{ form.WDBList[3] ? parseFloat(form.WDBList[3]).toFixed(3) : '-' }}</div> <div class="threeCell" style="border-bottom: 1px solid">{{ form.WDBList[3] ? parseFloat(form.WDBList[3]).toFixed(3) : '-' }}</div>
...@@ -199,7 +200,7 @@ ...@@ -199,7 +200,7 @@
</div> </div>
</div> </div>
<!-- 第二个模板--> <!-- 第二个模板-->
<div class="TwotableArea" v-if="index === 1 || index === 2 || index === 5 || index=== 6" > <div class="TwotableArea" v-if="index === 1 || index === 2 || index === 5 || index=== 6" >
<div class="measureTable"> <div class="measureTable">
<!-- 测量 --> <!-- 测量 -->
...@@ -324,7 +325,7 @@ ...@@ -324,7 +325,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 第三格模板--> <!-- 第三格模板-->
<div class="threetableArea" v-if="index === 3" > <div class="threetableArea" v-if="index === 3" >
<div class="measureTable"> <div class="measureTable">
<!-- 测量 --> <!-- 测量 -->
...@@ -426,6 +427,8 @@ ...@@ -426,6 +427,8 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- 对话框 --> <!-- 对话框 -->
<el-dialog :title="dialogController.title" :visible.sync="dialogController.open" width="600px" <el-dialog :title="dialogController.title" :visible.sync="dialogController.open" width="600px"
:close-on-click-modal="false" append-to-body> :close-on-click-modal="false" append-to-body>
...@@ -463,12 +466,27 @@ export default { ...@@ -463,12 +466,27 @@ export default {
defaultObject: { defaultObject: {
type: Object, type: Object,
required: true required: true
},
defaultControls: {
type: String,
required: true
},
defaultShow: {
type: String,
}
// 是否显示table 1:显示 0:不显示
},
computed: {
showTable() {
return this.defaultShow === '1'
} }
}, },
data() { data() {
return { return {
index: this.defaultIndex, index: this.defaultIndex,
form: this.defaultObject, form: this.defaultObject,
// 是否上传按钮
isupload: this.defaultControls === '0' || this.defaultControls === '3'? false: true,
// 对话框控制器 // 对话框控制器
dialogController: { dialogController: {
title: '', title: '',
...@@ -535,6 +553,7 @@ export default { ...@@ -535,6 +553,7 @@ export default {
this.form.projectAList = projectAList this.form.projectAList = projectAList
this.form.projetcBList = projetcBList this.form.projetcBList = projetcBList
this.form.projectCList = projectCList this.form.projectCList = projectCList
this.form.projectDList = []
this.index = this.sheetForm.sheetIndex this.index = this.sheetForm.sheetIndex
this.dialogController.open = false this.dialogController.open = false
// 提交给父组件 // 提交给父组件
...@@ -561,6 +580,11 @@ export default { ...@@ -561,6 +580,11 @@ export default {
this.form.WDAList = WDAList this.form.WDAList = WDAList
this.form.projectDList = projectDList this.form.projectDList = projectDList
this.index = this.sheetForm.sheetIndex this.index = this.sheetForm.sheetIndex
this.form.LDB = []
this.form.WDBList = []
this.form.projectAList = []
this.form.projectCList = []
this.form.projetcBList = []
this.dialogController.open = false this.dialogController.open = false
} }
if (this.sheetForm.sheetIndex === 2) { if (this.sheetForm.sheetIndex === 2) {
...@@ -584,6 +608,11 @@ export default { ...@@ -584,6 +608,11 @@ export default {
this.form.LDA = LDAList this.form.LDA = LDAList
this.form.WDAList = WDAList this.form.WDAList = WDAList
this.form.projectDList = projectDList this.form.projectDList = projectDList
this.form.LDB = []
this.form.WDBList = []
this.form.projectAList = []
this.form.projectCList = []
this.form.projetcBList = []
this.index = this.sheetForm.sheetIndex this.index = this.sheetForm.sheetIndex
this.dialogController.open = false this.dialogController.open = false
} }
...@@ -607,6 +636,12 @@ export default { ...@@ -607,6 +636,12 @@ export default {
this.form.LDA = LDList this.form.LDA = LDList
this.form.WDAList = WDAList this.form.WDAList = WDAList
this.form.projectDList = projectDList this.form.projectDList = projectDList
this.form.LD = []
this.form.LDB = []
this.form.WDBList = []
this.form.projectAList = []
this.form.projectCList = []
this.form.projetcBList = []
this.index = this.sheetForm.sheetIndex this.index = this.sheetForm.sheetIndex
this.dialogController.open = false this.dialogController.open = false
} }
...@@ -645,6 +680,7 @@ export default { ...@@ -645,6 +680,7 @@ export default {
this.form.projectAList = projectAList this.form.projectAList = projectAList
this.form.projetcBList = projetcBList this.form.projetcBList = projetcBList
this.form.projectCList = projectCList this.form.projectCList = projectCList
this.form.projectDList = []
this.index = this.sheetForm.sheetIndex this.index = this.sheetForm.sheetIndex
this.dialogController.open = false this.dialogController.open = false
} }
...@@ -670,6 +706,12 @@ export default { ...@@ -670,6 +706,12 @@ export default {
this.form.WDAList = WDAList this.form.WDAList = WDAList
this.form.projectDList = projectDList this.form.projectDList = projectDList
this.index = this.sheetForm.sheetIndex this.index = this.sheetForm.sheetIndex
this.form.LD = []
this.form.LDB = []
this.form.WDBList = []
this.form.projectAList = []
this.form.projectCList = []
this.form.projetcBList = []
this.dialogController.open = false this.dialogController.open = false
} }
if (this.sheetForm.sheetIndex === 6) { if (this.sheetForm.sheetIndex === 6) {
...@@ -693,11 +735,20 @@ export default { ...@@ -693,11 +735,20 @@ export default {
this.form.LDA = LDAList this.form.LDA = LDAList
this.form.WDAList = WDAList this.form.WDAList = WDAList
this.form.projectDList = projectDList this.form.projectDList = projectDList
this.form.LD = []
this.form.LDB = []
this.form.WDBList = []
this.form.projectAList = []
this.form.projectCList = []
this.form.projetcBList = []
this.index = this.sheetForm.sheetIndex this.index = this.sheetForm.sheetIndex
this.dialogController.open = false this.dialogController.open = false
} }
console.log('form',this.form)
this.showTable = true
this.$emit('sheetIndex',this.index) this.$emit('sheetIndex',this.index)
this.$emit('tarFrom',this.form) this.$emit('tarFrom',this.form)
this.$emit('ShowTabel','1');
}) })
}, },
// 取消按钮 // 取消按钮
...@@ -729,6 +780,12 @@ export default { ...@@ -729,6 +780,12 @@ export default {
console.log('new',newValue) console.log('new',newValue)
// this.index = oldValue // this.index = oldValue
} }
},
'defaultUpload': {
handler(oldValue,newValue) {
console.log('old111',oldValue)
// this.index = oldValue
}
} }
} }
} }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment