You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
3.1 KiB

var E=Object.defineProperty;var c=(o,t,i)=>t in o?E(o,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[t]=i;var a=(o,t,i)=>(c(o,typeof t!="symbol"?t+"":t,i),i);var _=(o,t,i)=>new Promise((u,e)=>{var r=p=>{try{m(i.next(p))}catch(l){e(l)}},s=p=>{try{m(i.throw(p))}catch(l){e(l)}},m=p=>p.done?u(p.value):Promise.resolve(p.value).then(r,s);m((i=i.apply(o,t)).next())});import{UAC as D}from"./UAC-8e255d47.js";import{Map as f}from"./Map-73575e6b.js";import{EntityMyPK as S,EntitiesMyPK as h}from"./EntityMyPK-e742fec8.js";import{G as F}from"./DataType-33901a1c.js";import{DeptEmpStations as K,DeptEmpStation as d}from"./DeptEmpStation-6b7abbad.js";import{Dept as w}from"./Dept-342c50de.js";import{CCBPMRunModel as N}from"./SystemConfig-b93c25b3.js";import{a1 as g}from"./index-f4658ae7.js";import"./Attrs-62391d6b.js";import"./EnumLab-3cbd0812.js";import"./Attr-d5feb8b8.js";import"./ParamUtils-cdc24dd6.js";import"./bignumber-cf158d26.js";import"./ParamsUtils-3cbc5822.js";import"./RefMethod-33a71db4.js";import"./SearchNormal-5c7fda42.js";import"./SearchFKEnum-31a3a609.js";import"./Glo-fda3f906.js";import"./EnMapExt-8e17025c.js";import"./Entities-6a72b013.js";import"./EntityTree-333c163f.js";import"./assign-481cba08.js";import"./_createAssigner-77c8874c.js";import"./BSEntity-840a884b.js";class n{}a(n,"FK_Dept","FK_Dept"),a(n,"FK_Emp","FK_Emp"),a(n,"OrgNo","OrgNo");class M extends S{constructor(t){super("TS.Port.DeptEmp"),t&&this.setPKVal(t)}get HisUAC(){const t=new D;return t.IsDelete=!0,t.IsUpdate=!0,t.IsInsert=!0,t}get EnMap(){const t=new f("Port_DeptEmp","\u7528\u6237\u90E8\u95E8");return t.CodeStruct="2",t.IsAutoGenerNo=!0,t.AddMyPK(),t.AddTBString(n.FK_Emp,null,"\u4EBA\u5458",!1,!1,0,50,100),t.AddTBString(n.FK_Dept,null,"\u90E8\u95E8",!0,!0,0,50,50),t.AddTBString("DeptName",null,"\u90E8\u95E8\u540D\u79F0",!0,!0,0,50,100),t.AddTBString("StationNo",null,"\u89D2\u8272\u7F16\u53F7",!0,!0,0,50,50,!0),t.SetPopGroupList("StationNo",F.srcStationTypes,F.srcStations,!0,"300px","500px","\u9009\u62E9\u89D2\u8272","icon-people"),g.CCBPMRunModel!=N.Single&&t.AddTBString("OrgNo",null,"\u7EC4\u7EC7\u7F16\u53F7",!1,!1,0,50,200),this._enMap=t,this._enMap}afterDelete(){return _(this,null,function*(){return yield new K().Delete("FK_Emp",this.FK_Emp,"FK_Dept",this.FK_Dept),!0})}beforeUpdateInsertAction(){return _(this,null,function*(){if(!this.DeptName){const e=new w(this.FK_Dept);e.No=this.FK_Dept,yield e.Retrieve(),this.DeptName=e.Name}const t=new K;if(yield t.Retrieve("FK_Emp",this.FK_Emp),!this.StationNo)return yield t.Delete(),!0;const i=this.StationNo.split(",").filter(e=>!!e);let u=",";for(let e=0;e<t.length;e++){const r=t[e];if(u+=r.FK_Station+",",this.StationNo.indexOf(r.FK_Station+",")==-1){const s=new d;s.MyPK=r.FK_Dept+"_"+r.FK_Emp+"_"+r.FK_Station,yield s.Delete()}}for(let e=0;e<i.length;e++){const r=i[e];if(u.indexOf(r+",")==-1){const s=new d;s.MyPK=this.FK_Dept+"_"+this.FK_Emp+"_"+r,s.FK_Dept=this.FK_Dept,s.FK_Emp=this.FK_Emp,s.FK_Station=r,yield s.Insert()}}return!0})}}class Z extends h{get GetNewEntity(){return new M}constructor(){super()}}export{M as DeptEmp,n as DeptEmpAttr,Z as DeptEmps};