Bläddra i källkod

Merge remote-tracking branch 'origin/master'

LLL 1 år sedan
förälder
incheckning
ed36f47455

+ 16 - 11
src/views/module_kzks/projectImportList/ProjectImportListList.vue

@@ -31,27 +31,27 @@
 
     <!-- 操作按钮区域 -->
     <div class="table-operator">
-      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('导入并下载')">导出</a-button>
+      <a-button @click="handleAdd" type="primary" icon="plus">导入</a-button>
+      <!-- <a-button type="primary" icon="download" @click="handleExportXls('导入并下载')">导出</a-button>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
+      </a-upload> -->
       <!-- 高级查询区域 -->
       <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
-      <a-dropdown v-if="selectedRowKeys.length > 0">
+      <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
         </a-menu>
         <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
-      </a-dropdown>
+      </a-dropdown> -->
     </div>
 
     <!-- table区域-begin -->
     <div>
-      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+      <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
         <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-      </div>
+      </div> -->
 
       <a-table
         ref="table"
@@ -63,7 +63,6 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         class="j-table-force-nowrap"
         @change="handleTableChange">
 
@@ -88,11 +87,12 @@
         </template>
 
         <span slot="action" slot-scope="text, record">
-          <a @click="handleDetail(record)">详情</a>
-          <a-divider type="vertical" />
+          <!-- <a @click="handleDetail(record)">详情</a> -->
+          <a @click="exportExcel(record)">下载</a>
+          <!-- <a-divider type="vertical" />
           <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
             <a>删除</a>
-          </a-popconfirm>
+          </a-popconfirm> -->
           <!-- <a @click="handleEdit(record)">编辑</a>
 
           <a-divider type="vertical" />
@@ -125,6 +125,7 @@
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
   import ProjectImportListModal from './modules/ProjectImportListModal'
   import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
+  import { getFileAccessHttpUrl, downloadFile } from '@/api/manage'
 
   export default {
     name: 'ProjectImportListList',
@@ -206,6 +207,10 @@
         fieldList.push({type:'string',value:'createBy',text:'导入人',dictCode:''})
         fieldList.push({type:'datetime',value:'createTime',text:'导入日期'})
         this.superFieldList = fieldList
+      },
+      exportExcel(record){
+        let url = getFileAccessHttpUrl(record.fileAddress);
+        downloadFile(url, record.fileName)
       }
     }
   }

+ 6 - 4
src/views/module_kzks/projectImportList/modules/ProjectImportListForm.vue

@@ -4,9 +4,9 @@
       <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
         <a-row>
           <a-col :span="24">
-            <a-form-model-item label="导入文件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fileAddress">
+            <a-form-model-item label="导入文件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="file">
               <!-- <a-input v-model="model.file_address" placeholder="请输入导入文件名称"  ></a-input> -->
-              <j-upload v-model="model.fileAddress" :number="1" :multiple="false" text="上传"></j-upload>
+              <j-upload v-model="model.file" :returnUrl="false" :number="1" :multiple="false" text="上传"></j-upload>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
@@ -51,7 +51,7 @@
     data () {
       return {
         model:{
-          fileAddress: [],
+          file: [],
          },
         labelCol: {
           xs: { span: 24 },
@@ -103,7 +103,9 @@
               httpurl+=this.url.edit;
                method = 'put';
             }
-            console.log(111111)
+            console.log(111111,this.model)
+            this.model.fileAddress = this.model.file[0].filePath
+            this.model.fileName = this.model.file[0].fileName
             httpAction(httpurl,this.model,method).then((res)=>{
               if(res.success){
                 that.$message.success(res.message);