Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

This commit is contained in:
zhn
2022-09-07 18:56:35 +08:00
5 changed files with 2371 additions and 1 deletions
@@ -167,4 +167,16 @@ public class SarFileCompareItemController extends JeroController<SarFileCompareI
return super.importExcel(request, response, SarFileCompareItem.class);
}
/**
* 条款对比高亮
*/
@AutoLog(value = "文档对比信息条款表-条款对比高亮")
@ApiOperation(value="文档对比信息条款表-条款对比高亮", notes="文档对比信息条款表-条款对比高亮")
@GetMapping(value = "/clauseComparison")
public Result<?> clauseComparison(@RequestParam(name="leftId",required=true) String leftId,
@RequestParam(name="rightId",required=true) String rightId) {
List<String> res = sarFileCompareItemService.clauseComparison(leftId,rightId);
return Result.OK(res);
}
}
@@ -72,4 +72,6 @@ public interface ISarFileCompareItemService extends IService<SarFileCompareItem>
List<SarFileCompareItem> queryListByInfoId(String infoId);
Map<String, SarFileCompareItem> queryMapByInfoId(String infoId);
List<String> clauseComparison(String lid,String rid);
}
@@ -6,6 +6,7 @@ import com.jero.modules.compare.entity.SarFileCompareItem;
import com.jero.modules.compare.mapper.SarFileCompareItemMapper;
import com.jero.modules.compare.service.ISarFileCompareItemService;
import com.jero.modules.compare.utils.CompareConst;
import com.jero.modules.compare.utils.DiffUtils;
import com.jero.modules.system.util.StringUtils;
import org.springframework.stereotype.Service;
@@ -122,4 +123,13 @@ public class SarFileCompareItemServiceImpl extends ServiceImpl<SarFileCompareIte
}
return resMap;
}
@Override
public List<String> clauseComparison(String lid, String rid) {
SarFileCompareItem leftItem = this.queryById(lid);
SarFileCompareItem rightItem = this.queryById(rid);
DiffUtils dmp = new DiffUtils();
List<String> htmlDiffStr = dmp.getHtmlDiffStr(leftItem.getItemsText(), rightItem.getItemsText());
return htmlDiffStr;
}
}
@@ -51,6 +51,7 @@
</div>
<div class="detail-content-content-right-data-text" v-html="item.itemsText"></div>
</div>
<JLoading :loading="loadingText">{{$t('dataLoading')}}</JLoading>
</div>
</div>
</div>
@@ -143,7 +144,7 @@
</template>
<script>
import { postAction, putAction } from '../../../../api/manage'
import { postAction, putAction, getAction } from '../../../../api/manage'
export default {
name: 'documentDataComparison',
@@ -152,6 +153,7 @@
formInline: {},
formInlineText: {},
dataLoadingText: '',
loadingText:false,
rules: {
comment: [
{
@@ -322,6 +324,7 @@
detailLeft[num].classList.add('detail-content-content-right-data-color')
}
this.dataLeft = item
this.dataLeft.numIndex = num
if (this.isMatching) {
let detailRightColor = document.getElementsByClassName('detail-content-content-right-data-color-right')
if (detailRightColor && detailRightColor.length > 0) {
@@ -335,6 +338,8 @@
detailRight[item.targetStand].classList.add('detail-content-content-right-data-color-right')
detailContent[0].scrollTop = detailRight[item.targetStand].offsetTop - 150
}
this.dataRight.numIndex = item.targetStand
this.clauseComparison()
}
}
},
@@ -352,6 +357,7 @@
detailRight[num].classList.add('detail-content-content-right-data-color-right')
}
this.dataRight = item
this.dataRight.numIndex = num
if (this.isMatching) {
let detailLeftColor = document.getElementsByClassName('detail-content-content-right-data-color')
if (detailLeftColor && detailLeftColor.length > 0) {
@@ -359,15 +365,34 @@
}
if (item.targetStand > -1) {
this.dataLeft = this.resultData.textLeft[item.targetStand]
this.dataLeft.numIndex = item.targetStand
let detailContent = document.getElementsByClassName('detail-content-content-right-top')
let detailLeft = document.getElementsByClassName('detail-content-content-right-data')
if (detailLeft && detailLeft.length > 0 && item.targetStand >= 0) {
detailLeft[item.targetStand].classList.add('detail-content-content-right-data-color')
detailContent[0].scrollTop = detailLeft[item.targetStand].offsetTop - 150
}
this.clauseComparison()
// this.resultData = { ...this.resultData }
}
}
},
clauseComparison() {
let query = {
leftId: this.dataLeft.id,
rightId: this.dataRight.id
}
this.loadingText = true
getAction('/compare/sarFileCompareItem/clauseComparison', query).then((res) => {
if (res.success) {
this.loadingText = false
this.resultData.textLeft[this.dataLeft.numIndex].itemsText = res.result[0]
this.resultData.textRight[this.dataRight.numIndex].itemsText = res.result[1]
}else{
this.loadingText = false
}
})
},
onSelectLeft(selectedKeys, exports) {
let node = exports.node.$vnode.data.props.dataRef
let detailLeft = document.getElementsByClassName('detail-content-content-right-data')
@@ -642,4 +667,13 @@
border: 1px red solid;
}
::v-deep .delClass {
background: #ff7168;
font-weight: 700;
}
::v-deep .insertClass {
background: rgba(85, 183, 255, .6);
font-weight: 700;
}
</style>