wangyanshen
2023-02-01 dd6abcc7f7d3c42ef8cf82c545015f4f43379ae7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!--  -->
<template>
  <div style="width: 100%; height: 100%; display: flex">
    <left-tree
      :treedata="treeData"
      titleName="故障树版本列表"
      :defaultSelectValue="defaultSelectValue"
      :selectData="selectData"
      :selectIsShow="true"
      :defaultExpandedKeys="defaultExpandedKeys"
      :currentNodeKey="currentNodeKey"
      @selectchange="selectchange"
      @click="handleNodeClick"
    >
      <template v-slot:titleright>
        <div class="titleSlotRight">
          <fks-button icon="fks-icon-plus" type="text" style="margin-right:5px;" @click="addGroup"></fks-button>
        </div>
      </template>
    </left-tree>
    <div class="boxright">
      <titleBoxVue style="background-color:#fff" :title="titleName">
        
      </titleBoxVue>
 
      <flow-edit style="height:calc(100% - 50px);margin-top:10px;"></flow-edit>
 
      <fks-dialog
        title="添加故障树版本"
        width="400px"
        :visible.sync="addFaultGroupFormVisible"
      >
      <span slot="title">
        <fks-button icon="fks-icon-plus" type="text"></fks-button>
        &nbsp;
        <span class="fks-dialog__title">添加故障树版本</span>
      </span>
        <fks-form :model="addFaultGroupForm" label-width="80px">
          <fks-form-item label="名称">
            <fks-input
              v-model="addFaultGroupForm.name"
              autocomplete="off"
            ></fks-input>
          </fks-form-item>
          <fks-form-item label="说明">
            <fks-input
              type="textarea"
              :rows="3"
              autocomplete="off"
              v-model="addFaultGroupForm.note"
            >
            </fks-input>
          </fks-form-item>
        </fks-form>
        <div slot="footer" class="dialog-footer">
          <fks-button @click="addFaultGroupFormVisible = false"
            >取 消</fks-button
          >
          <fks-button type="primary" @click="addFaultGroupFormVisible = false"
            >确 定</fks-button
          >
        </div>
      </fks-dialog>
    </div>
  </div>
</template>
  
  <script>
import titleBoxVue from "@/views/main/components/titleBox.vue";
import leftTree from "@/views/main/components/leftTreeByData.vue";
import FlowEdit from "@/views/main/flow-x6/index.vue";
 
const treeData = [
  {
    label: "泵",
    id: "s1",
    children: [
      {
        id: "1",
        label: "振动故障",
      },
      {
        id: "2",
        label: "噪音故障",
      },
      {
        id: "3",
        label: "运行故障",
        children: [
          {
            id: "3.1",
            label: "水泵无法启动",
          },
          {
            id: "3.2",
            label: "水泵出口压力过低",
            children: [
              {
                id: "3.2.1",
                label: "版本01",
              },
              {
                id: "3.2.2",
                label: "版本02",
              },
            ],
          },
          {
            id: "3.3",
            label: "水泵不吸水",
          },
          {
            id: "3.4",
            label: "轴承过热",
          },
        ],
      },
    ],
  },
];
export default {
  name: "vibrationDemo",
  components: {
    titleBoxVue,
    leftTree,
    FlowEdit,
  },
  data() {
    return {
      titleName: "运行故障",
      multipleSelection: [],
      addFaultGroupFormVisible: false,
      treeData: treeData,
      currentNodeKey: "3.2.1",
      defaultExpandedKeys: ["s1", "3", "3.2"],
      defaultSelectValue: "1",
      selectData: [
        {
          value: "1",
          label: "泵",
        },
        {
          value: "2",
          label: "电机",
        },
      ],
      addFaultGroupForm: {
        name: "",
        note: "",
      },
      
    };
  },
  created() {},
  mounted() {},
  computed: {},
  watch: {},
  methods: {
    selectchange(value) {
      console.log(value, 186);
    },
    handleNodeClick(data) {
      // console.log(data, 74);
      // this.titleName = data.label;
      this.getTableData();
    },
 
    getTableData(id) {},
 
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    addGroup() {
      this.addFaultGroupFormVisible = true;
    },
  },
};
</script>
  <style scoped>
.boxright {
  flex: 1;
  height: 100%;
  overflow: auto;
  background: transparent;
  margin-left: 20px;
}
 
.titleSlotRight {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
</style>