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

xignzi006 发布系统代码

上级 0e0fd549
...@@ -160,6 +160,43 @@ ...@@ -160,6 +160,43 @@
} }
] ]
}, },
{
"srfkey": "List__MemberType",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "Account",
"label": "客户",
"text": "客户",
"data":"",
"codename":"Account",
"value": "Account",
"disabled": false
}
, {
"id": "Lead",
"label": "潜在客户",
"text": "潜在客户",
"data":"",
"codename":"Lead",
"value": "Lead",
"disabled": false
}
, {
"id": "Contact",
"label": "联系人",
"text": "联系人",
"data":"",
"codename":"Contact",
"value": "Contact",
"disabled": false
}
]
},
{ {
"srfkey": "Lead__IndustryCode", "srfkey": "Lead__IndustryCode",
"emptytext": "未定义", "emptytext": "未定义",
......
...@@ -919,6 +919,16 @@ ...@@ -919,6 +919,16 @@
"viewtag": "aa79d35850f36fbc1a5085353ecd5af5", "viewtag": "aa79d35850f36fbc1a5085353ecd5af5",
"memo": "" "memo": ""
}, },
"listcontactinner": {
"title": "营销列表-联系人表格视图",
"caption": "联系人",
"viewtype": "DEGRIDVIEW9",
"viewmodule": "Marketing",
"viewname": "ListContactInner",
"viewfilename": "list-contact-inner",
"viewtag": "aaa875342bd9286a39c2d193a150afc4",
"memo": ""
},
"quoteeditview": { "quoteeditview": {
"title": "报价单编辑视图", "title": "报价单编辑视图",
"caption": "报价单", "caption": "报价单",
......
...@@ -22,6 +22,12 @@ export default { ...@@ -22,6 +22,12 @@ export default {
'2': "Inactive", '2': "Inactive",
empty: "", empty: "",
}, },
List__MemberType: {
'Account': "客户",
'Lead': "潜在客户",
'Contact': "联系人",
empty: "",
},
Lead__IndustryCode: { Lead__IndustryCode: {
'1': "Accounting", '1': "Accounting",
'2': "Agriculture and Non-petrol Natural Resource Extraction", '2': "Agriculture and Non-petrol Natural Resource Extraction",
......
...@@ -22,6 +22,12 @@ export default { ...@@ -22,6 +22,12 @@ export default {
'2': "Inactive", '2': "Inactive",
empty: "", empty: "",
}, },
List__MemberType: {
'Account': "客户",
'Lead': "潜在客户",
'Contact': "联系人",
empty: "",
},
Lead__IndustryCode: { Lead__IndustryCode: {
'1': "Accounting", '1': "Accounting",
'2': "Agriculture and Non-petrol Natural Resource Extraction", '2': "Agriculture and Non-petrol Natural Resource Extraction",
......
...@@ -134,7 +134,13 @@ export default { ...@@ -134,7 +134,13 @@ export default {
}, },
abstractinfo_form: { abstractinfo_form: {
details: { details: {
group1: "市场营销列表基本信息", group1: "列表信息",
druipart1: "",
grouppanel1: "成员",
druipart2: "",
grouppanel2: "成员",
druipart3: "",
grouppanel3: "成员",
formpage1: "基本信息", formpage1: "基本信息",
srfupdatedate: "更新时间", srfupdatedate: "更新时间",
srforikey: "", srforikey: "",
......
...@@ -133,7 +133,13 @@ export default { ...@@ -133,7 +133,13 @@ export default {
}, },
abstractinfo_form: { abstractinfo_form: {
details: { details: {
group1: '市场营销列表基本信息', group1: '列表信息',
druipart1: '',
grouppanel1: '成员',
druipart2: '',
grouppanel2: '成员',
druipart3: '',
grouppanel3: '成员',
formpage1: '基本信息', formpage1: '基本信息',
srfupdatedate: '更新时间', srfupdatedate: '更新时间',
srforikey: '', srforikey: '',
......
...@@ -35,10 +35,12 @@ export default { ...@@ -35,10 +35,12 @@ export default {
title: '查找客户', title: '查找客户',
}, },
}, },
quickcreatebylist_form: { main_form: {
details: { details: {
group1: "营销列表-账户基本信息", group1: "营销列表-账户基本信息",
formpage1: "基本信息", formpage1: "基本信息",
group2: "操作信息",
formpage2: "其它",
srfupdatedate: "更新时间", srfupdatedate: "更新时间",
srforikey: "", srforikey: "",
srfkey: "关系标识", srfkey: "关系标识",
...@@ -47,19 +49,15 @@ export default { ...@@ -47,19 +49,15 @@ export default {
srfuf: "", srfuf: "",
srfdeid: "", srfdeid: "",
srfsourcekey: "", srfsourcekey: "",
entity2name: "选择客户:",
entity2id: "客户",
relationshipsid: "关系标识", relationshipsid: "关系标识",
}, },
uiactions: { uiactions: {
}, },
}, },
main_form: { quickcreatebylist_form: {
details: { details: {
group1: "营销列表-账户基本信息", group1: "营销列表-账户基本信息",
formpage1: "基本信息", formpage1: "基本信息",
group2: "操作信息",
formpage2: "其它",
srfupdatedate: "更新时间", srfupdatedate: "更新时间",
srforikey: "", srforikey: "",
srfkey: "关系标识", srfkey: "关系标识",
...@@ -68,6 +66,8 @@ export default { ...@@ -68,6 +66,8 @@ export default {
srfuf: "", srfuf: "",
srfdeid: "", srfdeid: "",
srfsourcekey: "", srfsourcekey: "",
entity2name: "选择客户:",
entity2id: "客户",
relationshipsid: "关系标识", relationshipsid: "关系标识",
}, },
uiactions: { uiactions: {
...@@ -90,6 +90,24 @@ export default { ...@@ -90,6 +90,24 @@ export default {
uiactions: { uiactions: {
}, },
}, },
editviewtoolbar_toolbar: {
tbitem3: {
caption: "Save",
tip: "Save",
},
tbitem5: {
caption: "Save And Close",
tip: "Save And Close Window",
},
tbitem6: {
caption: "-",
tip: "",
},
tbitem12: {
caption: "关闭",
tip: "关闭",
},
},
bylisttoolbar_toolbar: { bylisttoolbar_toolbar: {
tbitem3: { tbitem3: {
caption: "New", caption: "New",
...@@ -128,22 +146,4 @@ export default { ...@@ -128,22 +146,4 @@ export default {
tip: "Filter", tip: "Filter",
}, },
}, },
editviewtoolbar_toolbar: {
tbitem3: {
caption: "Save",
tip: "Save",
},
tbitem5: {
caption: "Save And Close",
tip: "Save And Close Window",
},
tbitem6: {
caption: "-",
tip: "",
},
tbitem12: {
caption: "关闭",
tip: "关闭",
},
},
}; };
\ No newline at end of file
...@@ -34,10 +34,12 @@ export default { ...@@ -34,10 +34,12 @@ export default {
title: '查找客户', title: '查找客户',
}, },
}, },
quickcreatebylist_form: { main_form: {
details: { details: {
group1: '营销列表-账户基本信息', group1: '营销列表-账户基本信息',
formpage1: '基本信息', formpage1: '基本信息',
group2: '操作信息',
formpage2: '其它',
srfupdatedate: '更新时间', srfupdatedate: '更新时间',
srforikey: '', srforikey: '',
srfkey: '关系标识', srfkey: '关系标识',
...@@ -46,19 +48,15 @@ export default { ...@@ -46,19 +48,15 @@ export default {
srfuf: '', srfuf: '',
srfdeid: '', srfdeid: '',
srfsourcekey: '', srfsourcekey: '',
entity2name: '选择客户:',
entity2id: '客户',
relationshipsid: '关系标识', relationshipsid: '关系标识',
}, },
uiactions: { uiactions: {
}, },
}, },
main_form: { quickcreatebylist_form: {
details: { details: {
group1: '营销列表-账户基本信息', group1: '营销列表-账户基本信息',
formpage1: '基本信息', formpage1: '基本信息',
group2: '操作信息',
formpage2: '其它',
srfupdatedate: '更新时间', srfupdatedate: '更新时间',
srforikey: '', srforikey: '',
srfkey: '关系标识', srfkey: '关系标识',
...@@ -67,6 +65,8 @@ export default { ...@@ -67,6 +65,8 @@ export default {
srfuf: '', srfuf: '',
srfdeid: '', srfdeid: '',
srfsourcekey: '', srfsourcekey: '',
entity2name: '选择客户:',
entity2id: '客户',
relationshipsid: '关系标识', relationshipsid: '关系标识',
}, },
uiactions: { uiactions: {
...@@ -89,6 +89,24 @@ export default { ...@@ -89,6 +89,24 @@ export default {
uiactions: { uiactions: {
}, },
}, },
editviewtoolbar_toolbar: {
tbitem3: {
caption: '保存',
tip: '保存',
},
tbitem5: {
caption: '保存并关闭',
tip: '保存并关闭',
},
tbitem6: {
caption: '-',
tip: '',
},
tbitem12: {
caption: '关闭',
tip: '关闭',
},
},
bylisttoolbar_toolbar: { bylisttoolbar_toolbar: {
tbitem3: { tbitem3: {
caption: '新建', caption: '新建',
...@@ -127,22 +145,4 @@ export default { ...@@ -127,22 +145,4 @@ export default {
tip: '过滤', tip: '过滤',
}, },
}, },
editviewtoolbar_toolbar: {
tbitem3: {
caption: '保存',
tip: '保存',
},
tbitem5: {
caption: '保存并关闭',
tip: '保存并关闭',
},
tbitem6: {
caption: '-',
tip: '',
},
tbitem12: {
caption: '关闭',
tip: '关闭',
},
},
}; };
\ No newline at end of file
...@@ -20,6 +20,10 @@ export default { ...@@ -20,6 +20,10 @@ export default {
views: { views: {
gridview: { gridview: {
caption: "营销列表-联系人", caption: "营销列表-联系人",
title: '营销列表-联系人表格视图',
},
inner: {
caption: "联系人",
title: '营销列表-联系人表格视图', title: '营销列表-联系人表格视图',
}, },
editview: { editview: {
...@@ -46,6 +50,17 @@ export default { ...@@ -46,6 +50,17 @@ export default {
uiactions: { uiactions: {
}, },
}, },
inner_grid: {
columns: {
entity2name: "联系人",
emailaddress1: "电子邮件",
parentcustomerid: "公司名称",
telephone1: "商务电话",
statecode: "状态",
},
uiactions: {
},
},
main_grid: { main_grid: {
columns: { columns: {
entity2name: "联系人", entity2name: "联系人",
...@@ -64,6 +79,26 @@ export default { ...@@ -64,6 +79,26 @@ export default {
uiactions: { uiactions: {
}, },
}, },
innertoolbar_toolbar: {
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: "Save",
tip: "Save",
},
tbitem5: {
caption: "Save And Close",
tip: "Save And Close Window",
},
tbitem6: {
caption: "-",
tip: "",
},
tbitem12: {
caption: "关闭",
tip: "关闭",
},
},
gridviewtoolbar_toolbar: { gridviewtoolbar_toolbar: {
tbitem3: { tbitem3: {
caption: "New", caption: "New",
...@@ -102,22 +137,4 @@ export default { ...@@ -102,22 +137,4 @@ export default {
tip: "Filter", tip: "Filter",
}, },
}, },
editviewtoolbar_toolbar: {
tbitem3: {
caption: "Save",
tip: "Save",
},
tbitem5: {
caption: "Save And Close",
tip: "Save And Close Window",
},
tbitem6: {
caption: "-",
tip: "",
},
tbitem12: {
caption: "关闭",
tip: "关闭",
},
},
}; };
\ No newline at end of file
...@@ -19,6 +19,10 @@ export default { ...@@ -19,6 +19,10 @@ export default {
views: { views: {
gridview: { gridview: {
caption: '营销列表-联系人', caption: '营销列表-联系人',
title: '营销列表-联系人表格视图',
},
inner: {
caption: '联系人',
title: '营销列表-联系人表格视图', title: '营销列表-联系人表格视图',
}, },
editview: { editview: {
...@@ -45,6 +49,17 @@ export default { ...@@ -45,6 +49,17 @@ export default {
uiactions: { uiactions: {
}, },
}, },
inner_grid: {
columns: {
entity2name: '联系人',
emailaddress1: '电子邮件',
parentcustomerid: '公司名称',
telephone1: '商务电话',
statecode: '状态',
},
uiactions: {
},
},
main_grid: { main_grid: {
columns: { columns: {
entity2name: '联系人', entity2name: '联系人',
...@@ -63,6 +78,26 @@ export default { ...@@ -63,6 +78,26 @@ export default {
uiactions: { uiactions: {
}, },
}, },
innertoolbar_toolbar: {
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: '保存',
tip: '保存',
},
tbitem5: {
caption: '保存并关闭',
tip: '保存并关闭',
},
tbitem6: {
caption: '-',
tip: '',
},
tbitem12: {
caption: '关闭',
tip: '关闭',
},
},
gridviewtoolbar_toolbar: { gridviewtoolbar_toolbar: {
tbitem3: { tbitem3: {
caption: '新建', caption: '新建',
...@@ -101,22 +136,4 @@ export default { ...@@ -101,22 +136,4 @@ export default {
tip: '过滤', tip: '过滤',
}, },
}, },
editviewtoolbar_toolbar: {
tbitem3: {
caption: '保存',
tip: '保存',
},
tbitem5: {
caption: '保存并关闭',
tip: '保存并关闭',
},
tbitem6: {
caption: '-',
tip: '',
},
tbitem12: {
caption: '关闭',
tip: '关闭',
},
},
}; };
\ No newline at end of file
...@@ -56,14 +56,6 @@ export default { ...@@ -56,14 +56,6 @@ export default {
uiactions: { uiactions: {
}, },
}, },
default_searchform: {
details: {
formpage1: "常规条件",
n_entity2name_like: "潜在顾客(%)",
},
uiactions: {
},
},
bylisttoolbar_toolbar: { bylisttoolbar_toolbar: {
tbitem3: { tbitem3: {
caption: "New", caption: "New",
...@@ -93,13 +85,5 @@ export default { ...@@ -93,13 +85,5 @@ export default {
caption: "Export", caption: "Export",
tip: "Export {0} Data To Excel", tip: "Export {0} Data To Excel",
}, },
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "Filter",
tip: "Filter",
},
}, },
}; };
\ No newline at end of file
...@@ -55,14 +55,6 @@ export default { ...@@ -55,14 +55,6 @@ export default {
uiactions: { uiactions: {
}, },
}, },
default_searchform: {
details: {
formpage1: '常规条件',
n_entity2name_like: '潜在顾客(%)',
},
uiactions: {
},
},
bylisttoolbar_toolbar: { bylisttoolbar_toolbar: {
tbitem3: { tbitem3: {
caption: '新建', caption: '新建',
...@@ -92,13 +84,5 @@ export default { ...@@ -92,13 +84,5 @@ export default {
caption: '导出', caption: '导出',
tip: '导出', tip: '导出',
}, },
tbitem10: {
caption: '-',
tip: '',
},
tbitem19: {
caption: '过滤',
tip: '过滤',
},
}, },
}; };
\ No newline at end of file
...@@ -168,6 +168,43 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => { ...@@ -168,6 +168,43 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
}, },
] ]
}, },
{
srfkey: 'List__MemberType',
emptytext: '未定义',
"codelisttype":"static",
items: [
{
id: 'Account',
label: "客户",
text: "客户",
"data":"",
"codename":"Account",
value: 'Account',
disabled: false,
},
{
id: 'Lead',
label: "潜在客户",
text: "潜在客户",
"data":"",
"codename":"Lead",
value: 'Lead',
disabled: false,
},
{
id: 'Contact',
label: "联系人",
text: "联系人",
"data":"",
"codename":"Contact",
value: 'Contact',
disabled: false,
},
]
},
{ {
srfkey: 'Lead__IndustryCode', srfkey: 'Lead__IndustryCode',
emptytext: '未定义', emptytext: '未定义',
......
...@@ -743,6 +743,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => { ...@@ -743,6 +743,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "AppointmentQuickCreate", "viewname": "AppointmentQuickCreate",
"viewtag": "aa79d35850f36fbc1a5085353ecd5af5" "viewtag": "aa79d35850f36fbc1a5085353ecd5af5"
}, },
"listcontactinner": {
"title": "营销列表-联系人表格视图",
"caption": "联系人",
"viewtype": "DEGRIDVIEW9",
"viewmodule": "Marketing",
"viewname": "ListContactInner",
"viewtag": "aaa875342bd9286a39c2d193a150afc4"
},
"quoteeditview": { "quoteeditview": {
"title": "报价单编辑视图", "title": "报价单编辑视图",
"caption": "报价单", "caption": "报价单",
......
<template> <template>
<studio-view viewName="listaccounteditview" viewTitle="营销列表-账户编辑视图" class='deeditview list-account-edit-view'> <studio-view-style2 viewName="listaccounteditview" viewTitle="营销列表-账户编辑视图" class='deeditview list-account-edit-view'>
<template slot='title'> <template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span> <span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template> </template>
<template slot="toolbar"> <template slot="toolbar">
<view-toolbar :model="toolBarModels" @item-click="toolbar_click"/> </template> <view-toolbar mode="STYLE2" :model="toolBarModels" @item-click="toolbar_click"/> </template>
<view_form <view_form
:viewState="viewState" :viewState="viewState"
:viewparams="viewparams" :viewparams="viewparams"
...@@ -27,24 +27,29 @@ ...@@ -27,24 +27,29 @@
@load="form_load($event)" @load="form_load($event)"
@closeview="closeView($event)"> @closeview="closeView($event)">
</view_form> </view_form>
</studio-view> </studio-view-style2>
</template> </template>
<script lang='tsx'> <script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator'; import { Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { UIActionTool, Util } from '@/utils';
import { VueLifeCycleProcessing, EditViewBase } from '@/studio-core';
import ListAccountService from '@/service/list-account/list-account-service'; import ListAccountService from '@/service/list-account/list-account-service';
import EditViewEngine from '@engine/view/edit-view-engine'; import EditViewEngine from '@engine/view/edit-view-engine';
/**
@Component({ * 营销列表-账户编辑视图视图基类
components: { *
}, * @export
}) * @class ListAccountEditViewBase
export default class ListAccountEditViewBase extends Vue { * @extends {EditViewBase}
*/
@Component({})
@VueLifeCycleProcessing()
export default class ListAccountEditViewBase extends EditViewBase {
/** /**
* 实体服务对象 * 实体服务对象
...@@ -52,164 +57,64 @@ export default class ListAccountEditViewBase extends Vue { ...@@ -52,164 +57,64 @@ export default class ListAccountEditViewBase extends Vue {
* @type {ListAccountService} * @type {ListAccountService}
* @memberof ListAccountEditViewBase * @memberof ListAccountEditViewBase
*/ */
public appEntityService: ListAccountService = new ListAccountService; protected appEntityService: ListAccountService = new ListAccountService;
/** /**
* 计数器服务对象集合 * 计数器服务对象集合
* *
* @protected
* @type {Array<*>} * @type {Array<*>}
* @memberof ListAccountEditViewBase * @memberof ListAccountEditViewBase
*/ */
public counterServiceArray:Array<any> = []; protected counterServiceArray: Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof ListAccountEditViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof ListAccountEditViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof ListAccountEditViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof ListAccountEditViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof ListAccountEditViewBase
*/
public viewtag: string = '49dc1a714631338858cd0441f6c720ca';
/** /**
* 自定义视图导航上下文集合 * 自定义视图导航上下文集合
* *
* @protected
* @type {*} * @type {*}
* @memberof ListAccountEditViewBase * @memberof ListAccountEditViewBase
*/ */
public customViewNavContexts:any ={ protected customViewNavContexts: any = {
}; };
/** /**
* 自定义视图导航参数集合 * 自定义视图导航参数集合
* *
* @protected
* @type {*} * @type {*}
* @memberof ListAccountEditViewBase * @memberof ListAccountEditViewBase
*/ */
public customViewParams:any ={ protected customViewParams: any = {
}; };
/** /**
* 视图模型数据 * 视图模型数据
* *
* @protected
* @type {*} * @type {*}
* @memberof ListAccountEditViewBase * @memberof ListAccountEditViewBase
*/ */
public model: any = { protected model: any = {
srfCaption: 'entities.listaccount.views.editview.caption', srfCaption: 'entities.listaccount.views.editview.caption',
srfTitle: 'entities.listaccount.views.editview.title', srfTitle: 'entities.listaccount.views.editview.title',
srfSubTitle: 'entities.listaccount.views.editview.subtitle', srfSubTitle: 'entities.listaccount.views.editview.subtitle',
dataInfo: '' dataInfo: ''
} }
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof ListAccountEditViewBase
*/
@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 ListAccountEditViewBase
*/
@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();
});
}
}
/** /**
* 容器模型 * 容器模型
* *
* @protected
* @type {*} * @type {*}
* @memberof ListAccountEditViewBase * @memberof ListAccountEditViewBase
*/ */
public containerModel: any = { protected containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' }, view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_form: { name: 'form', type: 'FORM' }, view_form: { name: 'form', type: 'FORM' },
}; };
/**
* 计数器刷新
*
* @memberof ListAccountEditViewBase
*/
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 ListAccountEditViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/** /**
* 工具栏模型 * 工具栏模型
* *
...@@ -255,198 +160,6 @@ export default class ListAccountEditViewBase extends Vue { ...@@ -255,198 +160,6 @@ export default class ListAccountEditViewBase extends Vue {
}); });
} }
/**
* 应用上下文
*
* @type {*}
* @memberof ListAccountEditViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof ListAccountEditViewBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof ListAccountEditViewBase
*/
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 ListAccountEditViewBase
*/
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 ListAccountEditViewBase
*/
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 ListAccountEditViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ListAccountEditViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof ListAccountEditViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof ListAccountEditViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof ListAccountEditViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/** /**
* toolbar 部件 click 事件 * toolbar 部件 click 事件
* *
...@@ -454,7 +167,7 @@ export default class ListAccountEditViewBase extends Vue { ...@@ -454,7 +167,7 @@ export default class ListAccountEditViewBase extends Vue {
* @param {*} $event * @param {*} $event
* @memberof ListAccountEditViewBase * @memberof ListAccountEditViewBase
*/ */
public toolbar_click($event: any, $event2?: any) { public toolbar_click($event: any, $event2?: any): void {
if (Object.is($event.tag, 'tbitem3')) { if (Object.is($event.tag, 'tbitem3')) {
this.toolbar_tbitem3_click(null, '', $event2); this.toolbar_tbitem3_click(null, '', $event2);
} }
...@@ -466,7 +179,6 @@ export default class ListAccountEditViewBase extends Vue { ...@@ -466,7 +179,6 @@ export default class ListAccountEditViewBase extends Vue {
} }
} }
/** /**
* form 部件 save 事件 * form 部件 save 事件
* *
...@@ -474,11 +186,10 @@ export default class ListAccountEditViewBase extends Vue { ...@@ -474,11 +186,10 @@ export default class ListAccountEditViewBase extends Vue {
* @param {*} $event * @param {*} $event
* @memberof ListAccountEditViewBase * @memberof ListAccountEditViewBase
*/ */
public form_save($event: any, $event2?: any) { public form_save($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'save', $event); this.engine.onCtrlEvent('form', 'save', $event);
} }
/** /**
* form 部件 remove 事件 * form 部件 remove 事件
* *
...@@ -486,11 +197,10 @@ export default class ListAccountEditViewBase extends Vue { ...@@ -486,11 +197,10 @@ export default class ListAccountEditViewBase extends Vue {
* @param {*} $event * @param {*} $event
* @memberof ListAccountEditViewBase * @memberof ListAccountEditViewBase
*/ */
public form_remove($event: any, $event2?: any) { public form_remove($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'remove', $event); this.engine.onCtrlEvent('form', 'remove', $event);
} }
/** /**
* form 部件 load 事件 * form 部件 load 事件
* *
...@@ -498,12 +208,10 @@ export default class ListAccountEditViewBase extends Vue { ...@@ -498,12 +208,10 @@ export default class ListAccountEditViewBase extends Vue {
* @param {*} $event * @param {*} $event
* @memberof ListAccountEditViewBase * @memberof ListAccountEditViewBase
*/ */
public form_load($event: any, $event2?: any) { public form_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'load', $event); this.engine.onCtrlEvent('form', 'load', $event);
} }
/** /**
* 逻辑事件 * 逻辑事件
* *
...@@ -666,49 +374,6 @@ export default class ListAccountEditViewBase extends Vue { ...@@ -666,49 +374,6 @@ export default class ListAccountEditViewBase extends Vue {
} }
/**
* 关闭视图
*
* @param {any[]} args
* @memberof ListAccountEditViewBase
*/
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 ListAccountEditViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ListAccountEditViewBase
*/
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);
}
})
}
}
}
} }
</script> </script>
......
<template>
<studio-embed-view-style2 viewName="listaccountinner" viewTitle="营销列表-账户表格视图" class='degridview9 list-account-inner'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<view_grid
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
@save="onSave"
updateAction=""
removeAction="Remove"
loaddraftAction=""
loadAction=""
createAction=""
fetchAction="FetchDefault"
:newdata="newdata"
:opendata="opendata"
name="grid"
ref='grid'
@selectionchange="grid_selectionchange($event)"
@beforeload="grid_beforeload($event)"
@rowdblclick="grid_rowdblclick($event)"
@remove="grid_remove($event)"
@load="grid_load($event)"
@closeview="closeView($event)">
</view_grid>
</studio-embed-view-style2>
</template>
<script lang='tsx'>
import { Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
import { UIActionTool, Util } from '@/utils';
import { VueLifeCycleProcessing, GridView9Base } from '@/studio-core';
import ListAccountService from '@/service/list-account/list-account-service';
import GridView9Engine from '@engine/view/grid-view9-engine';
import CodeListService from "@service/app/codelist-service";
/**
* 营销列表-账户表格视图视图基类
*
* @export
* @class ListAccountInnerBase
* @extends {GridView9Base}
*/
@Component({})
@VueLifeCycleProcessing()
export default class ListAccountInnerBase extends GridView9Base {
/**
* 实体服务对象
*
* @type {ListAccountService}
* @memberof ListAccountInnerBase
*/
protected appEntityService: ListAccountService = new ListAccountService;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof ListAccountInnerBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 自定义视图导航上下文集合
*
* @protected
* @type {*}
* @memberof ListAccountInnerBase
*/
protected customViewNavContexts: any = {
};
/**
* 自定义视图导航参数集合
*
* @protected
* @type {*}
* @memberof ListAccountInnerBase
*/
protected customViewParams: any = {
};
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof ListAccountInnerBase
*/
protected model: any = {
srfCaption: 'entities.listaccount.views.inner.caption',
srfTitle: 'entities.listaccount.views.inner.title',
srfSubTitle: 'entities.listaccount.views.inner.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof ListAccountInnerBase
*/
protected containerModel: any = {
view_grid: { name: 'grid', type: 'GRID' },
};
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof ListAccountInnerBase
*/
public engine: GridView9Engine = new GridView9Engine();
/**
* 引擎初始化
*
* @public
* @memberof ListAccountInnerBase
*/
public engineInit(): void {
this.engine.init({
view: this,
opendata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.opendata(args,fullargs, params, $event, xData);
},
newdata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.newdata(args,fullargs, params, $event, xData);
},
grid: this.$refs.grid,
keyPSDEField: 'listaccount',
majorPSDEField: 'relationshipsname',
isLoadDefault: true,
});
}
/**
* grid 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListAccountInnerBase
*/
public grid_selectionchange($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'selectionchange', $event);
}
/**
* grid 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListAccountInnerBase
*/
public grid_beforeload($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'beforeload', $event);
}
/**
* grid 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListAccountInnerBase
*/
public grid_rowdblclick($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'rowdblclick', $event);
}
/**
* grid 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListAccountInnerBase
*/
public grid_remove($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'remove', $event);
}
/**
* grid 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListAccountInnerBase
*/
public grid_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'load', $event);
}
/**
* 打开新建数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof ListAccountInner
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
}
/**
* 打开编辑数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof ListAccountInner
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
let tempContext = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.account && true){
deResParameters = [
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'editview', parameterName: 'editview' },
];
const _this: any = this;
const openIndexViewTab = (data: any) => {
const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data);
this.$router.push(routePath);
}
openIndexViewTab(data);
}
/**
* 是否单选
*
* @type {boolean}
* @memberof ListAccountInnerBase
*/
public isSingleSelect: boolean = false;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof ListAccountInnerBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof ListAccountInnerBase
*/
@Prop() public formDruipart?: Subject<ViewState>;
/**
* 搜索值
*
* @type {string}
* @memberof ListAccountInnerBase
*/
public query: string = '';
/**
* 是否展开搜索表单
*
* @type {boolean}
* @memberof ListAccountInnerBase
*/
public isExpandSearchForm: boolean = false;
/**
* 表格行数据默认激活模式
* 0 不激活
* 1 单击激活
* 2 双击激活
*
* @type {(number | 0 | 1 | 2)}
* @memberof ListAccountInnerBase
*/
public gridRowActiveMode: number | 0 | 1 | 2 = 2;
/**
* 快速搜索
*
* @param {*} $event
* @memberof ListAccountInnerBase
*/
public onSearch($event: any): void {
const grid: any = this.$refs.grid;
if (grid) {
grid.load(this.context, true);
}
}
/**
* grid 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ENTITYTEST1Usr2GridViewBase
*/
public onSave($event: any) {
this.$emit('drdatasaved', $event);
}
/**
* 刷新数据
*
* @readonly
* @type {(number | null)}
* @memberof ListAccountInnerBase
*/
get refreshdata(): number | null {
return this.$store.getters['viewaction/getRefreshData'](this.viewtag);
}
/**
* 监控数据变化
*
* @param {*} newVal
* @param {*} oldVal
* @returns
* @memberof ListAccountInnerBase
*/
@Watch('refreshdata')
onRefreshData(newVal: any, oldVal: any) {
if (newVal === null || newVal === undefined) {
return;
}
if (newVal === 0) {
return;
}
const grid: any = this.$refs.grid;
if (grid) {
grid.load({});
}
}
}
</script>
<style lang='less'>
@import './list-account-inner.less';
</style>
\ No newline at end of file
// 避免空文件,后台不让空文件过
.list-account-inner {
--list-account-inner: 0;
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import ListAccountInnerBase from './list-account-inner-base.vue';
import view_grid from '@widgets/list-account/main-grid/main-grid.vue';
@Component({
components: {
view_grid,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
},
})
export default class ListAccountInner extends ListAccountInnerBase {
}
</script>
\ No newline at end of file
<template>
<studio-embed-view-style2 viewName="listcontactinner" viewTitle="营销列表-联系人表格视图" class='degridview9 list-contact-inner'>
<template slot="toolbar">
<view-toolbar mode="STYLE2" :model="toolBarModels" @item-click="toolbar_click"/> </template>
<view_grid
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
@save="onSave"
updateAction=""
removeAction="Remove"
loaddraftAction=""
loadAction=""
createAction=""
fetchAction="FetchDefault"
:newdata="newdata"
:opendata="opendata"
name="grid"
ref='grid'
@selectionchange="grid_selectionchange($event)"
@beforeload="grid_beforeload($event)"
@rowdblclick="grid_rowdblclick($event)"
@remove="grid_remove($event)"
@load="grid_load($event)"
@closeview="closeView($event)">
</view_grid>
</studio-embed-view-style2>
</template>
<script lang='tsx'>
import { Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
import { UIActionTool, Util } from '@/utils';
import { VueLifeCycleProcessing, GridView9Base } from '@/studio-core';
import ListContactService from '@/service/list-contact/list-contact-service';
import GridView9Engine from '@engine/view/grid-view9-engine';
import CodeListService from "@service/app/codelist-service";
/**
* 营销列表-联系人表格视图视图基类
*
* @export
* @class ListContactInnerBase
* @extends {GridView9Base}
*/
@Component({})
@VueLifeCycleProcessing()
export default class ListContactInnerBase extends GridView9Base {
/**
* 实体服务对象
*
* @type {ListContactService}
* @memberof ListContactInnerBase
*/
protected appEntityService: ListContactService = new ListContactService;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof ListContactInnerBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 自定义视图导航上下文集合
*
* @protected
* @type {*}
* @memberof ListContactInnerBase
*/
protected customViewNavContexts: any = {
};
/**
* 自定义视图导航参数集合
*
* @protected
* @type {*}
* @memberof ListContactInnerBase
*/
protected customViewParams: any = {
};
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof ListContactInnerBase
*/
protected model: any = {
srfCaption: 'entities.listcontact.views.inner.caption',
srfTitle: 'entities.listcontact.views.inner.title',
srfSubTitle: 'entities.listcontact.views.inner.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof ListContactInnerBase
*/
protected containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_grid: { name: 'grid', type: 'GRID' },
};
/**
* 工具栏模型
*
* @type {*}
* @memberof ListContactInner
*/
public toolBarModels: any = {
};
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof ListContactInnerBase
*/
public engine: GridView9Engine = new GridView9Engine();
/**
* 引擎初始化
*
* @public
* @memberof ListContactInnerBase
*/
public engineInit(): void {
this.engine.init({
view: this,
opendata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.opendata(args,fullargs, params, $event, xData);
},
newdata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.newdata(args,fullargs, params, $event, xData);
},
grid: this.$refs.grid,
keyPSDEField: 'listcontact',
majorPSDEField: 'relationshipsname',
isLoadDefault: true,
});
}
/**
* grid 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListContactInnerBase
*/
public grid_selectionchange($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'selectionchange', $event);
}
/**
* grid 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListContactInnerBase
*/
public grid_beforeload($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'beforeload', $event);
}
/**
* grid 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListContactInnerBase
*/
public grid_rowdblclick($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'rowdblclick', $event);
}
/**
* grid 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListContactInnerBase
*/
public grid_remove($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'remove', $event);
}
/**
* grid 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListContactInnerBase
*/
public grid_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'load', $event);
}
/**
* 打开新建数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof ListContactInner
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
}
/**
* 打开编辑数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof ListContactInner
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
let tempContext = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.contact && true){
deResParameters = [
{ pathName: 'contacts', parameterName: 'contact' },
]
}
const parameters: any[] = [
{ pathName: 'listcontacts', parameterName: 'listcontact' },
{ pathName: 'editview', parameterName: 'editview' },
];
const _this: any = this;
const openIndexViewTab = (data: any) => {
const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data);
this.$router.push(routePath);
}
openIndexViewTab(data);
}
/**
* 是否单选
*
* @type {boolean}
* @memberof ListContactInnerBase
*/
public isSingleSelect: boolean = false;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof ListContactInnerBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof ListContactInnerBase
*/
@Prop() public formDruipart?: Subject<ViewState>;
/**
* 搜索值
*
* @type {string}
* @memberof ListContactInnerBase
*/
public query: string = '';
/**
* 是否展开搜索表单
*
* @type {boolean}
* @memberof ListContactInnerBase
*/
public isExpandSearchForm: boolean = false;
/**
* 表格行数据默认激活模式
* 0 不激活
* 1 单击激活
* 2 双击激活
*
* @type {(number | 0 | 1 | 2)}
* @memberof ListContactInnerBase
*/
public gridRowActiveMode: number | 0 | 1 | 2 = 2;
/**
* 快速搜索
*
* @param {*} $event
* @memberof ListContactInnerBase
*/
public onSearch($event: any): void {
const grid: any = this.$refs.grid;
if (grid) {
grid.load(this.context, true);
}
}
/**
* grid 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ENTITYTEST1Usr2GridViewBase
*/
public onSave($event: any) {
this.$emit('drdatasaved', $event);
}
/**
* 刷新数据
*
* @readonly
* @type {(number | null)}
* @memberof ListContactInnerBase
*/
get refreshdata(): number | null {
return this.$store.getters['viewaction/getRefreshData'](this.viewtag);
}
/**
* 监控数据变化
*
* @param {*} newVal
* @param {*} oldVal
* @returns
* @memberof ListContactInnerBase
*/
@Watch('refreshdata')
onRefreshData(newVal: any, oldVal: any) {
if (newVal === null || newVal === undefined) {
return;
}
if (newVal === 0) {
return;
}
const grid: any = this.$refs.grid;
if (grid) {
grid.load({});
}
}
}
</script>
<style lang='less'>
@import './list-contact-inner.less';
</style>
\ No newline at end of file
// 避免空文件,后台不让空文件过
.list-contact-inner {
--list-contact-inner: 0;
}
// 视图样式
// this is less
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import ListContactInnerBase from './list-contact-inner-base.vue';
import view_grid from '@widgets/list-contact/inner-grid/inner-grid.vue';
@Component({
components: {
view_grid,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
},
})
export default class ListContactInner extends ListContactInnerBase {
}
</script>
\ No newline at end of file
<template> <template>
<studio-view-style2 viewName="listleadbylist" viewTitle="营销列表-潜在客户(根据营销列表)" class='degridview list-lead-by-list'> <studio-view-style2 viewName="listleadbylist" viewTitle="营销列表-潜在客户(根据营销列表)" class='degridview list-lead-by-list'>
<i-input slot="quickSearch" v-show="!isExpandSearchForm" v-model="query" search @on-search="onSearch($event)"/> <i-input slot="quickSearch" v-model="query" search @on-search="onSearch($event)"/>
<template slot="toolbar"> <template slot="toolbar">
<view-toolbar mode="STYLE2" :model="toolBarModels" @item-click="toolbar_click"/> </template> <view-toolbar mode="STYLE2" :model="toolBarModels" @item-click="toolbar_click"/> </template>
<template slot="searchForm">
<view_searchform
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
@search="searchform_search($event)"
@load="searchform_load($event)"
@closeview="closeView($event)">
</view_searchform>
</template>
<view_grid <view_grid
:viewState="viewState" :viewState="viewState"
:viewparams="viewparams" :viewparams="viewparams"
...@@ -136,7 +118,6 @@ export default class ListLeadByListBase extends GridViewBase { ...@@ -136,7 +118,6 @@ export default class ListLeadByListBase extends GridViewBase {
protected containerModel: any = { protected containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' }, view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_grid: { name: 'grid', type: 'GRID' }, view_grid: { name: 'grid', type: 'GRID' },
view_searchform: { name: 'searchform', type: 'SEARCHFORM' },
}; };
/** /**
...@@ -158,9 +139,6 @@ export default class ListLeadByListBase extends GridViewBase { ...@@ -158,9 +139,6 @@ export default class ListLeadByListBase extends GridViewBase {
tbitem9: { name: 'tbitem9', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } }, tbitem9: { name: 'tbitem9', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem13: { name: 'tbitem13', caption: '导出','isShowCaption':true,'isShowIcon':true, tooltip: '导出', iconcls: 'fa fa-file-excel-o', icon: '', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'ExportExcel', target: '' }, MaxRowCount: 1000, class: '' }, tbitem13: { name: 'tbitem13', caption: '导出','isShowCaption':true,'isShowIcon':true, tooltip: '导出', iconcls: 'fa fa-file-excel-o', icon: '', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'ExportExcel', target: '' }, MaxRowCount: 1000, class: '' },
tbitem10: { name: 'tbitem10', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem19: { name: 'tbitem19', caption: '过滤','isShowCaption':true,'isShowIcon':true, tooltip: '过滤', iconcls: 'fa fa-filter', icon: '', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'ToggleFilter', target: '' }, class: '' },
}; };
...@@ -192,7 +170,6 @@ export default class ListLeadByListBase extends GridViewBase { ...@@ -192,7 +170,6 @@ export default class ListLeadByListBase extends GridViewBase {
this.newdata(args,fullargs, params, $event, xData); this.newdata(args,fullargs, params, $event, xData);
}, },
grid: this.$refs.grid, grid: this.$refs.grid,
searchform: this.$refs.searchform,
keyPSDEField: 'listlead', keyPSDEField: 'listlead',
majorPSDEField: 'relationshipsname', majorPSDEField: 'relationshipsname',
isLoadDefault: true, isLoadDefault: true,
...@@ -291,39 +268,6 @@ export default class ListLeadByListBase extends GridViewBase { ...@@ -291,39 +268,6 @@ export default class ListLeadByListBase extends GridViewBase {
this.engine.onCtrlEvent('grid', 'load', $event); this.engine.onCtrlEvent('grid', 'load', $event);
} }
/**
* searchform 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListLeadByListBase
*/
public searchform_save($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'save', $event);
}
/**
* searchform 部件 search 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListLeadByListBase
*/
public searchform_search($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'search', $event);
}
/**
* searchform 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ListLeadByListBase
*/
public searchform_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'load', $event);
}
/** /**
* 逻辑事件 * 逻辑事件
* *
......
...@@ -3,11 +3,9 @@ import { Component } from 'vue-property-decorator'; ...@@ -3,11 +3,9 @@ import { Component } from 'vue-property-decorator';
import ListLeadByListBase from './list-lead-by-list-base.vue'; import ListLeadByListBase from './list-lead-by-list-base.vue';
import view_grid from '@widgets/list-lead/main-grid/main-grid.vue'; import view_grid from '@widgets/list-lead/main-grid/main-grid.vue';
import view_searchform from '@widgets/list-lead/default-searchform/default-searchform.vue';
@Component({ @Component({
components: { components: {
view_grid, view_grid,
view_searchform,
}, },
beforeRouteEnter: (to: any, from: any, next: any) => { beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => { next((vm: any) => {
......
...@@ -61,9 +61,11 @@ export const PageComponents = { ...@@ -61,9 +61,11 @@ export const PageComponents = {
Vue.component('quote-grid-view', () => import('@pages/sales/quote-grid-view/quote-grid-view.vue')); Vue.component('quote-grid-view', () => import('@pages/sales/quote-grid-view/quote-grid-view.vue'));
Vue.component('invoice-edit-view', () => import('@pages/finance/invoice-edit-view/invoice-edit-view.vue')); Vue.component('invoice-edit-view', () => import('@pages/finance/invoice-edit-view/invoice-edit-view.vue'));
Vue.component('campaign-edit-view', () => import('@pages/marketing/campaign-edit-view/campaign-edit-view.vue')); Vue.component('campaign-edit-view', () => import('@pages/marketing/campaign-edit-view/campaign-edit-view.vue'));
Vue.component('list-contact-inner', () => import('@pages/marketing/list-contact-inner/list-contact-inner.vue'));
Vue.component('campaign-info-campagin', () => import('@pages/marketing/campaign-info-campagin/campaign-info-campagin.vue')); Vue.component('campaign-info-campagin', () => import('@pages/marketing/campaign-info-campagin/campaign-info-campagin.vue'));
Vue.component('appointment-edit-view', () => import('@pages/base/appointment-edit-view/appointment-edit-view.vue')); Vue.component('appointment-edit-view', () => import('@pages/base/appointment-edit-view/appointment-edit-view.vue'));
Vue.component('contact-tab-exp-view', () => import('@pages/base/contact-tab-exp-view/contact-tab-exp-view.vue')); Vue.component('contact-tab-exp-view', () => import('@pages/base/contact-tab-exp-view/contact-tab-exp-view.vue'));
Vue.component('list-account-edit-view', () => import('@pages/marketing/list-account-edit-view/list-account-edit-view.vue'));
Vue.component('service-appointment-edit-view', () => import('@pages/service/service-appointment-edit-view/service-appointment-edit-view.vue')); Vue.component('service-appointment-edit-view', () => import('@pages/service/service-appointment-edit-view/service-appointment-edit-view.vue'));
Vue.component('contact-grid-view', () => import('@pages/base/contact-grid-view/contact-grid-view.vue')); Vue.component('contact-grid-view', () => import('@pages/base/contact-grid-view/contact-grid-view.vue'));
Vue.component('transaction-currency-pickup-grid-view', () => import('@pages/base/transaction-currency-pickup-grid-view/transaction-currency-pickup-grid-view.vue')); Vue.component('transaction-currency-pickup-grid-view', () => import('@pages/base/transaction-currency-pickup-grid-view/transaction-currency-pickup-grid-view.vue'));
...@@ -85,6 +87,7 @@ export const PageComponents = { ...@@ -85,6 +87,7 @@ export const PageComponents = {
Vue.component('account-info-all', () => import('@pages/base/account-info-all/account-info-all.vue')); Vue.component('account-info-all', () => import('@pages/base/account-info-all/account-info-all.vue'));
Vue.component('activity-pointer-by-parent-key', () => import('@pages/base/activity-pointer-by-parent-key/activity-pointer-by-parent-key.vue')); Vue.component('activity-pointer-by-parent-key', () => import('@pages/base/activity-pointer-by-parent-key/activity-pointer-by-parent-key.vue'));
Vue.component('contact-edit-abstract', () => import('@pages/base/contact-edit-abstract/contact-edit-abstract.vue')); Vue.component('contact-edit-abstract', () => import('@pages/base/contact-edit-abstract/contact-edit-abstract.vue'));
Vue.component('list-account-inner', () => import('@pages/marketing/list-account-inner/list-account-inner.vue'));
Vue.component('contact-dashboard-view', () => import('@pages/base/contact-dashboard-view/contact-dashboard-view.vue')); Vue.component('contact-dashboard-view', () => import('@pages/base/contact-dashboard-view/contact-dashboard-view.vue'));
Vue.component('task-edit-view', () => import('@pages/base/task-edit-view/task-edit-view.vue')); Vue.component('task-edit-view', () => import('@pages/base/task-edit-view/task-edit-view.vue'));
Vue.component('contact-info-market', () => import('@pages/base/contact-info-market/contact-info-market.vue')); Vue.component('contact-info-market', () => import('@pages/base/contact-info-market/contact-info-market.vue'));
......
...@@ -1650,6 +1650,66 @@ const router = new Router({ ...@@ -1650,6 +1650,66 @@ const router = new Router({
}, },
component: () => import('@pages/marketing/campaign-edit-view/campaign-edit-view.vue'), component: () => import('@pages/marketing/campaign-edit-view/campaign-edit-view.vue'),
}, },
{
path: 'accounts/:account?/contacts/:contact?/listcontacts/:listcontact?/inner/:inner?',
meta: {
caption: 'entities.listcontact.views.inner.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'listcontacts', parameterName: 'listcontact' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-contact-inner/list-contact-inner.vue'),
},
{
path: 'ibizlists/:ibizlist?/listcontacts/:listcontact?/inner/:inner?',
meta: {
caption: 'entities.listcontact.views.inner.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'ibizlists', parameterName: 'ibizlist' },
{ pathName: 'listcontacts', parameterName: 'listcontact' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-contact-inner/list-contact-inner.vue'),
},
{
path: 'contacts/:contact?/listcontacts/:listcontact?/inner/:inner?',
meta: {
caption: 'entities.listcontact.views.inner.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'listcontacts', parameterName: 'listcontact' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-contact-inner/list-contact-inner.vue'),
},
{
path: 'listcontacts/:listcontact?/inner/:inner?',
meta: {
caption: 'entities.listcontact.views.inner.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'listcontacts', parameterName: 'listcontact' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-contact-inner/list-contact-inner.vue'),
},
{ {
path: 'campaigns/:campaign?/info_campagin/:info_campagin?', path: 'campaigns/:campaign?/info_campagin/:info_campagin?',
meta: { meta: {
...@@ -1707,6 +1767,50 @@ const router = new Router({ ...@@ -1707,6 +1767,50 @@ const router = new Router({
}, },
component: () => import('@pages/base/contact-tab-exp-view/contact-tab-exp-view.vue'), component: () => import('@pages/base/contact-tab-exp-view/contact-tab-exp-view.vue'),
}, },
{
path: 'ibizlists/:ibizlist?/listaccounts/:listaccount?/editview/:editview?',
meta: {
caption: 'entities.listaccount.views.editview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'ibizlists', parameterName: 'ibizlist' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-edit-view/list-account-edit-view.vue'),
},
{
path: 'accounts/:account?/listaccounts/:listaccount?/editview/:editview?',
meta: {
caption: 'entities.listaccount.views.editview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-edit-view/list-account-edit-view.vue'),
},
{
path: 'listaccounts/:listaccount?/editview/:editview?',
meta: {
caption: 'entities.listaccount.views.editview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-edit-view/list-account-edit-view.vue'),
},
{ {
path: 'serviceappointments/:serviceappointment?/editview/:editview?', path: 'serviceappointments/:serviceappointment?/editview/:editview?',
meta: { meta: {
...@@ -2365,6 +2469,50 @@ const router = new Router({ ...@@ -2365,6 +2469,50 @@ const router = new Router({
}, },
component: () => import('@pages/base/account-inner-pickup-grid-view/account-inner-pickup-grid-view.vue'), component: () => import('@pages/base/account-inner-pickup-grid-view/account-inner-pickup-grid-view.vue'),
}, },
{
path: 'ibizlists/:ibizlist?/listaccounts/:listaccount?/inner/:inner?',
meta: {
caption: 'entities.listaccount.views.inner.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'ibizlists', parameterName: 'ibizlist' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-inner/list-account-inner.vue'),
},
{
path: 'accounts/:account?/listaccounts/:listaccount?/inner/:inner?',
meta: {
caption: 'entities.listaccount.views.inner.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-inner/list-account-inner.vue'),
},
{
path: 'listaccounts/:listaccount?/inner/:inner?',
meta: {
caption: 'entities.listaccount.views.inner.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-inner/list-account-inner.vue'),
},
{ {
path: 'accounts/:account?/edit_introduction/:edit_introduction?', path: 'accounts/:account?/edit_introduction/:edit_introduction?',
meta: { meta: {
...@@ -3340,6 +3488,47 @@ const router = new Router({ ...@@ -3340,6 +3488,47 @@ const router = new Router({
}, },
component: () => import('@pages/marketing/campaign-edit-view/campaign-edit-view.vue'), component: () => import('@pages/marketing/campaign-edit-view/campaign-edit-view.vue'),
}, },
{
path: '/ibizlists/:ibizlist?/listaccounts/:listaccount?/inner/:inner?',
meta: {
caption: 'entities.listaccount.views.inner.title',
info:'',
parameters: [
{ pathName: 'ibizlists', parameterName: 'ibizlist' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-inner/list-account-inner.vue'),
},
{
path: '/accounts/:account?/listaccounts/:listaccount?/inner/:inner?',
meta: {
caption: 'entities.listaccount.views.inner.title',
info:'',
parameters: [
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-inner/list-account-inner.vue'),
},
{
path: '/listaccounts/:listaccount?/inner/:inner?',
meta: {
caption: 'entities.listaccount.views.inner.title',
info:'',
parameters: [
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-inner/list-account-inner.vue'),
},
{ {
path: '/activitypointers/:activitypointer?/gridview/:gridview?', path: '/activitypointers/:activitypointer?/gridview/:gridview?',
meta: { meta: {
...@@ -3450,6 +3639,47 @@ const router = new Router({ ...@@ -3450,6 +3639,47 @@ const router = new Router({
}, },
component: () => import('@pages/marketing/list-account-by-list/list-account-by-list.vue'), component: () => import('@pages/marketing/list-account-by-list/list-account-by-list.vue'),
}, },
{
path: '/ibizlists/:ibizlist?/listaccounts/:listaccount?/editview/:editview?',
meta: {
caption: 'entities.listaccount.views.editview.title',
info:'',
parameters: [
{ pathName: 'ibizlists', parameterName: 'ibizlist' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-edit-view/list-account-edit-view.vue'),
},
{
path: '/accounts/:account?/listaccounts/:listaccount?/editview/:editview?',
meta: {
caption: 'entities.listaccount.views.editview.title',
info:'',
parameters: [
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-edit-view/list-account-edit-view.vue'),
},
{
path: '/listaccounts/:listaccount?/editview/:editview?',
meta: {
caption: 'entities.listaccount.views.editview.title',
info:'',
parameters: [
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-edit-view/list-account-edit-view.vue'),
},
{ {
path: '/accounts/:account?/contacts/:contact?/leads/:lead?/info_market/:info_market?', path: '/accounts/:account?/contacts/:contact?/leads/:lead?/info_market/:info_market?',
meta: { meta: {
...@@ -4467,6 +4697,62 @@ const router = new Router({ ...@@ -4467,6 +4697,62 @@ const router = new Router({
}, },
component: () => import('@pages/base/appointment-quick-create/appointment-quick-create.vue'), component: () => import('@pages/base/appointment-quick-create/appointment-quick-create.vue'),
}, },
{
path: '/accounts/:account?/contacts/:contact?/listcontacts/:listcontact?/inner/:inner?',
meta: {
caption: 'entities.listcontact.views.inner.title',
info:'',
parameters: [
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'listcontacts', parameterName: 'listcontact' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-contact-inner/list-contact-inner.vue'),
},
{
path: '/ibizlists/:ibizlist?/listcontacts/:listcontact?/inner/:inner?',
meta: {
caption: 'entities.listcontact.views.inner.title',
info:'',
parameters: [
{ pathName: 'ibizlists', parameterName: 'ibizlist' },
{ pathName: 'listcontacts', parameterName: 'listcontact' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-contact-inner/list-contact-inner.vue'),
},
{
path: '/contacts/:contact?/listcontacts/:listcontact?/inner/:inner?',
meta: {
caption: 'entities.listcontact.views.inner.title',
info:'',
parameters: [
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'listcontacts', parameterName: 'listcontact' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-contact-inner/list-contact-inner.vue'),
},
{
path: '/listcontacts/:listcontact?/inner/:inner?',
meta: {
caption: 'entities.listcontact.views.inner.title',
info:'',
parameters: [
{ pathName: 'listcontacts', parameterName: 'listcontact' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-contact-inner/list-contact-inner.vue'),
},
{ {
path: '/quotes/:quote?/editview/:editview?', path: '/quotes/:quote?/editview/:editview?',
meta: { meta: {
......
...@@ -251,6 +251,9 @@ export const viewstate: any = { ...@@ -251,6 +251,9 @@ export const viewstate: any = {
viewaction: '', viewaction: '',
viewdatachange: false, viewdatachange: false,
refviews: [ refviews: [
'2c6be792e84450585986e22f75dffa52',
'aaa875342bd9286a39c2d193a150afc4',
'44a690a1d62a390708480cb43f67d98b',
], ],
}, },
{ {
...@@ -344,6 +347,16 @@ export const viewstate: any = { ...@@ -344,6 +347,16 @@ export const viewstate: any = {
'da3f8c1f20f440f3df54d6c13a8de586', 'da3f8c1f20f440f3df54d6c13a8de586',
], ],
}, },
{
viewtag: '44a690a1d62a390708480cb43f67d98b',
viewmodule: 'Marketing',
viewname: 'ListAccountInner',
viewaction: '',
viewdatachange: false,
refviews: [
'49dc1a714631338858cd0441f6c720ca',
],
},
{ {
viewtag: '45fdc8ee4d1401d2d625e80177395ddc', viewtag: '45fdc8ee4d1401d2d625e80177395ddc',
viewmodule: 'Base', viewmodule: 'Base',
...@@ -381,6 +394,15 @@ export const viewstate: any = { ...@@ -381,6 +394,15 @@ export const viewstate: any = {
'a1b44c891ef0bbc073c82693d8489de6', 'a1b44c891ef0bbc073c82693d8489de6',
], ],
}, },
{
viewtag: '49dc1a714631338858cd0441f6c720ca',
viewmodule: 'Marketing',
viewname: 'ListAccountEditView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{ {
viewtag: '49e5e89fb51fa9929925b532841b2549', viewtag: '49e5e89fb51fa9929925b532841b2549',
viewmodule: 'Sales', viewmodule: 'Sales',
...@@ -826,6 +848,16 @@ export const viewstate: any = { ...@@ -826,6 +848,16 @@ export const viewstate: any = {
refviews: [ refviews: [
], ],
}, },
{
viewtag: 'aaa875342bd9286a39c2d193a150afc4',
viewmodule: 'Marketing',
viewname: 'ListContactInner',
viewaction: '',
viewdatachange: false,
refviews: [
'c7d0ca0f6fa1b27bbd1b5c422d1a108d',
],
},
{ {
viewtag: 'ad6abf83dc1bc466b988194cd868d98a', viewtag: 'ad6abf83dc1bc466b988194cd868d98a',
viewmodule: 'Sales', viewmodule: 'Sales',
......
...@@ -80,6 +80,7 @@ export default class ListContactUIServiceBase extends UIService { ...@@ -80,6 +80,7 @@ export default class ListContactUIServiceBase extends UIService {
*/ */
public initViewMap(){ public initViewMap(){
this.allViewMap.set('MDATAVIEW:',{viewname:'gridview',srfappde:'listcontacts'}); this.allViewMap.set('MDATAVIEW:',{viewname:'gridview',srfappde:'listcontacts'});
this.allViewMap.set(':',{viewname:'inner',srfappde:'listcontacts'});
this.allViewMap.set('EDITVIEW:',{viewname:'editview',srfappde:'listcontacts'}); this.allViewMap.set('EDITVIEW:',{viewname:'editview',srfappde:'listcontacts'});
} }
......
...@@ -525,10 +525,10 @@ export default class AbstractEditBase extends Vue implements ControlInterface { ...@@ -525,10 +525,10 @@ export default class AbstractEditBase extends Vue implements ControlInterface {
{ required: false, type: 'string', message: '用途 值不能为空', trigger: 'blur' }, { required: false, type: 'string', message: '用途 值不能为空', trigger: 'blur' },
], ],
membertype: [ membertype: [
{ type: 'number', message: '目标对象 值必须为数值类型', trigger: 'change' }, { type: 'string', message: '目标对象 值必须为字符串类型', trigger: 'change' },
{ type: 'number', message: '目标对象 值必须为数值类型', trigger: 'blur' }, { type: 'string', message: '目标对象 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'number', message: '目标对象 值不能为空', trigger: 'change' }, { required: false, type: 'string', message: '目标对象 值不能为空', trigger: 'change' },
{ required: false, type: 'number', message: '目标对象 值不能为空', trigger: 'blur' }, { required: false, type: 'string', message: '目标对象 值不能为空', trigger: 'blur' },
], ],
source: [ source: [
{ type: 'string', message: '来源 值必须为字符串类型', trigger: 'change' }, { type: 'string', message: '来源 值必须为字符串类型', trigger: 'change' },
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<row > <row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibizlist.abstractinfo_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="true" > <app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibizlist.abstractinfo_form.details.group1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="1" :isInfoGroupMode="true" >
<row> <row>
<i-col v-show="detailsModel.listname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }"> <i-col v-show="detailsModel.listname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='listname' :itemRules="this.rules.listname" class='' :caption="$t('entities.ibizlist.abstractinfo_form.details.listname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.listname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='listname' :itemRules="this.rules.listname" class='' :caption="$t('entities.ibizlist.abstractinfo_form.details.listname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.listname.error" :isEmptyCaption="false" labelPos="LEFT">
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<i-col v-show="detailsModel.membertype.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }"> <i-col v-show="detailsModel.membertype.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='membertype' :itemRules="this.rules.membertype" class='' :caption="$t('entities.ibizlist.abstractinfo_form.details.membertype')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.membertype.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='membertype' :itemRules="this.rules.membertype" class='' :caption="$t('entities.ibizlist.abstractinfo_form.details.membertype')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.membertype.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span name='membertype' :value="data.membertype" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span> <app-span name='membertype' :value="data.membertype" tag='List__MemberType' codelistType='STATIC' :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item> </app-form-item>
</i-col> </i-col>
...@@ -73,6 +73,108 @@ ...@@ -73,6 +73,108 @@
</row> </row>
</app-form-group> </app-form-group>
</i-col>
<i-col v-show="detailsModel.grouppanel1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.grouppanel1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibizlist.abstractinfo_form.details.grouppanel1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="1" :isInfoGroupMode="true" >
<row>
<i-col v-show="detailsModel.druipart1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-druipart
:formState="formState"
:isForbidLoad="this.data.srfuf === '0'"
paramItem='ibizlist'
:parentdata='{"srfparentdefname":"LISTID","srfparentdename":"LIST","SRFPARENTTYPE":"DER1N","srfparentmode":"DER1N_LISTACCOUNT_LIST_LISTID","SRFDER1NID":"DER1N_LISTACCOUNT_LIST_LISTID"}'
:parameters="[
{ pathName: 'accounts', parameterName: 'account' },
]"
:context="context"
:viewparams="viewparams"
:localContext ='{}'
:localParam ='{}'
parameterName='ibizlist'
parentName="IBizList"
refviewtype='DEGRIDVIEW9'
refreshitems=''
:ignorefieldvaluechange="ignorefieldvaluechange"
viewname='list-account-inner'
:data="JSON.stringify(this.data)"
@drdatasaved="drdatasaved($event)"
style=";overflow: auto;">
</app-form-druipart>
</i-col>
</row>
</app-form-group>
</i-col>
<i-col v-show="detailsModel.grouppanel2.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.grouppanel2.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibizlist.abstractinfo_form.details.grouppanel2')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="true" >
<row>
<i-col v-show="detailsModel.druipart2.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-druipart
:formState="formState"
:isForbidLoad="this.data.srfuf === '0'"
paramItem='ibizlist'
:parentdata='{"srfparentdefname":"LISTID","srfparentdename":"LIST","SRFPARENTTYPE":"DER1N","srfparentmode":"DER1N_LISTCONTACT_LIST_LISTID","SRFDER1NID":"DER1N_LISTCONTACT_LIST_LISTID"}'
:parameters="[
{ pathName: 'contacts', parameterName: 'contact' },
]"
:context="context"
:viewparams="viewparams"
:localContext ='{}'
:localParam ='{}'
parameterName='ibizlist'
parentName="IBizList"
refviewtype='DEGRIDVIEW9'
refreshitems=''
:ignorefieldvaluechange="ignorefieldvaluechange"
viewname='list-contact-inner'
:data="JSON.stringify(this.data)"
@drdatasaved="drdatasaved($event)"
style=";overflow: auto;">
</app-form-druipart>
</i-col>
</row>
</app-form-group>
</i-col>
<i-col v-show="detailsModel.grouppanel3.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.grouppanel3.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibizlist.abstractinfo_form.details.grouppanel3')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="true" >
<row>
<i-col v-show="detailsModel.druipart3.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-druipart
:formState="formState"
:isForbidLoad="this.data.srfuf === '0'"
paramItem='ibizlist'
:parentdata='{"srfparentdefname":"LISTID","srfparentdename":"LIST","SRFPARENTTYPE":"DER1N","srfparentmode":"DER1N_LISTLEAD_LIST_LISTID","SRFDER1NID":"DER1N_LISTLEAD_LIST_LISTID"}'
:parameters="[
{ pathName: 'leads', parameterName: 'lead' },
]"
:context="context"
:viewparams="viewparams"
:localContext ='{}'
:localParam ='{}'
parameterName='ibizlist'
parentName="IBizList"
refviewtype='DEGRIDVIEW'
refreshitems=''
:ignorefieldvaluechange="ignorefieldvaluechange"
viewname='list-lead-by-list'
:data="JSON.stringify(this.data)"
@drdatasaved="drdatasaved($event)"
style=";overflow: auto;">
</app-form-druipart>
</i-col>
</row>
</app-form-group>
</i-col> </i-col>
...@@ -499,10 +601,10 @@ export default class AbstractInfoBase extends Vue implements ControlInterface { ...@@ -499,10 +601,10 @@ export default class AbstractInfoBase extends Vue implements ControlInterface {
{ required: false, type: 'string', message: '用途 值不能为空', trigger: 'blur' }, { required: false, type: 'string', message: '用途 值不能为空', trigger: 'blur' },
], ],
membertype: [ membertype: [
{ type: 'number', message: '目标对象 值必须为数值类型', trigger: 'change' }, { type: 'string', message: '目标对象 值必须为字符串类型', trigger: 'change' },
{ type: 'number', message: '目标对象 值必须为数值类型', trigger: 'blur' }, { type: 'string', message: '目标对象 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'number', message: '目标对象 值不能为空', trigger: 'change' }, { required: false, type: 'string', message: '目标对象 值不能为空', trigger: 'change' },
{ required: false, type: 'number', message: '目标对象 值不能为空', trigger: 'blur' }, { required: false, type: 'string', message: '目标对象 值不能为空', trigger: 'blur' },
], ],
source: [ source: [
{ type: 'string', message: '来源 值必须为字符串类型', trigger: 'change' }, { type: 'string', message: '来源 值必须为字符串类型', trigger: 'change' },
...@@ -549,7 +651,19 @@ export default class AbstractInfoBase extends Vue implements ControlInterface { ...@@ -549,7 +651,19 @@ export default class AbstractInfoBase extends Vue implements ControlInterface {
* @memberof AbstractInfo * @memberof AbstractInfo
*/ */
public detailsModel: any = { public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '市场营销列表基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: 'entities.ibizlist.abstractinfo_form', extractMode: 'ITEM', details: [] } }) group1: new FormGroupPanelModel({ caption: '列表信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'entities.ibizlist.abstractinfo_form', extractMode: 'ITEM', details: [] } })
,
druipart1: new FormDRUIPartModel({ caption: '', detailType: 'DRUIPART', name: 'druipart1', visible: true, isShowCaption: true, form: this })
,
grouppanel1: new FormGroupPanelModel({ caption: '成员', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: false, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'entities.ibizlist.abstractinfo_form', extractMode: 'ITEM', details: [] } })
,
druipart2: new FormDRUIPartModel({ caption: '', detailType: 'DRUIPART', name: 'druipart2', visible: true, isShowCaption: true, form: this })
,
grouppanel2: new FormGroupPanelModel({ caption: '成员', detailType: 'GROUPPANEL', name: 'grouppanel2', visible: false, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'entities.ibizlist.abstractinfo_form', extractMode: 'ITEM', details: [] } })
,
druipart3: new FormDRUIPartModel({ caption: '', detailType: 'DRUIPART', name: 'druipart3', visible: true, isShowCaption: true, form: this })
,
grouppanel3: new FormGroupPanelModel({ caption: '成员', detailType: 'GROUPPANEL', name: 'grouppanel3', visible: false, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'entities.ibizlist.abstractinfo_form', extractMode: 'ITEM', details: [] } })
, ,
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this }) formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
, ,
...@@ -845,6 +959,36 @@ export default class AbstractInfoBase extends Vue implements ControlInterface { ...@@ -845,6 +959,36 @@ export default class AbstractInfoBase extends Vue implements ControlInterface {
if (Object.is(name, '') || Object.is(name, 'membertype')) {
let ret = false;
const _membertype = this.data.membertype;
if (this.$verify.testCond(_membertype, 'EQ', 'Account')) {
ret = true;
}
this.detailsModel.grouppanel1.setVisible(ret);
}
if (Object.is(name, '') || Object.is(name, 'membertype')) {
let ret = false;
const _membertype = this.data.membertype;
if (this.$verify.testCond(_membertype, 'EQ', 'Contact')) {
ret = true;
}
this.detailsModel.grouppanel2.setVisible(ret);
}
if (Object.is(name, '') || Object.is(name, 'membertype')) {
let ret = false;
const _membertype = this.data.membertype;
if (this.$verify.testCond(_membertype, 'EQ', 'Lead')) {
ret = true;
}
this.detailsModel.grouppanel3.setVisible(ret);
}
...@@ -1386,7 +1530,7 @@ export default class AbstractInfoBase extends Vue implements ControlInterface { ...@@ -1386,7 +1530,7 @@ export default class AbstractInfoBase extends Vue implements ControlInterface {
Object.assign(arg, data); Object.assign(arg, data);
Object.assign(arg, this.context); Object.assign(arg, this.context);
if (ifStateNext) { if (ifStateNext) {
this.drcounter = 0; this.drcounter = 3;
if(this.drcounter !== 0){ if(this.drcounter !== 0){
this.drsaveopt = opt; this.drsaveopt = opt;
this.formState.next({ type: 'beforesave', data: arg });//先通知关系界面保存 this.formState.next({ type: 'beforesave', data: arg });//先通知关系界面保存
......
...@@ -618,10 +618,10 @@ export default class QuickCreateBase extends Vue implements ControlInterface { ...@@ -618,10 +618,10 @@ export default class QuickCreateBase extends Vue implements ControlInterface {
{ required: true, type: 'string', message: '名称 值不能为空', trigger: 'blur' }, { required: true, type: 'string', message: '名称 值不能为空', trigger: 'blur' },
], ],
membertype: [ membertype: [
{ type: 'number', message: '目标对象 值必须为数值类型', trigger: 'change' }, { type: 'string', message: '目标对象 值必须为字符串类型', trigger: 'change' },
{ type: 'number', message: '目标对象 值必须为数值类型', trigger: 'blur' }, { type: 'string', message: '目标对象 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'number', message: '目标对象 值不能为空', trigger: 'change' }, { required: false, type: 'string', message: '目标对象 值不能为空', trigger: 'change' },
{ required: false, type: 'number', message: '目标对象 值不能为空', trigger: 'blur' }, { required: false, type: 'string', message: '目标对象 值不能为空', trigger: 'blur' },
], ],
type: [ type: [
{ type: 'number', message: '类型 值必须为数值类型', trigger: 'change' }, { type: 'number', message: '类型 值必须为数值类型', trigger: 'change' },
......
<template>
<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
<i-form>
<el-table v-if="isDisplay === true"
:default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"
@sort-change="onSortChange($event)"
:border="isDragendCol"
:highlight-current-row ="isSingleSelect"
:row-class-name="getRowClassName"
size="mini"
stripe
@row-click="rowClick($event)"
@select-all="selectAll($event)"
@select="select($event)"
@row-class-name="onRowClassName($event)"
@row-dblclick="rowDBLClick($event)"
ref='multipleTable' :data="items" :show-header="!isHideHeader">
<template slot="empty">
无数据
<span class="quick-toolbar">
</span>
</template>
<template v-if="!isSingleSelect">
<el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
</template>
<template v-if="getColumnState('entity2name')">
<el-table-column show-overflow-tooltip :prop="'entity2name'" :label="$t('entities.listcontact.inner_grid.columns.entity2name')" :width="100" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.listcontact.inner_grid.columns.entity2name')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.entity2name}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('emailaddress1')">
<el-table-column show-overflow-tooltip :prop="'emailaddress1'" :label="$t('entities.listcontact.inner_grid.columns.emailaddress1')" :width="100" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.listcontact.inner_grid.columns.emailaddress1')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.emailaddress1}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('parentcustomerid')">
<el-table-column show-overflow-tooltip :prop="'parentcustomerid'" :label="$t('entities.listcontact.inner_grid.columns.parentcustomerid')" :width="100" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.listcontact.inner_grid.columns.parentcustomerid')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.parentcustomerid}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('telephone1')">
<el-table-column show-overflow-tooltip :prop="'telephone1'" :label="$t('entities.listcontact.inner_grid.columns.telephone1')" :width="100" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.listcontact.inner_grid.columns.telephone1')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.telephone1}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('statecode')">
<el-table-column show-overflow-tooltip :prop="'statecode'" :label="$t('entities.listcontact.inner_grid.columns.statecode')" :width="100" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.listcontact.inner_grid.columns.statecode')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<template >
<codelist :value="row.statecode" tag='State' codelistType='STATIC' ></codelist>
</template>
</template>
</el-table-column>
</template>
<template v-if="adaptiveState">
<el-table-column></el-table-column>
</template>
</el-table>
</i-form>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils';
import ListContactService from '@/service/list-contact/list-contact-service';
import InnerService from './inner-grid-service';
import CodeListService from "@service/app/codelist-service";
import { FormItemModel } from '@/model/form-detail';
@Component({
components: {
}
})
export default class InnerBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Inner
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Inner
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Inner
*/
@Prop() public context: any;
/**
* 视图参数
*
* @type {*}
* @memberof Inner
*/
@Prop() public viewparams: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Inner
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Inner
*/
public getControlType(): string {
return 'GRID'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Inner
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {InnerService}
* @memberof Inner
*/
public service: InnerService = new InnerService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {ListContactService}
* @memberof Inner
*/
public appEntityService: ListContactService = new ListContactService({ $store: this.$store });
/**
* 关闭视图
*
* @param {any} args
* @memberof Inner
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Inner
*/
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();
}
})
}
}
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof Inner
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Inner
*/
public getDatas(): any[] {
return this.selections;
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Inner
*/
public getData(): any {
return this.selections[0];
}
/**
* 打开新建数据视图
*
* @type {any}
* @memberof Inner
*/
@Prop() public newdata: any;
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof Inner
*/
@Prop() public opendata: any;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof Inner
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 部件行为--update
*
* @type {string}
* @memberof Inner
*/
@Prop() public updateAction!: string;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof Inner
*/
@Prop() public fetchAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof Inner
*/
@Prop() public removeAction!: string;
/**
* 部件行为--load
*
* @type {string}
* @memberof Inner
*/
@Prop() public loadAction!: string;
/**
* 部件行为--loaddraft
*
* @type {string}
* @memberof Inner
*/
@Prop() public loaddraftAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof Inner
*/
@Prop() public createAction!: string;
/**
* 当前页
*
* @type {number}
* @memberof Inner
*/
public curPage: number = 1;
/**
* 数据
*
* @type {any[]}
* @memberof Inner
*/
public items: any[] = [];
/**
* 是否支持分页
*
* @type {boolean}
* @memberof Inner
*/
public isEnablePagingBar: boolean = false;
/**
* 是否禁用排序
*
* @type {boolean}
* @memberof Inner
*/
public isNoSort: boolean = false;
/**
* 排序方向
*
* @type {string}
* @memberof Inner
*/
public minorSortDir: string = '';
/**
* 排序字段
*
* @type {string}
* @memberof Inner
*/
public minorSortPSDEF: string = '';
/**
* 分页条数
*
* @type {number}
* @memberof Inner
*/
public limit: number = 50;
/**
* 是否显示标题
*
* @type {boolean}
* @memberof Inner
*/
public isHideHeader: boolean = false;
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof Inner
*/
@Prop({ default: false }) public isSelectFirstDefault!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof Inner
*/
@Prop() public isSingleSelect?: boolean;
/**
* 选中数据字符串
*
* @type {string}
* @memberof Inner
*/
@Prop() public selectedData?: string;
/**
* 选中值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Inner
*/
@Watch('selectedData')
public onValueChange(newVal: any, oldVal: any) {
this.selections = [];
if(this.selectedData){
const refs: any = this.$refs;
if (refs.multipleTable) {
refs.multipleTable.clearSelection();
JSON.parse(this.selectedData).forEach((selection:any)=>{
let selectedItem = this.items.find((item:any)=>{
return Object.is(item.srfkey, selection.srfkey);
});
if(selectedItem){
this.rowClick(selectedItem);
}
});
}
}
}
/**
* 表格行数据默认激活模式
* 0 不激活
* 1 单击激活
* 2 双击激活
*
* @type {(number | 0 | 1 | 2)}
* @memberof Inner
*/
@Prop({default: 2}) public gridRowActiveMode!: number;
/**
* 是否开启行编辑
*
* @type {boolean}
* @memberof Inner
*/
@Prop({default: false}) public isOpenEdit!: boolean;
/**
* 实际是否开启行编辑
*
* @type {boolean}
* @memberof Inner
*/
public actualIsOpenEdit: boolean = this.isOpenEdit;
/**
* 总条数
*
* @type {number}
* @memberof Inner
*/
public totalrow: number = 0;
/**
* 选中行数据
*
* @type {any[]}
* @memberof Inner
*/
public selections: any[] = [];
/**
* 拦截行选中
*
* @type {boolean}
* @memberof Inner
*/
public stopRowClick: boolean = false;
/**
* 表格是否显示
*
* @type {boolean}
* @memberof Inner
*/
public isDisplay:boolean = true;
/**
* 部件刷新
*
* @param {any[]} args
* @memberof Inner
*/
public refresh(args: any[]): void {
this.load();
}
/**
* 选项框列宽
*
* @type {number}
* @memberof Inner
*/
public checkboxColWidth: number = 35;
/**
* 是否允许拖动列宽
*
* @type {boolean}
* @memberof Inner
*/
public isDragendCol: boolean = false;
/**
* 所有列成员
*
* @type {any[]}
* @memberof Inner
*/
public allColumns: any[] = [
{
name: 'entity2name',
label: '联系人',
langtag: 'entities.listcontact.inner_grid.columns.entity2name',
show: true,
util: 'PX'
},
{
name: 'emailaddress1',
label: '电子邮件',
langtag: 'entities.listcontact.inner_grid.columns.emailaddress1',
show: true,
util: 'PX'
},
{
name: 'parentcustomerid',
label: '公司名称',
langtag: 'entities.listcontact.inner_grid.columns.parentcustomerid',
show: true,
util: 'PX'
},
{
name: 'telephone1',
label: '商务电话',
langtag: 'entities.listcontact.inner_grid.columns.telephone1',
show: true,
util: 'PX'
},
{
name: 'statecode',
label: '状态',
langtag: 'entities.listcontact.inner_grid.columns.statecode',
show: true,
util: 'PX'
},
]
/**
* 表格模型集合
*
* @type {*}
* @memberof Inner
*/
public gridItemsModel: any[] = [];
/**
* 获取表格行模型
*
* @type {*}
* @memberof Inner
*/
public getGridRowModel(){
return {
srfkey: new FormItemModel(),
}
}
/**
* 属性值规则
*
* @type {*}
* @memberof Inner
*/
public rules: any = {
srfkey: [
{ required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '关系标识 值不能为空', trigger: 'change' },
{ required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '关系标识 值不能为空', trigger: 'blur' },
],
}
/**
* 表格行编辑项校验
*
* @param {string} property 属性名
* @param {*} data 行数据
* @param {number} rowIndex 行索引
* @returns Promise<any>
*
* @memberof Inner
*/
public validate(property:string, data:any, rowIndex:number):Promise<any>{
return new Promise((resolve, reject) => {
this.$util.validateItem(property,data,this.rules).then(()=>{
this.gridItemsModel[rowIndex][property].setError(null);
resolve(true);
}).catch(({ errors, fields }) => {
this.gridItemsModel[rowIndex][property].setError(errors[0].message);
resolve(false);
});
});
}
/**
* 校验所有修改过的编辑项
*
* @returns Promise<any>
* @memberof Inner
*/
public async validateAll(){
let validateState = true;
let index = -1;
for(let item of this.items){
index++;
if(item.rowDataState === "create" || item.rowDataState === "update"){
for(let property of Object.keys(this.rules)){
if(!await this.validate(property,item,index)){
validateState = false;
}
}
}
}
return validateState;
}
/**
* 表格数据加载
*
* @param {*} [arg={}]
* @memberof Inner
*/
public load(opt: any = {}, pageReset: boolean = false): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: 'ListContactInner视图表格fetchAction参数未配置' });
return;
}
if(pageReset){
this.curPage = 1;
}
const arg: any = {...opt};
const page: any = {};
if (this.isEnablePagingBar) {
Object.assign(page, { page: this.curPage-1, size: this.limit });
}
// 设置排序
if (!this.isNoSort && !Object.is(this.minorSortDir, '') && !Object.is(this.minorSortPSDEF, '')) {
const sort: string = this.minorSortPSDEF+","+this.minorSortDir;
Object.assign(page, { sort: sort });
}
Object.assign(arg, page);
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
}
return;
}
const data: any = response.data;
this.totalrow = response.total;
this.items = JSON.parse(JSON.stringify(data));
// 清空selections,gridItemsModel
this.selections = [];
this.gridItemsModel = [];
this.items.forEach(()=>{this.gridItemsModel.push(this.getGridRowModel())});
this.$emit('load', this.items);
// 设置默认选中
let _this = this;
setTimeout(() => {
if(_this.isSelectFirstDefault){
_this.rowClick(_this.items[0]);
}
if(_this.selectedData){
const refs: any = _this.$refs;
if (refs.multipleTable) {
refs.multipleTable.clearSelection();
JSON.parse(_this.selectedData).forEach((selection:any)=>{
let selectedItem = _this.items.find((item:any)=>{
return Object.is(item.srfkey, selection.srfkey);
});
if(selectedItem){
_this.rowClick(selectedItem);
}
});
}
}
}, 300);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
});
}
/**
* 删除
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof Inner
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: 'ListContactInner视图表格removeAction参数未配置' });
return;
}
let _datas:any[] = [];
datas.forEach((record: any, index: number) => {
if (Object.is(record.srfuf, "0")) {
this.items.some((val: any, num: number) =>{
if(JSON.stringify(val) == JSON.stringify(record)){
this.items.splice(num,1);
this.gridItemsModel.splice(num,1);
return true;
}
});
}else{
_datas.push(datas[index]);
}
});
if (_datas.length === 0) {
return;
}
let dataInfo = '';
_datas.forEach((record: any, index: number) => {
let srfmajortext = record.relationshipsname;
if (index < 5) {
if (!Object.is(dataInfo, '')) {
dataInfo += '、';
}
dataInfo += srfmajortext;
} else {
return false;
}
});
if (_datas.length < 5) {
dataInfo = dataInfo + ' 共' + _datas.length + '条数据';
} else {
dataInfo = dataInfo + '...' + ' 共' + _datas.length + '条数据';
}
const removeData = () => {
let keys: any[] = [];
_datas.forEach((data: any) => {
keys.push(data.srfkey);
});
let _removeAction = keys.length > 1 ? 'removeBatch' : this.removeAction ;
let _keys = keys.length > 1 ? keys : keys[0] ;
const context:any = JSON.parse(JSON.stringify(this.context));
const post: Promise<any> = this.service.delete(_removeAction,Object.assign(context,{ listcontact: _keys }),Object.assign({ listcontact: _keys },{viewparams:this.viewparams}), this.showBusyIndicator);
return new Promise((resolve: any, reject: any) => {
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '删除数据失败,' + response.info });
return;
} else {
this.$Notice.success({ title: '', desc: '删除成功!' });
}
//删除items中已删除的项
console.log(this.items);
_datas.forEach((data: any) => {
this.items.some((item:any,index:number)=>{
if(Object.is(item.srfkey,data.srfkey)){
this.items.splice(index,1);
this.gridItemsModel.splice(index,1);
return true;
}
});
});
this.totalrow -= _datas.length;
this.$emit('remove', null);
this.selections = [];
resolve(response);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
});
});
}
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '');
this.$Modal.confirm({
title: '警告',
content: '确认要删除 ' + dataInfo + ',删除操作将不可恢复?',
onOk: () => {
removeData();
},
onCancel: () => { }
});
return removeData;
}
/**
* 批量添加
*
* @param {*} [arg={}]
* @memberof Inner
*/
public addBatch(arg: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: 'ListContactInner视图表格fetchAction参数未配置' });
return;
}
if(!arg){
arg = {};
}
console.error("批量添加未实现");
}
/**
* 数据导入
*
* @param {*} data
* @memberof Inner
*/
public importExcel(data:any ={}):void{
//导入excel
const importDataModel:any ={
}
if(Object.keys(importDataModel).length == 0){
this.$Notice.warning({ 'title': (this.$t("app.utilview.warning") as string), 'desc': (this.$t("app.utilview.info") as string) });
return;
}
const view:any ={
viewname: 'app-data-upload',
title: this.$t("app.utilview.importview"),
width: 900,
height: 700
}
let container: Subject<any> = this.$appmodal.openModal(view, JSON.parse(JSON.stringify(this.context)), importDataModel);
container.subscribe((result: any) => {
if(Object.is(result.ret,'OK')){
this.refresh(result.datas);
}
});
}
/**
* 数据导出
*
* @param {*} data
* @memberof Inner
*/
public exportExcel(data: any = {}): void {
// 导出Excel
const doExport = async (_data:any) => {
const tHeader: Array<any> = [];
const filterVal: Array<any> = [];
this.allColumns.forEach((item: any) => {
item.show && item.label ? tHeader.push(this.$t(item.langtag)) : "";
item.show && item.name ? filterVal.push(item.name) : "";
});
const data = await this.formatExcelData(filterVal, _data);
this.$export.exportExcel().then((excel:any)=>{
excel.export_json_to_excel({
header: tHeader, //表头 必填
data, //具体数据 必填
filename: "营销列表-联系人表", //非必填
autoWidth: true, //非必填
bookType: "xlsx" //非必填
});
});
};
const page: any = {};
// 设置page,size
if (Object.is(data.type, 'maxRowCount')) {
Object.assign(page, { page: 0, size: data.maxRowCount });
} else if (Object.is(data.type, 'activatedPage')) {
try {
doExport(JSON.parse(JSON.stringify(this.items)));
} catch (error) {
console.error(error);
}
return;
}
// 设置排序
if (!this.isNoSort && !Object.is(this.minorSortDir, '') && !Object.is(this.minorSortPSDEF, '')) {
const sort: string = this.minorSortPSDEF+","+this.minorSortDir;
Object.assign(page, { sort: sort });
}
const arg: any = {};
Object.assign(arg, page);
// 获取query,搜索表单,viewparams等父数据
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '数据导出失败,' + response.info });
return;
}
try {
doExport(JSON.parse(JSON.stringify(response.data)));
} catch (error) {
console.error(error);
}
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '', desc: '数据导出失败' });
});
}
/**
* 导出数据格式化
*
* @param {*} filterVal
* @param {*} jsonData
* @returns {[]}
* @memberof Inner
*/
public async formatExcelData(filterVal:any, jsonData:any) {
let codelistColumns:Array<any> = [
{
name: 'statecode',
srfkey: 'State',
codelistType : 'STATIC',
renderMode: 'other',
textSeparator: '、',
valueSeparator: ',',
},
];
let _this = this;
for (const codelist of codelistColumns) {
// 动态代码表处理
if (Object.is(codelist.codelistType, "DYNAMIC")) {
let items = await _this.codeListService.getItems(codelist.srfkey);
jsonData.forEach((row:any)=>{
row[codelist.name] = _this.getCodelistValue(items, row[codelist.name], codelist);
});
// 静态处理
} else if(Object.is(codelist.codelistType, "STATIC")){
let items = await _this.$store.getters.getCodeListItems(codelist.srfkey);
jsonData.forEach((row:any)=>{
row[codelist.name] = _this.getCodelistValue(items, row[codelist.name], codelist);
});
}
}
return jsonData.map((v:any) => filterVal.map((j:any) => v[j]))
}
/**
* 解析代码表和vlaue,设置items
*
* @public
* @param {any[]} items 代码表数据
* @param {*} value
* @returns {*}
* @memberof Inner
*/
public getCodelistValue(items: any[], value: any, codelist: any,){
if(!value){
return this.$t('codelist.'+codelist.srfkey+'.empty');
}
if (items) {
let result:any = [];
if(Object.is(codelist.renderMode,"number")){
items.map((_item: any, index: number)=>{
const nValue = parseInt((value as any), 10);
const codevalue = _item.value;
if((parseInt(codevalue, 10) & nValue) > 0){
result.push(_item);
}
});
} else if(Object.is(codelist.renderMode,"string")){
const arrayValue: Array<any> = (value as any).split(codelist.valueSeparator);
arrayValue.map((value: any, index: number) => {
result.push([]);
let values: any[] = Object.is(this.$util.typeOf(value), 'number') ? [value] : [...(value as any).split(codelist.valueSeparator)];
values.map((val:any ,num: number)=>{
const item = this.getItem(items, val, codelist);
if(item){
result[index].push(item);
}
});
});
} else {
let values: any[] = Object.is(this.$util.typeOf(value), 'number') ? [value] : [...(value as any).split(codelist.valueSeparator)];
values.map((value:any ,index: number)=>{
const item = this.getItem(items, value, codelist);
if(item){
result.push(item);
}
});
}
// 设置items
if(result.length != 0){
return result.join(codelist.valueSeparator);
}else{
return value;
}
}
}
/**
* 获取代码项
*
* @public
* @param {any[]} items
* @param {*} value
* @returns {*}
* @memberof Inner
*/
public getItem(items: any[], value: any, codelist: any): any {
const arr: Array<any> = items.filter(item => {return item.value == value});
if (arr.length !== 1) {
return undefined;
}
if(Object.is(codelist.codelistType,'STATIC')){
return this.$t('codelist.'+codelist.srfkey+'.'+arr[0].value);
}else{
return arr[0].text;
}
}
/**
* 生命周期
*
* @memberof Inner
*/
public created(): void {
this.afterCreated();
this.$acc.commandLocal(() => {
this.load()
}, 'all', 'LISTCONTACT');
}
/**
* 执行created后的逻辑
*
* @memberof Inner
*/
public afterCreated(){
this.setColState();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('load', action)) {
this.load(data);
}
if (Object.is('remove', action)) {
this.remove(data);
}
if (Object.is('save', action)) {
this.save(data);
}
});
}
}
/**
* vue 生命周期
*
* @memberof Inner
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Inner
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 获取选中行胡数据
*
* @returns {any[]}
* @memberof Inner
*/
public getSelection(): any[] {
return this.selections;
}
/**
* 行双击事件
*
* @param {*} $event
* @returns {void}
* @memberof Inner
*/
public rowDBLClick($event: any): void {
if (!$event || this.actualIsOpenEdit || Object.is(this.gridRowActiveMode,0)) {
return;
}
this.selections = [];
this.selections.push(JSON.parse(JSON.stringify($event)));
const refs: any = this.$refs;
if (refs.multipleTable) {
refs.multipleTable.clearSelection();
refs.multipleTable.toggleRowSelection($event);
}
this.$emit('rowdblclick', this.selections);
this.$emit('selectionchange', this.selections);
}
/**
* 复选框数据选中
*
* @param {*} $event
* @returns {void}
* @memberof Inner
*/
public select($event: any): void {
if (!$event) {
return;
}
this.selections = [];
this.selections = [...JSON.parse(JSON.stringify($event))];
this.$emit('selectionchange', this.selections);
}
/**
* 复选框数据全部选中
*
* @param {*} $event
* @memberof Inner
*/
public selectAll($event: any): void {
if (!$event) {
return;
}
this.selections = [];
this.selections = [...JSON.parse(JSON.stringify($event))];
this.$emit('selectionchange', this.selections);
}
/**
* 行单击选中
*
* @param {*} $event
* @returns {void}
* @memberof Inner
*/
public rowClick($event: any, ifAlways: boolean = false): void {
if (!ifAlways && (!$event || this.actualIsOpenEdit)) {
return;
}
if(this.stopRowClick) {
this.stopRowClick = false;
return;
}
if(this.isSingleSelect){
this.selections = [];
}
// 已选中则删除,没选中则添加
let selectIndex = this.selections.findIndex((item:any)=>{
return Object.is(item.listcontact,$event.listcontact);
});
if (Object.is(selectIndex,-1)){
this.selections.push(JSON.parse(JSON.stringify($event)));
} else {
this.selections.splice(selectIndex,1);
}
const refs: any = this.$refs;
if (refs.multipleTable) {
if(this.isSingleSelect){
refs.multipleTable.clearSelection();
refs.multipleTable.setCurrentRow($event);
}else{
refs.multipleTable.toggleRowSelection($event);
}
}
this.$emit('selectionchange', this.selections);
}
/**
* 页面变化
*
* @param {*} $event
* @returns {void}
* @memberof Inner
*/
public pageOnChange($event: any): void {
if (!$event) {
return;
}
if ($event === this.curPage) {
return;
}
this.curPage = $event;
this.load({});
}
/**
* 分页条数变化
*
* @param {*} $event
* @returns {void}
* @memberof Inner
*/
public onPageSizeChange($event: any): void {
if (!$event) {
return;
}
if ($event === this.limit) {
return;
}
this.limit = $event;
if (this.curPage === 1) {
this.load({});
}
}
/**
* 分页刷新
*
* @memberof Inner
*/
public pageRefresh(): void {
this.load({});
}
/**
* 排序变化
*
* @param {{ column: any, prop: any, order: any }} { column, prop, order }
* @memberof Inner
*/
public onSortChange({ column, prop, order }: { column: any, prop: any, order: any }): void {
const dir = Object.is(order, 'ascending') ? 'asc' : Object.is(order, 'descending') ? 'desc' : '';
if (Object.is(dir, this.minorSortDir) && Object.is(this.minorSortPSDEF, prop)) {
return;
}
this.minorSortDir = dir;
this.minorSortPSDEF = prop ? prop : '';
this.load({});
}
/**
* 表格行选中样式
*
* @param {{ row: any, rowIndex: any }} { row, rowIndex }
* @returns {string}
* @memberof Inner
*/
public onRowClassName({ row, rowIndex }: { row: any, rowIndex: any }): string {
const index = this.selections.findIndex((select: any) => Object.is(select.srfkey, row.srfkey));
return index !== -1 ? 'grid-row-select' : '';
}
/**
* 界面行为
*
* @param {*} row
* @param {*} tag
* @param {*} $event
* @memberof Inner
*/
public uiAction(row: any, tag: any, $event: any) {
$event.stopPropagation();
}
/**
* 设置列状态
*
* @memberof Inner
*/
public setColState() {
const _data: any = localStorage.getItem('listcontact_inner_grid');
if (_data) {
let columns = JSON.parse(_data);
columns.forEach((col: any) => {
let column = this.allColumns.find((item) => Object.is(col.name, item.name));
if (column) {
Object.assign(column, col);
}
});
}
}
/**
* 列变化
*
* @memberof Inner
*/
public onColChange() {
localStorage.setItem('listcontact_inner_grid', JSON.stringify(this.allColumns));
}
/**
* 获取列状态
*
* @param {string} name
* @returns {boolean}
* @memberof Inner
*/
public getColumnState(name: string): boolean {
let column = this.allColumns.find((col: any) =>
Object.is(name, col.name)
);
return column.show ? true : false;
}
/**
* 表格列是否自适应布局
*
* @readonly
* @type {boolean}
* @memberof Inner
*/
get adaptiveState(): boolean {
return !this.allColumns.find((column: any) => column.show && Object.is(column.util, 'STAR'));
}
/**
* 保存
*
* @param {*} $event
* @returns {Promise<any>}
* @memberof Inner
*/
public async save(args: any[], params?: any, $event?: any, xData?: any){
let _this = this;
if(!await this.validateAll()){
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
return [];
}
let successItems:any = [];
let errorItems:any = [];
let errorMessage:any = [];
for (const item of _this.items) {
try {
if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: '错误', desc: 'ListContactInner视图表格createAction参数未配置' });
}else{
Object.assign(item,{viewparams:this.viewparams});
let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
successItems.push(JSON.parse(JSON.stringify(response.data)));
}
}else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){
this.$Notice.error({ title: '错误', desc: 'ListContactInner视图表格updateAction参数未配置' });
}else{
Object.assign(item,{viewparams:this.viewparams});
if(item.listcontact){
Object.assign(this.context,{listcontact:item.listcontact});
}
let response = await this.service.add(this.updateAction,JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
successItems.push(JSON.parse(JSON.stringify(response.data)));
}
}
} catch (error) {
errorItems.push(JSON.parse(JSON.stringify(item)));
errorMessage.push(error);
}
}
this.$emit('save', successItems);
this.refresh([]);
if(errorItems.length === 0){
this.$Notice.success({ title: '', desc: '保存成功!' });
}else{
errorItems.forEach((item:any,index:number)=>{
this.$Notice.error({ title: '保存失败', desc: item.majorentityname+'保存失败!' });
console.error(errorMessage[index]);
});
}
return successItems;
}
/**
* 获取对应行class
*
* @param {*} $args row 行数据,rowIndex 行索引
* @returns {void}
* @memberof Inner
*/
public getRowClassName(args:{row: any,rowIndex: number}){
let isSelected = this.selections.some((item:any)=>{
return Object.is(item.listcontact,args.row.listcontact);
});
return isSelected ? "grid-selected-row" : "";
}
/**
* 新建默认值
* @param {*} row 行数据
* @memberof Inner
*/
public createDefault(row: any){
}
}
</script>
<style lang='less'>
@import './inner-grid.less';
</style>
\ No newline at end of file
/**
* Inner 部件模型
*
* @export
* @class InnerModel
*/
export default class InnerModel {
/**
* 是否是实体数据导出
*
* @returns {any[]}
* @memberof InnerGridMode
*/
public isDEExport: boolean = false;
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof InnerGridMode
*/
public getDataItems(): any[] {
if(this.isDEExport){
return [
]
}else{
return [
{
name: 'telephone1',
prop: 'telephone1',
dataType: 'PICKUPDATA',
},
{
name: 'entity2id',
prop: 'entity2id',
dataType: 'PICKUP',
},
{
name: 'statecode',
prop: 'statecode',
dataType: 'PICKUPDATA',
},
{
name: 'emailaddress1',
prop: 'emailaddress1',
dataType: 'PICKUPDATA',
},
{
name: 'entityid',
prop: 'entityid',
dataType: 'PICKUP',
},
{
name: 'parentcustomerid',
prop: 'parentcustomerid',
dataType: 'PICKUPDATA',
},
{
name: 'srfmajortext',
prop: 'relationshipsname',
dataType: 'TEXT',
},
{
name: 'srfdataaccaction',
prop: 'relationshipsid',
dataType: 'GUID',
},
{
name: 'srfkey',
prop: 'relationshipsid',
dataType: 'GUID',
},
{
name: 'entity2name',
prop: 'entity2name',
dataType: 'PICKUPTEXT',
},
{
name: 'listcontact',
prop: 'relationshipsid',
},
{
name:'size',
prop:'size'
},
{
name:'query',
prop:'query'
},
{
name:'page',
prop:'page'
},
{
name:'sort',
prop:'sort'
},
{
name:'srfparentdata',
prop:'srfparentdata'
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import ListContactService from '@/service/list-contact/list-contact-service';
import InnerModel from './inner-grid-model';
/**
* Inner 部件服务对象
*
* @export
* @class InnerService
*/
export default class InnerService extends ControlService {
/**
* 营销列表-联系人服务对象
*
* @type {ListContactService}
* @memberof InnerService
*/
public appEntityService: ListContactService = new ListContactService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof InnerService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of InnerService.
*
* @param {*} [opts={}]
* @memberof InnerService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new InnerModel();
}
/**
* 处理数据
*
* @public
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof InnerService
*/
public doItems(promise: Promise<any>, deKeyField: string, deName: string): Promise<any> {
return new Promise((resolve, reject) => {
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
data.forEach((item:any,index:number) =>{
item[deName] = item[deKeyField];
data[index] = item;
});
resolve(data);
} else {
reject([])
}
}).catch((response: any) => {
reject([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof InnerService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
return Promise.reject([])
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof InnerService
*/
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.Create(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof InnerService
*/
@Errorlog
public delete(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.Remove(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof InnerService
*/
@Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading);
}else{
result =_appEntityService.Update(Data,Context,isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 获取数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof InnerService
*/
@Errorlog
public get(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Get(Context,Data, isloading);
}
result.then((response) => {
//处理返回数据,补充判断标识
if(response.data){
Object.assign(response.data,{srfuf:0});
}
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof InnerService
*/
@Errorlog
public search(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.FetchDefault(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof InnerService
*/
@Errorlog
public loadDraft(action: string, context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
//处理返回数据,补充判断标识
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.relationshipsid = Util.createUUID();
}
this.handleResponse(action, response, true);
this.mergeDefaults(response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 合并配置的默认值
* @param {*}
* @memberof InnerService
*/
public mergeDefaults(response:any = {}){
if(response.data){
}
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public frontLogic(action:string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any)=>{
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
return Promise.reject({ status: 500, data: { title: '失败', message: '系统异常' } });
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
})
}
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import InnerBase from './inner-grid-base.vue';
@Component({
components: {
}
})
export default class Inner extends InnerBase {
}
</script>
\ No newline at end of file
...@@ -75,12 +75,6 @@ export default class MainModel { ...@@ -75,12 +75,6 @@ export default class MainModel {
name: 'listlead', name: 'listlead',
prop: 'relationshipsid', prop: 'relationshipsid',
}, },
{
name: 'n_entity2name_like',
prop: 'n_entity2name_like',
dataType: 'PICKUPTEXT',
},
{ {
name:'size', name:'size',
prop:'size' prop:'size'
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册