123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- $PBExportHeader$w_mftree_add.srw
- forward
- global type w_mftree_add from w_publ_base
- end type
- type dw_1 from datawindow within w_mftree_add
- end type
- type cb_1 from uo_imflatbutton within w_mftree_add
- end type
- end forward
- global type w_mftree_add from w_publ_base
- integer width = 1785
- integer height = 893
- string title = "菜单权限树结点"
- boolean minbox = false
- windowtype windowtype = response!
- long backcolor = 134217750
- dw_1 dw_1
- cb_1 cb_1
- end type
- global w_mftree_add w_mftree_add
- type variables
- s_sys_func_parm s_sfp
- end variables
- on w_mftree_add.create
- int iCurrent
- call super::create
- this.dw_1=create dw_1
- this.cb_1=create cb_1
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.dw_1
- this.Control[iCurrent+2]=this.cb_1
- end on
- on w_mftree_add.destroy
- call super::destroy
- destroy(this.dw_1)
- destroy(this.cb_1)
- end on
- event open;call super::open;
- s_sfp = Message.PowerObjectParm
- datawindowchild dw_child
- datastore ds_modules
- long i, row
- ds_modules = create datastore
- //ds_modules.dataobject = 'ds_sys_module_kf'
- ds_modules.dataobject = 'ds_sys_module_ddd_new'
- IF dw_1.GetChild('moduleid', Ref dw_child) = 1 THEN
- dw_child.Reset()
- for i = 1 to ds_modules.RowCount()
- row = dw_child.InsertRow(0)
- dw_child.SetItem(row, 'moduleid', ds_modules.Object.moduleid[i])
- dw_child.SetItem(row, 'modulename', ds_modules.Object.modulename[i])
- next
- ELSE
- MessageBox('ERROR', '获取模块ChildDW失败!')
- END IF
- destroy ds_modules
- dw_1.InsertRow(0)
- IF s_sfp.opflag = 1 THEN //add brother
- dw_1.Object.funcid[1] = 0
- dw_1.Object.parentid[1] = s_sfp.sfunc.parentid
- dw_1.Object.mainid[1] = 0
- dw_1.Object.functype[1] = s_sfp.sfunc.functype
- dw_1.Object.if_use[1] = 1
- dw_1.Object.sortflag[1] = s_sfp.sfunc.sortflag +1
- dw_1.Object.moduleid[1] = s_sfp.sfunc.moduleid
- This.Title = This.Title+' add brother'
- ELSEIF s_sfp.opflag = 2 THEN //add son
- dw_1.Object.funcid[1] = 0
- dw_1.Object.parentid[1] = s_sfp.sfunc.funcid
- dw_1.Object.mainid[1] = 0
- dw_1.Object.functype[1] = s_sfp.sfunc.functype
- dw_1.Object.if_use[1] = 1
- dw_1.Object.sortflag[1] = 0
- dw_1.Object.moduleid[1] = s_sfp.sfunc.moduleid
- This.Title = This.Title+' add son'
- ELSEIF s_sfp.opflag = 3 THEN //edit
- dw_1.Object.funcid[1] = s_sfp.sfunc.funcid
- dw_1.Object.parentid[1] = s_sfp.sfunc.parentid
- dw_1.Object.mainid[1] = s_sfp.sfunc.mainid
- dw_1.Object.functype[1] = s_sfp.sfunc.functype
- dw_1.Object.treename[1] = s_sfp.sfunc.treename
- dw_1.Object.MenuName[1] = s_sfp.sfunc.MenuName
- dw_1.Object.if_use[1] = s_sfp.sfunc.if_use
- dw_1.Object.sortflag[1] = s_sfp.sfunc.sortflag
- dw_1.Object.versiontype[1] = s_sfp.sfunc.versiontype
- dw_1.Object.worktype[1] = s_sfp.sfunc.worktype
- dw_1.Object.moduleid[1] = s_sfp.sfunc.moduleid
- This.Title = This.Title+' edit'
- END IF
- s_sfp.opflag = 0 //返回的默认信息
- end event
- event close;call super::close;closewithreturn(this,s_sfp)
- end event
- type cb_func from w_publ_base`cb_func within w_mftree_add
- boolean visible = false
- end type
- type cb_exit from w_publ_base`cb_exit within w_mftree_add
- integer x = 1042
- integer y = 634
- end type
- type dw_1 from datawindow within w_mftree_add
- integer y = 32
- integer width = 1733
- integer height = 573
- integer taborder = 30
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_sys_funcpwr_add"
- boolean border = false
- boolean livescroll = true
- end type
- type cb_1 from uo_imflatbutton within w_mftree_add
- integer x = 424
- integer y = 634
- integer width = 304
- integer height = 99
- integer taborder = 20
- boolean bringtotop = true
- end type
- event clicked;call super::clicked;
- dw_1.accepttext()
- uo_sys_funcpwr uo_sfp
- long ls_rslt
- dw_1.object.treename[1]=trim(dw_1.object.treename[1])
- dw_1.object.menuname[1]=trim(dw_1.object.menuname[1])
- ls_rslt=uo_sfp.save( &
- dw_1.object.funcid[1],&
- dw_1.object.parentid[1],&
- dw_1.object.mainid[1],&
- dw_1.object.functype[1],&
- dw_1.object.treename[1],&
- dw_1.object.menuname[1],&
- dw_1.object.if_use[1], &
- dw_1.object.sortflag[1],&
- dw_1.object.versiontype[1],&
- dw_1.object.worktype[1],&
- dw_1.object.moduleid[1])
-
- if ls_rslt<>1 then
- messagebox('错误',uo_sfp.ins_msg,stopsign!,ok!)
- return
- end if
- s_sfp.sfunc.funcid =uo_sfp.ins_funcid
- s_sfp.sfunc.parentid=dw_1.object.parentid[1]
- s_sfp.sfunc.mainid =dw_1.object.mainid[1]
- s_sfp.sfunc.functype=dw_1.object.functype[1]
- s_sfp.sfunc.treename=dw_1.object.treename[1]
- s_sfp.sfunc.menuname=dw_1.object.menuname[1]
- s_sfp.sfunc.if_use =dw_1.object.if_use[1]
- s_sfp.sfunc.sortflag=dw_1.object.sortflag[1]
- s_sfp.sfunc.versiontype=dw_1.object.versiontype[1]
- s_sfp.sfunc.worktype=dw_1.object.worktype[1]
- s_sfp.sfunc.moduleid=dw_1.object.moduleid[1]
- s_sfp.opflag=1
- close(parent)
- end event
|