liyangzheng 1 år sedan
förälder
incheckning
a4739af85d
3 ändrade filer med 12 tillägg och 11 borttagningar
  1. 1 1
      public/index.html
  2. BIN
      public/static/fanc_comp.xlsx
  3. 11 10
      src/pages/components/drawModal/AbilityModal.vue

+ 1 - 1
public/index.html

@@ -22,7 +22,7 @@
   </noscript>
   <div id="app"></div>
   <!-- built files will be auto injected -->
-  <script src="https://unpkg.com/bpmn-js@6.0.2/dist/bpmn-viewer.development.js"></script>
+  <!-- <script src="https://unpkg.com/bpmn-js@6.0.2/dist/bpmn-viewer.development.js"></script> -->
   <!-- <script src="./leader-line.min.js" type="module"></script> -->
   <!-- <script src="./anim-event.min.js" type="module"></script> -->
 </body>

BIN
public/static/fanc_comp.xlsx


+ 11 - 10
src/pages/components/drawModal/AbilityModal.vue

@@ -4,17 +4,12 @@
             <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"
+            <el-upload style="display: inline-block;margin: 0 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-button type="primary" plain :disabled="upState">Excel上传</el-button>
             </el-upload>
+            <el-button type="success" plain @click="downloadFile">模板下载</el-button>
+
             <el-table :data="tableData" style="width: 100%;height: calc(100vh - 600px);">
                 <el-table-column label="序号" width="100">
                     <template #default="scope">
@@ -102,7 +97,7 @@ export default {
         }
 
         function downloadFile() {
-            const fileUrl = '../../../assets/files/fanc_comp.xlsx'; // 修改为绝对路径
+            const fileUrl = '../../../../public/fanc_comp.xlsx'; // 修改为绝对路径
             fetch(fileUrl)
                 .then(response => {
                     if (!response.ok) {
@@ -143,6 +138,12 @@ export default {
                         message: "上传成功!",
                         type: "success"
                     })
+                    flow.getModelAndIed({//获取所有功能
+                        model_id: modelIds.value - 0,
+                        ied_type: iedTypes.value
+                    }).then(res => {
+                        tableData.value = res.data
+                    })
                 } else {
                     ElMessage({
                         message: res.msg,