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

xignzi006 发布系统代码

上级 2cfd58ea
......@@ -609,6 +609,16 @@
"viewtag": "e404dc93e70d6284d4e1a083017625ed",
"memo": ""
},
"accountusr2optionview": {
"title": "客户选项操作视图",
"caption": "11",
"viewtype": "DEOPTVIEW",
"viewmodule": "Base",
"viewname": "AccountUsr2OptionView",
"viewfilename": "account-usr2-option-view",
"viewtag": "e4335da0a7c14a65376eecaabb771fd7",
"memo": ""
},
"accountpickupgridview": {
"title": "account选择表格视图",
"caption": "客户",
......
......@@ -216,6 +216,10 @@ export default {
contactsetting: {
caption: "客户",
title: 'account编辑视图',
},
usr2optionview: {
caption: "11",
title: '客户选项操作视图',
},
pickupgridview: {
caption: "客户",
......@@ -278,7 +282,7 @@ export default {
uiactions: {
},
},
address_form: {
edit_address_form: {
details: {
group1: "客户基本信息",
formpage1: "基本信息",
......@@ -302,7 +306,7 @@ export default {
uiactions: {
},
},
edit_address_form: {
address_form: {
details: {
group1: "客户基本信息",
formpage1: "基本信息",
......
......@@ -215,6 +215,10 @@ export default {
contactsetting: {
caption: '客户',
title: 'account编辑视图',
},
usr2optionview: {
caption: '11',
title: '客户选项操作视图',
},
pickupgridview: {
caption: '客户',
......@@ -277,7 +281,7 @@ export default {
uiactions: {
},
},
address_form: {
edit_address_form: {
details: {
group1: '客户基本信息',
formpage1: '基本信息',
......@@ -301,7 +305,7 @@ export default {
uiactions: {
},
},
edit_address_form: {
address_form: {
details: {
group1: '客户基本信息',
formpage1: '基本信息',
......
......@@ -495,6 +495,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "ContactOptionView",
"viewtag": "e404dc93e70d6284d4e1a083017625ed"
},
"accountusr2optionview": {
"title": "客户选项操作视图",
"caption": "11",
"viewtype": "DEOPTVIEW",
"viewmodule": "Base",
"viewname": "AccountUsr2OptionView",
"viewtag": "e4335da0a7c14a65376eecaabb771fd7"
},
"accountpickupgridview": {
"title": "account选择表格视图",
"caption": "客户",
......
<template>
<studio-view viewName="accountusr2optionview" viewTitle="客户选项操作视图" class='deoptview account-usr2-option-view'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<view_form
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:autosave="false"
:viewtag="viewtag"
:showBusyIndicator="true"
updateAction="Update"
removeAction="Remove"
loaddraftAction="GetDraft"
loadAction="Get"
createAction="Create"
WFSubmitAction=""
WFStartAction=""
style=''
name="form"
ref='form'
@save="form_save($event)"
@remove="form_remove($event)"
@load="form_load($event)"
@closeview="closeView($event)">
</view_form>
<template slot="footer">
<div class="option-view-footer-actions">
<i-button type='primary' @click="onClickOk">{{ containerModel.view_okbtn.text }}</i-button>
&nbsp;&nbsp;
<i-button @click="onClickCancel">{{ containerModel.view_cancelbtn.text }}</i-button>
</div>
</template>
</studio-view>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs';
import AccountService from '@/service/account/account-service';
import OptionViewEngine from '@engine/view/option-view-engine';
@Component({
components: {
},
})
export default class AccountUsr2OptionViewBase extends Vue {
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof AccountUsr2OptionViewBase
*/
public appEntityService: AccountService = new AccountService;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof AccountUsr2OptionViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof AccountUsr2OptionViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof AccountUsr2OptionViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof AccountUsr2OptionViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof AccountUsr2OptionViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof AccountUsr2OptionViewBase
*/
public viewtag: string = 'e4335da0a7c14a65376eecaabb771fd7';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof AccountUsr2OptionViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof AccountUsr2OptionViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof AccountUsr2OptionViewBase
*/
public model: any = {
srfCaption: 'entities.account.views.usr2optionview.caption',
srfTitle: 'entities.account.views.usr2optionview.title',
srfSubTitle: 'entities.account.views.usr2optionview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AccountUsr2OptionViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
for(let key in this.viewparams){
delete this.viewparams[key];
}
Object.assign(this.viewparams, JSON.parse(this.viewparam));
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AccountUsr2OptionViewBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
this.$nextTick(()=>{
_this.parseViewParam();
_this.engine.load();
});
}
}
/**
* 容器模型
*
* @type {*}
* @memberof AccountUsr2OptionViewBase
*/
public containerModel: any = {
view_form: { name: 'form', type: 'FORM' },
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
};
/**
* 计数器刷新
*
* @memberof AccountUsr2OptionViewBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof AccountUsr2OptionViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof AccountUsr2OptionViewBase
*/
public engine: OptionViewEngine = new OptionViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof AccountUsr2OptionViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
form: this.$refs.form,
p2k: '0',
keyPSDEField: 'account',
majorPSDEField: 'accountname',
isLoadDefault: true,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof AccountUsr2OptionViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof AccountUsr2OptionViewBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof AccountUsr2OptionViewBase
*/
public parseViewParam(): void {
for(let key in this.context){
delete this.context[key];
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
this.handleCustomViewData();
return;
}
const path = (this.$route.matched[this.$route.matched.length - 1]).path;
const keys: Array<any> = [];
const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
const matchArray = curReg.exec(this.$route.path);
let tempValue: Object = {};
keys.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item.name, {
enumerable: true,
value: matchArray[index + 1]
});
});
this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams);
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
}
/**
* 处理自定义视图数据
*
* @memberof AccountUsr2OptionViewBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof AccountUsr2OptionViewBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* Vue声明周期
*
* @memberof AccountUsr2OptionViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof AccountUsr2OptionViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof AccountUsr2OptionViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof AccountUsr2OptionViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof AccountUsr2OptionViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/**
* form 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountUsr2OptionViewBase
*/
public form_save($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'save', $event);
}
/**
* form 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountUsr2OptionViewBase
*/
public form_remove($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'remove', $event);
}
/**
* form 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountUsr2OptionViewBase
*/
public form_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof AccountUsr2OptionViewBase
*/
public closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', [args]);
_view.$emit('close', [args]);
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
/**
* 销毁视图回调
*
* @memberof AccountUsr2OptionViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof AccountUsr2OptionViewBase
*/
public afterDestroyed(){
if(this.viewDefaultUsage){
let localStoreLength = Object.keys(localStorage);
if(localStoreLength.length > 0){
localStoreLength.forEach((item:string) =>{
if(item.startsWith(this.context.srfsessionid)){
localStorage.removeItem(item);
}
})
}
}
}
/**
* 确定
*
* @memberof AccountUsr2OptionViewBase
*/
public onClickOk(): void {
const form: any = this.$refs.form;
if (!form) return;
form.save().then((res:any) =>{
if(res.status == 200){
this.$emit('close',[res.data]);
}
});
}
/**
* 取消
*
* @memberof AccountUsr2OptionViewBase
*/
public onClickCancel(): void {
this.$emit('close', null);
}
}
</script>
<style lang='less'>
@import './account-usr2-option-view.less';
</style>
\ No newline at end of file
.option-view {
--option-view: 0;
}
// 避免空文件,后台不让空文件过
.account-usr2-option-view {
--account-usr2-option-view: 0;
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import AccountUsr2OptionViewBase from './account-usr2-option-view-base.vue';
import view_form from '@widgets/account/edit-address-form/edit-address-form.vue';
@Component({
components: {
view_form,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
},
})
export default class AccountUsr2OptionView extends AccountUsr2OptionViewBase {
}
</script>
\ No newline at end of file
......@@ -60,5 +60,6 @@ export const PageComponents = {
Vue.component('account-edit-address', () => import('@pages/base/account-edit-address/account-edit-address.vue'));
Vue.component('contact-abstract-edit-view9', () => import('@pages/base/contact-abstract-edit-view9/contact-abstract-edit-view9.vue'));
Vue.component('contact-pickup-view', () => import('@pages/base/contact-pickup-view/contact-pickup-view.vue'));
Vue.component('account-usr2-option-view', () => import('@pages/base/account-usr2-option-view/account-usr2-option-view.vue'));
}
};
\ No newline at end of file
......@@ -230,6 +230,20 @@ const router = new Router({
},
component: () => import('@pages/ungroup/centeral-portal/centeral-portal.vue'),
},
{
path: 'accounts/:account?/usr2optionview/:usr2optionview?',
meta: {
caption: 'entities.account.views.usr2optionview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'usr2optionview', parameterName: 'usr2optionview' },
],
requireAuth: true,
},
component: () => import('@pages/base/account-usr2-option-view/account-usr2-option-view.vue'),
},
{
path: 'products/:product?/editview/:editview?',
meta: {
......@@ -622,20 +636,6 @@ const router = new Router({
},
component: () => import('@pages/marketing/ibiz-list-grid-view/ibiz-list-grid-view.vue'),
},
{
path: 'accounts/:account?/edit_accountinfo/:edit_accountinfo?',
meta: {
caption: 'entities.account.views.edit_accountinfo.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'edit_accountinfo', parameterName: 'edit_accountinfo' },
],
requireAuth: true,
},
component: () => import('@pages/base/account-edit-account-info/account-edit-account-info.vue'),
},
{
path: 'products/:product?/gridview/:gridview?',
meta: {
......@@ -1591,6 +1591,19 @@ const router = new Router({
},
component: () => import('@pages/base/contact-option-view/contact-option-view.vue'),
},
{
path: '/accounts/:account?/usr2optionview/:usr2optionview?',
meta: {
caption: 'entities.account.views.usr2optionview.title',
info:'',
parameters: [
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'usr2optionview', parameterName: 'usr2optionview' },
],
requireAuth: true,
},
component: () => import('@pages/base/account-usr2-option-view/account-usr2-option-view.vue'),
},
{
path: '/accounts/:account?/pickupgridview/:pickupgridview?',
meta: {
......
......@@ -120,8 +120,8 @@ export const viewstate: any = {
'aa79d35850f36fbc1a5085353ecd5af5',
'e38e7b53a449e0f112cb545d2c5d4b85',
'fb06f2c1cea1ac2a5a70c20f4a277ae5',
'0d25ba75b06acd9c995642d0a45fcd2c',
'73bb9f7e653384ca09f8bbbfd580d892',
'e4335da0a7c14a65376eecaabb771fd7',
'c607e5bc2c07ab2aca084e275ce677b7',
'a95d7d9111bc13a8b73a11ee1e4ff92a',
'893e62d6fbdc4580de7e3e802aec9108',
......@@ -583,6 +583,15 @@ export const viewstate: any = {
refviews: [
],
},
{
viewtag: 'e4335da0a7c14a65376eecaabb771fd7',
viewmodule: 'Base',
viewname: 'AccountUsr2OptionView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{
viewtag: 'ef9fea872a6a21e7566033fafcc0ccb5',
viewmodule: 'Base',
......
......@@ -92,6 +92,7 @@ export default class AccountUIServiceBase extends UIService {
this.allViewMap.set(':',{viewname:'optionview',srfappde:'accounts'});
this.allViewMap.set(':',{viewname:'distribution',srfappde:'accounts'});
this.allViewMap.set(':',{viewname:'contactsetting',srfappde:'accounts'});
this.allViewMap.set(':',{viewname:'usr2optionview',srfappde:'accounts'});
this.allViewMap.set(':',{viewname:'pickupgridview',srfappde:'accounts'});
this.allViewMap.set(':',{viewname:'majorcontact',srfappde:'accounts'});
}
......@@ -210,6 +211,9 @@ export default class AccountUIServiceBase extends UIService {
return;
}
const _this: any = actionContext;
if (xData && xData.refresh && xData.refresh instanceof Function) {
xData.refresh(args);
}
if(window.opener){
window.opener.postMessage({status:'OK',identification:'WF'},Environment.uniteAddress);
window.close();
......@@ -273,6 +277,9 @@ export default class AccountUIServiceBase extends UIService {
return;
}
const _this: any = actionContext;
if (xData && xData.refresh && xData.refresh instanceof Function) {
xData.refresh(args);
}
if(window.opener){
window.opener.postMessage({status:'OK',identification:'WF'},Environment.uniteAddress);
window.close();
......@@ -281,10 +288,10 @@ export default class AccountUIServiceBase extends UIService {
});
}
const view: any = {
viewname: 'account-edit-account-info',
viewname: 'account-usr2-option-view',
height: 0,
width: 450,
title: actionContext.$t('entities.account.views.edit_accountinfo.title'),
title: actionContext.$t('entities.account.views.usr2optionview.title'),
placement: 'DRAWER_RIGHT',
};
openDrawer(view, data);
......
......@@ -1183,7 +1183,7 @@ export default class Edit_AddressBase extends Vue implements ControlInterface {
*/
public load(opt: any = {}): void {
if(!this.loadAction){
this.$Notice.error({ title: '错误', desc: 'AccountEdit_Address视图表单loadAction参数未配置' });
this.$Notice.error({ title: '错误', desc: 'AccountUsr2OptionView视图表单loadAction参数未配置' });
return;
}
const arg: any = { ...opt };
......@@ -1218,7 +1218,7 @@ export default class Edit_AddressBase extends Vue implements ControlInterface {
*/
public loadDraft(opt: any = {}): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: 'AccountEdit_Address视图表单loaddraftAction参数未配置' });
this.$Notice.error({ title: '错误', desc: 'AccountUsr2OptionView视图表单loaddraftAction参数未配置' });
return;
}
const arg: any = { ...opt } ;
......@@ -1280,7 +1280,7 @@ export default class Edit_AddressBase extends Vue implements ControlInterface {
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: 'AccountEdit_Address视图表单'+actionName+'参数未配置' });
this.$Notice.error({ title: '错误', desc: 'AccountUsr2OptionView视图表单'+actionName+'参数未配置' });
return;
}
Object.assign(arg,{viewparams:this.viewparams});
......@@ -1344,7 +1344,7 @@ export default class Edit_AddressBase extends Vue implements ControlInterface {
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: 'AccountEdit_Address视图表单'+actionName+'参数未配置' });
this.$Notice.error({ title: '错误', desc: 'AccountUsr2OptionView视图表单'+actionName+'参数未配置' });
return;
}
Object.assign(arg,{viewparams:this.viewparams});
......@@ -1394,7 +1394,7 @@ export default class Edit_AddressBase extends Vue implements ControlInterface {
public remove(opt:Array<any> = [],showResultInfo?: boolean): Promise<any> {
return new Promise((resolve: any, reject: any) => {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: 'AccountEdit_Address视图表单removeAction参数未配置' });
this.$Notice.error({ title: '错误', desc: 'AccountUsr2OptionView视图表单removeAction参数未配置' });
return;
}
const arg: any = opt[0];
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册