code init

This commit is contained in:
chenxiaoxi
2021-05-25 18:06:45 +08:00
parent 02698d6dab
commit f54a8d4fa1
1367 changed files with 540755 additions and 21713 deletions
File diff suppressed because it is too large Load Diff
+21
View File
@@ -0,0 +1,21 @@
<!-- localTool页面 liuyan -->
<template>
<div class="demo v-class">
<router-view />
</div>
</template>
<script>
export default {
name: 'Demo',
data () {
return {
//
}
}
}
</script>
<style lang="less" scoped>
.demo{
height: 100%;
}
</style>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+601
View File
@@ -0,0 +1,601 @@
<comment>
# 标准对比
</comment>
<template>
<div class="standContrast">
<!-- 顶部工具栏 -->
<table-tools-bar>
<div slot="left">
<div class="search-area">
<el-form :modal="standCommonlySearch" inline class="label-input-form" @keyup.enter.native="sarStandCompareHis">
<el-formItem :label="$t('m.oldTextNumberOrName')" class="search-item">
<el-input v-model="oldNumOrName" class="s-c-input" :placeholder="$t('m.searchByOldTextNumberOrname')" clearable :maxlength="100" @keyup.enter.native="sarStandCompareHis()"></el-input>
</el-formItem>
<el-formItem :label="$t('m.newTextNumberOrname')" class="search-item">
<el-input v-model="newNumOrName" class="s-c-input" :placeholder="$t('m.searchByNewTextNumberOrname')" clearable :maxlength="100" @keyup.enter.native="sarStandCompareHis()"></el-input>
</el-formItem>
<el-formItem class="search-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
round
class="common-button-primary"
@click="sarStandCompareHisInfo"></el-button>
<el-button
class="common-button-default"
icon="el-icon-refresh-left"
round
@click="clearSearchStand"></el-button>
</el-formItem>
</el-form>
</div>
</div>
</table-tools-bar>
<div class="content">
<div class="action-bar">
<el-button round size="mini" v-btn-permission="'HS9BVNTNX2PNRRWL42AW'" @click="contrastStandFile" style="width:77px; height:32px;">比对</el-button>
<el-button round size="mini" v-btn-permission="'Z9SMGAUX2JA3X3CTVVCP'" @click="batchDelete"><i class="iconfont">&#xe61b;</i>批量删除</el-button>
</div>
<div class="table-wrap">
<div style="position: absolute;height: calc(100% - 10px);width: 100%;">
<el-table
ref="selection"
:data="standInfoList"
tooltip-effect="dark"
style="width: 100%;padding:0 0 20px 0;"
height="100%"
border
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="standSelectChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="oldStandNum"
label="旧文档文本号"
align="center"
>
</el-table-column>
<el-table-column
prop="oldStandName"
label="旧文档文本名称"
align="center">
</el-table-column>
<el-table-column
prop="oldFileTypeShow"
label="旧文本状态"
align="center">
</el-table-column>
<el-table-column
prop="newStandNum"
label="新文档文本号"
align="center">
</el-table-column>
<el-table-column
prop="newStandName"
label="新文档文本名称"
align="center">
</el-table-column>
<el-table-column
prop="newFileTypeShow"
label="新文本状态"
align="center">
</el-table-column>
<el-table-column
prop="compareType"
label="比对类型"
align="center">
</el-table-column>
<el-table-column
prop="createTime"
label="比对时间"
sortable
align="center">
</el-table-column>
<el-table-column
prop="action"
label="操作"
width="50px"
align="center">
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- class="opera-btn"-->
<!-- size="mini"-->
<!-- type="primary"-->
<!-- @click="handlePreview(scope.row)">查看</el-button>-->
<!-- <el-button-->
<!-- class="opera-btn"-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- @click="delFileEditInfo(scope.row.id)">删除</el-button>-->
<!-- <el-button-->
<!-- class="opera-btn"-->
<!-- size="mini"-->
<!-- type="primary"-->
<!-- @click="enjoyInfo(scope.row)">分享</el-button>-->
<!-- <el-button size="mini" class="opera-btn" type="primary" v-if="scope.row.collectBtn" @click="collectInfo(scope.row)">收藏</el-button>-->
<!-- <el-button size="mini" class="opera-btn" type="primary" v-else @click="cancelCollectInfo(scope.row)">取消收藏</el-button>-->
<!-- </template>-->
<template slot-scope="scope">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-btn-permission="'C6P4Z2E7MJ5RBTYCS554'" :command="[scope.row, '查看']">查看</el-dropdown-item>
<el-dropdown-item v-btn-permission="'Z9SMGAUX2JA3X3CTVVCP'" :command="[scope.row, '删除']">删除</el-dropdown-item>
<el-dropdown-item v-btn-permission="'WEJNHYG4J5ETSA9VFJWP'" :command="[scope.row, '分享']">分享</el-dropdown-item>
<el-dropdown-item
v-if="scope.row.collectBtn"
v-btn-permission="'UGBLFYXKA78BHHJSNSER'"
:command="[scope.row, '收藏']"
>
收藏
</el-dropdown-item>
<el-dropdown-item
v-else
v-btn-permission="'UGBLFYXKA78BHHJSNSER'"
:command="[scope.row, '取消收藏']"
>
取消收藏
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<pagination :page="splitInfoPage" :total="total" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
<loading :loading="spinShow">{{$t('m.dataLoading')}}……</loading>
<!-- 分享 -->
<el-drawer :title="$t('m.sharingStandard')" :visible.sync="drawerModal" width="300" :styles="drawerModalstyles" @on-close="treeCancel">
<div class="demo-drawer-content">
<dept-tree treeDivId="drawerModalTree"
ref="drawerModalTree"
@treeClick="selcetTree"
allDept
showUser
:editable="false"
style="padding: 0 15px">
</dept-tree>
</div>
<div class="demo-drawer-footer">
<el-button round size="mini" type="primary" @click="shareStandardBt" icon="el-icon-check">确定</el-button>
<el-button round size="mini" style="margin-right: 8px" @click="treeCancel" icon="el-icon-close">取消</el-button>
</div>
</el-drawer>
<!-- 分享 全部选人 -->
<org-table
:visible.sync="visibleOrgTable"
title="分享人员"
dialog-model
:config="{
value: orgTableVal,
valueName: orgTableValName
}"
@confirm="isTreeOk"
></org-table>
</div>
</template>
<script>
export default {
name: 'standContrast',
components: {
},
data () {
return {
visibleOrgTable: false,
orgTableVal: '',
orgTableValName: '',
spinShow: false,
collect: '收藏',
cancelCollect: false,
standCommonlySearch: {},
oldNumOrName: '',
newNumOrName: '',
standInfoList: [],
tableHeight: null,
total: 0,
splitInfoPage: 1,
splitInfoPageSize: this.$store.getters.userInfo.configContent,
selectedList: [],
drawerModalstyles: {
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: '53px',
position: 'static'
},
// end 分享相关的
shareStandardModal: false,
shareStandardSelect: [],
// 分享数据
resType: '',
// 消息推送保存对象
personShareEO: {
id: '',
recipientId: '',
shareUserId: '',
resType: '',
resId: '',
resUri: '',
resTitle: '',
readFlag: '',
validFlag: '',
modifyTime: '',
creationTime: ''
},
// 收藏标准
personCollect: {
collectResId: '',
collectTitle: '',
collectType: ''
},
drawerModal: false // 分享
}
},
props: {
},
watch: {
},
methods: {
handleCommand (command) {
switch (command[1]) {
case '查看':
this.handlePreview(command[0])
break
case '收藏':
this.collectInfo(command[0])
break
case '取消收藏':
this.cancelCollectInfo(command[0])
break
case '分享':
this.enjoyInfo(command[0])
break
case '删除':
this.delFileEditInfo(command[0].id)
break
}
},
// 树点击
isTreeOk (checkedList) {
this.shareStandardSelect = []
checkedList.map((item, index) => {
if (!item.isParent) {
this.shareStandardSelect.push(item.userId)
}
})
if (this.shareStandardSelect.length === 0) {
this.$message({
message: '请选择要分享的人!',
type: 'warning'
})
} else {
this.personShareEO.resType = 'COMPARISON'
this.personShareEO.resTitle = '【标准比对】 ' + (this.resPk.oldStandNum ? this.resPk.oldStandNum:'') + ' - ' + (this.resPk.newStandNum ? this.resPk.newStandNum:'')
/*if (this.resPk.standYear != null && this.resPk.standYear !== '') {
this.personShareEO.resTitle = this.resPk.oldStandName + ' ( 编号:' + this.resPk.oldFileType + ' ' + this.resPk.oldStandNum + '-' + this.resPk.standYear + ' )'
} else {
}*/
this.personShareEO.resId = this.resPk.id
this.personShareEO.resUri = JSON.stringify(this.resPk)
this.personShareEO.recipientId = this.shareStandardSelect
this.$http.post('/person/personShare/savePersonShare', this.personShareEO, {
_this: this
}, res => {
this.$message({
message: '标准分享成功!',
type: 'success'
})
this.shareStandardModal = false
this.visibleOrgTable = false
// this.drawerModal = false
this.shareStandardSelect = []
// this.$refs.drawerModalTree.treeReload()
}, e => {
this.$message.error('标准分享失败!')
})
}
},
// 消息推送
shareStandardBt () {
if (this.shareStandardSelect.length === 0) {
this.$message({
message: '请选择要分享的人!',
type: 'warning'
})
} else {
this.personShareEO.resType = 'COMPARISON'
this.personShareEO.resTitle = '【标准比对】 ' + (this.resPk.oldStandNum ? this.resPk.oldStandNum:'') + ' - ' + (this.resPk.newStandNum ? this.resPk.newStandNum:'')
/*if (this.resPk.standYear != null && this.resPk.standYear !== '') {
this.personShareEO.resTitle = this.resPk.oldStandName + ' ( 编号:' + this.resPk.oldFileType + ' ' + this.resPk.oldStandNum + '-' + this.resPk.standYear + ' )'
} else {
}*/
this.personShareEO.resId = this.resPk.id
this.personShareEO.resUri = JSON.stringify(this.resPk)
this.personShareEO.recipientId = this.shareStandardSelect
this.$http.post('/person/personShare/savePersonShare', this.personShareEO, {
_this: this
}, res => {
this.$message({
message: '标准分享成功!',
type: 'success'
})
this.shareStandardModal = false
this.drawerModal = false
this.shareStandardSelect = []
this.$refs.drawerModalTree.treeReload()
}, e => {
this.$message.error('标准分享失败!')
})
}
},
// 树点击
selcetTree (treeId, treeNode) {
this.shareStandardSelect = treeNode.id
},
// 取消
treeCancel () {
this.drawerModal = false
this.$refs.drawerModalTree.treeReload()
},
// 查看
handlePreview (params) {
if (params.compareType === '条款比对') {
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'SeeDatalis',
query: {
row: JSON.stringify(params)
}
})
} else {
let rowDataLeft = {}
let rowDataRight = {}
rowDataLeft.showNumber = params.oldStandNum
rowDataLeft.standName = params.oldStandName
rowDataLeft.standNameSplit = null
rowDataLeft.standNumSplit = null
rowDataRight.showNumber = params.newStandNum
rowDataRight.standName = params.newStandName
rowDataRight.standNameSplit = null
rowDataRight.standNumSplit = null
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'TextComparison',
query: {
id: params.id,
flag: '查看',
rowDataLeft: JSON.stringify(rowDataLeft),
rowDataRight: JSON.stringify(rowDataRight)
}
})
}
},
// 删除
delFileEditInfo (id) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: this.$t('m.determine'),
cancelButtonText: this.$t('m.cancel'),
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.post('lawss/sarStandCompareHis/deleteByIds', {
deleteByIdList: id
}, {
_this: this
}, res => {
if (res.ok) {
this.sarStandCompareHis()
}
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
},
enjoyInfo (item) {
// this.$message({
// message: '此功能正在开发中……',
// type: 'warning'
// })
// this.drawerModal = true
// this.$nextTick(() => {
// this.$refs.drawerModalTree.clearSearch()
// })
this.visibleOrgTable = true
this.resPk = JSON.parse(JSON.stringify(item))
},
// scope.$index 获取当前行下标
collectInfo (item) {
// 点击收藏
this.spinShow = true
item.isSubmit = true
this.personCollect.collectResId = item.id
if (item.standYear != null && item.standYear !== '') {
this.personCollect.collectTitle = item.newStandName + ' ( 编号:' + item.newStandNum + ' )'
} else {
this.personCollect.collectTitle = item.newStandName + ' ( 编号:' + item.newStandNum + ' )'
}
this.personCollect.collectType = 'INLAND_STAND'
this.$http.postData('person/personCollect', this.personCollect, {
_this: this
}, res => {
this.spinShow = false
item.isSubmit = false
item.collectBtn = !item.collectBtn
console.log(item.collectBtn, '点击收藏后')
item.collectId = res.data.id
this.cancelCollect = !this.cancelCollect
}, e => {
item.isSubmit = false
})
},
cancelCollectInfo (item) {
this.$http.put('person/personCollect/updateByUserId', {
id: item.collectId
}, {
_this: this
}, res => {
if (res.ok) {
item.collectBtn = !item.collectBtn
this.cancelCollect = !this.cancelCollect
item.collectId = ''
}
})
},
clearSearchStand () {
this.oldNumOrName = ''
this.newNumOrName = ''
this.splitInfoPage = 1
this.sarStandCompareHis()
},
sarStandCompareHisInfo() {
this.splitInfoPage = 1
this.sarStandCompareHis()
},
// 表格
sarStandCompareHis () {
this.spinShow = true
this.$http.get('lawss/sarStandCompareHis/page', {
page: this.splitInfoPage,
pageSize: this.splitInfoPageSize,
oldNumOrName: this.oldNumOrName,
newNumOrName: this.newNumOrName
}, {
_this: this
}, res => {
for (let i = 0; i < res.data.list.length; i++) {
res.data.list[i].checked = false
if (res.data.list[i].collectId != null && res.data.list[i].collectId !== '') {
res.data.list[i].collectBtn = false
res.data.list[i].cancelCollectBtn = true
} else {
res.data.list[i].collectBtn = true
res.data.list[i].cancelCollectBtn = false
}
res.data.list[i].isSubmit = false
}
this.standInfoList = res.data.list
this.total = res.data.count
this.spinShow = false
}, e => {
})
},
pageChange (page) {
this.splitInfoPage = page
this.sarStandCompareHis()
},
// 分页每页显示数改变后方法
pageSizeChange (pageSize) {
this.splitInfoPageSize = pageSize
this.sarStandCompareHis()
},
standSelectChange (data) {
this.selectedList = []
for (let i = 0; i < data.length; i++) {
this.selectedList.push(data[i].id)
}
},
contrastStandFile () {
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'ContrastDetails'
})
},
batchDelete () {
if (this.selectedList.length === 0) {
this.$message({
message: '请选择要删除的数据',
type: 'warning'
})
} else {
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: this.$t('m.determine'),
cancelButtonText: this.$t('m.cancel'),
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.post('lawss/sarStandCompareHis/deleteByIds', {
deleteByIdList: this.selectedList.join(',')
}, {
_this: this
}, res => {
this.sarStandCompareHis()
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.multipleTable.clearSelection()
})
}
}
},
computed: {
},
mounted () {
this.sarStandCompareHis()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
@import '~@/assets/styles/style';
.standContrast {
height: 100%;
background: #fff;
.el-divider--horizontal {
display: block;
height: 1px;
width: 100%;
margin: 0;
}
.flex();
flex-direction: column;
.action-bar {
margin-bottom: 5px;
padding: 0;
}
.content {
flex: auto;
overflow: hidden;
display: flex;
flex-direction: column;
.table-wrap {
flex: auto;
overflow: hidden;
position: relative;
}
}
& > .pagination {
position: static;
/deep/.pagination-slot {
padding: 0;
}
}
.s-c-input {
/deep/ .el-input__inner {
width: 190px;
}
}
}
::v-deep .el-drawer__header{
&>span:first-child{
outline: none!important;
}
}
::v-deep .el-drawer{
outline: none!important;
}
</style>
@@ -0,0 +1,520 @@
<!--条款对比-->
<template>
<div id="comparisonClauses">
<div class="myheader">
<div class="back" title="返回" @click="back" >
<i class="el-icon-back"></i>
</div>
<div class="header-title">条款比对</div>
</div>
<div class="item-contents">
<div class="contents-left">
<div class="stander-title-item">
<div>
{{rowDataLeft.standNameSplit === null ? rowDataLeft.standName : rowDataLeft.standNameSplit}} -- {{rowDataLeft.standNumSplit === null ? rowDataLeft.showNumber : rowDataLeft.standNumSplit}}
</div>
<div>
<div><span v-if="selectSarMenu.name">{{selectSarMenu.name}}</span><span v-if="comparisonFlag === '2'">相似度:<span style="color: red">{{text}}</span> <span>({{textcontent}})</span></span></div>
</div>
</div>
<div class="contents-flex">
<laws-tree :zNodes="zNodes"
ref="domesticTree"
treeDivId="domesticTree"
:editable="false"
expandFirst
@treeClick="(treeId, treeNode) => treeClick(treeNode)"
></laws-tree>
<div class="drawer-content-wrapper">
<div class="otherStandardDetails-drawer-content">
<div style="font-size:15px;padding-left: 15px; height: 30px;line-height: 30px">{{$t('m.termsAndConditions')}}:</div>
<div class="item-content-styles" id="itemContentHtml2">
<div v-for="(item, index) in itemsContentListShow" :key="index" v-if="comparisonFlag === '1'">
<el-row>
<el-col :span="24" v-if="item.type === 'TEXT'">
<p>{{item.itemContent}}</p>
</el-col>
<el-col :span="24" v-if="item.type === 'IMG'">
<div style="padding-top: 10px">
<div v-html="item.itemContent" @click="previewImage(item.itemContent)"></div>
</div>
</el-col>
<el-col :span="24" v-if="item.type === 'TABLE'">
<div style="padding-top: 10px" class="wordTableStyle">
<el-input v-model.trim="item.id" v-if="false"></el-input>
<div class="updateContentInput">
<table>
<tr v-for="(itemRow, indexRow) in item.tableListShow" :key="indexRow">
<td v-for="(itemCol, indexCol) in itemRow" :key="indexCol">
{{itemCol.content}}
</td>
</tr>
</table>
</div>
</div>
</el-col>
</el-row>
</div>
<div v-for="(item,index) in leftString" v-html="item" :key="index" v-if="comparisonFlag === '2'"></div>
</div>
</div>
</div>
</div>
</div>
<div class="contents-right">
<div class="stander-title-item">
<div>
{{rowDataRight.standNameSplit === null ? rowDataRight.standName : rowDataRight.standNameSplit}} -- {{rowDataRight.standNumSplit === null ? rowDataRight.showNumber : rowDataRight.standNumSplit}}
</div>
<div>
<div><span v-if="selectSarMenuRight.name">{{selectSarMenuRight.name}}</span><span v-if="comparisonFlag === '2'">相似度:<span style="color: red">{{text}}</span> <span>({{textcontent}})</span></span></div>
</div>
</div>
<div class="contents-flex">
<laws-tree :zNodes="zNodesRight"
ref="domesticTreeRight"
treeDivId="domesticTreeRight"
:editable="false"
expandFirst
@treeClick="(treeId, treeNode) => treeClickRight(treeNode)"
></laws-tree>
<div class="drawer-content-wrapper">
<div class="otherStandardDetails-drawer-content">
<div style="font-size:15px;padding-left: 15px;height: 30px;line-height: 30px">{{$t('m.termsAndConditions')}}:</div>
<div class="item-content-styles" id="itemContentHtml">
<div v-for="(item, index) in itemsContentListShowRight" :key="index" v-if="comparisonFlag === '1'">
<el-row>
<el-col :span="24" v-if="item.type === 'TEXT'">
<p>{{item.itemContent}}</p>
</el-col>
<el-col :span="24" v-if="item.type === 'IMG'">
<div style="padding-top: 10px">
<div v-html="item.itemContent" @click="previewImage(item.itemContent)"></div>
</div>
</el-col>
<el-col :span="24" v-if="item.type === 'TABLE'">
<div style="padding-top: 10px" class="wordTableStyle">
<el-input v-model.trim="item.id" v-if="false"></el-input>
<div class="updateContentInput">
<table>
<tr v-for="(itemRow, indexRow) in item.tableListShow" :key="indexRow">
<td v-for="(itemCol, indexCol) in itemRow" :key="indexCol">
{{itemCol.content}}
</td>
</tr>
</table>
</div>
</div>
</el-col>
</el-row>
</div>
<div v-for="(item,index) in rightString" v-html="item" :key="index" v-if="comparisonFlag === '2'"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="item-bottom">
<el-button type="primary" round class="searchAngNewBtn" size="medium" @click="comparisonClick">比对</el-button>
</div>
<el-dialog :visible.sync="resultModal" title="比对结果" width="80%" class="standerModal">
<div class="standerModal-content">
<div class="content-header">
相似度:<span style="color: red">{{text}}</span> ({{textcontent}})
</div>
<div class="content">
<div class="content-left">
<div v-for="(item,index) in leftString" v-html="item" :key="index"></div>
</div>
<div class="content-right">
<div v-for="(item,index) in rightString" v-html="item" :key="index"></div>
</div>
</div>
</div>
</el-dialog>
<el-dialog title="展示图片" width="600px;height:800px;" :visible.sync="showImg">
<div v-html="preImgContent" class="preImgStyle"></div>
</el-dialog>
<loading :loading="spinShow">数据加载中……</loading>
</div>
</template>
<script>
import 'zTree/js/jquery.ztree.core.js'
import 'zTree/js/jquery.ztree.excheck.js'
import 'zTree/js/jquery.ztree.exedit.js'
import deptTree from '../../../../components/deptTree'
export default {
name: 'comparisonClauses',
data () {
return {
preImgContent: '',
showImg: false,
saveItemId: '',
saveItemIdRight: '',
itemsContentListShow: [],
itemsContentListShowRight: [],
text: '',
textcontent: '',
leftString: [],
rightString: [],
resultModal: false,
// Comparison result
selectSarMenu: {},
selectSarMenuRight: {},
zNodes: [],
zNodesRight: [],
spinShow: false,
rowDataLeft: JSON.parse(this.$route.query.rowDataLeft),
rowDataRight: JSON.parse(this.$route.query.rowDataRight),
comparisonFlag: ''
}
},
methods: {
previewImage (content) {
this.preImgContent = content
this.showImg = true
},
comparisonClick () {
if (this.selectSarMenu.id === undefined) {
return this.$message({
message: '请先选择左侧条款',
type: 'warning'
})
}
if (this.selectSarMenuRight.id === undefined) {
return this.$message({
message: '请先选择右侧条款',
type: 'warning'
})
}
if (this.saveItemId === '') {
return this.$message({
message: '左侧选择节点无条款内容,请重新选择',
type: 'warning'
})
}
if (this.saveItemIdRight === '') {
return this.$message({
message: '右侧选择节点无条款内容,请重新选择',
type: 'warning'
})
}
this.spinShow = true
let itemsEoPage = {
oldItemId: this.saveItemId,
newItemId: this.saveItemIdRight,
standHisId: this.$route.query.data
}
this.$http.post('lawss/sarStandCompareHis/clauseComparison', itemsEoPage, {
_this: this
}, res => {
this.comparisonFlag = '2'
this.leftString = res.data.leftString
this.rightString = res.data.rightString
this.text = res.data.similarityDegree
if (parseFloat(res.data.similarityDegree) < parseFloat('75%')) {
this.textcontent = '不相似'
} else if (parseFloat(res.data.similarityDegree) >= parseFloat('75%') && parseFloat(res.data.similarityDegree) !== parseFloat('100%')) {
this.textcontent = '相似'
} else if (parseFloat(res.data.similarityDegree) === parseFloat('100%')) {
this.textcontent = '相同'
}
// this.resultModal = true
this.spinShow = false
}, e => {
})
},
treeClick (treeNode) {
this.comparisonFlag = '1'
this.selectSarMenu = treeNode
this.getSplitItemsByPage()
},
getSplitItemsByPage () {
this.spinShow = true
this.saveItemId = ''
this.itemsContentListShow = []
let itemsEoPage = {}
if (this.selectSarMenu.pId == null || this.selectSarMenu.pId === '') {
itemsEoPage.menuId = null
} else {
itemsEoPage.menuId = this.selectSarMenu.id
}
itemsEoPage.infoId = this.$route.query.infoIdLeft
itemsEoPage.page = 1
itemsEoPage.pageSize = 9999
this.$http.get('lawss/sarFileSplitItems/getSplitItemsByPage', itemsEoPage, {
_this: this
}, res => {
this.spinShow = false
if (res.ok) {
if (res.data.list.length === 0) {
this.spinShow = false
return this.$Message.warning('该节点没有条款内容')
}
this.saveItemId = res.data.list[0].id
this.showItemRequestDetails(res.data.list[0].id)
} else {
this.$message.warning(res.message)
}
}, e => {
})
},
showItemRequestDetails (id) {
this.$http.get('lawss/sarFileSplitItemsVal/getItemsValList', {
itemId: id,
type: 'TEXT'
}, {
_this: this
}, res => {
this.spinShow = false
this.itemsContentListShow = res.data
}, e => {
})
},
treeClickRight (treeNode) {
this.comparisonFlag = '1'
this.selectSarMenuRight = treeNode
this.getSplitItemsByPageRight()
},
getSplitItemsByPageRight () {
this.spinShow = true
let itemsEoPage = {}
this.saveItemIdRight = ''
this.itemsContentListShowRight = []
if (this.selectSarMenuRight.pId == null || this.selectSarMenuRight.pId === '') {
itemsEoPage.menuId = null
} else {
itemsEoPage.menuId = this.selectSarMenuRight.id
}
itemsEoPage.infoId = this.$route.query.infoIdRight
itemsEoPage.page = 1
itemsEoPage.pageSize = 9999
this.$http.get('lawss/sarFileSplitItems/getSplitItemsByPage', itemsEoPage, {
_this: this
}, res => {
if (res.data.list.length === 0) {
this.spinShow = false
return this.$Message.warning('该节点没有条款内容')
}
this.saveItemIdRight = res.data.list[0].id
this.showItemRequestDetailsRight(res.data.list[0].id)
}, e => {
})
},
showItemRequestDetailsRight (id) {
this.$http.get('lawss/sarFileSplitItemsVal/getItemsValList', {
itemId: id,
type: 'TEXT'
}, {
_this: this
}, res => {
this.spinShow = false
this.itemsContentListShowRight = res.data
}, e => {
})
},
// 返回
back () {
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'ContrastDetails'
})
},
selectMenu () {
this.spinShow = true
this.$http.get('lawss/sarFileSplitMenu/getSplitMenusByInfoId', {
infoId: this.$route.query.infoIdLeft
}, {
_this: this
}, res => {
if (res.data.length !== 0) {
let cur = res.data
let str = []
let option = {}
for (var i = 0; i < cur.length; i++) {
option = { id: cur[i].id,
pId: cur[i].pid,
name: cur[i].name + ' ' + (cur[i].itemName != null ? cur[i].itemName : ''),
number: cur[i].name,
itemName: cur[i].itemName != null ? cur[i].itemName : '',
displaySeq: cur[i].displaySeq,
remarks: cur[i].remarks}
str.push(option)
this.zNodes = str
}
}
}, e => {
})
},
selectMenuRight () {
this.$http.get('lawss/sarFileSplitMenu/getSplitMenusByInfoId', {
infoId: this.$route.query.infoIdRight
}, {
_this: this
}, res => {
if (res.data.length !== 0) {
let cur = res.data
let str = []
let option = {}
for (var i = 0; i < cur.length; i++) {
option = { id: cur[i].id,
pId: cur[i].pid,
name: cur[i].name + ' ' + (cur[i].itemName != null ? cur[i].itemName : ''),
number: cur[i].name,
itemName: cur[i].itemName != null ? cur[i].itemName : '',
displaySeq: cur[i].displaySeq,
remarks: cur[i].remarks}
str.push(option)
this.zNodesRight = str
}
}
this.spinShow = false
}, e => {
})
}
},
components: {
deptTree
},
props: {},
watch: {
},
mounted () {
this.selectMenu()
this.selectMenuRight()
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
@import '~@/assets/styles/style';
#comparisonClauses{
background: #fff;
position: relative;
height: 100%;
display: flex;
flex-direction: column;
.myheader {
height: 40px;
padding: 10px 0 0 10px;
.header-title {
font-weight: 600;
font-size: 16px;
line-height: 30px;
}
}
.item-contents{
padding: 0;
.flex();
height: calc(~'100% - 90px');
flex: auto;
.stander-title-item{
height: 50px;
font-size: 16px;
}
.laws-tree{
height: auto;
}
.contents-left{
flex: 0 0 50%;
border-right: 1px solid #EDEDED;
padding: 15px;
//flex: auto;
display: flex;
flex-direction: column;
}
.contents-flex{
//height: calc(~'100% - 50px');
.flex();
flex: auto;
overflow-y: hidden;
& > :first-child {
flex: 0 0 35%;
overflow: auto;
height: 100%;
}
.drawer-content-wrapper{
flex: 0 0 65%;
//height: 100%;
overflow: hidden;
.flex();
flex-direction: column;
overflow-y: auto;
.otherStandardDetails-drawer-content{
flex: auto;
position: relative;
height: 100%;
overflow-x: auto;
}
}
}
.contents-right{
padding: 15px;
flex: auto;
display: flex;
flex-direction: column;
}
}
.item-bottom{
height: 50px;
border-top: 1px solid #EDEDED;
.flex();
justify-content: flex-end;
align-items: center;
padding-right: 15px;
}
}
.back{
float: left;
vertical-align: super;
display: inline-block;
}
.standerModal{
.ivu-modal-body{
min-height: 400px;
max-height: 500px;
overflow-y: auto;
padding: 0 !important;
.standerModal-content{
.content-header{
height: 50px;
font-size: 15px;
align-items: center;
line-height: 50px;
padding: 0 15px;
}
}
.content{
border-top: 1px solid #EDEDED;
min-height: 349px;
max-height: 549px;
.flex();
font-size: 15px;
.content-left{
border-right: 1px solid #EDEDED;
flex: 0 0 50%;
height: 100%;
line-height: 30px;
padding: 0 15px;
}
.content-right{
flex: 0 0 50%;
height: 100%;
line-height: 30px;
padding: 0 15px;
}
}
}
}
.item-content-styles{
padding: 10px;
font-size: 16px;
height: calc(~'100% - 50px');
}
</style>
@@ -0,0 +1,544 @@
<comment>
# 标准对比 ---- 对比详情
</comment>
<template>
<div class="contrastDetails">
<div class="contrast-content">
<div class="add-config">
<div class="contrast-content-top">
<table-tools-bar>
<div slot="left">
<div class="search-area">
<el-form :modal="standCommonlySearch" inline class="label-input-form">
<el-formItem :label="$t('m.standardNumberName')" class="search-item">
<el-input v-model="numOrName" :placeholder="$t('m.searchByStandardNumberOrName')" clearable :maxlength="100"></el-input>
</el-formItem>
<el-formItem>
<el-button
icon="el-icon-search"
type="primary"
round
class="common-button-primary"
@click="getSarFileSplitInfoEOPage">
</el-button>
<el-button round icon="el-icon-refresh-left" class="common-button-default" @click="clearSearchStand"></el-button>
</el-formItem>
</el-form>
</div>
</div>
</table-tools-bar>
</div>
<div class="contrast-content-bottom">
<div class="table-wrapper">
<el-table
ref="standSelectTable"
:data="addSpiltStandList"
tooltip-effect="dark"
style="width: 100%;"
:height="tableHeight"
border
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}">
<!-- @selection-change="standSelectChange"-->
<!-- <el-table-column-->
<!-- label="#"-->
<!-- width="55"-->
<!-- type="selection"-->
<!-- align="center">-->
<!-- </el-table-column>-->
<el-table-column label="" width="55">
<template slot-scope="scope">
<el-radio :label="scope.$index+1" v-model="radio" @change.native="standSelectChange(scope.row)">
&nbsp;
</el-radio>
</template>
</el-table-column>
<el-table-column
prop="showNumber"
label="标准号/政策号"
align="center">
<template slot-scope="scope">
<div v-if="scope.row.standId != null && scope.row.standId !== ''">{{scope.row.showNumber}}</div>
<div v-else>{{scope.row.standNumSplit}}</div>
</template>
</el-table-column>
<el-table-column
prop="standName"
label="标准名称/政策名称"
align="center">
<template slot-scope="scope">
<div v-if="scope.row.standId != null && scope.row.standId !== ''">{{scope.row.standName}}</div>
<div v-else>{{scope.row.standNameSplit}}</div>
</template>
</el-table-column>
<el-table-column
prop="fileTypeShow"
label="文本状态"
align="center">
</el-table-column>
<el-table-column
prop="fileName"
label="文件名称"
align="center">
</el-table-column>
<el-table-column
prop="creationTime"
label="拆分时间"
sortable
align="center">
</el-table-column>
</el-table>
</div>
</div>
<pagination :total="addFileStandtotal" @pageChange="addFileStandPageChange"
@pageSizeChange="addFileStandPageSizeChange"></pagination>
</div>
<div class="add-config">
<div class="contrast-content-top">
<table-tools-bar>
<div slot="left">
<div class="search-area">
<el-form :modal="standCommonlySearch" inline class="label-input-form">
<el-formItem :label="$t('m.standardNumberName')" class="search-item">
<el-input v-model="numOrName2" :placeholder="$t('m.searchByStandardNumberOrName')" clearable :maxlength="100"></el-input>
</el-formItem>
<el-formItem class="search-item">
<el-button
icon="el-icon-search"
round
type="primary"
class="common-button-primary"
@click="getSarFileSplitInfoEOPage2">
</el-button>
<el-button round icon="el-icon-refresh-left" class="common-button-default" @click="clearSearchStand2"></el-button>
</el-formItem>
</el-form>
</div>
</div>
</table-tools-bar>
</div>
<div class="contrast-content-bottom">
<div class="table-wrapper">
<el-table
ref="standSelectTable2"
:data="addSpiltStandList2"
tooltip-effect="dark"
style="width: 100%;"
border
:height="tableHeight"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="standSelectChange2">
<!-- <el-table-column-->
<!-- label="#"-->
<!-- type="selection"-->
<!-- width="55"-->
<!-- prop="checkBox"-->
<!-- align="center">-->
<!-- </el-table-column>-->
<el-table-column label="" width="55">
<template slot-scope="scope">
<el-radio :label="scope.$index+1" v-model="radio2" @change.native="standSelectChange2(scope.row)">
&nbsp;
</el-radio>
</template>
</el-table-column>
<el-table-column
prop="showNumber"
label="标准号/政策号"
align="center">
<template slot-scope="scope">
<div v-if="scope.row.standId != null && scope.row.standId !== ''">{{scope.row.showNumber}}</div>
<div v-else>{{scope.row.standNumSplit}}</div>
</template>
</el-table-column>
<el-table-column
prop="standName"
label="标准名称/政策名称"
align="center">
<template slot-scope="scope">
<div v-if="scope.row.standId != null && scope.row.standId !== ''">{{scope.row.standName}}</div>
<div v-else>{{scope.row.standNameSplit}}</div>
</template>
</el-table-column>
<el-table-column
prop="fileTypeShow"
label="文本状态"
align="center">
</el-table-column>
<el-table-column
prop="fileName"
label="文件名称"
align="center">
</el-table-column>
<el-table-column
prop="creationTime"
label="拆分时间"
sortable
align="center">
</el-table-column>
</el-table>
</div>
</div>
<pagination :total="addFileStandtotal2" @pageChange="addFileStandPageChange2"
@pageSizeChange="addFileStandPageSizeChange2"></pagination>
</div>
</div>
<div class="contrast-button">
<div>
<el-button round type="primary" size="mini" @click="comparisonClauses">{{$t('m.termComparison')}}</el-button>
<el-button round type="primary" size="mini" @click="textComparison">{{$t('m.fullTextComparison')}}</el-button>
</div>
</div>
<loading :loading="spinShow">数据加载中……</loading>
</div>
</template>
<script>
export default {
name: 'contrastDetails',
components: {
},
data () {
return {
spinShow: false,
standCommonlySearch: '',
numOrName: '',
numOrName2: '',
selectedSplitStandList: [],
selectedSplitStandList2: [],
addSpiltStandList: [],
addSpiltStandList2: [],
selectedList: [],
tableHeight: null,
radio: null,
radio2: null,
addFileStandtotal: 0,
addFileStandtotal2: 0,
addFilePage: 1,
addFilePage2: 1,
addFilePageSize: this.$store.getters.userInfo.configContent,
addFilePageSize2: this.$store.getters.userInfo.configContent
}
},
props: {
},
watch: {
},
methods: {
// select (selection, row) {
// this.$refs.standSelectTable.clearSelection()
// if (selection.length === 0) {
// return
// }
// this.$refs.standSelectTable.toggleRowSelection(row, true)
// this.selectedSplitStandList = []
// },
// select2 (selection, row) {
// this.$refs.standSelectTable2.clearSelection()
// if (selection.length === 0) {
// return
// }
// this.$refs.standSelectTable2.toggleRowSelection(row, true)
// },
standSelectChange (data) {
this.selectedSplitStandList = []
if (data.length !== '' || data.length !== null) {
for (let i = 0; i < this.addSpiltStandList.length; i++) {
if (data.id === this.addSpiltStandList[i].id) {
this.addSpiltStandList[i].checkBox = true
// 选中的一条数据
this.selectedSplitStandList.push(this.addSpiltStandList[i])
}
}
}
},
standSelectChange2 (data) {
this.selectedSplitStandList2 = []
for (let i = 0; i < this.addSpiltStandList2.length; i++) {
if (data.id === this.addSpiltStandList2[i].id) {
this.addSpiltStandList2[i].checkBox = true
this.selectedSplitStandList2.push(this.addSpiltStandList2[i])
}
}
// this.addSpiltStandList2.forEach((items) => { // 先取消所有对象的勾选,checkBox设置为false
// this.$set(items, 'checkBox', false)
// })
// this.addSpiltStandList2[0].checkBox = true // 再将勾选的对象的checkBox设置为true
// this.selectedSplitStandList2 = []
// this.selectedSplitStandList2.push(this.addSpiltStandList2[0])
},
// 条款比对
addStandCompareHis () {
return new Promise((resolve, reject) => {
this.$http.postData('lawss/sarStandCompareHis/addStandCompareHis', {
oldStandId: this.selectedSplitStandList[0].id,
oldStandName: this.selectedSplitStandList[0].standNameSplit === null ? this.selectedSplitStandList[0].standName : this.selectedSplitStandList[0].standNameSplit,
oldStandNum: this.selectedSplitStandList[0].standNumSplit === null ? this.selectedSplitStandList[0].showNumber : this.selectedSplitStandList[0].standNumSplit,
oldFileType: this.selectedSplitStandList[0].fileType,
oldSarType: this.selectedSplitStandList[0].sarType,
newStandId: this.selectedSplitStandList2[0].id,
newStandName: this.selectedSplitStandList2[0].standNameSplit === null ? this.selectedSplitStandList2[0].standName : this.selectedSplitStandList2[0].standNameSplit,
newStandNum: this.selectedSplitStandList2[0].standNumSplit === null ? this.selectedSplitStandList2[0].showNumber : this.selectedSplitStandList2[0].standNumSplit,
newFileType: this.selectedSplitStandList2[0].fileType,
newSarType: this.selectedSplitStandList2[0].sarType,
compareType: '条款比对'
}, {
_this: this
}, res => {
resolve(res.data)
}, e => {
})
})
},
// 条款比对
comparisonClauses () {
if (this.selectedSplitStandList.length === 0) {
return this.$message({
message: '请先选择一条左侧标准',
type: 'warning'
})
} else if (this.selectedSplitStandList.length > 1) {
return this.$message({
message: '只能选择一条标准',
type: 'warning'
})
}
if (this.selectedSplitStandList2.length === 0) {
return this.$message({
message: '请先选择一条右侧标准',
type: 'warning'
})
} else if (this.selectedSplitStandList2.length > 1) {
return this.$message({
message: '只能选择一条标准',
type: 'warning'
})
}
this.addStandCompareHis().then((data) => {
return this.$router.push({
name: 'ComparisonClauses',
query: {
data: data,
infoIdLeft: this.selectedSplitStandList[0].id,
infoIdRight: this.selectedSplitStandList2[0].id,
rowDataLeft: JSON.stringify(this.selectedSplitStandList[0]),
rowDataRight: JSON.stringify(this.selectedSplitStandList2[0])
}
})
})
},
// 全文比对
textComparison () {
if (this.selectedSplitStandList.length === 0) {
return this.$message({
message: '请先选择一条左侧标准',
type: 'warning'
})
} else if (this.selectedSplitStandList.length > 1) {
return this.$message({
message: '只能选择一条标准',
type: 'warning'
})
}
if (this.selectedSplitStandList2.length === 0) {
return this.$message({
message: '请先选择一条右侧标准',
type: 'warning'
})
} else if (this.selectedSplitStandList2.length > 1) {
return this.$message({
message: '只能选择一条标准',
type: 'warning'
})
}
this.$router.push({
name: 'TextComparison',
query: {
infoIdLeft: this.selectedSplitStandList[0].id,
infoIdRight: this.selectedSplitStandList2[0].id,
rowDataLeft: JSON.stringify(this.selectedSplitStandList[0]),
rowDataRight: JSON.stringify(this.selectedSplitStandList2[0])
}
})
},
addFileStandPageChange (page) {
this.addFilePage = page
this.getSarFileSplitInfoEOPage()
},
addFileStandPageChange2 (page) {
this.addFilePage2 = page
this.getSarFileSplitInfoEOPage2()
},
addFileStandPageSizeChange (pageSize) {
this.addFilePageSize = pageSize
this.getSarFileSplitInfoEOPage()
},
addFileStandPageSizeChange2 (pageSize) {
this.addFilePageSize2 = pageSize
this.getSarFileSplitInfoEOPage2()
},
getSarFileSplitInfoEOPage () {
this.spinShow = true
this.$http.get('lawss/sarFileSplitInfo/getSarFileSplitInfoEOPage', {
page: this.addFilePage,
pageSize: this.addFilePageSize,
numOrName: this.numOrName
}, {
_this: this
}, res => {
this.addSpiltStandList = res.data.list
this.addFileStandtotal = res.data.count
this.spinShow = false
}, e => {
})
},
getSarFileSplitInfoEOPage2 () {
this.spinShow = true
this.$http.get('lawss/sarFileSplitInfo/getSarFileSplitInfoEOPage', {
page: this.addFilePage2,
pageSize: this.addFilePageSize2,
numOrName: this.numOrName2
}, {
_this: this
}, res => {
this.addSpiltStandList2 = res.data.list
this.addFileStandtotal2 = res.data.count
this.spinShow = false
}, e => {
})
},
clearSearchStand () {
this.numOrName = ''
this.getSarFileSplitInfoEOPage()
},
clearSearchStand2 () {
this.numOrName2 = ''
this.getSarFileSplitInfoEOPage2()
}
},
computed: {
},
mounted () {
this.getSarFileSplitInfoEOPage()
this.getSarFileSplitInfoEOPage2()
this.$nextTick(() => {
this.tableHeight = $('.contrast-content').height() - 105
window.onresize = function () {
this.tableHeight = $('.contrast-content').height() - 105
}.bind(this)
})
}
}
</script>
<style scoped lang="less">
@import '~@/assets/styles/mixins';
@import '~@/assets/styles/style';
.contrastDetails{
width: 100%;
height: 100%;
.pagination {
width: 100% !important;
left: 0 !important;
}
.contrast-content{
width: 100%;
height: calc(~'100% - 48px');
position: relative;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #dcdee2;
& > div{
.contrast-content-top{
height: 50px;
border-bottom-width: 1px;
border-bottom-style: solid ;
border-bottom-color: #dcdee2;
border-right-width: 1px;
border-right-style: solid;
border-right-color: #dcdee2;
}
.contrast-content-bottom{
position: relative;
background: #fff;
height: calc(~'100% - 50px');
overflow-y: auto;
.ivu-table-wrapper{
border: none;
}
.table-wrapper{
margin: 0 10px;
}
}
}
& >:first-child{
border-right-width: 1px;
border-right-style: solid;
border-right-color: #dcdee2;
width: 50%;
height: 100%;
position: absolute;
left: 0;
}
& >:last-child{
/*border-right-width: 1px;*/
/*border-right-style: solid;*/
width: 50%;
height: 100%;
position: absolute;
right: 0;
}
}
.contrast-button{
padding: 10px;
background: #fff;
.flex();
justify-content: flex-end;
align-items: center;
}
.add-config{
.ivu-form-item{
margin-bottom: 8px;
.ivu-form-item-label{
width: auto;
}
.ivu-form-item-content{
width: calc(~'100% - 150px');
}
}
.table-wrapper{
.ivu-table-wrapper{
height: 100%;
.ivu-table-body{
height: calc(~'100% - 41px');
overflow-x: hidden;
overflow-y: auto;
}
}
}
.domestic-standard-database-config-header{
.ivu-select-selection{
min-width: 0;
}
}
.pagination .ivu-divider-horizontal{
display: none;
}
.standards-tree-modal{
.ivu-form-item-content{
width: calc(~'100% - 60px');
}
}
}
.searchAngNewBtn{
margin-top: 10px;
}
}
.el-table__body-wrapper is-scrolling-none {
/* overflow-y: auto !important; */
overflow-y: hidden;
}
.el-table .el-table__body-wrapper {
overflow-y: hidden !important;
}
</style>
@@ -0,0 +1,376 @@
<!--条款对比-->
<template>
<div id="seeDatalis">
<div class="myheader">
<div class="back" title="返回" @click="back" >
<i class="el-icon-back"></i>
</div>
<div class="header-title">条款比对</div>
</div>
<div class="item-contents">
<div style="padding-bottom: 10px;">
{{row.oldStandNum}} {{row.oldStandName}} —— {{row.newStandNum}} {{row.newStandName}}
<el-button type="primary" round @click="exportItemsCompareHis" size="mini" style="margin-left: 20px" v-btn-permission="'5BXYKLVAQ3AXT2PK7PJC'">{{$t('m.andGetTheResultsOfTheComparison')}}</el-button>
</div>
<el-table
ref="selection"
:data="standInfoList"
tooltip-effect="dark"
style="width: 100%;padding:0 0 10px 0;"
:height="tableHeight"
border
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}">
<el-table-column
prop="oldItemsNum"
:label="$t('m.oldTermNumber')"
align="center"
>
</el-table-column>
<el-table-column
prop="oldItemsName"
:label="$t('m.nameOfOldTerm')"
align="center">
</el-table-column>
<el-table-column
prop="newItemsNum"
:label="$t('m.newTermNumber')"
align="center">
</el-table-column>
<el-table-column
prop="newItemsName"
:label="$t('m.newTermsAndConditions')"
align="center">
</el-table-column>
<el-table-column
prop="createTime"
:label="$t('m.comparisonTime')"
align="center">
</el-table-column>
<el-table-column
prop="action"
:label="$t('m.action')"
width="280px"
align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="handlePreview(scope.row)" v-btn-permission="'99CSTACRWA5SKM94W2F2'">{{$t('m.lookAtTheDifferences')}}</el-button>
</template>
</el-table-column>
</el-table>
<pagination :total="total" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
</div>
<el-dialog :visible.sync="resultModal" title="比对结果" width="80%" class="standerModal">
<div class="standerModal-content">
<div class="content-header">
相似度:<span style="color: red">{{text}}</span> ({{textcontent}})
</div>
<div class="content">
<div class="content-left">
<div style="position: relative">
<div class="viewLogo" v-show="this.oldRemark !== null"><i class="el-icon-star-on" /></div>
<div v-html="leftString"></div>
<div @click="leftAddViewRemark" class="addRemarkBtn" v-show="(this.oldRemark === '' || this.oldRemark === null) && this.leftCloseBtn === false"><i class="el-icon-circle-plus-outline" style="font-size: 20px"/></div>
<div @click="leftAddViewRemark" class="addRemarkBtn" v-show="(this.oldRemark !== null && this.oldRemark !== '') && this.leftCloseBtn === false"><i class="el-icon-view" style="font-size: 25px"/></div>
<div @click="leftCloseView" class="addRemarkBtn" v-show="this.leftCloseBtn === true"><i class="el-icon-circle-close" style="font-size: 20px"/></div>
</div>
<div v-show="this.leftAddModalState">
<el-input type="textarea" v-model.trim="oldRemark" :maxlength="500" show-word-limit :autosize="{minRows: 4,maxRows: 7}" placeholder="书写笔记"></el-input>
<div class="btn">
<el-button type="primary" size="mini" @click="saveRemark('old')">提交</el-button>
</div>
</div>
</div>
<div class="content-right">
<div style="position: relative">
<div class="viewLogo" v-show="this.newRemark !== null"><i class="el-icon-star-on" /></div>
<div v-html="rightString"></div>
<div @click="addViewRemark" class="addRemarkBtn" v-show="(this.newRemark === '' || this.newRemark === null ) && this.closeBtn === false"><i class="el-icon-circle-plus-outline" style="font-size: 20px"/></div>
<div @click="addViewRemark" class="addRemarkBtn" v-show="(this.newRemark !== null && this.newRemark !== '') && this.closeBtn === false"><i class type="el-icon-view" style="font-size: 25px"/></div>
<div @click="closeView" class="addRemarkBtn" v-show="this.closeBtn === true"><i class="el-icon-circle-close" style="font-size: 20px"/></div>
</div>
<div v-show="this.addModalState">
<el-input type="textarea" v-model.trim="newRemark" :maxlength="500" show-word-limit :autosize="{minRows: 4,maxRows: 7}" placeholder="书写笔记"></el-input>
<div class="btn">
<el-button type="primary" size="mini" @click="saveRemark('new')">提交</el-button>
</div>
</div>
</div>
</div>
</div>
</el-dialog>
<loading :loading="spinShow">数据加载中……</loading>
</div>
</template>
<script>
export default {
name: 'seeDatalis',
data () {
return {
resultModal: false,
text: '',
textcontent: '',
newItemsId: '',
oldItemsId: '',
compareId: '',
leftString: '',
newRemark: '',
rightString: '',
oldRemark: '',
addModalState: false,
leftAddModalState: false,
closeBtn: false,
leftCloseBtn: false,
spinShow: false,
tableHeight: null,
splitInfoPage: 1,
splitInfoPageSize: 10,
total: 0,
row: JSON.parse(this.$route.query.row),
standInfoList: []
}
},
methods: {
handlePreview (row) {
this.resultModal = true
this.closeBtn = false
this.leftCloseBtn = false
this.addModalState = false
this.leftAddModalState = false
this.leftString = row.oldItemsText
this.newRemark = row.newRemark
this.newItemsId = row.newItemsId
this.rightString = row.newItemsText
this.oldRemark = row.oldRemark
this.oldItemsId = row.oldItemsId
this.compareId = row.id
this.text = row.similarityDegree
if (parseFloat(row.similarityDegree) < parseFloat('75%')) {
this.textcontent = '不相似'
} else if (parseFloat(row.similarityDegree) >= parseFloat('75%') && parseFloat(row.similarityDegree) !== parseFloat('100%')) {
this.textcontent = '相似'
} else if (parseFloat(row.similarityDegree) === parseFloat('100%')) {
this.textcontent = '相同'
}
},
pageChange (page) {
this.splitInfoPage = page
this.page()
},
// 分页每页显示数改变后方法
pageSizeChange (pageSize) {
this.splitInfoPageSize = pageSize
this.page()
},
// 返回
back () {
if (this.$store.state.detailMap !== '') {
this.$router.push(this.$store.state.detailMap)
this.$store.commit('setDetailMap', '')
} else {
let lastPathList = this.$store.getters.getLastDetailMap
let lastPath = lastPathList[lastPathList.length - 1]
this.$router.push(lastPath)
lastPathList.pop(1)
this.$store.commit('setLastDetailMap', JSON.stringify(lastPathList))
}
},
page () {
this.spinShow = true
this.$http.get('lawss/sarItemsCompareHis/page', {
page: this.splitInfoPage,
pageSize: this.splitInfoPageSize,
standHisId: JSON.parse(this.$route.query.row).id
// standHisId: ''
}, {
_this: this
}, res => {
if (res.ok) {
this.standInfoList = res.data.list
this.total = res.data.count
this.spinShow = false
}
})
},
exportItemsCompareHis () {
if (this.standInfoList != null && this.standInfoList.length > 0) {
let exportName = ''
let standHisId = JSON.parse(this.$route.query.row).id
window.open('/api/lawss/sarItemsCompareHis/exportItemsCompareHis?standHisId=' + standHisId + '&exportName=' + exportName)
this.$message({
message: '导出成功',
type: 'success'
})
} else {
this.$message({
message: '当前没有比对结果数据',
type: 'warning'
})
}
},
// 添加笔记
addViewRemark () {
this.addModalState = true
this.closeBtn = true
},
closeView () {
this.closeBtn = false
this.addModalState = false
},
leftAddViewRemark () {
this.leftAddModalState = true
this.leftCloseBtn = true
},
leftCloseView () {
this.leftCloseBtn = false
this.leftAddModalState = false
},
saveRemark (type) {
if (type === 'old') {
this.$http.putData('lawss/sarItemsCompareHis/updateItemsCompareHis', {
id: this.compareId,
oldRemark: this.oldRemark
}, {
_this: this
}, res => {
this.page()
})
} else {
this.$http.putData('lawss/sarItemsCompareHis/updateItemsCompareHis', {
id: this.compareId,
newRemark: this.newRemark
}, {
_this: this
}, res => {
this.page()
})
}
}
},
components: {
},
props: {},
watch: {
},
mounted () {
this.$nextTick(() => {
this.tableHeight = $('.item-contents').height() - 20
window.onresize = function () {
this.tableHeight = $('.item-contents').height() - 20
}.bind(this)
})
this.page()
}
}
</script>
<style lang="less">
@import '~@/assets/styles/mixins';
@import '~@/assets/styles/style';
#seeDatalis{
position: relative;
background: #fff;
height: 100%;
.myheader {
height: 40px;
padding: 10px 0 0 10px;
.header-title {
font-weight: 600;
font-size: 16px;
line-height: 30px;
}
}
.item-contents{
padding: 10px;
font-size: 16px;
//height: calc(~'100% - 100px');
height: 100%;
overflow: hidden;
}
}
.back{
float: left;
vertical-align: super;
display: inline-block;
}
.standerModal{
overflow-y: auto;
padding: 0 !important;
.standerModal-content{
.content-header{
height: 50px;
font-size: 15px;
align-items: center;
line-height: 50px;
padding: 0 15px;
}
}
.content{
border-top: 1px solid #EDEDED;
min-height: 349px;
max-height: 549px;
.flex();
font-size: 15px;
.content-left{
border-right: 1px solid #EDEDED;
flex: 0 0 50%;
/*height: 100%;*/
overflow-y: auto;
line-height: 30px;
padding: 0 15px;
position: relative;
.btn{
position: absolute;
right: 15px;
}
.addRemarkBtn{
position: absolute;
bottom: 5px;
right: -8px;
/*z-index: 10;*/
}
.viewLogo{
position: absolute;
font-size: 20px;
top: 0;
right: -8px;
.ivu-icon{
color: #3391CE;
}
}
}
.content-right{
flex: 0 0 50%;
/*height: 100%;*/
overflow-y: auto;
line-height: 30px;
padding: 0 15px;
position: relative;
.btn{
position: absolute;
right: 15px;
}
.addRemarkBtn{
position: absolute;
bottom: 5px;
right: -8px;
/*z-index: 10;*/
}
.viewLogo{
position: absolute;
font-size: 20px;
top: 0;
right: -8px;
.ivu-icon{
color: #3391CE;
}
}
}
}
}
</style>
@@ -0,0 +1,759 @@
<!--全文对比-->
<template>
<div id="textComparison">
<div class="item-header">
<div class="action-bar title-option">
<div class="contentTitle">
<div class="back" title="返回" @click="back" >
<i class="el-icon-back"></i>
</div>
</div>
<div class="stander-title">全文比对
<el-button v-if="flag === '查看'" type="primary" size="mini" @click="exportItemsCompareHis" class="searchAngNewBtn importBtn" style="margin-left: 20px;padding-bottom: 10px;" v-btn-permission="'5BXYKLVAQ3AXT2PK7PJC'">导出比对结果</el-button>
</div>
</div>
</div>
<div class="item-contents">
<div class="contents-left">
<div class="stander-title-item">{{rowDataLeft.standNameSplit === null ? rowDataLeft.standName : rowDataLeft.standNameSplit}} -- {{rowDataLeft.standNumSplit === null ? rowDataLeft.showNumber : rowDataLeft.standNumSplit}}
<!-- <el-button v-if="flag === '查看' && !leftShowAllFlag" size="small" type="default" @click="showAllRemark('left')" style="margin-left: 10px">显示全部笔记</el-button>-->
<!-- <el-button v-if="flag === '查看' && leftShowAllFlag" size="small" type="default" @click="hideAllRemark('left')" style="margin-left: 10px">隐藏全部笔记</el-button>-->
<br><span v-if="leftName !==''">{{leftName}}</span>
<span v-if="leftName !== '' || rightName !== ''">相似度:<span style="color: red">{{text}}</span> ({{textcontent}})</span>
</div>
<div id="contentLeft">
<div class="wrap-left">
<laws-tree
:zNodes="leftZNodes"
ref="reloadTree"
:editable="false"
treeDivId="domesticTree1"
deptSelect
@treeClick="handleLeftTreeClick"
class="ztree">
</laws-tree>
</div>
<div class="wrap-right">
<div :id="'left_'+ (item.menuId ? item.menuId : item.id)" v-for="(item, index) in resLeftMapList" :key="index">
<div class="children" @click="childrenClick(1, item, index)">
<div class="viewLogo" v-show="flag === '查看' && item.remark !== null && item.remark !== ''"><i class="el-icon-star-on" /></div>
<div>{{item.itemsNum}} {{item.itemsName}}</div>
<div v-html="item.itemsText" :id="'itemsLeftText_' + item.itemsId"></div>
<div @click="addViewRemark(item)" class="addRemarkBtn" v-show="flag === '查看' && item.remark === null && item.closeBtn === false"><i class="el-icon-circle-plus-outline" style="font-size: 20px"/></div>
<div @click="addViewRemark(item)" class="addRemarkBtn" v-show="flag === '查看' && item.remark !== null && item.closeBtn === false"><i class="el-icon-view" style="font-size: 25px"/></div>
<div @click="closeView(item)" class="addRemarkBtn" v-show="flag === '查看' && item.closeBtn === true"><i class="el-icon-circle-close" style="font-size: 20px"/></div>
</div>
<div v-show="item.addModalState" :id="'remarksLeft_' +item.itemsId">
<el-input type="textarea" v-model.trim="item.remark" :maxlength="500" show-word-limit :autosize="{minRows: 4,maxRows: 7}" placeholder="书写笔记"></el-input>
<div style="text-align: right;margin: 10px 0">
<el-button type="primary" size="mini" @click="modalSave(item)">提交</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="contents-right">
<div class="stander-title-item">{{rowDataRight.standNameSplit === null ? rowDataRight.standName : rowDataRight.standNameSplit}} -- {{rowDataRight.standNumSplit === null ? rowDataRight.showNumber : rowDataRight.standNumSplit}}
<!-- <el-button v-if="flag === '查看' && !rightShowAllFlag" size="small" type="default" @click="showAllRemark('right')" style="margin-left: 10px">显示全部笔记</el-button>-->
<!-- <el-button v-if="flag === '查看' && rightShowAllFlag" size="small" type="default" @click="hideAllRemark('right')" style="margin-left: 10px">隐藏全部笔记</el-button>-->
<br><span v-if="rightName !== ''">{{rightName}}</span>
<span v-if="leftName !== '' || rightName !== ''">相似度:<span style="color: red">{{text}}</span> ({{textcontent}})</span>
</div>
<div id="contentRight">
<div class="wrap-left">
<laws-tree
:zNodes="rightZNodes"
ref="reloadTree"
:editable="false"
treeDivId="domesticTree2"
deptSelect
@treeClick="handleRightTreeClick"
class="ztree">
</laws-tree>
</div>
<div class="wrap-right">
<div :id="'right_'+ (item.menuId ? item.menuId : item.id)" v-for="(item, index) in resRightMapList" :key="index">
<div class="children" @click="childrenClick(2, item, index)">
<div>{{item.itemsNum}} {{item.itemsName}}</div>
<div class="viewLogo" v-show="flag === '查看' && item.remark !== null && item.remark !== ''"><i class="el-icon-star-on" /></div>
<div v-html="item.itemsText" :id="'itemsRightText_' + item.itemsId"></div>
<div @click="addViewRemark(item)" class="addRemarkBtn" v-show="flag === '查看' && item.remark === null && item.closeBtn === false"><i class="el-icon-circle-plus-outline" style="font-size: 20px"/></div>
<div @click="addViewRemark(item)" class="addRemarkBtn" v-show="flag === '查看' && item.remark !== null && item.closeBtn === false"><i class="el-icon-view" style="font-size: 25px"/></div>
<div @click="closeView(item)" class="addRemarkBtn" v-show="flag === '查看' && item.closeBtn === true"><i class="el-icon-circle-close" style="font-size: 20px"/></div>
</div>
<div v-show="item.addModalState" :id="'remarksRight_' +item.itemsId">
<el-input type="textarea" v-model.trim="item.remark" :maxlength="500" show-word-limit :autosize="{minRows: 4,maxRows: 7}" placeholder="书写笔记"></el-input>
<div style="text-align: right;margin: 10px 0">
<el-button type="primary" size="mini" @click="modalSave(item)">提交</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<el-dialog :visible.sync="resultModal" title="比对结果" width="80%" class="standerModal">
<div class="standerModal-content">
<div class="content-header">
相似度:<span style="color: red">{{text}}</span> ({{textcontent}})
</div>
<div class="content">
<div class="content-left">
<div v-for="(item,index) in leftString" v-html="item" :key="index"></div>
</div>
<div class="content-right">
<div v-for="(item,index) in rightString" v-html="item" :key="index"></div>
</div>
</div>
</div>
</el-dialog>
<loading :loading="spinShow">数据加载中……</loading>
</div>
</template>
<script>
export default {
name: 'textComparison',
data () {
return {
itemLeftIndex: '',
itemRightIndex: '',
leftName: '',
rightName: '',
text: '',
textcontent: '',
resultModal: false,
resLeftMapList: [],
spinShow: false,
rowDataLeft: JSON.parse(this.$route.query.rowDataLeft),
rowDataRight: JSON.parse(this.$route.query.rowDataRight),
resRightMapList: [],
saveItemId: '',
saveItemIdRight: '',
leftString: '',
rightString: '',
oldLeftId: '',
oldRightId: '',
oldLeftContent: '',
oldRightContent: '',
leftShowAllFlag: false,
rightShowAllFlag: false,
flag: '',
leftZNodes: [],
rightZNodes: []
}
},
methods: {
comparisonClick () {
if (this.saveItemId === '' && this.saveItemIdRight === '') {
return this.$Message.warning('请选择比对的条款内容')
}
if (this.saveItemId === '' || this.saveItemIdRight === '') {
return this.$Message.warning('暂无找到相似的文本')
}
this.spinShow = true
let itemsEoPage = {
oldItemId: this.saveItemId,
newItemId: this.saveItemIdRight
}
this.$http.post('lawss/sarStandCompareHis/clauseComparison', itemsEoPage, {
_this: this
}, res => {
this.oldLeftId = '#left_' + this.saveItemId
this.oldRightId = '#right_' + this.saveItemIdRight
this.oldLeftContent = $('#itemsLeftText_' + this.saveItemId).html()
this.oldRightContent = $('#itemsRightText_' + this.saveItemIdRight).html()
$('#left_' + this.saveItemId).find('#itemsLeftText_' + this.saveItemId).html(res.data.leftString)
$('#right_' + this.saveItemIdRight).find('#itemsRightText_' + this.saveItemIdRight).html(res.data.rightString)
this.text = res.data.similarityDegree
if (parseFloat(res.data.similarityDegree) >= parseFloat('75%') && parseFloat(res.data.similarityDegree) !== parseFloat('100%')) {
this.textcontent = '相似'
} else if (parseFloat(res.data.similarityDegree) === parseFloat('100%')) {
this.textcontent = '相同'
} else if (parseFloat(res.data.similarityDegree) < parseFloat('75%')) {
this.textcontent = '不相似'
}
// this.resultModal = true
this.spinShow = false
}, e => {
})
},
// 添加笔记
addViewRemark (item) {
item.addModalState = true
item.closeBtn = true
},
closeView (item) {
if (item.remark !== item.oldRemark) {
this.$Modal.confirm({
title: '提示',
content: '<p>笔记内容有修改,是否保存?</p>',
onOk: () => {
this.modalSave(item)
item.closeBtn = false
item.addModalState = false
},
onCancel: () => {
item.closeBtn = false
item.addModalState = false
}
})
} else {
item.closeBtn = false
item.addModalState = false
}
},
/**
* 提交笔记 事件
* @param item
* 根据noteId 判断 有值走update 无值走新增
* 走updata时判断是否笔记内容修改为空,修改为空则走删除接口
*/
modalSave (item) {
this.$http.putData('lawss/sarStandItemsCompareHis/updateCompareItems', {
remark: item.remark,
id: item.id
}, {
_this: this
}, res => {
item.oldRemark = item.remark
})
},
childrenClick (flag, item, index) {
this.text = ''
this.textcontent = ''
this.leftName = ''
this.rightName = ''
if (flag === 1) {
if (this.oldLeftId !== '') {
$(this.oldLeftId).find('#itemsLeftText_' + this.saveItemId).html(this.oldLeftContent)
$(this.oldRightId).find('#itemsRightText_' + this.saveItemIdRight).html(this.oldRightContent)
}
this.saveItemId = item.itemsId
this.itemLeftIndex = index
let mainContainerLeft = $('#contentLeft')
$('#contentLeft .children').css('border', '2px solid #EDEDED')
let scrollToContainerLeft = mainContainerLeft.find(`.children:eq(${index})`)
scrollToContainerLeft.css('border', '2px solid #3391CE')
let mainContainer = $('#contentRight')
$('#contentRight .children').css('border', '2px solid #EDEDED')
if (item.targetStand === null) {
return false
}
this.leftName = item.itemsNum + ' ' + item.itemsName
this.saveItemIdRight = this.resRightMapList[item.targetStand].itemsId
let scrollToContainer = mainContainer.find(`.children:eq(${item.targetStand})`)
this.rightName = scrollToContainer.children(':first').html()
scrollToContainer.css('border', '2px solid red')
// 非动画效果
// mainContainer.scrollTop(
// scrollToContainer.offset().top - mainContainer.offset().top + mainContainer.scrollTop()
// );
// 动画效果
mainContainer.animate({
scrollTop: scrollToContainer.offset().top - mainContainer.offset().top + mainContainer.scrollTop()
})// 2秒滑动到指定位置
} else {
if (this.oldLeftId !== '') {
$(this.oldLeftId).find('#itemsLeftText_' + this.saveItemId).html(this.oldLeftContent)
$(this.oldRightId).find('#itemsRightText_' + this.saveItemIdRight).html(this.oldRightContent)
}
this.saveItemIdRight = item.itemsId
this.itemRightIndex = index
let mainContainerLeft = $('#contentRight')
$('#contentRight .children').css('border', '2px solid #EDEDED')
let scrollToContainerRight = mainContainerLeft.find(`.children:eq(${index})`)
scrollToContainerRight.css('border', '2px solid #3391CE')
let mainContainer = $('#contentLeft')
$('#contentLeft .children').css('border', '2px solid #EDEDED')
if (item.targetStand === null) {
return false
}
this.rightName = item.itemsNum + ' ' + item.itemsName
this.saveItemId = this.resLeftMapList[item.targetStand].itemsId
let scrollToContainer = mainContainer.find(`.children:eq(${item.targetStand})`)// 滚动到<div id="thisMainPanel">中类名为son-panel的第六个处
this.leftName = scrollToContainer.children('div:nth-child(2)').html()
scrollToContainer.css('border', '2px solid red')
// 非动画效果
// mainContainer.scrollTop(
// scrollToContainer.offset().top - mainContainer.offset().top + mainContainer.scrollTop()
// );
// 动画效果
mainContainer.animate({
scrollTop: scrollToContainer.offset().top - mainContainer.offset().top + mainContainer.scrollTop()
})// 2秒滑动到指定位置
}
this.comparisonClick()
},
// 返回
back () {
if (this.$store.state.detailMap !== '') {
this.$router.push(this.$store.state.detailMap)
this.$store.commit('setDetailMap', '')
} else {
let lastPathList = this.$store.getters.getLastDetailMap
let lastPath = lastPathList[lastPathList.length - 1]
this.$router.push(lastPath)
lastPathList.pop(1)
this.$store.commit('setLastDetailMap', JSON.stringify(lastPathList))
}
},
getStandItemsCompareHisListLeft () {
this.spinShow = true
this.$http.get('lawss/sarStandItemsCompareHis/getStandItemsCompareHisList', {
standHisId: this.$route.query.id,
leftOrRight: 'LEFT'
}, {
_this: this
}, res => {
this.resLeftMapList = res.data
this.resLeftMapList.map((item) => {
this.$set(item, 'addModalState', false)
this.$set(item, 'closeBtn', false)
this.$set(item, 'oldRemark', item.remark)
})
if (res.data.length !== 0) {
let cur = res.data
let str = []
let option = {}
for (var i = 0; i < cur.length; i++) {
option = { id: cur[i].id,
pId: cur[i].pid,
name: cur[i].itemsNum + ' ' + cur[i].itemsName,
number: cur[i].name,
itemName: cur[i].itemName != null ? cur[i].itemName : '',
displaySeq: cur[i].displaySeq,
remarks: cur[i].remarks}
str.push(option)
this.leftZNodes = str
}
}
this.spinShow = false
}, e => {
})
},
getStandItemsCompareHisListRight () {
this.spinShow = true
this.$http.get('lawss/sarStandItemsCompareHis/getStandItemsCompareHisList', {
standHisId: this.$route.query.id,
leftOrRight: 'RIGHT'
}, {
_this: this
}, res => {
this.resRightMapList = res.data
this.resRightMapList.map((item) => {
this.$set(item, 'addModalState', false)
this.$set(item, 'closeBtn', false)
this.$set(item, 'oldRemark', item.remark)
})
if (res.data.length !== 0) {
let cur = res.data
let str = []
let option = {}
for (var i = 0; i < cur.length; i++) {
option = { id: cur[i].id,
pId: cur[i].pid,
name: cur[i].itemsNum + ' ' + cur[i].itemsName,
number: cur[i].name,
itemName: cur[i].itemName != null ? cur[i].itemName : '',
displaySeq: cur[i].displaySeq,
remarks: cur[i].remarks}
str.push(option)
this.rightZNodes = str
}
}
this.spinShow = false
}, e => {
})
},
fullTextComparison () {
return new Promise((resolve, reject) => {
this.spinShow = true
this.$http.post('lawss/sarStandCompareHis/fullTextComparison', {
leftStandard: this.$route.query.infoIdLeft,
rightStandard: this.$route.query.infoIdRight
}, {
_this: this
}, res => {
this.resLeftMapList = res.data.resLeftMapList
this.resRightMapList = res.data.resRightMapList
this.spinShow = false
resolve(res.data)
}, e => {
})
})
},
exportItemsCompareHis () {
let exportName = ''
let standHisId = this.$route.query.id
window.open('/api/lawss/sarStandItemsCompareHis/exportItemsCompareHis?standHisId=' + standHisId + '&exportName=' + exportName)
this.$Message.info('导出成功')
},
showAllRemark (type) {
let showList = []
if (type === 'left') {
this.leftShowAllFlag = !this.leftShowAllFlag
showList = this.resLeftMapList
} else {
this.rightShowAllFlag = !this.rightShowAllFlag
showList = this.resRightMapList
}
if (showList != null && showList.length > 0) {
for (let i = 0; i < showList.length; i++) {
if (showList[i].remark != null && showList[i].remark !== '') {
showList[i].closeBtn = true
showList[i].addModalState = true
}
}
}
if (type === 'left') {
this.resLeftMapList = showList
} else {
this.resRightMapList = showList
}
},
hideAllRemark (type) {
let showList = []
if (type === 'left') {
this.leftShowAllFlag = !this.leftShowAllFlag
showList = this.resLeftMapList
} else {
this.rightShowAllFlag = !this.rightShowAllFlag
showList = this.resRightMapList
}
if (showList != null && showList.length > 0) {
for (let i = 0; i < showList.length; i++) {
if (showList[i].remark != null && showList[i].remark !== '') {
showList[i].closeBtn = false
showList[i].addModalState = false
}
}
}
if (type === 'left') {
this.resLeftMapList = showList
} else {
this.resRightMapList = showList
}
},
getSplitItemsByPage (leftId, rightId) {
const p1 = new Promise((resolve, reject) => {
this.$http.get('lawss/sarFileSplitMenu/getSplitMenusByInfoId', {
infoId: leftId
}, {
_this: this
}, res => {
if (res.data.length !== 0) {
let cur = res.data
let str = []
let option = {}
for (var i = 0; i < cur.length; i++) {
option = { id: cur[i].id,
pId: cur[i].pid,
name: cur[i].name + ' ' + (cur[i].itemName != null ? cur[i].itemName : ''),
number: cur[i].name,
itemName: cur[i].itemName != null ? cur[i].itemName : '',
displaySeq: cur[i].displaySeq,
remarks: cur[i].remarks}
str.push(option)
this.leftZNodes = str
}
}
}, e => {
})
})
const p2 = new Promise((resolve, reject) => {
this.$http.get('lawss/sarFileSplitMenu/getSplitMenusByInfoId', {
infoId: rightId
}, {
_this: this
}, res => {
if (res.data.length !== 0) {
let cur = res.data
let str = []
let option = {}
for (var i = 0; i < cur.length; i++) {
option = { id: cur[i].id,
pId: cur[i].pid,
name: cur[i].name + ' ' + (cur[i].itemName != null ? cur[i].itemName : ''),
number: cur[i].name,
itemName: cur[i].itemName != null ? cur[i].itemName : '',
displaySeq: cur[i].displaySeq,
remarks: cur[i].remarks}
str.push(option)
this.rightZNodes = str
}
}
}, e => {
})
})
},
handleLeftTreeClick(treeId, treeNode) {
const domId = `left_${treeNode.id}`
function getElementTop(element) {
var el = (typeof element == "string") ? document.getElementById(element) : element;
if (el.parentNode === null || el.style.display == 'none') {
return false;
}
return el.offsetTop - el.parentNode.offsetTop;
}
const offsetTop = getElementTop(domId)
/*$('#contentLeft').children('.wrap-right').animate({scrollTop: offsetTop},500)*/
},
handleRightTreeClick(treeId, treeNode) {
const domId = `right_${treeNode.id}`
function getElementTop(element) {
var el = (typeof element == "string") ? document.getElementById(element) : element;
if (el.parentNode === null || el.style.display == 'none') {
return false;
}
return el.offsetTop - el.parentNode.offsetTop;
}
const offsetTop = getElementTop(domId)
/*$('#contentRight').children('.wrap-right').animate({scrollTop: offsetTop},500)*/
}
},
components: {
},
props: {},
watch: {
itemRightIndex: {
deep: true,
handler (newVal, oldVal) {
if (oldVal !== '') {
this.resRightMapList[oldVal].addModalState = false
this.resRightMapList[oldVal].closeBtn = false
}
}
},
itemLeftIndex: {
deep: true,
handler (newVal, oldVal) {
if (oldVal !== '') {
this.resLeftMapList[oldVal].addModalState = false
this.resLeftMapList[oldVal].closeBtn = false
}
}
}
},
mounted () {
this.flag = this.$route.query.flag
if (this.flag === '查看') {
this.getStandItemsCompareHisListLeft()
this.getStandItemsCompareHisListRight()
return false
}
this.fullTextComparison()
this.getSplitItemsByPage(this.$route.query.infoIdLeft, this.$route.query.infoIdRight)
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
@import '~@/assets/styles/style';
#textComparison{
position: relative;
height: 100%;
background: #fff;
.item-header{
height: 50px;
padding: 10px;
//border-bottom: 1px solid #EDEDED;
.action-bar{
padding: 0;
border-top: 0;
}
.title-option{
line-height: 30px;
}
.importBtn{
padding-bottom: 7px !important;
}
.stander-title-item{
padding: 5px 10px;
font-weight: 600;
font-size: 16px;
}
button{
//padding-top: 5px;
}
.stander-title{
padding: 0px 10px;
font-weight: 600;
font-size: 16px;
}
}
.item-contents{
padding: 0;
.flex();
height: calc(~'100% - 50px');
border-bottom: 1px solid #EDEDED;
.stander-title-item{
height: 50px;
font-size: 16px;
}
.contents-left{
flex: 0 0 49%;
border-right: 1px solid #EDEDED;
height: 100%;
padding: 15px;
#contentLeft {
height: calc(~'100% - 50px');
overflow-y: auto;
line-height: 30px;
display: flex;
.children {
border: 2px solid #EDEDED;
padding: 5px;
cursor: pointer;
font-size: 16px;
border-radius: 9px;
margin-bottom: 10px;
position: relative;
&:hover{
box-shadow: 0 1px 13px 0 #DDD;
}
.addRemarkBtn{
position: absolute;
bottom: 5px;
right: 5px;
/*z-index: 10;*/
}
.viewLogo{
position: absolute;
font-size: 20px;
top: 0;
right: 5px;
.ivu-icon{
color: #3391CE;
}
}
}
}
}
.contents-right{
flex: 0 0 49%;
height: 100%;
padding: 15px;
#contentRight{
height: calc(~'100% - 50px');
overflow-y: auto;
line-height: 30px;
display: flex;
.children {
border: 2px solid #EDEDED;
padding: 5px;
cursor: pointer;
font-size: 16px;
border-radius: 9px;
margin-bottom: 10px;
position: relative;
&:hover{
box-shadow: 0 1px 13px 0 #DDD;
}
.addRemarkBtn{
position: absolute;
bottom: 5px;
right: 5px;
/*z-index: 10;*/
}
.viewLogo{
position: absolute;
font-size: 20px;
top: 0;
right: 5px;
.ivu-icon{
color: #3391CE;
}
}
}
}
}
}
.item-bottom{
height: 70px;
border-top: 1px solid #EDEDED;
.flex();
justify-content: flex-end;
align-items: center;
padding-right: 15px;
}
}
.back{
float: left;
vertical-align: super;
display: inline-block;
}
.standerModal{
.ivu-modal-body{
min-height: 400px;
max-height: 500px;
overflow-y: auto;
padding: 0 !important;
.standerModal-content{
.content-header{
height: 50px;
font-size: 15px;
align-items: center;
line-height: 50px;
padding: 0 15px;
}
}
.content{
border-top: 1px solid #EDEDED;
min-height: 349px;
max-height: 549px;
.flex();
font-size: 15px;
.content-left{
border-right: 1px solid #EDEDED;
flex: 0 0 50%;
height: 100%;
line-height: 30px;
padding: 0 15px;
}
.content-right{
flex: 0 0 50%;
height: 100%;
line-height: 30px;
padding: 0 15px;
}
}
}
}
.wrap-left,
.wrap-right {
height: 100%;
}
.wrap-left {
width: 200px;
border: 1px solid #ddd;
border-radius: 4px;
margin-right: 10px;
}
.wrap-right {
flex: 1;
overflow-y: auto;
}
</style>
@@ -0,0 +1,806 @@
<!--标准内容自动识别-->
<template>
<div class="standardRecognition">
<div class="action-bar">
<div slot="left">
<!-- <el-button type="primary" @click="changeData">转化</Button>-->
<el-button size="mini" round @click="uploadPdf" v-btn-permission="'MFQVKD5T76BL5VVZC3U2'"
><i class="iconfont">&#xe65d;</i>上传</el-button
>
<el-button size="mini" round @click="delData" v-btn-permission="'QJ2GMGUUE5ZZ9PL37BHM'"
><i class="iconfont">&#xe61b;</i>删除</el-button
>
</div>
</div>
<div class="content">
<div style="position: absolute; height: 100%; width: calc(100% - 20px)">
<el-table
border
:data="standRecoList"
style="width: 100%"
height="100%"
@selection-change="standSelectChange"
:header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }"
>
<el-table-column type="selection" align="center" width="50">
</el-table-column>
<el-table-column
prop="name"
:label="this.$t('m.serialNumber')"
type="index"
width="50"
align="center"
>
</el-table-column>
<el-table-column
prop="fileType"
:label="this.$t('m.dataType')"
align="center"
width="150"
>
<template slot-scope="scope">
{{
scope.row.fileType === "1"
? "国内标准法规"
: scope.row.fileType === "2"
? "海外标准法规"
: scope.row.fileType === "3"
? "政策"
: scope.row.fileType === "4"
? "企业标准"
: "标准"
}}
<!-- {{ scope.row.fileType === '标准' }}-->
</template>
</el-table-column>
<el-table-column
prop="standNumber"
:label="this.$t('m.standardNumberAndPolicyNumber')"
align="center"
>
</el-table-column>
<el-table-column
prop="standName"
:label="this.$t('m.standardNameAndPolicyName')"
align="center"
>
</el-table-column>
<el-table-column :label="this.$t('m.textState')" width="150" align="center">
<template slot-scope="scope">
{{
scope.row.fileType === "STAND_FILE"
? "标准文本"
: scope.row.fileType === "DRAFT_FILE"
? "草案"
: scope.row.fileType === "OPINION_FILE"
? "征求意见稿"
: scope.row.fileType === "SENT_SCREEN_FILE"
? "送审稿"
: scope.row.fileType === "APPROVAL_FILE"
? "报批稿"
: "关联文件"
}}
</template>
</el-table-column>
<el-table-column
prop="resultContent"
:label="this.$t('m.conversionResults')"
align="center"
width="120"
>
<template slot-scope="scope">
<el-tag :type="scope.row.resultContent === '转换成功' ? 'success' : (scope.row.resultContent === '转换中' ? undefined : 'danger')" size="small">{{ scope.row.resultContent }}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="spendTime"
:label="this.$t('m.timeConsuming')"
align="center"
sortable
width="120"
>
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="[scope.row, '获取文件']" v-btn-permission="'RFGHJXQLEBEC37EWCPMQ'"
>获取文件</el-dropdown-item
>
<el-dropdown-item :command="[scope.row, '编辑']" v-btn-permission="'4ZCETHNBRFJQH8J8Q3Y5'"
>编辑</el-dropdown-item
>
<el-dropdown-item :command="[scope.row, '删除']" v-btn-permission="'QJ2GMGUUE5ZZ9PL37BHM'"
>删除</el-dropdown-item
>
<el-dropdown-item :command="[scope.row, '在线编辑']" v-btn-permission="'M93G5FCWKBBPU8GMQ4EF'"
>在线编辑</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
<loading :loading="loading">正在获取中……</loading>
<pagination
:total="total"
:pageChange="page"
:pageSizeChange="pageSize"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"
></pagination>
<el-dialog
:visible.sync="uploadModal"
:title="title"
:label-width="100"
width="525px"
:before-close="cancel"
>
<el-form
:model="uploadFilesdfEo"
class="label-input-form"
ref="uploadFilesdfEo"
:rules="upFileRules"
>
<el-form-item label="文件" label-width="145px" prop="fileName">
<el-upload
:limit="1"
:on-exceed="uploadNum"
show-upload-list
:show-file-list="showUploadlist"
:on-success="uploadSuccess"
:on-remove="removeOneFile"
:action="uploadPath"
:default-file-list="defaultFileList"
:format="['pdf', 'PDF']"
:before-upload="beforeUpload"
name="file"
ref="importFileAboutStand"
>
<el-button
type="primary"
class="common-button-primary"
round
>{{ $t("m.upload")+' PDF'}}</el-button
>
</el-upload>
</el-form-item>
<el-form-item
label="标准号/政策号"
prop="standNumber"
label-width="145px"
>
<el-input
class="bead-input"
v-model="uploadFilesdfEo.standNumber"
:placeholder="$t('m.pleaseEnterTheStandardNumberAndPolicyNumber')"
></el-input>
</el-form-item>
<el-form-item
label="标准名称/政策名称"
prop="standName"
label-width="145px"
>
<el-input
class="bead-input"
v-model="uploadFilesdfEo.standName"
:placeholder="$t('m.pleaseEnterTheStandardNameAndPolicyName')"
></el-input>
</el-form-item>
<el-form-item label="文本状态" prop="fileType" label-width="145px">
<el-select class="bead-input" v-model="uploadFilesdfEo.fileType">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer">
<el-button size="mini" round @click="cancel" icon="el-icon-close"
>取消</el-button
>
<el-button
size="mini"
icon="el-icon-check"
round
class="common-button-primary add-button"
@click="uploadSave"
type="primary"
:loading="isSubmit"
>{{ btnName }}</el-button
>
<!-- <el-button @click="uploadSave" type="primary">转换</Button>-->
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "StandardRecognition",
components: {},
data() {
return {
tableHeight: null,
loading: false,
uploadModal: false,
title: "",
total: 0,
page: 1,
pageSize: 10,
// uploadPath: '/api/ocr/OCRRestful/upload',
uploadPath: "api/att/attFile/upload",
defaultFileList: [],
// 记录上传文件相关信息
uploadFilesdfEo: {
standNumber: "",
standName: "",
fileType: "",
attId: "",
fileName: "",
// standId: ''
},
upFileRules: {
standNumber: [
{ required: true, message: "标准号/政策号不能为空", trigger: "blur" },
],
standName: [
{
required: true,
message: "标准名称/政策名称不能为空",
trigger: "blur",
},
],
fileType: [
{ required: true, message: "文本状态称不能为空", trigger: "blur" },
],
fileName: [
{ required: true, message: '文件不能为空', trigger: 'blur' }
]
},
options: [
{
value: "STAND_FILE",
label: "标准文本",
},
{
value: "DRAFT_FILE",
label: "草案",
},
{
value: "OPINION_FILE",
label: "征求意见稿",
},
{
value: "SENT_SCREEN_FILE",
label: "送审稿",
},
{
value: "APPROVAL_FILE",
label: "报批稿",
},
{
value: "RELEVANCE_FILE",
label: "关联文件",
},
],
// standRecoColumn: [
// {
// type: 'selection',
// width: 60,
// align: 'center'
// },
// {
// title: '序号',
// type: 'index',
// align: 'center'
// },
// {
// title: '资料类型',
// key: 'fileType',
// align: 'center',
// render: (h, params) => {
// let texts
// if (params.row.fileType === '1') {
// texts = '国内标准法规'
// } else if (params.row.fileType === '2') {
// texts = '海外标准法规'
// } else if (params.row.fileType === '3') {
// texts = '政策'
// } else if (params.row.fileType === '4') {
// texts = '企业标准'
// } else {
// texts = '标准'
// }
// return h('div', {
// class: {
// 'text-overflow-hidden': true
// },
// attrs: {
// title: texts
// }
// }, texts)
// }
// },
// {
// title: '标准号/政策号',
// key: 'standNumber',
// align: 'center'
// },
// {
// title: '标准名称/政策名称',
// key: 'standName',
// align: 'center'
// },
// {
// title: '文本状态',
// key: 'fileStatus',
// align: 'center',
// render: (h, params) => {
// let texts
// if (params.row.fileType === 'STAND_FILE') {
// texts = '标准文本'
// } else if (params.row.fileType === 'DRAFT_FILE') {
// texts = '草案'
// } else if (params.row.fileType === 'OPINION_FILE') {
// texts = '征求意见稿'
// } else if (params.row.fileType === 'SENT_SCREEN_FILE') {
// texts = '送审稿'
// } else if (params.row.fileType === 'APPROVAL_FILE') {
// texts = '报批稿'
// } else if (params.row.fileType === 'RELEVANCE_FILE') {
// texts = '关联文件'
// }
// return h('div', {
// class: {
// 'text-overflow-hidden': true
// },
// attrs: {
// title: texts
// }
// }, texts)
// }
// },
// {
// title: '转换结果',
// key: 'resultContent',
// align: 'center'
// },
// {
// title: '消耗时间',
// key: 'spendTime',
// align: 'center'
// },
// {
// title: '操作',
// key: 'action',
// width: 200,
// align: 'center',
// render: (h, params) => {
// return h('div', [
// h('Button', {
// props: {
// type: 'primary',
// size: 'small'
// },
// style: {
// marginRight: '5px'
// },
// on: {
// click: () => {
// this.downloadFile(params.row)
// }
// }
// }, '获取文件'),
// h('Button', {
// props: {
// type: 'warning',
// size: 'small'
// },
// style: {
// marginRight: '5px'
// },
// on: {
// click: () => {
// this.editOcrRecord(params.row)
// }
// }
// }, '编辑'),
// h('Dropdown', {
// props: {
// trigger: 'click'
// },
// on: {
// 'on-click': (value) => {}
// }
// }, [
// h('Button', {
// props: {
// type: 'primary',
// size: 'small'
// }
// }, '更多'),
// h('DropdownMenu', {
// slot: 'list'
// },
// this.dropdownItems.map(function (type) {
// return h('DropdownItem', {
// props: {
// name: type.val
// }
// }, type.val)
// })
// )
// ])
// ])
// }
// }
// ],
modalType: "",
standRecoList: [],
selectTableData: [],
dropdownItems: [
{ val: "收藏" },
{ val: "分享" },
{ val: "关联" },
{ val: "删除" },
],
btnName: "",
isSubmit: false,
showUploadlist: true, // 导入过程中新增数据时,如果数据报错,不出现导入列表
collect: "收藏",
};
},
props: {},
watch: {},
methods: {
handleCommand(command) {
switch (command[1]) {
case "获取文件":
this.downloadFile(command[0]);
break;
case "编辑":
this.editOcrRecord(command[0], "edit");
break;
case "删除":
this.delSingalData(command[0]);
break;
case "在线编辑":
this.downloadFile(command[0]);
break;
}
},
// 修改成表格样式后,选择项勾选改变
standSelectChange(data) {
this.selectTableData = [];
for (let i = 0; i < data.length; i++) {
this.selectTableData.push(data[i].id);
}
},
// 上传
uploadNum() {
this.$message({
message: '最多只能上传一份',
type: 'warning'
})
},
uploadPdf() {
this.modalType = "1";
this.title = "上传文件";
this.uploadModal = true;
this.btnName = "转换";
this.defaultFileList = [];
},
uploadSuccess(res, file, fileList) {
if (res.ok) {
// this.uploadFilesdfEo.id = res.data
this.uploadFilesdfEo.attId = res.data.id;
if (res.data.standNum != null && res.data.standNum !== "") {
this.uploadFilesdfEo.standNumber = res.data.standNum;
}
if (res.data.standName != null && res.data.standName !== "") {
this.uploadFilesdfEo.standName = res.data.standName;
}
// this.uploadFilesdfEo.fileName = res.data.name
// this.getTableData()
this.defaultFileList.push(file);
this.$message({
message: "文件上传成功",
type: "success",
});
// this.$refs['uploadFilesdfEo'].resetFields()
} else {
this.defaultFileList = [];
this.uploadFilesdfEo.attId = "";
this.$message.error(res.message);
fileList.pop();
}
},
removeOneFile(file, fileList) {
this.defaultFileList = [];
this.uploadFilesdfEo.attId = "";
},
beforeUpload(file) {
var filename = file.name;
var index1 = filename.lastIndexOf(".");
var index2 = filename.length;
var fileSuffix = filename.substring(index1, index2);
// const fileSuffix = file.name.split('.')[1] // 后缀名
// 判断上传文件格式
if (
fileSuffix === ".pdf" ||
fileSuffix === ".PDF"
) {
return true;
} else {
this.$message.error(
"文件" +
file.name +
"格式不正确,请上传pdf文件"
);
return false;
}
// 判断文件上传大小
// eslint-disable-next-line no-unreachable
if (file.size / 1024 / 1024 <= 200) {
return true;
} else {
this.$message.error("文件" + file.name + "大小不超过200M");
return false;
}
return true;
},
cancel() {
this.uploadFilesdfEo = {
standNumber: "",
standName: "",
fileType: "",
attId: "",
fileName: "",
}
this.defaultFileList = []
this.uploadModal = false;
this.$refs["importFileAboutStand"].clearFiles();
},
// 编辑
editOcrRecord(row) {
this.modalType = "2";
this.title = "编辑信息";
this.btnName = "保存";
this.uploadModal = true;
this.uploadFilesdfEo.standNumber = JSON.parse(
JSON.stringify(row)
).standNumber;
this.uploadFilesdfEo.standName = JSON.parse(
JSON.stringify(row)
).standName;
// this.uploadFilesdfEo.fileType = JSON.parse(JSON.stringify(row)).fileType
this.options.map((item) => {
if (item.value === JSON.parse(JSON.stringify(row)).fileType) {
this.uploadFilesdfEo.fileType = item.label;
}
});
this.uploadFilesdfEo.id = JSON.parse(JSON.stringify(row)).id;
this.uploadFilesdfEo.attId = "";
this.defaultFileList = [];
},
// 提交
uploadSave() {
this.$refs["uploadFilesdfEo"].validate((valid) => {
if (valid) {
if (this.modalType === "1") {
if (
this.uploadFilesdfEo.attId != null &&
this.uploadFilesdfEo.attId !== ""
) {
this.isSubmit = true;
this.uploadFilesdfEo.fileType = this.uploadFilesdfEo.fileType.toString();
this.$http.post(
"ocr/OCRRestful/addOcrRecord",
this.uploadFilesdfEo,
{
_this: this,
},
(res) => {
if (res.ok) {
this.isSubmit = false;
this.uploadModal = false;
this.getTableData();
} else {
this.isSubmit = false;
}
},
(e) => {
this.isSubmit = false;
}
);
} else {
this.$message.warning("转换文件不能为空");
}
} else if (this.modalType === "2") {
this.isSubmit = true;
this.$http.putData(
"ocr/OCRRestful/updateOcrRecord",
this.uploadFilesdfEo,
{
_this: this,
},
(res) => {
if (res.ok) {
this.isSubmit = false;
this.uploadModal = false;
this.getTableData();
} else {
this.isSubmit = false;
this.$message.error(res.message);
}
},
(e) => {
this.isSubmit = false;
}
);
}
}
});
},
// 获取选中数据
selectStanderChange(data) {
this.selectTableData = data;
},
// 获取doc文件
downloadFile(data) {
window.open(data.docRealFile);
},
// 删除
delSingalData(row) {
if (this.selectTableData.length === 0) {
this.$confirm("确认删除这些数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
confirmButtonClass: "common-button-primary",
roundButton: true,
type: "warning",
}).then(() => {
this.$http.delete(
"ocr/OCRRestful/deleteOcrRecord",
{
ids: row.id,
},
{
_this: this,
},
(res) => {
if (res.ok) {
this.getTableData();
} else {
this.getTableData();
// this.$message.error(res.message)
}
}
);
});
}
},
// 批量删除
delData() {
if (this.selectTableData.length === 0) {
this.$confirm("请选择一条数据进行删除", "提示", {
showCancelButton: false,
confirmButtonText: "确定",
cancelButtonText: "取消",
confirmButtonClass: "common-button-primary",
type: "warning",
roundButton: true,
});
} else {
this.$confirm("确认删除这些数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
confirmButtonClass: "common-button-primary",
roundButton: true,
}).then(() => {
let idsList = [];
this.selectTableData.map((item) => {
idsList.push(item);
});
this.$http.delete(
"ocr/OCRRestful/deleteOcrRecord",
{
ids: idsList.join(","),
},
{
_this: this,
},
(res) => {
if (res.ok) {
this.getTableData();
} else {
this.getTableData();
// this.$message.error(res.message)
}
}
);
});
}
},
// 转化
changeData() {},
// 分页点击后方法
pageChange(page) {
this.page = page;
this.getTableData();
},
// 分页每页显示数改变后方法
pageSizeChange(pageSize) {
this.pageSize = pageSize;
this.getTableData();
},
// 获取表格数据
getTableData() {
this.$http.post(
"ocr/OCRRestful/getAllOcrResult",
{
page: this.page,
pageSize: this.pageSize,
},
{
_this: this,
loading: "loading",
},
(res) => {
if (res.ok) {
this.standRecoList = res.data.list;
this.total = res.data.count;
}
},
e => {}
);
},
},
computed: {},
created() {},
mounted() {
this.getTableData();
},
destroyed() {},
};
</script>
<style lang="less" scope>
.standardRecognition {
height: 100%;
background: #fff;
display: flex;
flex-direction: column;
.action-bar {
margin-bottom: 5px;
}
.content {
flex: auto;
overflow: hidden;
position: relative;
margin-bottom: 10px;
}
.pagination {
position: static;
/deep/.pagination-slot {
padding: 0;
}
}
}
.bead-input {
/deep/ .el-input__inner {
border-radius: 20px;
}
}
</style>
+814
View File
@@ -0,0 +1,814 @@
<!-- 标准法规库 - 动态&资料 -->
<template>
<div id="dynamicInformation" class="dynamic-information v-class">
<div class="dynamic-content">
<!-- 实施预警 -->
<div class="dynamic">
<div class="dynamic-content">
<h5>实施预警</h5>
<!-- <div class="dynamic-line"></div>-->
<!-- <span class="more" @click="dynamicWarning">更多</span> -->
<div class="more">
<el-button
v-btn-permission="'5XYSQKUDCFN2EGDE23VK'"
type="primary"
class="common-button-primary"
round
@click="dynamicWarning">
更多
</el-button>
</div>
<div class="content" style="height: 100%; padding-top: 5px;">
<el-divider content-position="left" class="dynamic-child-title">新车型实施日期预警</el-divider>
<el-table
:data="newTypeDatas"
:height="height"
border
:resizable="false"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
>
<el-table-column prop="sortName" label="类型" align="center">
<template slot-scope="scope">
<div v-if="scope.row.sortName === 'BUSINESS_STAND'">企业标准</div>
<div v-if="scope.row.sortName === 'FOREIGN_STAND'">海外标准法规</div>
<div v-if="scope.row.sortName === 'INLAND_STAND'">国内标准法规</div>
<div v-if="scope.row.sortName === 'INLAND_LAWS'">国内政策</div>
<div v-if="scope.row.sortName === 'FOREIGN_LAWS'">国外政策</div>
</template>
</el-table-column>
<el-table-column prop="standNum" label="编号" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.standNum }}</a>
</template>
</el-table-column>
<el-table-column prop="standName" label="标准名称" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column prop="putTime" label="新车型实施日期" align="center" sortable>
<template slot-scope="scope">
{{(scope.row.putTime ? scope.row.putTime.substring(0, 11): '')}}
</template>
</el-table-column>
</el-table>
<el-divider content-position="left" class="dynamic-child-title">在产车实施日期预警</el-divider>
<el-table
:data="productionVehicleDatas"
:height="height"
border
:resizable="false"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
>
<el-table-column prop="sortName" label="类型" align="center">
<template slot-scope="scope">
<div v-if="scope.row.sortName === 'BUSINESS_STAND'">企业标准</div>
<div v-if="scope.row.sortName === 'FOREIGN_STAND'">海外标准法规</div>
<div v-if="scope.row.sortName === 'INLAND_STAND'">国内标准法规</div>
<div v-if="scope.row.sortName === 'INLAND_LAWS'">国内政策</div>
<div v-if="scope.row.sortName === 'FOREIGN_LAWS'">国外政策</div>
</template>
</el-table-column>
<el-table-column prop="standNum" label="编号" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.standNum }}</a>
</template>
</el-table-column>
<el-table-column prop="standName" label="标准名称" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column prop="putTime" label="在产车实施日期" align="center" sortable>
<template slot-scope="scope">
{{(scope.row.putTime ? scope.row.putTime.substring(0, 11): '')}}
</template>
</el-table-column>
</el-table>
<!-- <el-divider content-position="left" class="dynamic-child-title">新生产车实施日期预警</el-divider>-->
<!-- <el-table-->
<!-- :data="newProductionDatas"-->
<!-- height="200px"-->
<!-- border-->
<!-- :resizable="false"-->
<!-- :header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"-->
<!-- >-->
<!-- <el-table-column prop="sortName" label="类型" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <div v-if="scope.row.sortName === 'BUSINESS_STAND'">企业标准</div>-->
<!-- <div v-if="scope.row.sortName === 'FOREIGN_STAND'">海外标准法规</div>-->
<!-- <div v-if="scope.row.sortName === 'INLAND_STAND'">国内标准法规</div>-->
<!-- <div v-if="scope.row.sortName === 'INLAND_LAWS'">国内政策</div>-->
<!-- <div v-if="scope.row.sortName === 'FOREIGN_LAWS'">国外政策</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="standNum" label="编号" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <div @click="showStandDetails(scope.row)">{{ scope.row.standNum }}</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="standName" label="标准名称" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <div @click="showStandDetails(scope.row)">{{ scope.row.standName }}</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="putTime" label="新生产车实施日期" align="center"></el-table-column>-->
<!-- </el-table>-->
<!-- <el-divider content-position="left" class="dynamic-child-title">新车型条款预警</el-divider>-->
<!-- <el-table-->
<!-- :data="newCarWarning"-->
<!-- height="200px"-->
<!-- border-->
<!-- :resizable="false"-->
<!-- :header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"-->
<!-- >-->
<!-- <el-table-column prop="standNum" label="标准编号" align="center">-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="standNum" label="标准名称" align="center">-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="itemsNum" label="条款号" align="center">-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="itemsName" label="条款名称" align="center"></el-table-column>-->
<!-- <el-table-column prop="putTime" label="实施日期" align="center"></el-table-column>-->
<!-- <el-table-column prop="creationTime" label="预警日期" align="center"></el-table-column>-->
<!-- </el-table>-->
<!-- <el-divider content-position="left" class="dynamic-child-title">在产车条款预警</el-divider>-->
<!-- <el-table-->
<!-- :data="producCarWarning"-->
<!-- height="200px"-->
<!-- border-->
<!-- :resizable="false"-->
<!-- :header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"-->
<!-- >-->
<!-- <el-table-column prop="standNum" label="标准编号" align="center">-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="standNum" label="标准名称" align="center">-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="itemsNum" label="条款号" align="center">-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="itemsName" label="条款名称" align="center"></el-table-column>-->
<!-- <el-table-column prop="putTime" label="实施日期" align="center"></el-table-column>-->
<!-- <el-table-column prop="creationTime" label="预警日期" align="center"></el-table-column>-->
<!-- </el-table>-->
</div>
</div>
</div>
</div>
<adc-back-top scroll-bind="dynamicInformation"></adc-back-top>
</div>
</template>
<script>
import { mapMutations } from 'vuex'
export default {
name: 'standardWarning',
data () {
return {
// 头部搜索框
dynamic: {
keyWord: '',
openData: '',
closeData: ''
},
MsgInterInfoEOPage: {
msgType: ''
},
MsgDynamicInfoEOPage: {
msgType: ''
},
MsgResourceInfoEOPage: {
msgType: ''
},
height: null,
productionVehicleDatas: [],
newTypeDatas: [],
newProductionDatas: [],
inlandMsgList: [],
foreignMsgList: [],
resourceMsgList: [],
newCarWarning: [],
producCarWarning: [],
// 轮播图
carouselValue1: 0,
// 有图片的动态信息列表
imgInformationList: [],
// 轮播图宽度
carouselImgWidth: 0,
// loading
loading: {
inlandLoading: false,
foreignLoading: false,
resourceLoading: false
},
roleModuleList: [],
// 轮播索引
swiperIndex: -1,
dynamicFormRules: {
keyWord: [
{ type: 'string', max: 100, message: '关键字长度不能超过100个字符', trigger: 'blur' }
]
}
}
},
methods: {
/**
* @author liruohao
* @date 2019/4/25
* @Description: 标准跳页
*/
// showStandDetails (item) {
// this.$store.commit('setDetailMap', this.$route.path)
// if (item.sortName === 'BUSINESS_STAND') {
// let routeUrl = this.$router.resolve({
// name: 'OtherBussStandardDetails',
// params: {
// id: item.sarId,
// pageType: item.sortName
// }
// })
// window.open(routeUrl.href, '_blank')
// } else if (item.sortName === 'INLAND_STAND' || item.sortName === 'FOREIGN_STAND') {
// let routeUrl = this.$router.resolve({
// name: 'OtherStandardDetails',
// params: {
// id: item.sarId,
// pageType: item.sortName
// }
// })
// window.open(routeUrl.href, '_blank')
// } else if (item.sortName === 'INLAND_LAWS' || item.sortName === 'FOREIGN_LAWS') {
// let routeUrl = this.$router.resolve({
// name: 'OtherLawsDetails',
// params: {
// id: item.sarId,
// pageType: item.sortName
// }
// })
// window.open(routeUrl.href, '_blank')
// }
// },
showStandDetails (item) {
let getStandId = item.sarId
let getStandType = item.sortName
this.$http.get('lawss/sarMenu/judgeSarMenuByRole', {
sarId: getStandId,
sarType: getStandType,
isExit: '1'
}, {
_this: this
}, res => {
if (res.ok) {
let pageTpe = ''
let id = ''
let routename = ''
if (getStandType === 'INLAND_STAND' || getStandType === 'FOREIGN_STAND') {
if (this.$hasPermission('SSA6WR4HV8')) {
pageTpe = getStandType
id = getStandId
routename = 'OtherStandardDetails'
} else {
this.$message.error('无权访问')
}
} else if (getStandType === 'INLAND_LAWS' || getStandType === 'FOREIGN_LAWS') {
if (this.$hasPermission('A2HDHMEA6W')) {
pageTpe = getStandType
id = getStandId
routename = 'OtherLawsDetails'
} else {
this.$message.error('无权访问')
}
} else if (getStandType === 'BUSSIONESS_STAND') {
if (this.$hasPermission('YJUHC32R7G')) {
pageTpe = 'BUSINESS_STAND'
id = getStandId
routename = 'OtherBussStandardDetails'
} else {
this.$message.error('无权访问')
}
}
if (routename !== '') {
let routeUrl = this.$router.resolve({
name: routename,
params: {
id: id,
pageType: pageTpe
}
})
window.open(routeUrl.href, '_blank')
}
} else {
this.$message.error(res.message)
}
}, e => {
})
},
// 获取国内动态
queryMsgByPage () {
this.MsgDynamicInfoEOPage.msgType = 'INLAND'
this.MsgDynamicInfoEOPage.rowLimit = 10
this.$http.get('lawss/msgDynamicInfo/page', this.MsgDynamicInfoEOPage, {
_this: this,
loading: 'loading.inlandLoading'
}, res => {
this.inlandMsgList = res.data.list
}, e => {
})
},
// 国内动态更多查看
dynamicDomestic () {
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'DomesticDynamics'
})
},
// 国际动态更多查看
dynamicInternational () {
this.$router.push({
name: 'InternationalDynamics'
})
},
// 获取国外动态
queryForeignMsgByPage () {
this.MsgInterInfoEOPage.msgType = 'FOREIGN'
this.MsgInterInfoEOPage.rowLimit = 10
this.$http.get('lawss/msgDynamicInfo/page', this.MsgInterInfoEOPage, {
_this: this,
loading: 'loading.foreignLoading'
}, res => {
this.foreignMsgList = res.data.list
}, e => {
})
},
// 资料中心更多查看
informationCenter () {
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'InformationCenter'
})
},
// 实施预警更多查看
dynamicWarning () {
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'ImplementWarning'
})
},
// 获取资料中心
queryResourceMsgByPage () {
this.MsgResourceInfoEOPage.msgType = 'RESOURCE'
this.MsgResourceInfoEOPage.rowLimit = 10
this.$http.get('lawss/msgDynamicInfo/page', this.MsgResourceInfoEOPage, {
_this: this,
loading: 'loading.resourceLoading'
}, res => {
this.resourceMsgList = res.data.list
}, e => {
})
},
showMsgDetails (id, pageType) {
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'DomesticDynamicsDetails',
params: {
id: id,
pageType: pageType
}
})
},
showDynmicMsgDetails (item) {
let isContains = 0
if (this.roleModuleList != null && this.roleModuleList.length > 0) {
for (let module in this.roleModuleList) {
if (this.roleModuleList[module].id === item.msgMode) {
isContains = 1
break
}
}
if (isContains === 1) {
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'DomesticDynamicsDetails',
params: {
id: item.id,
pageType: item.msgType + '_MSG'
}
})
} else {
this.$message.error('当前角色无权限查看此信息')
}
} else {
this.$message.error('当前角色无权限查看此信息')
}
},
queryProductionVehicleByPage () {
this.$http.get('lawss/msgSarPutTime/page', {
sarPutType: 'ZCCSSRQ',
pageSize: 5
}, {
_this: this
}, res => {
this.productionVehicleDatas = res.data.list
}, e => {
})
},
queryNewTypeByPage () {
this.$http.get('lawss/msgSarPutTime/page', {
sarPutType: 'XCXSSRQ',
pageSize: 5
}, {
_this: this
}, res => {
this.newTypeDatas = res.data.list
}, e => {
})
},
queryNewProductionByPage () {
this.$http.get('lawss/msgSarPutTime/page', {
warnType: 'STAND',
sarPutType: 'NEWPRODUCT',
pageSize: 5
}, {
_this: this
}, res => {
this.newProductionDatas = res.data.list
}, e => {
})
},
/*
*@description:新车型条款预警Table
*@modifyContent:
*@author: 刘志超
*@date: 2020-09-16 10:02:10
*/
querynewCarWarningByPage () {
this.$http.get('lawss/msgSarPutTime/page', {
warnType: 'ITEM',
sarPutType: 'NEWCAR',
pageSize: 5
}, {
_this: this
}, res => {
this.newCarWarning = res.data.list
}, e => {
})
},
/*
*@description:在产车条款预警Table
*@modifyContent:
*@author: 刘志超
*@date: 2020-09-16 10:02:19
*/
queryProducCarWarningByPage () {
this.$http.get('lawss/msgSarPutTime/page', {
warnType: 'ITEM',
sarPutType: 'PRODUCT',
pageSize: 5
}, {
_this: this
}, res => {
this.producCarWarning = res.data.list
}, e => {
})
},
/**
* @description: 本地动态搜索
* @author: chenxiaoxi
* @date: 2018/10/19 15:15:30
*/
queryDynamicInformation (formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$router.push({
name: 'QueryDynamicInformation',
query: {
keywords: this.dynamic.keyWord,
startTime: this.dynamic.openData !== '' ? this.dateFormat(this.dynamic.openData) : '',
endTime: this.dynamic.closeData !== '' ? this.dateFormat(this.dynamic.closeData) : ''
}
})
} else {
this.$message.error('请检查表单是否填写正确')
}
})
},
// 获取轮播图
getHorseLantern () {
this.$http.get('lawss/msgDynamicInfo/queryNewsPic', {
rowLimit: 5
}, {
_this: this
}, res => {
this.imgInformationList = res.data.list
}, e => {
})
},
/**
* @description: 查看图片信息详情
* @author: chenxiaoxi
* @date: 2018/10/26 14:08:38
*/
imgInformationDetail (information) {
this.setDetailMap(this.$route.path)
this.$router.push({
name: 'DomesticDynamicsDetails',
params: {
id: information.id,
pageType: information.msgType
}
})
},
isNew (pubTime) {
if (pubTime != null && pubTime !== '' && pubTime !== undefined) {
pubTime = pubTime.replace(new RegExp(/-/gm), '/')
return new Date().getTime() - new Date(pubTime).getTime() < 7 * 24 * 3600 * 1000
} else {
return ''
}
},
/**
* @description: 日期转换
* @author: chenxiaoxi
* @date: 2018/11/01 10:20:12
*/
dateFormat (date) {
let year = new Date(date).getFullYear()
let month = new Date(date).getMonth() + 1
let day = new Date(date).getDate()
return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day)
},
getDate (date) {
return date !== undefined && date != null ? date.split(' ')[0] : ''
},
/**
* @description: 轮播点击
* @author: chenxiaoxi
* @date: 2018/11/10 13:22:15
*/
swiperClick (index) {
if (index === 6 || index === 0) {
this.imgInformationDetail(this.imgInformationList[0])
} else {
this.imgInformationDetail(this.imgInformationList[index - 1])
}
},
// 查询当前登录人拥有的全部模块权限
showRoleModules () {
this.$http.get('lawss/msgModule/selectMsgModuleByRole', {}, {_this: this}, res => {
if (res.data) {
this.roleModuleList = res.data
}
})
},
...mapMutations(['setDetailMap'])
},
props: {
reload: {
type: Boolean
}
},
computed: {
showSwiper () {
return this.imgInformationList.length
}
},
watch: {
},
mounted () {
this.height = $('.content').height() * 0.4
window.onresize = () => {
this.height = $('.content').height() * 0.4
}
// this.queryMsgByPage()
// this.queryForeignMsgByPage()
// this.queryResourceMsgByPage()
this.queryNewTypeByPage()
this.queryProductionVehicleByPage()
// this.queryNewProductionByPage()
// this.querynewCarWarningByPage()
// this.queryProducCarWarningByPage()
// this.showRoleModules()
this.getHorseLantern()
for (let key in this.dynamic) {
this.dynamic[key] = ''
}
}
}
</script>
<style lang="less" scoped>
@import "~@/assets/styles/style";
@import "~@/assets/styles/mixins";
#dynamicInformation {
background: #fff;
padding-top: 10px;
width: 100%;
height: 100%;
.dynamic-header {
height: 300px;
background: @homeSectionBgColor;
.dynamic-header-left {
width: 750px;
height: 100%;
border-right: 1px solid #ddd;
float: left;
background: #eee;
.wrapper {
overflow: hidden;
width: 100%;
max-width: 750px;
margin: 0 auto;
height: 100%;
background: #eee;
cursor: pointer;
border: 1px solid #eee;
border-right: none;
.swiper-pagination {
.swiper-pagination-bullet {
width: 10px;
height: 10px;
outline: none;
&:hover {
cursor: pointer;
}
&.swiper-pagination-bullet-active {
background: #fff;
}
}
}
.swiper-container {
height: 100%;
.swiper-img {
width: 100%;
height: 100%;
}
}
}
}
.dynamic-header-right {
padding: 10px;
float: left;
.flex();
justify-content: center;
align-items: center;
width: calc(~"100% - 750px");
height: 100%;
.dynamic-search {
width: 300px;
.dynamic-search-line {
width: 100%;
height: 4px;
background: @boxBgColor;
margin-bottom: 5px;
}
.dynamic-search-center {
.search-btn {
padding: 0;
width: 100%;
height: 32px;
font-size: 12px;
}
}
h5 {
font-size: 18px;
line-height: 30px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
font-weight: 600;
}
.dynamic-label-input-form {
.el-form-item {
margin-bottom: 5px;
}
}
}
}
@media screen and (min-width: 1920px) {
.dynamic-header-left {
width: 1200px;
}
.dynamic-header-right {
width: calc(~"100% - 1200px");
}
}
}
.dynamic-content {
height: 100%;
overflow-y: hidden;
width: 100%;
position: relative;
.dynamic {
width: 100%;
height: 100%;
.dynamic-content {
h5 {
margin-left: 20px;
font-size: 18px;
line-height: 30px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
font-weight: 600;
}
.dynamic-line {
width: 100%;
height: 4px;
background: @boxBgColor;
margin-bottom: 5px;
}
.more {
cursor: pointer;
color: #12508e;
position: absolute;
top: 0;
right: 0;
z-index: 100;
padding: 5px 10px;
// &:hover {
// color: #fff;
// background: #12508e;
// transition: all 0.2s linear;
// }
}
.dynamic-loop-container {
position: relative;
min-height: 160px;
.dynamic-loop {
cursor: pointer;
width: 100%;
padding: 5px 18px;
&:hover {
.domestic-loop-header {
color: @baseColor;
}
.loop-content-left {
text-decoration: underline;
color: @baseColor;
}
}
.domestic-loop-header {
font-size: 15px;
height: 20px;
line-height: 20px;
.flex();
align-items: center;
.domestic-title {
max-width: 80%;
.ellipsis();
}
}
.newInformation {
color: #e4393c;
}
.time {
position: absolute;
right: 0.1rem;
//top: 0;
}
.newI {
font-style: italic;
color: #e4393c;
font-weight: bold;
margin-right: 5px;
}
.domestic-loop-content {
width: 100%;
height: 20px;
line-height: 20px;
.flex();
.loop-content-left {
padding-left: 30px;
flex: 1;
overflow: hidden;
.left-content {
width: 100%;
p {
.ellipsis();
}
}
}
.loop-content-right {
width: 150px;
.flex();
justify-content: flex-end;
}
}
}
}
.content {
padding-bottom: 10px;
height: calc(~'100% - 40px');
}
}
}
.dynamic-child-title {
color: #515a6e;
margin: 24px 0;
}
}
}
</style>
@@ -0,0 +1,872 @@
<!--预警管理--预警条款-->
<template>
<div class="warning-clause v-class">
<el-form inline :model="standardForm" ref="ruleForm" class="label-input-form">
<div class="search-area-item">
<el-form-item :label="$t('m.dateOfEnforcement')" class="serch-form-item">
<el-date-picker
v-model="materialDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="$t('m.warningDate')" class="serch-form-item btn-box">
<el-date-picker
v-model="warningDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="searchStandLaws"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</div>
<div class="search-area-item">
<!-- <el-form-item class="serch-form-item btn-box">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- class="searchAngNewBtn"-->
<!-- @click="standsAdd(1, null)"-->
<!-- v-btn-permission="'SDXRQ8LV6K'"-->
<!-- >新增</el-button>-->
<!-- </el-form-item>-->
<!-- <el-form-item class="serch-form-item btn-box">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- class="searchAngNewBtn"-->
<!-- @click="warningStandardsDel"-->
<!-- v-btn-permission="'SDXRQ8LV6K'"-->
<!-- >导出</el-button>-->
<!-- </el-form-item>-->
<!-- <el-form-item class="serch-form-item btn-box">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- class="searchAngNewBtn"-->
<!-- @click="warningStandardsDel"-->
<!-- v-btn-permission="'ATBANPLHCM'">删除</el-button>-->
<!-- </el-form-item>-->
</div>
</el-form>
<!-- :reserve-selection="true" -->
<div class="content">
<div class="action-bar">
<el-button type="primary" size="mini" @click="standsAdd(1, null)">新增</el-button>
<el-button type="danger" size="mini" @click="warningStandardsDel">批量删除</el-button>
<el-button type="primary" size="mini" @click="exportStandard('apart')" v-btn-permission="'J2X4KHNN4N'">导出</el-button>
<el-button type="primary" size="mini" @click="exportStandard('all')" v-btn-permission="'NLDJF75Msde'">全部导出</el-button>
</div>
<div class="table-wrap">
<el-table
ref="selection"
:data="warningData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange"
height="100%"
>
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="standNum"
:label="$t('m.standardNumber')"
align="center"
>
</el-table-column>
<el-table-column
prop="itemsName"
:label="$t('m.name')"
align="center">
</el-table-column>
<el-table-column
prop="describes"
:label="$t('m.content')"
align="center">
</el-table-column>
<el-table-column
prop="putTime"
:label="$t('m.putTime')"
align="center">
</el-table-column>
<el-table-column
prop="creationTime"
:label="$t('m.warningDate')"
align="center">
</el-table-column>
<el-table-column :label="$t('m.action')" align="center">
<template slot-scope="scope">
<!-- <el-button-->
<!-- class="opera-btn"-->
<!-- size="mini"-->
<!-- type="primary"-->
<!-- @click="standsAdd(3, scope.row)">查看</el-button>-->
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'VWUD78DHGM'"
@click="standsAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'GAPG2L7CWP'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!--分页-->
<pagination
:page="tableFlag === '' ? standardForm.page : tableFlag.page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<!-- :class="classObject"-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="warningModelData" ref="warningModelData" :rules="classRules">
<el-row>
<el-col :span="12">
<el-form-item label="条目名称"
prop="itemName"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="warningModelData.itemName"
autocomplete="off"
clearable
placeholder="请点击按钮选择"></el-input>
</el-form-item>
</el-col>
<el-row>
<el-col :span="12">
<el-form-item label="" class="add-form-item">
<el-button
type="primary"
class="chooseBtn"
@click="openDialog"
>选择</el-button>
</el-form-item>
</el-col>
</el-row>
<el-col :span="12">
<el-form-item label="预警信息分类"
:label-width="formLabelWidth"
prop="sarPutType"
class="add-form-item">
<!-- @change="getAddSelectCountry"-->
<el-select v-model="warningModelData.sarPutType" placeholder="请选择预警信息分类">
<el-option v-for="type in typeOptions" :label="type.label" :value="type.value === undefined ? '' :type.value" :key="type.value">{{ type.label }}</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="实施日期"
class="add-form-item"
:label-width="formLabelWidth"
prop="putTime">
<el-date-picker
v-model="warningModelData.putTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="请选择实施日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="预警日期"
class="add-form-item"
:label-width="formLabelWidth"
prop="creationTime">
<el-date-picker
v-model="warningModelData.creationTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="请选择预警日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer__footer">
<el-button size="mini" @click="closeModal('warningModelData')">取 消</el-button>
<el-button size="mini" type="primary" @click="saveWarning('warningModelData')">提交</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{warningModelData.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{warningModelData.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{warningModelData.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
<!--内部弹窗-->
<el-dialog title="条目" :visible.sync="chooseDialog">
<el-table
ref="multipleTable"
:data="stahndinfoList"
tooltip-effect="dark"
style="width: 100%"
border
class="drag-table"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="standSelectChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="itemsNum"
label="条目号"
align="center"
>
</el-table-column>
<el-table-column
prop="itemsName"
label="条目名称"
align="center">
</el-table-column>
<el-table-column
prop="remarks"
label="备注"
align="center">
</el-table-column>
<el-table-column
prop="standName"
label="标准名称"
align="center">
</el-table-column>
<el-table-column
prop="standNum"
label="标准编号"
align="center">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="standStateShow"-->
<!-- label="标准状态"-->
<!-- align="center">-->
<!-- </el-table-column>-->
</el-table>
<pagination
class="pagination"
:page="configPage"
:total="configTotal"
@pageChange="configuraPageChange"
@pageSizeChange="configuraPageSizeChange">
</pagination>
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="chooseDialog = false">取 消</el-button>
<el-button size="mini" type="primary" @click="submitStand">确 定</el-button>
</div>
</el-dialog>
<!--导出文件改名字模态框-->
<el-dialog :visible.sync="exportModelFlag" title="导出文件" width="30%">
<el-form :inline="true" class="label-input-form">
<el-form-item label="导出名称" class="serch-form-item">
<el-input v-model="exportName" placeholder="请输入导出文件名称" :maxlength="30" clearable label="导出名称"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" class="searchAngNewBtn" size="mini" @click="exportTestItem">确定</el-button>
<el-button type="primary" class="searchAngNewBtn" size="mini" @click="cancal">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'warningClause',
data () {
return {
tableHeight: null,
// 查询条件
standardForm: {
// 实施日期
putTime1: '',
putTime2: '',
// 预警日期
creationTime1: '',
creationTime2: '',
pageSize: this.$store.getters.userInfo.configContent,
page: 1,
warnType: 'ITEM'
},
page: 1,
tableFlag: '',
// 实施日期中间变量
putTime1: '',
putTime2: '',
// 预警日期中间变量
creationTime1: '',
creationTime2: '',
// 实施日期
materialDate: [],
// 预警日期
warningDate: [],
total: 0,
rows: 10,
loading: false,
// 列表数据
warningData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
warningModelData: {
// 预警时间
creationTime: '',
// 预警信息分类
sarPutType: '',
// 实施日期
putTime: '',
// 判断法规类型是国内还是国外,从内部弹窗里查
sarType: '',
// 条目名称
itemName: '',
// 标准id
sarId: '',
// 条目id
itemId: '',
// 预警类型
warnType: 'ITEM'
},
// 弹窗标题
title: '',
typeOptions: [
{
label: '新车型条款预警',
value: 'NEWCAR'
},
{
label: '在产车条款预警',
value: 'PRODUCT'
}
],
configPage: 1,
configTotal: 0,
configRows: 10,
stahndinfoList: [],
// 表单验证
classRules: {
itemName: [
{required: true, message: '条目名称不能为空', trigger: 'change'}
],
sarPutType: [
{required: true, message: '预警信息分类不能为空', trigger: 'change'}
],
putTime: [
{required: true, message: '实施日期不能为空', trigger: 'blur'}
],
creationTime: [
{required: true, message: '预警日期不能为空', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
singleSelection: [],
// 选择标准弹窗
chooseDialog: false,
sarStandardsSearch: {
page: 1,
pageSize: this.$store.getters.userInfo.configContent
},
// 导出文件模态框控制,和文件名称
saveExportType: '',
exportModelFlag: false,
exportName: '',
SarExportSearchEo: {}
}
},
methods: {
// 多选
// 多选
handleSelectionChange (val) {
const data = []
val.map((item) => {
data.push(item.id)
})
this.selectNum = data.toString()
console.log('this.selectNum', this.selectNum)
},
standSelectChange (val) {
this.singleSelection = val
console.log('this.singleSelection', this.singleSelection)
if (this.singleSelection.length > 1) {
this.$message({
message: '最多只能选择一条警告',
type: 'warning'
})
this.$refs.multipleTable.clearSelection()
}
},
// 条件查询
searchStandLaws () {
this.page = 1
// this.tableFlag = item
this.pageChange(1)
this.standardForm.putTime1 = this.materialDate[0]
this.standardForm.putTime2 = this.materialDate[1]
this.standardForm.creationTime1 = this.warningDate[0]
this.standardForm.creationTime2 = this.warningDate[0]
this.putTime1 = this.standardForm.putTime1
this.putTime2 = this.standardForm.putTime2
this.creationTime1 = this.standardForm.creationTime1
this.creationTime2 = this.standardForm.creationTime2
// 执行列表查询
this.getStandLawsByPage()
},
// 分页查询
getStandLawsByPage (item, flag) {
if (item) {
item.pageSize = this.$store.getters.userInfo.configContent
}
const data = {}
flag && (this.standardForm.page = this.page)
data.putTime1 = this.putTime1
data.putTime2 = this.putTime2
data.creationTime1 = this.creationTime1
data.creationTime2 = this.creationTime2
data.page = this.standardForm.page
data.pageSize = this.standardForm.pageSize
data.warnType = this.standardForm.warnType
this.standardForm.pageSize = this.$store.getters.userInfo.configContent
this.SarExportSearchEo = item || this.standardForm
this.loading = true
this.$http.get('lawss/msgSarPutTime/page', item || data, {
_this: this,
loading: this.loading
}, res => {
if (res.ok) {
this.warningData = res.data.list
this.total = res.data.count
this.loading = false
}
}, e => {
})
},
// 清空查询
resetSelect () {
this.page = 1
this.standardForm.putTime1 = ''
this.standardForm.putTime2 = ''
this.standardForm.creationTime1 = ''
this.standardForm.creationTime2 = ''
this.putTime1 = ''
this.putTime2 = ''
this.creationTime1 = ''
this.creationTime2 = ''
this.materialDate = []
this.warningDate = []
// 执行列表查询
this.getStandLawsByPage(this.tableFlag, 1)
},
// 新增,编辑弹窗打开
standsAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增'
this.dialogState = true
} else {
this.title = '编辑'
this.warningModelData = row
this.warningModelData.itemName = row.itemsName
this.dialogState = true
}
},
// 新增预警标准确定
saveWarning () {
this.$refs['warningModelData'].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.$http.post('lawss/msgSarPutTime/addmsgSarPutTime', this.warningModelData, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
})
} else {
this.$http.post('lawss/msgSarPutTime/updateemsgSarPutTime', this.warningModelData, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
})
}
} else {
}
})
},
// 取消
closeModal () {
this.page = 1
this.getStandLawsByPage(this.tableFlag, 1)
this.warningModelData = {
// 预警时间
creationTime: '',
// 预警信息分类
sarPutType: '',
// 实施日期
putTime: '',
// 判断法规类型是国内还是国外,从内部弹窗里查
sarType: '',
// 标准名称
itemName: '',
// 标准id
sarId: '',
// 条目id
itemId: '',
// 预警类型
warnType: 'ITEM'
}
this.$nextTick(() => {
this.$refs['warningModelData'].resetFields()
})
this.dialogState = false
},
// 关闭弹窗
handleClose () {
this.page = 1
this.getStandLawsByPage(this.tableFlag, 1)
this.warningModelData = {
// 预警时间
creationTime: '',
// 预警信息分类
sarPutType: '',
// 实施日期
putTime: '',
// 判断法规类型是国内还是国外,从内部弹窗里查
sarType: '',
// 标准名称
itemName: '',
// 标准id
sarId: '',
// 条目id
itemId: '',
// 预警类型
warnType: 'ITEM'
}
this.$nextTick(() => {
if (this.$refs['warningModelData']) {
this.$refs['warningModelData'].resetFields()
}
})
this.dialogState = false
},
// 打开选择弹窗
openDialog () {
this.getDomesticStandardTable()
this.chooseDialog = true
},
submitStand () {
console.log('this.singleSelection', this.singleSelection)
this.warningModelData.itemName = this.singleSelection[0].itemsName
this.warningModelData.sarType = this.singleSelection[0].itemsType
this.warningModelData.sarId = this.singleSelection[0].standId
this.warningModelData.itemId = this.singleSelection[0].id
this.chooseDialog = false
console.log('this.warningModelData', this.warningModelData)
this.$refs.multipleTable.clearSelection()
this.singleSelection = []
},
// 分页查询国内标准
getDomesticStandardTable (item) {
this.sarStandardsSearch.page = this.configPage
this.sarStandardsSearch.validFlag = 0
this.$http.get('lawss/sarStandItems/getSarStandItemsList', this.sarStandardsSearch, {
_this: this, loading: 'loading'
}, res => {
if (res.ok) {
const arr = res.data.list
this.stahndinfoList = arr
this.configTotal = res.data.count
this.$nextTick(() => {
this.stahndinfoList.map((item) => {
if (this.warningModelData.sarId === item.id) {
this.singleSelection.push(item)
this.$refs.multipleTable.toggleRowSelection(item, true)
}
})
})
}
}, e => {
})
},
// 删除
classDel (row) {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.post('lawss/msgSarPutTime/deletemsgSarPutTime', {
ids: row.id
}, {
_this: this, loading: 'loading'
}, res => {
if (res.ok) {
this.$message({
showClose: true,
message: '删除成功',
type: 'success'
})
this.page = 1
this.getStandLawsByPage(this.tableFlag, 1)
}
})
})
},
// 批量删除
warningStandardsDel () {
if (this.selectNum.length === 0) {
this.$message.error('请先选择要删除的数据!')
} else {
this.$confirm('确认删除选中数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.post('lawss/msgSarPutTime/deletemsgSarPutTime', {ids: this.selectNum}, {
_this: this
}, res => {
if (res.ok) {
this.$message({
showClose: true,
message: '删除成功',
type: 'success'
})
this.page = 1
this.getStandLawsByPage(this.tableFlag, 1)
this.selectNum = []
}
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
}
},
// 导出选中的标准 此处因为复选框没有设置好,所以先设置导出所有数据
exportStandard (type) {
// 区别是选择导出还是全部导出
this.saveExportType = type
if (type === 'apart') {
if (this.selectNum.length > 0) {
this.exportName = ''
this.exportModelFlag = true
} else {
this.$message({
message: '请先选择要导出的数据',
type: 'warning'
})
}
} else {
this.exportName = ''
this.exportModelFlag = true
}
},
// 导出确定功能
exportTestItem () {
if (this.saveExportType === 'apart') {
if (this.selectNum != null && this.selectNum !== '') {
window.open('/api/lawss/msgSarPutTime/exportStandardsInfoExcel?exportType=' + this.saveExportType + '&exportContent=' + this.selectNum + '&exportName=' + this.exportName)
this.$message.success('导出信息成功')
}
} else if (this.saveExportType === 'all') {
// if (this.SarExportSearchEo.dicTypeCode === '') {
// delete this.SarExportSearchEo.dicTypeCode
// }
// let exportEO = this.tableFlag === '' ? this.standardForm : this.tableFlag
let exportEOStr = JSON.stringify(this.SarExportSearchEo)
exportEOStr = exportEOStr.replace(/""/g, null)
window.open('/api/lawss/msgSarPutTime/exportStandardsInfoExcel?exportType=' + this.saveExportType + '&exportContent=' + exportEOStr + '&exportName=' + this.exportName)
this.$message.success('导出信息成功')
}
this.exportModelFlag = false
},
// 导出取消按钮关闭模态、置空
cancal () {
this.exportModelFlag = false
},
pageChange (page) {
let pageObj
if (this.tableFlag !== '') {
this.tableFlag.page = page
pageObj = this.tableFlag
} else {
this.standardForm.page = page
pageObj = this.standardForm
}
this.getStandLawsByPage(pageObj)
},
pageSizeChange (pageSize) {
this.standardForm.pageSize = this.$store.getters.userInfo.configContent
this.rows = pageSize
this.getStandLawsByPage(this.tableFlag)
},
// 分页点击后方法
configuraPageChange (page) {
this.configPage = page
this.getDomesticStandardTable()
},
// 分页每页显示数改变后方法
configuraPageSizeChange (pageSize) {
this.sarStandardsSearch.pageSize = this.$store.getters.userInfo.configContent
this.configRows = pageSize
// this.selectConfiguraStand()
this.getDomesticStandardTable()
// 此处需要调用接口,修改个人配置
}
},
mounted () {
this.getStandLawsByPage()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
}
}
</script>
<style lang="less" scoped>
.warning-clause {
position: relative;
height: 100%;
padding: 10px 10px 0;
background: #fff;
display: flex;
flex-direction: column;
.label-input-form {
display: flex;
justify-content: space-between;
}
.action-bar {
margin-bottom: 5px;
}
.content{
width: 100%;
flex: auto;
overflow-y: auto;
display: flex;
flex-direction: column;
padding: 0;
.table-wrap {
flex: auto;
overflow: hidden;
}
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
.chooseBtn{
height: 32px;
padding: 0 15px;
color: #fff;
background-color: #3391CE;
border-color: #3391CE;
&.is-disabled {
background-color: #b0d3ed !important;
border-color: #bcd1e0 !important;
}
}
.chooseBtn:hover {
padding: 0 15px;
background-color: #3391CE;
border-color: #3391CE;
}
.chooseBtn:focus {
padding: 0 15px;
}
.el-form--inline {
.el-form-item {
margin-right: 5px;
&:last-child {
margin-right: 0;
}
/deep/.el-form-item__content {
line-height: normal;
}
}
}
.action-bar {
line-height: normal;
padding: 0;
margin-bottom: 10px;
}
.pagination {
position: static;
/deep/.pagination-slot {
padding: 0;
}
}
.el-range-separator {
width: auto;
}
}
</style>
@@ -0,0 +1,860 @@
<!--预警管理--预警标准-->
<template>
<div class="warning-standard v-class">
<div class="search-area">
<div class="left">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="$t('m.putTime')" class="search-item">
<el-date-picker
v-model="materialDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="$t('m.warningDate')" class="search-item">
<el-date-picker
v-model="warningDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="common-button-primary"
round
@click="searchStandLaws"></el-button>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
class="common-button-default"
icon="el-icon-refresh-left"
round
@click="resetSelect"></el-button>
</el-form-item>
</el-form>
</div>
<div class="right"></div>
</div>
<!-- :reserve-selection="true" -->
<div class="content">
<div class="action-bar">
<el-button type="primary" size="mini" @click="standsAdd(1, null)">新增</el-button>
<el-button type="danger" size="mini" @click="warningStandardsDel">批量删除</el-button>
<el-button type="primary" size="mini" @click="exportStandard('apart')" v-btn-permission="'J2X4KHNN4N'">导出</el-button>
<el-button type="primary" size="mini" @click="exportStandard('all')" v-btn-permission="'NLDJF75Msde'">全部导出</el-button>
</div>
<div class="table-wrap">
<el-table
ref="selection"
:data="warningData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange"
height="100%"
>
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="standNum"
:label="$t('m.standardNumber')"
align="center"
>
</el-table-column>
<el-table-column
prop="standName"
:label="$t('m.name')"
align="center">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="describes"-->
<!-- label="内容"-->
<!-- width="400"-->
<!-- align="center">-->
<!-- </el-table-column>-->
<el-table-column
prop="putTime"
:label="$t('m.dateOfEnforcement')"
align="center">
</el-table-column>
<el-table-column
prop="creationTime"
:label="$t('m.warningDate')"
align="center">
</el-table-column>
<el-table-column :label="$t('m.action')" align="center">
<template slot-scope="scope">
<!-- <el-button-->
<!-- class="opera-btn"-->
<!-- size="mini"-->
<!-- type="primary"-->
<!-- @click="standsAdd(3, scope.row)">查看</el-button>-->
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'VWUD78DHGM'"
@click="standsAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'GAPG2L7CWP'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!--分页-->
<pagination
:page="tableFlag === '' ? standardForm.page : tableFlag.page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<!-- :class="classObject"-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="warningModelData" ref="warningModelData" :rules="classRules">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('m.standName')"
prop="standName"
:label-width="formLabelWidth"
class="add-form-item">
<el-input v-model="warningModelData.standName" readonly placeholder="请点击按钮选择"></el-input>
</el-form-item>
</el-col>
<!-- <el-row>-->
<el-col :span="12">
<el-form-item label="" class="add-form-item">
<el-button
type="primary"
class="chooseBtn"
@click="openDialog"
>{{$t('m.select')}}</el-button>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('m.classificationOfEarlyWarningInformation')"
:label-width="formLabelWidth"
prop="sarPutType"
class="add-form-item">
<!-- @change="getAddSelectCountry"-->
<el-select v-model="warningModelData.sarPutType" :placeholder="$t('m.pleaseSelectWarningInformationClassification')">
<el-option v-for="type in typeOptions" :label="type.label" :value="type.value === undefined ? '' :type.value" :key="type.value">{{ type.label }}</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('m.putTime')"
class="add-form-item"
:label-width="formLabelWidth"
prop="putTime">
<el-date-picker
v-model="warningModelData.putTime"
value-format="yyyy-MM-dd"
type="date"
:placeholder="$t('m.selectImplementationDate')">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('m.warningDate')"
class="add-form-item"
:label-width="formLabelWidth"
prop="creationTime">
<el-date-picker
v-model="warningModelData.creationTime"
value-format="yyyy-MM-dd"
type="date"
:placeholder="$t('m.pleaseSselectWarningDate')">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer__footer">
<el-button size="mini" @click="closeModal('warningModelData')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveWarning('warningModelData')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{warningModelData.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{warningModelData.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{warningModelData.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
<!--内部弹窗-->
<el-dialog title="标准" :visible.sync="chooseDialog">
<el-table
ref="multipleTable"
:data="stahndinfoList"
tooltip-effect="dark"
style="width: 100%"
border
class="drag-table"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="standSelectChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="standNumber"
label="标准号"
align="center"
>
</el-table-column>
<el-table-column
prop="standName"
label="标准名称"
align="center">
</el-table-column>
<el-table-column
prop="regionShow"
label="区域"
align="center">
</el-table-column>
<el-table-column
prop="countryShow"
label="国家/地区"
align="center">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="standNatureShow"-->
<!-- label="标准性质"-->
<!-- align="center">-->
<!-- </el-table-column>-->
<el-table-column
prop="standStateShow"
label="标准状态"
align="center">
</el-table-column>
</el-table>
<pagination
class="pagination"
:page="configPage"
:total="configTotal"
@pageChange="configuraPageChange"
@pageSizeChange="configuraPageSizeChange">
</pagination>
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="chooseDialog = false">取 消</el-button>
<el-button size="mini" type="primary" @click="submitStand">确 定</el-button>
</div>
</el-dialog>
<!--导出文件改名字模态框-->
<el-dialog :visible.sync="exportModelFlag" title="导出文件" width="30%">
<el-form :inline="true" class="label-input-form">
<el-form-item label="导出名称" class="serch-form-item">
<el-input v-model="exportName" placeholder="请输入导出文件名称" :maxlength="30" clearable label="导出名称"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" class="searchAngNewBtn" size="mini" @click="exportTestItem">确定</el-button>
<el-button type="primary" class="searchAngNewBtn" size="mini" @click="cancal">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'warningStandard',
data () {
return {
// 查询条件
standardForm: {
// 实施日期
putTime1: '',
putTime2: '',
// 预警日期
creationTime1: '',
creationTime2: '',
pageSize: this.$store.getters.userInfo.configContent,
page: 1,
warnType: 'STAND'
},
page: 1,
// 实施日期中间变量
putTime1: '',
putTime2: '',
// 预警日期中间变量
creationTime1: '',
creationTime2: '',
// 实施日期
materialDate: [],
// 预警日期
warningDate: [],
total: 0,
rows: 10,
loading: false,
// 列表数据
warningData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '100px',
// 新增弹窗数据
warningModelData: {
// 预警类型
warnType: 'STAND',
// 预警时间
creationTime: '',
// 预警信息分类
sarPutType: '',
// 实施日期
putTime: '',
// 判断法规类型是国内还是国外,从内部弹窗里查
sarType: '',
// 标准名称
standName: '',
// 标准id
sarId: ''
//
},
// 弹窗标题
title: '',
typeOptions: [
{
label: '在产车实施日期预警',
value: 'PRODUCT'
},
{
label: '新定型车实施预期预警',
value: 'NEWCAR'
},
{
label: '新生产车实施日期预警',
value: 'NEWPRODUCT'
}
],
configPage: 1,
configTotal: 0,
configRows: 10,
stahndinfoList: [],
// 表单验证
classRules: {
standName: [
{required: true, message: '标准名称不能为空', trigger: 'change'}
],
sarPutType: [
{required: true, message: '预警信息分类不能为空', trigger: 'change'}
],
putTime: [
{required: true, message: '实施日期不能为空', trigger: 'blur'}
],
creationTime: [
{required: true, message: '预警日期不能为空', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
// 单选
singleSelection: [],
// 选择标准弹窗
chooseDialog: false,
sarStandardsSearch: {
page: 1,
pageSize: this.$store.getters.userInfo.configContent
},
// 导出文件模态框控制,和文件名称
saveExportType: '',
exportModelFlag: false,
exportName: '',
SarExportSearchEo: {},
tableFlag: ''
}
},
methods: {
// 多选
handleSelectionChange (val) {
const data = []
val.map((item) => {
data.push(item.id)
})
this.selectNum = data.toString()
console.log('this.selectNum', this.selectNum)
},
standSelectChange (val) {
this.singleSelection = val
console.log('this.singleSelection', this.singleSelection)
if (this.singleSelection.length > 1) {
this.$message({
message: '最多只能选择一条警告',
type: 'warning'
})
this.$refs.multipleTable.clearSelection()
}
},
// 条件查询
searchStandLaws () {
this.page = 1
// this.tableFlag = item
this.pageChange(1)
this.standardForm.putTime1 = this.materialDate[0]
this.standardForm.putTime2 = this.materialDate[1]
this.standardForm.creationTime1 = this.warningDate[0]
this.standardForm.creationTime2 = this.warningDate[1]
this.putTime1 = this.standardForm.putTime1
this.putTime2 = this.standardForm.putTime2
this.creationTime1 = this.standardForm.creationTime1
this.creationTime2 = this.standardForm.creationTime2
// 执行列表查询
this.getStandLawsByPage()
},
// 分页查询
getStandLawsByPage (item, flag) {
if (item) {
item.pageSize = this.$store.getters.userInfo.configContent
}
const data = {}
flag && (this.standardForm.page = this.page)
data.putTime1 = this.putTime1
data.putTime2 = this.putTime2
data.creationTime1 = this.creationTime1
data.creationTime2 = this.creationTime2
data.page = this.standardForm.page
data.pageSize = this.standardForm.pageSize
data.warnType = this.standardForm.warnType
this.standardForm.pageSize = this.$store.getters.userInfo.configContent
this.SarExportSearchEo = item || this.standardForm
this.loading = true
this.$http.get('lawss/msgSarPutTime/page', item || data, {
_this: this,
loading: this.loading
}, res => {
if (res.ok) {
this.warningData = res.data.list
this.total = res.data.count
this.loading = false
}
}, e => {
})
},
// 清空查询
resetSelect () {
this.page = 1
this.standardForm.putTime1 = ''
this.standardForm.putTime2 = ''
this.standardForm.creationTime1 = ''
this.standardForm.creationTime2 = ''
this.putTime1 = ''
this.putTime2 = ''
this.creationTime1 = ''
this.creationTime2 = ''
this.materialDate = []
this.warningDate = []
// 执行列表查询
this.getStandLawsByPage(this.tableFlag, 1)
},
// 新增,编辑弹窗打开
standsAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增'
this.dialogState = true
this.$nextTick(() => {
if (this.$refs['warningModelData']) {
this.$refs['warningModelData'].resetFields()
}
})
} else {
this.title = '编辑'
this.warningModelData = row
this.dialogState = true
}
},
// 新增预警标准确定
saveWarning () {
this.$refs['warningModelData'].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.$http.post('lawss/msgSarPutTime/addmsgSarPutTime', this.warningModelData, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
})
} else {
this.$http.post('lawss/msgSarPutTime/updateemsgSarPutTime', this.warningModelData, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
})
}
} else {
}
})
},
// 取消
closeModal () {
this.page = 1
this.getStandLawsByPage()
this.warningModelData = {
// 预警类型
warnType: 'STAND',
// 预警时间
creationTime: '',
// 预警信息分类
sarPutType: '',
// 实施日期
putTime: '',
// 判断法规类型是国内还是国外,从内部弹窗里查
sarType: '',
// 标准名称
standName: '',
// 标准id
sarId: ''
}
this.$nextTick(() => {
this.$refs['warningModelData'].resetFields()
})
this.dialogState = false
},
// 关闭弹窗
handleClose () {
this.page = 1
this.getStandLawsByPage(this.tableFlag, 1)
this.warningModelData = {
// 预警类型
warnType: 'STAND',
// 预警时间
creationTime: '',
// 预警信息分类
sarPutType: '',
// 实施日期
putTime: '',
// 判断法规类型是国内还是国外,从内部弹窗里查
sarType: '',
// 标准名称
standName: '',
// 标准id
sarId: ''
}
this.$nextTick(() => {
if (this.$refs['warningModelData']) {
this.$refs['warningModelData'].resetFields()
}
})
this.dialogState = false
},
// 打开选择弹窗
openDialog () {
// this.singleSelection = []
this.getDomesticStandardTable()
this.chooseDialog = true
},
// 分页查询国内标准
getDomesticStandardTable (item) {
this.sarStandardsSearch.page = this.configPage
this.sarStandardsSearch.validFlag = 0
this.$http.get('lawss/sarStandardsInfo/getSarStandardsInfoPage', this.sarStandardsSearch, {
_this: this, loading: 'loading'
}, res => {
if (res.ok) {
const arr = res.data.list
this.stahndinfoList = arr
this.configTotal = res.data.count
this.$nextTick(() => {
this.stahndinfoList.map((item) => {
if (this.warningModelData.sarId === item.id) {
this.singleSelection.push(item)
this.$refs.multipleTable.toggleRowSelection(item, true)
}
})
})
}
}, e => {
})
},
submitStand () {
this.warningModelData.standName = this.singleSelection[0].standName
this.warningModelData.sarType = this.singleSelection[0].standType
this.warningModelData.sarId = this.singleSelection[0].id
this.chooseDialog = false
this.$refs.multipleTable.clearSelection()
this.singleSelection = []
},
// 删除
classDel (row) {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.post('lawss/msgSarPutTime/deletemsgSarPutTime', {
ids: row.id
}, {
_this: this, loading: 'loading'
}, res => {
if (res.ok) {
this.$message({
showClose: true,
message: '删除成功',
type: 'success'
})
this.page = 1
this.getStandLawsByPage(this.tableFlag, 1)
}
})
})
},
// 批量删除
warningStandardsDel () {
if (this.selectNum.length === 0) {
this.$message.error('请先选择要删除的数据!')
} else {
this.$confirm('确认删除选中数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.post('lawss/msgSarPutTime/deletemsgSarPutTime', {ids: this.selectNum}, {
_this: this
}, res => {
if (res.ok) {
this.$message({
showClose: true,
message: '删除成功',
type: 'success'
})
this.page = 1
this.getStandLawsByPage(this.tableFlag, 1)
this.selectNum = []
}
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
}
},
// 导出选中的标准 此处因为复选框没有设置好,所以先设置导出所有数据
exportStandard (type) {
// 区别是选择导出还是全部导出
this.saveExportType = type
if (type === 'apart') {
if (this.selectNum.length > 0) {
this.exportName = ''
this.exportModelFlag = true
} else {
this.$message({
message: '请先选择要导出的数据',
type: 'warning'
})
}
} else {
this.exportName = ''
this.exportModelFlag = true
}
},
// 导出确定功能
exportTestItem () {
if (this.saveExportType === 'apart') {
if (this.selectNum != null && this.selectNum !== '') {
window.open('/api/lawss/msgSarPutTime/exportStandardsInfoExcel?exportType=' + this.saveExportType + '&exportContent=' + this.selectNum + '&exportName=' + this.exportName)
this.$message.success('导出信息成功')
}
} else if (this.saveExportType === 'all') {
// if (this.SarExportSearchEo.dicTypeCode === '') {
// delete this.SarExportSearchEo.dicTypeCode
// }
// let exportEO = this.tableFlag === '' ? this.standardForm : this.tableFlag
let exportEOStr = JSON.stringify(this.SarExportSearchEo)
exportEOStr = exportEOStr.replace(/""/g, null)
window.open('/api/lawss/msgSarPutTime/exportStandardsInfoExcel?exportType=' + this.saveExportType + '&exportContent=' + exportEOStr + '&exportName=' + this.exportName)
this.$message.success('导出信息成功')
}
this.exportModelFlag = false
},
// 导出取消按钮关闭模态、置空
cancal () {
this.exportModelFlag = false
},
pageChange (page) {
let pageObj
if (this.tableFlag !== '') {
this.tableFlag.page = page
pageObj = this.tableFlag
} else {
this.standardForm.page = page
pageObj = this.standardForm
}
this.getStandLawsByPage(pageObj)
},
pageSizeChange (pageSize) {
this.standardForm.pageSize = this.$store.getters.userInfo.configContent
this.rows = pageSize
this.getStandLawsByPage(this.tableFlag)
},
// 分页点击后方法
configuraPageChange (page) {
this.configPage = page
this.getDomesticStandardTable()
},
// 分页每页显示数改变后方法
configuraPageSizeChange (pageSize) {
this.sarStandardsSearch.pageSize = this.$store.getters.userInfo.configContent
this.configRows = pageSize
// this.selectConfiguraStand()
this.getDomesticStandardTable()
// 此处需要调用接口,修改个人配置
}
},
mounted () {
this.getStandLawsByPage()
}
}
</script>
<style lang="less" scoped>
.warning-standard {
position: relative;
height: 100%;
padding: 10px 10px 0;
background: #fff;
display: flex;
flex-direction: column;
.action-bar {
margin-bottom: 5px;
}
.content {
padding: 0;
width: 100%;
flex: auto;
overflow-y: auto;
display: flex;
flex-direction: column;
.table-wrap {
flex: auto;
overflow: hidden;
}
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
.demo-drawer__footer {
width: 100%;
position: absolute;
bottom: 0;
left: 0;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
background: #fff;
z-index: 999;
.el-button {
width: 60px;
height: 32px;
}
}
}
.chooseBtn{
height: 32px;
padding: 0 15px;
color: #fff;
background-color: #3391CE;
border-color: #3391CE;
&.is-disabled {
background-color: #b0d3ed !important;
border-color: #bcd1e0 !important;
}
}
.chooseBtn:hover {
padding: 0 15px;
background-color: #3391CE;
border-color: #3391CE;
}
.chooseBtn:focus {
padding: 0 15px;
}
.el-form--inline {
.el-form-item {
margin-right: 5px;
&:last-child {
margin-right: 0;
}
/deep/.el-form-item__content {
line-height: normal;
}
}
}
.action-bar {
line-height: normal;
padding: 0;
margin-bottom: 10px;
}
.pagination {
position: static;
/deep/.pagination-slot {
padding: 0;
}
}
}
</style>
@@ -0,0 +1,46 @@
<template>
<div class="regulatory-repository v-class">
<panel-header :tabs="tabsList" @activated="showComponent" :active="active"></panel-header>
<panel-content>
<transition enter-active-class="" leave-active-class="">
<components :is="active"></components>
</transition>
</panel-content>
</div>
</template>
<script>
import warningStandard from './components/warningStandard'
import warningClause from './components/warningClause'
export default {
name: 'warningManage',
components: {
warningClause,
warningStandard
},
data () {
return {
active: 'warningStandard',
tabsList: [ {
title: this.$t('m.earlyWarningStandard'),
name: 'warningStandard'
}, {
title: this.$t('m.earlyWarningClause'),
name: 'warningClause'
}]
}
},
methods: {
// tabs 切换事件
showComponent (name) {
this.active = name
}
}
}
</script>
<style lang="less" scoped>
.regulatory-repository{
height: 100%;
}
</style>