修改文档详情

This commit is contained in:
qq787203167
2022-02-23 17:51:13 +08:00
parent 8512db8baa
commit 7912df8e23
3 changed files with 92 additions and 56 deletions
+23 -13
View File
@@ -16,7 +16,9 @@
<a class="text" v-for="(ol,index) in OperationList"
@click="OperationClick(ol,record)">{{ol.text}}</a>
</span>
<span slot="detailClick" slot-scope="text,record">
<a class="text" @click="detailClick(record)">{{text}}</a>
</span>
</a-table>
</div>
<div class="page" v-if="dataSource.length > 0">
@@ -74,16 +76,16 @@
total: 0,
searchParmes: {},
loading: false,
orderBy:'1',
orderByField:'',
orderBy: '1',
orderByField: ''
}
},
mounted() {
eventBUs.$on('searchQuery', search => {
Object.keys(search).forEach(res=>{
if (search[res] instanceof Array){
search[res] = search[res].join(',')
}
Object.keys(search).forEach(res => {
if (search[res] instanceof Array) {
search[res] = search[res].join(',')
}
})
this.searchParmes = search
this.getTableList()
@@ -103,7 +105,7 @@
getAction(this.url.tableHeader, params).then((res) => {
if (res.success) {
var jsonHead = res.result
jsonHead.forEach(res => {
jsonHead.forEach((res, index) => {
this.columns.push({
title: res.db_field_txt,
dataIndex: res.db_field_name,
@@ -111,6 +113,11 @@
ellipsis: true,
sorter: res.sort
})
if (res.click) {
this.columns[index].scopedSlots = {
customRender: 'detailClick'
}
}
})
let width
if (this.OperationList.length > 0) {
@@ -138,8 +145,8 @@
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
let params = {
...this.searchParmes,
orderBy:this.orderBy,
orderByField:this.orderByField,
orderBy: this.orderBy,
orderByField: this.orderByField,
pageNo: pageNo + '',
pageSize: pageSize + ''
}
@@ -161,12 +168,15 @@
this.getTableList()
},
onSelectChange(value) {
this.selectedRowKeys = value;
this.$emit('onSelectChange',value)
this.selectedRowKeys = value
this.$emit('onSelectChange', value)
},
OperationClick(ol, item) {
this.$emit(ol.ClickEvent, item)
}
},
detailClick(item){
this.$emit('detailClick',item)
},
}
}
</script>
@@ -5,7 +5,7 @@
<div class="doc-detail-header">
<div class="doc-detail-title">
<a-icon type="home" style="margin-right: 4px"/>
GB 27999-2019 《乘用车燃料消耗量评价方法及指标》 标准详情
{{this.$route.query.serial_number}} 《{{this.$route.query.title}}》 标准详情
</div>
<div class="doc-detail-right">
<a-button class="doc-detail-btn" type="primary">更新log</a-button>
@@ -15,49 +15,45 @@
<a-button class="doc-detail-btn" type="primary">知识问答库</a-button>
</div>
</div>
<div class="content">
<div class="header-text">
基本信息
</div>
<div class="content-text">
<div class="text-field" v-for="(item,index) in 19" :key="index">
<span class="text-field-left" v-if="index == 1">标注实施日期</span>
<span class="text-field-left" v-else>编号</span>
<span class="text-field-right">GB 27999-8019</span>
<div v-for="(item,index) in detailList">
<div v-for="val in Object.keys(item)" class="content">
<div class="header-text">
{{val}}
</div>
</div>
<div class="header-text">
文本信息
</div>
<div class="TextInformation">
<div class="TextInformationContent" v-for="item in 10">
<div class="content-text" v-if="val == '基本信息'">
<div class="text-field" v-for="(ol,index1) in item[val]">
<span class="text-field-left">{{ol.db_field_txt}}</span>
<span class="text-field-right">{{ol.value ? ol.value : '--'}}</span>
</div>
</div>
<div class="TextInformation" v-if="val == '文本信息'">
<div class="TextInformationContent" v-for="(ol,index1) in item[val]" style="width: 100%">
<span class="TextInformationContentLeft">
测试程序
{{ol.db_field_txt}}
</span>
<span class="TextInformationContentcontent">
123456.pdf
</span>
<span class="TextInformationContentright">
<a-icon type="vertical-align-bottom"/>
下载
</span>
</div>
</div>
<div class="header-text">
文本信息
</div>
<div class="TextInformation">
<div class="TextInformationContent" v-for="item in 3">
<span class="TextInformationContentLeft">
测试程序
</span>
<span class="TextInformationContentcontent">
123456.pdf
</span>
<span class="TextInformationContentright">
<span class="TextInformationContentcontent">
{{ol.value ? ol.value.fileName : '--'}}
</span>
<span class="TextInformationContentright">
<a-icon type="vertical-align-bottom"/>
下载
</span>
</div>
</div>
<div class="TextInformation" v-else-if="val == '关联信息'">
<div class="TextInformationContent" v-for="(ol,index1) in item[val]" style="width: 100%">
<span class="TextInformationContentLeft">
{{ol.db_field_txt}}
</span>
<span class="TextInformationContentcontent">
{{ol.value ? ol.value.fileName : '--'}}
</span>
<span class="TextInformationContentright">
<a-icon type="vertical-align-bottom"/>
下载
</span>
</div>
</div>
</div>
</div>
</div>
@@ -84,8 +80,12 @@
},
methods: {
getInfoById() {
getAction(this.url.getInfo, { id: '559594408e50406b867dc6fa1b0a515c' }).then((res) => {
getAction(this.url.getInfo, { id: this.$route.query.id }).then((res) => {
if (res.success) {
this.detailList = res.result
} else {
this.detailList = []
}
})
}
}
@@ -29,6 +29,7 @@
@Collection="Collection"
@subscribe="subscribe"
@onSelectChange="onSelectChange"
@detailClick="detailClick"
/>
</div>
<addForm
@@ -92,7 +93,8 @@
updateInfo: 'document/bussDocumentLibraryEO/updateInfo', //编辑
getDocumentInfo: 'document/bussDocumentLibraryEO/getDocumentInfoById', //查看
deleteBatch: 'document/bussDocumentLibraryEO/deleteBatch' //删除
}
},
idList:[],
}
},
mounted() {
@@ -115,6 +117,25 @@
},
handleDel() {
if (this.idList.length > 0){
let _this = this
this.$confirm({
content: '确认删除?',
onOk() {
deleteAction(_this.url.deleteBatch, { ids: _this.idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(res.message)
_this.idList = []
eventBUs.$emit('searchReset')
} else {
this.$message.warning(res.message)
}
})
}
})
}else{
this.$message.warning('请选择需要删除的数据')
}
},
handleCompare() {
@@ -146,7 +167,6 @@
})
}
})
},
//收藏按钮
Collection(val) {
@@ -157,7 +177,13 @@
console.log('val222', val)
},
onSelectChange(value){
this.idList = value
},
detailClick(item){
this.$router.push({
path:'/docManage/library/detail',
query:item
})
},
}
}