147 lines
		
	
	
		
			4.8 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
		
		
			
		
	
	
			147 lines
		
	
	
		
			4.8 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
|   | <template> | ||
|  |     <el-container | ||
|  |             id="methodObject" | ||
|  |             v-loading="loading" | ||
|  |             :element-loading-text="loadingText"> | ||
|  |         <el-main style="padding: 0px 20px;"> | ||
|  |             <el-table | ||
|  |                     ref="table" | ||
|  |                     highlight-current-row | ||
|  |                     :height="tableHeight" | ||
|  |                     :data="tableData" | ||
|  |                     size="small"> | ||
|  |                 <el-table-column | ||
|  |                         prop="no" | ||
|  |                         label="序号" | ||
|  |                         width="100" | ||
|  |                         align="center"> | ||
|  |                 </el-table-column> | ||
|  |                 <el-table-column | ||
|  |                         prop="code" | ||
|  |                         label="代码" | ||
|  |                         width="130"> | ||
|  |                 </el-table-column> | ||
|  |                 <el-table-column | ||
|  |                         prop="fromShapeId" | ||
|  |                         label="主动名称" | ||
|  |                         width="250"> | ||
|  |                 </el-table-column> | ||
|  |                 <el-table-column | ||
|  |                         prop="toShapeId" | ||
|  |                         label="被动名称" | ||
|  |                         min-width="250"> | ||
|  |                 </el-table-column> | ||
|  |                 <el-table-column | ||
|  |                         prop="outComingName" | ||
|  |                         label="连出范围" | ||
|  |                         width="200"> | ||
|  |                 </el-table-column> | ||
|  |                 <el-table-column | ||
|  |                         prop="inComingName" | ||
|  |                         label="连入范围" | ||
|  |                         width="200"> | ||
|  |                 </el-table-column> | ||
|  |             </el-table> | ||
|  |         </el-main> | ||
|  |     </el-container> | ||
|  | </template> | ||
|  | 
 | ||
|  | <script> | ||
|  |     import awsuiAxios from "../../awsuiAxios"; | ||
|  | 
 | ||
|  |     export default { | ||
|  |         name: "MethodLink", | ||
|  |         props: { | ||
|  |             parentHeaderHeight: { | ||
|  |                 type: String, | ||
|  |                 default: '0px' | ||
|  |             }, | ||
|  |             methodId: { | ||
|  |                 type: String, | ||
|  |                 default: '' | ||
|  |             }, | ||
|  |             methodName: { | ||
|  |                 type: String, | ||
|  |                 default: '' | ||
|  |             }, | ||
|  |             searchInput: { | ||
|  |                 type: String, | ||
|  |                 default: '' | ||
|  |             } | ||
|  |         }, | ||
|  |         data() { | ||
|  |             return { | ||
|  |                 loading: false, | ||
|  |                 loadingText: "加载中", | ||
|  |                 tableHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - parseInt(this.parentHeaderHeight)) + 'px', | ||
|  |                 tableData: [], | ||
|  |                 tableTempData: [] | ||
|  |             } | ||
|  |         }, | ||
|  |         mounted() { | ||
|  |             this.initData(); | ||
|  |         }, | ||
|  |         methods: { | ||
|  |             initData() {// 初始化数据查询
 | ||
|  |                 const that = this; | ||
|  |                 that.loadingText = '加载中'; | ||
|  |                 that.loading = true; | ||
|  |                 const params = { | ||
|  |                     url:'jd', | ||
|  |                     data:{ | ||
|  |                         cmd: 'com.actionsoft.apps.coe.pal_pl_manage_method_link_data_query', | ||
|  |                         methodId: that.methodId | ||
|  |                     } | ||
|  |                 }; | ||
|  |                 awsuiAxios.post(params).then(function (ro) {// 查询数据总条数
 | ||
|  |                     that.loading = false; | ||
|  |                     if (ro.result == 'ok') { | ||
|  |                         for (let i = 0; i < ro.data.length; i++) { | ||
|  |                             ro.data[i].no = i + 1; | ||
|  |                             that.tableTempData.push(ro.data[i]); | ||
|  |                         } | ||
|  |                         that.search(that.searchInput); | ||
|  |                     } else { | ||
|  |                         alert('请求响应错误'); | ||
|  |                     } | ||
|  |                 }).catch(error=>{ | ||
|  |                     console.log(error); | ||
|  |                     that.loading = false; | ||
|  |                 }) | ||
|  |             }, | ||
|  |             handleDataNo(data) {// 处理数据的序号
 | ||
|  |                 for (let i = 0; i < data.length; i++) { | ||
|  |                     data[i].no = i+1; | ||
|  |                 } | ||
|  |                 return data; | ||
|  |             }, | ||
|  |             search(searchInput) { | ||
|  |                 if (searchInput && searchInput.trim() != '') {// 根据条件搜索
 | ||
|  |                     const data = []; | ||
|  |                     for (let i = 0; i < this.tableTempData.length; i++) { | ||
|  |                         if (this.tableTempData[i].fromShapeId.indexOf(searchInput) > -1) { | ||
|  |                             data.push(this.tableTempData[i]); | ||
|  |                         } | ||
|  |                     } | ||
|  |                     this.tableData = this.handleDataNo(data); | ||
|  |                 } else {// 显示全部
 | ||
|  |                     this.tableData = this.handleDataNo(this.tableTempData); | ||
|  |                 } | ||
|  |             }, | ||
|  |         }, | ||
|  |         computed: { | ||
|  |             listenTopMainHeight() { | ||
|  |                 return this.$store.getters.getTopMainHeightFn; | ||
|  |             } | ||
|  |         }, | ||
|  |         watch: { | ||
|  |             listenTopMainHeight: function (newd, old) { | ||
|  |                 this.tableHeight = (parseInt(newd)) - parseInt(this.parentHeaderHeight) + 'px'; | ||
|  |             } | ||
|  |         } | ||
|  |     } | ||
|  | </script> | ||
|  | 
 | ||
|  | <style scoped> | ||
|  | 
 | ||
|  | </style> |