vue2-client 1.8.459 → 1.8.461

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.
@@ -0,0 +1,45 @@
1
+ # logic插件使用说明
2
+
3
+ ### 插件
4
+
5
+ 在logic中 调用插件函数 比如 log.debug("str") sql.query("sql"),其中 log / sql 均对应一个 java 类,
6
+ - log 对应 org.apache.logging.log4j.Logger 用于输出日志
7
+ * log.debug(内容) -> 打印debug日志
8
+ * log.info(内容) -> 打印info日志
9
+ * log.warn(内容) -> 打印warn日志
10
+ * log.error(内容) -> 打印error日志
11
+ - ENV 对应 一个 org.json.JSONObject {tenantName:"租户名称",orgName:"分公司名称",applicationName:"应用名称",dbType:"数据库类型"}
12
+ - logic 对应 LogicService 类,其中有方法
13
+ * logic.run(logicName,param) 执行logic / logicName 执行的业务逻辑名称,param 参数 返回 org.json.JSONObject
14
+ - sql 对应 [SqlService]() 类,其中有方法
15
+ * sql.query(sql别名 string,sql参数 string) 执行已经注册的sql 返回 org.json.JSONArray
16
+ * sql.query(sql别名 string,sql参数 string,页数 int,每页行数 int) 执行已经注册的sql 返回 org.json.JSONArray
17
+ * sql.querySQL(sql名称,sql语句) 执行一个没有注册的sql语句 返回 org.json.JSONArray
18
+ * sql.querySQL(sql名称,sql语句,页数 int,每页行数 int) ) 执行一个没有注册的sql语句 返回 org.json.JSONArray
19
+ * sql.execSQL(sql名称,sql语句,页数 int,每页行数 int) ) 执行一个增删改sql语句 返回 org.json.JSONArray
20
+ - entity 对应 EntityService 类,其中有方法
21
+ * entity.partialSave(实体名称 string,保存参数 org.json.JSONObject) 返回整个实体 JSONObject
22
+ * entity.delete(实体名称 string,id Object)
23
+ * entity.getById(表名 string, 主键值 Object) -> 根据主键查询数据 返回找到的 JSONObject
24
+ - CommonTools 常用工具类
25
+ * CommonTools.getUUID() 获取一个UUID 字符串
26
+ * CommonTools.add(Obejct,Object) 加法运算
27
+ * CommonTools.sub(Obejct,Object) 减法运算
28
+ * CommonTools.mul(Obejct,Object) 乘法运算
29
+ * CommonTools.div(Obejct,Object) 除法运算
30
+ - redis,用于操作redis
31
+ * redis.set(redis键, 值) -> 往redis存入数据
32
+ * redis.get(redis键) -> 从redis获取数据
33
+ * redis.delete(redis键) -> 从redis删除数据
34
+ - dateTools,日期工具类
35
+ * dateTools.getNow2() -> 获取当前日期字符串(格式:yyyy-MM-dd HH:mm:ss)
36
+ * dateTools.getNow(格式 string) -> 获取指定格式的当前日期字符串
37
+ * dateTools.getNowYear() -> 获取当前年份
38
+ * dateTools.getNowMonth() -> 获取当前月份
39
+ * dateTools.getNowDay() -> 获取当前日
40
+ * dateTools.format(日期 string, 目标日期格式) -> 格式化日期字符串为指定格式
41
+ * dateTools.formatDateTime(日期 string) -> 格式化日期字符串为yyyy-MM-dd HH:mm:ss格式
42
+ * dateTools.compareDate(日期1 string, 日期2 string) -> 比较两个日期大小,返回boolean(日期1 > 日期2)
43
+ - jsonTools,json工具类
44
+ * jsonTools.convertToJson(字符串 string) -> 字符串转org.json.JSONObject
45
+ * jsonTools.parseArray(字符串 string) -> 字符串转org.json.JSONArray
@@ -4,22 +4,32 @@
4
4
  - 用this.函数函数调用方式调用相应功能。
5
5
 
6
6
  # 通过this可以调用的函数
7
- - openDialog(configName, selectedId, mixinData):打开一个对话框,例如:this.openDialog('xxx', 5, {})
7
+ - openDialog(configName, selectedId, mixinData, outEnv):打开一个对话框:
8
+ * selectId:id号,formtable选择时,用selectId过滤数据
9
+ * mixinData: form表单需要的数据
10
+ * outEnv: 传递给打开的界面的数据,在打开界面的js中通过this.outEnv可以访问
11
+ ```js
12
+ this.openDialog('xxx', 5, {}, {})
13
+ ```
8
14
  - runLogic(logicName, parameter): 运行业务逻辑, 例如: this.runLogic('xxx', {})
9
15
 
10
16
  # 如何调用珊格中组件的数据及函数
11
17
  - 先给组件起名字,命名规范:main,left,right,top,bottom
12
18
  - 用 this.getComponentByName('main') 拿到组件。
13
19
 
20
+ # 特殊处理
21
+ - form表单提交数据到列表,而非后台。用 `this.outEnv.data.push(...[])`刷新列表数据。
22
+
14
23
  # x-form-table 可以使用的函数/数据
24
+ - getTableData(): 获取所有数据
25
+ - 获取selectedid getSelectedId()
26
+ - 重新查询 refreshTable()
15
27
  ```js
16
28
  假如组件名称叫 xtable
17
29
  // 所有选中的id
18
30
  const allid = this.$refs.xtable.table_selectedRowKeys
19
31
  // 所有选中的行 table_selectedRowKeys
20
32
  const allrecord = this.$refs.xtable.table_selectedRows
21
- - 获取selectedid getSelectedId()
22
- - 重新查询 refreshTable()
23
33
 
24
34
  // xtable 所调用事件
25
35
  // 新增修改后调用事件
@@ -32,18 +42,23 @@ afterDelete( res (删除接口返回数据))
32
42
  action(record (当前记录), id (当前记录主键), actionType (操作类型))
33
43
  ```
34
44
 
45
+ - table_selectedRowKeys 获取选中的id /不用加 () 这是一个data 中的变量
46
+ - table_selectedRows 获取选中的行 /不用加 () 这是一个data 中的变量
47
+ - getSelectedId 获取获取selectedid
48
+ - refreshTable 重新查询
49
+ - clearRowKeys 清除选中的行
50
+ - 事件相关
51
+ - afterSubmit( type(新增/修改/擦和讯), id: (所操作的主键id), form: (请求的表单内容)) 提交后触发
52
+ - afterQuery( res (查询后数据), querparams (查询参数)) 查询后触发
53
+ afterDelete( res (删除接口返回数据)) 删除后触发
54
+ action(record (当前记录), id (当前记录主键), actionType (操作类型)) 操作按钮触发
35
55
 
36
56
  # form 简易表单
37
- ```js
38
- 假如组件名称叫 xform
39
- // 主动调用提交函数
40
- const res = await this.$refs.xform.asyncSubmit() res 为表单内容
41
- // 设置 表单内容
42
- this.$refs.xform.setForm(obj) obj 用于合并到 form 对象中
43
-
44
- // xform 所调用事件 点击自带提交按钮后调用
45
- onSubmit( form: (请求的表单内容))
46
- ```
57
+
58
+ - asyncSubmit().then(res=>{}) 手动提交表单
59
+ - setForm({}) 手动设置表单内容
60
+ - 事件相关
61
+ - onSubmit(form) 表单提交事件
47
62
 
48
63
  # 每种事件处理,传递给function的参数
49
64
  - 添加处理:空
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.459",
3
+ "version": "1.8.461",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -265,7 +265,7 @@ import { mapState } from 'vuex'
265
265
  import { executeStrFunction } from '@vue2-client/utils/runEvalFunction'
266
266
  import debounce from 'lodash.debounce'
267
267
  import XDataCard from '@vue2-client/base-client/components/common/XDataCard/XDataCard.vue'
268
- import { getRealKeyData } from '@/utils/formatter'
268
+ import { getRealKeyData } from '@vue2-client/utils/formatter'
269
269
 
270
270
  export default {
271
271
  name: 'XTable',
@@ -125,16 +125,9 @@ export function getConfigByLogic (logicName, parameter, serviceName = process.en
125
125
  * @deprecated 这个函数应该只有琉璃中心会使用,其他项目不能使用 之后会删除这个
126
126
  * @param configContent 原配置内容
127
127
  * @param configType 配置类型
128
- * @param serviceName 命名空间名称
129
- * @param isDev 是否是开发环境
130
128
  */
131
- export function parseConfig (configContent, configType, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev = true) {
132
- let apiPre = '/api/'
133
- if (isDev) {
134
- apiPre = '/devApi/'
135
- }
136
- const url = apiPre + serviceName + '/' + commonApi.parseConfig
137
- return post(url, {
129
+ export function parseConfig (configContent, configType) {
130
+ return post('/api/af-liuli/logic/openapi/parseConfigByClient', {
138
131
  configType: configType,
139
132
  configContent: configContent
140
133
  })