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

wwwwww 部署微服务应用

上级 96c1c5a7

要显示的变更太多。

为了保持性能,仅显示文件中的 1000/1000+

*volumes
*target
.settings
*node_modules
......
......@@ -117,9 +117,7 @@ $ yarn build
|─ ─ favicon.ico 图标
​ |─ ─ src 工程文件夹
|─ ─ assets 静态资源
|─ ─ codelist 动态代码表服务
|─ ─ components 基础组件,主要包含编辑器组件和其他全局使用的组件
|─ ─ counter 计数器服务
|─ ─ engine 引擎文件,主要封装了内置视图的内置逻辑
|─ ─ environments 环境文件
​ |─ ─ interface 接口文件
......@@ -152,7 +150,6 @@ $ yarn build
|─ ─ YYY-ui-logic-base.ts 应用实体界面处理逻辑文件
|─ ─ YYY-ui-logic.ts 自定义应用实体界面处理逻辑文件
|─ ─ utils 工具类文件
|─ ─ utilservice 应用功能服务
|─ ─ widgets 部件文件夹
|─ ─ appde 应用实体名称
​ |─ ─ XXX 部件名称
......
......@@ -18,16 +18,12 @@
"@fullcalendar/list": "^4.4.0",
"@fullcalendar/timegrid": "^4.4.0",
"@fullcalendar/vue": "^4.4.0",
"vuedraggable": "^2.23.2",
"async-validator": "^3.3.0",
"axios": "^0.19.1",
"core-js": "^3.4.4",
"echarts": "^4.6.0",
"element-ui": "^2.13.0",
"file-saver": "^2.0.2",
"font-awesome": "^4.7.0",
"ibiz-gantt-elastic": "^1.0.15",
"ibiz-vue-lib": "^0.1.9",
"interactjs": "^1.9.4",
"moment": "^2.24.0",
"path-to-regexp": "^6.1.0",
......
app_EAMWeb/public/assets/img/logo.png

2.0 KB | W: 0px | H: 0px

app_EAMWeb/public/assets/img/logo.png

6.7 KB | W: 0px | H: 0px

app_EAMWeb/public/assets/img/logo.png
app_EAMWeb/public/assets/img/logo.png
app_EAMWeb/public/assets/img/logo.png
app_EAMWeb/public/assets/img/logo.png
  • 2-up
  • Swipe
  • Onion skin
因为 它太大了无法显示 源差异 。您可以改为 查看blob
......@@ -119,6 +119,14 @@
"viewname": "EMWPLISTCOSTEditView",
"viewtag": "09ad3a83b0e34aac0f60864d0730dda3"
},
"appindexview": {
"title": "应用首页视图",
"caption": "",
"viewtype": "APPINDEXVIEW",
"viewmodule": "Monitor",
"viewname": "AppIndexView",
"viewtag": "0A87D181-7625-46E5-A00E-AFD14CFAF409"
},
"emproductgridview": {
"title": "试用品",
"caption": "试用品",
......
app_EAMWeb/public/favicon.ico

1.1 KB | W: 16px | H: 16px

app_EAMWeb/public/favicon.ico

4.2 KB | W: 32px | H: 32px

app_EAMWeb/public/favicon.ico
app_EAMWeb/public/favicon.ico
app_EAMWeb/public/favicon.ico
app_EAMWeb/public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
<template>
<div id='app'>
<debug-actions/>
<app-debug-actions />
<router-view v-if="isRouterAlive"/>
</div>
</template>
......
......@@ -69,13 +69,6 @@ import AppImagePreview from './components/app-image-preview/app-image-preview.vu
import AppFormatData from './components/app-format-data/app-format-data.vue'
import AppUploadFileInfo from './components/app-upload-file-info/app-upload-file-info.vue'
import ContextMenu from './components/context-menu/context-menu'
import AppColumnFormat from './components/app-column-format/app-column-format.vue'
import AppQuickGroup from './components/app-quick-group/app-quick-group.vue'
import AppOrgSelect from './components/app-org-select/app-org-select.vue'
import AppDepartmentSelect from './components/app-department-select/app-department-select.vue'
import IBizGroupSelect from './components/ibiz-group-select/ibiz-group-select.vue'
import IBizGroupPicker from './components/ibiz-group-picker/ibiz-group-picker.vue'
import AppWFApproval from './components/app-wf-approval/app-wf-approval.vue'
// 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister;
......@@ -154,12 +147,5 @@ export const AppComponents = {
v.component('app-format-data', AppFormatData);
v.component('app-upload-file-info', AppUploadFileInfo);
v.component('context-menu',ContextMenu);
v.component('app-column-format',AppColumnFormat);
v.component('app-quick-group',AppQuickGroup);
v.component('app-org-select',AppOrgSelect);
v.component('app-department-select',AppDepartmentSelect);
v.component('ibiz-group-select',IBizGroupSelect);
v.component('ibiz-group-picker',IBizGroupPicker);
v.component('app-wf-approval',AppWFApproval);
},
};
\ No newline at end of file
app_EAMWeb/src/assets/img/logo.png

6.7 KB | W: 0px | H: 0px

app_EAMWeb/src/assets/img/logo.png

2.0 KB | W: 0px | H: 0px

app_EAMWeb/src/assets/img/logo.png
app_EAMWeb/src/assets/img/logo.png
app_EAMWeb/src/assets/img/logo.png
app_EAMWeb/src/assets/img/logo.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -43,7 +43,7 @@ export default class AppCheckBox extends Vue {
* @type {string}
* @memberof AppCheckBox
*/
@Prop({default:','}) public valueSeparator?: string;
@Prop({default:';'}) public valueSeparator?: string;
/**
* 是否禁用
......@@ -97,6 +97,28 @@ export default class AppCheckBox extends Vue {
}
}
/**
* 分隔符
*
* @type {*}
* @memberof AppCheckBox
*/
@Prop() separator: any;
/**
* 获取分隔符
*
* @readonly
* @memberof AppCheckBox
*/
get currentseparator() {
if (this.separator) {
return this.separator;
} else {
return ';';
}
}
/**
* 选中值
*
......
......@@ -47,14 +47,6 @@ export default class AppFormDRUIPart extends Vue {
*/
@Prop({ default: '' }) public refreshitems!: string;
/**
* 禁止加载
*
* @type {string}
* @memberof AppFormDRUIPart
*/
@Prop({ default: false }) public isForbidLoad!: boolean;
/**
* 关系视图类型
*
......@@ -240,7 +232,7 @@ export default class AppFormDRUIPart extends Vue {
}
const formData: any = data?data:JSON.parse(this.data);
const _paramitem = formData[this.paramItem];
let viewdata = {};
let viewdata = {srfparentdename:this.parentName,srfparentkey:_paramitem};
Object.assign(viewdata, this.$viewTool.getIndexViewParam());
const _parameters: any[] = [...this.$viewTool.getIndexParameters(), ...this.parameters];
_parameters.forEach((parameter: any) => {
......@@ -252,7 +244,6 @@ export default class AppFormDRUIPart extends Vue {
Object.assign(viewdata, { [this.paramItem]: _paramitem });
//设置顶层视图唯一标识
Object.assign(viewdata,this.context);
Object.assign(viewdata,{srfparentdename:this.parentName,srfparentkey:_paramitem});
this.viewdata = JSON.stringify(viewdata);
this.viewparam = JSON.stringify(this.viewparams);
if (this.isRelationalData) {
......@@ -263,11 +254,7 @@ export default class AppFormDRUIPart extends Vue {
this.blockUIStop();
}
}
if(!this.isForbidLoad){
this.$nextTick(() => {
this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}});
});
}
this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}});
}
/**
......
......@@ -9,7 +9,6 @@
}
>.ivu-card-extra {
.item-extract-mode {
display: flex;
.item {
margin-left: 12px;
}
......
......@@ -131,14 +131,6 @@ export default class AppFormGroup extends Vue {
*/
@Prop() public titleStyle?:string;
/**
* 分组图标
*
* @type {string}
* @memberof AppFormGroup
*/
@Prop() public iconInfo?:any;
/**
* 是否显示标题
*
......
......@@ -123,12 +123,12 @@ export default class AppMpicker extends Vue {
* @param newVal
* @param val
*/
@Watch('curvalue', {immediate:true, deep: true })
@Watch('curvalue', { deep: true })
oncurvalueChange(newVal: any, val: any) {
this.value = [];
this.selectItems = [];
if (newVal) {
this.selectItems = this.parseValue(JSON.parse(newVal));
this.selectItems = JSON.parse(newVal);
this.selectItems.forEach((item: any) => {
this.value.push(item[this.deKeyField]);
let index = this.items.findIndex((i) => Object.is(i[this.deKeyField], item[this.deKeyField]));
......@@ -187,7 +187,7 @@ export default class AppMpicker extends Vue {
let index = this.items.findIndex((item) => Object.is(item[this.deKeyField], select));
if (index >= 0) {
let item = this.items[index];
val.push({ [this.deKeyField]: item[this.deKeyField], [this.deMajorField]: item[this.deMajorField] });
val.push({ [this.deKeyField]: item[this.deKeyField], [this.deMajorField]: item.text });
} else {
index = this.selectItems.findIndex((item: any) => Object.is(item[this.deKeyField], select));
if (index >= 0) {
......@@ -196,7 +196,7 @@ export default class AppMpicker extends Vue {
}
}
});
let value = val.length > 0 ? JSON.stringify(this.formatValue(val)) : '';
let value = val.length > 0 ? JSON.stringify(val) : '';
this.$emit('formitemvaluechange', { name: this.name, value: value });
}
}
......@@ -211,7 +211,7 @@ export default class AppMpicker extends Vue {
let index = this.selectItems.findIndex((item: any) => Object.is(item[this.deKeyField], tag));
if (index >= 0) {
this.selectItems.splice(index, 1);
let value = this.selectItems.length > 0 ? JSON.stringify(this.formatValue(this.selectItems)) : '';
let value = this.selectItems.length > 0 ? JSON.stringify(this.selectItems) : '';
this.$emit('formitemvaluechange', { name: this.name, value: value });
}
}
......@@ -256,50 +256,13 @@ export default class AppMpicker extends Vue {
});
}
if (this.name && this.activeData) {
let value = selects.length > 0 ? JSON.stringify(this.formatValue(selects)) : '';
let value = selects.length > 0 ? JSON.stringify(selects) : '';
this.$emit('formitemvaluechange', { name: this.name, value: value });
}
})
}
}
/**
* 解析值,把srfkey和srfmajortext解析成实体属性名
*
* @param {any[]} value 需要转换的数组
* @memberof AppMpicker
*/
public parseValue(value: any[]){
let result = [];
if(this.deKeyField !== "srfkey" || this.deMajorField !== "srfmajortext"){
value.forEach((item: any) => {
result.push({[this.deMajorField]: item.srfmajortext, [this.deKeyField]: item.srfkey});
});
}else{
result = value;
}
return result;
}
/**
* 格式化值,把实体属性名格式化成srfkey和srfmajortext
*
* @param {any[]} value 需要转换的数组
* @memberof AppMpicker
*/
public formatValue(value: any[]){
let result = [];
if(this.deKeyField !== "srfkey" || this.deMajorField !== "srfmajortext"){
value.forEach((item: any) => {
result.push({srfmajortext : item[this.deMajorField], srfkey : item[this.deKeyField]});
});
}else{
result = value;
}
return result;
}
}
</script>
<style lang="less">
......
......@@ -26,112 +26,94 @@ const tinymceCode:any = tinymce;
@Component({})
export default class AppRichTextEditor extends Vue {
/**
* 传入值
*
* @type {*}
* @memberof AppRichTextEditor
*/
@Prop() value?: any;
/**
* 监听value值
*/
@Watch('value', { immediate: true, deep: true })
oncurrentContent(newval: any, val: any) {
if (newval) {
if(this.editor){
tinymceCode.remove('#' + this.id);
}
this.init(newval);
}
}
/**
* 输入name
*
* @type {string}
* @memberof AppRichTextEditor
*/
@Prop() name?: string;
/**
* 输入高度
*
* @type {*}
* @memberof AppRichTextEditor
*/
@Prop() height?: any;
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppRichTextEditor
*/
@Prop() disabled?: boolean;
@Prop() disabled?: any;
/**
* 表单状态
*
* @type {Subject<any>}
* @memberof AppRichTextEditor
* 当前语言,默认中文
*/
@Prop() public formState?: Subject<any>;
public langu: any = localStorage.getItem('local') ? localStorage.getItem('local') : 'zh_CN' ;
/**
* 监听语言变化
*/
@Watch('$i18n.locale')
onLocaleChange(newval: any, val: any) {
console.log("语言变更"+newval)
this.langu = newval;
if(this.editor){
tinymceCode.remove('#' + this.id);
}
this.init('');
}
/**
* 语言映射文件
*/
public languMap:any = {
'zh-CN': 'zh_CN',
'en-US': 'en_US',
};
/**
* 上传文件路径
*
* @type {string}
* @memberof AppRichTextEditor
*/
public uploadUrl = Environment.BaseUrl + Environment.UploadFile;
/**
* 下载路径
*
* @type {string}
* @memberof AppRichTextEditor
*/
public downloadUrl = Environment.BaseUrl + Environment.ExportFile;
/**
* 当前富文本
*
* @type {*}
* @memberof AppRichTextEditor
*/
public editor: any = null;
/**
* 当前富文本id
*
* @type {string}
* @memberof AppRichTextEditor
*/
public id: string = this.$util.createUUID();
id: string = this.$util.createUUID();
/**
* 当前语言,默认中文
*
* @type {*}
* @memberof AppRichTextEditor
*/
public langu: any = localStorage.getItem('local') ? localStorage.getItem('local') : 'zh_CN' ;
/**
* 语言映射文件
*
* @type {*}
* @memberof AppRichTextEditor
*/
public languMap:any = {
'zh-CN': 'zh_CN',
'en-US': 'en_US',
};
/**
* 是否处于激活状态
*
* @type {boolean}
* @memberof AppRichTextEditor
*/
public isActived:boolean = true;
/**
* 是否需要初始化
*
* @type {boolean}
* 表单状态
*
* @type {Subject<any>}
* @memberof AppRichTextEditor
*/
public isNeedInit:boolean = false;
@Prop() public formState?: Subject<any>;
/**
* 生命周期
......@@ -143,92 +125,40 @@ export default class AppRichTextEditor extends Vue {
this.formState.subscribe(({ type, data }) => {
if (Object.is('load', type)) {
if (!this.value) {
this.init();
if(this.editor){
tinymceCode.remove('#' + this.id);
}
this.init(this.value);
}
}
});
}
}
/**
* 生命周期:激活
*
* @memberof AppRichTextEditor
*/
public activated(){
this.isActived = true;
if(this.isNeedInit){
this.init();
this.isNeedInit = false;
}
}
/**
* 生命周期:缓存
*
* @memberof AppRichTextEditor
*/
public deactivated(){
this.isActived = false;
}
/**
* 生命周期:初始化富文本
*
* @memberof AppRichTextEditor
* 初始化富文本
*/
public mounted() {
this.init();
this.init('');
}
/**
* 生命周期:销毁富文本
*
* @memberof AppRichTextEditor
* 销毁富文本
*/
public destoryed(){
if(this.editor){
tinymceCode.remove('#' + this.id);
}
}
/**
* 监听value值
*
* @memberof AppRichTextEditor
*/
@Watch('value', { immediate: true, deep: true })
oncurrentContent(newval: any, val: any) {
if (newval) {
this.init();
}
}
/**
* 监听语言变化
*/
@Watch('$i18n.locale')
onLocaleChange(newval: any, val: any) {
this.langu = newval;
if(this.isActived){
this.init();
}else{
this.isNeedInit = true;
}
tinymceCode.remove(this.editor);
}
/**
* 初始化富文本
*
* @memberof AppRichTextEditor
* @param val
*/
public init() {
this.destoryed();
public init(val: any) {
let richtexteditor = this;
tinymceCode.init({
selector: '#' + richtexteditor.id,
selector: '#' + this.id,
width: 'calc( 100% - 2px )',
height: richtexteditor.height,
height: this.height,
min_height: 400,
branding: false,
plugins: ['link', 'paste', 'table', 'image', 'codesample', 'code', 'fullscreen', 'preview'],
......@@ -247,13 +177,13 @@ export default class AppRichTextEditor extends Vue {
paste_data_images: true,
codesample_content_css: 'assets/tinymce/prism.css',
skin_url: './assets/tinymce/skins/lightgray',
language_url: './assets/tinymce/langs/' + richtexteditor.languMap[richtexteditor.langu] + '.js',
language:richtexteditor.languMap[richtexteditor.langu],
language_url: './assets/tinymce/langs/' + this.languMap[this.langu] + '.js',
language:this.languMap[this.langu],
setup: (editor: any) => {
richtexteditor.editor = editor;
this.editor = editor;
editor.on('blur', () => {
const content = editor.getContent();
richtexteditor.$emit('change', content);
this.$emit('change', content);
});
},
images_upload_handler: (bolbinfo: any, success: any, failure: any) => {
......@@ -272,13 +202,13 @@ export default class AppRichTextEditor extends Vue {
});
},
init_instance_callback: (editor: any) => {
richtexteditor.editor = editor;
let value = (richtexteditor.value && richtexteditor.value.length > 0) ? richtexteditor.value : '';
if (richtexteditor.editor) {
richtexteditor.editor.setContent(value);
this.editor = editor;
let value = (this.value && this.value.length > 0) ? this.value : '';
if (this.editor) {
this.editor.setContent(value);
}
if (richtexteditor.disabled) {
richtexteditor.editor.setMode('readonly');
if (this.disabled) {
this.editor.setMode('readonly');
}
}
});
......@@ -286,10 +216,8 @@ export default class AppRichTextEditor extends Vue {
/**
* 上传文件
*
* @param url 路径
* @param formData 文件对象
* @memberof AppRichTextEditor
* @param url
* @param formData
*/
public uploadFile(url: string, formData: any) {
let _this = this;
......
......@@ -9,7 +9,7 @@ import { Vue, Component, Prop, Watch, Model } from 'vue-property-decorator';
import CodeListService from "@service/app/codelist-service";
@Component({})
export default class AppSpan extends Vue {
export default class DropDownList extends Vue {
/**
* 当前值
......@@ -46,23 +46,23 @@ export default class AppSpan extends Vue {
/**
* 获取或模式
* @type {boolean}
* @memberof AppSpan
* @memberof SelectPicker
*/
@Prop({default:"STR"}) public renderMode?: string;
/**
* 文本分隔符
* @type {boolean}
* @memberof AppSpan
* @memberof SelectPicker
*/
@Prop({default:'、'}) public textSeparator?: string;
@Prop({default:"、"}) public textSeparator?: string;
/**
* 值分隔符
* @type {boolean}
* @memberof AppSpan
* @memberof SelectPicker
*/
@Prop({default:','}) public valueSeparator?: string;
@Prop({default:";"}) public valueSeparator?: string;
/**
* 监控表单属性 data 值
......@@ -108,11 +108,6 @@ export default class AppSpan extends Vue {
public load(){
if(!this.value || this.tag){
return; //代码表走codelist组件
}else if(this.editorType === "ADDRESSPICKUP"){
JSON.parse(this.value).forEach((item:any,index:number) => {
this.text += index === 0 ? item.srfmajortext : ","+item.srfmajortext;
});
}else{
this.text = this.value;
}
......
......@@ -64,12 +64,6 @@ export default class AppUser extends Vue {
_user.avatar = this.$store.getters.getAppData().context.srfusericonpath;
}
}
if(localStorage.getItem("user")){
let user:any = JSON.parse(localStorage.getItem("user") as string);
if(user && user.personname){
_user.name = user.personname;
}
}
Object.assign(this.user,_user,{
time: +new Date
});
......@@ -81,16 +75,9 @@ export default class AppUser extends Vue {
* @memberof AppUser
*/
public logout() {
const get: Promise<any> = this.$http.get('v7/logout');
get.then((response:any) =>{
if (response && response.status === 200) {
localStorage.removeItem('user');
localStorage.removeItem('token');
this.$router.push({ name: 'login' });
}
}).catch((error: any) =>{
console.error(error);
})
localStorage.removeItem('user');
localStorage.removeItem('token');
this.$router.push({ name: 'login' });
}
}
</script>
......
......@@ -61,14 +61,14 @@ export default class CodeList extends Vue {
* @type {boolean}
* @memberof SelectPicker
*/
@Prop({default:'、'}) public textSeparator?: string;
@Prop({default:"、"}) public textSeparator?: string;
/**
* 值分隔符
* @type {boolean}
* @memberof SelectPicker
*/
@Prop({default:','}) public valueSeparator?: string;
@Prop({default:";"}) public valueSeparator?: string;
/**
* 是否为空
......
......@@ -60,7 +60,7 @@ export default class DropDownListMpicker extends Vue {
* @type {string}
* @memberof DropDownListMpicker
*/
@Prop({default:','}) public valueSeparator?: string;
@Prop({default:';'}) public valueSeparator?: string;
/**
* 是否禁用
......
.login{
width: 100vh;
height: 100vh;
> img{
width: 100vw;
height: 100vh;
}
.login-logo{
position: fixed;
left: 80px;
top: 80px;
}
.login-content{
position: fixed;
left: 10%;
top: 30%;
width: 60%;
>span{
color: #fff;
font-size: 84px;
}
}
// background-image: url('../assets/images/login_bg.jpg');
background-size: cover;
background-position: center;
position: relative;
&-con{
position: fixed;
right: 160px;
top: 50%;
transform: translateY(-60%);
width: 300px;
.ivu-card{
border-radius: 15px;
.ivu-card-head {
padding: 14px 6px;
>p{
line-height: 20px;
font-size: 20px;
color: #17233d;
font-weight: 700;
text-align:center;
}
}
&-header{
font-size: 16px;
font-weight: 300;
text-align: center;
padding: 30px 0;
}
.form-con{
padding: 10px 0 0;
.ivu-form-item{
margin-bottom: 20px;
}
p{
font-size: 14px;
font-weight: bold;
height: 21px;
line-height: 21px;
}
button{
background-image: linear-gradient(to bottom,#8bbcf1 0%,#2d8cf0 100%);
border-color:#8bbcf1;
}
}
.login-tip{
font-size: 10px;
text-align: center;
color: #5f4949;
}
}
&-header{
font-size: 16px;
font-weight: 300;
text-align: center;
padding: 30px 0;
}
.form-con{
padding: 10px 0 0;
}
.login-tip{
font-size: 10px;
text-align: center;
color: #c3c3c3;
}
}
}
\ No newline at end of file
<template>
<div class='login'>
<img src="/assets/img/login_bg.png"/>
<div class="login-logo">
<img src ="/assets/img/logo.svg"/>
</div>
<div class="login-content">
<span>{{appTitle}}</span>
</div>
<div class='login-con'>
<card :bordered="false">
<p slot='title'>
<!-- <icon type='ios-log-in'></icon> -->
<!-- &nbsp;&nbsp; -->
{{this.$t('components.login.caption')}}
<icon type='ios-log-in'></icon>
&nbsp;&nbsp;{{this.$t('components.login.caption')}}
</p>
<div class='form-con'>
<i-form ref='loginForm' :rules="rules" :model="form">
<form-item prop='loginname'>
<p>用户名</p>
<i-input
prefix='ios-contact'
v-model="form.loginname"
......@@ -25,7 +16,6 @@
</i-input>
</form-item>
<form-item prop='password'>
<p>密码</p>
<i-input
prefix='ios-key'
v-model="form.password"
......@@ -65,15 +55,7 @@ export default class Login extends Vue {
* @type {*}
* @memberof Login
*/
public form: any = { loginname: 'guest', password: 'guest' };
/**
* 应用标题
*
* @type {string}
* @memberof Login
*/
public appTitle:string = Environment.AppTitle;
public form: any = { loginname: null, password: null };
/**
* 值规则
......@@ -136,12 +118,8 @@ export default class Login extends Vue {
post.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
if(data && data.token){
localStorage.setItem('token', data.token);
}
if(data && data.user){
localStorage.setItem('user', JSON.stringify(data.user));
}
localStorage.setItem('token', data.token);
localStorage.setItem('user', JSON.stringify(data.user));
const url: any = this.$route.query.redirect ? this.$route.query.redirect : '*';
this.$router.push({ path: url });
}
......
......@@ -201,11 +201,11 @@ export default class TabPageExp extends Vue {
* @param {*} caption
* @memberof TabPageExp
*/
public setCurPageCaption(caption: string, title: any, info: string) {
if(this.$route.meta && (!Object.is(this.$route.meta.caption, caption))) {
public setCurPageCaption(routename: string, caption: any, info: string) {
if(!Object.is(this.$route.name, routename)) {
return;
}
this.$store.commit("setCurPageCaption", { route: this.$route, caption: title, info: info });
this.$store.commit("setCurPageCaption", { route: this.$route, caption: caption, info: info });
setTimeout(() => {
this.moveToView(this.$route);
}, 1);
......
......@@ -247,9 +247,9 @@ export default class EditViewEngine extends ViewEngine {
*/
public setTabCaption(info: string): void {
let viewdata: any = this.view.model;
if (viewdata && info && !Object.is(info, '') && this.view.$tabPageExp && (viewdata.srfTitle.indexOf(" - ") === -1)) {
this.view.$tabPageExp.setCurPageCaption(viewdata.srfCaption, viewdata.srfTitle, info);
this.view.model.srfTitle = `${this.view.$t(viewdata.srfTitle)} - ${viewdata.dataInfo}`;
let viewParam = this.view.$store.getters['viewaction/getAppView'](this.view.viewtag);
if (viewdata && viewParam && info && !Object.is(info, '') && this.view.$tabPageExp) {
this.view.$tabPageExp.setCurPageCaption(`${viewParam.viewmodule}_${viewParam.viewname}`.toLocaleLowerCase(), viewdata.srfCaption, info);
}
}
......
......@@ -117,9 +117,6 @@ export default class MDViewEngine extends ViewEngine {
if (Object.is(eventName, 'load')) {
this.onSearchFormLoad(args);
}
if (Object.is(eventName, 'search')) {
this.onSearchFormLoad(args);
}
}
/**
......@@ -160,20 +157,6 @@ export default class MDViewEngine extends ViewEngine {
this.isLoadDefault = true;
}
/**
* 搜索表单搜索
*
* @param {*} [args={}]
* @memberof MDViewEngine
*/
public onSearchFormSearch(args: any = {}): void {
if (this.getMDCtrl() && this.isLoadDefault) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
}
this.isLoadDefault = true;
}
/**
* 处理实体界面行为
*
......@@ -389,15 +372,6 @@ export default class MDViewEngine extends ViewEngine {
if (this.view && !this.view.isExpandSearchForm) {
Object.assign(arg, { query: this.view.query });
}
// 快速分组和快速搜索栏
let otherQueryParam:any = {};
if(this.view && this.view.qucikGroupData){
Object.assign(otherQueryParam,this.view.qucikGroupData);
}
if(this.view && this.view.qucikFormData){
Object.assign(otherQueryParam,this.view.qucikFormData);
}
Object.assign(arg,{viewparams:otherQueryParam});
}
/**
......
......@@ -35,20 +35,4 @@ export default class PickupTreeViewEngine extends TreeViewEngine {
this.view.$emit('viewdataschange', args);
}
}
/**
* 双击选中激活数据
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof PickupTreeViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, 'tree') && Object.is(eventName, 'nodedblclick')) {
this.view.$emit('viewdatasactivated', args);
return ;
}
super.onCtrlEvent(ctrlName, eventName, args);
}
}
\ No newline at end of file
......@@ -16,29 +16,25 @@ export const Environment = {
// 文件上传
UploadFile: 'ibizutil/upload',
// 是否为pc端应用
isAppMode: true,
isAppMode:true,
//统一地址
uniteAddress: "http://172.16.100.202:8114",
uniteAddress:"http://172.16.100.202:8114",
// 是否为开发模式
devMode: true,
// 项目模板地址
ProjectUrl: "http://demo.ibizlab.cn/ibizr7pfstdtempl/ibizvuer7plus",
ProjectUrl: "http://172.16.180.229/wangxiang1/VUE_R7_FTL",
// 配置平台地址
StudioUrl: "http://neko.org.cn:3333/",
// 方案标识
SlnId: "AFFB70EF-A2CF-470A-B1AE-38156EAF4A50",
StudioUrl: "http://172.16.170.145/slnstudio/",
// 中心标识
SlnId: "B4BF5C84-D020-4D9A-A986-8FA4FD72816C",
// 系统标识
SysId: "8A26FD38-06D7-495C-88B1-77238F3AB96D",
SysId: "B428B5BE-EA90-4101-A493-BA7085D89F0A",
// 前端应用标识
AppId: "0df1f39e51db7152428a905a11c28a16",
AppId: "6e0b7357169ef4eba84e1347ed94bd84",
// 项目发布文件地址
PublishProjectUrl: 'http://oauth2:cTux_e7Aoz1PrasP5dDq@demo.ibizlab.cn/ibizeam_practice/eam_practice04.git',
// ibiz开放平台地址
ibizlabtUrl: 'https://www.ibizlab.cn',
// ibiz论坛地址
ibizbbstUrl: 'https://bbs.ibizlab.cn',
};
// 挂载外部配置文件
if ((window as any).Environment) {
Object.assign(Environment, (window as any).Environment);
}
\ No newline at end of file
};
\ No newline at end of file
......@@ -118,6 +118,10 @@ export default {
},
// 非实体视图
views: {
appindexview: {
caption: '',
title: '',
},
appportalview: {
caption: '',
title: '',
......@@ -133,6 +137,8 @@ export default {
info:"Please configure the data import item"
},
menus: {
appindexview: {
},
indexview: {
menuitem61: '工作台',
menuitem3: '设备',
......
......@@ -118,6 +118,10 @@ export default {
},
// 非实体视图
views: {
appindexview: {
caption: '',
title: '',
},
appportalview: {
caption: '',
title: '',
......@@ -133,6 +137,8 @@ export default {
info:"请配置数据导入项"
},
menus: {
appindexview: {
},
indexview: {
menuitem61: '工作台',
menuitem3: '设备',
......
import { MockAdapter } from '@/mock/mock-adapter';
const mock = MockAdapter.getInstance();
import Mock from 'mockjs'
const Random = Mock.Random;
// 获取应用数据
mock.onGet('v7/app-index-viewappmenu').reply((config: any) => {
let status = MockAdapter.mockStatus(config);
return [status, {
name: 'appmenu',
items: [
],
}];
});
......@@ -6,55 +6,10 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/dynacharts\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/dynacharts\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/dynacharts\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -66,7 +21,6 @@ mock.onPost(new RegExp(/^\/dynacharts\/batch$/)).reply((config: any) => {
mock.onPut(new RegExp(/^\/dynacharts\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -78,7 +32,6 @@ mock.onPut(new RegExp(/^\/dynacharts\/batch$/)).reply((config: any) => {
mock.onDelete(new RegExp(/^\/dynacharts\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -114,33 +67,17 @@ mock.onGet(new RegExp(/^\/dynacharts\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply(
console.groupEnd();
return [status, _items];
});
// GetDraft
mock.onGet(new RegExp(/^\/dynacharts\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/dynacharts\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: CheckKey");
// Create
mock.onPost(new RegExp(/^\/dynacharts\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['dynachartid'];
const matchArray:any = new RegExp(/^\/dynacharts\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/dynacharts\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -150,23 +87,11 @@ mock.onPost(new RegExp(/^\/dynacharts\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).re
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.dynachartid, tempValue.dynachartid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['dynachartid'] == tempValue['dynachartid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, mockDatas[0]];
});
// Update
......@@ -206,17 +131,33 @@ mock.onPut(new RegExp(/^\/dynacharts\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/dynacharts\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Create
mock.onPost(new RegExp(/^\/dynacharts\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: Create");
// CheckKey
mock.onPost(new RegExp(/^\/dynacharts\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['dynachartid'];
const matchArray:any = new RegExp(/^\/dynacharts\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/dynacharts\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -226,11 +167,23 @@ mock.onPost(new RegExp(/^\/dynacharts\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((confi
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.dynachartid, tempValue.dynachartid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['dynachartid'] == tempValue['dynachartid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, data];
});
// Save
......@@ -323,9 +276,9 @@ mock.onGet(new RegExp(/^\/dynacharts\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/dynacharts\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/dynacharts\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +304,9 @@ mock.onGet(new RegExp(/^\/dynacharts\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config:
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/dynacharts\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/dynacharts\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynachart 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -6,55 +6,10 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/dynadashboards\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/dynadashboards\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/dynadashboards\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -66,7 +21,6 @@ mock.onPost(new RegExp(/^\/dynadashboards\/batch$/)).reply((config: any) => {
mock.onPut(new RegExp(/^\/dynadashboards\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -78,7 +32,6 @@ mock.onPut(new RegExp(/^\/dynadashboards\/batch$/)).reply((config: any) => {
mock.onDelete(new RegExp(/^\/dynadashboards\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -115,16 +68,16 @@ mock.onGet(new RegExp(/^\/dynadashboards\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).re
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/dynadashboards\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: Save");
// Create
mock.onPost(new RegExp(/^\/dynadashboards\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['dynadashboardid'];
const matchArray:any = new RegExp(/^\/dynadashboards\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/dynadashboards\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -134,23 +87,11 @@ mock.onPost(new RegExp(/^\/dynadashboards\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).re
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.dynadashboardid, tempValue.dynadashboardid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['dynadashboardid'] == tempValue['dynadashboardid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, mockDatas[0]];
});
// Update
......@@ -190,6 +131,22 @@ mock.onPut(new RegExp(/^\/dynadashboards\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((co
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/dynadashboards\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/dynadashboards\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
......@@ -228,33 +185,17 @@ mock.onPost(new RegExp(/^\/dynadashboards\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/dynadashboards\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Create
mock.onPost(new RegExp(/^\/dynadashboards\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: Create");
// Save
mock.onPost(new RegExp(/^\/dynadashboards\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['dynadashboardid'];
const matchArray:any = new RegExp(/^\/dynadashboards\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/dynadashboards\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -264,11 +205,23 @@ mock.onPost(new RegExp(/^\/dynadashboards\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((c
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.dynadashboardid, tempValue.dynadashboardid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['dynadashboardid'] == tempValue['dynadashboardid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, data];
});
// FetchDefault
......@@ -323,9 +276,9 @@ mock.onGet(new RegExp(/^\/dynadashboards\/fetchdefault(\?[\w-./?%&=,]*)*$/)).rep
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/dynadashboards\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/dynadashboards\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +304,9 @@ mock.onGet(new RegExp(/^\/dynadashboards\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((con
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/dynadashboards\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/dynadashboards\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dynadashboard 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -6,55 +6,10 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/emacclasses\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/emacclasses\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/emacclasses\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -66,7 +21,6 @@ mock.onPost(new RegExp(/^\/emacclasses\/batch$/)).reply((config: any) => {
mock.onPut(new RegExp(/^\/emacclasses\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -78,7 +32,6 @@ mock.onPut(new RegExp(/^\/emacclasses\/batch$/)).reply((config: any) => {
mock.onDelete(new RegExp(/^\/emacclasses\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -115,16 +68,42 @@ mock.onGet(new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/emacclasses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: Save");
// Create
mock.onPost(new RegExp(/^\/emacclasses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emacclassid'];
const matchArray:any = new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/emacclasses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emacclassid'];
const matchArray:any = new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -169,32 +148,6 @@ mock.onGet(new RegExp(/^\/emacclasses\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// Create
mock.onPost(new RegExp(/^\/emacclasses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emacclassid'];
const matchArray:any = new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// CheckKey
mock.onPost(new RegExp(/^\/emacclasses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: CheckKey");
......@@ -233,16 +186,16 @@ mock.onPost(new RegExp(/^\/emacclasses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).r
return [status, data];
});
// Update
mock.onPut(new RegExp(/^\/emacclasses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: Update");
// Save
mock.onPost(new RegExp(/^\/emacclasses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emacclassid'];
const matchArray:any = new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -323,9 +276,9 @@ mock.onGet(new RegExp(/^\/emacclasses\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply(
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +304,9 @@ mock.onGet(new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/emacclasses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emacclass 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -6,55 +6,10 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/emassetclasses\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/emassetclasses\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/emassetclasses\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -66,7 +21,6 @@ mock.onPost(new RegExp(/^\/emassetclasses\/batch$/)).reply((config: any) => {
mock.onPut(new RegExp(/^\/emassetclasses\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -78,7 +32,6 @@ mock.onPut(new RegExp(/^\/emassetclasses\/batch$/)).reply((config: any) => {
mock.onDelete(new RegExp(/^\/emassetclasses\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -115,16 +68,42 @@ mock.onGet(new RegExp(/^\/emassetclasses\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).re
return [status, _items];
});
// CheckKey
mock.onPost(new RegExp(/^\/emassetclasses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: CheckKey");
// Create
mock.onPost(new RegExp(/^\/emassetclasses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emassetclassid'];
const matchArray:any = new RegExp(/^\/emassetclasses\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emassetclasses\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/emassetclasses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emassetclassid'];
const matchArray:any = new RegExp(/^\/emassetclasses\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -169,16 +148,16 @@ mock.onGet(new RegExp(/^\/emassetclasses\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/emassetclasses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: Save");
// CheckKey
mock.onPost(new RegExp(/^\/emassetclasses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emassetclassid'];
const matchArray:any = new RegExp(/^\/emassetclasses\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emassetclasses\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -207,16 +186,16 @@ mock.onPost(new RegExp(/^\/emassetclasses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).re
return [status, data];
});
// Update
mock.onPut(new RegExp(/^\/emassetclasses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: Update");
// Save
mock.onPost(new RegExp(/^\/emassetclasses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emassetclassid'];
const matchArray:any = new RegExp(/^\/emassetclasses\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emassetclasses\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -244,32 +223,6 @@ mock.onPut(new RegExp(/^\/emassetclasses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((co
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/emassetclasses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emassetclass 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emassetclassid'];
const matchArray:any = new RegExp(/^\/emassetclasses\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// FetchDefault
mock.onGet(new RegExp(/^\/emassetclasses\/fetchdefault$/)).reply((config: any) => {
......
......@@ -6,55 +6,10 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/emassets\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/emassets\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/emassets\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -66,7 +21,6 @@ mock.onPost(new RegExp(/^\/emassets\/batch$/)).reply((config: any) => {
mock.onPut(new RegExp(/^\/emassets\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -78,7 +32,6 @@ mock.onPut(new RegExp(/^\/emassets\/batch$/)).reply((config: any) => {
mock.onDelete(new RegExp(/^\/emassets\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -115,16 +68,16 @@ mock.onGet(new RegExp(/^\/emassets\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/emassets\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: Save");
// Create
mock.onPost(new RegExp(/^\/emassets\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emassetid'];
const matchArray:any = new RegExp(/^\/emassets\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emassets\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -134,23 +87,11 @@ mock.onPost(new RegExp(/^\/emassets\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.emassetid, tempValue.emassetid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['emassetid'] == tempValue['emassetid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, mockDatas[0]];
});
// Update
......@@ -190,32 +131,6 @@ mock.onPut(new RegExp(/^\/emassets\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/emassets\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emassetid'];
const matchArray:any = new RegExp(/^\/emassets\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// GetDraft
mock.onGet(new RegExp(/^\/emassets\/getdraft$/)).reply((config: any) => {
......@@ -270,6 +185,44 @@ mock.onPost(new RegExp(/^\/emassets\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).repl
console.groupEnd();
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/emassets\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emassetid'];
const matchArray:any = new RegExp(/^\/emassets\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.emassetid, tempValue.emassetid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['emassetid'] == tempValue['emassetid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// FetchAssetBf
mock.onGet(new RegExp(/^\/emassets\/fetchassetbf$/)).reply((config: any) => {
......@@ -367,9 +320,9 @@ mock.onGet(new RegExp(/^\/emassets\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((co
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/emassets\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/emassets\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -395,9 +348,9 @@ mock.onGet(new RegExp(/^\/emassets\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: a
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/emassets\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/emassets\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emasset 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -6,55 +6,10 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/emberths\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/emberths\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/emberths\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -66,7 +21,6 @@ mock.onPost(new RegExp(/^\/emberths\/batch$/)).reply((config: any) => {
mock.onPut(new RegExp(/^\/emberths\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -78,7 +32,6 @@ mock.onPut(new RegExp(/^\/emberths\/batch$/)).reply((config: any) => {
mock.onDelete(new RegExp(/^\/emberths\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -140,22 +93,6 @@ mock.onPost(new RegExp(/^\/emberths\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
console.groupEnd();
return [status, mockDatas[0]];
});
// GetDraft
mock.onGet(new RegExp(/^\/emberths\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/emberths\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
......@@ -194,17 +131,33 @@ mock.onPut(new RegExp(/^\/emberths\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/emberths\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/emberths\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: Save");
// CheckKey
mock.onPost(new RegExp(/^\/emberths\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emberthid'];
const matchArray:any = new RegExp(/^\/emberths\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emberths\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -233,16 +186,16 @@ mock.onPost(new RegExp(/^\/emberths\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c
return [status, data];
});
// CheckKey
mock.onPost(new RegExp(/^\/emberths\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/emberths\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emberthid'];
const matchArray:any = new RegExp(/^\/emberths\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emberths\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -323,9 +276,9 @@ mock.onGet(new RegExp(/^\/emberths\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((co
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/emberths\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/emberths\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +304,9 @@ mock.onGet(new RegExp(/^\/emberths\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: a
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/emberths\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/emberths\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emberth 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -6,55 +6,10 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/embrands\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/embrands\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/embrands\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -66,7 +21,6 @@ mock.onPost(new RegExp(/^\/embrands\/batch$/)).reply((config: any) => {
mock.onPut(new RegExp(/^\/embrands\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -78,7 +32,6 @@ mock.onPut(new RegExp(/^\/embrands\/batch$/)).reply((config: any) => {
mock.onDelete(new RegExp(/^\/embrands\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -141,16 +94,16 @@ mock.onPost(new RegExp(/^\/embrands\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, mockDatas[0]];
});
// Save
mock.onPost(new RegExp(/^\/embrands\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: Save");
// Update
mock.onPut(new RegExp(/^\/embrands\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['embrandid'];
const matchArray:any = new RegExp(/^\/embrands\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/embrands\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -195,16 +148,16 @@ mock.onGet(new RegExp(/^\/embrands\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/embrands\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: Update");
// CheckKey
mock.onPost(new RegExp(/^\/embrands\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['embrandid'];
const matchArray:any = new RegExp(/^\/embrands\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/embrands\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -233,16 +186,16 @@ mock.onPut(new RegExp(/^\/embrands\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, data];
});
// CheckKey
mock.onPost(new RegExp(/^\/embrands\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/embrands\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['embrandid'];
const matchArray:any = new RegExp(/^\/embrands\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/embrands\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -323,9 +276,9 @@ mock.onGet(new RegExp(/^\/embrands\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((co
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/embrands\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/embrands\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +304,9 @@ mock.onGet(new RegExp(/^\/embrands\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: a
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/embrands\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/embrands\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:embrand 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -6,55 +6,10 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/emeitires\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/eam_practice04-app-eamweb\/emeitires\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/emeitires\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -66,7 +21,6 @@ mock.onPost(new RegExp(/^\/emeitires\/batch$/)).reply((config: any) => {
mock.onPut(new RegExp(/^\/emeitires\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -78,7 +32,6 @@ mock.onPut(new RegExp(/^\/emeitires\/batch$/)).reply((config: any) => {
mock.onDelete(new RegExp(/^\/emeitires\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
......@@ -114,33 +67,43 @@ mock.onGet(new RegExp(/^\/emeitires\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
console.groupEnd();
return [status, _items];
});
// GetDraft
mock.onGet(new RegExp(/^\/emeitires\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: GetDraft");
// Create
mock.onPost(new RegExp(/^\/emeitires\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emeitiresid'];
const matchArray:any = new RegExp(/^\/emeitires\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, mockDatas[0]];
});
// Save
mock.onPost(new RegExp(/^\/emeitires\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: Save");
// Update
mock.onPut(new RegExp(/^\/emeitires\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emeitiresid'];
const matchArray:any = new RegExp(/^\/emeitires\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emeitires\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -168,31 +131,21 @@ mock.onPost(new RegExp(/^\/emeitires\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/emeitires\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: Create");
// GetDraft
mock.onGet(new RegExp(/^\/emeitires\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emeitiresid'];
const matchArray:any = new RegExp(/^\/emeitires\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.table({});
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, {}];
});
// CheckKey
......@@ -233,16 +186,16 @@ mock.onPost(new RegExp(/^\/emeitires\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).rep
return [status, data];
});
// Update
mock.onPut(new RegExp(/^\/emeitires\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: Update");
// Save
mock.onPost(new RegExp(/^\/emeitires\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:emeitires 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['emeitiresid'];
const matchArray:any = new RegExp(/^\/emeitires\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emeitires\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册