|
@@ -0,0 +1,139 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="ocr-manage">
|
|
|
|
+ <div
|
|
|
|
+ class="part-box part-box-filter part-box-flex"
|
|
|
|
+ style="padding-bottom: 20px"
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('OCR_SUPPLIER_INSERT')"
|
|
|
|
+ type="success"
|
|
|
|
+ @click="toAdd"
|
|
|
|
+ >新增</el-button
|
|
|
|
+ >
|
|
|
|
+ <span v-else></span>
|
|
|
|
+ <el-tooltip effect="dark" content="刷新" placement="bottom">
|
|
|
|
+ <el-button icon="el-icon-refresh-right" @click="toPage"></el-button>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="part-box part-box-pad">
|
|
|
|
+ <el-table ref="TableList" :data="dataList" v-loading="loading">
|
|
|
|
+ <el-table-column prop="id" label="ID"></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="enable" label="状态">
|
|
|
|
+ <span
|
|
|
|
+ slot-scope="scope"
|
|
|
|
+ :class="scope.row.enable ? 'color-success' : 'color-danger'"
|
|
|
|
+ >{{ scope.row.enable | ableTypeFilter }}</span
|
|
|
|
+ >
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="createTime" label="创建时间" :width="160">
|
|
|
|
+ <span slot-scope="scope">{{
|
|
|
|
+ scope.row.createTime | timestampFilter
|
|
|
|
+ }}</span>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="updateTime" label="修改时间" :width="160">
|
|
|
|
+ <span slot-scope="scope">{{
|
|
|
|
+ scope.row.updateTime | timestampFilter
|
|
|
|
+ }}</span>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkPrivilege('OCR_SUPPLIER_EDIT')"
|
|
|
|
+ class-name="action-column"
|
|
|
|
+ label="操作"
|
|
|
|
+ :width="150"
|
|
|
|
+ fixed="right"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('OCR_SUPPLIER_EDIT')"
|
|
|
|
+ class="btn-primary"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="toEdit(scope.row)"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ :class="scope.row.enable ? 'btn-danger' : 'btn-primary'"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="toEnable(scope.row)"
|
|
|
|
+ >{{ scope.row.enable ? "禁用" : "启用" }}</el-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ <modify-doc
|
|
|
|
+ ref="ModifyDoc"
|
|
|
|
+ :instance="curRow"
|
|
|
|
+ @modified="getList"
|
|
|
|
+ :readonly="dialogReadonly"
|
|
|
|
+ ></modify-doc>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { docListQuery, docInsertOrUpdate } from "../api";
|
|
|
|
+import ModifyDoc from "./ModifyDoc.vue";
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: "org-manage",
|
|
|
|
+ components: { ModifyDoc },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ dataList: [],
|
|
|
|
+ curRow: {},
|
|
|
|
+ loading: false,
|
|
|
|
+ dialogReadonly: false,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.initData();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ initData() {
|
|
|
|
+ this.toPage();
|
|
|
|
+ },
|
|
|
|
+ async getList() {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ const data = await docListQuery();
|
|
|
|
+ this.dataList = data;
|
|
|
|
+ this.loading = false;
|
|
|
|
+ },
|
|
|
|
+ toPage() {
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ toAdd() {
|
|
|
|
+ this.dialogReadonly = false;
|
|
|
|
+ this.curRow = {};
|
|
|
|
+ this.$refs.ModifyDoc.open();
|
|
|
|
+ },
|
|
|
|
+ toEdit(row) {
|
|
|
|
+ this.dialogReadonly = false;
|
|
|
|
+ this.curRow = row;
|
|
|
|
+ this.$refs.ModifyDoc.open();
|
|
|
|
+ },
|
|
|
|
+ async toEnable(row) {
|
|
|
|
+ const action = row.enable ? "禁用" : "启用";
|
|
|
|
+ const confirm = await this.$confirm(
|
|
|
|
+ `确定要${action}DOC【${row.name}】吗?`,
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }
|
|
|
|
+ ).catch(() => {});
|
|
|
|
+
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
|
|
+ const enable = !row.enable;
|
|
|
|
+ await docInsertOrUpdate({
|
|
|
|
+ id: row.id,
|
|
|
|
+ enable,
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ });
|
|
|
|
+ row.enable = enable;
|
|
|
|
+ this.$message.success("操作成功!");
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|