Blame view

src/views/basic/device/error.vue 5.77 KB
8ef22809   梁保满   软件下载页面添加.net环境下载
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  <template>
    <div>
      <back-box>
        <template slot="title">
          <span>异常设备信息</span>
        </template>
      </back-box>
      <div class="page-content">
        <el-table :data="tableData" border style="width: 100%">
          <el-table-column
            prop="sn"
            label="设备编码"
            align="center"
            width="160"
          ></el-table-column>
66f2f9c2   梁保满   异常设备信息显示问题
16
17
18
19
20
21
22
23
24
25
26
          <el-table-column prop="deviceType" label="设备类型" align="center">
            <template slot-scope="scoped">
              {{
                scoped.row.deviceType == 1
                  ? "基站"
                  : scoped.row.deviceType == 2
                  ? "键盘"
                  : "PC"
              }}
            </template>
          </el-table-column>
d4b9eb45   梁保满   设备异常信息
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
          <el-table-column label="异常类型" align="center">
            <template slot-scope="scoped">
              {{
                scoped.row.status == 0
                  ? "正常"
                  : scoped.row.status == 1
                  ? "低电量异常"
                  : scoped.row.status == 2
                  ? "配对码异常"
                  : "关联班级异常"
              }}
            </template></el-table-column
          >
          <template v-if="type == 1">
            <el-table-column
              prop="pairingCode"
              label="配对码"
              align="center"
            ></el-table-column>
            <el-table-column label="关联班级" align="center">
              <template slot-scope="scoped">
                <p v-for="(item, index) in scoped.row.classList" :key="index">
                  {{ item.className }}
                </p>
              </template>
            </el-table-column>
          </template>
8ef22809   梁保满   软件下载页面添加.net环境下载
54
          <el-table-column
d4b9eb45   梁保满   设备异常信息
55
            prop="modifiedTime"
8ef22809   梁保满   软件下载页面添加.net环境下载
56
57
58
59
60
            label="最早发现时间"
            align="center"
            width="200"
          ></el-table-column>
          <el-table-column
b8827a72   梁保满   测试bug
61
            v-if="type == 2"
d4b9eb45   梁保满   设备异常信息
62
63
            prop="answerTimes"
            label="答题次数"
8ef22809   梁保满   软件下载页面添加.net环境下载
64
65
66
            align="center"
          ></el-table-column>
          <el-table-column
d4b9eb45   梁保满   设备异常信息
67
            prop="abnormalRemark"
8ef22809   梁保满   软件下载页面添加.net环境下载
68
69
70
            label="状态"
            align="center"
          ></el-table-column>
391f66b9   梁保满   异常设备信息显示问题,单题型总分错误
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
          <el-table-column prop="abnormalSource" label="信息来源" align="center">
            <template slot-scope="scoped">
              {{
                scoped.row.abnormalSource == 0
                  ? "无"
                  : scoped.row.abnormalSource == 1
                  ? "云平台"
                  : scoped.row.abnormalSource == 2
                  ? "授课端"
                  : scoped.row.abnormalSource == 3
                  ? "出厂工具"
                  : "发卡工具"
              }}
            </template>
          </el-table-column>
d4b9eb45   梁保满   设备异常信息
86
          <el-table-column label="操作" align="center" width="100"
8ef22809   梁保满   软件下载页面添加.net环境下载
87
            ><template slot-scope="scoped">
d4b9eb45   梁保满   设备异常信息
88
              <el-link
99713685   梁保满   学生调班,班级数据重新请求,使用过...
89
                :disabled="!!scoped.row.abnormalRemark"
d4b9eb45   梁保满   设备异常信息
90
91
92
                @click="openDia(scoped.row)"
                >处理</el-link
              ></template
8ef22809   梁保满   软件下载页面添加.net环境下载
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
            ></el-table-column
          >
        </el-table>
        <div class="pagination-box">
          <el-pagination
            small=""
            layout="total,prev, pager, next"
            :hide-on-single-page="true"
            :total="total"
            @current-change="changePage"
            :current-page="page"
            :page-size="size"
          >
          </el-pagination>
        </div>
      </div>
f45b3c05   LH_PC   云平台新UI界面
109
      <el-dialog :append-to-body="true"
66f2f9c2   梁保满   异常设备信息显示问题
110
111
112
113
114
        :close-on-click-modal="false"
        title="备注"
        :visible.sync="diaNotes"
        width="400"
      >
d4b9eb45   梁保满   设备异常信息
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
        <el-form ref="formClass" label-width="100px">
          <el-form-item label="处理备注:" prop="studentName">
            <el-col :span="12">
              <el-input
                type="textarea"
                :rows="3"
                maxlength="200"
                v-model="ntoes"
              />
            </el-col>
          </el-form-item>
        </el-form>
        <div class="dialog-footer" slot="footer">
          <el-button @click="_SaveNotes" type="primary">确 定</el-button>
          <el-button @click="diaNotes = false">取 消</el-button>
        </div>
      </el-dialog>
8ef22809   梁保满   软件下载页面添加.net环境下载
132
133
134
135
136
137
138
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
d4b9eb45   梁保满   设备异常信息
139
140
141
142
143
144
        role: "",
        loading: false,
        diaNotes: false,
        ntoes: "",
        deviceId: "",
        type: 1,
8ef22809   梁保满   软件下载页面添加.net环境下载
145
146
147
148
149
150
151
        tableData: [],
        total: 0,
        page: 1,
        size: 20,
      };
    },
    created() {
d4b9eb45   梁保满   设备异常信息
152
153
154
155
156
      this.type = this.$route.query.type;
      this.role =
        this.$store.getters.info.showRole ||
        this.$store.getters.info.permissions[0].role;
      this._QueryData();
8ef22809   梁保满   软件下载页面添加.net环境下载
157
158
159
160
161
162
    },
    methods: {
      changePage(page) {
        this.page = page;
        this._QueryData();
      },
d4b9eb45   梁保满   设备异常信息
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
      openDia(obj) {
        this.diaNotes = true;
        this.deviceId = obj.id;
        this.ntoes = "";
      },
      async _SaveNotes() {
        if (!this.ntoes.trim()) {
          this.$message.warning("请填写备注内容!");
          return;
        }
        const { status, info } = await this.$request.abnormalRemark({
          deviceId: this.deviceId,
          abnormalRemark: this.ntoes,
        });
        if (status === 0) {
          this.ntoes = "";
          this.diaNotes = false;
          this._QueryData();
        } else {
          this.$message.error(info);
        }
      },
8ef22809   梁保满   软件下载页面添加.net环境下载
185
186
      async _QueryData() {
        this.loading = true;
d4b9eb45   梁保满   设备异常信息
187
188
189
190
191
192
193
194
        const deviceList =
          this.role != "ROLE_JITUAN"
            ? this.$request.deviceList
            : this.$request.tenantDeviceList;
        this.tableData = [];
        const { data, status, info } = await deviceList({
          status: 1,
          deviceType: this.type,
8ef22809   梁保满   软件下载页面添加.net环境下载
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
          page: this.page,
          size: this.size,
        });
        this.loading = false;
        if (status === 0) {
          this.tableData = (data?.list && [...data?.list]) || [];
          this.total = data.count;
        } else {
          this.$message.error(info);
        }
      },
    },
  };
  </script>
  
  <style lang="scss" scoped>
  .page-content {
    padding: 20px;
  }
  </style>