wangyanshen
2023-01-11 4638422d5a6b8146ec0f8ddd1bf17160330a2049
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!--  -->
<template>
  <div style="height: 100%; background-color: transparent">
    <titleBoxVue style="background-color: #fff" title="趋势分析方法">
      <template v-slot:right>
        <div style="text-align: right; padding: 10px">
          <fks-button
            style="margin: 0 10px"
            type="primary"
            icon="fks-icon-plus"
            @click="addTrendFun"
            >添加</fks-button
          >
        </div>
      </template>
    </titleBoxVue>
 
    <fks-table
      stripe
      ref="table"
      :data.sync="tableData"
      style="width: 100%; margin-top: 10px; height: calc(100% - 50px)"
      row-key="id"
    >
      <fks-table-column prop="name" label="名称" width="180">
      </fks-table-column>
      <fks-table-column prop="code" label="识别码" width="260">
      </fks-table-column>
      <fks-table-column prop="note" label="说明"> </fks-table-column>
      <fks-table-column label="操作" width="100">
        <template slot-scope="scope">
          <fks-button
            @click="editTrendFun(scope.row)"
            type="text"
            icon="fks-icon-edit"
            size="small"
            >编辑</fks-button
          >
        </template>
      </fks-table-column>
    </fks-table>
 
    <fks-dialog
      title="添加趋势分析方法"
      width="400px"
      :visible.sync="addTrendFunVisible"
      class="reportDialog"
    >
      <fks-form
        style="width: 100%; height: calc(100% - 40px)"
        :model="addTrendFunFrom"
        label-width="80px"
      >
        <fks-form-item label="名称">
          <fks-input
            v-model="addTrendFunFrom.name"
            autocomplete="off"
          ></fks-input>
        </fks-form-item>
 
        <fks-form-item label="识别码">
          <fks-input
            v-model="addTrendFunFrom.code"
            autocomplete="off"
          ></fks-input>
        </fks-form-item>
        <fks-form-item label="说明">
          <fks-input
            type="textarea"
            :rows="3"
            autocomplete="off"
            v-model="addTrendFunFrom.note"
          >
          </fks-input>
        </fks-form-item>
      </fks-form>
      <div slot="footer" class="dialog-footer">
        <fks-button @click="addTrendFunVisible = false">取 消</fks-button>
        <fks-button type="primary" @click="addTrendFunVisible = false"
          >确 定</fks-button
        >
      </div>
    </fks-dialog>
 
    <fks-dialog
      title="编辑趋势分析方法"
      width="400px"
      :visible.sync="editTrendFunVisible"
      class="reportDialog"
    >
      <fks-form
        style="width: 100%; height: calc(100% - 40px)"
        :model="editTrendFunFrom"
        label-width="80px"
      >
        <fks-form-item label="名称">
          <fks-input
            v-model="editTrendFunFrom.name"
            autocomplete="off"
          ></fks-input>
        </fks-form-item>
 
        <fks-form-item label="识别码">
          <fks-input
            v-model="editTrendFunFrom.code"
            autocomplete="off"
          ></fks-input>
        </fks-form-item>
        <fks-form-item label="说明">
          <fks-input
            type="textarea"
            :rows="3"
            autocomplete="off"
            v-model="editTrendFunFrom.note"
          >
          </fks-input>
        </fks-form-item>
      </fks-form>
      <div slot="footer" class="dialog-footer">
        <fks-button @click="editTrendFunVisible = false">取 消</fks-button>
        <fks-button type="primary" @click="editTrendFunVisible = false"
          >确 定</fks-button
        >
      </div>
    </fks-dialog>
  </div>
</template>
    
    <script>
import titleBoxVue from "@/views/main/components/titleBox.vue";
 
const tableData = [
  {
    id: 1,
    name: "阻尼趋势预测",
    code: "TREND__ANALY_001",
    note: "",
  },
  {
    id: 2,
    name: "霍尔特趋势预测",
    code: "TREND__ANALY_002",
    note: "",
  },
  {
    id: 3,
    name: "布朗线性趋势预测",
    code: "TREND__ANALY_003",
    note: "",
  },
  {
    id: 4,
    name: "一阶平滑",
    code: "TREND__ANALY_004",
    note: "",
  },
  {
    id: 5,
    name: "二阶平滑",
    code: "TREND__ANALY_005",
    note: "",
  },
  {
    id: 6,
    name: "三阶平滑",
    code: "TREND__ANALY_006",
    note: "",
  },
];
 
export default {
  name: "vibrationDemo",
  components: {
    titleBoxVue,
  },
  data() {
    return {
      tableData: tableData,
      addTrendFunVisible: false,
      editTrendFunVisible: false,
      addTrendFunFrom: {
        name: "",
        code: "",
        note: "",
      },
      editTrendFunFrom: {
        name: "",
        code: "",
        note: "",
      },
    };
  },
  created() {},
  mounted() {},
  computed: {},
  watch: {},
  methods: {
    addTrendFun() {
      this.addTrendFunVisible = true;
    },
    editTrendFun(row) {
      this.editTrendFunVisible = true;
      this.editTrendFunFrom.name = row.name;
      this.editTrendFunFrom.code = row.code;
      this.editTrendFunFrom.note = row.note;
    },
  },
};
</script>
<style scoped>
</style>