listOfPenaltiesDialog.vue 2.96 KB
<template>
  <d2-dialog :is-visible="show" class="accountDailog" :title="`学习任务情况 | ${detailInfo.staffName}`" :isShowFooter="false"
    :noCancel="true" width="720px" @confirmDialog="handleAddConfirm" @closeDialog="handleClose">
    <!-- <div class="d2-container-content"> -->
    <!--  :before-search-fn="beforeSearchFn" -->
    <d2-table ref="recordTable" :search-form="searchFormSearch" :get-list-api="getListApi" :table-params="tableParams">
      <div slot="other" slot-scope="scope">
        <div class="online-status">
          <span class="dot"
            :style="{ background: LEARN_PROGRESS_OPTIONS.find(item => item.id === scope.scope.status).backgroundColor }"></span>
          {{LEARN_PROGRESS_OPTIONS.find(item => item.id === scope.scope.status).label}}
        </div>
      </div>
    </d2-table>
    <!-- </div> -->
  </d2-dialog>
</template>

<script>
import { deepClone } from "@/common/util"
import { LEARN_PROGRESS_OPTIONS } from "../constant"

import { coursePage, contentManagerTaskPage, contentManagerTaskCourseList } from "@/api/contentManager"
export default {
  name: "listOfPenaltiesDialog",
  props: {
    detailInfo: {
      type: Object,
      require: true
    },
    dialogVisible: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      LEARN_PROGRESS_OPTIONS,
      getListApi: coursePage,
      searchFormSearch: {
        staffStudyId: '',
      },
      tableData: [],
      tableParams: {
        btnId: new Date().getTime() + parseInt(Math.random() * 1000),
        listName: 'list',
        // singleSelectUniqueKey: 'id',
        tableOption: false,
        tableColumns: [
          // {
          //   label: "序号",
          //   addHtml: "num",
          //   width: '100'
          // },
          {
            label: '课程名称',
            prop: 'courseName',
          },
          {
            label: "学习进度",
            prop: "other",
            addHtml: "other",
            width: '150'
          },
        ]
      },
      // getListApi: getAllMerchantList,
    }
  },
  computed: {
    show: {
      get() {
        return this.dialogVisible
      },
      set(val) {
        this.$emit("update:dialogVisible", val)
      }
    }
  },
  mounted() {
    this.searchFormSearch.staffStudyId = this.detailInfo.id
    // this.getList()
  },
  methods: {
    handleAddConfirm() {
      this.show = false
    },
    handleClose() {
      // this.$emit("closeDialogFn")
      this.show = false
    }
  }
}
</script>

<style scoped lang="scss">
.online-status {
  display: flex;
  justify-content: center;
  align-items: center;

  .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
  }

  .gray {
    background-color: #c5c5c5;
  }

  .orange {
    background-color: #fdb757;
  }

  .blue {
    background-color: #2a58ad;
  }
}
</style>