浏览代码

* CAD 功能对接

chen.cheng 4 月之前
父节点
当前提交
55fd6dba7b
共有 3 个文件被更改,包括 90 次插入75 次删除
  1. 1 0
      src/api/cons/consUnitInfo.js
  2. 2 2
      src/api/system/config.js
  3. 87 73
      src/views/cons/consUnit/index.vue

+ 1 - 0
src/api/cons/consUnitInfo.js

@@ -50,6 +50,7 @@ export function delConsUnitInfo(id) {
   })
 }
 
+
 export function importCad(data) {
   return request({
     url: '/cons/consUnitInfo/import/cad',

+ 2 - 2
src/api/system/config.js

@@ -12,7 +12,7 @@ export function listConfig(query) {
 // 查询参数详细
 export function getConfig(configId) {
   return request({
-    url: '/system/config/' + configId,
+    url: '/system/config/cust/' + configId,
     method: 'get'
   })
 }
@@ -37,7 +37,7 @@ export function addConfig(data) {
 // 修改参数配置
 export function updateConfig(data) {
   return request({
-    url: '/system/config',
+    url: '/system/config/cust',
     method: 'put',
     data: data
   })

+ 87 - 73
src/views/cons/consUnit/index.vue

@@ -3,10 +3,10 @@
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
       <el-form-item label="单元名称" prop="deptName">
         <el-input
-            v-model="queryParams.deptName"
-            placeholder="请输入单元名称"
-            clearable
-            @keyup.enter.native="handleQuery"
+          v-model="queryParams.deptName"
+          placeholder="请输入单元名称"
+          clearable
+          @keyup.enter.native="handleQuery"
         />
       </el-form-item>
       <el-form-item>
@@ -18,22 +18,22 @@
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
-            type="primary"
-            plain
-            icon="el-icon-plus"
-            size="mini"
-            @click="handleAdd"
-            v-hasPermi="['system:dept:add']"
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:dept:add']"
         >新增
         </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
-            type="info"
-            plain
-            icon="el-icon-sort"
-            size="mini"
-            @click="toggleExpandAll"
+          type="info"
+          plain
+          icon="el-icon-sort"
+          size="mini"
+          @click="toggleExpandAll"
         >展开/折叠
         </el-button>
       </el-col>
@@ -41,12 +41,12 @@
     </el-row>
 
     <el-table
-        v-if="refreshTable"
-        v-loading="loading"
-        :data="consUnitInfoList"
-        row-key="id"
-        :default-expand-all="isExpandAll"
-        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+      v-if="refreshTable"
+      v-loading="loading"
+      :data="consUnitInfoList"
+      row-key="id"
+      :default-expand-all="isExpandAll"
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
       <el-table-column label="施工单元名称" width="200" prop="name"/>
       <el-table-column label="强夯类型" prop="penningType"/>
@@ -65,50 +65,59 @@
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
-              v-if="scope.row.type==='2'"
-              size="mini"
-              type="text"
-              icon="el-icon-upload"
-              @click="handleImport(scope.row)"
-              v-hasPermi="['system:dept:edit']"
+            v-if="scope.row.type==='2'"
+            size="mini"
+            type="text"
+            icon="el-icon-upload"
+            @click="handleImport(scope.row)"
+            v-hasPermi="['system:dept:edit']"
           >
             上传设计文件
           </el-button>
           <el-button
-              v-if="scope.row.type==='2'"
-              size="mini"
-              type="text"
-              icon="el-icon-set-up"
-              @click="handleAssign(scope.row)"
-              v-hasPermi="['system:dept:edit']"
+            v-if="scope.row.type==='2'"
+            size="mini"
+            type="text"
+            icon="el-icon-set-up"
+            @click="handleAssign(scope.row)"
+            v-hasPermi="['system:dept:edit']"
           >
             分配施工机械
           </el-button>
           <el-button
-              size="mini"
-              type="text"
-              icon="el-icon-edit"
-              @click="handleUpdate(scope.row)"
-              v-hasPermi="['system:dept:edit']"
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:dept:edit']"
           >修改
           </el-button>
           <el-button
-              size="mini"
-              type="text"
-              icon="el-icon-plus"
-              @click="handleAdd(scope.row)"
-              v-hasPermi="['system:dept:add']"
+            size="mini"
+            type="text"
+            icon="el-icon-plus"
+            @click="handleAdd(scope.row)"
+            v-hasPermi="['system:dept:add']"
           >新增
           </el-button>
           <el-button
-              v-if="scope.row.parentId != 0"
-              size="mini"
-              type="text"
-              icon="el-icon-delete"
-              @click="handleDelete(scope.row)"
-              v-hasPermi="['system:dept:remove']"
+            v-if="scope.row.parentId != 0"
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:dept:remove']"
           >删除
           </el-button>
+          <el-button
+            v-if="scope.row.type==='2'"
+            size="mini"
+            type="text"
+            icon="el-icon-download"
+            @click="handleExport(scope.row)"
+          >
+            下载设计文件
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -146,10 +155,10 @@
             <el-form-item label="类型" prop="type">
               <el-select v-model="form.type" placeholder="请选择节点类型">
                 <el-option
-                    v-for="dict in dict.type.cons_unit_type"
-                    :key="dict.value"
-                    :label="dict.label"
-                    :value="dict.value"
+                  v-for="dict in dict.type.cons_unit_type"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -170,10 +179,10 @@
             <el-form-item label="施工桩机" prop="toMachineId">
               <el-select style="width: 100%" v-model="form.machineId" multiple placeholder="请选择桩机">
                 <el-option
-                    v-for="machine in machineList"
-                    :key="machine.id"
-                    :label="`${machine.machineNum}(${machine.equipment})`"
-                    :value="machine.id"
+                  v-for="machine in machineList"
+                  :key="machine.id"
+                  :label="`${machine.machineNum}(${machine.equipment})`"
+                  :value="machine.id"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -187,17 +196,17 @@
     </el-dialog>
     <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
-          ref="upload"
-          :limit="1"
-          name="files"
-          accept=".dwg,.xls,.xlsx"
-          :headers="upload.headers"
-          :action="upload.url + '?updateSupport=' + upload.updateSupport"
-          :disabled="upload.isUploading"
-          :on-progress="handleFileUploadProgress"
-          :on-success="handleFileSuccess"
-          :auto-upload="false"
-          drag
+        ref="upload"
+        :limit="1"
+        name="files"
+        accept=".dwg,.xls,.xlsx"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
       >
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">{{ $t("common.importModeMsg") }}</div>
@@ -228,10 +237,10 @@
             <el-form-item label="施工桩机" prop="toMachineId">
               <el-select style="width: 100%" v-model="form.machineId" multiple placeholder="请选择桩机">
                 <el-option
-                    v-for="machine in machineList"
-                    :key="machine.id"
-                    :label="`${machine.machineNum}(${machine.name})`"
-                    :value="machine.id"
+                  v-for="machine in machineList"
+                  :key="machine.id"
+                  :label="`${machine.machineNum}(${machine.name})`"
+                  :value="machine.id"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -490,7 +499,12 @@ export default {
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {
       });
-    }
+    },
+    handleExport(row) {
+      this.download('cons/consUnitInfo/export/cad', {
+        id: row.id
+      }, `attendGroup_${new Date().getTime()}.dwg`)
+    },
   }
 };
 </script>