2 次代碼提交 f81b0be573 ... 438e37f117

作者 SHA1 備註 提交日期
  dongfeng 438e37f117 Merge remote-tracking branch 'origin/qirui-v2' into qirui-v2 10 月之前
  dongfeng 2d4eaa501a 项目DVP编制-计划页面 前端代码 10 月之前

+ 1 - 1
src/App.vue

@@ -73,7 +73,7 @@ export default {
         },
         {
           // 02 DVP计划
-          path: "/",
+          path: "/dvpPlan",
           name: "header.dvp-plan",
           status: "wait",
           background: "transparent"

+ 3 - 1
src/locales/lang/en-US.js

@@ -8,6 +8,7 @@ import header from './en-US/header';
 import baseInfo from './en-US/baseInfo';
 /** DVP计划 */
 import fullVehicle from './en-US/fullVehicle'
+import dvpPlan from "./en-US/dvpPlan";
 const components = {
 	antLocale: antdEnUS,
 	momentName: 'eu',
@@ -19,5 +20,6 @@ export default {
 	...globalBtn,
 	...header,
 	...baseInfo,
-    ...fullVehicle
+    ...fullVehicle,
+	...dvpPlan
 };

+ 17 - 0
src/locales/lang/en-US/dvpPlan.js

@@ -0,0 +1,17 @@
+export default {
+    /** DVP计划 */
+    'plan.dvp.description-of-the-purpose-of-the-test-vehicle': 'Description of the purpose of test vehicle',
+    'plan.dvp.description-of-the-vehicle-status': 'Description of the vehicle status',
+    'plan.dvp.test-location': 'Test location',
+    'plan.dvp.study-director': 'Study director',
+    'plan.dvp.panel-point': 'Panel point',
+    'plan.dvp.sample-vehicle-plan-delivery-time': 'Sample vehicle plan delivery time',
+    'plan.dvp.scheduled-start-time': 'Scheduled start time',
+    'plan.dvp.scheduled-end-time': 'Scheduled end time',
+    'plan.dvp.vehicle-performance-module': 'Vehicle performance module',
+    'plan.dvp.serial-number': 'Serial number',
+    'plan.dvp.expand':'Expand',
+    'plan.dvp.collapse':'Collapse',
+    'plan.dvp.test-type': 'Test type',
+    'plan.dvp.quantity': 'Quantity',
+}

+ 3 - 1
src/locales/lang/zh-CN.js

@@ -8,6 +8,7 @@ import header from './zh-CN/header';
 import baseInfo from './zh-CN/baseInfo';
 /** DVP计划 */
 import fullVehicle from './zh-CN/fullVehicle'
+import dvpPlan from "./zh-CN/dvpPlan";
 
 const components = {
 	antLocale: antd,
@@ -20,5 +21,6 @@ export default {
 	...globalBtn,
 	...header,
 	...baseInfo,
-    ...fullVehicle
+    ...fullVehicle,
+	...dvpPlan
 };

+ 18 - 0
src/locales/lang/zh-CN/dvpPlan.js

@@ -0,0 +1,18 @@
+export default {
+    /** DVP计划 */
+    'plan.dvp.description-of-the-purpose-of-the-test-vehicle': '试验车用途描述',
+    'plan.dvp.description-of-the-vehicle-status': '车辆状态描述',
+    'plan.dvp.test-location': '试验地点',
+    'plan.dvp.study-director': '试验负责人',
+    'plan.dvp.panel-point': '节点',
+    'plan.dvp.sample-vehicle-plan-delivery-time': '样车计划提供时间',
+    'plan.dvp.scheduled-start-time': '计划开始时间',
+    'plan.dvp.scheduled-end-time': '计划结束时间',
+    'plan.dvp.vehicle-performance-module': '整车性能模块',
+    'plan.dvp.serial-number': '序号',
+    'plan.dvp.expand':'展开',
+    'plan.dvp.collapse':'收起',
+    'plan.dvp.test-type': '试验类型',
+    'plan.dvp.quantity': '数量',
+
+}

+ 63 - 0
src/main.js

@@ -15,6 +15,7 @@ import "@/icons/ali-icons/iconfont.css";
 import "@/icons/3rd-icons/style.css";
 
 
+
 // 引入api
 import { api } from './providers/http';
 Vue.prototype.$api = api;
@@ -22,6 +23,68 @@ Vue.prototype.$api = api;
 Vue.use(Antd)
 Vue.config.productionTip = false
 
+// 树结构
+import {
+  Cascader,
+  Layout,
+  Upload,
+  Tabs,
+  Button,
+  Row,
+  Col,
+  DatePicker,
+  Table,
+  Form,
+  Input,
+  Icon,
+  Menu,
+  Dropdown,
+  Card,
+  Tree,
+  Drawer,
+  Select,
+  Modal,
+  Collapse,
+  Affix,
+  TreeSelect,
+  Comment,
+  List,
+  Pagination,
+  Result,
+  Transfer,
+  Space,
+  Timeline
+} from 'ant-design-vue';
+Vue.use(Cascader)
+    .use(Layout)
+    .use(Upload)
+    .use(Tabs)
+    .use(Button)
+    .use(Row)
+    .use(Col)
+    .use(DatePicker)
+    .use(Table)
+    .use(Form)
+    .use(Input)
+    .use(Icon)
+    .use(Menu)
+    .use(Dropdown)
+    .use(Tree)
+    .use(Card)
+    .use(Drawer)
+    .use(Tabs)
+    .use(Select)
+    .use(Collapse)
+    .use(Modal)
+    .use(TreeSelect)
+    .use(Comment)
+    .use(List)
+    .use(Pagination)
+    .use(Result)
+    .use(Transfer)
+    .use(Space)
+    .use(Timeline);
+
 new Vue({
   router,
   store,

+ 4 - 0
src/providers/http.js

@@ -489,4 +489,8 @@ export const api = {
     changeLocale: function (paramObj) {
         return fetch('/DFMEA/locale/changeLocale', paramObj);
     },
+    // dvp编制-dvp计划列表初始化
+    initDvpList: function (paramObj) {
+        return fetch('/DFMEA/dvp/fullVehicle/initDvpPlanList', paramObj);
+    }
 };

+ 6 - 0
src/router/index.js

@@ -15,6 +15,12 @@ const routes = [
     name: "fullVehicle",
     component: () => import("@/views/fullVehicle/baseInfo/index")
   },
+    // 整车性能DVP-计划
+  {
+    path: "/dvpPlan",
+    name: "dvpPlan",
+    component: () => import("@/views/fullVehicle/dvpPlan/index")
+  } ,
   // 整车性能DVP-DVP验证
   {
     path: "/dvpVerify",

+ 407 - 0
src/views/fullVehicle/dvpPlan/index.vue

@@ -0,0 +1,407 @@
+<template>
+  <a-row class="content-box">
+    <a-card class="layoutCard">
+      <a-form layout='vertical'>
+        <a-row :gutter="24">
+          <a-col :xl='6' :lg='6' :md='12' :sm='24' :xs='24'>
+            <a-form-item :label="$t('plan.dvp.description-of-the-purpose-of-the-test-vehicle')">
+              <a-input>
+
+              </a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl='6' :lg='6' :md='12' :sm='24' :xs='24'>
+            <a-form-item :label="$t('plan.dvp.description-of-the-vehicle-status')">
+              <a-input>
+
+              </a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl='6' :lg='6' :md='12' :sm='24' :xs='24' v-for="(item,index) in selectDataList">
+            <a-form-item :label="item.title">
+              <a-select allowClear v-model="item.value" :options="item.dataList" :key="item.id">
+
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <span v-show="advanceExpand">
+            <a-col :xl='6' :lg='6' :md='12' :sm='24' :xs='24'>
+            <a-form-item :label="$t('plan.dvp.test-location')">
+              <a-input>
+
+              </a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl='6' :lg='6' :md='24' :sm='24' :xs='24'>
+            <a-form-item :label="$t('plan.dvp.study-director')">
+              <a-input>
+
+              </a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl='6' :lg='6' :md='24' :sm='24' :xs='24'>
+            <a-form-item :label="$t('plan.dvp.panel-point')">
+              <a-input>
+
+              </a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl='6' :lg='6' :md='24' :sm='24' :xs='24'>
+            <a-form-item :label="$t('plan.dvp.sample-vehicle-plan-delivery-time')">
+              <a-input>
+
+              </a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl='6' :lg='6' :md='24' :sm='24' :xs='24'>
+            <a-form-item :label="$t('plan.dvp.scheduled-start-time')">
+              <a-input>
+
+              </a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl='6' :lg='6' :md='24' :sm='24' :xs='24'>
+            <a-form-item :label="$t('plan.dvp.scheduled-end-time')">
+              <a-input>
+
+              </a-input>
+            </a-form-item>
+          </a-col>
+          </span>
+        </a-row>
+        <a-row :gutter="24">
+          <a-form-item class='tr' :label="'\xa0'">
+            <a-col :xl='24' :lg='24' :md='24' :sm='24' :xs='24'>
+              <!-- 展开/收起 -->
+              <a @click="toggleAdvance">
+                {{ advanceExpand ? $t('plan.dvp.collapse') : $t('plan.dvp.expand') }}
+                <a-icon :type="advanceExpand ? 'up' : 'down'"/>
+              </a>
+              <!-- 重置 -->
+              <a-button @click='reset' type="primary" class="mr10">
+                {{ $t('global-btn.reset') }}
+              </a-button>
+              <!-- 查询 -->
+              <a-button @click='search' type="primary" class="mr10">
+                {{ $t('global-btn.search') }}
+              </a-button>
+            </a-col>
+          </a-form-item>
+        </a-row>
+      </a-form>
+    </a-card>
+    <a-card class="layoutCard" :style="{ height: tableHeight }">
+      <a-form-item class='tr' >
+        <!-- 新建 -->
+        <a-button @click='saveDvpPlan' type="primary" class="mr10">
+          {{ $t('global-btn.reset') }}
+        </a-button>
+        <!-- 导入 -->
+        <a-button @click='importFile' type="primary" class="mr10">
+          {{ $t('global-btn.import') }}
+        </a-button>
+        <!-- 导出 -->
+        <a-button @click='exportFile'>
+          {{ $t('global-btn.export') }}
+        </a-button>
+      </a-form-item>
+      <a-table
+          size="small"
+          :columns='tableColumns'
+          :dataSource='tableData'
+          :rowKey='(record, index) => { return index; }'
+          :scroll='{ x: 1850, y: tableHeightValue }'
+          :pagination='pagination'
+          :loading='tableLoading'
+          @change='handlePageChange'
+      >
+        <!-- 序号列 -->
+        <template slot='index' slot-scope='text, record, index'>
+          <span>{{ (pagination.current - 1) * pagination.pageSize + index + 1 }}</span>
+        </template>
+        <template slot="action" slot-scope="text, record">
+          <span>
+            <!-- 编辑 -->
+            <a
+                href='javascript:'
+                @click='update(record)'
+            >
+              <a-tooltip :title="$t('workbench.edit')">
+                <i class="iconfont iconicon-bainji"></i>
+              </a-tooltip>
+            </a>
+            <a class='operation-btn ml16' @click="deleteDvpData(record)">
+              <!-- 删除 -->
+              <a-tooltip :title="$t('workbench.delete')">
+                <i class="iconfont iconshanchu"></i>
+              </a-tooltip>
+            </a>
+          </span>
+        </template>
+      </a-table>
+    </a-card>
+  </a-row>
+
+</template>
+
+<script>
+
+
+export default {
+  data() {
+    return{
+      /** 下拉选数据集合 根据后端返回数据生成对应的下拉选 */
+      selectDataList: [],
+      /** 折叠 展开 */
+      advanceExpand: false,
+      /** 分页 */
+      pagination: {
+        size: 'small',
+        current: 1,
+        pageNo: 1,
+        pageSize: 10, // 默认每页显示数量
+        showTotal: total => this.$t('workbench.a-total-of-data', {total: `${total}`}), // 显示总数
+        showSizeChanger: true, // 显示可改变每页数量
+        pageSizeOptions: ['10', '20', '50', '100', '200'], // 每页数量选项
+        onShowSizeChange: (current, pageSize) => (this.pageSize = pageSize), // 改变每页数量时更新显示
+        total: 0, //总条数
+        showQuickJumper: true,
+        position: 'top'
+      },
+      /** 表格高度 */
+      tableHeight: window.innerHeight - 360 + 'px',
+      tableHeightValue: window.innerHeight - 418,
+      /** 表格加载状态 */
+      tableLoading: false,
+      /** 表格数据 */
+      tableData: [],
+      /** 表格列 */
+      tableColumns: [
+        {
+          title: this.$t('plan.dvp.serial-number'),
+          width: 50,
+          fixed: 'left',
+          align: 'center',
+          scopedSlots: {
+            customRender: 'index'
+          },
+          ellipsis: true
+        },
+        {
+          title: this.$t('plan.dvp.vehicle-performance-module'),
+          dataIndex: 'performanceModule',
+          align: 'center',
+          // width: 100,
+          ellipsis: true
+        },
+        {
+          title: this.$t('plan.dvp.description-of-the-purpose-of-the-test-vehicle'),
+          dataIndex: 'vehicleUse',
+          align: 'center',
+          // width: 100,
+          ellipsis: true
+        },
+        {
+          title: this.$t('plan.dvp.test-type'),
+          dataIndex: 'testType',
+          align: 'center',
+          // width: 100,
+          ellipsis: true
+        },
+        {
+          title: this.$t('plan.dvp.description-of-the-vehicle-status'),
+          dataIndex: 'vehicleState',
+          align: 'center',
+          // width: 100,
+          ellipsis: true
+        },
+        {
+          title: this.$t('plan.dvp.quantity'),
+          dataIndex: 'count',
+          align: 'center',
+          // width: 100,
+          ellipsis: true
+        }
+      ],
+      /** 表格固定部分数据 */
+      tableRightColumns: [
+        {
+          title: this.$t('plan.dvp.sample-vehicle-plan-delivery-time'),
+          dataIndex: 'prototypePlanTime',
+          align: 'center',
+          // width: 150,
+          ellipsis: true
+        },
+        {
+          title: this.$t('plan.dvp.scheduled-start-time'),
+          dataIndex: 'planStartTime',
+          align: 'center',
+          // width: 150,
+          ellipsis: true
+        },
+        {
+          title: this.$t('plan.dvp.scheduled-end-time'),
+          dataIndex: 'planEndTime',
+          align: 'center',
+          // width: 150,
+          ellipsis: true
+        },
+        {
+          title: this.$t('global-constant.operation'),
+          // dataIndex: 'quantity',
+          align: 'center',
+          width: 100,
+          scopedSlots: {customRender: 'action'},
+          ellipsis: true
+        }
+      ]
+    }
+  },
+  mounted() {
+    this.initData();
+    window.onresize = () => {
+      this.tableHeight = window.innerHeight - 360 + 'px';
+      this.tableHeightValue = window.innerHeight - 418;
+    };
+  },
+  created() {
+  },
+  methods: {
+    /**
+     * 查询
+     */
+    search() {
+
+    },
+    /**
+     * 重置
+     */
+    reset() {
+      this.advanceExpand = false;
+    },
+    /**
+     * 收起/展开
+     */
+    toggleAdvance() {
+      this.advanceExpand = !this.advanceExpand;
+    },
+    /**
+     * 新建DVP计划试验数据
+     */
+    saveDvpPlan() {
+
+    },
+    /**
+     * 导入
+     */
+    importFile() {
+
+    },
+    /**
+     * 导出
+     */
+    exportFile() {
+
+    },
+    /**
+     * 表格 - 点击分页中数字触发的方法
+     * @param pagination
+     */
+    handlePageChange(pagination) {
+      this.pagination.current = pagination.current;
+      this.pagination.pageSize = pagination.pageSize;
+      this.pagination.pageNo = pagination.current;
+      // this.initData();
+    },
+    //    '1': {
+    //        name: '发送机'
+    //        value: '99T星星发动机'
+    //    '2': {
+    //        name: '颜色'
+    //        value: '五彩斑斓的黑'
+    //    }
+    /**
+     * 初始化表格数据
+     */
+    initData() {
+      let _that = this;
+      let data = {
+        dvpId:1
+      }
+      _that.$api.initDvpList(data).then(res => {
+        if (res.flag) {
+          let columnData = res.inputData;
+          if (Object.keys(columnData).length > 0) {
+            for (let key in columnData) {
+              let column = {};
+              column.title = columnData[key].name;
+              column.dataIndex = columnData[key].id;
+              column.align = 'center';
+              column.ellipsis = true;
+              _that.tableColumns.push(column);
+            }
+          }
+          _that.tableRightColumns.forEach(item => {
+            _that.tableColumns.push(item);
+          })
+          let tableDataList = res.data.data;
+          if (tableDataList) {
+            if (tableDataList.length > 0) {
+              tableDataList.forEach(item => {
+                // 表格数据整理
+                let tempData = {};
+                // 表格中动态列数据整理
+                let columnId = item.columnId.split('/');
+                let columnValue = item.columnValue.split('/');
+                console.log(columnId, columnValue);
+                columnId.forEach((id, index) => {
+                  tempData[id] = columnValue[index];
+                });
+                console.log(tempData);
+                tempData.performanceModule = item.performanceModule; // 性能模块
+                tempData.testId = item.testId; // 编号
+                tempData.vehicleUse = item.vehicleUse; // 试验车用途
+                tempData.vehicleState = item.vehicleState; // 车辆状态
+                tempData.testType = item.testType; // 试验类型
+                tempData.count = item.count; // 数量
+                tempData.testSite = item.testSite; // 试验地点
+                tempData.testOwner = item.testOwner; // 试验负责人
+                tempData.node = item.node; // 节点
+                tempData.prototypePlanTime = item.prototypePlanTime; // 样车计划提供时间
+                tempData.planStartTime = item.planStartTime; // 计划开始时间
+                tempData.planEndTime = item.planEndTime; // 计划结束时间
+                _that.tableData.push(tempData);
+              })
+            }
+          }
+        }
+      })
+
+    },
+    /**
+     * 删除dvp计划试验数据
+     * @param data
+     */
+    deleteDvpData(data) {
+
+    },
+    /**
+     * 编辑dvp计划试验数据
+     * @param data
+     */
+    update(data) {
+
+    }
+  }
+}
+
+</script>
+<style>
+.content-box {
+  padding: 0 12px;
+}
+
+.layoutCard {
+ padding: 12px;
+}
+</style>