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

ShineKOT 发布系统代码 [后台服务,演示应用]

上级 7a467949
......@@ -137,6 +137,7 @@ import AppIndexOrgSelect from './components/layout-element/index/app-index-org-s
import AppIndexUserInfo from './components/layout-element/index/app-index-user-info/app-index-user-info.vue';
import AppCtrlPos from './components/layout-element/control/app-ctrl-pos/app-ctrl-pos.vue';
import AppPresetButton from './components/layout-element/interactive/app-preset-button/app-preset-button.vue';
import AppFieldImageDynamic from './components/layout-element/media/app-field-image-dynamic/app-field-image-dynamic.vue';
// 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister;
// 全局挂载实体权限服务注册中心
......@@ -288,5 +289,6 @@ export const AppComponents = {
v.component('app-index-user-info', AppIndexUserInfo);
v.component('app-ctrl-pos', AppCtrlPos);
v.component('app-preset-button',AppPresetButton);
v.component('app-field-image-dynamic', AppFieldImageDynamic);
},
};
\ No newline at end of file
<template>
<i-button
:class="className"
:class="curClassName"
:style="curStyle"
:type="buttonType"
:disabled="disabled"
:title="tooltip"
......@@ -45,67 +46,91 @@ export default class AppPresetButton extends Vue {
@Prop() public caption?: string;
/**
* 显示标题
* 加载状态
*
* @memberof AppPresetButton
*/
@Prop({ default: true }) public showCaption!: boolean;
@Prop({ default: false }) public loading?: boolean;
/**
* 禁用状态
* 布局模型详情
*
* @type {*}
* @memberof AppPresetButton
*/
@Prop({ default: false }) public disabled?: boolean;
@Prop() public layoutModelDetails: any;
/**
* 加载状态
*
* @memberof AppPresetButton
*/
@Prop({ default: false }) public loading?: boolean;
/**
* 传入数据
* 显示标题
*
* @memberof AppPresetButton
*/
@Prop() public data: any;
get showCaption() {
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.isShowCaption;
}
/**
* 图标
* 类名
*
* @memberof AppPresetButton
*/
@Prop() public cssClass?: string;
get curClassName(){
const layoutModel = this.layoutModelDetails[this.name];
return `app-preset-button ${this.name} ${layoutModel.sysCss}`;
}
/**
* 图片路径
*
* @memberof AppPresetButton
*/
@Prop() public imagePath?: string;
get imagePath() {
const layoutModel = this.layoutModelDetails[this.name];
let imagePath = '';
if (layoutModel.sysImage) {
imagePath = layoutModel.sysImage.imagePath;
} else if (layoutModel.uiAction) {
imagePath = layoutModel.uiAction.imagePath;
}
return imagePath;
}
/**
* 按钮绘制模式
* 图标
*
* @memberof AppPresetButton
*/
@Prop({ default: 'BUTTON' }) public renderMode!: 'BUTTON' | 'LINK';
get cssClass() {
const layoutModel = this.layoutModelDetails[this.name];
let cssClass = '';
if (layoutModel.sysImage) {
cssClass = layoutModel.sysImage.iconcls;
} else if (layoutModel.uiAction) {
cssClass = layoutModel.uiAction.iconcls;
}
return cssClass;
}
/**
* 按钮样式
*
* 当前容器样式
*
* @memberof AppPresetButton
*/
@Prop({ default: 'DEFAULT' }) public buttonStyle!: 'DEFAULT' | 'INVERSE' | 'PRIMARY' | 'INFO' | 'SUCCESS' | 'WARNING' | 'DANGER' | 'STYLE2' | 'STYLE3' | 'STYLE4';
get curStyle(){
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.getElementStyle();
}
/**
* 按钮图标方向
*
* 禁用
*
* @memberof AppPresetButton
*/
@Prop({ default: 'LEFT' }) public iconAlign!: 'LEFT' | 'TOP' | 'RIGHT' | 'BOTTOM';
get disabled(){
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.disabled;
}
/**
* 按钮类型
......@@ -113,42 +138,45 @@ export default class AppPresetButton extends Vue {
* @memberof AppPresetButton
*/
get buttonType() {
if (Object.is(this.renderMode, 'LINK')) {
const layoutModel = this.layoutModelDetails[this.name];
if (Object.is(layoutModel.renderMode, 'LINK')) {
return 'text';
} else {
if (
Object.is(this.buttonStyle, 'DEFAULT') ||
Object.is(this.buttonStyle, 'STYLE2') ||
Object.is(this.buttonStyle, 'STYLE3') ||
Object.is(this.buttonStyle, 'STYLE4')
Object.is(layoutModel.buttonStyle, 'DEFAULT') ||
Object.is(layoutModel.buttonStyle, 'STYLE2') ||
Object.is(layoutModel.buttonStyle, 'STYLE3') ||
Object.is(layoutModel.buttonStyle, 'STYLE4')
) {
return 'default';
} else if (Object.is(this.buttonStyle, 'DANGER')) {
} else if (Object.is(layoutModel.buttonStyle, 'DANGER')) {
return 'error';
} else if (Object.is(this.buttonStyle, 'INVERSE')) {
} else if (Object.is(layoutModel.buttonStyle, 'INVERSE')) {
return 'primary';
} else {
return this.buttonStyle.toLowerCase();
return layoutModel.buttonStyle.toLowerCase();
}
}
}
/**
* 按钮幽灵属性,使按钮背景透明
* 图标方向
*
* @memberof AppPresetButton
*/
get buttonGhost() {
return Object.is(this.buttonStyle, 'INVERSE');
get iconAlign() {
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.iconAlign || 'LEFT';
}
/**
* 类名
* 按钮幽灵属性,使按钮背景透明
*
* @memberof AppPresetButton
*/
get className(): string {
return `app-preset-button ${this.name}`;
get buttonGhost() {
const layoutModel = this.layoutModelDetails[this.name];
return Object.is(layoutModel.buttonStyle, 'INVERSE');
}
/**
......
.app-login-input {
.ivu-input-wrapper {
width: 100%;
height: 100%;
}
.ivu-input {
height: 100%;
width: 100%;
}
.ivu-input-prefix {
display: flex;
align-items: center;
justify-content: center;
}
}
\ No newline at end of file
<template>
<div class="app-user-input">
<div :class="[model.sysCss, 'app-login-input']" :style="containerStyle">
<i-input
size='large'
:prefix='icon'
v-model="value"
:placeholder="placeholder">
:prefix='defaultIcon'
v-model="curValue"
:disabled="disabled"
:readonly="readonly"
:placeholder="model.caption">
</i-input>
</div>
</template>
<script lang="ts">
import { Vue, Component, Watch, Prop, Model } from 'vue-property-decorator';
import { PanelFieldModel } from '@/model/panel-detail';
import { Vue, Component, Prop } from 'vue-property-decorator';
@Component({
})
export default class AppUserId extends Vue {
export default class AppLoginInput extends Vue {
/**
* 模型
*
* @type {string}
* @memberof AppLoginInput
*/
@Prop() public model!: PanelFieldModel;
/**
* 登录名称
*
*
* @type {string}
* @memberof AppUserId
* @memberof AppLoginInput
*/
@Prop() public value!: string;
/**
* 名称
*
* @type {string}
* @memberof AppLoginInput
*/
@Prop() public name!: string;
/**
* 默认图标
*
* @type {string}
* @memberof AppLoginInput
*/
@Prop() public defaultIcon?: string;
/**
* 容器样式
*
* @type {any}
* @memberof AppLoginInput
*/
@Prop({default: ''}) public value!: string;
public containerStyle: any = null;
@Prop() public icon?: string;
/**
* 禁用模式
*
* @type {any}
* @memberof AppLoginInput
*/
public disabled: boolean = false;
/**
* 只读模式
*
* @type {any}
* @memberof AppLoginInput
*/
public readonly: boolean = false;
/**
* 当前值
*
* @type {any}
* @memberof AppLoginInput
*/
get curValue() {
return this.value;
}
/**
* 值变化
*
* @memberof AppPresetTextInput
*/
set curValue(val: any) {
this.$emit('valueChange', { name: this.name, value: val });
}
@Prop() public placeholder?: string;
public mounted() {
if (this.model) {
this.containerStyle = this.model.getElementStyle();
this.disabled = Object.is(this.model.fieldState, '1');
this.readonly = Object.is(this.model.fieldState, '2');
}
}
}
</script>
<style lang="less">
@import "./app-login-input.less";
</style>
\ No newline at end of file
<template>
<div :class="{'app-field-image-dynamic':true,[cssClass]:cssClass?true:false}">
<img :style="cssStyle" :src="imgUrl" />
</div>
</template>
<script lang = 'ts'>
import { Vue, Component, Prop, Watch, Provide } from 'vue-property-decorator';
import { ImgurlBase64 } from '@/utils';
import { Environment } from "@/environments/environment";
@Component({})
export default class AppFieldImageDynamic extends Vue {
/**
* 输入值
*
* @type {string}
* @memberof AppRawItemImage
*/
@Prop() public value: any;
/**
* 样式
*
* @type {string}
* @memberof AppRawItemImage
*/
@Prop() public cssStyle?: string;
/**
* 样式表类名
*
* @type {string}
* @memberof AppRawItemImage
*/
@Prop({default:''}) public cssClass: string;
/**
* 动态图片路径
*
* @memberof AppPresetRawitem
*/
protected dynaImgUrl: string = '';
/**
* 下载文件路径
*
* @memberof AppPresetRawitem
*/
public downloadUrl = Environment.ExportFile;
/**
* 图片路径
*
* @memberof AppPresetRawitem
*/
get imgUrl(): string {
return this.dynaImgUrl;
}
created() {
this.handleDynaImg();
}
/**
* 处理动态图片
*
* @memberof AppPresetRawitem
*/
protected handleDynaImg() {
if (this.value && typeof this.value == "string") {
// 默认识别文件对象形式,识别失败则为全路径模式
try {
const _files = JSON.parse(this.value);
const file = _files instanceof Array ? _files[0] : null;
const url =
file && file.id ? `${this.downloadUrl}/${file.id}` : "";
ImgurlBase64.getInstance()
.getImgURLOfBase64(url)
.then((res: any) => {
this.dynaImgUrl = res;
});
} catch (error) {
this.dynaImgUrl = this.value;
}
}
}
}
</script>
<style lang = "less">
@import './app-field-image-dynamic.less';
</style>
\ No newline at end of file
......@@ -18,19 +18,50 @@
import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
@Component({})
export default class AppCarousel extends Vue {
/**
* 父项所有数据
*
* @type {*}
* @memberof AppPresetCarousel
*/
@Prop() public contextData?: any;
/**
* @description 轮播图数据
* @param {*}
* @memberof AppCarousel
*/
@Prop() public data?: any;
@Prop() public value?: any;
/**
* @description 轮播图样式
* @param {*}
* @memberof AppCarousel
*/
@Prop() public rawstyle?: any;
@Prop() public cssStyle?: any;
/**
* @description 样式表
* @param {*}
* @memberof AppCarousel
*/
@Prop() public cssClass?: any;
/**
* 名称
*
* @type {string}
* @memberof AppCarousel
*/
@Prop() public name!: string;
/**
* 类型
*
* @type {string}
* @memberof AppCarousel
*/
@Prop() public type?: string;
/**
* @description 轮播图图片所有项数据
......@@ -64,7 +95,7 @@ export default class AppCarousel extends Vue {
* @memberof AppCarousel
*/
created() {
this.handleSwipData(this.data);
this.handleSwipData(this.value);
}
/**
......@@ -81,7 +112,7 @@ export default class AppCarousel extends Vue {
this.swipeData = data.slice(0, -2);
this.swipeConfig = this.setSwipeConfig(data.slice(-2));
} else {
this.swipeData = this.data;
this.swipeData = data;
this.swipeConfig = this.setSwipeConfig(data);
}
}
......
......@@ -11,9 +11,11 @@ export class PanelButtonModel extends PanelDetailModel {
constructor(opts: any = {}) {
super(opts);
this.uiaction = opts.uiaction;
this.uiAction = opts.uiAction;
this.buttonStyle = opts.buttonStyle;
this.renderMode = opts.renderMode;
this.iconAlign = opts.iconAlign || 'LEFT';
this.disabled = opts.disabled ? true : false;
}
/**
......@@ -22,8 +24,23 @@ export class PanelButtonModel extends PanelDetailModel {
* @type {*}
* @memberof PanelButtonModel
*/
public uiaction:any;
public uiAction:any;
/**
* 图标方向
*
* @type {('LEFT' | 'TOP' | 'RIGHT' | 'BOTTOM')}
* @memberof PanelButtonModel
*/
public iconAlign: 'LEFT' | 'TOP' | 'RIGHT' | 'BOTTOM';
/**
* 是否禁用
*
* @type {boolean}
* @memberof PanelButtonModel
*/
public disabled: boolean = false;
/**
* @description 按钮类型
......
......@@ -38,6 +38,16 @@ export class PanelFieldModel extends PanelDetailModel {
*/
public enableCond: number | 0 | 1 | 2 | 3 = 3;
/**
* @description 默认状态
* 0 不启用
* 1 只读
* 2 禁用
* @type {('0' | '1' | '2')}
* @memberof PanelFieldModel
*/
public fieldState: '0' | '1' | '2';
/**
* Creates an instance of PanelFieldModel.
* PanelFieldModel 实例
......@@ -49,6 +59,7 @@ export class PanelFieldModel extends PanelDetailModel {
super(opts);
this.disabled = opts.disabled ? true : false;
this.enableCond = opts.enableCond;
this.fieldState = opts.fieldState;
}
/**
......
......@@ -268,9 +268,9 @@ export default class IBIZOrderTestCustomLayoutPanelGridExpViewBase extends Vue {
* @memberof IBIZOrderTestCustomLayoutPanelGridExpViewBase
*/
public layoutModelDetails:any = {
view_pagecaption:new PanelFieldModel({ name: 'view_pagecaption', caption: '页面标题', isShowCaption: false, sysCss: '', itemType: 'FIELD', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'', layoutPos:'', layoutHeight:0, heightMode:'FULL', layoutWidth:0, widthMode:'FULL', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'', vAlignSelf:'', flexGrow:0, flexParams:{align:'',dir:'',vAlign:''}, fieldState: '0', panel: this }),
view_pagecaption:new PanelFieldModel({ name: 'view_pagecaption', caption: '页面标题', isShowCaption: false, sysCss: '', itemType: 'FIELD', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'', layoutPos:'', layoutHeight:0, heightMode:'FULL', layoutWidth:0, widthMode:'FULL', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'', vAlignSelf:'', flexGrow:0, flexParams:{align:'',dir:'',vAlign:''}, panel: this , fieldState: '0', }),
container2:new PanelContainerModel({ name: 'container2', caption: '容器', titleBarCloseMode: 0, isShowCaption: false, sysCss: '', itemType: 'CONTAINER', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'TABLE_24COL', layoutPos:'', layoutHeight:0, heightMode:'FULL', layoutWidth:0, widthMode:'', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'', vAlignSelf:'', flexGrow:-1, flexParams:{align:'',dir:'',vAlign:''}, panel: this , details:['view_pagecaption']}),
nav_pos1:new PanelRawitemModel({ name: 'nav_pos1', caption: '导航区占位', isShowCaption: true, sysCss: '', itemType: 'RAWITEM', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'', layoutPos:'CENTER', layoutHeight:0, heightMode:'', layoutWidth:0, widthMode:'', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'', vAlignSelf:'', flexGrow:0, flexParams:{align:'',dir:'',vAlign:''}, predefinedType: 'NAV_POS', contentType: '', contentStyle: '', rawContent: '', htmlContent: '', panel: this , viewType: 'DEGRIDEXPVIEW' }),
nav_pos1:new PanelRawitemModel({ name: 'nav_pos1', caption: '导航区占位', isShowCaption: true, sysCss: '', itemType: 'RAWITEM', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'', layoutPos:'CENTER', layoutHeight:0, heightMode:'', layoutWidth:0, widthMode:'', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'', vAlignSelf:'', flexGrow:0, flexParams:{align:'',dir:'',vAlign:''}, panel: this , viewType: 'DEGRIDEXPVIEW', predefinedType: 'NAV_POS', contentType: '', contentStyle: '', rawContent: '', htmlContent: '', }),
container_scroll_main1:new PanelContainerModel({ name: 'container_scroll_main1', caption: '面板容器', titleBarCloseMode: 0, isShowCaption: true, sysCss: '', itemType: 'CONTAINER', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'BORDER', layoutPos:'CENTER', layoutHeight:0, heightMode:'', layoutWidth:0, widthMode:'', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'', vAlignSelf:'', flexGrow:0, flexParams:{align:'',dir:'',vAlign:''}, panel: this , details:['nav_pos1']}),
gridexpbar:new PanelCtrlPosModel({ name: 'gridexpbar', caption: '表格导航栏', isShowCaption: true, sysCss: '', itemType: 'CTRLPOS', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'', layoutPos:'CENTER', layoutHeight:0, heightMode:'', layoutWidth:0, widthMode:'', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'', vAlignSelf:'', flexGrow:0, flexParams:{align:'',dir:'',vAlign:''}, panel: this }),
container_scroll_left1:new PanelContainerModel({ name: 'container_scroll_left1', caption: '面板容器', titleBarCloseMode: 0, isShowCaption: true, sysCss: '', itemType: 'CONTAINER', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'BORDER', layoutPos:'WEST', layoutHeight:0, heightMode:'', layoutWidth:200, widthMode:'PX', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'', vAlignSelf:'', flexGrow:0, flexParams:{align:'',dir:'',vAlign:''}, panel: this , details:['gridexpbar']}),
......@@ -291,6 +291,16 @@ export default class IBIZOrderTestCustomLayoutPanelGridExpViewBase extends Vue {
this.layoutData[$event.name] = $event.value;
}
/**
* 处理按钮点击
*
* @public
* @memberof IBIZOrderTestCustomLayoutPanelGridExpViewBase
*/
public handleButtonClick($event: any) {
}
/**
* 视图引擎
*
......
......@@ -341,7 +341,7 @@ export default class IBIZOrderUsr2GridViewBase extends Vue {
* @memberof IBIZOrderUsr2GridViewBase
*/
public layoutModelDetails:any = {
view_pagecaption:new PanelFieldModel({ name: 'view_pagecaption', caption: '页面标题', isShowCaption: false, sysCss: '', itemType: 'FIELD', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'', layoutPos:'', layoutHeight:0, heightMode:'FULL', layoutWidth:0, widthMode:'FULL', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'LEFT', vAlignSelf:'', flexGrow:-1, flexParams:{align:'',dir:'',vAlign:''}, fieldState: '0', panel: this }),
view_pagecaption:new PanelFieldModel({ name: 'view_pagecaption', caption: '页面标题', isShowCaption: false, sysCss: '', itemType: 'FIELD', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'', layoutPos:'', layoutHeight:0, heightMode:'FULL', layoutWidth:0, widthMode:'FULL', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'LEFT', vAlignSelf:'', flexGrow:-1, flexParams:{align:'',dir:'',vAlign:''}, panel: this , fieldState: '0', }),
container1:new PanelContainerModel({ name: 'container1', caption: '面板容器', titleBarCloseMode: 0, isShowCaption: false, sysCss: '', itemType: 'CONTAINER', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'SIMPLEFLEX', layoutPos:'', layoutHeight:0, heightMode:'', layoutWidth:0, widthMode:'', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'', vAlignSelf:'', flexGrow:6, flexParams:{align:'',dir:'',vAlign:''}, panel: this , details:['view_pagecaption']}),
quicksearchbar:new PanelCtrlPosModel({ name: 'quicksearchbar', caption: 'QUICKSEARCHBAR', isShowCaption: true, sysCss: '', itemType: 'CTRLPOS', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'', layoutPos:'', layoutHeight:0, heightMode:'FULL', layoutWidth:0, widthMode:'', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'RIGHT', vAlignSelf:'', flexGrow:-1, flexParams:{align:'',dir:'',vAlign:''}, panel: this }),
container2:new PanelContainerModel({ name: 'container2', caption: '面板容器', titleBarCloseMode: 0, isShowCaption: false, sysCss: '', itemType: 'CONTAINER', itemStyle: 'DEFAULT', visible: true, disabled: false, layout:'SIMPLEFLEX', layoutPos:'', layoutHeight:0, heightMode:'', layoutWidth:0, widthMode:'', spacingBottom:'', spacingLeft:'', spacingRight:'', spacingTop:'', hAlignSelf:'', vAlignSelf:'', flexGrow:3, flexParams:{align:'',dir:'',vAlign:''}, panel: this , details:['quicksearchbar']}),
......@@ -367,6 +367,16 @@ export default class IBIZOrderUsr2GridViewBase extends Vue {
this.layoutData[$event.name] = $event.value;
}
/**
* 处理按钮点击
*
* @public
* @memberof IBIZOrderUsr2GridViewBase
*/
public handleButtonClick($event: any) {
}
......
......@@ -12,3 +12,4 @@ export { UIActionTool } from './uiaction-tool/uiaction-tool';
export { LoadAppData } from './load-app-data/load-app-data';
export { Interceptors } from './interceptor/interceptor';
export { StudioActionUtil } from './studio-action/StudioActionUtil';
export { ImgurlBase64 } from './util/imgurl-base64';
\ No newline at end of file
import axios from 'axios';
export class ImgurlBase64{
/**
* 单例变量声明
*
* @memberof ImgurlBase64
*/
private static imgurlBase64: ImgurlBase64;
/**
* 图片缓存(加载中)
*
* @type {Map<string,any>}
* @memberof ImgurlBase64
*/
public static imgCache: Map<string, any> = new Map();
/**
* 图片缓存(已完成)
*
* @type {Map<string,any>}
* @memberof ImgurlBase64
*/
public static imgCached: Map<string, any> = new Map();
/**
* 获取 ImgurlBase64 单例对象
*
* @memberof ImgurlBase64
*/
public static getInstance() {
if (!this.imgurlBase64) {
this.imgurlBase64 = new ImgurlBase64();
}
return this.imgurlBase64;
}
/**
* 手动获取图片
*
*
* @param url 图片url路径
* @returns
*/
public async getImgURLOfBase64(url: string) {
return new Promise((resolve, reject) => {
let img = '/';
// 富文本CV上传图片与鼠标移出抛值冲突问题,上传成功回调还没执行时就抛值
var reg = /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*?)\s*$/i;
if (reg.test(url)) {
return resolve(url);
}
// 缓存中有从缓存中拿
if (ImgurlBase64.imgCached.get(url)) {
let img = ImgurlBase64.imgCached.get(url);
resolve(img);
}
const callback: Function = (url: string, promise: Promise<any>) => {
promise.then((response: any) => {
if (response && response.status === 200 && response.data) {
// 获取文件名
const disposition = response.headers['content-disposition'];
const filename = disposition.split('filename=')[1];
let type = 'image/png';
if (filename && filename.indexOf('.') > 0) {
const start = filename.lastIndexOf('.');
const expandedName = filename.substring(start + 1);
if (expandedName.match(/(bmp|jpg|jpeg|png|tif|gif|pcx|tga|exif|fpx|svg|psd|cdr|pcd|dxf|ufo|eps|ai|raw|WMF|webp)/gi) != null) {
type = 'image/' + expandedName;
} else {
resolve(img);
}
}
let blob = new Blob([response.data],{type: type});
this.blobToBase64(blob).then((res) => {
// 转化后的base64
img = `${res}`;
// 缓存图片
ImgurlBase64.imgCached.set(url, img);
resolve(img);
})
} else {
resolve(img);
}
}).catch((result: any) => {
return resolve(img);
})
}
// 加载中
if (ImgurlBase64.imgCache.get(url)) {
callback(url, ImgurlBase64.imgCache.get(url));
} else {
let _url = url;
if (!Object.is('/', _url.substring(0,1))) {
_url = '/'+_url;
}
let result:Promise<any> = axios({method: 'get', url: _url, responseType: 'blob'});
ImgurlBase64.imgCache.set(url, result);
callback(url, result);
}
});
}
/**
* 将blob转为base64
*
*
* @param blob blob对象
* @returns
*/
public blobToBase64(blob: any) {
return new Promise((resolve, reject) => {
const fileReader = new FileReader();
fileReader.onload = (e: any) => {
resolve(e.target.result);
};
// readAsDataURL
fileReader.readAsDataURL(blob);
fileReader.onerror = () => {
reject(new Error('blobToBase64 error'));
};
});
}
}
\ No newline at end of file
......@@ -663,7 +663,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public load(opt: any = {}): void {
if(!this.loadAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr3GridView' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9GridView' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
return;
}
const arg: any = { ...opt };
......@@ -699,7 +699,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public loadDraft(opt: any = {},mode?:string): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr3GridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9GridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
......
......@@ -214,17 +214,24 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public selection: any = {};
public menuItems: any[] = [
public items: any[] = [
{
caption: '详细信息',
id: 'a7c7923d37319b42645a41908d62bae9',
name: 'a7c7923d37319b42645a41908d62bae9',
codeName: 'a7c7923d37319b42645a41908d62bae9',
hidden: false,
items: this.items.find((item: any) => item.groupCodeName === 'a7c7923d37319b42645a41908d62bae9')
},
{
items: [
{
text: "订单明细",
disabled: false,
id: "dritem2",
groupCodeName: 'a7c7923d37319b42645a41908d62bae9',
drView: 'ibizorder-detail-sgrid-view',
localContext:{CONTEXTPARAM1:"%orderstate%"},
localViewParam:{param2:"%orderstate%"}
},
]
},
]
......@@ -292,8 +299,10 @@ export default class DefaultBase extends Vue implements ControlInterface {
return;
}
if (Object.is('state', action)) {
const state = !this.context.ibizorder ? true : false;
this.setItemDisabled(this.items, state);
this.handleFormChange(data);
}
if (Object.is('change', action)) {
this.selection = data;
}
});
}
......@@ -323,28 +332,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
}
}
/**
* 获取关系项
*
* @public
* @param {*} [arg={}]
* @returns {*}
* @memberof DefaultBase
*/
public getDRBarItem(arg: any = {}): any {
let expmode = arg.nodetype;
if (!expmode) {
expmode = '';
}
if (Object.is(expmode, 'dritem2')) {
return {
viewname: 'ibizorder-detail-sgrid-view',
parentdatajo: {},
};
}
return undefined;
}
/**
* 处理数据
*
......@@ -392,67 +379,62 @@ export default class DefaultBase extends Vue implements ControlInterface {
return item;
}
/**
* 初始化导航参数
*
* @param {*} drItem
* @memberof DefaultBase
*/
public initNavParam(drItem:any){
// let returnNavParam:any = {};
// if(drItem && drItem.id){
// let curDRItem:any = this.navParamsArray.find((item:any) =>{
// return Object.is(item.id,drItem.id);
// })
// if(curDRItem){
// let localContext:any = curDRItem.localContext;
// let localViewParam:any = curDRItem.localViewParam;
// if(localContext && Object.keys(localContext).length >0){
// let _context:any = this.$util.computedNavData(this.formData,this.context,this.viewparams,localContext);
// returnNavParam.localContext = _context;
// }
// if(localViewParam && Object.keys(localViewParam).length >0){
// let _params:any = this.$util.computedNavData(this.formData,this.context,this.viewparams,localViewParam);
// returnNavParam.localViewParam = _params;
// }
// return returnNavParam;
// }else{
// return null;
// }
// }
}
/**
* 节点选中
*
* @param {*} $event
* @memberof DefaultBase
*/
public onSelect($event: any): void {
public onSelect(key: string): void {
if (key === this.selection.id) {
return;
}
const selectItem = this.getItem(this.items, key);
if (!selectItem) {
return;
}
const tempContext = Util.deepCopy(this.context);
const tempViewParams = Util.deepCopy(this.viewparams);
if (selectItem.localContext && Object.keys(selectItem.localContext).length > 0) {
const _context: any = this.$util.computedNavData(this.formData, tempContext, tempViewParams, selectItem.localContext);
Object.assign(tempContext, _context);
}
if (this.formData.srfparentkey) {
Object.assign(tempContext, { srfparentkey: this.formData.srfparentkey });
Object.assign(tempViewParams, { srfparentkey: this.formData.srfparentkey });
}
if (selectItem.localViewParam && Object.keys(selectItem.localViewParam).length > 0) {
const _params: any = this.$util.computedNavData(this.formData, tempContext, tempViewParams, selectItem.localViewParam);
Object.assign(tempViewParams, _params);
}
if (this.formData.srfparentdename) {
Object.assign(tempContext, { srfparentdename: this.formData.srfparentdename });
Object.assign(tempViewParams, { srfparentdename: this.formData.srfparentdename });
}
const drItem = {
id: selectItem.id,
drView: selectItem.drView,
srfnavdata: {
context: tempContext,
viewparams: tempViewParams
}
}
this.$emit('selectionchange', drItem);
}
// this.$emit('selectionchange', [item]);
// let localNavParam:any = this.initNavParam(item);
// const refview = this.getDRBarItem({ nodetype: item.id });
// this.selection = {};
// const _context: any = { ...JSON.parse(JSON.stringify(this.context)) };
// if(localNavParam && localNavParam.localContext){
// Object.assign(_context,localNavParam.localContext);
// }
// const _params: any = {};
// if(localNavParam && localNavParam.localViewParam){
// Object.assign(_params,localNavParam.localViewParam);
// }
// if (refview && refview.parentdatajo) {
// Object.assign(_context, refview.parentdatajo);
// Object.assign(this.selection, { view: { viewname: refview.viewname }, data: _context, param: _params });
// }
// Object.assign(this.selection, item);
/**
* 处理表单变化
*
* @param {*} $event
* @memberof DefaultBase
*/
public handleFormChange(args: any) {
if (args && Object.is(args.srfuf, '1')) {
this.setDisabled(this.items, false);
} else {
this.setDisabled(this.items, true);
}
this.formData = args;
}
/**
......@@ -492,21 +474,17 @@ export default class DefaultBase extends Vue implements ControlInterface {
}
/**
* 设置关系项状态
* 设置禁用状态
*
* @param {any[]} items
* @param {boolean} state
* @memberof DefaultBase
*/
public setItemDisabled(items: any[], state: boolean) {
public setDisabled(items: any[], state: boolean) {
items.forEach((item: any) => {
if (!Object.is(item.id, 'form')) {
item.disabled = state;
item.disabled = state;
if (item && item.items && item.items.length > 0) {
this.setDisabled(item.items, state);
}
if (item.items && Array.isArray(item.items)) {
this.setItemDisabled(item.items, state);
}
});
})
}
}
......
......@@ -55,23 +55,6 @@
git clone -b master $para2 demosys/
export NODE_OPTIONS=--max-old-space-size=4096
cd demosys/
cd demo-boot
mvn ibizlabcli:code
cd ..
set +e
git config user.name "ibizdev"
git add .
git commit -m "generator before deploy $para5"
git push origin master
git config user.name "root"
set -e
mvn package -Pboot
cd demo-boot
sed -i "s#dstimage#$para5#g" pom.xml
sed -i "s#dstimage#$para5#g" src/main/docker/demo-boot-demoapi.yaml
mvn -Pboot docker:build
mvn -Pboot docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/demo-boot-demoapi.yaml iBizDemo --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -10,6 +10,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Duser.timezone=$TZ -Djava.security.egd=file:/dev/./urandom -jar /demo-boot.jar
EXPOSE 51000
EXPOSE 8081
ADD demo-boot.jar /demo-boot.jar
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册