ludc
2023-07-14 7602a824e39e19260ae32bb45e799e6ce43300ac
Source/UBCS-WEB/src/components/code-dialog-page/formulaEditor.vue
@@ -312,9 +312,9 @@
                    :show-header="false"
                    style="width: 100%"
                  >
                    <el-table-column prop="formula" width="40">
                    <el-table-column prop="formula" width="120">
                    </el-table-column>
                    <el-table-column prop="desc" width="100"> </el-table-column>
                    <el-table-column prop="desc" width="200"> </el-table-column>
                  </el-table>
                </el-tab-pane>
                <el-tab-pane label="系统变量" name="second">
@@ -324,9 +324,9 @@
                    :show-header="false"
                    style="width: 100%"
                  >
                    <el-table-column prop="formula" width="150">
                    <el-table-column prop="formula" width="200">
                    </el-table-column>
                    <el-table-column prop="desc" width="150"> </el-table-column>
                    <el-table-column prop="desc" width="200"> </el-table-column>
                  </el-table>
                </el-tab-pane>
              </el-tabs>
@@ -338,11 +338,20 @@
  </el-dialog>
</template>
  <script>
export default {
  name: "formulaEditor",
  props: {
    // 对话框显示隐藏控制
    visible: {
        type: "Boolean",
        default: false,
    },
    componentRuleText:{
      type:String,
      default: ""
    },
    //本场景变量
    thisSceneTableData: {
      type: Array,
@@ -354,7 +363,7 @@
  },
  data() {
    return {
      isShowformulaEdit: false, //公式编辑框对话框显示控制
      isShowformulaEdit: this.visible, //公式编辑框对话框显示控制
      formulaContent: '', //公式编辑框内容,方便值的回传
      activeName: 'first', //当前活动的tab
      activeNameAttr: 'first', //变量中的当前活动tab
@@ -639,6 +648,15 @@
      ],
    };
  },
  watch: {
      // 监听父组件传的窗口显示隐藏的值
      visible (){
          this.isShowformulaEdit = this.visible;
      }
  },
  mounted() {
    this.formulaContent=this.componentRuleText
  },
  methods: {
    //双击添加公式内容
@@ -653,6 +671,7 @@
    //关闭时清空上次公式内容
    closeFormulaEdit(){
      this.resetFormulaContent();
      this.$emit('update:visible',false);
    },
    //编辑完成公式内容回显并关闭对话框
    saveFormulaContent(){
@@ -662,14 +681,15 @@
          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 {
@@ -677,7 +697,7 @@
    height: 85%;
    width: 100%;
  }
  .formula-editor-total {
    /* margin-top: 3px; */
    height: 100%;
@@ -705,7 +725,7 @@
    height: auto;
    justify-content: space-between;
    align-items: center;
   }
   }
  .formula-editor-btn-sm {
    width: 4.5vw;
@@ -719,4 +739,3 @@
  }
</style>