<!-- 交互日志管理页面 -->
<template>
  <div>
    <CurdPanel ref="curdPanelRef"
               title-data-table="数据列表"
               :doQuery="LogsOperDataApi.doQuery"
               :searchParam="{opid: flag === 1? uuid:null, seid:flag === 2? uuid:null}"
               :queryFormLabelPosition="'top'"
               :allowAdd="false"
               :allowEdit="false"
               :allowDelete="false"
               :allowRefresh="false"
               :titleSearchForm="false"
               fullHeight
               autoLoad>

      <!-- 表格列区域 -->
      <template slot="table-columns">
        <el-table-column type="expand">
          <template slot-scope="scope">
            <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: pre-wrap;white-space: -o-pre-wrap; word-wrap: break-word;">{{scope.row.opdata}}</pre>
          </template>
        </el-table-column>
        <el-table-column prop="opname" label="操作表名" show-overflow-tooltip></el-table-column>
        <el-table-column prop="optype" label="操作类型" :formatter="optypeFormat" sysCode="operDataOpType"
                         show-overflow-tooltip></el-table-column>
      </template>


    </CurdPanel>

  </div>
</template>
<script>

  import BaseApi from '@/api/base/BaseApi';

  export default {
    props: {
      uuid: null,
      flag: null
    },
    data() {
      return {
        LogsOperDataApi: BaseApi('/logs/LogsOperData'),
      };
    },
    methods: {
      optypeFormat(row, column, par) {
        let stat = "";
        //没有字典缓存 则刷新
        if (this.sysCode['operDataOpType'] === undefined) {
          this.refresh();
        }
        this.sysCode['operDataOpType'].forEach(val => {
          if (par === val.value) {
            stat = val.label;
            return;
          }
        });
        return stat;
      },
      refresh() {
        this.$store.dispatch("base/refreshSysCode", "operDataOpType");
      }
    }
  };
</script>

