liyangzheng 1 an în urmă
părinte
comite
c2ffbf3e1c

+ 27 - 11
src/api/flow/flow.js

@@ -34,11 +34,11 @@ function delModelOn(data) {
     })
 }
 // 获取指定模型和装置类型的端子列表
-function getModelAndIed(data){
+function getModelAndIed(data) {
     return request({//适用于表格数据
-        url:`/admin/model/function/fcda/list`,
-        method:"get",
-        params:data
+        url: `/admin/model/function/fcda/list`,
+        method: "get",
+        params: data
     })
 }
 // 保存模型装置功能及端子信息
@@ -49,21 +49,36 @@ func_name *功能名称。必传。
 fcda_id *端子ID。编辑时必传。
 fcda_name *功能名称。必传。
 fcda_match_exp *端子匹配表达式。必传。*/
-function saveModelAndIed(data){
+function saveModelAndIed(data) {
     return request({
-        url:`/admin/model/function/fcda/save`,
-        method:"post",
+        url: `/admin/model/function/fcda/save`,
+        method: "post",
         data
     })
 }
 // 获取指定模型和装置类型的功能列表
 /*model_id *模型ID
 ied_type *装置类型*/
-function getByModelAndIed(data){
+function getByModelAndIed(data) {
     return request({//适用于新增修改时下拉数据
-        url:`/admin/model/function/list`,
-        method:"get",
-        params:data
+        url: `/admin/model/function/list`,
+        method: "get",
+        params: data
+    })
+}
+// 将Excel数据导入到指定模块
+/*
+code *业务数据类别,由系统定义。当前支持:ied_func_fcda
+file *文件流参数名
+*/
+function excelInData(data) {
+    return request({
+        url: "impData",
+        method: "post",
+        data,
+        headers: {
+            'content-Type': 'multipart/form-data',
+        },
     })
 }
 export default {
@@ -73,4 +88,5 @@ export default {
     getModelAndIed,
     saveModelAndIed,
     getByModelAndIed,
+    excelInData,
 }

BIN
src/assets/files/装置功能及端子导入_模板.xlsx


+ 31 - 0
src/pages/components/drawModal/AbilityModal.vue

@@ -4,6 +4,17 @@
             <el-button type="primary" plain @click="addAbility(0)"><el-icon>
                     <Plus />
                 </el-icon>添加新功能</el-button>
+            <el-button type="success" plain @click="lookTemplate">查看模板</el-button>
+            <!-- <el-button type="primary" plain @click="upTemplate">上传模板</el-button> -->
+            <el-upload style="display: inline-block;margin-left: 10px;" v-model:file-list="fileList" class="upload-demo"
+                :show-file-list="false" :http-request="upTemplate" multiple :limit="1">
+                <el-button type="primary" plain :disabled="upState">上传模板</el-button>
+                <!-- <template #tip>
+                            <div class="el-upload__tip">
+                                jpg/png files with a size less than 500KB.
+                            </div>
+                        </template> -->
+            </el-upload>
             <el-table :data="tableData" style="width: 100%;height: calc(100vh - 600px);">
                 <el-table-column label="序号" width="100">
                     <template #default="scope">
@@ -42,6 +53,7 @@
 <script>
 import { ref, onMounted, watch, toRefs } from 'vue';
 import flow from "@/api/flow/flow"
+import system from '@/api/system';
 import AddAbility from './AddAbility.vue';
 import DelAbility from './DelAbility.vue';
 import { ElMessage } from 'element-plus';
@@ -88,6 +100,23 @@ export default {
                 tableData.value = res.data
             })
         }
+        // 下载报告模板
+        function lookTemplate() {
+            // 84780
+            system.downLoad({ ids: 84780 }).then(res => {
+                if (res.code == 0) {//使用接口获取服务器上文件位置
+                    let a = window.ApiServer + res.data//合成链接
+                    window.location = a//调用原生链接下载文件
+                }
+            })
+        }
+        // 文件上传
+        function upTemplate(e) {
+            // 调用接口进行文件上传
+            flow.excelInData({ code: "ied_func_fcda", file: e.file, model_id: modelIds.value - 0 }).then(res => {
+                console.log(res, 'fuahsfk');
+            })
+        }
         function copyReload() {
             flow.getModelAndIed({//获取所有功能
                 model_id: modelIds.value - 0,
@@ -150,6 +179,8 @@ export default {
             delFcda,//需要删除的fcdaid
             delModal,//删除功能模态框开关状态
             delBack,//DelAbility.vue返回模态框状态
+            lookTemplate,//模板下载
+            upTemplate,//文件上传
         }
     },
     components: {

+ 1 - 0
src/pages/mission/components/HistoryMis.vue

@@ -112,6 +112,7 @@ export default {
                 end_time: endTime.value
             }).then(res => {
                 tableData.value = res.data
+                totals.value = res.count
             })
         }
         function timeChange(e) {

+ 1 - 0
src/pages/setting/modalComp/Addrm.vue

@@ -116,6 +116,7 @@ export default {
             filesCacl.value = e.file
             cid.fileUpload({ station_id: 9999, file: filesCacl.value, attachment_type: "tpl" }).then(res => {
                 addForm.value.docid = res.data.fileid
+                console.log(addForm.value.docid,'filesifafk');
             })
         }
         function getCancel() {