| | |
| | | <template> |
| | | <avue-input-tree :props="props" :lazy="lazy" :tree-load="treeLoad" :leaf-only="!referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="placeholder" :dic="treeData"></avue-input-tree> |
| | | <avue-input-tree ref="referTree" :props="props" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :leaf-only="!referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="placeholder" :dic="treeData"></avue-input-tree> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | |
| | | export default { |
| | | name: "vciWebReferTree", |
| | | props:["referConfig","value"], |
| | | props:["referConfig","value","text"], |
| | | data() { |
| | | return { |
| | | options: this.referConfig.options, |
| | |
| | | //value:"value", |
| | | //label:"title" |
| | | }, |
| | | treeUrl: this.referConfig.options.url || '',//'/api/ubcs-code/codeClassify/treeCodeClassify', |
| | | treeUrl: this.referConfig.options.url || '/api/ubcs-code/codeClassify/treeCodeClassify', |
| | | treeData: [], |
| | | currentNode:{}, |
| | | params: {}, |
| | | loadType: {'all': 'all', 'node': 'node'}, |
| | | copyParam: ['btmType', 'lnType', 'toBtmType', 'textField', 'valueField', 'parentFieldName', 'parentValue', 'sort', 'order', 'isDirection', 'whereSql', 'isMuti', 'queryScheme', 'isQueryAllColumn', 'queryColumn', 'split', 'loadType', 'onlyLeaf', 'onlyLeafText', 'parentUsedField'] |
| | |
| | | }, |
| | | created() { |
| | | this.getParams(); |
| | | console.log('referConfig:') |
| | | console.log(this.referConfig) |
| | | }, |
| | | mounted() { |
| | | if(!this.lazy){ |
| | |
| | | methods: { |
| | | getParams:function (){ |
| | | var queryParams = {}; |
| | | debugger; |
| | | if(this.options.extraParams){ |
| | | queryParams = this.options.extraParams; |
| | | } |
| | |
| | | } |
| | | })) |
| | | }); |
| | | }, |
| | | nodeClick(data){ |
| | | //不要用watch监听value值,会找不到text |
| | | this.value=data[this.props.value]; |
| | | this.text=data[this.props.label]; |
| | | this.currentNode=data; |
| | | this.$emit("setValue", {field:this.referConfig.field,showField:this.referConfig.showField,value:this.value,text:this.text,rawData:this.currentNode}); |
| | | } |
| | | |
| | | }, |
| | | watch:{ |
| | | } |
| | | } |
| | | </script> |