| | |
| | | <el-dialog |
| | | title="公式编辑框" |
| | | append-to-body |
| | | :close-on-click-modal="false" |
| | | :visible.sync="isShowformulaEdit" |
| | | @close="closeFormulaEdit" |
| | | width="78%" |
| | | style="height: 150vh; margin-top: -13vh; overflow: hidden"> |
| | | |
| | | <div style="overflow-y: auto; height: 80vh"> |
| | | width="75%" |
| | | class="avue-dialog avue-dialog--top" top="-3%" |
| | | style="height: 100vh;"> |
| | | <div> |
| | | <el-row> |
| | | <!-- 左侧公式内容 --> |
| | | <el-col :span="14" style="overflow: hidden"> |
| | | <el-card |
| | | class="box-card" |
| | | style="height: 33vh; overflow-y: auto; overflow-x: auto"> |
| | | style="height: 29.5vh; overflow-y: auto; overflow-x: auto;margin-right: 10px"> |
| | | <div slot="header" class="clearfix"> |
| | | <span style="font-size: medium">公式内容</span> |
| | | <el-button |
| | |
| | | <div class="text item"> |
| | | <el-input |
| | | type="textarea" |
| | | :rows="5" |
| | | style="width: 560px" |
| | | :rows="6" |
| | | style="width: 100%" |
| | | v-model="formulaContent" |
| | | ></el-input> |
| | | </div> |
| | |
| | | <!-- 右侧运算符 --> |
| | | <el-col :span="10"> |
| | | <el-card |
| | | class="box-card" |
| | | style="height: 33vh;"> |
| | | class="box-card formula-box-card" |
| | | data-v-49729759 |
| | | style="height: 29.5vh;"> |
| | | <div slot="header" class="clearfix"> |
| | | <span style="font-size: medium">运算符</span> |
| | | </div> |
| | | <div class="text item"> |
| | | <div class="formula-editor-total"> |
| | | <div class="formula-editor"> |
| | | <div class="one"> |
| | | <button |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '7' })" |
| | | > |
| | | 7 |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '8' })" |
| | | > |
| | | 8 |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '9' })" |
| | | > |
| | | 9 |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '/' })" |
| | | > |
| | | /</button |
| | | ><br /> |
| | | /</el-button> |
| | | <br /> |
| | | </div> |
| | | <div class="one"> |
| | | <button |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '4' })" |
| | | > |
| | | 4 |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '5' })" |
| | | > |
| | | 5 |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '6' })" |
| | | > |
| | | 6 |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '*' })" |
| | | > |
| | | *</button |
| | | ><br /> |
| | | *</el-button> |
| | | <br /> |
| | | </div> |
| | | <div class="one"> |
| | | <button |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '1' })" |
| | | > |
| | | 1 |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '2' })" |
| | | > |
| | | 2 |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '3' })" |
| | | > |
| | | 3 |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '>' })" |
| | | > |
| | | -</button |
| | | ><br /> |
| | | -</el-button> |
| | | <br /> |
| | | </div> |
| | | <div class="one"> |
| | | <button |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '0' })" |
| | | > |
| | | 0 |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '00' })" |
| | | > |
| | | 00 |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '.' })" |
| | | > |
| | | . |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '+' })" |
| | | > |
| | | +</button |
| | | ><br /> |
| | | +</el-button> |
| | | <br/> |
| | | </div> |
| | | <div class="one"> |
| | | <button |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '->' })" |
| | | > |
| | | -> |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '==' })" |
| | | > |
| | | == |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '(' })" |
| | | > |
| | | ( |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: ')' })" |
| | | > |
| | | )</button |
| | | ><br /> |
| | | )</el-button> |
| | | <br /> |
| | | </div> |
| | | <div class="one"> |
| | | <button |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '<' })" |
| | | > |
| | | < |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '>' })" |
| | | > |
| | | > |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '<=' })" |
| | | > |
| | | <= |
| | | </button> |
| | | <button |
| | | </el-button> |
| | | <el-button type="primary" |
| | | class="formula-editor-btn-sm" |
| | | @click="dbClickAddContent({ formula: '>=' })" |
| | | > |
| | | >= |
| | | </button> |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <!-- 左侧公式选择区域 --> |
| | | <el-col :span="14" style="overflow: hidden"> |
| | | <el-col :span="14" style="overflow: hidden;"> |
| | | <el-card |
| | | class="box-card" |
| | | style="height: 40vh; overflow-y: auto; overflow-x: auto" |
| | | > |
| | | style="height: 35vh; overflow-y: auto; overflow-x: auto;margin-right: 10px"> |
| | | <div slot="header" class="clearfix"> |
| | | <span style="font-size: medium">公式选择</span> |
| | | </div> |
| | |
| | | > |
| | | <el-table-column prop="formula" width="300"> |
| | | </el-table-column> |
| | | <el-table-column prop="desc" width="300"> </el-table-column> |
| | | <el-table-column prop="desc"> </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | |
| | |
| | | > |
| | | <el-table-column prop="formula" width="300"> |
| | | </el-table-column> |
| | | <el-table-column prop="desc" width="300"> </el-table-column> |
| | | <el-table-column prop="desc"> </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | |
| | |
| | | > |
| | | <el-table-column prop="formula" width="300"> |
| | | </el-table-column> |
| | | <el-table-column prop="desc" width="300"> </el-table-column> |
| | | <el-table-column prop="desc"> </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | |
| | |
| | | > |
| | | <el-table-column prop="formula" width="300"> |
| | | </el-table-column> |
| | | <el-table-column prop="desc" width="300"> </el-table-column> |
| | | <el-table-column prop="desc"> </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | |
| | |
| | | > |
| | | <el-table-column prop="formula" width="300"> |
| | | </el-table-column> |
| | | <el-table-column prop="desc" width="300"> </el-table-column> |
| | | <el-table-column prop="desc" > </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | |
| | | <el-col :span="10" style="overflow: hidden"> |
| | | <el-card |
| | | class="box-card" |
| | | style="height: 40vh; overflow-y: auto; overflow-x: auto" |
| | | style="height: 35vh; overflow-y: auto; overflow-x: auto" |
| | | > |
| | | <div slot="header" class="clearfix"> |
| | | <span style="font-size: medium">变量</span> |
| | |
| | | :show-header="false" |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column prop="formula" width="40"> |
| | | <el-table-column prop="formula" width="300"> |
| | | </el-table-column> |
| | | <el-table-column prop="desc" width="100"> </el-table-column> |
| | | <el-table-column prop="desc"> </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="系统变量" name="second"> |
| | |
| | | :show-header="false" |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column prop="formula" width="150"> |
| | | <el-table-column prop="formula" width="300"> |
| | | </el-table-column> |
| | | <el-table-column prop="desc" width="150"> </el-table-column> |
| | | <el-table-column prop="desc"> </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | |
| | | |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "formulaEditor", |
| | | props: { |
| | | // 对话框显示隐藏控制 |
| | | visible: { |
| | | type: "Boolean", |
| | | default: false, |
| | | }, |
| | | componentRuleText:{ |
| | | type:String, |
| | | default: "" |
| | | }, |
| | | //本场景变量 |
| | | thisSceneTableData: { |
| | | type: Array, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | isShowformulaEdit: false, //公式编辑框对话框显示控制 |
| | | isShowformulaEdit: this.visible, //公式编辑框对话框显示控制 |
| | | formulaContent: '', //公式编辑框内容,方便值的回传 |
| | | activeName: 'first', //当前活动的tab |
| | | activeNameAttr: 'first', //变量中的当前活动tab |
| | |
| | | ], |
| | | }; |
| | | }, |
| | | watch: { |
| | | // 监听父组件传的窗口显示隐藏的值,以及值的回填 |
| | | visible() { |
| | | this.isShowformulaEdit = this.visible; |
| | | this.formulaContent=this.componentRuleText || ''; |
| | | }, |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | methods: { |
| | | |
| | | //双击添加公式内容 |
| | |
| | | //关闭时清空上次公式内容 |
| | | closeFormulaEdit(){ |
| | | this.resetFormulaContent(); |
| | | this.$emit('update:visible',false); |
| | | }, |
| | | //编辑完成公式内容回显并关闭对话框 |
| | | saveFormulaContent(){ |
| | |
| | | return; |
| | | } |
| | | //公式内容回显 |
| | | this.$emit('updateFormulaContent', this.formulaContent) // 触发update:data将子组件值传递给父组件 |
| | | this.isShowformulaEdit = false; |
| | | // 触发update:data将子组件值传递给父组件 |
| | | this.$emit('updateFormulaContent', this.formulaContent) |
| | | this.isShowformulaEdit = false; |
| | | }, |
| | | |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | |
| | | <style scoped> |
| | | |
| | | .formula-box-card >>> .el-card__body { |
| | | padding: 0px; |
| | | height: 85%; |
| | | width: 100%; |
| | | } |
| | | |
| | | .formula-editor-total { |
| | | /* margin-top: 3px; */ |
| | | height: 100%; |
| | | width: 100%; |
| | | } |
| | | |
| | | .formula-editor{ |
| | | margin-top: -15px; |
| | | margin-left: 4vw; |
| | | /*设置弹性盒子*/ |
| | | display: flex; |
| | | /*子元素以竖列排列,一共有6列*/ |
| | | flex-direction:column; |
| | | width: 310px; |
| | | height: 185px; |
| | | width: 100%; |
| | | height: 100%; |
| | | /*左右均匀排列*/ |
| | | justify-content: space-around; |
| | | /*上下均匀排列*/ |
| | |
| | | display: flex; |
| | | /*以行排列*/ |
| | | flex-direction: row; |
| | | width: 223px; |
| | | height: 80px; |
| | | width: auto; |
| | | height: auto; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | } |
| | | |
| | | .formula-editor-btn-sm { |
| | | width: 55px; |
| | | height: 29px; |
| | | background: rgb(153, 214, 240); |
| | | border-radius: 10%; |
| | | width: 68px; |
| | | height: 34px; |
| | | margin-left: 10px; |
| | | text-align: center; |
| | | line-height: 0; |
| | | /* background: rgb(153, 214, 240); */ |
| | | background: #87c2fc; |
| | | /* border-radius: 10%; */ |
| | | } |
| | | |
| | | </style> |
| | | |