|
@@ -20,21 +20,23 @@
|
|
|
}
|
|
|
|
|
|
.left_header {
|
|
|
+ height: 40px;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
.tips {
|
|
|
margin-top: 15px;
|
|
|
}
|
|
|
.inp {
|
|
|
- width: 280px;
|
|
|
-
|
|
|
+ width: 150px;
|
|
|
/deep/.el-input__inner {
|
|
|
height: 30px;
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ .right_header {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
.table_form {
|
|
|
width: 100%;
|
|
|
box-sizing: border-box;
|
|
@@ -45,36 +47,60 @@
|
|
|
flex-wrap: wrap;
|
|
|
}
|
|
|
.table_content {
|
|
|
- min-height: 200px;
|
|
|
- height: calc(100vh - 264px);
|
|
|
margin-top: 10px;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
+ overflow: hidden;
|
|
|
.table_left {
|
|
|
- flex: 1;
|
|
|
+ width: 45%;
|
|
|
+ float: left;
|
|
|
margin-right: 10px;
|
|
|
background: #ffffff;
|
|
|
- padding: 0 50px;
|
|
|
-
|
|
|
+ padding: 0 2%;
|
|
|
.left_box {
|
|
|
margin: 30px 0;
|
|
|
overflow: hidden;
|
|
|
- overflow-y: auto;
|
|
|
- height: calc(100vh - 410px);
|
|
|
+ min-height: calc(100vh - 410px);
|
|
|
}
|
|
|
.tabs {
|
|
|
- float: left;
|
|
|
- max-width: 49%;
|
|
|
- min-width: 49%;
|
|
|
+ max-width: 100%;
|
|
|
+ min-width: 100%;
|
|
|
+ border-color: #dcdfe6;
|
|
|
}
|
|
|
.form_btn {
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
+ padding-bottom: 15px;
|
|
|
}
|
|
|
}
|
|
|
.table_right {
|
|
|
- width: 300px;
|
|
|
+ width: 45%;
|
|
|
+ float: right;
|
|
|
background: #ffffff;
|
|
|
+ padding: 0 2%;
|
|
|
+ .right_box {
|
|
|
+ margin: 30px 0;
|
|
|
+ overflow: hidden;
|
|
|
+ min-height: calc(100vh - 410px);
|
|
|
+ }
|
|
|
+ .tabs {
|
|
|
+ max-width: 100%;
|
|
|
+ min-width: 100%;
|
|
|
+ border-color: #dcdfe6;
|
|
|
+ }
|
|
|
+ .inp {
|
|
|
+ width: 100px;
|
|
|
+ /deep/.el-input__inner {
|
|
|
+ height: 30px;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .inps {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ .form_btn {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-bottom: 15px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
/deep/.el-select-dropdown__item.hover,
|
|
@@ -100,56 +126,42 @@
|
|
|
/deep/ .el-form-item.is-success .el-textarea__inner {
|
|
|
border-color: #c9c9c9 !important;
|
|
|
}
|
|
|
- .conceptSearch {
|
|
|
- width: 100%;
|
|
|
- text-align: center;
|
|
|
- z-index: 2;
|
|
|
- padding: 30px;
|
|
|
- box-sizing: border-box;
|
|
|
- .conceptTitle {
|
|
|
- width: 100%;
|
|
|
- text-align: center;
|
|
|
- padding: 20px 0;
|
|
|
- }
|
|
|
- .searchText {
|
|
|
- padding: 0 35px 0 15px;
|
|
|
- width: 100%;
|
|
|
- height: 34px;
|
|
|
- border: 1px solid #c9c9c9;
|
|
|
- box-sizing: border-box;
|
|
|
- }
|
|
|
- .conceptList {
|
|
|
- min-height: 200px;
|
|
|
- max-height: 300px;
|
|
|
- margin: -2px auto 0;
|
|
|
- border: 1px solid #e1dfdf;
|
|
|
- overflow: hidden;
|
|
|
- overflow-y: auto;
|
|
|
- }
|
|
|
- .conceptItem {
|
|
|
- height: 34px;
|
|
|
- line-height: 34px;
|
|
|
- text-align: left;
|
|
|
- padding: 0 15px;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
- .conceptItem:hover {
|
|
|
- background: #f5f7fa;
|
|
|
- }
|
|
|
- .searchWrap {
|
|
|
- position: relative;
|
|
|
- .search {
|
|
|
- position: absolute;
|
|
|
- right: 7px;
|
|
|
- top: 8px;
|
|
|
- }
|
|
|
- }
|
|
|
+ /deep/ .el-table th.gutter {
|
|
|
+ display: table-cell !important;
|
|
|
+ }
|
|
|
+ /deep/.el-table .cell,
|
|
|
+ .el-table--border td:first-child .cell,
|
|
|
+ .el-table--border th:first-child .cell {
|
|
|
+ padding-right: 14px;
|
|
|
+ }
|
|
|
+ /*table边框颜色*/
|
|
|
+ /deep/ .el-table--border:after,
|
|
|
+ .el-table--group:after,
|
|
|
+ .el-table:before {
|
|
|
+ background-color: #dcdfe6;
|
|
|
+ }
|
|
|
+ /deep/ .el-table--border,
|
|
|
+ .el-table--group {
|
|
|
+ border-color: #dcdfe6;
|
|
|
}
|
|
|
- .noresult {
|
|
|
- padding: 20px 0;
|
|
|
- color: #ccc;
|
|
|
+ /deep/ .el-table td,
|
|
|
+ .el-table th.is-leaf {
|
|
|
+ border-bottom: 1px solid #dcdfe6;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-table--border th,
|
|
|
+ .el-table--border th.gutter:last-of-type {
|
|
|
+ border-bottom: 1px solid #dcdfe6;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-table--border td,
|
|
|
+ .el-table--border th {
|
|
|
+ border-right: 1px solid #dcdfe6;
|
|
|
}
|
|
|
}
|
|
|
+/deep/ .el-textarea__inner {
|
|
|
+ resize: none;
|
|
|
+}
|
|
|
</style>
|
|
|
<template>
|
|
|
<div>
|
|
@@ -207,21 +219,32 @@
|
|
|
<div class="table_content" v-if="onshow">
|
|
|
<div class="table_left">
|
|
|
<div class="left_header">
|
|
|
- <h4 class="tips">关联的术语({{form.concepts.length}})</h4>
|
|
|
- <el-input v-model="searchtext" @input="searchList" placeholder="请搜索" class="inp"></el-input>
|
|
|
+ <h5 class="tips">关联的术语({{form.concepts.length}})</h5>
|
|
|
+ <div style="display:flex">
|
|
|
+ <el-input v-model.trim="searchtext" @input="searchList" placeholder="关键词" class="inp"></el-input>
|
|
|
+ <span style="display:flex;align-items: center;margin:0 5px">-</span>
|
|
|
+ <el-input
|
|
|
+ v-model.trim="searchtext2"
|
|
|
+ @input="searchList"
|
|
|
+ placeholder="关键词"
|
|
|
+ class="inp"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="left_box">
|
|
|
<el-table
|
|
|
- v-if="firstList.length>0"
|
|
|
- :data="firstList"
|
|
|
+ :data="leftList"
|
|
|
border
|
|
|
+ style="min-height: 200px"
|
|
|
+ height="calc(100vh - 393px)"
|
|
|
class="tabs"
|
|
|
+ ref="table"
|
|
|
:header-row-style="{height:'40px'}"
|
|
|
- :header-cell-style="{height:'40px',padding:'0',background:'#f7f7f7'}"
|
|
|
+ :header-cell-style="{height:'40px',borderColor:'#DCDFE6'}"
|
|
|
>
|
|
|
<el-table-column prop="conceptLibName" :show-overflow-tooltip="true" label="术语名称"></el-table-column>
|
|
|
- <el-table-column label="操作" fixed="right">
|
|
|
+ <el-table-column label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -232,60 +255,81 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form_btn">
|
|
|
+ <el-button type="primary" size="medium " @click="saveSet">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="table_right">
|
|
|
+ <div class="right_header">
|
|
|
+ <el-select
|
|
|
+ v-model="formInline.logicalOperator"
|
|
|
+ class="inp inps"
|
|
|
+ @change="searchConcept"
|
|
|
+ >
|
|
|
+ <el-option label="and" value="0"></el-option>
|
|
|
+ <el-option label="or" value="1"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model.trim="formInline.name1"
|
|
|
+ @input="searchConcept"
|
|
|
+ placeholder="关键词"
|
|
|
+ class="inp"
|
|
|
+ ></el-input>
|
|
|
+ <span style="display:flex;align-items: center;margin:0 5px">-</span>
|
|
|
+ <el-input
|
|
|
+ v-model.trim="formInline.name2"
|
|
|
+ @input="searchConcept"
|
|
|
+ placeholder="关键词"
|
|
|
+ class="inp"
|
|
|
+ ></el-input>
|
|
|
+ <span style="display:flex;align-items: center;margin:0 5px">-</span>
|
|
|
+ <el-input
|
|
|
+ v-model.trim="formInline.name3"
|
|
|
+ @input="searchConcept"
|
|
|
+ placeholder="关键词"
|
|
|
+ class="inp"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="right_box">
|
|
|
<el-table
|
|
|
- v-if="lastList.length>0"
|
|
|
- :data="lastList"
|
|
|
+ :data="conceptList"
|
|
|
border
|
|
|
+ style="min-height: 200px"
|
|
|
+ height="calc(100vh - 393px)"
|
|
|
class="tabs"
|
|
|
+ ref="tables"
|
|
|
+ @row-click="btn"
|
|
|
:header-row-style="{height:'40px'}"
|
|
|
- :header-cell-style="{height:'40px',padding:'0',background:'#f7f7f7'}"
|
|
|
+ :header-cell-style="{height:'40px',borderColor:'#DCDFE6'}"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
>
|
|
|
- <el-table-column prop="conceptLibName" :show-overflow-tooltip="true" label="术语名称"></el-table-column>
|
|
|
- <el-table-column label="操作" fixed="right">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- class="delete"
|
|
|
- @click="showDelDialog(scope.row)"
|
|
|
- >移除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column type="selection"></el-table-column>
|
|
|
+ <el-table-column prop="conceptName" :show-overflow-tooltip="true" label="术语名称"></el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
-
|
|
|
<div class="form_btn">
|
|
|
- <el-button type="primary" size="medium " @click="saveSet">确定</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="table_right">
|
|
|
- <div class="conceptSearch" ref="conceptSearch">
|
|
|
- <h4 class="conceptTitle">添加关联术语</h4>
|
|
|
- <p class="searchWrap">
|
|
|
- <img class="search" src="../../images/search.png" alt="搜索" />
|
|
|
- <input
|
|
|
- v-model.trim="conceptText"
|
|
|
- @input="searchConcept"
|
|
|
- type="text"
|
|
|
- ref="conceptInput"
|
|
|
- class="searchText"
|
|
|
- placeholder="请输入关键词搜索"
|
|
|
- />
|
|
|
- </p>
|
|
|
- <ul class="conceptList" ref="conceptList">
|
|
|
- <li
|
|
|
- v-for="item in conceptList"
|
|
|
- class="conceptItem ellipsis"
|
|
|
- :title="item.conceptName"
|
|
|
- @click="selectConcept(item)"
|
|
|
- :key="item.conceptId"
|
|
|
- >{{item.conceptName}}</li>
|
|
|
- <li class="noresult" v-if="conceptList.length==0">暂无结果~</li>
|
|
|
- </ul>
|
|
|
+ <el-button size="medium " @click="add" icon="el-icon-caret-left">添加</el-button>
|
|
|
+ <el-button size="medium " @click="dialogVisible = true">文本批量添加</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <el-dialog
|
|
|
+ :title="'请输入要添加到关联的标准术语(每行一个)'+'共'+len+'行'"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="30%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :showClose="false"
|
|
|
+ >
|
|
|
+ <el-input type="textarea" :rows="15" placeholder="请输入内容" v-model="innerText"></el-input>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="collectcancel">保存并关闭</el-button>
|
|
|
+ <el-button type="primary" @click="collectionMatch">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script type="text/javascript">
|
|
@@ -297,17 +341,25 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
title: '术语集合内容维护-添加',
|
|
|
+ formInline: {
|
|
|
+ logicalOperator: '0',
|
|
|
+ name1: '',
|
|
|
+ name2: '',
|
|
|
+ name3: ''
|
|
|
+ },
|
|
|
+ innerText: '',
|
|
|
ruleTypeList: [],
|
|
|
ruleTermTypeList: [],
|
|
|
conceptList: [],
|
|
|
conceptText: '',
|
|
|
excludedConceptIds: [],
|
|
|
type: [],
|
|
|
- firstList: [],
|
|
|
- lastList: [],
|
|
|
+ leftList: [],
|
|
|
+ multipleSelection: [],
|
|
|
sign: 1,
|
|
|
searchtext: '',
|
|
|
- len: null,
|
|
|
+ searchtext2: '',
|
|
|
+ dialogVisible: false,
|
|
|
form: {
|
|
|
collectionLibType: '',
|
|
|
collectionLibName: '',
|
|
@@ -334,27 +386,53 @@ export default {
|
|
|
created() {
|
|
|
this.getDict();
|
|
|
const param = this.$route.params;
|
|
|
- let info = param.data;
|
|
|
- if (info) {
|
|
|
+ let type = param.type;
|
|
|
+ if (type == 2) {
|
|
|
this.title = '术语集合内容维护-' + '修改';
|
|
|
- this.form.collectionLibType = JSON.stringify(info.collectionLibType);
|
|
|
- this.form.collectionLibName = info.collectionLibName;
|
|
|
- this.form.concepts = info.concepts;
|
|
|
- this.form.conceptLibType = info.concepts[0].conceptLibType;
|
|
|
- this.form.collectionId = info.collectionId;
|
|
|
- this.form.collectionRemark = info.collectionRemark;
|
|
|
+ this.getInfo(param.id);
|
|
|
this.sign = 2;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.getList(this.form.concepts);
|
|
|
- this.getIds(this.form.concepts);
|
|
|
- this.getTreeSearchList();
|
|
|
- });
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
this.startCount = this.editCount;
|
|
|
}, 500);
|
|
|
},
|
|
|
methods: {
|
|
|
+ getInfo(id) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: 'Loading',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ api
|
|
|
+ .getRecordById({ id })
|
|
|
+ .then(res => {
|
|
|
+ loading.close();
|
|
|
+ if (res.data.code == '0') {
|
|
|
+ const data = res.data.data;
|
|
|
+ this.form.collectionLibType = JSON.stringify(
|
|
|
+ data.collectionLibType
|
|
|
+ );
|
|
|
+ this.form.collectionLibName = data.collectionLibName;
|
|
|
+ this.form.concepts = data.concepts;
|
|
|
+ this.form.conceptLibType = data.concepts[0].conceptLibType;
|
|
|
+ this.form.collectionId = data.collectionId;
|
|
|
+ this.form.collectionRemark = data.collectionRemark;
|
|
|
+ this.leftList = data.concepts;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.getIds(this.form.concepts);
|
|
|
+ this.getTreeSearchList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ loading.close();
|
|
|
+ this.warning('获取详情失败,请重试');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ collectcancel() {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ },
|
|
|
cancelRequest() {
|
|
|
if (typeof this.source === 'function') {
|
|
|
this.source('终止请求');
|
|
@@ -398,8 +476,21 @@ export default {
|
|
|
console.log(error);
|
|
|
});
|
|
|
},
|
|
|
- searchList(val) {
|
|
|
- let concepts = JSON.parse(JSON.stringify(this.form.concepts));
|
|
|
+ searchList() {
|
|
|
+ let concepts, val;
|
|
|
+ if (
|
|
|
+ (this.searchtext != '' && this.searchtext2 == '') ||
|
|
|
+ (this.searchtext == '' && this.searchtext2 != '')
|
|
|
+ ) {
|
|
|
+ concepts = JSON.parse(JSON.stringify(this.form.concepts));
|
|
|
+ val = this.searchtext != '' ? this.searchtext : this.searchtext2;
|
|
|
+ } else if (this.searchtext != '' && this.searchtext2 != '') {
|
|
|
+ concepts = JSON.parse(JSON.stringify(this.leftList));
|
|
|
+ val = this.searchtext2;
|
|
|
+ } else if (this.searchtext == '' && this.searchtext2 == '') {
|
|
|
+ this.leftList = JSON.parse(JSON.stringify(this.form.concepts));
|
|
|
+ return;
|
|
|
+ }
|
|
|
let str = '.*' + val + '.*';
|
|
|
let reg = new RegExp(str);
|
|
|
let arr = [];
|
|
@@ -409,7 +500,8 @@ export default {
|
|
|
arr.push(concepts[i]);
|
|
|
}
|
|
|
}
|
|
|
- this.getList(arr);
|
|
|
+ this.$refs.table.bodyWrapper.scrollTop = 0;
|
|
|
+ this.leftList = arr;
|
|
|
},
|
|
|
getCollectionLib(newValue) {
|
|
|
this.ruleTermTypeList.forEach(item => {
|
|
@@ -422,41 +514,108 @@ export default {
|
|
|
},
|
|
|
// 基础术语
|
|
|
searchConcept(e) {
|
|
|
- this.conceptText = e.target.value
|
|
|
if (this.timeout) {
|
|
|
clearTimeout(this.timeout);
|
|
|
}
|
|
|
this.timeout = setTimeout(() => {
|
|
|
- this.getTreeSearchList()
|
|
|
+ this.getTreeSearchList();
|
|
|
+ this.$refs.tables.bodyWrapper.scrollTop = 0;
|
|
|
}, 800);
|
|
|
},
|
|
|
- async getTreeSearchList(){
|
|
|
+ async getTreeSearchList() {
|
|
|
this.whether = true;
|
|
|
const params = {
|
|
|
- typeId: this.form.conceptLibType,
|
|
|
- name: this.conceptText,
|
|
|
- excludedConceptIds: this.excludedConceptIds
|
|
|
+ libType: this.form.conceptLibType,
|
|
|
+ names: [
|
|
|
+ this.formInline.name1,
|
|
|
+ this.formInline.name2,
|
|
|
+ this.formInline.name3
|
|
|
+ ],
|
|
|
+ excludedConceptIds: this.excludedConceptIds,
|
|
|
+ logicalOperator: this.formInline.logicalOperator
|
|
|
};
|
|
|
- const data = await api.getTreeSearchList(params)
|
|
|
+ const data = await api.searchCollectionConceptVO(params);
|
|
|
if (data.data.code == '0') {
|
|
|
this.conceptList = data.data.data;
|
|
|
this.whether = false;
|
|
|
}
|
|
|
},
|
|
|
- // 选择基础术语
|
|
|
- selectConcept(item) {
|
|
|
+ btn(row) {
|
|
|
if (this.whether) {
|
|
|
return;
|
|
|
}
|
|
|
let concepts = {
|
|
|
- conceptId: item.conceptId,
|
|
|
- conceptLibType: item.conceptNameType,
|
|
|
- conceptLibName: item.conceptName
|
|
|
+ conceptId: row.conceptId,
|
|
|
+ conceptLibType: row.libType,
|
|
|
+ conceptLibName: row.conceptName
|
|
|
};
|
|
|
- this.excludedConceptIds.push(item.conceptId);
|
|
|
+ this.excludedConceptIds.push(row.conceptId);
|
|
|
this.form.concepts.push(concepts);
|
|
|
- this.getList(this.form.concepts);
|
|
|
- this.conceptList = []
|
|
|
+ this.leftList = this.form.concepts;
|
|
|
+ this.conceptList = [];
|
|
|
+ this.searchtext = '';
|
|
|
+ this.searchtext2 = '';
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getTreeSearchList();
|
|
|
+ }, 150);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelection = val;
|
|
|
+ },
|
|
|
+ add() {
|
|
|
+ if (this.multipleSelection.length == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '添加数据不能为空',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.processing(this.multipleSelection);
|
|
|
+ this.searchtext = '';
|
|
|
+ this.searchtext2 = '';
|
|
|
+ },
|
|
|
+ //去重
|
|
|
+ unique(arr) {
|
|
|
+ let obj = {};
|
|
|
+ arr = arr.reduce(function(item, next) {
|
|
|
+ obj[next.conceptId]
|
|
|
+ ? ''
|
|
|
+ : (obj[next.conceptId] = true && item.push(next));
|
|
|
+ return item;
|
|
|
+ }, []);
|
|
|
+ return arr;
|
|
|
+ },
|
|
|
+ //过滤数组去重
|
|
|
+ unique2(arr) {
|
|
|
+ let obj = {};
|
|
|
+ arr = arr.reduce(function(item, next) {
|
|
|
+ obj[next] ? '' : (obj[next] = true && item.push(next));
|
|
|
+ return item;
|
|
|
+ }, []);
|
|
|
+ return arr;
|
|
|
+ },
|
|
|
+ //处理数据
|
|
|
+ processing(arr) {
|
|
|
+ if (this.whether) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ arr.forEach(it => {
|
|
|
+ let concepts = {
|
|
|
+ conceptId: it.conceptId,
|
|
|
+ conceptLibType: it.libType ? it.libType : it.conceptLibType,
|
|
|
+ conceptLibName: it.conceptName ? it.conceptName : it.conceptLibName
|
|
|
+ };
|
|
|
+ this.excludedConceptIds.push(it.conceptId);
|
|
|
+ this.form.concepts.push(concepts);
|
|
|
+ });
|
|
|
+
|
|
|
+ this.form.concepts = this.unique(this.form.concepts);
|
|
|
+ this.excludedConceptIds = this.unique2(this.excludedConceptIds);
|
|
|
+ this.leftList = this.form.concepts;
|
|
|
+ this.conceptList = [];
|
|
|
+ this.multipleSelection = [];
|
|
|
this.$nextTick(() => {
|
|
|
setTimeout(() => {
|
|
|
this.getTreeSearchList();
|
|
@@ -475,44 +634,48 @@ export default {
|
|
|
},
|
|
|
// 移除术语
|
|
|
showDelDialog(row) {
|
|
|
- this.form.concepts.forEach((item, index) => {
|
|
|
- if (item.conceptId == row.conceptId) {
|
|
|
- this.form.concepts.splice(index, 1);
|
|
|
- this.excludedConceptIds.splice(index, 1);
|
|
|
- }
|
|
|
- });
|
|
|
- this.getTreeSearchList();
|
|
|
- if (this.searchtext != '') {
|
|
|
- this.searchList(this.searchtext);
|
|
|
+ if (this.searchtext == '' && this.searchtext2 == '') {
|
|
|
+ this.form.concepts.forEach((item, index) => {
|
|
|
+ if (item.conceptId == row.conceptId) {
|
|
|
+ this.form.concepts.splice(index, 1);
|
|
|
+ this.excludedConceptIds.splice(index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.leftList = this.form.concepts;
|
|
|
} else {
|
|
|
- this.getList(this.form.concepts);
|
|
|
+ this.leftList.forEach((item, index) => {
|
|
|
+ if (item.conceptId == row.conceptId) {
|
|
|
+ this.leftList.splice(index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.form.concepts.forEach((item, index) => {
|
|
|
+ if (item.conceptId == row.conceptId) {
|
|
|
+ this.form.concepts.splice(index, 1);
|
|
|
+ this.excludedConceptIds.splice(index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- },
|
|
|
- getchk(num) {
|
|
|
- return num % 2 == 0 ? '偶数' : '奇数'; //判断是否能整除2
|
|
|
- },
|
|
|
- getList(arr) {
|
|
|
- this.firstList = [];
|
|
|
- this.lastList = [];
|
|
|
- arr.forEach((item, index) => {
|
|
|
- if (this.getchk(index) == '偶数') {
|
|
|
- this.firstList.push(item);
|
|
|
- } else {
|
|
|
- this.lastList.push(item);
|
|
|
- }
|
|
|
- });
|
|
|
+ this.getTreeSearchList();
|
|
|
},
|
|
|
saveSet() {
|
|
|
let params = {
|
|
|
...this.form,
|
|
|
relationId: 0
|
|
|
};
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: 'Loading',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
api.saveOrUpdateRecord(params).then(res => {
|
|
|
+ loading.close();
|
|
|
if (res.data.code == 0) {
|
|
|
this.$message({
|
|
|
message: '操作成功',
|
|
|
type: 'success'
|
|
|
});
|
|
|
+ this.loading2 = false;
|
|
|
this.isSaveSuccess = true;
|
|
|
this.$router.push({
|
|
|
name: 'TermSet',
|
|
@@ -521,17 +684,73 @@ export default {
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.data.msg,
|
|
|
- type: 'warning'
|
|
|
+ type: 'error'
|
|
|
});
|
|
|
+ loading.close();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ collectionMatch() {
|
|
|
+ this.innerText = this.innerText.replace(/(^\s*)|(\s*$)/g, "");
|
|
|
+ if (this.innerText.length == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '术语名称不能为空',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: 'Loading',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ let params = {
|
|
|
+ conceptLibNames: this.innerText,
|
|
|
+ conceptLibType: this.form.conceptLibType
|
|
|
+ };
|
|
|
+ api
|
|
|
+ .collectionMatch(params)
|
|
|
+ .then(res => {
|
|
|
+ loading.close();
|
|
|
+ if (res.data.code == '0') {
|
|
|
+ const data = res.data.data;
|
|
|
+ let text = '';
|
|
|
+ if (data.matchList.length > 0) {
|
|
|
+ this.processing(data.matchList);
|
|
|
+ if (
|
|
|
+ data.unMatchList.length == 0 &&
|
|
|
+ data.disableList.length == 0
|
|
|
+ ) {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (data.unMatchList.length > 0 || data.disableList.length > 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '列表中存在非标准术语或禁用术语',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ let arr = data.unMatchList.concat(data.disableList);
|
|
|
+ arr.forEach(it => {
|
|
|
+ text += it.conceptLibName + '\n';
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.innerText = text;
|
|
|
+ this.searchtext = '';
|
|
|
+ this.searchtext2 = '';
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.log(error);
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ },
|
|
|
clearData() {
|
|
|
this.form.collectionLibName = '';
|
|
|
this.conceptText = '';
|
|
|
this.ruleTermTypeList = [];
|
|
|
this.form.concepts = [];
|
|
|
- this.getList(this.form.concepts);
|
|
|
+ this.leftList = [];
|
|
|
this.getTreeSearchList();
|
|
|
}
|
|
|
},
|
|
@@ -570,6 +789,16 @@ export default {
|
|
|
return (
|
|
|
this.form.collectionLibType != '' && this.form.collectionLibName != ''
|
|
|
);
|
|
|
+ },
|
|
|
+ len() {
|
|
|
+ let arr = this.innerText.split('\n');
|
|
|
+ let len = 0;
|
|
|
+ arr.forEach(it => {
|
|
|
+ if (it != '') {
|
|
|
+ len++;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return len;
|
|
|
}
|
|
|
}
|
|
|
};
|