|
@@ -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,33 @@ 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 => {
|
|
|
+ if (res.returncode == 200) {
|
|
|
+ ElMessage({
|
|
|
+ message: "上传成功!",
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
function copyReload() {
|
|
|
flow.getModelAndIed({//获取所有功能
|
|
|
model_id: modelIds.value - 0,
|
|
@@ -150,6 +189,8 @@ export default {
|
|
|
delFcda,//需要删除的fcdaid
|
|
|
delModal,//删除功能模态框开关状态
|
|
|
delBack,//DelAbility.vue返回模态框状态
|
|
|
+ lookTemplate,//模板下载
|
|
|
+ upTemplate,//文件上传
|
|
|
}
|
|
|
},
|
|
|
components: {
|