w_ljmail_manager_fx.srw 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. $PBExportHeader$w_ljmail_manager_fx.srw
  2. $PBExportComments$(协同)消息管理
  3. forward
  4. global type w_ljmail_manager_fx from w_publ_base_style
  5. end type
  6. type tv_1 from treeview within w_ljmail_manager_fx
  7. end type
  8. type dw_1 from u_dw_rbtnfilter within w_ljmail_manager_fx
  9. end type
  10. type uo_1 from uo_html_editor within w_ljmail_manager_fx
  11. end type
  12. type cbx_all from checkbox within w_ljmail_manager_fx
  13. end type
  14. end forward
  15. global type w_ljmail_manager_fx from w_publ_base_style
  16. integer width = 5015
  17. integer height = 2712
  18. string title = "消息管理"
  19. boolean maxbox = true
  20. boolean resizable = true
  21. long backcolor = 16777215
  22. string icon = "graphics\chain_link_128px.ico"
  23. tv_1 tv_1
  24. dw_1 dw_1
  25. uo_1 uo_1
  26. cbx_all cbx_all
  27. end type
  28. global w_ljmail_manager_fx w_ljmail_manager_fx
  29. forward prototypes
  30. public function integer wf_treeview ()
  31. public function integer wf_retrieve_list (long arg_boxid)
  32. end prototypes
  33. public function integer wf_treeview ();int rslt = 1
  34. // 清空treeview
  35. tv_1.SetRedraw(false)
  36. DO UNTIL tv_1.FindItem(RootTreeItem!, 0) = -1
  37. tv_1.DeleteItem(0)
  38. LOOP
  39. tv_1.SetRedraw(true)
  40. // 获取sys_ds_ljmailbox
  41. string arg_msg
  42. long i, row
  43. if (sys_ds_ljmailbox.RowCount() <= 0) then
  44. oleobject list, item
  45. list = FXAppCom.GetLjmailBox(app_token_fx, ref arg_msg)
  46. if (arg_msg <> '') then
  47. rslt = 0
  48. goto ext
  49. end if
  50. sys_ds_ljmailbox.Reset()
  51. for i = 1 to list.Count
  52. item = list.GetItem(i - 1)
  53. row = sys_ds_ljmailbox.InsertRow(0)
  54. sys_ds_ljmailbox.Object.boxid[row] = item.GetInt('boxid')
  55. sys_ds_ljmailbox.Object.boxname[row] = item.GetString('boxname')
  56. sys_ds_ljmailbox.Object.empid[row] = item.GetInt('empid')
  57. sys_ds_ljmailbox.Object.parentid[row] = item.GetInt('parentid')
  58. sys_ds_ljmailbox.Object.boxtype[row] = item.GetInt('boxtype')
  59. next
  60. sys_ds_ljmailbox.SetSort('boxtype,boxid')
  61. sys_ds_ljmailbox.Sort()
  62. end if
  63. // 构建treeview
  64. tv_1.SetRedraw(false)
  65. long ll_hand_root, ll_hand
  66. string boxname
  67. long boxid, boxtype, picIndex
  68. treeviewitem l_tvi
  69. ll_hand_root = tv_1.InsertItemLast(0,'我的邮箱',1)
  70. IF tv_1.GetItem(ll_hand_root, l_tvi) = 1 THEN
  71. l_tvi.Data = 0
  72. tv_1.SetItem(ll_hand_root, l_tvi)
  73. END IF
  74. for i = 1 to sys_ds_ljmailbox.RowCount()
  75. boxtype = sys_ds_ljmailbox.Object.boxtype[i]
  76. if (boxtype = 1 or boxtype = 2 or boxtype = 3 or boxtype = 4) then // 图片分别对应
  77. picIndex = boxtype + 1
  78. else
  79. picIndex = 1
  80. end if
  81. boxid = sys_ds_ljmailbox.Object.boxid[i]
  82. boxname = sys_ds_ljmailbox.Object.boxname[i]
  83. ll_hand = tv_1.InsertItemLast(ll_hand_root, boxname, picIndex)
  84. IF tv_1.GetItem(ll_hand, l_tvi) = 1 THEN
  85. l_tvi.Label = boxname
  86. l_tvi.Data = boxid
  87. tv_1.SetItem(ll_hand, l_tvi)
  88. END IF
  89. next
  90. tv_1.ExpandItem(ll_hand_root)
  91. tv_1.SetRedraw(true)
  92. ext:
  93. if (rslt = 0) then
  94. MessageBox('提示', '获取邮箱失败:' + arg_msg)
  95. end if
  96. return rslt
  97. end function
  98. public function integer wf_retrieve_list (long arg_boxid);int rslt = 1
  99. if IsNull(arg_boxid) then return 1
  100. dw_1.Reset()
  101. if (arg_boxid < 0) then return 1
  102. string arg_msg
  103. oleobject list, item
  104. list = FXAppCom.GetLjmailByBoxid(app_token_fx, arg_boxid, ref arg_msg)
  105. if (arg_msg <> '') then
  106. rslt = 0
  107. goto ext
  108. end if
  109. dw_1.SetRedraw(false)
  110. long i, row
  111. for i = 1 to list.Count
  112. item = list.GetItem(i - 1)
  113. row = dw_1.InsertRow(0)
  114. dw_1.Object.msgid[row] = item.GetInt('msgid')
  115. dw_1.Object.boxid[row] = item.GetInt('boxid')
  116. dw_1.Object.sendcomid[row] = item.GetInt('sendcomid')
  117. dw_1.Object.sendcomname[row] = item.GetString('sendcomname')
  118. dw_1.Object.sendempid[row] = item.GetInt('sendempid')
  119. dw_1.Object.sendempname[row] = item.GetString('sendempname')
  120. dw_1.Object.sendflag[row] = item.GetInt('sendflag')
  121. dw_1.Object.opemp[row] = item.GetString('opemp')
  122. if not IsNull(item.GetDateTime('opdate')) then
  123. dw_1.Object.opdate[row] = item.GetDateTime('opdate')
  124. end if
  125. dw_1.Object.modemp[row] = item.GetString('modemp')
  126. if not IsNull(item.GetDateTime('moddate')) then
  127. dw_1.Object.moddate[row] = item.GetDateTime('moddate')
  128. end if
  129. dw_1.Object.subject[row] = item.GetString('subject')
  130. dw_1.Object.htmlbody[row] = item.GetString('htmlbody')
  131. dw_1.Object.reltype[row] = item.GetInt('reltype')
  132. dw_1.Object.relid[row] = item.GetInt('relid')
  133. if not IsNull(item.GetDateTime('sendtime')) then
  134. dw_1.Object.sendtime[row] = item.GetDateTime('sendtime')
  135. end if
  136. dw_1.Object.ljmail[row] = item.GetString('ljmail')
  137. dw_1.Object.ifread[row] = item.GetInt('ifread')
  138. dw_1.Object.serialnum[row] = item.GetString('serialnum')
  139. dw_1.Object.subjectmin[row] = item.GetString('subjectmin')
  140. dw_1.Object.comname[row] = item.GetString('comname')
  141. next
  142. if (arg_boxid > 0) then
  143. long boxtype
  144. row = sys_ds_ljmailbox.Find('boxid = ' + string(arg_boxid), 1, sys_ds_ljmailbox.RowCount())
  145. if (row > 0) then
  146. boxtype = sys_ds_ljmailbox.Object.boxtype[row]
  147. if (boxtype = 1 or boxtype = 3) then // 收\已发
  148. dw_1.SetSort('sendtime desc')
  149. else // 待发(草稿)\废
  150. dw_1.SetSort('opdate desc')
  151. end if
  152. dw_1.Sort()
  153. end if
  154. else
  155. dw_1.SetSort('opdate desc')
  156. dw_1.Sort()
  157. end if
  158. dw_1.SetRedraw(true)
  159. if (dw_1.RowCount() > 0) then
  160. dw_1.post event RowFocusChanged(1)
  161. else
  162. uo_1.uf_sethtml('')
  163. end if
  164. ext:
  165. if (rslt = 0) then
  166. MessageBox('提示', '获取邮件列表失败:' + arg_msg)
  167. end if
  168. return rslt
  169. end function
  170. on w_ljmail_manager_fx.create
  171. int iCurrent
  172. call super::create
  173. this.tv_1=create tv_1
  174. this.dw_1=create dw_1
  175. this.uo_1=create uo_1
  176. this.cbx_all=create cbx_all
  177. iCurrent=UpperBound(this.Control)
  178. this.Control[iCurrent+1]=this.tv_1
  179. this.Control[iCurrent+2]=this.dw_1
  180. this.Control[iCurrent+3]=this.uo_1
  181. this.Control[iCurrent+4]=this.cbx_all
  182. end on
  183. on w_ljmail_manager_fx.destroy
  184. call super::destroy
  185. destroy(this.tv_1)
  186. destroy(this.dw_1)
  187. destroy(this.uo_1)
  188. destroy(this.cbx_all)
  189. end on
  190. event open;call super::open;// 获取邮箱,treeview
  191. if (wf_treeview() <> 1) then
  192. Close(this)
  193. return
  194. end if
  195. uo_1.uf_setreadonly( )
  196. end event
  197. event resize;call super::resize;dw_1.Width = this.workspacewidth( ) - dw_1.X
  198. uo_1.Width = this.workspacewidth( )
  199. uo_1.Height = this.workspaceheight( ) - uo_1.Y
  200. cb_exit.X = this.workspacewidth( ) - cb_exit.Width
  201. end event
  202. type cb_func from w_publ_base_style`cb_func within w_ljmail_manager_fx
  203. boolean visible = false
  204. boolean enabled = false
  205. string normalpicname = "setting.BMP"
  206. integer picsize = 16
  207. end type
  208. type cb_exit from w_publ_base_style`cb_exit within w_ljmail_manager_fx
  209. integer x = 2272
  210. end type
  211. type ln_bar from w_publ_base_style`ln_bar within w_ljmail_manager_fx
  212. end type
  213. type ln_bar2 from w_publ_base_style`ln_bar2 within w_ljmail_manager_fx
  214. long linecolor = 268435456
  215. integer beginy = 168
  216. integer endy = 168
  217. end type
  218. type r_bar from w_publ_base_style`r_bar within w_ljmail_manager_fx
  219. end type
  220. type tv_1 from treeview within w_ljmail_manager_fx
  221. integer y = 272
  222. integer width = 695
  223. integer height = 880
  224. integer taborder = 20
  225. boolean bringtotop = true
  226. integer textsize = -9
  227. integer weight = 400
  228. fontcharset fontcharset = gb2312charset!
  229. fontpitch fontpitch = variable!
  230. string facename = "宋体"
  231. long textcolor = 33554432
  232. borderstyle borderstyle = stylelowered!
  233. string picturename[] = {"email_one.bmp","email_rev.bmp","email_sent.bmp","email_send.bmp","email_dust.bmp"}
  234. long picturemaskcolor = 536870912
  235. long statepicturemaskcolor = 536870912
  236. end type
  237. event clicked;treeviewitem tvi
  238. long boxid
  239. if (this.GetItem(handle, tvi) = 1) then
  240. boxid = tvi.Data
  241. if (not IsNull(boxid) and boxid >= 0) then
  242. wf_retrieve_list(boxid)
  243. end if
  244. end if
  245. end event
  246. type dw_1 from u_dw_rbtnfilter within w_ljmail_manager_fx
  247. integer x = 695
  248. integer y = 272
  249. integer width = 4023
  250. integer height = 880
  251. integer taborder = 20
  252. boolean bringtotop = true
  253. string dataobject = "dw_ljmail_msg_list"
  254. boolean hscrollbar = true
  255. boolean vscrollbar = true
  256. boolean rbutton_setposition_use = true
  257. boolean titleclick_sort_use = true
  258. end type
  259. event clicked;call super::clicked;if (row > 0) then
  260. this.SetRow(row)
  261. this.SelectRow(0, false)
  262. this.SelectRow(row, true)
  263. end if
  264. end event
  265. event itemfocuschanged;call super::itemfocuschanged;if (row > 0) then
  266. this.SetRow(row)
  267. this.SelectRow(0, false)
  268. this.SelectRow(row, true)
  269. end if
  270. end event
  271. event rowfocuschanged;call super::rowfocuschanged;if IsNull(currentrow) then return
  272. if (currentrow <= 0) then return
  273. string html
  274. html = this.Object.htmlbody[currentrow]
  275. uo_1.uf_sethtml(html)
  276. end event
  277. event doubleclicked;call super::doubleclicked;if (row <= 0) then return
  278. long msgid
  279. msgid = this.Object.msgid[row]
  280. if not IsNull(msgid) then
  281. if (msgid > 0) then
  282. OpenWithParm(w_ljmail_msg_fx, msgid)
  283. end if
  284. end if
  285. end event
  286. type uo_1 from uo_html_editor within w_ljmail_manager_fx
  287. integer y = 1152
  288. integer width = 3291
  289. integer height = 1140
  290. integer taborder = 30
  291. boolean bringtotop = true
  292. end type
  293. on uo_1.destroy
  294. call uo_html_editor::destroy
  295. end on
  296. type cbx_all from checkbox within w_ljmail_manager_fx
  297. integer x = 722
  298. integer y = 192
  299. integer width = 251
  300. integer height = 60
  301. boolean bringtotop = true
  302. integer textsize = -9
  303. integer weight = 400
  304. fontcharset fontcharset = gb2312charset!
  305. fontpitch fontpitch = variable!
  306. string facename = "宋体"
  307. long textcolor = 33554432
  308. long backcolor = 16777215
  309. string text = "全选"
  310. end type