【变更】文档拆分 80787
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="10">
|
||||
<a-form-item :label="$t('treeSelection.primaryNodeName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('treeSelection.primaryNodeName')" v-model="queryParam.nodeName" />
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('treeSelection.primaryNodeName')" v-model="queryParam[searchField]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@@ -36,9 +36,9 @@
|
||||
:scroll="{x: '100%'}"
|
||||
:data-source="dataSource"
|
||||
:pagination="ipagination"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: type }"
|
||||
:row-selection="rowSelection"
|
||||
:loading="confirmLoading"
|
||||
childrenColumnName="childPartNameList"
|
||||
:childrenColumnName="childrenFieldName"
|
||||
@change="handleTableChange">
|
||||
<template slot="text" slot-scope="text">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
@@ -61,6 +61,7 @@
|
||||
|
||||
<script>
|
||||
import { getAction } from '../../api/manage'
|
||||
import { StandardSource } from '../../enums/commonEnums'
|
||||
|
||||
export default {
|
||||
name: 'TreeSelectModal',
|
||||
@@ -86,6 +87,38 @@ export default {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
// 树形数据取值字段
|
||||
childrenColumnName: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'childPartNameList'
|
||||
},
|
||||
// 标签库的限制,只能选第三级
|
||||
isTagLibraryRestriction: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
// 查询传的字段值
|
||||
searchFieldName: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'nodeName'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
rowSelection () {
|
||||
return {
|
||||
selectedRowKeys: this.selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
type: this.type,
|
||||
getCheckboxProps: record => ({
|
||||
props: {
|
||||
disabled: this.isTagLibraryRestriction ? record.level + '' !== '3' : false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -122,13 +155,15 @@ export default {
|
||||
],
|
||||
dataSource: [],
|
||||
selectedRowKeys: [],
|
||||
url: {
|
||||
queryByCodes: '/laws/standard/partName/echo'
|
||||
}
|
||||
childrenFieldName: 'childPartNameList',
|
||||
searchField: 'nodeName'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open (values) {
|
||||
// 处理零部件和标签的字段不一致的问题,默认的是零部件的
|
||||
this.childrenFieldName = this.childrenColumnName || 'childPartNameList'
|
||||
this.searchField = this.searchFieldName || 'nodeName'
|
||||
this.visible = true
|
||||
this.selectedRowKeys = values ? values.split(',') : []
|
||||
this.loadData(1)
|
||||
@@ -235,7 +270,17 @@ export default {
|
||||
const params = {
|
||||
selectNodeCodes: codes
|
||||
}
|
||||
getAction(this.url.queryByCodes, params).then(res => {
|
||||
let url
|
||||
// 零部件
|
||||
if (this.optionsHref === '/laws/standard/partName/') {
|
||||
url = '/laws/standard/partName/echo'
|
||||
} else if (this.optionsHref === '/laws/lawsLabelDatabase/queryTreeList') { // 标签库
|
||||
url = '/laws/lawsLabelDatabase/queryByCodes'
|
||||
}
|
||||
if (!url) {
|
||||
return
|
||||
}
|
||||
getAction(url, params).then(res => {
|
||||
if (res.success) {
|
||||
this.dataSourceRight = res.result || []
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{{ $t('userSelect.select') }}
|
||||
</a-button>
|
||||
|
||||
<tree-select-modal ref="selectModal" v-bind="$attrs" @change="selectChange" @nameChange="nameChange"/>
|
||||
<tree-select-modal ref="selectModal" v-bind="$attrs" @change="selectChange" @nameChange="nameChange" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
default: () => {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
nameStr: {
|
||||
|
||||
Reference in New Issue
Block a user