起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 385|回复: 18

【结贴】问个提醒功能的问题**

[复制链接]
发表于 2009-7-3 17:18:26 | 显示全部楼层 |阅读模式
你好,请问我在新做了一个功能,要用户在打开系统后就能调用这个功能,我知道在工作台中是可以添加进来的,但是是一个窗体,我希望能打开系统调用这个功能打开的是一个对话框,有点类似于任务提醒功能的,如何做到?
回复

使用道具 举报

发表于 2009-7-3 18:59:39 | 显示全部楼层
可以在工作台功能里运行runfunc,最后一个参数为true,表示以showmodal方式运行功能主窗体
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-6 09:23:17 | 显示全部楼层
工作台功能在建模工具的哪里?
回复 支持 反对

使用道具 举报

发表于 2009-7-6 09:44:04 | 显示全部楼层
在协同系统空间下。

您可以在studio中用“工作台”做关键字搜索一下
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-6 14:47:30 | 显示全部楼层
在工作台功能中没有找到runfunc,请问具体该如何操作,
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-6 14:55:00 | 显示全部楼层
上面提示的操作会将“工作台”和“日程”都以showmodal弹出显示,我现在需要的是只将我自己做的功能以showmodal显示就可以了
回复 支持 反对

使用道具 举报

发表于 2009-7-6 14:57:30 | 显示全部楼层
楼主,您是怎么做的?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-8 10:54:55 | 显示全部楼层
在标准风格窗体,红色字体部分是我修改的
procedure TSTANDARDSTYLEMAINFORM.UIRunFunc(AContext: TContext; const AUniqueID, AFuncURL, AParams: string; UseUI: Boolean; BeforeRunFunc: TFuncNotifyEvent; Modal: Boolean);
var
  lContext: TContext;
  S, lUID: string;
  lFunc: TFunc;
begin
  if Opr.IsSystemManager(TSystemCore.Operator.ID) then
  begin
    lUID := AUniqueID;
    if lUID = '' then
      lUID := TFuncManager.GetFuncUniqueID(TSystemCore.Operator.Context, AFuncURL, AParams);
      // TSystemCore.FuncManager.RunFunc(TSystemCore.Operator.Context, lUID, AFuncURL, AParams, BeforeRunFunc, true);

   TSystemCore.FuncManager.RunFunc(TSystemCore.Operator.Context, lUID, AFuncURL, AParams, BeforeRunFunc, Modal);
  end
  else begin
    if FDefaultPosition = nil then
      lContext := TSystemCore.FuncManager.FindRunFuncContext(AContext, AFuncURL)
    else
      lContext := TSystemCore.FuncManager.FindRunFuncContext(FDefaultPosition.Context, AFuncURL);

    if lContext = nil then
    begin
      if not TSystemCore.FuncManager.IsDefaultFunc(AFuncURL) then
      begin
        try
          S := BizSys.BizSystem.FileName2DisplayFileName(BizSys.BizSystem.URL2FileName(AFuncURL));
          S := SysUtils.Format('您没有运行此功能的权限:%s', [S]);
        except
          S := SysUtils.Format('功能不存在:%s', [AFuncURL]);
        end;
        raise Exception.Create(S);
      end;
      lContext := TContextUtils.GetDefaultOperatorPosition(AContext).Context;
    end;

    if (FDefaultPosition = nil) and
      StrUtils.AnsiMatchText(AFuncURL, TRTLConsts.PersonFuncs) then
      lContext := AContext.GetParentContext(BizSys.IL_PERSON);

    lUID := AUniqueID;
    if lUID = '' then
    begin
      // 暂时一个功能只能运行一份实例, 不同参数的功能,允许多份实例
      //lUID := TFuncManager.GetFuncUniqueID(lContext, AFuncURL, AParams);
      lUID := AFuncURL + '.MainForm.Run' + '|' + AParams;
    end;

    lFunc := TSystemCore.FuncManager.FindRunning(lUID);
    if lFunc <> nil then
      TSystemCore.FuncManager.ActivateFunc(lFunc)
    else
      //TSystemCore.FuncManager.RunFunc(lContext, lUID, AFuncURL, AParams, BeforeRunFunc, Modal);
    TSystemCore.FuncManager.RunFunc(lContext, lUID, AFuncURL, AParams, BeforeRunFunc, true);
  end;
end;
回复 支持 反对

使用道具 举报

发表于 2009-7-8 11:44:01 | 显示全部楼层
楼主,你改错地方了。这是系统的主窗体,不是工作台。工作台在协同系统业务空间里。

你的这个需求有种实现方法:
1、在“工作台”功能上,执行runfunc函数来启动一个功能,如:
var
  lFunc: TFunc;
begin
  lFunc := TSystemCore.FuncManager.Runfunc();
  try
  finally
    lFunc.Free;
  end;
end;

2、在工作台上,直接创建一个窗体,然后执行showmodal即可
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-8 14:08:15 | 显示全部楼层
可以实现了,不过如何判断这个岗位下的人员是否分配了该功能,如何做呢?还有能不能有用户自己判断需不需要弹出这样的功能窗体,可以设置么?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-19 05:17 , Processed in 0.040666 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表