This commit is contained in:
zhutianqi
2022-03-09 16:40:13 +08:00
parent ecaee403d0
commit e6e01768af
9 changed files with 111 additions and 90 deletions
+41 -20
View File
@@ -5,7 +5,7 @@
:visible.sync="isVisible2" :visible.sync="isVisible2"
:wrapperClosable="false" :wrapperClosable="false"
@close="handleTreeDrawerCancel" @close="handleTreeDrawerCancel"
size="400px"> size="460px">
<el-form <el-form
ref="attributeEO" ref="attributeEO"
class="label-input-form" class="label-input-form"
@@ -30,7 +30,7 @@
@check-change="checkChange" @check-change="checkChange"
:data="treeData" :data="treeData"
:props="defaultProps" :props="defaultProps"
:default-checked-keys="nodeList" :default-checked-keys="nodeList2"
highlight-current highlight-current
check-strictly check-strictly
@check="drawerCheck" @check="drawerCheck"
@@ -53,7 +53,7 @@
:data="treeData1" :data="treeData1"
:props="defaultProps" :props="defaultProps"
@check-change="checkChange2" @check-change="checkChange2"
:default-checked-keys="nodeList" :default-checked-keys="nodeList2"
highlight-current highlight-current
check-strictly check-strictly
@check="drawerCheck" @check="drawerCheck"
@@ -124,6 +124,7 @@
}, },
data () { data () {
return { return {
nodeList2: [],
delList: [], delList: [],
roleList: [], roleList: [],
isVisible2: false, isVisible2: false,
@@ -146,14 +147,19 @@
}, },
methods: { methods: {
handleClose (tag) { handleClose (tag) {
let arr = []
for (let a = 0; a < this.delList.length; a++) { for (let a = 0; a < this.delList.length; a++) {
if (tag.id === this.delList[a].id) { if (tag.id === this.delList[a].id) {
this.delList.splice(a, 1) this.delList.splice(a, 1)
} }
} }
for (let b = 0; b < this.nodeList.length; b++) { this.delList.map(item => {
if (tag.id === this.nodeList[b]) { arr.push(item)
this.nodeList.splice(b, 1) })
this.$refs.tree.setCheckedKeys(arr);
for (let b = 0; b < this.nodeList2.length; b++) {
if (tag.id === this.nodeList2[b]) {
this.nodeList2.splice(b, 1)
} }
} }
}, },
@@ -166,7 +172,8 @@
cancelButtonText: '取消', cancelButtonText: '取消',
}).then(() => { }).then(() => {
this.delList = [] this.delList = []
this.nodeList = [] this.nodeList2 = []
this.$refs.tree.setCheckedKeys([]);
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
@@ -191,13 +198,20 @@
}), }),
checkChange2 (row, type, c) { checkChange2 (row, type, c) {
if (this.checkBox) { if (this.checkBox) {
} else { } else {
if (type) { if (type) {
this.nodeList.push(row.id) this.nodeList2.push(row.id)
this.delList.push(row)
} else { } else {
for (let a = 0; a < this.nodeList.length; a ++) { for (let a = 0; a < this.nodeList2.length; a ++) {
if (row.id === this.nodeList[a]) { if (row.id === this.nodeList2[a]) {
this.nodeList.splice(a, 1) this.nodeList2.splice(a, 1)
}
}
for (let b = 0; b < this.delList.length; b++) {
if (row.id === this.delList[b].id) {
this.delList.splice(b, 1)
} }
} }
} }
@@ -205,18 +219,24 @@
}, },
checkChange (row, type, c) { checkChange (row, type, c) {
if (this.checkBox) { if (this.checkBox) {
} else { } else {
if (type) { if (type) {
this.nodeList.push(row.id) this.nodeList2.push(row.id)
this.delList.push(row)
} else { } else {
for (let a = 0; a < this.nodeList.length; a ++) { for (let a = 0; a < this.nodeList2.length; a++) {
if (row.id === this.nodeList[a]) { if (row.id === this.nodeList2[a]) {
this.nodeList.splice(a, 1) this.nodeList2.splice(a, 1)
}
}
for (let b = 0; b < this.delList.length; b++) {
if (row.id === this.delList[b].id) {
this.delList.splice(b, 1)
} }
} }
} }
} }
}, },
handleTreeDrawerCancel () { handleTreeDrawerCancel () {
this.filterText = '' this.filterText = ''
@@ -228,9 +248,9 @@
this.isVisible2 = false this.isVisible2 = false
this.$emit('checkedRole', this.roleList) this.$emit('checkedRole', this.roleList)
} else { } else {
if (this.nodeList.length > 0 && this.nodeList[0].length !== 0) { if (this.nodeList2.length > 0 && this.nodeList2[0].length !== 0) {
let ids = '' let ids = ''
this.nodeList.forEach(item => { this.nodeList2.forEach(item => {
if (ids.length > 0) { if (ids.length > 0) {
ids += ',' ids += ','
ids += item ids += item
@@ -295,10 +315,11 @@
watch: { watch: {
isVisible (val) { isVisible (val) {
this.isVisible2 = val this.isVisible2 = val
this.nodeList2 = this.nodeList
if (val) { if (val) {
if (this.nodeList.length > 0 && this.nodeList[0].length !== 0) { if (this.nodeList2.length > 0 && this.nodeList2[0].length !== 0) {
let ids = '' let ids = ''
this.nodeList.forEach(item => { this.nodeList2.forEach(item => {
if (ids.length > 0) { if (ids.length > 0) {
ids += ',' ids += ','
ids += item ids += item
@@ -169,14 +169,14 @@
show-overflow-tooltip show-overflow-tooltip
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
v-if="sarType === 'FOREIGN' && form.itemsNum1" <!-- v-if="sarType === 'FOREIGN' && form.itemsNum1"-->
prop="changePoint" <!-- prop="changePoint"-->
width="150" <!-- width="150"-->
label="相对于国行标差异点" <!-- label="相对于国行标差异点"-->
show-overflow-tooltip <!-- show-overflow-tooltip-->
align="center"> <!-- align="center">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
label="操作" label="操作"
width="240" width="240"
@@ -411,8 +411,8 @@
<div style="margin: 10px 5px;">比对条款: {{ plForm.itemsNum }}</div> <div style="margin: 10px 5px;">比对条款: {{ plForm.itemsNum }}</div>
<div style="margin: 10px 5px 5px;">相似度: {{ similarityDegree }}</div> <div style="margin: 10px 5px 5px;">相似度: {{ similarityDegree }}</div>
<div style="overflow: auto;display: flex;" class="BDclass"> <div style="overflow: auto;display: flex;" class="BDclass">
<div v-html="leftData" style="margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div> <div v-html="leftData" style="line-height: 20px;margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div>
<div v-html="rightData" style="margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div> <div v-html="rightData" style="line-height: 20px;margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div>
</div> </div>
</div> </div>
</div> </div>
@@ -220,14 +220,14 @@
show-overflow-tooltip show-overflow-tooltip
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
v-show="sarType === 'FOREIGN' && form.itemsNum1" <!-- v-show="sarType === 'FOREIGN' && form.itemsNum1"-->
prop="changePoint" <!-- prop="changePoint"-->
width="150" <!-- width="150"-->
label="相对于国行标差异点" <!-- label="相对于国行标差异点"-->
show-overflow-tooltip <!-- show-overflow-tooltip-->
align="center"> <!-- align="center">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
label="责任人" label="责任人"
width="170" width="170"
@@ -170,14 +170,14 @@
show-overflow-tooltip show-overflow-tooltip
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
v-if="sarType === 'FOREIGN' && form.itemsNum1" <!-- v-if="sarType === 'FOREIGN' && form.itemsNum1"-->
prop="changePoint" <!-- prop="changePoint"-->
width="150" <!-- width="150"-->
label="相对于国行标差异点" <!-- label="相对于国行标差异点"-->
show-overflow-tooltip <!-- show-overflow-tooltip-->
align="center"> <!-- align="center">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
label="责任人" label="责任人"
width="170" width="170"
@@ -419,8 +419,8 @@
<div style="margin: 10px 5px;">比对条款: {{ plForm.itemsNum }}</div> <div style="margin: 10px 5px;">比对条款: {{ plForm.itemsNum }}</div>
<div style="margin: 10px 5px 5px;">相似度: {{ similarityDegree }}</div> <div style="margin: 10px 5px 5px;">相似度: {{ similarityDegree }}</div>
<div style="overflow: auto;display: flex;" class="BDclass"> <div style="overflow: auto;display: flex;" class="BDclass">
<div v-html="leftData" style="margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div> <div v-html="leftData" style="line-height: 20px;margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div>
<div v-html="rightData" style="margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div> <div v-html="rightData" style="line-height: 20px;margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div>
</div> </div>
</div> </div>
</div> </div>
@@ -154,14 +154,14 @@
show-overflow-tooltip show-overflow-tooltip
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
v-if="sarType === 'FOREIGN' && form.itemsNum1" <!-- v-if="sarType === 'FOREIGN' && form.itemsNum1"-->
prop="changePoint" <!-- prop="changePoint"-->
width="150" <!-- width="150"-->
label="相对于国行标差异点" <!-- label="相对于国行标差异点"-->
show-overflow-tooltip <!-- show-overflow-tooltip-->
align="center"> <!-- align="center">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
label="责任人" label="责任人"
width="170" width="170"
@@ -169,14 +169,14 @@
show-overflow-tooltip show-overflow-tooltip
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
v-if="sarType === 'FOREIGN' && form.itemsNum1" <!-- v-if="sarType === 'FOREIGN' && form.itemsNum1"-->
prop="changePoint" <!-- prop="changePoint"-->
width="150" <!-- width="150"-->
label="相对于国行标差异点" <!-- label="相对于国行标差异点"-->
show-overflow-tooltip <!-- show-overflow-tooltip-->
align="center"> <!-- align="center">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
prop="complianceRequir" prop="complianceRequir"
width="150" width="150"
@@ -378,8 +378,8 @@
<div style="margin: 10px 5px;">比对条款: {{ editForm.itemsNum }}</div> <div style="margin: 10px 5px;">比对条款: {{ editForm.itemsNum }}</div>
<div style="margin: 10px 5px 5px;">相似度: {{ similarityDegree }}</div> <div style="margin: 10px 5px 5px;">相似度: {{ similarityDegree }}</div>
<div style="overflow: auto;display: flex;" class="BDclass"> <div style="overflow: auto;display: flex;" class="BDclass">
<div v-html="leftData" style="margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div> <div v-html="leftData" style="line-height: 20px;margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div>
<div v-html="rightData" style="margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div> <div v-html="rightData" style="line-height: 20px;margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%; overflow: auto;"></div>
</div> </div>
</div> </div>
</div> </div>
@@ -163,14 +163,14 @@
show-overflow-tooltip show-overflow-tooltip
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
v-show="sarType === 'FOREIGN' && form.itemsNum1" <!-- v-show="sarType === 'FOREIGN' && form.itemsNum1"-->
prop="changePoint" <!-- prop="changePoint"-->
width="150" <!-- width="150"-->
label="相对于国行标差异点" <!-- label="相对于国行标差异点"-->
show-overflow-tooltip <!-- show-overflow-tooltip-->
align="center"> <!-- align="center">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
prop="complianceRequir" prop="complianceRequir"
width="150" width="150"
@@ -163,14 +163,14 @@
show-overflow-tooltip show-overflow-tooltip
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
v-show="sarType === 'FOREIGN' && form.itemsNum1" <!-- v-show="sarType === 'FOREIGN' && form.itemsNum1"-->
prop="changePoint" <!-- prop="changePoint"-->
width="150" <!-- width="150"-->
label="相对于国行标差异点" <!-- label="相对于国行标差异点"-->
show-overflow-tooltip <!-- show-overflow-tooltip-->
align="center"> <!-- align="center">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
prop="complianceRequir" prop="complianceRequir"
width="150" width="150"
@@ -163,14 +163,14 @@
show-overflow-tooltip show-overflow-tooltip
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
v-show="sarType === 'FOREIGN' && form.itemsNum1" <!-- v-show="sarType === 'FOREIGN' && form.itemsNum1"-->
prop="changePoint" <!-- prop="changePoint"-->
width="150" <!-- width="150"-->
label="相对于国行标差异点" <!-- label="相对于国行标差异点"-->
show-overflow-tooltip <!-- show-overflow-tooltip-->
align="center"> <!-- align="center">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
prop="complianceRequir" prop="complianceRequir"
width="150" width="150"