From 269904d54d259f5c6f8e776d98821187a72f9eb8 Mon Sep 17 00:00:00 2001
From: zhangxp <zhangxp@chicecm.com>
Date: 星期三, 23 八月 2023 15:54:58 +0800
Subject: [PATCH] 最大流水号
---
Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue | 1030 ++++++++++++++++++++++++++++++++------------------------
1 files changed, 582 insertions(+), 448 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue b/Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue
index 54f330f..adbf433 100644
--- a/Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue
+++ b/Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue
@@ -8,7 +8,7 @@
style="height: 115vh; margin-top: -14vh; overflow-y: hidden">
<div style="width: 100%; overflow-y: auto; height: 70vh">
<el-row style="width: 100%; height:70%">
- <el-col :style="toggleCrudWidth">
+ <el-col :style="toggleBasicCrudWidth">
<basic-container style="width: 100%;">
<avue-crud :option="referConfigCrudOption"
class="refer-config-crud"
@@ -42,8 +42,9 @@
</basic-container>
</el-col>
</el-row>
- <el-row style="width: 100%; height:30%; margin-top: 130px" v-show="srchCondParams.isShow && showAttrParams.isShow">
- <el-col v-show="srchCondParams.isShow" style="width: 40%;">
+ <el-row style="width: 100%; height:30%; margin-top: 130px">
+ <el-col
+ :style="toggleSrchCrudWidth">
<basic-container style="width: 100%; height:100%;">
<avue-crud :option="srchCondOption"
class="refer-srchcond-crud"
@@ -53,7 +54,7 @@
</avue-crud>
</basic-container>
</el-col>
- <el-col v-show="showAttrParams.isShow" style="width: 60%;">
+ <el-col v-show="showAttrParams.isShow" style="width: 60%; height: 100%;">
<basic-container style="width: 100%; height:100%;">
<avue-crud :option="showAttrOption"
class="refer-attr-crud"
@@ -76,87 +77,89 @@
//import func from "@/util/func";
import { getReferConfigPage } from "@/api/code/codeReferConfig";
export default {
- name: "referConfigDialog",
- props: {
- },
- data() {
- return{
- isShowReferConfigCrud:false,
- referConfigCrudOption: {
- border: true,
- height: '45vh',
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- index: true,
- selection: false,
- menu: false,
- addBtn: false,
- refreshBtn: false,
- searchShowBtn: false,
- columnBtn: false,
- dialogClickModal: false,
- highlightCurrentRow: true,
- align: 'center',
- menuAlign: 'center',
- column: [
- {
- label: '-',
- prop: 'radio',
- width: 60,
- hide: false
- },{
- label: '鍙傜収閰嶇疆缂栧彿',
- width: 120,
- search: true,
- searchSpan: 9,
- searchLabelWidth: 100,
- prop: 'id'
- },{
- label: '鍙傜収閰嶇疆鍚嶇О',
- search: true,
- searchSpan: 9,
- searchLabelWidth: 100,
- prop: 'name'
- },{
- label: '鍙傜収鐨勪笟鍔$被鍨�',
- search: false,
- prop: 'referType'
- },{
- label: '鏄剧ず鐨勫睘鎬�',
- search: false,
- prop: 'textField'
- },{
- label: '瀛樺偍鍊肩殑灞炴��',
- search: false,
- prop: 'valueField'
- },{
- label: '鍙傜収绐楀彛绫诲瀷',
- search: false,
- prop: 'typeText',
- }
- ],
+ name: "referConfigCrudDialog",
+ props: {
+
+ },
+ data() {
+ return{
+ isShowReferConfigCrud: false,
+ referConfigCrudOption: {
+ border: true,
+ height: '45vh',
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 6,
+ index: true,
+ selection: false,
+ menu: false,
+ addBtn: false,
+ refreshBtn: false,
+ searchShowBtn: false,
+ columnBtn: false,
+ dialogClickModal: false,
+ highlightCurrentRow: true,
+ align: 'center',
+ menuAlign: 'center',
+ column: [
+ {
+ label: '-',
+ prop: 'radio',
+ width: 60,
+ hide: false
+ },{
+ label: '鍙傜収閰嶇疆缂栧彿',
+ width: 120,
+ search: true,
+ searchSpan: 9,
+ searchLabelWidth: 100,
+ prop: 'id'
+ },{
+ label: '鍙傜収閰嶇疆鍚嶇О',
+ search: true,
+ searchSpan: 9,
+ searchLabelWidth: 100,
+ prop: 'name'
+ },{
+ label: '鍙傜収鐨勪笟鍔$被鍨�',
+ search: false,
+ prop: 'referTypeName'
+ },{
+ label: '鏄剧ず鐨勫睘鎬�',
+ search: false,
+ prop: 'textField'
+ },{
+ label: '瀛樺偍鍊肩殑灞炴��',
+ search: false,
+ prop: 'valueField'
+ },{
+ label: '鍙傜収绐楀彛绫诲瀷',
+ search: false,
+ prop: 'typeText',
+ }
+ ],
+ },
+ referConfigParams: {
+ ref: "referConfigCrud",
+ referConfigLoading: false,
+ referConfigData: [],
+ referConfigPage: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0
},
- referConfigParams: {
- ref: "referConfigCrud",
- referConfigLoading: false,
- referConfigData: [],
- referConfigPage: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- referConfigQuery: {},
- referConfigSelectedRowData: '',
- // 褰撳墠閫変腑琛�
- referConfigSelectedRow: '',
- },
- formOption: {
- submitBtn: false,
- emptyBtn: false,
- labelWidth: '150', //榛樿鏍囩瀹藉害
- // 榛樿閰嶇疆灏变负鏍戝舰绫诲瀷锛屾敼浜嗕細鍑虹幇闂
- column: [{
+ referConfigQuery: {},
+ referConfigSelectedRowData: '',
+ // 褰撳墠閫変腑琛�
+ referConfigSelectedRow: '',
+ },
+ formOption: {
+ submitBtn: false,
+ emptyBtn: false,
+ labelWidth: '150', //榛樿鏍囩瀹藉害
+ // 榛樿閰嶇疆灏变负鏍戝舰绫诲瀷锛屾敼浜嗕細鍑虹幇闂
+ column: [
+ {
label: '鏍戝舰鐨勪笂绾у睘鎬�',
prop: 'parentFieldName',
span: 24,
@@ -177,8 +180,7 @@
disabled: true,
row: true,
placeholder: ' ',
- },
- {
+ },{
label: '鏍戝姞杞芥柟寮�',
prop: 'loadType',
span: 24,
@@ -217,381 +219,513 @@
label: '闄嶅簭', value: 'desc'
}],
},
- ],
- },
- referConfigForm:{},
- // 鎺掑簭绫诲瀷鐨勮〃鍗曢厤缃�
- sortColumn:[{
- label: '姣忛〉鏄剧ず鏉℃暟',
- prop: 'limit',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
- },{
- label: '鎺掑簭瀛楁',
- prop: 'sortField',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
- },{
- label: '鎺掑簭绫诲瀷',
- prop: 'sortType',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
- dicData: [{
- label: '鍗囧簭', value: 'asc'
- }, {
- label: '闄嶅簭', value: 'desc'
- }],
- }],
- // 鏍戝舰绫诲瀷鐨勮〃鍗曢厤缃�
- treeColumn:[{
- label: '鏍戝舰鐨勪笂绾у睘鎬�',
- prop: 'parentFieldName',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
- },{
- label: '涓婄骇灞炴�у�煎搴斿睘鎬�',
- prop: 'parentUsedField',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
- },{
- label: '鏍硅妭鐐圭殑鍊�',
- prop: 'parentValue',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
- },
- {
- label: '鏍戝姞杞芥柟寮�',
- prop: 'loadType',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
- dicData: [{
- label: '鍏ㄩ儴', value: 'all'
- }, {
- label: '閫愮骇鍔犺浇', value: 'node'
- }],
- },{
- label: '鏄惁鍙兘閫夋嫨鍙跺瓙鑺傜偣',
- prop: 'onlyLeaf',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
- },{
- label: '鎺掑簭瀛楁',
- prop: 'sortField',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
- },{
- label: '鎺掑簭绫诲瀷',
- prop: 'sortType',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
- dicData: [{
- label: '鍗囧簭', value: 'asc'
- }, {
- label: '闄嶅簭', value: 'desc'
- }],
- },
],
- // 骞冲彴绫诲瀷鐨勮〃鍗曢厤缃�
- standColumn:[{
- label: '鍙傝�冪殑UI涓婁笅鏂�',
- prop: 'referContent',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
- },
- {
- label: '骞冲彴鐨勮〃鏍肩紪鍙�',
- prop: 'displayTable',
- span: 24,
- disabled: true,
- row: true,
- placeholder: ' ',
+ },
+ referConfigForm:{},
+ // 鎺掑簭绫诲瀷鐨勮〃鍗曢厤缃�
+ sortColumn:[{
+ label: '姣忛〉鏄剧ず鏉℃暟',
+ prop: 'limit',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ },{
+ label: '鎺掑簭瀛楁',
+ prop: 'sortField',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ },{
+ label: '鎺掑簭绫诲瀷',
+ prop: 'sortType',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ dicData: [{
+ label: '鍗囧簭', value: 'asc'
+ }, {
+ label: '闄嶅簭', value: 'desc'
}],
+ }],
+ // 鏍戝舰绫诲瀷鐨勮〃鍗曢厤缃�
+ treeColumn:[{
+ label: '鏍戝舰鐨勪笂绾у睘鎬�',
+ prop: 'parentFieldName',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ },{
+ label: '涓婄骇灞炴�у�煎搴斿睘鎬�',
+ prop: 'parentUsedField',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ },{
+ label: '鏍硅妭鐐圭殑鍊�',
+ prop: 'parentValue',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ },
+ {
+ label: '鏍戝姞杞芥柟寮�',
+ prop: 'loadType',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ dicData: [{
+ label: '鍏ㄩ儴', value: 'all'
+ }, {
+ label: '閫愮骇鍔犺浇', value: 'node'
+ }],
+ },{
+ label: '鏄惁鍙兘閫夋嫨鍙跺瓙鑺傜偣',
+ prop: 'onlyLeaf',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ },{
+ label: '鎺掑簭瀛楁',
+ prop: 'sortField',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ },{
+ label: '鎺掑簭绫诲瀷',
+ prop: 'sortType',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ dicData: [{
+ label: '鍗囧簭', value: 'asc'
+ }, {
+ label: '闄嶅簭', value: 'desc'
+ }],
+ },
+ ],
+ // 骞冲彴绫诲瀷鐨勮〃鍗曢厤缃�
+ standColumn:[{
+ label: '鍙傝�冪殑UI涓婁笅鏂�',
+ prop: 'referContent',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ },
+ {
+ label: '骞冲彴鐨勮〃鏍肩紪鍙�',
+ prop: 'displayTable',
+ span: 24,
+ disabled: true,
+ row: true,
+ placeholder: ' ',
+ }],
- // 鏌ヨ鏉′欢琛ㄦ牸鍖哄煙
- srchCondOption: {
- border: true,
- height: '40vh',
- tip: false,
- searchShow: false,
- searchMenuSpan: 6,
- index: true,
- selection: false,
- menu: false,
- addBtn: false,
- refreshBtn: false,
- searchShowBtn: false,
- columnBtn: false,
- dialogClickModal: false,
- highlightCurrentRow: true,
- align: 'center',
- menuAlign: 'center',
- column: [
- {
- label: '鏌ヨ鏉′欢',
- children: [
- {
- label: '绛涢�夊瓧娈�',
- prop: 'filterField',
- },{
- label: '绛涢�夌被鍨�',
- prop: 'filterType',
- },{
- label: '绛涢�夌殑鍊�',
- prop: 'filterValue',
- }
- ],
- },
- ],
- },
- srchCondParams: {
- ref: "srchCondCrud",
- srchCondLoading: false,
- srchCondData: [],
- isShow: true,
- },
+ // 鏌ヨ鏉′欢琛ㄦ牸鍖哄煙
+ srchCondOption: {
+ border: true,
+ height: '40vh',
+ tip: false,
+ searchShow: false,
+ searchMenuSpan: 6,
+ index: true,
+ selection: false,
+ menu: false,
+ addBtn: false,
+ refreshBtn: false,
+ searchShowBtn: false,
+ columnBtn: false,
+ dialogClickModal: false,
+ highlightCurrentRow: true,
+ align: 'center',
+ menuAlign: 'center',
+ column: [
+ {
+ label: '鏌ヨ鏉′欢',
+ children: [
+ {
+ label: '绛涢�夊瓧娈�',
+ prop: 'filterField',
+ },{
+ label: '绛涢�夌被鍨�',
+ prop: 'filterType',
+ },{
+ label: '绛涢�夌殑鍊�',
+ prop: 'filterValue',
+ }
+ ],
+ },
+ ],
+ },
+ srchCondParams: {
+ ref: "srchCondCrud",
+ srchCondLoading: false,
+ srchCondData: [],
+ isShow: true,
+ },
+ toggleSrchCrudWidth: {
+ width: '40%',
+ height: '100%',
+ },
- //鏄剧ず鐨勫睘鎬ц〃鏍奸厤缃尯鍩�
- showAttrOption: {
- border: true,
- height: '40vh',
- tip: false,
- searchShow: false,
- searchMenuSpan: 6,
- index: true,
- selection: false,
- menu: false,
- addBtn: false,
- refreshBtn: false,
- searchShowBtn: false,
- columnBtn: false,
- dialogClickModal: false,
- highlightCurrentRow: true,
- align: 'center',
- menuAlign: 'center',
- column: [
- {
- label: '鏄剧ず鐨勫睘鎬�',
- children: [
- {
- label: '鍒楀瓧娈�',
- // width: 120,
- prop: 'field',
- //type: 'select',
- // props: {
- // label: 'name',
- // value: 'code'
- // },
- // dicUrl: 'https://cli.avuejs.com/api/area/getProvince'
- },{
- label: '鍒楀悕',
- prop: 'title'
- },{
- label: '瀛楁绫诲瀷',
- prop: 'fieldType'
- },{
- label: '鍒楄〃鍙帓搴�',
- prop: 'sort'
- },{
- label: '鎺掑簭瀛楁',
- prop: 'sortField'
- },{
- label: '瀛楁瀹藉害',
- prop: 'width'
- },{
- label: '鍒楀浐瀹氫綅缃�',
- prop: 'fixedText'
- },{
- label: 'js鏄剧ず浠g爜',
- prop: 'templet'
- },{
- label: '鏄惁蹇�熸煡璇�',
- prop: 'isQuery'
- }
- ]
- },
- ],
- },
- showAttrParams: {
- ref: "showAttrCrud",
- showAttrLoading: false,
- showAttrData: [],
- isShow: true,
- },
+ //鏄剧ず鐨勫睘鎬ц〃鏍奸厤缃尯鍩�
+ showAttrOption: {
+ border: true,
+ height: '40vh',
+ tip: false,
+ searchShow: false,
+ searchMenuSpan: 6,
+ index: true,
+ selection: false,
+ menu: false,
+ addBtn: false,
+ refreshBtn: false,
+ searchShowBtn: false,
+ columnBtn: false,
+ dialogClickModal: false,
+ highlightCurrentRow: true,
+ align: 'center',
+ menuAlign: 'center',
+ column: [
+ {
+ label: '鏄剧ず鐨勫睘鎬�',
+ children: [
+ {
+ label: '鍒楀瓧娈�',
+ // width: 120,
+ prop: 'field',
+ //type: 'select',
+ // props: {
+ // label: 'name',
+ // value: 'code'
+ // },
+ // dicUrl: 'https://cli.avuejs.com/api/area/getProvince'
+ },{
+ label: '鍒楀悕',
+ prop: 'title'
+ },{
+ label: '瀛楁绫诲瀷',
+ prop: 'fieldTypeText'
+ },{
+ label: '鍒楄〃鍙帓搴�',
+ prop: 'sort'
+ },{
+ label: '鎺掑簭瀛楁',
+ prop: 'attrSortField'
+ },{
+ label: '瀛楁瀹藉害',
+ prop: 'width'
+ },{
+ label: '鍒楀浐瀹氫綅缃�',
+ prop: 'fixedPositionText'
+ },{
+ label: 'js鏄剧ず浠g爜',
+ prop: 'templet'
+ },{
+ label: '鏄惁蹇�熸煡璇�',
+ prop: 'isQuery'
+ }
+ ]
+ },
+ ],
+ },
+ showAttrParams: {
+ ref: "showAttrCrud",
+ showAttrLoading: false,
+ showAttrData: [],
+ isShow: true,
+ },
- // 鏄惁鏄剧ず鍙樺姩鐨勮〃鍗曞尯鍩�
- isShowForm: true,
- toggleCrudWidth: {
- height: '100%',
- width: '70%',
- },
- defaultOrGridForm: ['limit','sortField','sortType'],
- standForm: ['referContent','displayTable'],
- treeForm: [
- 'parentFieldName',
+ // 鏄惁鏄剧ず鍙樺姩鐨勮〃鍗曞尯鍩�
+ isShowForm: true,
+ toggleBasicCrudWidth: {
+ height: '100%',
+ width: '70%',
+ },
+
+ // 鏄惁鏄剧ず灞炴�ц〃鏍�
+ isShowAttrCrud: true,
+
+ defaultOrGridForm: ['limit','sortField','sortType'],
+ standForm: ['referContent','displayTable'],
+ treeForm: [
+ 'parentFieldName',
+ 'parentUsedField',
+ 'parentValue',
+ 'loadType',
+ 'onlyLeaf',
+ 'sortField',
+ 'sortType'
+ ],
+ }
+ },
+ watch: {
+ // 鐩戝惉鐖剁粍浠朵紶鐨勭獥鍙f樉绀洪殣钘忕殑鍊�
+ isShowReferConfigCrud (){
+ if(this.isShowReferConfigCrud){
+ this.referConfigOnload();
+ }
+ }
+ },
+ methods: {
+
+ // 涓嬩竴姝ヨ杩涜鐨勬搷浣滈�夋嫨骞朵繚瀛樻垨閫夋嫨骞朵慨鏀�
+ selectedreferConfig(condition) {
+ // 褰撳墠閫変腑鐨勫弬鐓ч厤缃
+ let currentSeletedRow = this.referConfigParams.referConfigSelectedRowData;
+ if(!currentSeletedRow){
+ this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹紒");
+ return;
+ }
+ let filterForm = this.filterForm(currentSeletedRow);
+ if(condition == "selectedSave"){
+ // 鐩存帴淇濆瓨,鎵�浠ョ洿鎺ヨ皟鐢╟ode鐣岄潰鐨勭晫闈㈠洖鏄�
+ this.$emit('echoReferConfig',filterForm);
+ // console.log(filterForm);
+ }else {
+ // 閫夋嫨骞朵慨鏀�,鎵цcode鏈嶅姟涓殑鎵撳紑鐣岄潰锛屾墍浠ヨ鍏堟瀯閫犲嚭鎵�闇�鐨勬暟鎹�
+ let submitForm = {
+ referBtmName: filterForm.referType,
+ referBtmId: filterForm.referTypeName,
+ referConfig: JSON.stringify(filterForm),
+ }
+ this.$emit('openReconfigInterFace',submitForm);
+ }
+ this.isShowReferConfigCrud = false;
+ },
+ // 杩囨护鍑哄綋鍓嶇被鍨嬫墍闇�瑕佺殑灞炴��
+ filterForm(currentRow){
+ // 闇�瑕佷繚鐣欑殑鍩虹灞炴��
+ let submittDefaultForm = [
+ 'referTypeName',
+ 'referType',
+ 'textField',
+ 'valueField',
+ 'type', //鍙傜収绐楀彛绫诲瀷
+ 'url',
+ 'backPath',
+ 'method',
+ 'height',
+ 'useFormKey',
+ 'paramForFormKey',
+ 'isMuti',
+ 'mapFields',
+ 'isOpenGlobal', //鏄惁寮�鍚叏灞�
+ 'isPersistence',
+ 'id',
+ 'name',
+ ];
+ // 闇�瑕佹牴鎹被鍨嬫坊鍔犵殑灞炴��
+ let addArray = [];
+ let newForm ={};
+ // 鏍规嵁涓嶅悓绫诲瀷杩囨护鍑轰笉鍚岀殑鐨勮〃鍗曞睘鎬�
+ if(currentRow.type == 'stand'){
+ addArray = ['referContent', 'displayTable'];
+ } else if(currentRow.type == 'default' || currentRow.type == 'grid'){
+ addArray = ['limit', 'sortField', 'sortType'];
+ } else if(currentRow.type == 'tree'){
+ addArray = [
+ "parentFieldName",
'parentUsedField',
- 'parentValue',
+ 'parentValue',
'loadType',
'onlyLeaf',
'sortField',
'sortType'
- ],
+ ];
}
+ // 鎷兼帴涓や釜鏁扮粍
+ submittDefaultForm = submittDefaultForm.concat(addArray);
+ if(currentRow.codeSrchCondConfigVOS.length > 0){
+ //console.log(currentRow.codeSrchCondConfigVOS);
+ newForm = {
+ codeSrchCondConfigVOS: currentRow.codeSrchCondConfigVOS,
+ }
+ }
+ if((currentRow.type == 'default' || currentRow.type == 'grid') && currentRow.codeShowFieldConfigVOS.length >= 0){
+ newForm = Object.assign(newForm,{codeShowFieldConfigVOS: currentRow.codeShowFieldConfigVOS});
+ }
+ // 杩囨护鍑虹┖鍊煎睘鎬у拰涓嶉渶瑕佺殑灞炴��
+ submittDefaultForm.forEach(item=>{
+ // console.log(!this.checkStringIsEmpty(currentRow[item]) || !this.checkArrayIsUndefined(currentRow[item]));
+ if((item == 'isMuti' || item == 'onlyLeaf') || (!this.checkStringIsEmpty(currentRow[item]) || !this.checkArrayIsUndefined(currentRow[item]))){
+ //console.log(item,currentRow[item]);
+ newForm = Object.assign(newForm,{[item]:currentRow[item]});
+ }
+ });
+ // console.log(newForm);
+ return newForm;
},
- methods: {
-
- // 涓嬩竴姝ヨ杩涜鐨勬搷浣滈�夋嫨骞朵繚瀛樻垨閫夋嫨骞朵慨鏀�
- selectedreferConfig(condition) {
- // 褰撳墠閫変腑鐨勫弬鐓ч厤缃
- let currentSeletedRow = this.referConfigParams.referConfigSelectedRowData;
- if(!currentSeletedRow){
- this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹紒");
- return;
- }
- if(condition == "selectedSave"){
- //console.log(currentSeletedRow);
- }else {
- //console.log(currentSeletedRow);
- }
- },
- referConfigOnload(){
- let refer = this.referConfigParams;
- refer.referConfigLoading = true;
- let param = {};
- // 澶氫釜conditionMap杩欐牱浼犲弬
- if(refer.referConfigQuery){
- Object.keys(refer.referConfigQuery).forEach(key=>{
- param['conditionMap['+key+']'] = refer.referConfigQuery[key];
- });
- }
- getReferConfigPage(
- refer.referConfigPage.currentPage,
- refer.referConfigPage.pageSize,
- param
- ).then(res=>{
- const data = res.data.data;
- this.referConfigParams.referConfigPage.total = data.total;
- this.referConfigParams.referConfigData = data.records;
- this.referConfigParams.referConfigLoading = false;
- //console.log(this.referConfigParams.referConfigData.length > 0);
- if(this.referConfigParams.referConfigData.length > 0) {
- this.$nextTick(() => {
- this.$refs[this.referConfigParams.ref].doLayout()
- this.referConfigParams.referConfigSelectedRow = 0;
- this.$refs[this.referConfigParams.ref].setCurrentRow(this.referConfigParams.referConfigData[0]);
- this.attrAndSrchCondOnload(this.referConfigParams.referConfigData[0]);
- this.loadDefaultOrGridOrStandOrTreeForm(this.referConfigParams.referConfigData[0]);
- })
- }
- });
- },
- referBtmTypeSizeChange(pageSize){
- this.referConfigParams.referConfigPage.pageSize = pageSize;
- },
- referBtmTypeCurrentChange(currentPage){
- this.referConfigParams.referConfigPage.currentPage = currentPage;
- },
- referConfigRowClick(row){
- // 瀵瑰綋鍓嶉�変腑琛岃繘琛岃褰�
- this.referConfigParams.referConfigSelectedRowData = row;
- // 鍗曢�夋閫変腑
- this.referConfigParams.referConfigSelectedRow = row.$index
- this.attrAndSrchCondOnload(row);
- this.loadDefaultOrGridOrStandOrTreeForm(row);
- },
- referConfigSearchChange(params, done){
- this.referConfigParams.referConfigQuery = params;
- this.referConfigParams.referConfigPage.currentPage = 1;
- this.referConfigOnload();
- done();
- },
- referConfigSearchReset(){
- this.referConfigParams.referConfigQuery = {};
- this.referConfigOnload(this.referConfigParams.referConfigPage);
- },
- referConfigCurrentChange(currentPage){
- this.referConfigParams.referConfigPage.currentPage = currentPage;
- },
- referConfigSizeChange(pageSize){
- this.referConfigParams.referConfigPage.pageSize = pageSize;
- },
- // 鍔犺浇琛ㄥ崟鏄剧ず鍐呭
- loadDefaultOrGridOrStandOrTreeForm(currentFormData){
- if(currentFormData.type != 'tree' &
- currentFormData.type != 'stand' &
- currentFormData.type != 'default'&
- currentFormData.type != 'grid') {
- //鎺у埗鍙傜収閰嶇疆琛ㄦ牸鍜岃〃鍗曟樉绀烘瘮渚�
- this.isShowForm = false;
- this.toggleCrudWidth.width = '100%';
- }else {
- this.isShowForm = true;
- this.toggleCrudWidth.width = '70%';
- this.toggleFormOption(currentFormData);
- }
- //console.log(this.isShowForm);
- //console.log(this.toggleCrudWidth.width);
- },
-
- // 鏍规嵁type鐨勫彉鍔ㄥ垏鎹㈣〃鍗曠殑閰嶇疆option
- toggleFormOption(data){
- //console.log(data);
- let currentForm = '';
- if(data.type=='default' || data.type=='grid'){
- this.formOption.column = this.sortColumn;
- currentForm = 'defaultOrGridForm'
- }else if(data.type == 'stand'){
- this.formOption.column = this.standColumn;
- currentForm = 'standForm';
- }else if(data.type == 'tree'){
- this.formOption.column = this.treeColumn;
- currentForm = 'treeForm'
- }
- this.referConfigForm = {},
- console.log( this.formOption);
- this[currentForm].forEach(item=>{
- Vue.set(this.referConfigForm, item, data[item])
- //this.referConfigForm = Object.assign(this.referConfigForm,{[item]:data[item]})
- })
- console.log(this.referConfigForm);
- },
-
- // 鏄剧ず鐨勫睘鎬у拰鏌ヨ鏉′欢鐩稿叧鏂规硶
- attrAndSrchCondOnload(row){
- this.srchCondParams.srchCondLoading = true;
- this.showAttrParams.showAttrLoading = true;
- this.$nextTick(() => {
- this.$refs[this.srchCondParams.ref].doLayout()
- this.$refs[this.showAttrParams.ref].doLayout()
- });
- this.srchCondParams.srchCondData = row.codeSrchCondConfigVOS
- this.showAttrParams.showAttrData = row.codeShowFieldConfigVOS
- this.srchCondParams.srchCondLoading = false;
- this.showAttrParams.showAttrLoading = false;
- },
-
+ /**
+ * 涓虹┖
+ * @param val
+ * @returns {boolean}
+ */
+ checkStringIsEmpty(val){
+ if (
+ val === null ||
+ typeof val === 'undefined' ||
+ (typeof val === 'string' && val === "" && val !== 'undefined')
+ ) {
+ return true;
+ }
+ return false;
},
+ /**
+ * 鏄惁涓哄畾涔�
+ * @param val
+ * @returns {boolean}
+ */
+ checkArrayIsUndefined(val){
+ return typeof val === 'array' && (val.length === 0 || val === null || typeof val === 'undefined' || val === []);
+ },
+ referConfigOnload(){
+ let refer = this.referConfigParams;
+ refer.referConfigLoading = true;
+ let param = {};
+ // 澶氫釜conditionMap杩欐牱浼犲弬
+ if(refer.referConfigQuery){
+ Object.keys(refer.referConfigQuery).forEach(key=>{
+ param['conditionMap['+key+']'] = refer.referConfigQuery[key];
+ });
+ }
+ getReferConfigPage(
+ refer.referConfigPage.currentPage,
+ refer.referConfigPage.pageSize,
+ param
+ ).then(res=>{
+ const data = res.data.data;
+ this.referConfigParams.referConfigPage.total = data.total;
+ this.referConfigParams.referConfigData = data.records;
+ this.referConfigParams.referConfigLoading = false;
+ //console.log(this.referConfigParams.referConfigData.length > 0);
+ // 娓叉煋鍏朵粬鍖哄煙鏁版嵁
+ if(this.referConfigParams.referConfigData.length > 0) {
+ this.$nextTick(() => {
+ // 琛ㄦ牸閿欒闂
+ this.$refs[this.referConfigParams.ref].doLayout()
+ // 榛樿閫変腑绗竴琛�
+ this.referConfigParams.referConfigSelectedRow = 0;
+ this.$refs[this.referConfigParams.ref].setCurrentRow(this.referConfigParams.referConfigData[0]);
+ this.referConfigParams.referConfigSelectedRowData = this.referConfigParams.referConfigData[0];
+ this.attrAndSrchCondOnload(this.referConfigParams.referConfigData[0]);
+ this.loadDefaultOrGridOrStandOrTreeForm(this.referConfigParams.referConfigData[0]);
+ })
+ }
+ });
+ },
+ referBtmTypeSizeChange(pageSize){
+ this.referConfigParams.referConfigPage.pageSize = pageSize;
+ },
+ referBtmTypeCurrentChange(currentPage){
+ this.referConfigParams.referConfigPage.currentPage = currentPage;
+ },
+ referConfigRowClick(row){
+ // 瀵瑰綋鍓嶉�変腑琛岃繘琛岃褰�
+ this.referConfigParams.referConfigSelectedRowData = row;
+ // 鍗曢�夋閫変腑
+ this.referConfigParams.referConfigSelectedRow = row.$index
+ this.attrAndSrchCondOnload(row);
+ this.loadDefaultOrGridOrStandOrTreeForm(row);
+ },
+ referConfigSearchChange(params, done){
+ this.referConfigParams.referConfigQuery = params;
+ this.referConfigParams.referConfigPage.currentPage = 1;
+ this.referConfigOnload();
+ done();
+ },
+ referConfigSearchReset(){
+ this.referConfigParams.referConfigQuery = {};
+ this.referConfigOnload(this.referConfigParams.referConfigPage);
+ },
+ referConfigCurrentChange(currentPage){
+ this.referConfigParams.referConfigPage.currentPage = currentPage;
+ },
+ referConfigSizeChange(pageSize){
+ this.referConfigParams.referConfigPage.pageSize = pageSize;
+ },
+ // 鍔犺浇琛ㄥ崟鏄剧ず鍐呭
+ loadDefaultOrGridOrStandOrTreeForm(currentFormData){
+ if(currentFormData.type != 'tree' &
+ currentFormData.type != 'stand' &
+ currentFormData.type != 'default'&
+ currentFormData.type != 'grid') {
+ //鎺у埗鍙傜収閰嶇疆琛ㄦ牸鍜岃〃鍗曟樉绀烘瘮渚�
+ this.isShowForm = false;
+ this.toggleBasicCrudWidth.width = '100%';
+ }else {
+ this.isShowForm = true;
+ this.toggleBasicCrudWidth.width = '70%';
+ this.toggleFormOption(currentFormData);
+ }
+ this.toggleCurdWidth(currentFormData);
+ //console.log(this.isShowForm);
+ //console.log(this.toggleBasicCrudWidth.width);
+ },
+
+ // 鏍规嵁type鐨勫彉鍔ㄥ垏鎹㈣〃鍗曠殑閰嶇疆option
+ toggleFormOption(data){
+ //console.log(data);
+ let currentForm = '';
+ if(data.type=='default' || data.type=='grid'){
+ this.formOption.column = this.sortColumn;
+ currentForm = 'defaultOrGridForm';
+ }else if(data.type == 'stand'){
+ this.formOption.column = this.standColumn;
+ currentForm = 'standForm';
+ }else if(data.type == 'tree'){
+ this.formOption.column = this.treeColumn;
+ currentForm = 'treeForm'
+ }
+ this.referConfigForm = {},
+ //console.log( this.formOption);
+ this[currentForm].forEach(item=>{
+ Vue.set(this.referConfigForm, item, data[item])
+ //this.referConfigForm = Object.assign(this.referConfigForm,{[item]:data[item]})
+ })
+ // console.log(this.referConfigForm);
+ },
+ // 鏍规嵁type鐨勫彉鍔ㄥ垏鎹ttr琛ㄦ牸鐨勬樉绀洪殣钘忥紝璋冩暣鏌ヨ鏉′欢琛ㄦ牸鐨勫搴�
+ toggleCurdWidth(data) {
+ if(data.type=='default' || data.type=='grid'){
+ this.showAttrParams.isShow = true;
+ // 涓嶉渶瑕佹樉绀哄睘鎬ц〃鏍兼墍鏈夐渶瑕佸皢鏌ヨ璋冧环琛ㄦ牸缂╁皬涓�100%
+ this.toggleSrchCrudWidth.width = '40%';
+ }else {
+ this.showAttrParams.isShow = false;
+ // 涓嶉渶瑕佹樉绀哄睘鎬ц〃鏍兼墍鏈夐渶瑕佸皢鏌ヨ璋冧环琛ㄦ牸缂╁皬涓�100%
+ this.toggleSrchCrudWidth.width = '100%';
+ }
+ // console.log(this.toggleSrchCrudWidth);
+ // console.log(this.showAttrParams.isShow);
+ },
+
+ // 鏄剧ず鐨勫睘鎬у拰鏌ヨ鏉′欢鐩稿叧鏂规硶
+ attrAndSrchCondOnload(row){
+ this.srchCondParams.srchCondLoading = true;
+ this.showAttrParams.showAttrLoading = true;
+ this.$nextTick(() => {
+ this.$refs[this.srchCondParams.ref].doLayout()
+ this.$refs[this.showAttrParams.ref].doLayout()
+ });
+ this.srchCondParams.srchCondData = row.codeSrchCondConfigVOS
+ this.showAttrParams.showAttrData = row.codeShowFieldConfigVOS
+ //console.log(this.showAttrParams.showAttrData);
+ this.srchCondParams.srchCondLoading = false;
+ this.showAttrParams.showAttrLoading = false;
+ },
+
+ },
}
</script>
--
Gitblit v1.9.3