luobisheng
2022-11-17 99f97b11a334ce482db9aa91fca86dadbaffd716
src/views/operate/myWait/index.vue
@@ -6,8 +6,8 @@
        <header>
            <div class="headerContent">
                <div class="search">
                    <span>筛选条件:</span>
                    <el-input placeholder="请输入内容" v-model="context"></el-input>
                    <span>事件编号:</span>
                    <el-input placeholder="请输入事件编号" v-model="context"></el-input>
                    <div class="findBtn">
                        <el-button type="primary" @click="getTableData">查询</el-button>
                    </div>
@@ -26,24 +26,18 @@
                    <el-table-column prop="code" label="事件编号" min-width="10">
                    </el-table-column>
                    <el-table-column prop="eventSource" label="问题来源" min-width="10">
                        <template slot-scope="scope">
                            <span>{{scope.row}}</span>
                        <template slot-scope="scope" v-if="scope.row">
                            <span>{{ getEventSource(scope.row.eventSource)?.label }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="category" label="问题类别" min-width="10">
                        <template slot-scope="scope">
                            <span>{{scope.row}}</span>
                        <template slot-scope="scope" v-if="scope.row">
                            <span>{{ getCategory(scope.row.category)?.label }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="createTime" label="创建时间" min-width="10">
                        <template slot-scope="scope">
                            <span>{{changeTime(scope.row)}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="type" label="剩余时间" min-width="10">
                        <template slot-scope="scope">
                            <span>{{getRestTime(scope.row)}}</span>
                        </template>
                    <el-table-column prop="limitTime" label="剩余时间" min-width="10">
                    </el-table-column>
                    <el-table-column prop="stepName" label="问题状态" min-width="10">
                    </el-table-column>
@@ -52,7 +46,7 @@
                </el-table>
                <!-- 查看修改页面 -->
                <el-dialog :visible.sync="dialogUpdate" width="45%" :title="updateFlag ? '权限设置' :'查看角色信息'"
                    v-if="dialogUpdate" :before-close="handleClose">
                    :destroy-on-close="true" :key="updateFlag" :before-close="handleClose">
                    <updateUser :updateFlag="updateFlag" :userInfo=userInfo
                        :getTableData=" context ? getTableData : getTableData" @changeDialog="changeDialog" />
                </el-dialog>
@@ -75,8 +69,7 @@
                    </div>
                    <div class="pagination">
                        <el-pagination background :current-page="currentPage" layout="prev, pager, next"
                            :total="totalNum" :page-size="pageSize" @current-change="changeCurrentPage"
                            @prev-click="handlePrev" @next-click="handleNext">
                            :total="totalNum" :page-size="pageSize" @current-change="changeCurrentPage">
                        </el-pagination>
                    </div>
                </div>
@@ -90,6 +83,7 @@
import {computeTime} from '@/utils/helper'
import filterTime from '@/utils/mydate'
import myWait from "@/api/operate/myWait";
import { CATEGOTY, RESOURCE_TYPE } from "@/utils/helper";
export default {
    components: {
@@ -98,7 +92,7 @@
    data() {
        return {
            tableData: [],
            context: "",
            context: null,
            dialogCreate: false,
            dialogUpdate: false,
            updateFlag: false,
@@ -139,6 +133,7 @@
        myWait.getMybackLog({ num: this.context })
            .then(res => {
              this.tableData = res;
              this.tableData = this.tableData.filter(item => !!item);
            })
            .catch(err => this.$message({ type: 'error', message: err }))
      },
@@ -183,7 +178,7 @@
        },
        // 设置表格斑马纹
        tableRowClassName({ row, rowIndex }) {
            if ((rowIndex + 1) % 2 == 0) {
            if ((rowIndex + 1) % 2 === 0) {
                return 'warning-row';
            } else {
                return 'success-row';
@@ -200,28 +195,17 @@
            this.currentPage = page;
            this.getTableData();
        },
        // 上一页点击事件
        handlePrev(page) {
            this.currentPage = page;
            this.getTableData();
        },
        // 下一页点击事件
        handleNext(page) {
            this.currentPage = page;
            this.getTableData();
        },
        changeDialog(val) {
            this.dialogUpdate = val.dialogUpdate;
            console.log(val);
        },
        handleClose(done) {
            this.$confirm('确认关闭?')
                .then(_ => {
                .then(() => {
                    this.dialogCreate = false;
                    this.dialogUpdate = false;
                    done();
                })
                .catch(_ => { });
                .catch(() => { });
        },
        // 计算时间
        getRestTime(time2){
@@ -232,7 +216,14 @@
            if(time){
                return filterTime(time);
            }
        }
        },
      getCategory(code) {
        return CATEGOTY.find(item => item.value === code);
      },
      getEventSource(code) {
        return RESOURCE_TYPE.find(item => item.value === code);
      }
    }
}
</script>
@@ -248,7 +239,6 @@
    header {
        background-color: #09152f;
        border: 1pox solid #fff;
        .headerContent {
            padding: 0 40px;
@@ -303,7 +293,6 @@
        background-color: #09152f;
        margin-top: 20px;
        padding-bottom: 50px;
        border: 1pox solid #fff;
        .mainTitle {
            line-height: 60px;