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

文档管理

parent 865d6541
......@@ -63,6 +63,15 @@ export function doDeleteDtl(query) {
})
}
/* 树节点查询 */
export function doQuerytree(query) {
return request({
url: '/aqgl/jcsj/aqwd/query/tree',
method: 'post',
data: query||{}
})
}
......
......@@ -75,6 +75,19 @@ export const powerRoutes=[
name:'announcementManagement',
path:"announcementManagement"
},
{
component:'basicData/mlvh/index',
hidden:false,
meta:{
"title": "目录维护",
"icon": "",
"noCache": false,
"link": null,
"mkid":'902000200',
},
name:'mlvh',
path:"mlvh"
},
{
component:'basicData/securityDocumentManagement/index',
hidden:false,
......
<template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="20">
<!-- <el-col :span="12">
<el-form-item label="序号" ref="appid" prop="appid">
<el-input :readonly="readonly" v-model="form.appid"></el-input>
</el-form-item>
</el-col> -->
<el-col :span="24">
<el-form-item label="发布公司" ref="gsid" prop="gsid">
<RelSelect style="width: 100%;" src='jcsj/common/bm/queryGs' :match="{value:'id',label:'bmmc'}" v-model='form.gsid' ></RelSelect>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="标准名称" ref="name" prop="name">
<el-input :readonly="readonly" v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="备注">
<el-input type="textarea" :readonly="readonly" v-model="form.bz"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 按钮重写, -->
<!-- <div slot="reFooter">
<span slot="footer">
重写按钮写在这里,根据需要重写 slot(reFooter,foorer) 节点样式 重写方法需要在此页重新定义
</span>
</div> -->
</RelDialog>
</template>
<script>
import {editMixin} from 'common'
export default {
mixins: [editMixin],
/* 存放index页面传递的额外参数*/
mounted() {
},
/* 组件名称*/
name: 'appVersionEdit',
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() {
return {
/* 额外初始化,根据需求*/
systemType: [],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
gsid:'',
name: '',
bz: ''
},
/* form提交时的规则,具体规则参考官网*/
rules: {
gsid: [{
required: true,
} ]
}
}
},
methods: {
/* 重写方法,this.app来调用index页面定义的api*/
}
}
</script>
<style scoped lang="scss">
</style>
<template>
<div class="min_full">
<!-- 查询条件-->
<div class="search" v-condition>
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">目录名称:</span>
<el-input v-model='queryParams.name' ></el-input>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">公司:</span>
<RelSelect style="width: 100%;" src='jcsj/common/bm/queryGs' :match="{value:'id',label:'bmmc'}" v-model='queryParams.gsid' ></RelSelect>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<el-row class="tool-bar">
<PrintButton :app='app'></PrintButton>
<ViewButton ref="view" :app='app'></ViewButton>
<AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton>
<!-- <AttachFileButton :app='app' ></AttachFileButton> -->
<FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton>
<!-- 额外按钮-->
<!-- 表头设置 -->
<!-- 权限-->
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'>
</TablePager>
</div>
</div>
</template>
<script>
/* 引入需要的接口*/
import {
doQuery,
doAdd,
doUpdate,
doDelete
} from '@/api/basicData/securityDocumentManagement.js';
/* edit页面*/
import Edit from './edit'
import {
tableMixin
} from 'common'
export default {
mixins: [tableMixin],
name: 'aqgl/rcglLzrw',
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
return {
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: '/aqgl/rcgl/lzrw',
/* 查询参数*/
queryParams: {
name: '',
gsid: ''
},
/* 表格标题对应参数*/
tableTitle: [
// {
// prop: 'xh',
// label: '序号',
// width: '80'
// },
{
prop: 'name',
label: '目录名称',
width: '600'
},
{
prop: 'bz',
label: '备注',
width: '600'
}
]
}
},
methods: {
/* 基础查询*/
query: doQuery,
/* 基础增*/
apiAdd: doAdd,
/* 基础更新*/
apiUpdate: doUpdate,
/* 删除操作*/
apiDelete: doDelete,
/* 初始化赋值操作*/
init() {
}
},
components: {
Edit,
}
}
</script>
<style scoped>
</style>
<template>
<div style="display: flex;">
<div class="min_full" style="width: 200px;border-right: 0px;height: 140vh;">
<TreeBase :app='this' @selected='selectedTree'></TreeBase>
<el-dialog
:fullscreen='true'
append-to-body
:visible.sync="show"
width="100%"
>
<div v-if="show" style="height: 85vh;width: 100%">
<iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe>
<img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" width="100%" height="100%" border="0" >
</div>
</el-dialog>
<div id='aqwdfileAdd' style="display: none;" >
<input @change='beginUpload' id='aqglfilesonadd' ref="upload" type="file" style="display: none;">
</div>
<div class="min_full" style="width: 200px;border-right: 0px;">
<TreeBase :dgtype='3' :app='this' @selected='selectedTree'></TreeBase>
</div>
<div class="min_full" style="overflow: auto;width: calc(100% - 200px)">
<div class="min_full" style="calc(60vh - 42px)">
<!-- 查询条件-->
<div class="search" v-condition>
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">文档标题:</span>
<el-input v-model="queryParams.title"></el-input>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<el-row class="tool-bar" >
<PrintButton :app='this'></PrintButton>
<ViewButton ref="view" :app='this'></ViewButton>
<AddButton ref="add" :app='this'></AddButton>
<CopyButton ref="copy" :app='this'></CopyButton>
<EditButton ref="edit" :app='this'></EditButton>
<FieldButton :app='this'></FieldButton>
<ExcelButton :app='this'></ExcelButton>
<!-- <AttachFileButton :app='this' ></AttachFileButton> -->
<el-button v-loading='isupLoad' @click="upload" size='mini' type="primary">上传</el-button>
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager @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" >
<template slot-scope="scope">
<div style="width: 100%;display: flex;">
<el-button style="text-align: center;color: #3399ff;width: 50%;"
@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%;"
@click.native.prevent="downLoad(scope.row)" type="text" size="small">
<i class="el-icon-download"></i>下载
</el-button>
</div>
</template>
</el-table-column>
</template>
</TablePager>
</div>
</div>
<div class="min_full" style="overflow: auto;height: 140vh;width: calc(100% - 200px)">
<MainIndex :vMain='this' ref="mainIndex" ></MainIndex>
<LessIndex :vMain='this' ref="lessIndex" ></LessIndex>
<!-- <MainIndex :vMain='this' ref="mainIndex" ></MainIndex>
<LessIndex :vMain='this' ref="lessIndex" ></LessIndex> -->
</div>
</div>
</template>
<script>
import {
QueryUser,
QueryApptype,
AddUser,
DeleteUser,
UpdateUser,
QtUser,
QueryBm,
Setcanlogin,
ResetPassword
} from "common/src/api/system/dmgSystem.js";
doQuerytree
} from "@/api/basicData/securityDocumentManagement.js";
import {
autoAttach,
autoAttachDownload,
deleteAttachDownload,
uploadAttachDownload
} from "common/src/api/system/dmgSystem.js";
import {
doQueryDtl,
doAddDtl,
doUpdateDtl,
doDeleteDtl
} from "@/api/basicData/securityDocumentManagement.js";
import Edit from './lessEdit.vue'
import {tableMixin} from 'common'
import MainIndex from './mainIndex.vue'
import LessIndex from './lessIndex.vue'
export default {
mixins: [tableMixin],
name: 'securityDocumentManagementDtl',
name:'securityDocumentManagement',
components:{
MainIndex,
LessIndex
LessIndex,
Edit
},
data() {
return{
treeTitle: '部门列表',
show:false,
isupLoad:false,
treeTitle: '文档目录',
treeDefaultProps: {
children: 'children',
label: 'bmmc'
label: 'name'
},
// 额外
typeMap: [],
systemType: [],
baseUrl: 'aqgl/jcsj/aqwd',
/* 查询参数*/
queryParams: {
mlid:'',
title:'',
gsid:''
},
/* 表格标题对应参数*/
tableTitle: [
{
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'
},
{
prop: 'fileName',
label: '文件名',
width: '120'
},
{
prop: 'fileSize',
label: '文件大小',
width: '120',
formatter:function(a,b,bytes){
if(!bytes){
return '未上传文件'
}
if (bytes === 0) return '0 B';
var k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}
}
]
}
},
methods:{
/* 预览 */
preview(row){
console.log(row)
this.showType=row.fileType
let canShow=['gif','jpg','jpeg','png','bmp','pdf'].indexOf(row.fileType)==-1
if(canShow){
this.$warning('该文件不支持预览,请直接下载')
return
}
autoAttachDownload({},'aqgl/jcsj/aqwd',row.fileId).then(res=>{
let blob = new Blob([res], {
type: 'application/'+row.fileType+';charset=UTF-8',
});
this.url=URL.createObjectURL(blob)
this.show=true
})
},
creatFile(){
/* 清除老节点 */
$('#aqwdfileAdd').find('input').remove()
let lineEl = document.createElement('input');
let $lineEl=$(lineEl)
$lineEl.attr('type','file')
$lineEl.attr('ref','upload')
$lineEl.attr('id','aqglfilesonadd')
$lineEl.hide()
$lineEl.change(()=>{
console.log('触发beginUpload')
this.beginUpload()
})
// $lineEl
$('#aqwdfileAdd').append($lineEl)
},
beginUpload(){
this.isupLoad=true
let uploadDom=document.getElementById('aqglfilesonadd')
var filec = uploadDom.files[0];
var name = filec.name
var type = filec.type
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)
this.creatFile()
// formData.append('childPath', this.app.params['childPath']||'')
uploadAttachDownload(formData,'aqgl/jcsj/aqwd').then(res => {
if (res.success) {
this.$success('添加成功')
this.isupLoad=false
this.$refs['TablePager'].reLoad()
}
}).catch(e=>{
console.error(e)
this.isupLoad=false
})
}
},
upload(){
if (this.app.selectOne || this.app.clickOne){
console.log(this.singleItem)
let $upload=$('#aqglfilesonadd')
$upload.click()
/* 上传*/
}else{
this.$warning('请选中一行操作');
}
},
down(data,type,title) {
let a = document.createElement('a');
a.download = title;
a.style.display = 'none';
let blob = new Blob([data], {
type: 'application/'+type+';charset=UTF-8',
});
a.href = URL.createObjectURL(blob);
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
this.closeAll()
},
downLoad(row){
let title=row.fileName
autoAttachDownload({},'aqgl/jcsj/aqwd',row.fileId).then(res=>{
this.down(res,row.type,title)
})
},
selectedTree(val){
this.$refs.mainIndex.queryParams.pid=val.id
this.$refs.mainIndex.$refs['TablePager'].pageQuery({setFirstCurrent:true})
if(val.type=='ML'){
this.queryParams.gsid=val.gsid
this.queryParams.mlid=val.id
}else{
this.queryParams.gsid=val.id
this.queryParams.mlid=''
}
this.$refs['TablePager'].pageQuery()
},
apiTreeQuery: QueryBm,
/* 基础查询*/
query: doQueryDtl,
/* 基础增*/
apiAdd: doAddDtl,
/* 基础更新*/
apiUpdate: doUpdateDtl,
/* 删除操作*/
apiDelete: doDeleteDtl,
apiTreeQuery: doQuerytree,
}
}
......
......@@ -10,7 +10,7 @@
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-col :span="12">
<el-form-item label="发布日期" ref="fbrq" prop="fbrq">
<el-date-picker
value-format="timestamp"
......@@ -22,7 +22,7 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="12">
<el-form-item label="实施日期" ref="ssrq" prop="ssrq">
<el-date-picker
value-format="timestamp"
......@@ -34,13 +34,14 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发布部门" ref="bmid" prop="bmid">
<!-- <el-select :disabled="readonly" style="width: 100%;" :filterable='true' v-model="form.bmid" placeholder="请选择">
<el-option :key="index" v-for="(item,index) in bmList" :label="item.bmmc" :value="item.id">
</el-option>
</el-select> -->
<RelSelect src='kzzx/bm/query' :match="{value:'id',label:'bmmc'}" v-model='form.bmid' ></RelSelect>
<el-col :span="12">
<el-form-item label="发布公司" ref="gsid" prop="gsid">
<RelSelect style="width: 100%;" src='jcsj/common/bm/queryGs' :match="{value:'id',label:'bmmc'}" v-model='form.gsid' ></RelSelect>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="目录" ref="mlid" prop="mlid">
<RelSelect 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>
......@@ -68,6 +69,7 @@
/* 存放index页面传递的额外参数*/
mounted() {
this.form.mlid=this.app.queryParams.mlid
this.form.gsid=this.app.queryParams.gsid
},
/* 组件名称*/
name: 'appVersionEdit',
......@@ -81,6 +83,8 @@
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
mlid:'',
gsid:'',
title: '',
sytk: '',
bz: "",
......@@ -90,25 +94,8 @@
},
/* form提交时的规则,具体规则参考官网*/
rules: {
appid: [{
required: true,
trigger: 'blur'
}, ],
name: [{
required: true,
trigger: 'blur'
}, ],
type: [{
required: true,
trigger: 'change'
}, ],
version: [{
required: true,
trigger: 'blur'
}, ],
url: [{
required: true,
trigger: 'blur'
mlid: [{
required: true,
}, ],
}
}
......
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