Browse Source

增加导入功能

twzydn20000928 2 years ago
parent
commit
e6e5587ecf

+ 8 - 0
src/api/suport/piont.js

@@ -42,3 +42,11 @@ export function delPiont(id) {
     method: 'delete'
   })
 }
+
+// 查询检查点管理列表
+export function getPointOption() {
+  return request({
+    url: '/suport/piont/getOption',
+    method: 'get',
+  })
+}

+ 128 - 0
src/components/Echarts/TreeNode.vue

@@ -0,0 +1,128 @@
+<template>
+  <div>
+    <div id="chart" style="width: 600px; height: 400px;"></div>
+  </div>
+</template>
+
+<script>
+import * as echarts from 'echarts';
+
+export default {
+  mounted() {
+    this.initChart();
+  },
+  methods: {
+    initChart() {
+      const chart = echarts.init(document.getElementById('chart'));
+
+      // 初始数据
+      const data = {
+        name: '节点1',
+        children: []
+      };
+
+      // 点击节点时的处理函数
+      const handleClick = (event, node) => {
+        event.stopPropagation();
+
+        // 添加左节点
+        const addLeftNode = () => {
+          const leftNode = {
+            name: '左节点',
+            children: []
+          };
+          node.children.unshift(leftNode);
+          this.updateChart();
+        };
+
+        // 添加右节点
+        const addRightNode = () => {
+          const rightNode = {
+            name: '右节点',
+            children: []
+          };
+          node.children.push(rightNode);
+          this.updateChart();
+        };
+
+        // 删除节点
+        const deleteNode = () => {
+          const parent = node.parent;
+          if (parent) {
+            const index = parent.children.indexOf(node);
+            if (index !== -1) {
+              parent.children.splice(index, 1);
+              this.updateChart();
+            }
+          }
+        };
+
+        // 创建按钮
+        const addButton = (text, handler) => {
+          const button = document.createElement('button');
+          button.innerText = text;
+          button.addEventListener('click', handler);
+          return button;
+        };
+
+        // 弹出按钮面板
+        const panel = document.createElement('div');
+        panel.appendChild(addButton('添加左节点', addLeftNode));
+        panel.appendChild(addButton('添加右节点', addRightNode));
+        panel.appendChild(addButton('删除该节点', deleteNode));
+        panel.style.position = 'absolute';
+        panel.style.top = event.clientY + 'px';
+        panel.style.left = event.clientX + 'px';
+        panel.style.background = '#fff';
+        panel.style.padding = '10px';
+        panel.style.border = '1px solid #ccc';
+
+        document.body.appendChild(panel);
+      };
+
+      // 更新图表数据
+      this.updateChart = () => {
+        const option = {
+          series: [{
+            type: 'tree',
+            data: [data],
+            top: '10%',
+            left: '10%',
+            bottom: '10%',
+            right: '10%',
+            symbol: 'emptyCircle',
+            symbolSize: 7,
+            initialTreeDepth: -1,
+            expandAndCollapse: false,
+            label: {
+              position: 'bottom',
+              verticalAlign: 'middle',
+              align: 'center',
+              fontSize: 10
+            },
+            leaves: {
+              label: {
+                position: 'right',
+                verticalAlign: 'middle',
+                align: 'left'
+              }
+            },
+            emphasis: {
+              focus: 'descendant'
+            },
+            animationDurationUpdate: 750
+          }]
+        };
+
+        chart.setOption(option);
+      };
+
+      // 监听点击事件
+      chart.on('click', handleClick);
+
+      // 初始化图表数据
+      this.updateChart();
+    }
+  }
+};
+</script>

+ 39 - 0
src/views/knowledge/search/CustomNode.vue

@@ -0,0 +1,39 @@
+<template>
+  <div>
+    <div class="node-container" ref="nodeContainer"></div>
+    <button @click="handleButtonClick">按钮</button>
+  </div>
+</template>
+
+<script>
+import echarts from 'echarts';
+
+export default {
+  mounted() {
+    this.renderNode();
+  },
+  methods: {
+    renderNode() {
+      // 使用Echarts渲染节点
+      const chart = echarts.init(this.$refs.nodeContainer);
+      // 在这里可以编写你的节点配置和数据
+      // 示例:
+      const options = {
+        // Echarts配置项
+        // ...
+      };
+      chart.setOption(options);
+    },
+    handleButtonClick() {
+      // 按钮点击事件处理逻辑
+      // ...
+    }
+  }
+}
+</script>
+
+<style>
+.node-container {
+  height: 300px; /* 调整节点容器的高度 */
+}
+</style>

+ 250 - 88
src/views/knowledge/search/chartByD3.vue

@@ -1,101 +1,263 @@
 <template>
-  <div class="app-container" ref="svgContainer"></div>
+  <div>
+    <div id="chart" style="width: 1000px; height: 700px"></div>
+    <button v-show="selectedNode" @click="addLeftNode">添加左节点</button>
+    <button v-show="selectedNode" @click="addRightNode">添加右节点</button>
+    <button v-show="selectedNode" @click="deleteNode">删除该节点</button>
+    <button v-show="selectedNode" @click="updateNode">修改该节点</button>
+
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="检查点" prop="startId">
+          <el-select
+            v-model="form.id"
+            placeholder="请选择检查点"
+            value-key="id"
+            filterable
+          >
+            <el-option
+              v-for="item in pointList"
+              :key="item.id"
+              :label="item.check_piont"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
+
+
 <script>
-import * as d3 from 'd3';
+import echarts from "echarts";
+import { getPointOption } from "@/api/suport/piont";
 
 export default {
+  data() {
+    return {
+      chartInstance: null,
+      selectedNode: null,
+      treeData: [
+        // 初始节点
+        {
+          name: "Root",
+          value: null,
+          children: [],
+          borderColor: {
+            color: "#ccc"
+          }
+        },
+      ],
+      title: "",
+      open: false,
+      form: {},
+      rules: {},
+      pointList: [],
+      ecode:'',
+    };
+  },
+
+  created() {
+    this.getPointOption();
+  },
+
   mounted() {
-    const svgContainer = this.$refs.svgContainer;
-    const width = svgContainer.clientWidth;
-    const height = svgContainer.clientHeight;
-
-    const links = [
-      { source: "A", target: "B", value: 1 },
-      { source: "A", target: "C", value: 2 },
-      { source: "B", target: "C", value: 3 },
-      { source: "B", target: "D", value: 4 },
-      { source: "C", target: "D", value: 5 },
-    ];
-
-    const nodes = [
-      { id: "A", x: 100, y: 100 },
-      { id: "B", x: 200, y: 100 },
-      { id: "C", x: 150, y: 200 },
-      { id: "D", x: 250, y: 200 },
-    ];
-
-    const svg = d3.select(svgContainer).append("svg")
-      .attr("width", width)
-      .attr("height", height);
-
-    const link = svg.selectAll("line")
-      .data(links)
-      .join("line")
-      .attr("stroke", "black")
-      .attr("stroke-width", d => d.value);
-
-    const node = svg.selectAll("circle")
-      .data(nodes)
-      .join("circle")
-      .attr("r", 20)
-      .attr("fill", "red")
-      .call(drag(simulation));
-
-    const label = svg.selectAll("text")
-      .data(nodes)
-      .join("text")
-      .text(d => d.id)
-      .attr("x", d => d.x)
-      .attr("y", d => d.y);
-
-    const simulation = d3.forceSimulation(nodes)
-      .force("link", d3.forceLink(links).id(d => d.id))
-      .force("charge", d3.forceManyBody())
-      .force("center", d3.forceCenter(width / 2, height / 2));
-
-    simulation.on("tick", () => {
-      link
-        .attr("x1", d => d.source.x)
-        .attr("y1", d => d.source.y)
-        .attr("x2", d => d.target.x)
-        .attr("y2", d => d.target.y);
-
-      node
-        .attr("cx", d => d.x)
-        .attr("cy", d => d.y);
-
-      label
-        .attr("x", d => d.x)
-        .attr("y", d => d.y - 25);
-    });
-
-    function drag(simulation) {
-
-      function dragstarted(event) {
-        if (!event.active) simulation.alphaTarget(0.3).restart();
-        event.subject.fx = event.subject.x;
-        event.subject.fy = event.subject.y;
+    this.chartInstance = echarts.init(document.getElementById("chart"));
+    this.chartInstance.on("click", this.selectNode); // 监听点击事件
+    this.renderChart();
+    this.levelOrder();
+  },
+  beforeDestroy() {
+    this.chartInstance.off("click", this.selectNode); // 移除监听事件
+  },
+  methods: {
+    renderChart() {
+      const option = {
+        // ECharts配置项
+        tooltip: {
+          trigger: "item",
+          triggerOn: "mousemove",
+        },
+        series: [
+          {
+            type: "tree",
+            data: this.treeData,
+            left: "2%",
+            right: "2%",
+            top: "8%",
+            bottom: "20%",
+            symbol: "emptyCircle",
+            orient: "vertical",
+            symbolSize: 30,
+            itemStyle: {
+              color: null,
+            },
+            expandAndCollapse: false,
+            label: {
+              position: "bottom",
+              rotate: 0,
+              verticalAlign: "middle",
+              align: "center",
+              fontSize: 15,
+              distance: 10,
+            },
+            animationDurationUpdate: 750,
+            initialTreeDepth: 10,
+          },
+        ],
+      };
+
+      this.chartInstance.setOption(option);
+    },
+
+    reset() {
+      this.form = {
+        id: null,
+        code: null,
+        checkPiont: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+      };
+      this.resetForm("form");
+    },
+
+    selectNode(params) {
+      if (params.data && params.data.name) {
+        this.selectedNode = params.data;
       }
+    },
 
-      function dragged(event) {
-        event.subject.fx = event.x;
-        event.subject.fy = event.y;
+    addLeftNode() {
+      const newNode = { name: "Left Node", value: null, children: [], itemStyle: {borderColor: "#FF0000"} };
+      this.selectedNode.children.unshift(newNode);
+      this.treeData = this.chartInstance.getOption().series[0].data;
+      this.chartInstance.clear();
+      this.renderChart();
+      this.levelOrder();
+    },
+    addRightNode() {
+      const newNode = { name: "Right Node", value: null, children: [],itemStyle: {borderColor: "#0000FF"} };
+      this.selectedNode.children.push(newNode);
+      this.treeData = this.chartInstance.getOption().series[0].data;
+      this.chartInstance.clear();
+      this.renderChart();
+      this.levelOrder();
+    },
+    deleteNode() {
+      this.treeData = this.chartInstance.getOption().series[0].data;
+      const parentNode = this.findParentNode(this.treeData, this.selectedNode);
+      if (parentNode) {
+        const index = parentNode.children.indexOf(this.selectedNode);
+        parentNode.children.splice(index, 1);
+        this.chartInstance.clear();
+        this.renderChart();
+        this.levelOrder();
+        this.selectedNode = null;
+      }
+    },
+    findParentNode(tree, targetNode) {
+      for (const node of tree) {
+        for (const child of node.children) {
+          if (child.name === targetNode.name) {
+            return node;
+          }
+        }
+        if (node.children.length > 0) {
+          const parentNode = this.findParentNode(node.children, targetNode);
+          if (parentNode) {
+            return parentNode;
+          }
+        }
       }
+      return null;
+    },
 
-      function dragended(event) {
-        if (!event.active) simulation.alphaTarget(0);
-        event.subject.fx = null;
-        event.subject.fy = null;
+    updateNode() {
+      this.reset();
+      this.form.id = this.selectedNode.value;
+      this.open = true;
+      this.title = "修改检查点";
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.selectedNode.value = this.form.id;
+      for (const point of this.pointList) {
+        if (point.id === this.form.id) {
+          this.selectedNode.name = point.check_piont;
+          break;
+        }
       }
+      this.open = false;
+      this.treeData = this.chartInstance.getOption().series[0].data;
+      this.chartInstance.clear();
+      this.renderChart();
+      this.levelOrder();
+    },
+
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+
+    getPointOption() {
+      getPointOption().then((resp) => {
+        this.pointList = resp.data;
+        console.info(resp);
+      });
+    },
 
-      return d3.drag()
-        .on("start", dragstarted)
-        .on("drag",
-          dragged)
-        .on("end", dragended);
-    }
-  }
-}
-</script>
+    levelOrder() {
+        const ret = [];
+        if (!this.treeData) {
+            return ret;
+        }
+        const q = [];
+        q.push(this.treeData[0]);
+        while (q.length !== 0) {
+            const currentLevelSize = q.length;
+            const nullNode = { name: "", value: 0, children: [],itemStyle: {} };
+            for (let i = 1; i <= currentLevelSize; ++i) {
+                const node = q.shift();
+                ret.push(node.value);
+                let n = node.children.length;
+                if (n == 0 && node.value != 0) {
+                  q.push(nullNode);
+                  q.push(nullNode);
+                }
+                else if (n == 1) {
+                  if (node.children[0].itemStyle.borderColor == "#FF0000"){
+                    q.push(node.children[0]);
+                    q.push(nullNode);
+                  }
+                  else {
+                    q.push(nullNode);
+                    q.push(node.children[0]);
+                  }
+                }
+                else if (n == 2) {
+                  q.push(node.children[0]);
+                  q.push(node.children[1]);
+                }
+            }
+        }
+        let n = ret.length;
+        while (ret[n-1] === 0) {
+          ret.pop();
+          n--;
+        }
+        this.$emit('flowEncode', ret.join(','));
+    },
+  },
+};
+</script>

+ 128 - 49
src/views/suport/flow/index.vue

@@ -1,6 +1,14 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+      @submit.native.prevent
+    >
       <el-form-item label="故障名称" prop="errorAppearance">
         <el-input
           v-model="queryParams.errorAppearance"
@@ -10,8 +18,16 @@
         />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
 
@@ -24,7 +40,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['suport:flow:add']"
-        >新增</el-button>
+          >新增</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -35,7 +52,8 @@
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['suport:flow:edit']"
-        >修改</el-button>
+          >修改</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -46,7 +64,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['suport:flow:remove']"
-        >删除</el-button>
+          >删除</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -56,7 +75,8 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['suport:flow:export']"
-        >导出</el-button>
+          >导出</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -66,37 +86,59 @@
           size="mini"
           @click="handleImport"
           v-hasPermi="['suport:flow:add']"
-          >导入</el-button>
+          >导入</el-button
+        >
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="flowList" @selection-change="handleSelectionChange">
+    <el-table
+      v-loading="loading"
+      :data="flowList"
+      @selection-change="handleSelectionChange"
+    >
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="故障名称" align="center" prop="errorAppearance" />
       <el-table-column label="流程数据" align="center" prop="flowEncode" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
         <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleGraph(scope.row)"
+            v-hasPermi="['suport:flow:edit']"
+            >图修改</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['suport:flow:edit']"
-          >修改</el-button>
+            >修改</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['suport:flow:remove']"
-          >删除</el-button>
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
-      v-show="total>0"
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -104,14 +146,20 @@
     />
 
     <!-- 添加或修改故障名称对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+    <el-dialog v-if="open" :title="title" :visible.sync="open" width="1200px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" @submit.native.prevent>
         <el-form-item label="故障名称" prop="errorAppearance">
-          <el-input v-model="form.errorAppearance" placeholder="请输入故障名称" />
+          <el-input
+            v-model="form.errorAppearance"
+            placeholder="请输入故障名称"
+          />
         </el-form-item>
         <el-form-item label="流程数据" prop="flowEncode">
           <el-input v-model="form.flowEncode" type="textarea" placeholder="请输入内容" />
         </el-form-item>
+        <div>
+          <chartByD3 @handleEncode="handleFlowEncode" :codes="form.flowEncode" />
+        </div>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -143,7 +191,8 @@
         <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
         <div class="el-upload__tip text-center" slot="tip">
           <div class="el-upload__tip" slot="tip">
-            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据
+            <el-checkbox v-model="upload.updateSupport" />
+            是否更新已经存在的数据
           </div>
           <span>仅允许导入xls、xlsx格式文件。</span>
           <el-link
@@ -166,9 +215,11 @@
 <script>
 import { listFlow, getInfo, delFlow, addFlow, updateFlow } from "@/api/suport/flow";
 import { getToken } from "@/utils/auth";
+import chartByD3 from "@/views/knowledge/search/chartByD3.vue";
 
 export default {
   name: "Flow",
+  components: { chartByD3 },
   data() {
     return {
       // 遮罩层
@@ -200,8 +251,7 @@ export default {
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-      },
+      rules: {},
       upload: {
         // 是否显示弹出层
         open: false,
@@ -221,14 +271,14 @@ export default {
   created() {
     this.getList();
   },
-  activated(){
+  activated() {
     this.getList();
   },
   methods: {
     /** 查询故障名称列表 */
     getList() {
       this.loading = true;
-      listFlow(this.queryParams).then(response => {
+      listFlow(this.queryParams).then((response) => {
         this.flowList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -249,7 +299,7 @@ export default {
         createBy: null,
         createTime: null,
         updateBy: null,
-        updateTime: null
+        updateTime: null,
       };
       this.resetForm("form");
     },
@@ -265,38 +315,51 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
+      this.ids = selection.map((item) => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
     },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
       this.open = true;
-      this.title = "添加故障名称";
+      this.title = "添加故障";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const id = row.id || this.ids
-      getInfo(id).then(response => {
+      const id = row.id || this.ids;
+      getInfo(id).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改故障";
+      });
+    },
+
+    /** 图修改按钮操作 */
+    handleGraph(row) {
+      this.reset();
+      const id = row.id || this.ids;
+      getInfo(id).then((response) => {
         this.form = response.data;
         this.open = true;
-        this.title = "修改故障名称";
+        this.title = "修改故障";
       });
     },
+
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
+          // this.form.flowEncode = this.form._flowEncode
           if (this.form.id != null) {
-            updateFlow(this.form).then(response => {
+            updateFlow(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addFlow(this.form).then(response => {
+            addFlow(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -308,18 +371,26 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除故障名称编号为"' + ids + '"的数据项?').then(function() {
-        return delFlow(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      this.$modal
+        .confirm('是否确认删除故障名称编号为"' + ids + '"的数据项?')
+        .then(function () {
+          return delFlow(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('suport/flow/export', {
-        ...this.queryParams
-      }, `flow_${new Date().getTime()}.xlsx`)
+      this.download(
+        "suport/flow/export",
+        {
+          ...this.queryParams,
+        },
+        `flow_${new Date().getTime()}.xlsx`
+      );
     },
 
     /** 导入按钮操作 */
@@ -329,11 +400,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      this.download(
-        "suport/flow/importTemplate",
-        {},
-        `排故流程导入模板.xlsx`
-      );
+      this.download("suport/flow/importTemplate", {}, `排故流程导入模板.xlsx`);
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -357,6 +424,18 @@ export default {
     submitFileForm() {
       this.$refs.upload.submit();
     },
-  }
+    // 父组件自定义事件
+    closeInfo() {
+      this.flowInfoOpen = false;
+      this.createInfoOpen = false;
+      this.tripletInfoOpen = false;
+      this.subTask = {};
+      this.getListByTaskId();
+    },
+
+    handleFlowEncode(data) {
+      this.form.flowEncode = data;
+    }
+  },
 };
 </script>