Kaynağa Gözat

证书审核列表

zweizhao 7 yıl önce
ebeveyn
işleme
22e540916d
4 değiştirilmiş dosya ile 141 ekleme ve 3 silme
  1. 3 0
      components/menu/data.js
  2. 3 3
      package-lock.json
  3. 1 0
      package.json
  4. 134 0
      pages/main/index/cert_check.vue

+ 3 - 0
components/menu/data.js

@@ -41,6 +41,9 @@ export default [{
   subs: [{
     title: '云端开发者认证表',
     path: 'cloud_developer',
+  },{
+    title: '认证开发者',
+    path: 'cert_check',
   }]
 },
 {

+ 3 - 3
package-lock.json

@@ -3021,9 +3021,9 @@
       "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs="
     },
     "dayjs": {
-      "version": "1.8.0",
-      "resolved": "http://registry.npm.taobao.org/dayjs/download/dayjs-1.8.0.tgz",
-      "integrity": "sha1-UHljrDAj9LH585mieDVpRvxMmuk="
+      "version": "1.8.6",
+      "resolved": "http://registry.npm.taobao.org/dayjs/download/dayjs-1.8.6.tgz",
+      "integrity": "sha1-t6jM/vFz2uA+g6BaWHiMnb6UijU="
     },
     "de-indent": {
       "version": "1.0.2",

+ 1 - 0
package.json

@@ -20,6 +20,7 @@
     "@nuxtjs/axios": "^5.0.0",
     "@nuxtjs/proxy": "^1.3.1",
     "cross-env": "^5.2.0",
+    "dayjs": "^1.8.6",
     "element-ui": "^2.4.6",
     "nuxt": "^2.0.0",
     "vue-quill-editor": "^3.0.6"

+ 134 - 0
pages/main/index/cert_check.vue

@@ -0,0 +1,134 @@
+<template>
+  <section id="cert-check">
+    <div class="table">
+      <el-table v-if="tableData.length" height="100%" border style="width: 100%" :data="tableData">
+        <el-table-column v-for="(prop, index) of tableProps" :key="index" :prop="prop" :label="tableHeaders[index]">
+          <template slot-scope="scope">
+            <el-button type="text" v-if="prop === 'ctrl'" @click="clickCheck(scope.row)">{{scope.row[prop]}}</el-button>
+            <el-button type="text" v-else-if="prop === 'nickname'" @click="clickDetail(scope.row['uid'])">{{scope.row[prop]}}</el-button>
+            <span v-else>{{scope.row[prop]}}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <el-pagination @current-change="changePagination" :current-page.sync="currentPage" :page-size="10" layout="total, prev, pager, next"
+      :total="totalCount"></el-pagination>
+  </section>
+</template>
+
+<script>
+import dayjs from 'dayjs'
+const tableHeaders = [
+  "ID",
+  "昵称",
+  "认证类型",
+  "证书状态",
+  "工作",
+  "职业方向",
+  "技能",
+  "城市",
+  "工龄",
+  "接单数量",
+  "自由职业",
+  "开始时间",
+  "过期时间",
+  "操作"
+]
+
+const tableProps = [
+  "uid",
+  "nickname",
+  "name",
+  "cert_status_name",
+  "work_status_name",
+  "direction_name",
+  "skills",
+  "city_name",
+  "work_year_op",
+  "projectCountInfoStr",
+  "freelancer_name",
+  "startDate",
+  "endDate",
+  "ctrl"
+]
+
+const apis = {
+  dataList: `/api/admin/cert/getUserList`,
+}
+
+// 获取当前状态
+const getOnProjectShow = i => {
+  let str = ''
+  if(i.on_project === 0 && i.on_hire === 0 & i.on_job === 0 && i.work_status === 1) str = '空闲'
+  else {
+    if(i.on_project) str = '项目'
+    else if(i.on_hire) str = '雇佣'
+    else if(i.on_job) str = '云端'
+    else if(!i.work_status) str = '不接单'
+  }
+  return str
+}
+
+export default {
+  data() {
+    return {
+      // 数据总条目
+      totalCount: 0,
+      currentPage: 1,
+      // 列表头显示内容
+      tableHeaders,
+      // 列表头字段
+      tableProps,
+      // 列表数据
+      tableData: []
+    }
+  },
+  mounted() {
+    this.getTableData()
+  },
+  methods: {
+    clickCheck(item) {
+      window.open(`https://dev.test.proginn.com/rooter/developerVerifyAuditList?uid=${item.uid}&audit_type=1`)
+    },
+    // 格式化列表数据
+    formatTableData(data, resData) {
+      const userSkills = resData.userSkills
+      return data.map(i => {
+        const projectCountInfo = i.project_count_info
+          , countDevelopProject = projectCountInfo.project
+          , countHire = projectCountInfo.hire
+          , countJob = projectCountInfo.job
+        return {
+          ...i,
+          projectCountInfoStr: `项目:${countDevelopProject},雇佣:${countHire},云端:${countJob}`,
+          startDate: dayjs(i.start_time * 1000).format('YYYY-MM-DD'),
+          endDate: dayjs(i.end_time * 1000).format('YYYY-MM-DD'),
+          ctrl: "审核"
+        }
+      })
+    },
+    // 页码变动
+    changePagination(page) {
+      this.getTableData()
+    },
+    // 获取列表数据
+    async getTableData(status = 0) {
+      this.tableData = []
+      const p = this.currentPage
+        , res = await this.$get(apis.dataList, { p })
+        , data = res.data
+        , list = data.list
+      // console.log(list)
+      this.tableData = this.formatTableData(list, data)
+      this.totalCount = Number(data.total)
+      this.totalPage = data.totalPage
+    }
+  }
+}
+</script>
+
+<style scoped>
+.table {
+  height: calc(100% - 40px);
+}
+</style>