Commit a28e04a1 authored by 李苏's avatar 李苏 💬

修改上传,写bug

parent 647e97fc
......@@ -35,31 +35,7 @@ const permission = {
e.hidden=false
}
})
console.log(state.sidebarRouters)
// state.sidebarRouters.forEach((e,index)=>{
// if(mkid!='root'&&e.mkid&&(e.mkid==mkid)){
// state.sidebarRouters[index].hidden=false
// function getName(obj){
// let name=''
// if(obj.children&&obj.children[0]){
// name=getName(obj.children[0])
// }else{
// name=obj.name
// }
// return name
// }
// router.push({name:getName(e)})
// }else if(mkid!='root'&&e.mkid&&(e.mkid!=mkid)){
// state.sidebarRouters[index].hidden=true
// }
// else if(mkid=='root'&&e.mkid){
// state.sidebarRouters[index].hidden=false
// }
// })
// if(mkid!='root'){
// }
},
SET_ROUTES: (state, routes) => {
state.addRoutes = routes
......@@ -96,7 +72,9 @@ const permission = {
let hasMkid=false
asymenus.forEach(e=>{
if((e.mkid==item.meta.mkid)||(item.meta.mkid=='test')){
console.log(item,e)
item.meta.icon=e.icon
item.meta.title=e.mkmc
/* 额外参数*/
e.mkid&&(item.mkid=e.mkid)
e.menusBizType&&(item.menusBizType=e.menusBizType)
......@@ -196,6 +174,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
let outarr = []
oldarr.forEach((e,index)=>{
if(e.fmkid==pid){
outarr.push(e)
e.children=dgmk(oldarr,e.mkid)
}
......
......@@ -36,31 +36,35 @@
<!-- 按钮操作-->
<el-row class="tool-bar" >
<PrintButton :app='this'></PrintButton>
<ViewButton ref="view" :app='this'></ViewButton>
<AddButton ref="add" :app='this'></AddButton>
<EditButton ref="add" :app='this'></EditButton>
<!-- <ViewButton ref="view" :app='this'></ViewButton>
<CopyButton ref="copy" :app='this'></CopyButton>
<EditButton ref="edit" :app='this'></EditButton>
<FieldButton :app='this'></FieldButton>
<ExcelButton :app='this'></ExcelButton>
<ExcelButton :app='this'></ExcelButton> -->
<!-- <AttachFileButton :app='this' ></AttachFileButton> -->
<el-button v-loading='isupLoad' @click="upload" size='mini' type="primary">上传</el-button>
<el-button @click="upload" size='mini' type="primary">上传</el-button>
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='this' :query='query' @selectItem='selectItem'
<TablePager v-loading='isupLoad' @getData='getData' :ref="'TablePager'" :app='this' :query='query' @selectItem='selectItem'
@getRow='getRow'>
<template slot="tabCustom">
<el-table-column label="操作" width="180" header-align="center" fixed="right" >
<el-table-column label="附件操作" width="240" header-align="center" fixed="right" >
<template slot-scope="scope">
<div style="width: 100%;display: flex;">
<el-button style="text-align: center;color: #3399ff;width: 50%;"
<el-button style="text-align: center;color: #3399ff;width: 33.3%;"
@click.native.prevent="preview(scope.row)" type="text" size="small">
<i class="el-icon-view"></i>预览
</el-button>
<el-button v-if="scope.row.fileType!='pdf'" style="text-align: center;color: #3399ff;width: 33%;"
<el-button v-show="scope.row.fileType!='pdf'" style="text-align: center;color: #3399ff;width: 33.3%;"
@click.native.prevent="downLoad(scope.row)" type="text" size="small">
<i class="el-icon-download"></i>下载
</el-button>
<el-button style="text-align: center;color: #3399ff;width: 33.3%;"
@click.native.prevent="upload('update',scope.row)" type="text" size="small">
<i class="el-icon-upload2"></i>更新
</el-button>
</div>
</template>
......@@ -83,7 +87,8 @@
autoAttach,
autoAttachDownload,
deleteAttachDownload,
uploadAttachDownload
uploadAttachDownload,
aqglUploadUpdate
} from "common/src/api/system/dmgSystem.js";
import {
doQueryDtl,
......@@ -129,32 +134,32 @@
{
prop: 'title',
label: '标题',
width: '120'
},
{
prop: 'fbrq',
label: '发布日期',
...this.$common('ftDateTime')
},
{
prop: 'ssrq',
label: '实施日期',
...this.$common('ftDateTime')
},
{
prop: 'sytk',
label: '适用条款',
width: '120'
},
{
prop: 'bz',
label: '备注',
width: '120'
width: '400'
},
// {
// prop: 'fbrq',
// label: '发布日期',
// ...this.$common('ftDateTime')
// },
// {
// prop: 'ssrq',
// label: '实施日期',
// ...this.$common('ftDateTime')
// },
// {
// prop: 'sytk',
// label: '适用条款',
// width: '120'
// },
// {
// prop: 'bz',
// label: '备注',
// width: '120'
// },
{
prop: 'fileName',
label: '文件名',
width: '120'
width: '400'
},
{
prop: 'fileSize',
......@@ -215,15 +220,31 @@
var filec = uploadDom.files[0];
var name = filec.name
var type = filec.type
let updateId=$(uploadDom).attr('inputId')
updateId&&$(uploadDom).attr('inputId',null)
if (filec) {
let formData = new FormData();
formData.append('file', filec)
formData.append('type', type)
formData.append('folder', '')
formData.append('name', name)
formData.append('groupid', this.singleItem.id)
if(updateId){
formData.append('id', updateId)
this.creatFile()
aqglUploadUpdate(formData).then(res => {
if (res.success) {
this.$success('更新成功')
this.isupLoad=false
this.$refs['TablePager'].reLoad()
}
}).catch(e=>{
console.error(e)
this.isupLoad=false
})
return
}
formData.append('groupid', this.queryParams.mlid)
this.creatFile()
// formData.append('childPath', this.app.params['childPath']||'')
uploadAttachDownload(formData,'aqgl/jcsj/aqwd').then(res => {
if (res.success) {
this.$success('添加成功')
......@@ -238,13 +259,16 @@
}
},
upload(){
if (this.app.selectOne || this.app.clickOne){
console.log(this.singleItem)
let $upload=$('#aqglfilesonadd')
arguments[0]=='update'&&$upload.attr('inputId',arguments[1].fileId)&&$upload.click()
if(arguments[0]=='update'){
return
}
else if (this.queryParams.mlid ){
$upload.click()
/* 上传*/
}else{
this.$warning('请选中一行操作');
this.$warning('请选中目录操作操作');
}
},
down(data,type,title) {
......
......@@ -9,7 +9,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<!-- <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="发布日期" ref="fbrq" prop="fbrq">
<el-date-picker
......@@ -44,8 +44,8 @@
<RelSelect :readonly="readonly" style="width: 100%;" linkage :linkParams="{pid:form.gsid}" src='aqgl/jcsj/aqwdml/query' :match="{value:'id',label:'name'}" v-model='form.mlid' ></RelSelect>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
</el-row> -->
<!-- <el-row :gutter="20">
<el-col :span="24">
<el-form-item label="适用条款" ref="sytk" prop="content">
<el-input :readonly="readonly" type="textarea" v-model="form.sytk"></el-input>
......@@ -58,7 +58,7 @@
<el-input :readonly="readonly" type="textarea" v-model="form.bz"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-row> -->
</el-form>
</RelDialog>
</template>
......
......@@ -150,6 +150,7 @@ import Zdzrr from './zdzrr'
baseUrl: '/aqgl/fxyk/fxpc',
/* 查询参数*/
queryParams: {
queryType:'history',
gsid:'',
bmid:'',
jcr:'',
......
......@@ -63,13 +63,13 @@
<!-- tabs -->
<el-tabs v-model="activeName" @tab-click="handleClick" >
<el-tab-pane label="详细" name="first" >
<Details ref="Details" />
<Details v-show='tabData.length>0' ref="Details" />
</el-tab-pane>
<!-- <el-tab-pane label="检查周期" name="second">
<Cycle />
</el-tab-pane> -->
<el-tab-pane label="检查任务" name="third">
<Content :vMain='this' ref="Content" />
<Content v-show='tabData.length>0' :vMain='this' ref="Content" />
</el-tab-pane>
<!-- <el-tab-pane label="责任人" name="fourth">
<PersonLiable />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment