zbcx_ckyc 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/README.md +3 -0
  2. package/package.json +90 -0
  3. package/src/plugins/app/com/CesiumTool.js +730 -0
  4. package/src/plugins/app/com/MapMethods.js +355 -0
  5. package/src/plugins/app/com/MapTool.vue +772 -0
  6. package/src/plugins/app/com/MenuRouter.vue +157 -0
  7. package/src/plugins/app/com/ParamsDes.vue +35 -0
  8. package/src/plugins/app/com/SelCoorSys.vue +235 -0
  9. package/src/plugins/app/com/WebProj4.js +32 -0
  10. package/src/plugins/app/com/measure.js +127 -0
  11. package/src/plugins/app/com/yx.js +238 -0
  12. package/src/plugins/app/modelmanagement/D3DrawGraph.js +708 -0
  13. package/src/plugins/app/modelmanagement/MineralGo.vue +241 -0
  14. package/src/plugins/app/modelmanagement/MineralModel.vue +1203 -0
  15. package/src/plugins/app/modelmanagement/ModelCloudmap.vue +69 -0
  16. package/src/plugins/app/modelmanagement/ModelMst.vue +60 -0
  17. package/src/plugins/app/modelmanagement/ModelSy.vue +173 -0
  18. package/src/plugins/app/modelmanagement/ModelTp.vue +51 -0
  19. package/src/plugins/app/modelmanagement/ModelUpload.vue +774 -0
  20. package/src/plugins/app/znycpjxt/Api.js +714 -0
  21. package/src/plugins/app/znycpjxt/Bf/AttFactory.js +25 -0
  22. package/src/plugins/app/znycpjxt/Bf/IAnomalyhandle.js +102 -0
  23. package/src/plugins/app/znycpjxt/Bf/IComposeanomaly.js +140 -0
  24. package/src/plugins/app/znycpjxt/Bf/IContinueanaly.js +138 -0
  25. package/src/plugins/app/znycpjxt/Bf/IContrastanaly.js +138 -0
  26. package/src/plugins/app/znycpjxt/Bf/ICustomNode.js +145 -0
  27. package/src/plugins/app/znycpjxt/Bf/IDerivanaly.js +139 -0
  28. package/src/plugins/app/znycpjxt/Bf/IFilterananly.js +141 -0
  29. package/src/plugins/app/znycpjxt/Bf/IMeananaly.js +137 -0
  30. package/src/plugins/app/znycpjxt/Bf/IModelNodeBase.js +135 -0
  31. package/src/plugins/app/znycpjxt/Bf/IMoveaverage.js +135 -0
  32. package/src/plugins/app/znycpjxt/Bf/IReducepole.js +141 -0
  33. package/src/plugins/app/znycpjxt/Bf/ISmoothanaly.js +135 -0
  34. package/src/plugins/app/znycpjxt/Bf/ITrendanaly.js +144 -0
  35. package/src/plugins/app/znycpjxt/Bf/IVector2grd.js +144 -0
  36. package/src/plugins/app/znycpjxt/Bf/IYcfj.js +84 -0
  37. package/src/plugins/app/znycpjxt/Bf/IYcxxjs.js +105 -0
  38. package/src/plugins/app/znycpjxt/Bf/IYgsbtq.js +112 -0
  39. package/src/plugins/app/znycpjxt/Bf/IYgtxrh.js +112 -0
  40. package/src/plugins/app/znycpjxt/Bf/Iinteranaly.js +135 -0
  41. package/src/plugins/app/znycpjxt/Bf/index.js +44 -0
  42. package/src/plugins/app/znycpjxt/Bf/input/InputData.js +21 -0
  43. package/src/plugins/app/znycpjxt/Bf/input/InputExcel.js +28 -0
  44. package/src/plugins/app/znycpjxt/Bf/input/InputKd.js +31 -0
  45. package/src/plugins/app/znycpjxt/Bqqd/Bqqd.vue +380 -0
  46. package/src/plugins/app/znycpjxt/Bqqd/BqqdMap.vue +1046 -0
  47. package/src/plugins/app/znycpjxt/Bqqd/SetOpacity.vue +101 -0
  48. package/src/plugins/app/znycpjxt/Bqqd/SjzxTree.vue +244 -0
  49. package/src/plugins/app/znycpjxt/Bqqd/YclsjjTree.vue +212 -0
  50. package/src/plugins/app/znycpjxt/Bqqd/api/DsjzxApi.js +37 -0
  51. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmx.vue +161 -0
  52. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxgl/CfgGloalParams.vue +92 -0
  53. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxgl/CfgNodeFlds.vue +102 -0
  54. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxgl/CfgNodeParams.vue +277 -0
  55. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxgl/Ckycmxgl.vue +303 -0
  56. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxgl/SetLabelParam.vue +68 -0
  57. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxgl/SetModelParam.vue +69 -0
  58. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxtab/Ckycmxtab.vue +107 -0
  59. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxtab/Dtzzylwl.vue +156 -0
  60. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxtab/Jjsjwl.vue +230 -0
  61. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxtab/Sjsl.vue +126 -0
  62. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxtab/Zcxlj.vue +128 -0
  63. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxtab/Zjq.vue +123 -0
  64. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxtab/Zstp.vue +271 -0
  65. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxtab/Zzylwl.vue +149 -0
  66. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxtab/coms/ParamsData.vue +323 -0
  67. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxtab/coms/ParamsDataNew.vue +336 -0
  68. package/src/plugins/app/znycpjxt/Ckycmx/Ckycmxtab/coms/QqtEcharts.vue +137 -0
  69. package/src/plugins/app/znycpjxt/Ckycmx/Ckycrwgl/Ckycrwgl.vue +290 -0
  70. package/src/plugins/app/znycpjxt/CusTools/CodeApi.js +83 -0
  71. package/src/plugins/app/znycpjxt/CusTools/CodeEditor/CodeEditor.md +36 -0
  72. package/src/plugins/app/znycpjxt/CusTools/CodeEditor/CodeEditor.vue +227 -0
  73. package/src/plugins/app/znycpjxt/CusTools/CodeEditor/PlugCodeEditor.vue +78 -0
  74. package/src/plugins/app/znycpjxt/CusTools/CodeEditor/demo/basic.png +0 -0
  75. package/src/plugins/app/znycpjxt/CusTools/CodeEditor/demo/basic.vue +27 -0
  76. package/src/plugins/app/znycpjxt/CusTools/DmbjForm.vue +76 -0
  77. package/src/plugins/app/znycpjxt/CusTools/DmfbForm.vue +351 -0
  78. package/src/plugins/app/znycpjxt/CusTools/GjForm.vue +206 -0
  79. package/src/plugins/app/znycpjxt/CusTools/Gjbjyfb.vue +200 -0
  80. package/src/plugins/app/znycpjxt/CusTools/ParamSelect.vue +222 -0
  81. package/src/plugins/app/znycpjxt/CusTools/ParamSelect2.vue +204 -0
  82. package/src/plugins/app/znycpjxt/CusTools/Zngjj.vue +105 -0
  83. package/src/plugins/app/znycpjxt/DataAnlyModel/DataAnlyModel.vue +134 -0
  84. package/src/plugins/app/znycpjxt/DataAnlyModel/Hgfx/HgfxEcharts.vue +98 -0
  85. package/src/plugins/app/znycpjxt/DataAnlyModel/Hgfx/HgfxTab.vue +73 -0
  86. package/src/plugins/app/znycpjxt/DataAnlyModel/Hgfx.vue +101 -0
  87. package/src/plugins/app/znycpjxt/DataAnlyModel/Jctj/JctjjgTab.vue +70 -0
  88. package/src/plugins/app/znycpjxt/DataAnlyModel/Jctj/Plzft.vue +154 -0
  89. package/src/plugins/app/znycpjxt/DataAnlyModel/Jctj.vue +118 -0
  90. package/src/plugins/app/znycpjxt/DataAnlyModel/Jlfx/JlfxImg.vue +80 -0
  91. package/src/plugins/app/znycpjxt/DataAnlyModel/Jlfx.vue +91 -0
  92. package/src/plugins/app/znycpjxt/DataAnlyModel/PCAfx/PcaTab.vue +161 -0
  93. package/src/plugins/app/znycpjxt/DataAnlyModel/PCAfx.vue +101 -0
  94. package/src/plugins/app/znycpjxt/DataAnlyModel/Qqt/QqtEcharts.vue +202 -0
  95. package/src/plugins/app/znycpjxt/DataAnlyModel/Qqt.vue +88 -0
  96. package/src/plugins/app/znycpjxt/DataAnlyModel/Xgxfx/XgxfxImg.vue +80 -0
  97. package/src/plugins/app/znycpjxt/DataAnlyModel/Xgxfx.vue +96 -0
  98. package/src/plugins/app/znycpjxt/DatasetMan/CreateDataset.vue +296 -0
  99. package/src/plugins/app/znycpjxt/DatasetMan/DatasetMan.vue +141 -0
  100. package/src/plugins/app/znycpjxt/DatasetMan/PreData.js +91 -0
  101. package/src/plugins/app/znycpjxt/DatasetMan/PreData.vue +545 -0
  102. package/src/plugins/app/znycpjxt/DatasetMan/PreDataApi.js +101 -0
  103. package/src/plugins/app/znycpjxt/DatasetMan/SelData.vue +186 -0
  104. package/src/plugins/app/znycpjxt/DatasetMan/SjTree.vue +130 -0
  105. package/src/plugins/app/znycpjxt/DatasetMan/Sjj.vue +478 -0
  106. package/src/plugins/app/znycpjxt/DatasetMan/Yclsjj.vue +445 -0
  107. package/src/plugins/app/znycpjxt/DatasetMan/Yssjj.vue +389 -0
  108. package/src/plugins/app/znycpjxt/DocList/DocList.vue +496 -0
  109. package/src/plugins/app/znycpjxt/DocList/unit/DocItem.vue +137 -0
  110. package/src/plugins/app/znycpjxt/ExceptHandlModel/AnomalyExtraction/Dchj.vue +107 -0
  111. package/src/plugins/app/znycpjxt/ExceptHandlModel/AnomalyExtraction/GeophysicalAnomaly.vue +115 -0
  112. package/src/plugins/app/znycpjxt/ExceptHandlModel/AnomalyExtraction/Jxyt.vue +98 -0
  113. package/src/plugins/app/znycpjxt/ExceptHandlModel/AnomalyExtraction/Lbjs.vue +127 -0
  114. package/src/plugins/app/znycpjxt/ExceptHandlModel/AnomalyExtraction/Pjcjs.vue +103 -0
  115. package/src/plugins/app/znycpjxt/ExceptHandlModel/AnomalyExtraction/Qdjs.vue +103 -0
  116. package/src/plugins/app/znycpjxt/ExceptHandlModel/ExceptHandlModel.vue +163 -0
  117. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/Cdjs.vue +102 -0
  118. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/Czfx.vue +163 -0
  119. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/GetFormData.vue +343 -0
  120. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/Hdpj.vue +100 -0
  121. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/Pjtd.vue +90 -0
  122. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/Qsfx.vue +109 -0
  123. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/ResultOnlyData.vue +121 -0
  124. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/ResultTable.vue +231 -0
  125. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/UniversalComputing.vue +139 -0
  126. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/Xgxsjs.vue +93 -0
  127. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/Xxsjs.vue +90 -0
  128. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/Ycfj.vue +116 -0
  129. package/src/plugins/app/znycpjxt/ExceptHandlModel/GeneralCalculation/Yhcl.vue +100 -0
  130. package/src/plugins/app/znycpjxt/ExceptHandlModel/extgeoanomalies/AnomalsGard.vue +91 -0
  131. package/src/plugins/app/znycpjxt/ExceptHandlModel/extgeoanomalies/Dqhxycht.vue +113 -0
  132. package/src/plugins/app/znycpjxt/ExceptHandlModel/extgeoanomalies/GeocAnomalies.vue +99 -0
  133. package/src/plugins/app/znycpjxt/ExceptHandlModel/extgeoanomalies/JgTableList.vue +203 -0
  134. package/src/plugins/app/znycpjxt/ExceptHandlModel/extgeoanomalies/Lszcl.vue +110 -0
  135. package/src/plugins/app/znycpjxt/ExceptHandlModel/extgeoanomalies/Ycxxjs.vue +116 -0
  136. package/src/plugins/app/znycpjxt/ExceptHandlModel/geoAnomalyExtraction/GeoAnomalyExtraction.vue +108 -0
  137. package/src/plugins/app/znycpjxt/ExceptHandlModel/geoAnomalyExtraction/coms/AttWeight.vue +99 -0
  138. package/src/plugins/app/znycpjxt/ExceptHandlModel/geoAnomalyExtraction/coms/Ckdctq.vue +98 -0
  139. package/src/plugins/app/znycpjxt/ExceptHandlModel/geoAnomalyExtraction/coms/LeftForm.vue +266 -0
  140. package/src/plugins/app/znycpjxt/ExceptHandlModel/ygyctq/Ygsbtq.vue +150 -0
  141. package/src/plugins/app/znycpjxt/ExceptHandlModel/ygyctq/Ygtxrh.vue +107 -0
  142. package/src/plugins/app/znycpjxt/ExceptHandlModel/ygyctq/ygyctq.vue +98 -0
  143. package/src/plugins/app/znycpjxt/Index/DataCard.vue +45 -0
  144. package/src/plugins/app/znycpjxt/Index/Index.vue +123 -0
  145. package/src/plugins/app/znycpjxt/Rzgl/Rzgl.vue +156 -0
  146. package/src/plugins/app/znycpjxt/coms/CmapColor.vue +70 -0
  147. package/src/plugins/app/znycpjxt/coms/CustomFileView.vue +343 -0
  148. package/src/plugins/app/znycpjxt/coms/CustomForm.vue +220 -0
  149. package/src/plugins/app/znycpjxt/coms/GrdView.vue +355 -0
  150. package/src/plugins/app/znycpjxt/coms/LeftForm.vue +195 -0
  151. package/src/plugins/app/znycpjxt/coms/MakeData.js +472 -0
  152. package/src/plugins/app/znycpjxt/coms/PreView.js +55 -0
  153. package/src/plugins/app/znycpjxt/coms/RightContent.vue +71 -0
  154. package/src/plugins/app/znycpjxt/coms/TableEarth.vue +259 -0
  155. package/src/plugins/app/znycpjxt/intellPred/ModelList.vue +200 -0
  156. package/src/plugins/app/znycpjxt/intellPred/coms/D3DrawGraph.js +634 -0
  157. package/src/plugins/app/znycpjxt/intellPred/coms/MineralGo.vue +249 -0
  158. package/src/plugins/app/znycpjxt/intellPred/coms/ModelCard.vue +298 -0
  159. package/src/plugins/app/znycpjxt/intellPred/coms/ModelEdit.vue +292 -0
  160. package/src/plugins/app/znycpjxt/intellPred/coms/ModelSpecif.vue +46 -0
  161. package/src/plugins/app/znycpjxt/intellPred/intellPred.vue +71 -0
  162. package/src/plugins/bf/BfApi.js +92 -0
  163. package/src/plugins/bf/BfColAdd.vue +78 -0
  164. package/src/plugins/bf/BfColEdit.vue +68 -0
  165. package/src/plugins/bf/BfColFilter.vue +112 -0
  166. package/src/plugins/bf/BfDataGroup.vue +80 -0
  167. package/src/plugins/bf/BfDataPreview.vue +118 -0
  168. package/src/plugins/bf/BfDataStat.vue +81 -0
  169. package/src/plugins/bf/BfDuplicateDel.vue +82 -0
  170. package/src/plugins/bf/BfProcCall.vue +82 -0
  171. package/src/plugins/bf/BfRunHis.vue +289 -0
  172. package/src/plugins/bf/BfRunParams.vue +94 -0
  173. package/src/plugins/bf/BfSaveFlow.vue +186 -0
  174. package/src/plugins/bf/BfSelFlow.vue +123 -0
  175. package/src/plugins/bf/BfTabCombine.vue +127 -0
  176. package/src/plugins/bf/BfTabJoin.vue +108 -0
  177. package/src/plugins/bf/BfTabMerge.vue +68 -0
  178. package/src/plugins/bf/BfTabReader.vue +126 -0
  179. package/src/plugins/bf/BfValFormat.vue +68 -0
  180. package/src/plugins/bf/BfValNumber.vue +68 -0
  181. package/src/plugins/bf/BfValProc.vue +78 -0
  182. package/src/plugins/bf/BfValSort.vue +78 -0
  183. package/src/plugins/bf/BiFlow.vue +1177 -0
  184. package/src/plugins/bf/IBfPlug.js +205 -0
  185. package/src/plugins/bf/coms/ColAdd.vue +75 -0
  186. package/src/plugins/bf/coms/ColEdit.vue +52 -0
  187. package/src/plugins/bf/coms/ColList.vue +91 -0
  188. package/src/plugins/bf/coms/DataGroup.vue +90 -0
  189. package/src/plugins/bf/coms/DataStat.vue +67 -0
  190. package/src/plugins/bf/coms/EditTable.vue +161 -0
  191. package/src/plugins/bf/coms/NodeTree.vue +105 -0
  192. package/src/plugins/bf/coms/PlugCmd.vue +95 -0
  193. package/src/plugins/bf/coms/RunParams.vue +68 -0
  194. package/src/plugins/bf/coms/TabCombine.vue +60 -0
  195. package/src/plugins/bf/coms/TabJoin.vue +69 -0
  196. package/src/plugins/bf/coms/ValFormat.vue +53 -0
  197. package/src/plugins/bf/coms/ValProc.vue +77 -0
  198. package/src/plugins/bf/coms/ValSort.vue +89 -0
  199. package/src/plugins/bf/parts/Icon.vue +105 -0
  200. package/src/plugins/bf/parts/Rect.vue +98 -0
  201. package/src/plugins/bf/parts/index.js +11 -0
  202. package/src/plugins/cxMixin/IAttBase.js +78 -0
  203. package/src/plugins/cxMixin/IAttDlg.js +45 -0
  204. package/src/plugins/cxMixin/IAttProc.js +98 -0
  205. package/src/plugins/cxMixin/IComBase.js +42 -0
  206. package/src/plugins/cxMixin/IContextMenu.js +74 -0
  207. package/src/plugins/cxMixin/IDataAcce.js +1106 -0
  208. package/src/plugins/cxMixin/IDataList.js +775 -0
  209. package/src/plugins/cxMixin/IDataMan.js +1670 -0
  210. package/src/plugins/cxMixin/IDataMan2.js +2561 -0
  211. package/src/plugins/cxMixin/IDataProc.js +379 -0
  212. package/src/plugins/cxMixin/IDatagrid.js +234 -0
  213. package/src/plugins/cxMixin/IEditableDg.js +477 -0
  214. package/src/plugins/cxMixin/IExpBase.js +51 -0
  215. package/src/plugins/cxMixin/IFormBase.js +29 -0
  216. package/src/plugins/cxMixin/IGridBpm.js +732 -0
  217. package/src/plugins/cxMixin/IGridData.js +109 -0
  218. package/src/plugins/cxMixin/IOperMore.js +323 -0
  219. package/src/plugins/cxMixin/IPlugBase.js +341 -0
  220. package/src/plugins/cxMixin/ISendCode.js +86 -0
  221. package/src/plugins/cxMixin/ISinglePage.js +112 -0
  222. package/src/plugins/cxMixin/ITags.js +81 -0
  223. package/src/plugins/cxe/CxeMap.vue +61 -0
  224. package/src/plugins/home/HeadNav.vue +194 -0
  225. package/src/plugins/home/Home.vue +59 -0
  226. package/src/plugins/home/HomePage.vue +237 -0
  227. package/src/plugins/home/Login.vue +139 -0
  228. package/src/plugins/zbcxCesium/coms/GraDrawBarWgt.vue +176 -0
  229. package/src/plugins/zbcxCesium/coms/baseMapSwitch/BaseMap.scss +42 -0
  230. package/src/plugins/zbcxCesium/coms/baseMapSwitch/BaseMap.vue +59 -0
  231. package/src/plugins/zbcxCesium/coms/dataPreview/DataPreview.vue +526 -0
  232. package/src/plugins/zbcxCesium/coms/dataPreview/DataPreviewPlug.vue +79 -0
  233. package/src/plugins/zbcxCesium/coms/dataPreview/ReadShpFile.js +42 -0
  234. package/src/plugins/zbcxCesium/coms/legend/Legend.vue +78 -0
  235. package/src/plugins/zbcxCesium/coms/popup/dialog-left-bg.png +0 -0
  236. package/src/plugins/zbcxCesium/coms/popup/index.js +88 -0
  237. package/src/plugins/zbcxCesium/coms/popup/index.vue +93 -0
  238. package/src/plugins/zbcxCesium/pub/LoadGeojson.js +44 -0
  239. package/src/plugins/zbcxCesium/pub/LoadModel.js +128 -0
  240. package/src/plugins/zbcxCesium/pub/LoadOgc.js +226 -0
  241. package/src/plugins/zbcxCesium/pub/Opacity.vue +139 -0
  242. package/src/plugins/zbcxCesium/pub/PubCxe.js +97 -0
  243. package/src/plugins/zbcxCesium/pub/SceneSet.vue +178 -0
  244. package/src/plugins/zbcxCesium/pub/ShowEffect.vue +216 -0
  245. package/src/plugins/zbcxCesium/pub/TMeasure.vue +122 -0
  246. package/src/plugins/zbcxCesium/pub/ToDefView3.vue +109 -0
  247. package/src/plugins/zbcxCesium/pub/getWmsGetCapabilities.js +127 -0
  248. package/src/plugins/zbcxCesium/utils/ShpToGeoJson.js +24 -0
  249. package/src/plugins/zbcxCesium/utils/WebProj4.js +32 -0
@@ -0,0 +1,1670 @@
1
+ /**
2
+ * 修改记录:
3
+ * 20-07-18 张发勇 增加一个函数 setAttOper(operCol),用于派生类自定义属性相关的操作按钮,简化派生类的代码
4
+ * 20-08-04 张发勇 增加一个函数 initAtt(att),用于输入属性之前,在派生类初始化属性(特殊情况下修改字段值)
5
+ * 21-02-19 张发勇 增加 onEditRow, 响应 event: edit-row
6
+ * 21-02-24 张发勇 增加 maxColWidth = 275, fontSize = 14, padding = 15 便于派生类修改
7
+ * 21-04-04 张发勇 增加函数 operView, operEdit, operDel 便于定制
8
+ * 21-06-09 张发勇 去掉前端直接传递表达式给后端,增加参数 sqlCfg, 支持 query, queryUnion
9
+ * 21-11-04 张发勇 去掉了 __update(), 增加了 getCur()
10
+ * 22-05-20 张发勇 升级到 element-plus
11
+ * 删除 useOperCols
12
+ * 删除 usePage
13
+ * selections -> selection
14
+ * page-change -> page-chang / pagesize-change
15
+ * onClickRow -> onRowClick
16
+ * onRowDblClick -> onRowDblClick
17
+ * onSelectionChange -> onSelectionChange
18
+ * onButtonClick -> onButtonClick
19
+ * onPageChange -> onPageChange
20
+ * 22-06-11 张发勇 js -> vue
21
+ * 23-05-31 张 清 放开init方法中operCols、cols空数组声明,解决多次调用init时保留上次的数据
22
+ * 23-07-16 张发勇 增加函数,exportData()-根据当前的查询条件去导出的数据,getDispCols()-,取当前显示的列名
23
+ * 23-07-31 张发勇 _upd()函数,增加数据修改标记,否则可输入的数据没有修改,保存按钮不可点击
24
+ * 23-08-12 张发勇 sqlexp.querPara()修改了参数,去掉major,minor
25
+ * 23-08-17 张清 更新注释,修改自动计算的默认参数,解决表头多行显示问题
26
+ * 24-04-23 张发勇 修改列排序方式,对于使用排序的列,同时点击排序进行数据请求的,必须把sortable = custom,否则使用显示文本排序
27
+ */
28
+
29
+ /**
30
+ * cx.mixin.IDataMan
31
+ * 混淆类 - 数据管理(基于DataGrid)
32
+ *
33
+ * @module cx.mixin.IDataMan
34
+ * @memberof cx.mixin
35
+ *
36
+ * @property {Number} major 实体主类型
37
+ * @property {Number} minor 实体子类型
38
+ * @property {String} [tabName] 表名,地图服务配置fld时构造字段对象,tabName 和 major,minor 至少要有一个
39
+ * @property {Array} [flds = null] 要创建的的字段对象序列,没传入该属性时,就是用major和minor对应表的字段数据
40
+ * @property {Boolean} [editable = false] 是否可编辑
41
+ * @property {Boolean} [useExp = true] 是否启用属性查询条件输入
42
+ * @property {Boolean} [useExpMore = true] 是否启用属性查询条件输入(More)
43
+ * @property {Boolean} [noExpDispAll = false] 没有查询条件显示所有数据
44
+ * @property {Array.<String>} [expRange] 条件输入里面用于输入范围的列列表
45
+ * @property {Array.<String>} [expExclude] 条件输入里面排除的列列表
46
+ * @property {cx.SqlEx} [fixedExp = null] 固定条件(任何时候都加上的条件)
47
+ * @property {cx.SqlEx} [defExp = null] 默认条件(有自定义条件之后即删除)
48
+ * @property {Object} [unionQuery = null] 联合查询参数
49
+ * @property {String} [unionQuery.mainAlias] 主表别名(例如: "a")
50
+ * @property {Number} [retAtt = 0] 插入/修改是否返回数据
51
+ *
52
+ * @property {Boolean} [sortable = true] 是否启用列排序(列名边上的排序箭头,会影响到宽度计算)
53
+ * @property {Number} [maxColWidth = 275] 最大列宽(dynaWidth=true时用于计算列宽)
54
+ * @property {Number} [fontSize = 14] 默认字体大小(dynaWidth=true时用于计算列宽)
55
+ * @property {Number} [padding = 20] padding值(dynaWidth=true时用于计算列宽)
56
+ * @property {Boolean} [dynaWidth = true] 动态计算列宽,根据数据内容计算宽度,覆盖字段设置宽度
57
+ *
58
+ * @property {Object} entity 实体对象
59
+ * @property {cx.AttBase} attObj 属性对象
60
+ * @property {Boolean} ready 是否初始化完成,尤其attObj是异步创建,必须ready后使用
61
+ * @property {Array} expFlds 条件表达式字段列表
62
+ * @property {Object} attExp 条件表达式对象
63
+ * @property {String} orderby 排序,asc(升序) desc(降序)
64
+ * @property {Object} queryPara SQL查询参数
65
+ * @property {Array} list 数据
66
+ * @property {Array} opers 操作列表-便于计算各种操作的enable, show
67
+ * @property {Object} selected 当前选中的行
68
+ * @property {Array.<Object>} selection 复选框选中的全部行
69
+ * @property {Object} dg DataGrid对象
70
+ * @property {Object} sqlCfg SQL 配置
71
+ * @property {String} sqlCfg.key sqlexp 表的 name
72
+ * @property {String} sqlCfg.vals 传递给 sqlexp 的值
73
+ * @property {String} sqlCfg.orderby 排序信息
74
+ */
75
+
76
+ export default
77
+ {
78
+ data()
79
+ {
80
+ return {
81
+ major: 0,
82
+ minor: 0,
83
+ tabName: '',
84
+ flds: null,
85
+ editable: false,
86
+ useExp: true,
87
+ useExpMore: true,
88
+ noExpDispAll: false,
89
+ expRange: null,
90
+ expExclude: null,
91
+ fixedExp: null,
92
+ defExp: null,
93
+ unionQuery: null,
94
+ retAtt: 0,
95
+ sortable: true,
96
+ maxColWidth: 275,
97
+ fontSize: 14,
98
+ padding: 20,
99
+ dynaWidth: true,
100
+ sqlCfg: { key: '', vals: '', orderby: '' },
101
+ entity: null,
102
+ attObj: null,
103
+ expFlds: [],
104
+ attExp: null,
105
+ orderby: '',
106
+ queryPara: {},
107
+ list: [],
108
+ opers: [],
109
+ selected: null,
110
+ selection: [],
111
+ dg:
112
+ {
113
+ pages: true, // 是否使用分页
114
+ table:
115
+ {
116
+ elAtts:
117
+ {
118
+ border: true, // 是否带有纵向边框
119
+ stripe: true, // 是否为斑马纹 table
120
+ showSummary: false, // 是否在表尾显示合计行
121
+ 'row-style': ({ row, rowIndex }) => this.onRowStyle({ row, rowIndex }), // 行的 style 的回调方法,也可以使用一个固定的 Object 为所有行设置一样的 Style。
122
+ 'cell-style': ({ row, column, rowIndex, columnIndex }) => this.onCellStyle({ row, column, rowIndex, columnIndex }) // 单元格的 style 的回调方法,也可以使用一个固定的 Object 为所有单元格设置一样的 Style。
123
+ },
124
+ fitWidth: true, // 宽度自适应
125
+ multiple: false, // 是否支持多选
126
+ selectOnClick: true, // 点击某一行时会触发select选择事件,如果multiple多选模式会更新复选框的状态
127
+ operFix: 'right', // 操作列固定右边
128
+ list: [], // 数据列表
129
+ cols: [], // 列信息
130
+ operCols: [] // 操作列信息
131
+ },
132
+ page:
133
+ {
134
+ total: 0, // 数据量
135
+ pageSize: cx.consts.PAGE_SIZE, // 每页记录数
136
+ pageSizes: cx.consts.PAGE_SIZES // 分页标准
137
+ }
138
+ }
139
+ }
140
+ },
141
+
142
+ /** @member {Boolean} enable1 选中一行数据 */
143
+ /** @member {Object} dgAtts DataGrid 属性 */
144
+ /** @member {Object} dgEvts DataGrid 事件 */
145
+ /** @member {Object} expAtts 表达式输入 属性 */
146
+ /** @member {Object} expEvts 表达式输入 事件 */
147
+ computed:
148
+ {
149
+ // 选中一行数据
150
+ enable1()
151
+ {
152
+ return !!this.selected
153
+ },
154
+
155
+ // DataGrid 属性
156
+ dgAtts()
157
+ {
158
+ return {
159
+ size: this.size,
160
+ datagrid: this.dg
161
+ }
162
+ },
163
+
164
+ // DataGrid 事件
165
+ dgEvts()
166
+ {
167
+ return {
168
+ 'sort-change': (name, sort) => this.onSortChange(name, sort),
169
+ 'row-click': (att) => this.onRowClick(att),
170
+ 'row-dblclick': (att) => this.onRowDblClick(att),
171
+ 'selection-change': (selection) => this.onSelectionChange(selection),
172
+ 'button-click': (btn, att) => this.onButtonClick(btn, att),
173
+ 'edit-row': (oldRowIndex, newRowIndwx) => this.onEditRow(oldRowIndex, newRowIndwx),
174
+ 'pagesize-change': (pagesize) => this.onPagesizeChage(pagesize),
175
+ 'page-change': (pageno) => this.onPageChange(pageno)
176
+ }
177
+ },
178
+
179
+ // 表达式输入 属性
180
+ expAtts()
181
+ {
182
+ return {
183
+ size: this.size,
184
+ flds: this.expFlds,
185
+ 'show-more': this.useExpMore
186
+ }
187
+ },
188
+
189
+ // 表达式输入 事件
190
+ expEvts()
191
+ {
192
+ return {
193
+ 'exp-search': () => this.onExpSearch(),
194
+ 'exp-clear': () => this.onExpClear(),
195
+ 'exp-more': () => this.onExpMore()
196
+ }
197
+ }
198
+ },
199
+
200
+ /**
201
+ * mounted 钩子
202
+ * @method
203
+ */
204
+ mounted()
205
+ {
206
+ // 监听
207
+ cx.events.listen(this, 'AttInsert', (params) =>
208
+ {
209
+ // eslint-disable-next-line
210
+ if (params.major == this.major && params.minor == this.minor)
211
+ {
212
+ this.attObj.numberize(params.newAtt)
213
+ this.afterAdd(params.newAtt)
214
+ this.gridAdd(params.newAtt)
215
+ }
216
+ })
217
+
218
+ cx.events.listen(this, 'AttDelete', (params) =>
219
+ {
220
+ // eslint-disable-next-line
221
+ if (params.major == this.major && params.minor == this.minor)
222
+ {
223
+ this.afterDel(params.oldAtt)
224
+ this.gridDel(params.oldAtt)
225
+ }
226
+ })
227
+
228
+ cx.events.listen(this, 'AttUpdate', (params) =>
229
+ {
230
+ // eslint-disable-next-line
231
+ if (params.major == this.major && params.minor == this.minor)
232
+ {
233
+ this.attObj.numberize(params.newAtt)
234
+ this.afterUpd(params.newAtt)
235
+ this.gridUpd(params.newAtt, params.oldAtt)
236
+ }
237
+ })
238
+
239
+ this.ready = false
240
+ if (this.editable)
241
+ this.retAtt = 1
242
+ this.init().then(ret =>
243
+ {
244
+ this.ready = true
245
+ })
246
+ },
247
+
248
+ /**
249
+ * unmounted 钩子
250
+ * @method
251
+ */
252
+ unmounted()
253
+ {
254
+ cx.events.unlisten(this)
255
+ // cx.run.closePlug('ExpMoreInput')
256
+ },
257
+
258
+ /**
259
+ * 混合方法
260
+ * @class
261
+ */
262
+ methods:
263
+ {
264
+ /**
265
+ * 初始化
266
+ * @method
267
+ */
268
+ async init()
269
+ {
270
+ const self = this
271
+
272
+ // DataGrid赋值
273
+ self.dg.table.list = self.list
274
+
275
+ self.attExp = self.defExp // 默认条件
276
+
277
+ if (!self.major && !self.minor && !self.tabName)
278
+ return
279
+
280
+ // 实体信息
281
+ self.entity = $g.entity.byMajMin(self.major, self.minor) || $g.entity.byName(self.tabName)
282
+ if (!self.entity)
283
+ {
284
+ self.$showSvr('noPermision')
285
+ return
286
+ }
287
+
288
+ // 取表对象
289
+ this.attObj = await $g.attFactory.byMajMin(this.major, this.minor, { flds: this.flds, tabname: this.tabName })
290
+
291
+ // 条件表达式
292
+ if (self.useExp)
293
+ {
294
+ self.attObj.makeExp(self.expFlds, self.expRange, self.expExclude)
295
+ // 增加处理查询字段expFlds的钩子函数。
296
+ self.expFlds = self.filterExpFlds(self.expFlds)
297
+ }
298
+
299
+ // 构造操作列
300
+ // this.dg.table.operCols = []
301
+ const operCols = self.getOpers()
302
+ cx.array.appendArr(self.dg.table.operCols, operCols)
303
+ self.makeOpers(operCols)
304
+
305
+ // 构造DataGrid列
306
+ let cols = self.getCols()
307
+ const colInfs = self.getColInfs()
308
+ cx.datagrid.makeCols(cols, colInfs, self.attObj.flds)
309
+
310
+ cols = self.filterCols(cols)
311
+ if (self.getEditCols)
312
+ self.attObj.makeEdit(cols, self.getEditCols())
313
+
314
+ // 修改组件排序方式,否则用内存字符串排序
315
+ for (let col of cols)
316
+ {
317
+ if (col.sortable)
318
+ col.sortable = 'custom'
319
+ }
320
+
321
+ self.cols = cols
322
+ self.dg.table.cols = cols
323
+
324
+ // 发起默认查询
325
+ if (self.fixedExp || self.attExp || self.unionQuery || self.sqlCfg.key || (!self.attExp && self.noExpDispAll))
326
+ {
327
+ self.makeQueryPara()
328
+ self.refresh()
329
+ }
330
+ },
331
+
332
+ /**
333
+ * 构造好列头后的过滤钩子,可以对列头进行过滤处理。
334
+ * @method
335
+ * @param {Array<Object>} cols 构造好的列头集合
336
+ */
337
+ filterCols(cols)
338
+ {
339
+ return cols
340
+ },
341
+
342
+ /**
343
+ * 构造好expFlds后的过滤钩子,可以对expFlds进行过滤处理。
344
+ * @method
345
+ * @param {Array<Object>} flds 构造好的列头集合
346
+ */
347
+ filterExpFlds(flds)
348
+ {
349
+ return flds
350
+ },
351
+
352
+ /**
353
+ * 行样式
354
+ * @method
355
+ * @param {Object} opts 参数对象
356
+ * @param {Object} pts.aatt 行数据
357
+ * @param {Number} pts.arowIndex 行索引
358
+ * @returns {Object} 样式对象
359
+ */
360
+ onRowStyle({ att, rowIndex })
361
+ {
362
+ },
363
+
364
+ /**
365
+ * 单元格样式
366
+ * @method
367
+ * @param {Object} opts 参数对象
368
+ * @param {Object} opts.att 行数据
369
+ * @param {Object} opts.column 列数据
370
+ * @param {Number} opts.rowIndex 行索引
371
+ * @param {Number} opts.columnIndex 列索引
372
+ * @returns {Object} 样式对象
373
+ */
374
+ onCellStyle({ row, column, rowIndex, columnIndex })
375
+ {
376
+ },
377
+
378
+ /**
379
+ * 按列头排序
380
+ * @method
381
+ * @param {String} name 排序字段
382
+ * @param {String} order 排序方式
383
+ */
384
+ onSortChange(name, order)
385
+ {
386
+ if (name)
387
+ {
388
+ // eslint-disable-next-line
389
+ if (name[0] == '_')
390
+ name = name.substring(1)
391
+ }
392
+ if (name && order)
393
+ this.orderby = (this.unionQuery && this.unionQuery.mainAlias ? this.unionQuery.mainAlias + '.' : '') + name + ' ' + order
394
+ else
395
+ this.orderby = ''
396
+ this.query()
397
+ },
398
+
399
+ /**
400
+ * 点击行
401
+ * @method
402
+ * @param {Object} att 行数据
403
+ */
404
+ onRowClick(att)
405
+ {
406
+ this.selected = att
407
+ },
408
+
409
+ /**
410
+ * 双击行
411
+ * @method
412
+ * @param {Object} att 行数据
413
+ */
414
+ onRowDblClick(att)
415
+ {
416
+ this.selected = att
417
+ },
418
+
419
+ /**
420
+ * 选择发生变化
421
+ * @method
422
+ * @param {Array} selection 选中的行数据
423
+ */
424
+ onSelectionChange(selection)
425
+ {
426
+ this.selection = selection
427
+ },
428
+
429
+ /**
430
+ * 点击按钮
431
+ * @method
432
+ * @param {Object} btn 点击的按钮
433
+ * @param {Object} att 行数据
434
+ */
435
+ onButtonClick(btn, att)
436
+ {
437
+ cx.base.call(btn.onClick, att)
438
+ },
439
+
440
+ /**
441
+ * 消息响应函数-每页数据量变化
442
+ * @method
443
+ * @param {Number} pagesize 选中的页码
444
+ */
445
+ onPagesizeChage(pagesize)
446
+ {
447
+ if (this.dg.page.pageSize !== pagesize)
448
+ this.dg.page.pageSize = pagesize
449
+ this.queryPara.pagesize = pagesize
450
+ this.queryPara.pageno = 1
451
+ this.query()
452
+ },
453
+
454
+ /**
455
+ * 消息响应函数-选中某页
456
+ * @method
457
+ * @param {Number} pageNo 选中的页码
458
+ */
459
+ onPageChange(pageNo)
460
+ {
461
+ if (this.queryPara.pageno !== pageNo)
462
+ {
463
+ this.queryPara.pageno = pageNo < 1 ? 1 : pageNo
464
+ this.query()
465
+ }
466
+ },
467
+
468
+ /**
469
+ * 消息响应函数-根据自定义表达式搜索
470
+ * @method
471
+ */
472
+ onExpSearch()
473
+ {
474
+ // 默认查询
475
+ if (!this.makeAttExp())
476
+ return
477
+
478
+ const defExp = cx.sqlexp.getDefExp() // 空表达式
479
+
480
+ cx.sqlexp.merge(defExp, this.fixedExp, this.attExp)
481
+ this.queryPara = cx.sqlexp.queryPara(defExp, this.dg.pages ? this.dg.page.pageSize : 0)
482
+ if (this.$refs.datagrid && this.$refs.datagrid.$refs.gridpage)
483
+ this.$refs.datagrid.$refs.gridpage.currentPage = 1
484
+ this.query()
485
+ },
486
+
487
+ /**
488
+ * 消息响应函数-根据自定义表达式搜索
489
+ * @method
490
+ */
491
+ onExpClear()
492
+ {
493
+ for (let fld of this.expFlds)
494
+ {
495
+ fld.value = ''
496
+ fld.value1 = ''
497
+ fld.value2 = ''
498
+ }
499
+ },
500
+
501
+ /**
502
+ * 消息响应函数-更多条件过滤
503
+ * @method
504
+ */
505
+ onExpMore()
506
+ {
507
+ const self = this
508
+ const params =
509
+ {
510
+ flds: self.expFlds,
511
+ unionQuery: self.unionQuery,
512
+ onOk: (attExp) =>
513
+ {
514
+ const defExp = cx.sqlexp.getDefExp() // 空表达式
515
+
516
+ self.attExp = attExp
517
+ cx.sqlexp.merge(defExp, self.fixedExp, self.attExp)
518
+ self.queryPara = cx.sqlexp.queryPara(defExp, self.dg.pages ? self.dg.page.pageSize : 0)
519
+
520
+ self.query()
521
+ }
522
+ }
523
+ cx.run.runPlug('ExpMoreInput', params)
524
+ },
525
+
526
+ /**
527
+ * 消息响应函数-刷新
528
+ * @method
529
+ */
530
+ onRefresh()
531
+ {
532
+ this.selected = null
533
+ this.selection = []
534
+ this.$refs.datagrid.$refs.gridtable.$refs.table.clearSelection()
535
+ this.refresh()
536
+ },
537
+
538
+ /**
539
+ * 消息响应函数-刷新一条记录
540
+ * @method
541
+ */
542
+ onRefreshA()
543
+ {
544
+ this.refreshA()
545
+ },
546
+
547
+ /**
548
+ * 事件 edit-row 响应函数
549
+ * @param {Number} oldRowIndex 旧行
550
+ * @param {Number} newRowIndex 新行
551
+ */
552
+ onEditRow(oldRowIndex, newRowIndex)
553
+ {
554
+ },
555
+
556
+ /**
557
+ * 取当前选中的行
558
+ * @method
559
+ * @returns {Object}
560
+ */
561
+ getSelected()
562
+ {
563
+ return this.selected
564
+ },
565
+
566
+ /**
567
+ * 返回当前行
568
+ * @method
569
+ * @returns {Object}
570
+ */
571
+ getCur()
572
+ {
573
+ return this.selected
574
+ },
575
+
576
+ /**
577
+ * 获取缺省的datagrid列字段信息
578
+ * @method
579
+ * @returns {Array} 返回datagrid列字段
580
+ */
581
+ getDefCols()
582
+ {
583
+ return cx.datagrid.getDefCols(this.attObj.flds, this.sortable)
584
+ },
585
+
586
+ /**
587
+ * 获取datagrid列字段信息
588
+ * @method
589
+ * @returns {Array} 返回datagrid列字段
590
+ */
591
+ getCols()
592
+ {
593
+ return this.getDefCols()
594
+ },
595
+
596
+ /**
597
+ * 获取datagrid列信息
598
+ * @method
599
+ * @returns {Array}
600
+ * @example
601
+ * [{colname: String, [title: String], width: Number, [align: Number = cx.consts.ALIGN_CENTER], [sortable: Boolean = true]}]
602
+ */
603
+ getColInfs()
604
+ {
605
+ return []
606
+ },
607
+
608
+ /**
609
+ * 重新计算opers
610
+ * @method
611
+ * @param {Array} operCols 操作列
612
+ * @returns {Object} this
613
+ */
614
+ makeOpers(operCols)
615
+ {
616
+ this.opers = []
617
+ for (let operCol of operCols)
618
+ {
619
+ for (let btn of operCol.btns)
620
+ {
621
+ btn.keyAble = btn.name + 'able_'
622
+ btn.keyShow = btn.name + 'show_'
623
+ this.opers.push(btn)
624
+ }
625
+ }
626
+ },
627
+
628
+ /**
629
+ * 计算各种操作的状态
630
+ * @method
631
+ * @param {Object} att 属性
632
+ * @returns {Object} this
633
+ */
634
+ calcOpers(att)
635
+ {
636
+ for (let oper of this.opers)
637
+ {
638
+ att[oper.keyAble] = oper.enable(att)
639
+ att[oper.keyShow] = oper.show(att)
640
+ }
641
+ },
642
+
643
+ /**
644
+ * 取操作按钮信息
645
+ * @method
646
+ * @returns {Array}
647
+ * @example
648
+ * [{colname: String,
649
+ * title: String,
650
+ * width: Number,
651
+ * [align: String = 'center']
652
+ * btns: [{name: String, title: String, onClick: Function}]
653
+ * }]
654
+ */
655
+ getOpers()
656
+ {
657
+ // 增/删/改/查操作
658
+ const operCol = this.getColOper()
659
+ this.addOperView(operCol)
660
+ .addOperEdit(operCol)
661
+ .addOperDel(operCol)
662
+ .setAttOper(operCol)
663
+
664
+ return [operCol]
665
+ },
666
+
667
+ /**
668
+ * 设置属性相关的按钮
669
+ * @method
670
+ * @abstract
671
+ * @param {Object} operCol 操作列
672
+ * @returns {Object} this
673
+ */
674
+ setAttOper(operCol)
675
+ {
676
+ return this
677
+ },
678
+
679
+ /**
680
+ * 操作列
681
+ * @method
682
+ * @returns {Object}
683
+ */
684
+ getColOper()
685
+ {
686
+ return { colname: 'rud_', title: this.$locBase('oper'), width: this.editable ? 95 : 70, align: 'center', btns: [] }
687
+ },
688
+
689
+ /**
690
+ * 增加操作-浏览
691
+ * @method
692
+ * @param {Object} operCol 操作列
693
+ * @returns {Object} this
694
+ */
695
+ addOperView(operCol)
696
+ {
697
+ const oper = cx.datagrid.getOper('view_', this.$locBase('view'), '')
698
+
699
+ oper.enable = (att) => true
700
+ oper.show = (att) => !this.editable || !!att.completed || (this.editable && !!att.procinstid)
701
+ oper.onClick = (att) =>
702
+ {
703
+ this._view(att)
704
+ }
705
+
706
+ this.operView(oper)
707
+ operCol.btns.push(oper)
708
+ return this
709
+ },
710
+
711
+ /**
712
+ * 增加操作-编辑
713
+ * @method
714
+ * @param {Object} operCol 操作列
715
+ * @returns {Object} this
716
+ */
717
+ addOperEdit(operCol)
718
+ {
719
+ const oper = cx.datagrid.getOper('edit_', this.$locBase('edit'), '')
720
+
721
+ oper.type = 'warning'
722
+ oper.enable = (att) => true
723
+ oper.show = (att) => !!this.editable && !att.completed && !att.procinstid
724
+ oper.onClick = (att) =>
725
+ {
726
+ this._upd(att)
727
+ }
728
+
729
+ this.operEdit(oper)
730
+ operCol.btns.push(oper)
731
+ return this
732
+ },
733
+
734
+ /**
735
+ * 增加操作-删除
736
+ * @method
737
+ * @param {Object} operCol 操作列
738
+ * @returns {Object} this
739
+ */
740
+ addOperDel(operCol)
741
+ {
742
+ const oper = cx.datagrid.getOper('del_', this.$locBase('del'), '')
743
+
744
+ oper.type = 'danger'
745
+ oper.enable = (att) => true
746
+ oper.show = (att) => !!this.editable && !att.completed && !att.bill
747
+ oper.onClick = (att) =>
748
+ {
749
+ this._del(att)
750
+ }
751
+
752
+ this.operDel(oper)
753
+ operCol.btns.push(oper)
754
+ return this
755
+ },
756
+
757
+ /**
758
+ * 增加操作-完成->未完成
759
+ * @method
760
+ * @param {Object} operCol 操作列
761
+ * @returns {Object} this
762
+ */
763
+ addOperCompelete(operCol)
764
+ {
765
+ const oper = cx.datagrid.getOper('uncomp_', this.$loc('cx.btnUncompelete'), '')
766
+
767
+ oper.type = 'warning'
768
+ oper.enable = (att) => true
769
+ oper.show = (att) => !!this.editable && att.completed && !att.procinstid
770
+ oper.onClick = (att) =>
771
+ {
772
+ this._complete(att, 0)
773
+ }
774
+
775
+ operCol.btns.push(oper)
776
+ return this
777
+ },
778
+
779
+ /**
780
+ * 增加操作-详情
781
+ * @method
782
+ * @param {Object} operCol 操作列
783
+ * @returns {Object} this
784
+ */
785
+ addOperDetail(operCol)
786
+ {
787
+ const oper = cx.datagrid.getOper('detail_', this.$locBase('detail'), '')
788
+
789
+ oper.enable = (att) => true
790
+ oper.show = (att) => att.procinstid
791
+ oper.onClick = (att) =>
792
+ {
793
+ this._detail(att)
794
+ }
795
+
796
+ operCol.btns.push(oper)
797
+ return this
798
+ },
799
+
800
+ /**
801
+ * 定制函数-操作/查看
802
+ * @method
803
+ * @param {Object} oper 操作对象
804
+ */
805
+ operView(oper)
806
+ {
807
+ },
808
+
809
+ /**
810
+ * 定制函数-操作/编辑
811
+ * @method
812
+ * @param {Object} oper 操作对象
813
+ */
814
+ operEdit(oper)
815
+ {
816
+ },
817
+
818
+ /**
819
+ * 定制函数-操作/删除
820
+ * @method
821
+ * @param {Object} oper 操作对象
822
+ */
823
+ operDel(oper)
824
+ {
825
+ },
826
+
827
+ /**
828
+ * 异常处理函数
829
+ * @method
830
+ * @param {Object} err 异常对象
831
+ */
832
+ onError(err)
833
+ {
834
+ // this.$processing.close()
835
+ this.$showRet(err)
836
+ },
837
+
838
+ /**
839
+ * 刷新
840
+ * @method
841
+ */
842
+ refresh()
843
+ {
844
+ if (this.dg.pages)
845
+ {
846
+ this.queryPara.init = 0 // 重新查询
847
+ this.queryPara.pageno = 1
848
+ this.queryPara.pagesize = this.dg.page.pageSize
849
+ }
850
+ this.query()
851
+ },
852
+
853
+ /**
854
+ * 刷新一条记录
855
+ * @method
856
+ */
857
+ refreshA(att)
858
+ {
859
+ if (!att)
860
+ att = this.selected
861
+ if (!att)
862
+ return
863
+
864
+ cx.svr.data.queryId(this.major, this.minor, att.id)
865
+ .then(ret =>
866
+ {
867
+ this.gridUpd(ret, att)
868
+ })
869
+ },
870
+
871
+ /**
872
+ * 更新列的宽度
873
+ */
874
+ updColsWidth()
875
+ {
876
+ cx.datagrid.makeColsFitWidth(this.cols, this.list, this.maxColWidth, this.fontSize, this.padding)
877
+ },
878
+
879
+ /**
880
+ * 向数据库发查询请求
881
+ * @method
882
+ */
883
+ query()
884
+ {
885
+ // 回调函数
886
+ const onSuccess = ret =>
887
+ {
888
+ let data = [], total = 0
889
+ let att
890
+
891
+ this.$processing.close()
892
+ cx.array.clear(this.dg.table.list)
893
+
894
+ if (ret instanceof Array)
895
+ {
896
+ data = ret
897
+ total = 0
898
+ }
899
+ else
900
+ {
901
+ data = ret.data
902
+ total = ret.total
903
+ }
904
+ // if (ret.length > 0)
905
+ // {
906
+ // // eslint-disable-next-line
907
+ // if (ret.total != undefined)
908
+ // {
909
+ // data = ret.data
910
+ // total = ret.total
911
+ // }
912
+ // else
913
+ // {
914
+ // data = ret
915
+ // total = 0
916
+ // }
917
+ // }
918
+ cx.array.appendArr(this.list, data)
919
+
920
+ // 当前选中行还在不在?
921
+ if (this.selected)
922
+ {
923
+ if (!cx.array.get1(data, { id: this.selected }))
924
+ this.selected = null
925
+ }
926
+
927
+ // 显示数据
928
+ for (att of data)
929
+ this.getDisp(att)
930
+
931
+ this.afterQuery()
932
+
933
+ // 根据数据和字段更新列宽度
934
+ if (this.dynaWidth)
935
+ this.updColsWidth()
936
+
937
+ if (this.dg.pages)
938
+ {
939
+ if (!this.queryPara.init)
940
+ {
941
+ this.queryPara.init = 1
942
+ this.dg.page.total = total
943
+ }
944
+ }
945
+ }
946
+
947
+ // 装配参数
948
+ if (this.sqlCfg.key)
949
+ {
950
+ this.queryPara._key = this.sqlCfg.key
951
+
952
+ // eslint-disable-next-line
953
+ if (this.sqlCfg.vals != undefined && this.sqlCfg.vals != null && this.sqlCfg.vals !== '')
954
+ this.queryPara.vals = this.sqlCfg.vals
955
+
956
+ if (this.sqlCfg.orderby)
957
+ this.queryPara.orderby = this.sqlCfg.orderby
958
+ if (this.sqlCfg.args)
959
+ this.queryPara.args = this.sqlCfg.args
960
+ }
961
+ if (this.orderby)
962
+ this.queryPara.orderby = this.orderby
963
+
964
+ if (this.queryPara.args.length < 1 && !this.sqlCfg.key) // 如果没有条件表达式
965
+ {
966
+ if (this.noExpDispAll) // 没有查询条件显示所有数据
967
+ {
968
+ this.queryPara.args = [['id', '>', 0]]
969
+ this.queryPara.orderby = 'id desc'
970
+ }
971
+ else
972
+ return
973
+ }
974
+ if (!this.queryPara.args)
975
+ delete this.queryPara.args
976
+
977
+ this.beforeQuery()
978
+ this.runSvr(onSuccess)
979
+ },
980
+
981
+ /**
982
+ * 调取服务进行查询
983
+ * @method
984
+ * @param {Function} onSuccess 查询成功后的回调函数
985
+ */
986
+ runSvr(onSuccess)
987
+ {
988
+ // 发起调用
989
+ this.$processing.show()
990
+ cx.svr.data.query(this.major, this.minor, this.queryPara)
991
+ .then(onSuccess)
992
+ .catch(err =>
993
+ {
994
+ this.$processing.close()
995
+ this.onError(err)
996
+ })
997
+ },
998
+
999
+ /**
1000
+ * 产生查询参数
1001
+ * @method
1002
+ */
1003
+ makeQueryPara()
1004
+ {
1005
+ const exp = cx.sqlexp.getDefExp() // 空表达式
1006
+
1007
+ cx.sqlexp.merge(exp, this.fixedExp, this.attExp)
1008
+ this.queryPara = cx.sqlexp.queryPara(exp, this.dg.pages ? this.dg.page.pageSize : 0)
1009
+ },
1010
+
1011
+ /**
1012
+ * 根据当前的查询条件,返回数据,导出数据
1013
+ * @returns {Promise}
1014
+ */
1015
+ exportData()
1016
+ {
1017
+ const self = this
1018
+ const sqlCfg = self.sqlCfg
1019
+ const exp = cx.sqlexp.getDefExp() // 空表达式
1020
+ cx.sqlexp.merge(exp, self.fixedExp, self.attExp)
1021
+
1022
+ const params = cx.sqlexp.queryPara(exp, 0)
1023
+
1024
+ if (sqlCfg.key)
1025
+ {
1026
+ params._key = sqlCfg.key
1027
+
1028
+ // eslint-disable-next-line
1029
+ if (sqlCfg.vals != undefined && sqlCfg.vals != null && sqlCfg.vals !== '')
1030
+ params.vals = sqlCfg.vals
1031
+
1032
+ if (sqlCfg.orderby)
1033
+ params.orderby = sqlCfg.orderby
1034
+ if (sqlCfg.args)
1035
+ params.args = sqlCfg.args
1036
+ }
1037
+ if (self.orderby)
1038
+ params.orderby = self.orderby
1039
+
1040
+ if (params.args.length < 1 && !sqlCfg.key) // 如果没有条件表达式
1041
+ {
1042
+ if (self.noExpDispAll) // 没有查询条件显示所有数据
1043
+ {
1044
+ params.args = [['id', '>', 0]]
1045
+ params.orderby = 'id desc'
1046
+ }
1047
+ }
1048
+ if (params.args.length < 1)
1049
+ delete params.args
1050
+
1051
+ // 发起调用
1052
+ return cx.svr.data.query(self.major, self.minor, params)
1053
+ .then(ret =>
1054
+ {
1055
+ for (let att of ret)
1056
+ self.getDisp(att)
1057
+
1058
+ return ret
1059
+ })
1060
+ },
1061
+
1062
+ /**
1063
+ * 根据当前的getCols(),取当前显示的列名
1064
+ * @returns { cols: Array.<String>, colInfs: {colname: {_label: ..., }} }
1065
+ */
1066
+ getDispCols()
1067
+ {
1068
+ const _cols = this.getCols()
1069
+ const cols = [], colInfs = {}
1070
+ let colname, title
1071
+
1072
+ _cols.forEach(item =>
1073
+ {
1074
+ colname = item.colname
1075
+ title = item.title
1076
+ // eslint-disable-next-line
1077
+ if (colname[0] == '_')
1078
+ colname = colname.substring(1)
1079
+ cols.push(colname)
1080
+ if (title)
1081
+ colInfs[colname] = { _label: title }
1082
+ })
1083
+ return { cols, colInfs }
1084
+ },
1085
+
1086
+ /**
1087
+ * 取对象的显示信息
1088
+ * @method
1089
+ * @param {Object} att 属性对象
1090
+ * @returns {Object} this
1091
+ */
1092
+ getDisp(att)
1093
+ {
1094
+ this._getDisp(att)
1095
+ return this
1096
+ },
1097
+
1098
+ /**
1099
+ * 取对象的显示信息
1100
+ * @method
1101
+ * @private
1102
+ * @param {Object} att 属性对象
1103
+ * @returns {Object} this
1104
+ */
1105
+ _getDisp(att)
1106
+ {
1107
+ this.attObj.numberize(att)
1108
+ this.attObj.decode(att)
1109
+ this.attObj.getDisp(att)
1110
+ if (att.completed !== undefined)
1111
+ {
1112
+ if (att.completed)
1113
+ att._completed = cx.consts.TEXT_COMPLETED
1114
+ else
1115
+ att._completed = ''
1116
+ }
1117
+ this.calcOpers(att)
1118
+ return this
1119
+ },
1120
+
1121
+ /**
1122
+ * 添加新项到datagrid列表
1123
+ * @method
1124
+ * @param {Object} attNew 新属性
1125
+ */
1126
+ gridAdd(attNew)
1127
+ {
1128
+ this.getDisp(attNew)
1129
+ cx.array.insert(this.list, attNew)
1130
+ },
1131
+
1132
+ /**
1133
+ * 从datagrid删除项
1134
+ * @method
1135
+ * @param {Object} attOld 旧属性
1136
+ */
1137
+ gridDel(attOld)
1138
+ {
1139
+ cx.array.remove(this.list, { id: attOld.id })
1140
+ // eslint-disable-next-line
1141
+ if (this.selected && this.selected.id == attOld.id)
1142
+ this.selected = null
1143
+ },
1144
+
1145
+ /**
1146
+ * 更新datagrid项
1147
+ * @method
1148
+ * @param {Object} attNew 新属性
1149
+ * @param {Object} attOld 旧属性
1150
+ */
1151
+ gridUpd(attNew, attOld)
1152
+ {
1153
+ let item, i, j
1154
+
1155
+ for (i = this.list.length - 1; i >= 0; i--)
1156
+ {
1157
+ item = this.list[i]
1158
+ // eslint-disable-next-line
1159
+ if (item.id == attNew.id)
1160
+ {
1161
+ for (j in attNew)
1162
+ item[j] = attNew[j]
1163
+ this.getDisp(item)
1164
+ }
1165
+ }
1166
+ },
1167
+
1168
+ /**
1169
+ * 生成用户自定义的条件表达式,放在attExp对象里面
1170
+ * @method
1171
+ * @returns {Boolean} 是否正确生成表达式
1172
+ */
1173
+ makeAttExp()
1174
+ {
1175
+ const exp = cx.sqlexp.getDefExp() // 空表达式
1176
+ const attExp = this.getExp()
1177
+
1178
+ cx.sqlexp.merge(exp, attExp)
1179
+ this.attExp = exp
1180
+ return true
1181
+ },
1182
+
1183
+ /**
1184
+ * 提交-增加
1185
+ * @method
1186
+ * @param {Object} att 新属性
1187
+ */
1188
+ submitAdd(att)
1189
+ {
1190
+ if (!this.beforeAdd(att))
1191
+ {
1192
+ return new Promise((resolve) =>
1193
+ {
1194
+ resolve(false)
1195
+ })
1196
+ }
1197
+ return cx.svr.attOper.insert(this.major, this.minor, att, this.retAtt)
1198
+ .then(ret =>
1199
+ {
1200
+ return true
1201
+ // 这里没有额外代码,是因为该类增加了数据增删改监听
1202
+ })
1203
+ },
1204
+
1205
+ /**
1206
+ * 提交-删除
1207
+ * @method
1208
+ * @param {Object} att 属性
1209
+ */
1210
+ submitDel(att)
1211
+ {
1212
+ if (!att)
1213
+ return
1214
+ if (!this.beforeDel(att))
1215
+ return
1216
+
1217
+ // cx.svr.doc.delEntity({ major: this.major, minor: this.minor, entityid: att.id })
1218
+ // .then(ret =>
1219
+ // {
1220
+ cx.svr.attOper.del(this.major, this.minor, att)
1221
+ .then(ret =>
1222
+ {
1223
+ // eslint-disable-next-line
1224
+ if (att == this.selected)
1225
+ this.selected = null
1226
+
1227
+ // 这里没有额外代码,是因为该类增加了数据增删改监听
1228
+ })
1229
+ .catch(this.onError)
1230
+ // })
1231
+ // .catch(this.onError)
1232
+ },
1233
+
1234
+ /**
1235
+ * 提交-修改
1236
+ * @method
1237
+ * @param {Object} attNew 新属性
1238
+ * @param {Object} attOld 旧属性
1239
+ */
1240
+ submitUpd(attNew, attOld)
1241
+ {
1242
+ return new Promise((resolve) =>
1243
+ {
1244
+ resolve(true)
1245
+ })
1246
+ // 这里没有额外代码,是因为该类增加了数据增删改监听,并且很多地方是界面提供了修改数据功能
1247
+ },
1248
+
1249
+ /**
1250
+ * 提交-开启/关闭
1251
+ * @method
1252
+ * @param {Object} att 新属性
1253
+ * @param {Number} state 状态值(0-未结束 1-结束)
1254
+ */
1255
+ submitComp(att, state)
1256
+ {
1257
+ const attNew =
1258
+ {
1259
+ id: att.id,
1260
+ completed: state,
1261
+ cols: 'completed'
1262
+ }
1263
+
1264
+ if (state === 0)
1265
+ {
1266
+ attNew.procinstid = ''
1267
+ attNew.bill = ''
1268
+ }
1269
+
1270
+ cx.svr.attOper.update(this.major, this.minor, attNew, att)
1271
+ .then(ret =>
1272
+ {
1273
+ // this.afterUpd(att)
1274
+ // this.gridUpd(attNew, att)
1275
+ })
1276
+ .catch(this.onError)
1277
+ },
1278
+
1279
+ /**
1280
+ * 根据属性删除实体
1281
+ * @private
1282
+ * @method
1283
+ * @param {Object} att 属性
1284
+ */
1285
+ _del(att)
1286
+ {
1287
+ if (!att)
1288
+ return
1289
+
1290
+ this.$cfm('del')
1291
+ .then(() =>
1292
+ {
1293
+ this.submitDel(att)
1294
+ })
1295
+ .catch(() =>
1296
+ {
1297
+ })
1298
+ },
1299
+
1300
+ /**
1301
+ * 根据属性查看实体
1302
+ * @private
1303
+ * @method
1304
+ * @param {Object} att 属性
1305
+ */
1306
+ _view(att)
1307
+ {
1308
+ if (!att)
1309
+ return
1310
+
1311
+ const params =
1312
+ {
1313
+ major: this.major,
1314
+ minor: this.minor,
1315
+ att,
1316
+ editable: false,
1317
+ title: this.getEntityName(),
1318
+ closable: true
1319
+ }
1320
+ cx.run.runPlug(this.getPluginName(cx.consts.ATT_VIEW, att), params, { modal: 0 })
1321
+ },
1322
+
1323
+ /**
1324
+ * 根据属性编辑实体
1325
+ * @private
1326
+ * @method
1327
+ * @param {Object} att 属性
1328
+ * @param {Boolean} [changed = false] 数据改变标记
1329
+ */
1330
+ _upd(att, changed)
1331
+ {
1332
+ if (!att)
1333
+ return
1334
+
1335
+ const params =
1336
+ {
1337
+ major: this.major,
1338
+ minor: this.minor,
1339
+ editable: true,
1340
+ att,
1341
+ title: this.getEntityName(),
1342
+ retAtt: this.retAtt,
1343
+ beforeUpd: (att) => this.beforeUpd(att),
1344
+ onOk: (attNew, attOld) => this.submitUpd(attNew, attOld)
1345
+ }
1346
+ if (changed)
1347
+ params.changed = !!changed
1348
+
1349
+ cx.run.runPlug(this.getPluginName(cx.consts.ATT_EDIT, att), params, { modal: 0 })
1350
+ },
1351
+
1352
+ /**
1353
+ * 根据属性开启/关闭
1354
+ * @private
1355
+ * @method
1356
+ * @param {Object} att 属性
1357
+ * @param {Number} state 状态值(0-未结束 1-结束)
1358
+ */
1359
+ _complete(att, state)
1360
+ {
1361
+ if (!att)
1362
+ return
1363
+
1364
+ this.$cfmMsg(this.$loc('cx.cfmUncomplete'))
1365
+ .then(() =>
1366
+ {
1367
+ this.submitComp(att, state)
1368
+ })
1369
+ .catch(() =>
1370
+ {
1371
+ })
1372
+ },
1373
+
1374
+ /**
1375
+ * 根据属性查看详情
1376
+ * @private
1377
+ * @method
1378
+ * @param {Object} att 属性
1379
+ */
1380
+ _detail(att)
1381
+ {
1382
+ if (!att)
1383
+ return
1384
+
1385
+ // 查找表对应的流程
1386
+ const proc = cx.array.get1($g.init.procs, { tabname: this.entity.name })
1387
+
1388
+ if (proc)
1389
+ {
1390
+ const plug = proc.plugins.detail
1391
+
1392
+ if (plug)
1393
+ {
1394
+ const params =
1395
+ {
1396
+ major: this.major,
1397
+ minor: this.minor,
1398
+ att,
1399
+ editable: false,
1400
+ task: null
1401
+ }
1402
+ // 上面没有传 comments 参数
1403
+
1404
+ cx.base.execute(plug, [params])
1405
+ }
1406
+ }
1407
+ },
1408
+
1409
+ /**
1410
+ * 根据ID删除实体
1411
+ * @method
1412
+ * @param {Number} id ID
1413
+ */
1414
+ del(id)
1415
+ {
1416
+ this._del(cx.array.get1(this.list, { id: parseInt(id) }))
1417
+ },
1418
+
1419
+ /**
1420
+ * 根据ID删除实体
1421
+ * @method
1422
+ * @param {Number} id ID
1423
+ */
1424
+ view(id)
1425
+ {
1426
+ this._view(cx.array.get1(this.list, { id: parseInt(id) }))
1427
+ },
1428
+
1429
+ /**
1430
+ * 根据ID修改实体
1431
+ * @method
1432
+ * @param {Number} id ID
1433
+ */
1434
+ upd(id)
1435
+ {
1436
+ this._upd(cx.array.get1(this.list, { id: parseInt(id) }))
1437
+ },
1438
+
1439
+ /**
1440
+ * 根据ID开启
1441
+ * @method
1442
+ * @param {Number} id ID
1443
+ */
1444
+ complete(id)
1445
+ {
1446
+ this._complete(cx.array.get1(this.list, { id: parseInt(id) }), 0)
1447
+ },
1448
+
1449
+ /**
1450
+ * 根据ID修改实体
1451
+ * @method
1452
+ * @param {Number} id ID
1453
+ */
1454
+ detail(id)
1455
+ {
1456
+ this._detail(cx.array.get1(this.list, { id: parseInt(id) }))
1457
+ },
1458
+
1459
+ /**
1460
+ * 消息响应函数-添加
1461
+ * @method
1462
+ */
1463
+ onAdd()
1464
+ {
1465
+ // 弹出输入界面
1466
+ const params =
1467
+ {
1468
+ major: this.major,
1469
+ minor: this.minor,
1470
+ att: this.defVal(),
1471
+ title: this.getEntityName(),
1472
+ onOk: (att) => this.submitAdd(att)
1473
+ }
1474
+
1475
+ cx.run.runPlug(this.getPluginName(cx.consts.ATT_ADD, null), params, {})
1476
+ },
1477
+
1478
+ /**
1479
+ * 带属性进行添加操作
1480
+ * @param {Object} att 带进来的属性信息
1481
+ * @param {String} [title] 带进来的标题
1482
+ * @method
1483
+ */
1484
+ addWithAtt(att, title)
1485
+ {
1486
+ // 弹出输入界面
1487
+ const params =
1488
+ {
1489
+ major: this.major,
1490
+ minor: this.minor,
1491
+ att: this.defVal(),
1492
+ title: title ? title : this.getEntityName(),
1493
+ onOk: (att) => this.submitAdd(att)
1494
+ }
1495
+
1496
+ cx.base.extend(params.att, att)
1497
+
1498
+ cx.run.runPlug(this.getPluginName(cx.consts.ATT_ADD, null), params, {})
1499
+ },
1500
+
1501
+ /**
1502
+ * 消息响应函数-删除
1503
+ * @method
1504
+ */
1505
+ onDel()
1506
+ {
1507
+ this._del(this.getCur())
1508
+ },
1509
+
1510
+ /**
1511
+ * 消息响应函数-修改
1512
+ * @method
1513
+ */
1514
+ onUpd()
1515
+ {
1516
+ this._upd(this.getCur())
1517
+ },
1518
+
1519
+ /**
1520
+ * 消息响应函数-明细
1521
+ * @method
1522
+ */
1523
+ onDetail()
1524
+ {
1525
+ const att = this.getCur()
1526
+ if (att)
1527
+ this.detail(att.id)
1528
+ },
1529
+
1530
+ /**
1531
+ * 取默认值
1532
+ * @method
1533
+ * @returns {Object} 默认属性(如果没有缓存数据,则返回NULL)
1534
+ */
1535
+ defVal()
1536
+ {
1537
+ const att = this.attObj.getDefVal()
1538
+ cx.att.getCacheAtt(this.major, this.minor, att)
1539
+ this.initAtt(att)
1540
+ return att
1541
+ },
1542
+
1543
+ /**
1544
+ * 用于输入属性之前,在派生类初始化属性(特殊情况下修改字段值)
1545
+ * @method
1546
+ * @param {Object} att 属性对象
1547
+ */
1548
+ initAtt(att)
1549
+ {
1550
+ },
1551
+
1552
+ /**
1553
+ * 添加属性之前的接口
1554
+ * @method
1555
+ * @param {Object} att 属性对象
1556
+ */
1557
+ beforeAdd(att)
1558
+ {
1559
+ this.attObj.encode(att)
1560
+ return true
1561
+ },
1562
+
1563
+ /**
1564
+ * 添加属性之后的接口
1565
+ * @method
1566
+ * @param {Object} att 属性对象
1567
+ */
1568
+ afterAdd(att)
1569
+ {
1570
+ },
1571
+
1572
+ /**
1573
+ * 删除属性之前的接口
1574
+ * @method
1575
+ * @param {Object} att 属性对象
1576
+ */
1577
+ beforeDel(att)
1578
+ {
1579
+ return true
1580
+ },
1581
+
1582
+ /**
1583
+ * 删除属性之后的接口
1584
+ * @method
1585
+ * @param {Object} att 属性对象
1586
+ */
1587
+ afterDel(att)
1588
+ {
1589
+ },
1590
+
1591
+ /**
1592
+ * 修改属性之前的接口
1593
+ * @method
1594
+ * @param {Object} att 属性对象
1595
+ */
1596
+ beforeUpd(att)
1597
+ {
1598
+ this.attObj.encode(att)
1599
+ return true
1600
+ },
1601
+
1602
+ /**
1603
+ * 修改属性之后的接口
1604
+ * @method
1605
+ * @param {Object} att 属性对象
1606
+ */
1607
+ afterUpd(att)
1608
+ {
1609
+ },
1610
+
1611
+ /**
1612
+ * 查询之后的接口
1613
+ * @method
1614
+ */
1615
+ afterQuery()
1616
+ {
1617
+ },
1618
+
1619
+ /**
1620
+ * 查询之前的接口
1621
+ * @method
1622
+ */
1623
+ beforeQuery()
1624
+ {
1625
+ },
1626
+
1627
+ /**
1628
+ * 取实体信息
1629
+ * @method
1630
+ * @returns {Object} 返回实体信息
1631
+ */
1632
+ getEntity()
1633
+ {
1634
+ return this.entity
1635
+ },
1636
+
1637
+ /**
1638
+ * 取实体名称
1639
+ * @method
1640
+ * @returns {String} 返回实体信息
1641
+ */
1642
+ getEntityName()
1643
+ {
1644
+ return cx.i18n.locEntity(this.entity)
1645
+ },
1646
+
1647
+ /**
1648
+ * 取插件名
1649
+ * @method
1650
+ * @param {Number} type 类型
1651
+ * @param {Object} [att] 属性(当前需要发起流程的属性)
1652
+ * @returns {String}
1653
+ */
1654
+ getPluginName(type, att)
1655
+ {
1656
+ switch (type)
1657
+ {
1658
+ case cx.consts.PROC_START: return 'ProcStart'
1659
+ case cx.consts.PROC_PROGRESS: return 'ProcProgress'
1660
+ case cx.consts.PROC_TRACE: return 'ProcTrace'
1661
+ case cx.consts.ATT_ADD:
1662
+ return 'AttInput'
1663
+ case cx.consts.ATT_EDIT:
1664
+ case cx.consts.ATT_VIEW:
1665
+ return 'AttEdit'
1666
+ }
1667
+ return ''
1668
+ }
1669
+ }
1670
+ }