拆分条款详情修改

This commit is contained in:
caoyang
2022-04-09 20:24:46 +08:00
parent 7d9dc44461
commit e08332d385
11 changed files with 230 additions and 111 deletions
@@ -20,10 +20,19 @@
<template #title="{ key: treeKey, title, record }">
<a-dropdown :trigger="['contextmenu']">
<!-- <span>{{ title }}</span>-->
<span v-if="title.indexOf(searchValue) > -1" :title="title">
<span v-if="title.indexOf(searchValue) >= -1 " :title="title" class="expand-title">
{{ title.substr(0, title.indexOf(searchValue)) }}<span style="color: #f50">{{ searchValue }}</span>{{ title.substr(title.indexOf(searchValue) + searchValue.length) }}
</span>
<span v-else :title="title">{{ title }}</span>
<!-- <span v-else-if="title.indexOf(searchValue) >= -1 && title.length > 18 && title.indexOf(searchValue)>18" :title="title">-->
<!-- {{title && title.length > 18?title.slice(0,17)+'...':title}}-->
<!-- </span>-->
<!-- <span v-else-if="title.indexOf(searchValue) >= -1 && title.length > 18 && title.indexOf(searchValue)<=18" :title="title">-->
<!-- {{ title.substr(0, title.indexOf(searchValue)) }}<span style="color: #f50">{{ title.indexOf(searchValue)+searchValue.length>18?searchValue.substr(0,18-title.indexOf(searchValue)) : searchValue }}</span>{{ title.indexOf(searchValue)+searchValue.length>18?'...': title.substr(title.indexOf(searchValue) + searchValue.length,18-title.indexOf(searchValue) - searchValue.length)+'...' }}-->
<!-- </span>-->
<span v-else :title="title">
{{title && title.length > 18?title.slice(0,17)+'...':title}}
</span>
<template #overlay>
<a-menu @click="({ key: menuKey }) => onContextMenuClick(treeKey, menuKey, record)">
<a-menu-item key="1" @click="orgAdd">{{$t('newNode')}}</a-menu-item>
@@ -81,6 +90,7 @@
</div>
<div class="split-detail-table">
<table-data
ref="splitDetailTabel"
:url="url"
:flag="'4'"
:OperationList="OperationList"
@@ -219,11 +229,11 @@
rules: {
name: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('clauseNo'), trigger: 'blur' },
{ min: 1, max: 20, message: this.$t('cantExeed') + '20' + this.$t('characters'), trigger: 'blur' },
{ min: 1, max: 200, message: this.$t('cantExeed') + '200' + this.$t('characters'), trigger: 'blur' },
],
itemName: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('clauseName'), trigger: 'blur' },
{ min: 1, max: 20, message: this.$t('cantExeed') + '20' + this.$t('characters'), trigger: 'blur' },
{ min: 1, max: 200, message: this.$t('cantExeed') + '200' + this.$t('characters'), trigger: 'blur' },
],
displaySeq: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('serialNumber'), trigger: 'blur' },
@@ -270,23 +280,41 @@
deleteNode:false,
fullWidth:'',
parameter:{},
widthBrown:''
widthBrown:'',
creenWidth: document.body.clientWidth,
}
},
watch:{
deleteNode(){
},
screenWidth: {
immediate: true,
handler(newValue) {
// console.log(newValue)
}
}
},
computed:{
},
mounted() {
const that = this;
let client=''
let width=''
this.widthBrown = document.documentElement.offsetWidth || document.body.offsetWidth
let client = document.querySelector('.split-detail-table .ant-table-content').getBoundingClientRect()
let width = this.widthBrown - client.left
client = document.querySelector('.split-detail-table .ant-table-content').getBoundingClientRect()
width = this.widthBrown - client.left
document.querySelector('.split-detail-table .ant-table-content').style.width = width - 20 + 'px'
window.addEventListener('resize', () => {
that.screenWidth = window.screenWidth || document.body.clientWidth;
client = document.querySelector('.split-detail-table .ant-table-content').getBoundingClientRect()
// console.log('screenWidth',that.screenWidth)
width = that.screenWidth - client.left
document.querySelector('.split-detail-table .ant-table-content').style.width = width - 20 + 'px'
}, false);
this.infoId=this.$route.query.infoId
// console.log('info',this.$route.query)
@@ -329,6 +357,7 @@
return parentKey;
},
onExpand(expandedKeys){
// console.log('expandedKeys',expandedKeys)
this.expandedKeys = expandedKeys;
this.autoExpandParent = false;
},
@@ -359,6 +388,10 @@
if (res.success) {
this.data = this.toTree(res.result)
this.gData= [...this.data]
Object.assign(this, {
expandedKeys:this.expandedKeys,
autoExpandParent: true,
})
}
}).finally(()=>{
this.loading=false
@@ -521,8 +554,10 @@
if(res.success){
this.menuRightVisible=false
this.$message.success(this.$t('OperationSuccessful'))
this.onExpand(expandId)
// this.onExpand(expandId)
this.form={}
this.expandedKeys.push(this.nodeItem.id)
// console.log('expandedKeys1111',this.expandedKeys)
this.loadMenuData()
let queryParam={
menu_id:this.menuId,
@@ -633,6 +668,8 @@
.then((res) => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$emit('selectClear')
this.selectClear()
// this.loadData()
this.loadMenuData()
let queryParam={
@@ -726,7 +763,13 @@
parameter: this.parameter
}
downloadFile('split/sarFileSplitItems/exportSplitInfoZip', name, query)
downloadFile('split/sarFileSplitItems/exportSplitInfoZip', name, query,this.selectClear)
},
selectClear() {
this.$refs.splitDetailTabel.selectedRowKeys = []
this.selectedRowKeys=[]
this.selectedRows=[]
this.selecIds=[]
},
//模板下载
handleDownManage(){
@@ -757,6 +800,7 @@
.then( (res) => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.selectClear()
this.loadMenuData()
let queryParam={
menu_id:this.menuId,
@@ -799,6 +843,7 @@
//批量设置确定提交
addFormClick(){
this.batSetVisible=false
this.selectClear()
let queryParam={
menu_id:this.menuId,
info_id: this.infoId,
@@ -1066,7 +1111,10 @@
}
},
}
},
beforeDestroy() {
window.removeEventListener('resize', {}, false);
},
}
</script>
@@ -1080,11 +1128,11 @@
display: flex;
justify-content: space-between;
.split-detail-left{
width: 260px;
padding-right: 20px;
border-right: 1px solid #E6E7EC;
.split-detail-left-tree{
width: 240px;
}
.menu-item{
padding: 2px 8px;
@@ -1185,17 +1233,33 @@
}
}
.split-detail-left{
.ant-tree-treenode-switcher-open{
.ant-tree-node-content-wrapper-normal{
width:200px;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.ant-tree-title{
}
}
.ant-tree-title{
span{
display: block;
width: 240px;
overflow:hidden;
text-overflow:ellipsis;
}
}
.ant-tree-child-tree{
.ant-tree-title{
span{
display: block;
width: 240px;
overflow:hidden;
text-overflow:ellipsis;
}
}
}
}
.split-detail-table{
.ant-table-body{