研发图纸文件管理系统-前端项目
longyvfengyun
2022-07-19 ad939fb61aa431c95b7e27429d7dee1e97f7323c
头部修改
4个文件已添加
4个文件已修改
253 ■■■■ 已修改文件
src/layouts/header/HeaderAvatar.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/components/drawUpload/DrawUpload.vue 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/components/drawUpload/apis.js 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/components/drawUpload/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/WorkPlace.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/myDraw/MyDraw.vue 99 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/myDraw/apis.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yarn.lock 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layouts/header/HeaderAvatar.vue
@@ -1,7 +1,7 @@
<template>
  <a-dropdown>
    <div class="header-avatar" style="cursor: pointer">
      <a-avatar class="avatar" size="small" shape="circle" :src="user.avatar" />
      <a-avatar class="avatar" size="small" shape="circle" icon="user" />
      <span class="name">{{ user.name }}</span>
    </div>
    <a-menu :class="['avatar-menu']" slot="overlay">
src/pages/components/drawUpload/DrawUpload.vue
New file
@@ -0,0 +1,129 @@
<template>
  <div class="draw-upload">
    <a-card>
      <a-row>
        <a-col :span="8">
          <span class="content-label">母物料编号:</span>
          <span class="content-value">0940000072</span>
        </a-col>
        <a-col :span="8">
          <span class="content-label">母物料名称:</span>
          <span class="content-value">离线式放电负载</span>
        </a-col>
        <a-col :span="8">
          <span class="content-label">母物料型号:</span>
          <span class="content-value">IDCE-6006NTpro</span>
        </a-col>
      </a-row>
    </a-card>
    <a-table size="small" :scroll="{ x: 1800}" bordered :columns="columns" :data-source="dataSource" :pagination="false"></a-table>
  </div>
</template>
<script>
export default {
  name: "DrawUpload",
  props: {
    list: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    const columns = [
      {
        title: '子件编码',
        dataIndex: 'subCode',
        width: 80,
        align: 'center'
      },
      {
        title: '子件名称',
        dataIndex: 'subName',
        width: 80,
        align: 'center',
        ellipsis: true,
      },
      {
        title: '子件型号',
        dataIndex: 'subModel',
        width: 100,
        align: 'center',
        ellipsis: true,
      },
      {
        title: '类别',
        dataIndex: 'category',
        width: 60,
        align: 'center',
        ellipsis: true,
      },
      {
        title: '基本单位',
        dataIndex: 'unit',
        width: 70,
        align: 'center',
        ellipsis: true,
      },
      {
        title: '子件数量',
        dataIndex: 'quantity',
        width: 70,
        align: 'center'
      },
      {
        title: '生产商',
        dataIndex: 'producer',
        width: 60,
        align: 'center',
        ellipsis: true,
      },
      {
        title: '封装类型/材质',
        dataIndex: 'material',
        width: 80,
        align: 'center'
      },
      {
        title: '元件编号/料厚',
        dataIndex: 'thickness',
        width: 80,
        align: 'center'
      },
      {
        title: '表面处理/物料详情',
        dataIndex: 'surfaceDetail',
        width: 90,
        align: 'center',
        ellipsis: true,
      },
      {
        title: '备注',
        dataIndex: 'notes',
        width: 100,
        align: 'center',
        ellipsis: true,
      },
      {
        title: '图片',
        dataIndex: 'pictureUrl',
        width: 100,
        align: 'center'
      },
    ];
    return {
      columns: columns,
      dataSource: []
    }
  }
}
</script>
<style scoped>
.content-label,
.content-value {
  font-weight: bold;
}
</style>
src/pages/components/drawUpload/apis.js
src/pages/components/drawUpload/index.js
New file
@@ -0,0 +1 @@
import DrawUpload from "./DrawUpload";
src/pages/workplace/WorkPlace.vue
@@ -47,6 +47,7 @@
  data() {
    return {
      loading: false,
      drawUploadVisible: false,
      cardName: "myDraw",
      totals: const_total.normal,
      radio: 0,
src/pages/workplace/myDraw/MyDraw.vue
@@ -1,5 +1,6 @@
<template>
  <page-toggle-transition v-if="isShow" :disabled="animate.disabled" :animate="animate.name" :direction="animate.direction">
    <div class="page-content">
    <advance-table
        :data-source="dataSource"
        :columns="columns"
@@ -22,7 +23,14 @@
        onShowSizeChange: onSizeChange,
      }">
      <template slot="title">
          <a-upload
              :file-list="fileList"
              :remove="handleRemove"
              :before-upload="beforeUpload"
              :showUploadList="false"
              @change="uploadChange">
        <a-button type="primary" size="small">新建图纸</a-button>
          </a-upload>
      </template>
      <template slot="approvalState" slot-scope="{text}">
        <a-tag v-if="text==1" color="blue">
@@ -59,6 +67,14 @@
        <a @click="scope.record">详情</a>
      </template>
    </advance-table>
      <a-modal
        v-model="drawUploadVisible"
        title="图纸上传"
        centered
        :width="1300">
        <draw-upload :list="subList"></draw-upload>
      </a-modal>
    </div>
  </page-toggle-transition>
</template>
@@ -66,6 +82,10 @@
import PageToggleTransition from "@/components/transition/PageToggleTransition";
import AdvanceTable from "@/components/table/advance/AdvanceTable";
import {mapState} from "vuex";
import AStepItem from "@/components/tool/AStepItem";
import DrawUpload from "@/pages/components/drawUpload/DrawUpload";
import {excelParse } from "./apis";
export default {
  name: "MyDraw",
  props: {
@@ -75,12 +95,15 @@
    },
  },
  components: {
    DrawUpload,
    AStepItem,
    PageToggleTransition,
    AdvanceTable,
  },
  data() {
    return {
      loading: false,
      drawUploadVisible: false,
      page: 1,
      pageSize: 10,
      total: 5,
@@ -159,58 +182,9 @@
          scopedSlots: { customRender: 'action' }
        },
      ],
      dataSource: [
        {
          name: "BJ2312",
          type: "钣金",
          uploadPeople: "霍东伟",
          uploadDate: "2022-07-14 00:00:00",
          auditPeople: "霍东伟",
          auditDate: "2022-07-14 00:00:00",
          approvalState: 1,
          approvalSuggestion: '可以使用'
        },
        {
          name: "TP9528",
          type: "铜牌",
          uploadPeople: "何威",
          uploadDate: "2022-07-14 00:00:00",
          auditPeople: "何威",
          auditDate: "2022-07-14 00:00:00",
          approvalState: 0,
          approvalSuggestion: '可以使用'
        },
        {
          name: "TP9529",
          type: "铜牌",
          uploadPeople: "霍东伟",
          uploadDate: "2022-07-14 00:00:00",
          auditPeople: "霍东伟",
          auditDate: "2022-07-14 00:00:00",
          approvalState: 2,
          approvalSuggestion: '建议修改'
        },
        {
          name: "SRQ9527",
          type: "散热器",
          uploadPeople: "鲁星伟",
          uploadDate: "2022-07-14 00:00:00",
          auditPeople: "鲁星伟",
          auditDate: "2022-07-14 00:00:00",
          approvalState: 1,
          approvalSuggestion: '可以使用'
        },
        {
          name: "SRQ9528",
          type: "散热器",
          uploadPeople: "霍东伟",
          uploadDate: "2022-07-14 00:00:00",
          auditPeople: "徐仲陪",
          auditDate: "2022-07-14 00:00:00",
          approvalState: 0,
          approvalSuggestion: '可以使用'
        },
      ],
      dataSource: [],
      fileList: [],
      subList: [],
    }
  },
  methods: {
@@ -245,6 +219,27 @@
    searchData() {
      console.log("查询后台返回参数");
    },
    handleRemove(file) {
      const index = this.fileList.indexOf(file);
      const newFileList = this.fileList.slice();
      newFileList.splice(index, 1);
      this.fileList = newFileList;
    },
    beforeUpload(file) {
      this.fileList = [...this.fileList, file];
      return false;
    },
    uploadChange(data) {
      if(data.fileList.length == 1) {
        const formData = new FormData();
        formData.append('file', data.file);
        excelParse(formData).then(res=>{
          console.log(res);
        }).catch(error=>{
          console.log(error);
        });
      }
    }
  },
  computed: {
    ...mapState('setting', ['animate']),
src/pages/workplace/myDraw/apis.js
New file
@@ -0,0 +1,16 @@
import axios from "@/assets/axios";
/**
 * excel解析
 * @returns
 */
export const excelParse = (data) => {
  return axios({
    method: "POST",
    url: "bomApproving/excelParse",
    headers: {
      "Content-Type": "multipart/form-data"
    },
    data
  })
}
yarn.lock
@@ -6136,6 +6136,11 @@
  resolved "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
  integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
jsencrypt@^3.2.1:
  version "3.2.1"
  resolved "https://registry.yarnpkg.com/jsencrypt/-/jsencrypt-3.2.1.tgz#09766983cc760088ff26b12fe7e574252af97727"
  integrity sha512-k1sD5QV0KPn+D8uG9AdGzTQuamt82QZ3A3l6f7TRwMU6Oi2Vg0BsL+wZIQBONcraO1pc78ExMdvmBBJ8WhNYUA==
jsesc@^2.5.1:
  version "2.5.2"
  resolved "https://registry.npm.taobao.org/jsesc/download/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"