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

lab_qyk 发布系统代码

上级 9d1af3bf
......@@ -25,7 +25,7 @@
"file-saver": "^2.0.2",
"font-awesome": "^4.7.0",
"ibiz-gantt-elastic": "^1.0.12",
"ibiz-vue-lib": "^0.1.5",
"ibiz-vue-lib": "^0.1.6",
"interactjs": "^1.9.4",
"moment": "^2.24.0",
"path-to-regexp": "^6.1.0",
......
<template>
<div class="app-org-select">
<ibiz-select-tree :NodesData="NodesData" v-model="selectTreeValue" :multiple="false" @select="treeSelectChange"></ibiz-select-tree>
<ibiz-select-tree :NodesData="NodesData" v-model="selectTreeValue" :multiple="multiple" @select="treeSelectChange"></ibiz-select-tree>
</div>
</template>
<script lang = 'ts'>
......@@ -140,7 +140,23 @@ export default class AppOrgSelect extends Vue {
}
}else{
// 多选
if(this.fillMap && Object.keys(this.fillMap).length >0){
let tempArray:Array<any> = [];
Object.keys(this.fillMap).forEach((item:any) =>{
if(this.data && this.data[this.fillMap[item]]){
let tempDataArray:Array<any> = (this.data[this.fillMap[item]]).split(",");
tempDataArray.forEach((tempData:any,index:number) =>{
if(tempArray.length < tempDataArray.length){
let singleData:any ={[item]:tempData};
tempArray.push(singleData);
}else{
Object.assign(tempArray[index],{[item]:tempData});
}
})
}
})
this.selectTreeValue = JSON.stringify(tempArray);
}
}
}
......@@ -150,13 +166,22 @@ export default class AppOrgSelect extends Vue {
* @memberof AppOrgSelect
*/
public loadTreeData(requestUrl:string){
if(this.filter){
const result:any = this.$store.getters.getCopyData(this.filter);
if(result){
this.NodesData = result;
return;
}
}
Http.getInstance().get(requestUrl).then((res:any) =>{
if(!res.status && res.status !== 200){
console.error("加载数据失败");
return;
}
this.NodesData = res.data;
console.log(this.NodesData);
if(this.filter){
this.$store.commit('addOrgData', { srfkey: this.filter, orgData: res.data });
}
})
}
......@@ -168,7 +193,24 @@ export default class AppOrgSelect extends Vue {
public treeSelectChange($event:any){
// 多选
if(this.multiple){
if($event){
const tempValue:any = JSON.parse($event);
if(this.fillMap && Object.keys(this.fillMap).length >0){
Object.keys(this.fillMap).forEach((item:any) =>{
let tempResult:any ="";
tempValue.forEach((value:any,index:number) =>{
tempResult += index>0?`,${value[item]}`:`${value[item]}`;
})
this.emitValue(this.fillMap[item],tempResult);
})
}
}else{
if(this.fillMap && Object.keys(this.fillMap).length >0){
Object.keys(this.fillMap).forEach((item:any) =>{
this.emitValue(this.fillMap[item],null);
})
}
}
}else{
// 单选
if($event){
......
......@@ -89,3 +89,13 @@ export const getCopyData = (state: any) => (srfkey: string) => {
}
return copyData;
}
/**
* 获取单位数据
*
* @param state
*/
export const getOrgData = (state: any) => (srfkey: string) => {
let orgData = state.orgDataMap[srfkey];
return orgData;
}
\ No newline at end of file
......@@ -56,6 +56,7 @@ export const viewstate: any = {
viewdatachange: false,
refviews: [
'9e25d15d43ff644fa008c9cf7d063ac3',
'b59db4df07430a34645566a64d59244c',
],
},
{
......
......@@ -266,3 +266,15 @@ export const addCopyData = (state: any, args: {srfkey: string,copyData: any}) =>
state.copyDataMap[args.srfkey] = JSON.parse(JSON.stringify(args.copyData));
}
}
/**
* 添加单位数据
*
* @param state
* @param args
*/
export const addOrgData = (state: any, args: {srfkey: string,orgData: any}) => {
if(args && args.srfkey && args.orgData){
state.orgDataMap[args.srfkey] = JSON.parse(JSON.stringify(args.orgData));
}
}
\ No newline at end of file
......@@ -14,4 +14,5 @@ export const rootstate: any = {
zIndex: 300,
viewSplit: {},
copyDataMap:{},
orgDataMap:{},
}
\ No newline at end of file
......@@ -17,7 +17,26 @@
</i-col>
<i-col v-show="detailsModel.pdeptname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='pdeptname' :itemRules="this.rules.pdeptname" class='' :caption="$t('entities.ibzdepartment.main_form.details.pdeptname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.pdeptname.error" :isEmptyCaption="false" labelPos="LEFT">
<app-department-select :data="data" name="pdeptname" :value="data.pdeptname" :context="JSON.parse(JSON.stringify(context))" :fillMap="{id:'bcode','label':'shortname'}" filter="orgid" :multiple="true" style="" @select-change="onFormItemValueChange"></app-department-select>
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:itemParam='{ }'
:disabled="detailsModel.pdeptname.disabled"
name='pdeptname'
deMajorField='deptname'
deKeyField='ibzdepartment'
:service="service"
:acParams="{ serviceName: 'IBZDepartmentService', interfaceName: 'FetchDefault'}"
valueitem='pdeptid'
:value="data.pdeptname"
editortype=""
:pickupView="{ viewname: 'ibzdepartment-pickup-view', title: $t('entities.ibzdepartment.views.pickupview.title'), deResParameters: [{ pathName: 'ibzorganizations', parameterName: 'ibzorganization' }, ], parameters: [{ pathName: 'ibzdepartments', parameterName: 'ibzdepartment' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange">
</app-picker>
</app-form-item>
</i-col>
......
......@@ -89,6 +89,9 @@ export default class MainService extends ControlService {
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
if (Object.is(serviceName, 'IBZDepartmentService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.appEntityService.FetchDefault(JSON.parse(JSON.stringify(context)), data, isloading), 'deptid', 'ibzdepartment');
}
if (Object.is(serviceName, 'IBZOrganizationService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.ibzorganizationService.FetchDefault(JSON.parse(JSON.stringify(context)),data, isloading), 'orgid', 'ibzorganization');
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册