Commit ca72bbc086ca1d341adff5837556ba00d53e093e

Authored by Min
1 parent 984e4090

1.上一条,下一条增加多语言翻译,如果是未清复制到过来的,直接进行提示,不具备功能

src/components/Common/CommonBillEvent.js
@@ -2837,20 +2837,18 @@ export default (ChildComponent) => { @@ -2837,20 +2837,18 @@ export default (ChildComponent) => {
2837 this.handleSearchData1(handleType); 2837 this.handleSearchData1(handleType);
2838 return; 2838 return;
2839 } 2839 }
  2840 + const tipLast = commonFunc.showLocalMessage(this.props, 'tipLast', '当前已经是最后一条');
  2841 + const tipFirst = commonFunc.showLocalMessage(this.props, 'tipFirst', '当前已经是第一条');
2840 2842
2841 const { currentPane, token } = app; 2843 const { currentPane, token } = app;
2842 const { 2844 const {
2843 pages, sFilterOrderBy, bFilter, sListFormmasterId, currentIndex, 2845 pages, sFilterOrderBy, bFilter, sListFormmasterId, currentIndex,
2844 } = currentPane; 2846 } = currentPane;
  2847 + console.log('22page2222s2', pages);
2845 let currentPosition = currentIndexFlag ? currentPageNo : commonUtils.isEmptyObject(pages) ? 1 : (((pages.current - 1) * commonConfig.pageSize) + Number.parseInt(currentIndex, 10)) + 1; 2848 let currentPosition = currentIndexFlag ? currentPageNo : commonUtils.isEmptyObject(pages) ? 1 : (((pages.current - 1) * commonConfig.pageSize) + Number.parseInt(currentIndex, 10)) + 1;
2846 if (currentIndex === undefined) { 2849 if (currentIndex === undefined) {
2847 currentPosition = 1; 2850 currentPosition = 1;
2848 } 2851 }
2849 - // if (handleType === 'first') {  
2850 - // currentPosition = 1;  
2851 - // } else if (handleType === 'end') {  
2852 - // currentPosition = pages.total;  
2853 - // }  
2854 if (!commonUtils.isNum(currentPosition)) { // 如果是列表直接点增加,就跳到第一条去 2852 if (!commonUtils.isNum(currentPosition)) { // 如果是列表直接点增加,就跳到第一条去
2855 currentPosition = 1; 2853 currentPosition = 1;
2856 } 2854 }
@@ -2862,12 +2860,12 @@ export default (ChildComponent) => { @@ -2862,12 +2860,12 @@ export default (ChildComponent) => {
2862 if ("next".includes(handleType)) { 2860 if ("next".includes(handleType)) {
2863 currentPosition = index + 1; 2861 currentPosition = index + 1;
2864 if(currentPosition > sBillIdsArray.length - 1 ){ 2862 if(currentPosition > sBillIdsArray.length - 1 ){
2865 - message.warn('当前已经是最后一条'); 2863 + message.warn(tipLast);
2866 return ; 2864 return ;
2867 } 2865 }
2868 } else if ("up".includes(handleType)) { 2866 } else if ("up".includes(handleType)) {
2869 if(index === 0){ 2867 if(index === 0){
2870 - message.warn('当前已经是第一条!'); 2868 + message.warn(tipFirst);
2871 return ; 2869 return ;
2872 } 2870 }
2873 currentPosition = index - 1; 2871 currentPosition = index - 1;
@@ -2885,8 +2883,18 @@ export default (ChildComponent) => { @@ -2885,8 +2883,18 @@ export default (ChildComponent) => {
2885 } 2883 }
2886 /* 如果是第一次请求 */ 2884 /* 如果是第一次请求 */
2887 if(!bExist) { 2885 if(!bExist) {
  2886 + const bFromList = commonUtils.isEmptyObject(pages) ? true: false;
  2887 + if(bFromList) {
  2888 + if(handleType ==='next' || handleType ==='end') {
  2889 + message.warn(tipLast);
  2890 + return ;
  2891 + }else {
  2892 + message.warn(tipFirst);
  2893 + return ;
  2894 + }
  2895 + }
2888 const value = { 2896 const value = {
2889 - sClientType: '1', sFilterOrderBy, bFilter, sListFormmasterId, currentPosition, handleType, iCountSum: pages.total, 2897 + sClientType: '1', sFilterOrderBy, bFilter, sListFormmasterId, currentPosition, handleType, iCountSum: pages?.total,
2890 sUpId: masterData?.sId, sParentModelId :sSrcModelsId, 2898 sUpId: masterData?.sId, sParentModelId :sSrcModelsId,
2891 }; 2899 };
2892 const url = `${commonConfig.server_host}business/getBusinessDataByIndex?sModelsId=${sModelsId}`; 2900 const url = `${commonConfig.server_host}business/getBusinessDataByIndex?sModelsId=${sModelsId}`;
src/components/Common/CommonElementEvent.js
@@ -3020,14 +3020,15 @@ export default (ChildComponent) => { @@ -3020,14 +3020,15 @@ export default (ChildComponent) => {
3020 const { 3020 const {
3021 pages, sFilterOrderBy, bFilter, sListFormmasterId, currentIndex, 3021 pages, sFilterOrderBy, bFilter, sListFormmasterId, currentIndex,
3022 } = currentPane; 3022 } = currentPane;
3023 - 3023 + const tipLast = commonFunc.showLocalMessage(this.props, 'tipLast', '当前已经是最后一条');
  3024 + const tipFirst = commonFunc.showLocalMessage(this.props, 'tipFirst', '当前已经是第一条');
3024 let currentPosition = currentIndexFlag ? currentPageNo : commonUtils.isEmptyObject(pages) ? 1 : (((pages.current - 1) * commonConfig.pageSize) + Number.parseInt(currentIndex, 10)) + 1; 3025 let currentPosition = currentIndexFlag ? currentPageNo : commonUtils.isEmptyObject(pages) ? 1 : (((pages.current - 1) * commonConfig.pageSize) + Number.parseInt(currentIndex, 10)) + 1;
3025 if (commonUtils.isEmptyObject(pages) || commonUtils.isEmptyNumber(pages.total)) { 3026 if (commonUtils.isEmptyObject(pages) || commonUtils.isEmptyNumber(pages.total)) {
3026 if (handleType === 'next' || handleType === 'end') { 3027 if (handleType === 'next' || handleType === 'end') {
3027 - message.warning('当前已是最后一条数据'); 3028 + message.warn(tipLast);
3028 return; 3029 return;
3029 } else { 3030 } else {
3030 - message.warning('当前已是第一条数据'); 3031 + message.warn(tipFirst);
3031 return; 3032 return;
3032 } 3033 }
3033 } 3034 }
src/components/Common/CommonNewBillEvent.js
@@ -1941,6 +1941,8 @@ export default (ChildComponent) => { @@ -1941,6 +1941,8 @@ export default (ChildComponent) => {
1941 let { sBillIdsArray = []} = this.props; 1941 let { sBillIdsArray = []} = this.props;
1942 let { currentId } = this.props; 1942 let { currentId } = this.props;
1943 const { currentPane, token } = app; 1943 const { currentPane, token } = app;
  1944 + const tipLast = commonFunc.showLocalMessage(this.props, 'tipLast', '当前已经是最后一条');
  1945 + const tipFirst = commonFunc.showLocalMessage(this.props, 'tipFirst', '当前已经是第一条');
1944 let { 1946 let {
1945 pages, sFilterOrderBy, bFilter, sListFormmasterId, currentIndex, fromKey, 1947 pages, sFilterOrderBy, bFilter, sListFormmasterId, currentIndex, fromKey,
1946 } = currentPane; 1948 } = currentPane;
@@ -1968,12 +1970,12 @@ export default (ChildComponent) => { @@ -1968,12 +1970,12 @@ export default (ChildComponent) => {
1968 if ("next".includes(handleType)) { 1970 if ("next".includes(handleType)) {
1969 currentPosition = index + 1; 1971 currentPosition = index + 1;
1970 if(currentPosition > sBillIdsArray.length - 1 ){ 1972 if(currentPosition > sBillIdsArray.length - 1 ){
1971 - message.warn('当前已经是最后一条'); 1973 + message.warn(tipLast);
1972 return ; 1974 return ;
1973 } 1975 }
1974 } else if ("up".includes(handleType)) { 1976 } else if ("up".includes(handleType)) {
1975 if(index === 0){ 1977 if(index === 0){
1976 - message.warn('当前已经是第一条!'); 1978 + message.warn(tipFirst);
1977 return ; 1979 return ;
1978 } 1980 }
1979 currentPosition = index - 1; 1981 currentPosition = index - 1;
@@ -1991,6 +1993,16 @@ export default (ChildComponent) => { @@ -1991,6 +1993,16 @@ export default (ChildComponent) => {
1991 } 1993 }
1992 /* 如果是第一次请求 */ 1994 /* 如果是第一次请求 */
1993 if(!bExist) { 1995 if(!bExist) {
  1996 + const bFromList = commonUtils.isEmptyObject(pages) ? true: false;
  1997 + if(bFromList) {
  1998 + if(handleType ==='next' || handleType ==='end') {
  1999 + message.warn(tipLast);
  2000 + return ;
  2001 + }else {
  2002 + message.warn(tipFirst);
  2003 + return ;
  2004 + }
  2005 + }
1994 const value = { 2006 const value = {
1995 sClientType: '1', sFilterOrderBy, bFilter, sListFormmasterId, currentPosition, handleType, iCountSum: pages.total, 2007 sClientType: '1', sFilterOrderBy, bFilter, sListFormmasterId, currentPosition, handleType, iCountSum: pages.total,
1996 sUpId: masterData?.sId, sParentModelId :sSrcModelsId, 2008 sUpId: masterData?.sId, sParentModelId :sSrcModelsId,
src/components/Common/CommonSubBillEvent.js
@@ -2820,6 +2820,8 @@ export default (ChildComponent) => { @@ -2820,6 +2820,8 @@ export default (ChildComponent) => {
2820 let { sBillIdsArray = []} = this.props; 2820 let { sBillIdsArray = []} = this.props;
2821 let { currentId } = this.props; 2821 let { currentId } = this.props;
2822 const { currentPane, token } = app; 2822 const { currentPane, token } = app;
  2823 + const tipLast = commonFunc.showLocalMessage(this.props, 'tipLast', '当前已经是最后一条');
  2824 + const tipFirst = commonFunc.showLocalMessage(this.props, 'tipFirst', '当前已经是第一条');
2823 const { 2825 const {
2824 pages, sFilterOrderBy, bFilter, sListFormmasterId, currentIndex, 2826 pages, sFilterOrderBy, bFilter, sListFormmasterId, currentIndex,
2825 } = currentPane; 2827 } = currentPane;
@@ -2843,12 +2845,12 @@ export default (ChildComponent) => { @@ -2843,12 +2845,12 @@ export default (ChildComponent) => {
2843 if ("next".includes(handleType)) { 2845 if ("next".includes(handleType)) {
2844 currentPosition = index + 1; 2846 currentPosition = index + 1;
2845 if(currentPosition > sBillIdsArray.length - 1 ){ 2847 if(currentPosition > sBillIdsArray.length - 1 ){
2846 - message.warn('当前已经是最后一条'); 2848 + message.warn(tipLast);
2847 return ; 2849 return ;
2848 } 2850 }
2849 } else if ("up".includes(handleType)) { 2851 } else if ("up".includes(handleType)) {
2850 if(index === 0){ 2852 if(index === 0){
2851 - message.warn('当前已经是第一条!'); 2853 + message.warn(tipFirst);
2852 return ; 2854 return ;
2853 } 2855 }
2854 currentPosition = index - 1; 2856 currentPosition = index - 1;
@@ -2866,6 +2868,16 @@ export default (ChildComponent) => { @@ -2866,6 +2868,16 @@ export default (ChildComponent) => {
2866 } 2868 }
2867 /* 如果是第一次请求 */ 2869 /* 如果是第一次请求 */
2868 if(!bExist) { 2870 if(!bExist) {
  2871 + const bFromList = commonUtils.isEmptyObject(pages) ? true: false;
  2872 + if(bFromList) {
  2873 + if(handleType ==='next' || handleType ==='end') {
  2874 + message.warn(tipLast);
  2875 + return ;
  2876 + }else {
  2877 + message.warn(tipFirst);
  2878 + return ;
  2879 + }
  2880 + }
2869 const value = { 2881 const value = {
2870 sClientType: '1', sFilterOrderBy, bFilter, sListFormmasterId, currentPosition, handleType, iCountSum: pages.total, 2882 sClientType: '1', sFilterOrderBy, bFilter, sListFormmasterId, currentPosition, handleType, iCountSum: pages.total,
2871 sUpId: masterData?.sId, sParentModelId :sSrcModelsId, 2883 sUpId: masterData?.sId, sParentModelId :sSrcModelsId,