[fix 87598] 拆分-导入拆分结果-选择标准来源调整
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
<div class="table-page-search-wrapper">
|
<div class="table-page-search-wrapper">
|
||||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :sm="6">
|
<a-col :sm="6" v-show="!splitSearch">
|
||||||
<a-form-item :label="$t('standardSelect.source')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item :label="$t('standardSelect.source')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<j-dict-select-tag style="width: 100%" v-model="queryParam.source"
|
<j-dict-select-tag style="width: 100%" v-model="queryParam.source"
|
||||||
:disabled="disabledSourceSearch"
|
:disabled="disabledSourceSearch"
|
||||||
@@ -22,6 +22,24 @@
|
|||||||
@change="handleTypeChange" />
|
@change="handleTypeChange" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<!--标准结构树-->
|
||||||
|
<a-col :md="8" :sm="12" v-if="splitSearch">
|
||||||
|
<a-form-item :label="$t('docTool.comparison.standardStructureTree')">
|
||||||
|
<a-tree-select
|
||||||
|
tree-node-filter-prop="title"
|
||||||
|
v-model="queryParam.standardSystem"
|
||||||
|
:maxTagCount="1"
|
||||||
|
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||||
|
:tree-data="standardStructureTree"
|
||||||
|
tree-checkable
|
||||||
|
show-search
|
||||||
|
allowClear
|
||||||
|
tree-check-strictly
|
||||||
|
:filterTreeNode="filterTreeOption"
|
||||||
|
:placeholder="$t('pleaseSelect') + $t('docTool.comparison.standardStructureTree')"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :sm="8">
|
<a-col :sm="8">
|
||||||
<a-form-item :label="$t('standardSelect.standardNumOrName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item :label="$t('standardSelect.standardNumOrName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<a-input :placeholder="$t('pleaseEnter')+$t('standardSelect.standardNumOrName')"
|
<a-input :placeholder="$t('pleaseEnter')+$t('standardSelect.standardNumOrName')"
|
||||||
@@ -83,6 +101,7 @@
|
|||||||
import { ajaxGetDictItems, getStandardList } from '@/api/api'
|
import { ajaxGetDictItems, getStandardList } from '@/api/api'
|
||||||
import JDictSelectTag from '../dict/JDictSelectTag'
|
import JDictSelectTag from '../dict/JDictSelectTag'
|
||||||
import { StandardSource } from '../../enums/commonEnums'
|
import { StandardSource } from '../../enums/commonEnums'
|
||||||
|
import { getForeignStandardTree } from '@api/standardRegulationLibraryApi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StandardSelectionModal',
|
name: 'StandardSelectionModal',
|
||||||
@@ -127,6 +146,12 @@ export default {
|
|||||||
default: () => {
|
default: () => {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// 是否拆分的搜索(来源换成外部标准结构树)
|
||||||
|
splitSearch: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
@@ -189,7 +214,15 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
dataList: [],
|
dataList: [],
|
||||||
sourceOptions: []
|
sourceOptions: [],
|
||||||
|
// 标准结构树
|
||||||
|
standardStructureTree: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
// 拆分的需要加载标准结构树
|
||||||
|
if (this.splitSearch) {
|
||||||
|
this.loadStandardStructureTree()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -210,6 +243,38 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 加载标准结构树
|
||||||
|
loadStandardStructureTree () {
|
||||||
|
// option 不传显示我的收藏,1不显示我的收藏, 2只能选二级中国及中国下三级,和欧盟EU
|
||||||
|
getForeignStandardTree({ option: 2 }).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
const data = res.result || []
|
||||||
|
this.standardStructureTree = data.map(item => {
|
||||||
|
item.disabled = true
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// tree-select搜索
|
||||||
|
filterTreeOption (input, option) {
|
||||||
|
const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label
|
||||||
|
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||||
|
},
|
||||||
|
// 获取树结构没有被禁用的value值
|
||||||
|
getValuesWhereNotDisabled (tree = []) {
|
||||||
|
const values = []
|
||||||
|
function traverse (node) {
|
||||||
|
if (!node.disabled) { // 只处理 disabled 不为 true 的节点
|
||||||
|
values.push(node.value)
|
||||||
|
}
|
||||||
|
if (node.children && node.children.length > 0) {
|
||||||
|
node.children.forEach(child => traverse(child))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tree.forEach(node => traverse(node))
|
||||||
|
return values
|
||||||
|
},
|
||||||
// 获取表格数据
|
// 获取表格数据
|
||||||
replacePage (arg) {
|
replacePage (arg) {
|
||||||
if (arg === 1) {
|
if (arg === 1) {
|
||||||
@@ -222,6 +287,12 @@ export default {
|
|||||||
pageSize: this.ipagination.pageSize,
|
pageSize: this.ipagination.pageSize,
|
||||||
excludeStandardNumbers: this.excludeStandardNumbers
|
excludeStandardNumbers: this.excludeStandardNumbers
|
||||||
}
|
}
|
||||||
|
// 标准结构树
|
||||||
|
if (Array.isArray(query.standardSystem) && query.standardSystem.length) {
|
||||||
|
query.standardSystem = query.standardSystem.map(item => item.value).join(',')
|
||||||
|
} else {
|
||||||
|
query.standardSystem = this.getValuesWhereNotDisabled(this.standardStructureTree).join(',')
|
||||||
|
}
|
||||||
// 清空在可选范围内进行查询
|
// 清空在可选范围内进行查询
|
||||||
if (!query.source && this.canSelectedSource.length < 3) {
|
if (!query.source && this.canSelectedSource.length < 3) {
|
||||||
query.source = this.canSelectedSource.join(',')
|
query.source = this.canSelectedSource.join(',')
|
||||||
|
|||||||
@@ -17,9 +17,11 @@
|
|||||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardSelect.standardNumber')">
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardSelect.standardNumber')">
|
||||||
<standard-selection :placeholder="$t('pleaseSelect') + $t('standardSelect.standardNumber')"
|
<standard-selection :placeholder="$t('pleaseSelect') + $t('standardSelect.standardNumber')"
|
||||||
type="radio"
|
type="radio"
|
||||||
|
splitSearch
|
||||||
|
disabledSourceSearch
|
||||||
@nameChange="handleStandardNumberChange"
|
@nameChange="handleStandardNumberChange"
|
||||||
:select-only="true"
|
:select-only="true"
|
||||||
:can-selected-source="[StandardSource.FOREIGN.value, StandardSource.ENTERPRISE.value]"
|
:can-selected-source="[StandardSource.FOREIGN.value]"
|
||||||
class="readonly-input"
|
class="readonly-input"
|
||||||
v-decorator="['serialNumber', validatorRules.serialNumber]" />
|
v-decorator="['serialNumber', validatorRules.serialNumber]" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|||||||
@@ -151,6 +151,20 @@ export default {
|
|||||||
this.loadStandardStructureTree()
|
this.loadStandardStructureTree()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 获取树结构没有被禁用的value值
|
||||||
|
getValuesWhereNotDisabled (tree = []) {
|
||||||
|
const values = []
|
||||||
|
function traverse (node) {
|
||||||
|
if (!node.disabled) { // 只处理 disabled 不为 true 的节点
|
||||||
|
values.push(node.value)
|
||||||
|
}
|
||||||
|
if (node.children && node.children.length > 0) {
|
||||||
|
node.children.forEach(child => traverse(child))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tree.forEach(node => traverse(node))
|
||||||
|
return values
|
||||||
|
},
|
||||||
getQueryParams () {
|
getQueryParams () {
|
||||||
// 获取查询条件
|
// 获取查询条件
|
||||||
const sqp = {}
|
const sqp = {}
|
||||||
@@ -162,18 +176,23 @@ export default {
|
|||||||
param.field = this.getQueryField()
|
param.field = this.getQueryField()
|
||||||
param.pageNo = this.ipagination.current
|
param.pageNo = this.ipagination.current
|
||||||
param.pageSize = this.ipagination.pageSize
|
param.pageSize = this.ipagination.pageSize
|
||||||
if (Array.isArray(param.standardSystem)) {
|
if (Array.isArray(param.standardSystem) && param.standardSystem.length) {
|
||||||
param.standardSystem = param.standardSystem.map(item => item.value).join(',')
|
param.standardSystem = param.standardSystem.map(item => item.value).join(',')
|
||||||
|
} else {
|
||||||
|
param.standardSystem = this.getValuesWhereNotDisabled(this.standardStructureTree).join(',')
|
||||||
}
|
}
|
||||||
return filterObj(param)
|
return filterObj(param)
|
||||||
},
|
},
|
||||||
// 加载标准结构树
|
// 加载标准结构树
|
||||||
loadStandardStructureTree () {
|
loadStandardStructureTree () {
|
||||||
// option 不传显示我的收藏,1不显示我的收藏
|
// option 不传显示我的收藏,1不显示我的收藏, 2只能选二级中国及中国下三级,和欧盟EU
|
||||||
getForeignStandardTree({ option: 1 }).then(res => {
|
getForeignStandardTree({ option: 2 }).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
console.log(res.result)
|
const data = res.result || []
|
||||||
this.standardStructureTree = res.result || []
|
this.standardStructureTree = data.map(item => {
|
||||||
|
item.disabled = true
|
||||||
|
return item
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user