1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| --[[
| 编码: WMS-07-02
| 名称: 常量-删除前
| 作者:HAN
| 日期:2025-1-29
|
| 级别:固定 (说明本段代码在项目中不太会变化)
|
| 函数: BeforeDataObjDelete
|
| 功能:
| 不允许删除系统固有的常量
| 更改记录:
| V6.0 HAN 2023/9/6 -- lua.Error/lua.Debug 函数变化
| --]]
|
| json = require ("json")
| mobox = require ("OILua_JavelinExt")
| m3 = require("oi_base_mobox")
|
| function BeforeDataObjDelete ( strLuaDEID )
| local nRet, strRetInfo
| nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "C_SYS" )
| if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "[1] 获取当前编辑属性失败! "..strRetInfo ) end
| local obj_attrs = json.decode( strRetInfo )
| local cIsSys = obj_attrs[1].value -- 是否是系统固有常量
|
| if ( cIsSys == 'Y' or cIsSys == 'y') then lua.Warning( strLuaDEID, debug.getinfo(1), "抱歉,不能删除系统固有的常量!" ) end
| end
|
|