提交 a79539de 编写于 作者: ibizdev's avatar ibizdev

lxm1993 发布系统代码 [TrainSys,网页端]

上级 169b0351
...@@ -252,7 +252,7 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase { ...@@ -252,7 +252,7 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
try { try {
switch (logicNodeParam.srcValueType) { switch (logicNodeParam.srcValueType) {
case "SRCDLPARAM": // 源逻辑参数 case "SRCDLPARAM": // 源逻辑参数
targetValue = srcParam.get(srcFieldName) ? srcParam.get(srcFieldName) : srcParam; targetValue = srcParam.get(srcFieldName) ? srcParam.get(srcFieldName) : null;
break; break;
case 'APPLICATION': // 系统全局对象 case 'APPLICATION': // 系统全局对象
case 'SESSION': // 用户全局对象 case 'SESSION': // 用户全局对象
......
...@@ -259,7 +259,7 @@ export class AppUILogicPrepareParamNode extends AppUILogicNodeBase { ...@@ -259,7 +259,7 @@ export class AppUILogicPrepareParamNode extends AppUILogicNodeBase {
case "SRCDLPARAM": // 源逻辑参数 case "SRCDLPARAM": // 源逻辑参数
case 'WEBCONTEXT': // 网页请求上下文 case 'WEBCONTEXT': // 网页请求上下文
case 'VIEWPARAM': // 当前视图参数 case 'VIEWPARAM': // 当前视图参数
targetValue = srcParam.get(srcFieldName); targetValue = srcParam.get(srcFieldName) ? srcParam.get(srcFieldName) : null;
break; break;
case 'APPLICATION': // 系统全局对象 case 'APPLICATION': // 系统全局对象
case 'SESSION': // 用户全局对象 case 'SESSION': // 用户全局对象
......
...@@ -94,10 +94,14 @@ export class CodeListTranslator { ...@@ -94,10 +94,14 @@ export class CodeListTranslator {
* @param {*} value 传入的value值 * @param {*} value 传入的value值
* @param {*} codeList 代码表的模型对象 * @param {*} codeList 代码表的模型对象
* @param {*} _this 上下文索引 * @param {*} _this 上下文索引
* @param {*} context 上下文
* @param {*} viewparams 视图参数
* @param {*} isLoading 是否加载
* @param {*} translatorMode 翻译模式(true: 使用text获取选中代码表项, false: 使用value获取代码表项)
* @returns * @returns
* @memberof CodeListTranslator * @memberof CodeListTranslator
*/ */
public async getSelectedCodeListItems(value: any, codeList: any, _this: any, context: any, viewparams?: any, isLoading: boolean = false){ public async getSelectedCodeListItems(value: any, codeList: any, _this: any, context: any, viewparams?: any, isLoading: boolean = false, translatorMode: boolean = false){
if(Util.isEmpty(value)){ if(Util.isEmpty(value)){
return [] return []
} }
...@@ -108,7 +112,7 @@ export class CodeListTranslator { ...@@ -108,7 +112,7 @@ export class CodeListTranslator {
}else{ }else{
codeListItems = await this.codeListService.getDataItems(this.getCodeListObj(codeList,context,viewparams,isLoading)); codeListItems = await this.codeListService.getDataItems(this.getCodeListObj(codeList,context,viewparams,isLoading));
} }
return this.getSelectedItems(value, codeListItems, codeList); return this.getSelectedItems(value, codeListItems, codeList, translatorMode);
} }
/** /**
...@@ -147,36 +151,49 @@ export class CodeListTranslator { ...@@ -147,36 +151,49 @@ export class CodeListTranslator {
* @param {*} value 传入的value值 * @param {*} value 传入的value值
* @param {any[]} codeListItems 代码表项集合 * @param {any[]} codeListItems 代码表项集合
* @param {*} codeList 代码表模型对象 * @param {*} codeList 代码表模型对象
* @param {*} translatorMode 翻译模式(true: 使用text获取选中代码表项, false: 使用value获取代码表项)
* @memberof CodeListTranslator * @memberof CodeListTranslator
*/ */
private getSelectedItems(value: any, codeListItems: any[], codeList: any){ private getSelectedItems(value: any, codeListItems: any[], codeList: any, translatorMode: boolean){
if(codeListItems){ if(codeListItems){
let valueSeparator = codeList.valueSeparator || this.valueSeparator; let valueSeparator = codeList.valueSeparator || this.valueSeparator;
// 值的集合 // 值的集合
let values: any[] = []; let values: any[] = [];
// 选中代码表项的集合 // 选中代码表项的集合
let selectedItems: any[] = []; let selectedItems: any[] = [];
if(codeList.orMode == 'NUM'){ if (translatorMode) {
codeListItems.forEach((_item: any, index: number)=>{ const textValues = [...value.toString().split(valueSeparator)];
const nValue = parseInt((value as any), 10); textValues.forEach((text: string) => {
if((parseInt(_item.value, 10) & nValue) > 0){ let selected = codeListItems.find((_item:any)=> _item.text == text);
selectedItems.push(Util.deepCopy(_item));
}
});
}else{
if(Util.typeOf(value) == 'number'){
values = [value]
}else{
values = [...value.toString().split(valueSeparator)];
}
values.forEach((v: any)=>{
let selected = codeListItems.find((_item:any)=> _item.value == v);
if(selected){ if(selected){
selectedItems.push(selected); selectedItems.push(selected);
} else { } else {
selectedItems.push({text: v}); selectedItems.push({text: text});
} }
}) })
} else {
if(codeList.orMode == 'NUM'){
codeListItems.forEach((_item: any, index: number)=>{
const nValue = parseInt((value as any), 10);
if((parseInt(_item.value, 10) & nValue) > 0){
selectedItems.push(Util.deepCopy(_item));
}
});
}else{
if(Util.typeOf(value) == 'number'){
values = [value]
}else{
values = [...value.toString().split(valueSeparator)];
}
values.forEach((v: any)=>{
let selected = codeListItems.find((_item:any)=> _item.value == v);
if(selected){
selectedItems.push(selected);
} else {
selectedItems.push({text: v});
}
})
}
} }
return selectedItems; return selectedItems;
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<script lang="ts"> <script lang="ts">
import { IPSAppDEUIAction } from '@ibiz/dynamic-model-api'; import { IPSAppDEUIAction } from '@ibiz/dynamic-model-api';
import { Vue, Component, Prop } from 'vue-property-decorator'; import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
@Component({}) @Component({})
export default class AppModelButton extends Vue { export default class AppModelButton extends Vue {
...@@ -84,6 +84,13 @@ export default class AppModelButton extends Vue { ...@@ -84,6 +84,13 @@ export default class AppModelButton extends Vue {
*/ */
@Prop({ default: undefined }) public shape?: string | undefined; @Prop({ default: undefined }) public shape?: string | undefined;
/**
* 传入数据
*
* @memberof AppModelButton
*/
@Prop() data: any;
/** /**
* 按钮名称 * 按钮名称
* *
...@@ -231,6 +238,14 @@ export default class AppModelButton extends Vue { ...@@ -231,6 +238,14 @@ export default class AppModelButton extends Vue {
*/ */
public iconAlign: 'LEFT' | 'TOP' | 'RIGHT' | 'BOTTOM' = 'LEFT'; public iconAlign: 'LEFT' | 'TOP' | 'RIGHT' | 'BOTTOM' = 'LEFT';
@Watch('data', { deep: true })
dataChange(newVal: any, oldVal: any) {
let { captionItemName } = this.modelJson;
if (captionItemName && newVal[captionItemName.toLowerCase()]) {
this.caption = newVal[captionItemName];
}
}
/** /**
* 初始化完成 * 初始化完成
* *
......
<template> <template>
<codelist <codelist
v-if="codeList && !showSourceMode" v-if="codeList"
:codeList="codeList" :codeList="codeList"
:value="value" :value="value"
:data="data" :data="data"
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
:localContext="localContext" :localContext="localContext"
:localParam="localParam" :localParam="localParam"
:context="context" :context="context"
:translatorMode="showSourceMode"
:viewparams="viewparams" :viewparams="viewparams"
></codelist> ></codelist>
<app-upload-file-info <app-upload-file-info
...@@ -196,8 +197,8 @@ export default class AppSpan extends Vue { ...@@ -196,8 +197,8 @@ export default class AppSpan extends Vue {
* @memberof AppSpan * @memberof AppSpan
*/ */
public load() { public load() {
if (this.codeList && !this.showSourceMode) { if (this.codeList) {
return; //代码表走codelist组件 return;
} else if (this.editorType === 'ADDRESSPICKUP') { } else if (this.editorType === 'ADDRESSPICKUP') {
if (this.$util.isEmpty(this.value)) { if (this.$util.isEmpty(this.value)) {
this.text = ''; this.text = '';
......
...@@ -97,6 +97,14 @@ export default class CodeList extends Vue { ...@@ -97,6 +97,14 @@ export default class CodeList extends Vue {
*/ */
@Prop() public textOnly?: boolean; @Prop() public textOnly?: boolean;
/**
* 代码表翻译模式(true: 使用text获取选中代码表项, false: 使用value获取代码表项)
*
* @type {*}
* @memberof CodeList
*/
@Prop({default:false}) public translatorMode?: boolean;
/** /**
* 显示文本 * 显示文本
* *
...@@ -218,7 +226,7 @@ export default class CodeList extends Vue { ...@@ -218,7 +226,7 @@ export default class CodeList extends Vue {
this.text = response; this.text = response;
}) })
}else{ }else{
this.codeListTranslator.getSelectedCodeListItems(this.value, this.codeList, this, _context,_param).then(async (response: any)=>{ this.codeListTranslator.getSelectedCodeListItems(this.value, this.codeList, this, _context, _param, false, this.translatorMode).then(async (response: any)=>{
this.items = await this.getImgURLOfBase64(response); this.items = await this.getImgURLOfBase64(response);
this.isEmpty = !(this.items?.length > 0); this.isEmpty = !(this.items?.length > 0);
}) })
......
...@@ -413,6 +413,7 @@ export class AppFormBase extends EditFormControlBase { ...@@ -413,6 +413,7 @@ export class AppFormBase extends EditFormControlBase {
<div> <div>
{badge} {badge}
<app-model-button <app-model-button
data={this.data}
modelJson={modelJson} modelJson={modelJson}
dynaStyle={dynaStyle} dynaStyle={dynaStyle}
dynaClass={dynaClass} dynaClass={dynaClass}
......
...@@ -400,6 +400,7 @@ export class AppPanelBase extends PanelControlBase { ...@@ -400,6 +400,7 @@ export class AppPanelBase extends PanelControlBase {
const detailStyle = this.layoutDetailsModel[name].getBoxStyle(); const detailStyle = this.layoutDetailsModel[name].getBoxStyle();
return ( return (
<app-model-button <app-model-button
data={this.data}
modelJson={modelJson} modelJson={modelJson}
dynaStyle={detailStyle} dynaStyle={detailStyle}
dynaClass={detailClass} dynaClass={detailClass}
......
...@@ -354,6 +354,7 @@ export class AppSearchFormBase extends SearchFormControlBase { ...@@ -354,6 +354,7 @@ export class AppSearchFormBase extends SearchFormControlBase {
<div> <div>
{badge} {badge}
<app-model-button <app-model-button
data={this.data}
modelJson={modelJson} modelJson={modelJson}
dynaStyle={dynaStyle} dynaStyle={dynaStyle}
dynaClass={dynaClass} dynaClass={dynaClass}
......
...@@ -201,15 +201,17 @@ ...@@ -201,15 +201,17 @@
line-height: 50px; line-height: 50px;
color: var(--app-font-color); color: var(--app-font-color);
overflow: visible; overflow: visible;
border-bottom: 0;
&:not(.is-disabled):hover, &:not(.is-disabled):focus, &.is-active { &:not(.is-disabled):hover, &:not(.is-disabled):focus, &.is-active {
color: var(--app-font-color); color: var(--app-font-color);
background-color: var(--app-background-color-bright); background-color: var(--app-background-color-bright);
} }
&.is-active { &.is-active {
border-bottom: 2px solid var(--app-font-color); border-bottom: 0;
} }
} }
.el-submenu { .el-submenu {
border-bottom: 0;
.el-submenu__title { .el-submenu__title {
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
...@@ -221,7 +223,7 @@ ...@@ -221,7 +223,7 @@
} }
&.is-active .el-submenu__title { &.is-active .el-submenu__title {
color: var(--app-font-color); color: var(--app-font-color);
border-bottom: 2px solid var(--app-font-color); border-bottom: 0;
} }
} }
} }
......
...@@ -1168,6 +1168,7 @@ export class AppDefaultViewLayout extends ControlContainer { ...@@ -1168,6 +1168,7 @@ export class AppDefaultViewLayout extends ControlContainer {
return ( return (
<app-model-button <app-model-button
id={name} id={name}
data={this.layoutData}
modelJson={modelJson} modelJson={modelJson}
dynaStyle={detailStyle} dynaStyle={detailStyle}
dynaClass={detailClass} dynaClass={detailClass}
......
...@@ -1458,7 +1458,7 @@ export class GridControlBase extends MDControlBase implements GridControlInterfa ...@@ -1458,7 +1458,7 @@ export class GridControlBase extends MDControlBase implements GridControlInterfa
public exportExcel(args: any = {}): void { public exportExcel(args: any = {}): void {
let _this: any = this; let _this: any = this;
const exportModel = this.controlInstance.getPSDEDataExport?.(); const exportModel = this.controlInstance.getPSDEDataExport?.();
if (exportModel && exportModel.M.enableBackend && !exportModel.M.enableFront) { if (exportModel && exportModel.M.enableBackend) {
this.exportExcelByBackend(args); this.exportExcelByBackend(args);
return; return;
} }
...@@ -1714,7 +1714,7 @@ export class GridControlBase extends MDControlBase implements GridControlInterfa ...@@ -1714,7 +1714,7 @@ export class GridControlBase extends MDControlBase implements GridControlInterfa
const { codeList } = codelistColumn; const { codeList } = codelistColumn;
let items: any = await this.codeListService.getDataItems({ tag: codeList.codeName, type: codeList.codeListType, data: codeList, context: this.context, viewparams: this.viewparams }); let items: any = await this.codeListService.getDataItems({ tag: codeList.codeName, type: codeList.codeListType, data: codeList, context: this.context, viewparams: this.viewparams });
jsonData.forEach((row: any) => { jsonData.forEach((row: any) => {
row[codelistColumn.name] = ModelTool.getCodelistValue(items, row[codelistColumn.name], codelistColumn.codeList, this); row[codelistColumn.name] = ModelTool.getCodelistValue(items, row[codelistColumn.name], codelistColumn.codeList, this) || row[codelistColumn.name];
}) })
} }
// 值格式化 // 值格式化
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</changeSet> </changeSet>
<!--输出实体[BOOK]数据结构 --> <!--输出实体[BOOK]数据结构 -->
<changeSet author="root" id="tab-book-215-3"> <changeSet author="root" id="tab-book-216-3">
<createTable tableName="T_BOOK"> <createTable tableName="T_BOOK">
<column name="BOOKNAME" remarks="" type="VARCHAR(200)"> <column name="BOOKNAME" remarks="" type="VARCHAR(200)">
</column> </column>
......
...@@ -94,6 +94,14 @@ ...@@ -94,6 +94,14 @@
"id" : "srfsourcekey", "id" : "srfsourcekey",
"hidden" : true, "hidden" : true,
"dataType" : 25 "dataType" : 25
}, {
"id" : "hiddenitem",
"hidden" : true,
"dataType" : 25,
"getPSAppDEField" : {
"name" : "FIELD9",
"codeName" : "Field9"
}
}, { }, {
"id" : "bookname", "id" : "bookname",
"dataType" : 25, "dataType" : 25,
...@@ -278,6 +286,33 @@ ...@@ -278,6 +286,33 @@
"detailType" : "GROUPPANEL", "detailType" : "GROUPPANEL",
"name" : "group1", "name" : "group1",
"getPSDEFormDetails" : [ { "getPSDEFormDetails" : [ {
"caption" : "属性9",
"codeName" : "hiddenitem",
"dataType" : 25,
"detailStyle" : "DEFAULT",
"detailType" : "FORMITEM",
"enableCond" : 3,
"ignoreInput" : 0,
"labelPos" : "LEFT",
"labelWidth" : 130,
"name" : "hiddenitem",
"noPrivDisplayMode" : 1,
"getPSAppDEField" : {
"name" : "FIELD9",
"codeName" : "Field9"
},
"getPSEditor" : {
"editorType" : "HIDDEN",
"name" : "hiddenitem"
},
"getPSLayoutPos" : {
"colMD" : 24,
"layout" : "TABLE_24COL"
},
"allowEmpty" : true,
"hidden" : true,
"showCaption" : true
}, {
"caption" : "标签", "caption" : "标签",
"codeName" : "bookname", "codeName" : "bookname",
"dataType" : 25, "dataType" : 25,
......
...@@ -215,6 +215,14 @@ ...@@ -215,6 +215,14 @@
"id" : "srfsourcekey", "id" : "srfsourcekey",
"hidden" : true, "hidden" : true,
"dataType" : 25 "dataType" : 25
}, {
"id" : "hiddenitem",
"hidden" : true,
"dataType" : 25,
"getPSAppDEField" : {
"name" : "FIELD9",
"codeName" : "Field9"
}
}, { }, {
"id" : "bookname", "id" : "bookname",
"dataType" : 25, "dataType" : 25,
...@@ -399,6 +407,33 @@ ...@@ -399,6 +407,33 @@
"detailType" : "GROUPPANEL", "detailType" : "GROUPPANEL",
"name" : "group1", "name" : "group1",
"getPSDEFormDetails" : [ { "getPSDEFormDetails" : [ {
"caption" : "属性9",
"codeName" : "hiddenitem",
"dataType" : 25,
"detailStyle" : "DEFAULT",
"detailType" : "FORMITEM",
"enableCond" : 3,
"ignoreInput" : 0,
"labelPos" : "LEFT",
"labelWidth" : 130,
"name" : "hiddenitem",
"noPrivDisplayMode" : 1,
"getPSAppDEField" : {
"name" : "FIELD9",
"codeName" : "Field9"
},
"getPSEditor" : {
"editorType" : "HIDDEN",
"name" : "hiddenitem"
},
"getPSLayoutPos" : {
"colMD" : 24,
"layout" : "TABLE_24COL"
},
"allowEmpty" : true,
"hidden" : true,
"showCaption" : true
}, {
"caption" : "标签", "caption" : "标签",
"codeName" : "bookname", "codeName" : "bookname",
"dataType" : 25, "dataType" : 25,
......
...@@ -4186,6 +4186,14 @@ ...@@ -4186,6 +4186,14 @@
"id" : "srfsourcekey", "id" : "srfsourcekey",
"hidden" : true, "hidden" : true,
"dataType" : 25 "dataType" : 25
}, {
"id" : "hiddenitem",
"hidden" : true,
"dataType" : 25,
"getPSAppDEField" : {
"name" : "FIELD9",
"codeName" : "Field9"
}
}, { }, {
"id" : "bookname", "id" : "bookname",
"dataType" : 25, "dataType" : 25,
...@@ -4370,6 +4378,33 @@ ...@@ -4370,6 +4378,33 @@
"detailType" : "GROUPPANEL", "detailType" : "GROUPPANEL",
"name" : "group1", "name" : "group1",
"getPSDEFormDetails" : [ { "getPSDEFormDetails" : [ {
"caption" : "属性9",
"codeName" : "hiddenitem",
"dataType" : 25,
"detailStyle" : "DEFAULT",
"detailType" : "FORMITEM",
"enableCond" : 3,
"ignoreInput" : 0,
"labelPos" : "LEFT",
"labelWidth" : 130,
"name" : "hiddenitem",
"noPrivDisplayMode" : 1,
"getPSAppDEField" : {
"name" : "FIELD9",
"codeName" : "Field9"
},
"getPSEditor" : {
"editorType" : "HIDDEN",
"name" : "hiddenitem"
},
"getPSLayoutPos" : {
"colMD" : 24,
"layout" : "TABLE_24COL"
},
"allowEmpty" : true,
"hidden" : true,
"showCaption" : true
}, {
"caption" : "标签", "caption" : "标签",
"codeName" : "bookname", "codeName" : "bookname",
"dataType" : 25, "dataType" : 25,
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册