OperateList.vue 2.16 KB
<!--
 * @Author: 'wangzhihui' '1733904062@qq.com'
 * @Date: 2025-02-28 15:16:11
 * @LastEditors: 'wangzhihui' '1733904062@qq.com'
 * @LastEditTime: 2025-02-28 16:04:13
 * @FilePath: \dj-car-life-system\src\views\goods\shelfManage\components\detailCon\OperateList.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->

<template>
  <div class="edit-page">
    <div class="title">
      <span>操作记录</span>
    </div>
    <div style="padding: 20px" v-if="list && list.length > 0">
      <div class="wrap" v-for="(item, index) in list" :key="index">
        <div class="type">
          {{ item.operatorTypeText }}
        </div>
        <div class="operate">
          {{ item.operatorTypeText }}人:{{ item.createdBy }}
        </div>
        <div>操作时间:{{ item.createdDate }}</div>
      </div>
    </div>
    <div v-else class="empty">暂无记录</div>
  </div>
</template>
<script>
import { deepClone ,Util} from "@/common/util"
export default {
  name: "OperateList",
  props: {
    logList: {
      type: Array,
      default: () => []
    }
  },
  watch: {
    logList(val) {

      this.list = val
      for (var item in this.types) {
        this.list.forEach((ele) => {
          if (ele.operatorType == item) {
            ele.operatorTypeText = this.types[item]
          }
        })
      }
    //   console.log(this.list, "✈")
      this.list = deepClone(this.list)
    }
  },
  data() {
    //这里存放数据
    return {
      list: [],
      types: { 1: "创建", 2: "驳回", 3: "确认", 4: "完成" }
    }
  },
  methods: {}
}
</script>
<style lang="scss" scoped>
@import "../../style/editdetailCon.scss";
.wrap {
  display: flex;
  align-items: center;
  color: #333333;
  font-size: 14px;
  margin-bottom: 20px;
  .type {
    font-weight: bold;
    margin-right: 60px;
  }
  .operate {
    min-width: 160px;
    margin-right: 86px;
    white-space: nowrap;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
</style>