|
@@ -21,17 +21,21 @@
|
|
<el-table-column prop="name" label="名称"> </el-table-column>
|
|
<el-table-column prop="name" label="名称"> </el-table-column>
|
|
<el-table-column prop="qps" label="QPS限流"> </el-table-column>
|
|
<el-table-column prop="qps" label="QPS限流"> </el-table-column>
|
|
<el-table-column prop="enable" label="状态">
|
|
<el-table-column prop="enable" label="状态">
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-tag v-if="scope.row.enable" type="success">启用</el-tag>
|
|
|
|
- <el-tag v-else type="danger">禁用</el-tag>
|
|
|
|
- </template>
|
|
|
|
|
|
+ <!-- <el-tag v-if="scope.row.enable" type="success">启用</el-tag>
|
|
|
|
+ <el-tag v-else type="danger">禁用</el-tag> -->
|
|
|
|
+
|
|
|
|
+ <span
|
|
|
|
+ slot-scope="scope"
|
|
|
|
+ :class="scope.row.enable ? 'color-success' : 'color-danger'"
|
|
|
|
+ >{{ scope.row.enable | ableTypeFilter }}</span
|
|
|
|
+ >
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="createTime" label="创建时间">
|
|
|
|
|
|
+ <el-table-column prop="createTime" label="创建时间" :width="160">
|
|
<span slot-scope="scope">{{
|
|
<span slot-scope="scope">{{
|
|
scope.row.createTime | timestampFilter
|
|
scope.row.createTime | timestampFilter
|
|
}}</span>
|
|
}}</span>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="updateTime" label="修改时间">
|
|
|
|
|
|
+ <el-table-column prop="updateTime" label="修改时间" :width="160">
|
|
<span slot-scope="scope">{{
|
|
<span slot-scope="scope">{{
|
|
scope.row.updateTime | timestampFilter
|
|
scope.row.updateTime | timestampFilter
|
|
}}</span>
|
|
}}</span>
|
|
@@ -40,7 +44,7 @@
|
|
v-if="checkPrivilege('OCR_SUPPLIER_EDIT')"
|
|
v-if="checkPrivilege('OCR_SUPPLIER_EDIT')"
|
|
class-name="action-column"
|
|
class-name="action-column"
|
|
label="操作"
|
|
label="操作"
|
|
- width="120"
|
|
|
|
|
|
+ :width="150"
|
|
fixed="right"
|
|
fixed="right"
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -51,6 +55,12 @@
|
|
@click="toEdit(scope.row)"
|
|
@click="toEdit(scope.row)"
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
>
|
|
>
|
|
|
|
+ <el-button
|
|
|
|
+ :class="scope.row.enable ? 'btn-danger' : 'btn-primary'"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="toEnable(scope.row)"
|
|
|
|
+ >{{ scope.row.enable ? "禁用" : "启用" }}</el-button
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
@@ -72,7 +82,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { ocrListQuery } from "../api";
|
|
|
|
|
|
+import { ocrListQuery, ocrInsertOrUpdate } from "../api";
|
|
import ModifyOcr from "./ModifyOcr.vue";
|
|
import ModifyOcr from "./ModifyOcr.vue";
|
|
import OcrTest from "./OcrTest.vue";
|
|
import OcrTest from "./OcrTest.vue";
|
|
export default {
|
|
export default {
|
|
@@ -116,6 +126,28 @@ export default {
|
|
this.curRow = row;
|
|
this.curRow = row;
|
|
this.$refs.OcrTest.open();
|
|
this.$refs.OcrTest.open();
|
|
},
|
|
},
|
|
|
|
+ async toEnable(row) {
|
|
|
|
+ const action = row.enable ? "禁用" : "启用";
|
|
|
|
+ const confirm = await this.$confirm(
|
|
|
|
+ `确定要${action}OCR【${row.name}】吗?`,
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }
|
|
|
|
+ ).catch(() => {});
|
|
|
|
+
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
|
|
+ const enable = !row.enable;
|
|
|
|
+ await ocrInsertOrUpdate({
|
|
|
|
+ id: row.id,
|
|
|
|
+ enable,
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ });
|
|
|
|
+ row.enable = enable;
|
|
|
|
+ this.$message.success("操作成功!");
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|