mooho-base-admin-plus 2.4.39 → 2.4.40
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.
package/history.md
CHANGED
|
@@ -1,73 +1,74 @@
|
|
|
1
|
-
2.1.3 - 修复因为 i18n 加载延迟导致的页面出错,特别是日期控件
|
|
2
|
-
2.1.4 - vue 3.3.3 版本报错,降至固定版本 3.3.2
|
|
3
|
-
2.1.5 - vue 升级至 3.3.4
|
|
4
|
-
2.1.6 - item-select 组件 init 时不加载一次数据
|
|
5
|
-
2.2.0 - 增加外发接口日志查询,任务队列日志查询增加接口日志
|
|
6
|
-
2.2.1 - tableView 和 modalView 增加 row-class-name 属性
|
|
7
|
-
2.2.2 - 路由权限判断 bug 修复,处理带 query 参数的情况
|
|
8
|
-
2.2.4 - 非多语言情况下,仍旧要解析后端传过来的内容
|
|
9
|
-
2.2.5 - 流程模板页面增加 all 权限的判断
|
|
10
|
-
2.2.6 - 流程模板页面增加 create 权限的判断
|
|
11
|
-
2.2.7 - 静态选项支持数字
|
|
12
|
-
2.2.8 - 增加描述类型控件
|
|
13
|
-
2.2.9 - 枚举类型加载时不再判断 source 字段
|
|
14
|
-
2.2.10 - 图片上传控件可设置接受的文件格式
|
|
15
|
-
2.2.11 - 筛选栏控件对齐方式与筛选操作栏一致
|
|
16
|
-
2.2.12 - 修复 2.2.10 bug
|
|
17
|
-
2.2.13 - 修复 2.2.10 bug
|
|
18
|
-
2.2.14 - 筛选栏数据处理机制变化,修复默认值 bug
|
|
19
|
-
2.2.15 - 修改表格 open 时参数无法带入的 bug
|
|
20
|
-
2.3.0 - 表格只读文本字段增加强制单行、固定在最前选项
|
|
21
|
-
2.3.1 - 前端增加默认每页默认数量配置 layout.pageSize
|
|
22
|
-
2.3.2 - 修改表格 open 时参数无法带入的 bug
|
|
23
|
-
2.3.3 - 增加菜单筛选
|
|
24
|
-
2.3.4 - 菜单筛选默认关闭
|
|
25
|
-
2.3.5 - 解决菜单只能筛选两层的 bug
|
|
26
|
-
2.3.6 - 解决修改筛选导致的弹出选择框 bug
|
|
27
|
-
2.3.7 - 继续解决修改筛选导致的弹出选择框 bug
|
|
28
|
-
2.3.8 - 增加可筛选选择框支持
|
|
29
|
-
2.3.9 - 优化默认筛选参数:filter 的处理方式
|
|
30
|
-
2.3.10 - 可筛选选择框 bug 修复
|
|
31
|
-
2.3.11 - 弹出框增加全屏按钮
|
|
32
|
-
2.3.12 - 解决弹出框全屏按钮有时会关闭窗口的 bug
|
|
33
|
-
2.3.13 - 解决表格弹出框无法关闭的 bug
|
|
34
|
-
2.4.0 - 增加表格弹出显示表单
|
|
35
|
-
2.4.1 - 增加 int 类型时间戳显示支持
|
|
36
|
-
2.4.2 - 附件 json 的 file 字段支持 http 开头地址,用于外部链接
|
|
37
|
-
2.4.3 - 附件下载改为弹出新页,为了兼容 某些文件下载时直接打开,无法回退。如 pdf
|
|
38
|
-
2.4.4 - 附件下载 div 改为 span,解决点击空白处也会下载的问题
|
|
39
|
-
2.4.5 - 修复表格中显示图片报错的 bug
|
|
40
|
-
2.4.6 - 表格允许查看、允许编辑、允许删除属性增加函数类型
|
|
41
|
-
2.4.7 - 计算列触发条件优化
|
|
42
|
-
2.4.8 - 批量选择时无法触发选择
|
|
43
|
-
2.4.9 - 增加 ModalTable 的查看支持
|
|
44
|
-
2.4.10 - showData 支持多行显示(换行、空格)
|
|
45
|
-
2.4.11 - 增加 string 类型时间戳显示支持
|
|
46
|
-
2.4.12 - 增加 string 类型时间戳显示支持 bug 修复
|
|
47
|
-
2.4.13 - 增加 string 类型时间戳显示支持 bug 修复
|
|
48
|
-
2.4.14 - 修复草稿状态下点击历史显示所有的问题
|
|
49
|
-
2.4.15 - 修复自定义模型表格导出和打印的 bug
|
|
50
|
-
2.4.16 - 修复弹出表单全屏后高度不能 100%的 bug
|
|
51
|
-
2.4.17 - 分拆登录方法,应对 sso 登录
|
|
52
|
-
2.4.18 - 修复上一版本导致的 bug
|
|
53
|
-
2.4.19 - 修复自定义图标按钮无法显示的 bug
|
|
54
|
-
2.4.20 - 默认值下拉框优化
|
|
55
|
-
2.4.21 - 优化 login css 避免污染其他页面
|
|
56
|
-
2.4.22 - transfer bug 修复
|
|
57
|
-
2.4.23 - 表格加载完成触发 change 事件,解决自动计算无法触发的 bug
|
|
58
|
-
2.4.24 - 修复登录时未更新菜单的 bug
|
|
59
|
-
2.4.25 - 增加上传文件大小限制
|
|
60
|
-
2.4.26 - 优化计算列,避免转换对象
|
|
61
|
-
2.4.27 - 优化标题默认样式
|
|
62
|
-
2.4.28 - 修复可筛选下拉框选中内容会跳回原值的bug
|
|
63
|
-
2.4.29 - 修复新增、修改开放接口用户密码未加密的bug
|
|
64
|
-
2.4.30 - 批量选择支持默认值
|
|
65
|
-
2.4.31 - 增加自定义功能导入导出
|
|
66
|
-
2.4.32 - 修复切换强制换行后不会马上换行的bug
|
|
67
|
-
2.4.33 - 修复多选可筛选选择框无法删除已选项的bug
|
|
68
|
-
2.4.34 - 修复带参数的路由地址无法处理权限点的bug
|
|
69
|
-
2.4.35 - showMultiLine函数增加判断,非字符串不处理
|
|
70
|
-
2.4.36 - 增加了组件覆盖支持
|
|
71
|
-
2.4.37 - 增加component导出
|
|
72
|
-
2.4.38 - 修复上一版本bug
|
|
73
|
-
2.4.39 - 修复菜单管理界面无法用关键词查询的bug
|
|
1
|
+
mooho-base-admin-plus@2.1.3 - 修复因为 i18n 加载延迟导致的页面出错,特别是日期控件
|
|
2
|
+
mooho-base-admin-plus@2.1.4 - vue 3.3.3 版本报错,降至固定版本 3.3.2
|
|
3
|
+
mooho-base-admin-plus@2.1.5 - vue 升级至 3.3.4
|
|
4
|
+
mooho-base-admin-plus@2.1.6 - item-select 组件 init 时不加载一次数据
|
|
5
|
+
mooho-base-admin-plus@2.2.0 - 增加外发接口日志查询,任务队列日志查询增加接口日志
|
|
6
|
+
mooho-base-admin-plus@2.2.1 - tableView 和 modalView 增加 row-class-name 属性
|
|
7
|
+
mooho-base-admin-plus@2.2.2 - 路由权限判断 bug 修复,处理带 query 参数的情况
|
|
8
|
+
mooho-base-admin-plus@2.2.4 - 非多语言情况下,仍旧要解析后端传过来的内容
|
|
9
|
+
mooho-base-admin-plus@2.2.5 - 流程模板页面增加 all 权限的判断
|
|
10
|
+
mooho-base-admin-plus@2.2.6 - 流程模板页面增加 create 权限的判断
|
|
11
|
+
mooho-base-admin-plus@2.2.7 - 静态选项支持数字
|
|
12
|
+
mooho-base-admin-plus@2.2.8 - 增加描述类型控件
|
|
13
|
+
mooho-base-admin-plus@2.2.9 - 枚举类型加载时不再判断 source 字段
|
|
14
|
+
mooho-base-admin-plus@2.2.10 - 图片上传控件可设置接受的文件格式
|
|
15
|
+
mooho-base-admin-plus@2.2.11 - 筛选栏控件对齐方式与筛选操作栏一致
|
|
16
|
+
mooho-base-admin-plus@2.2.12 - 修复 2.2.10 bug
|
|
17
|
+
mooho-base-admin-plus@2.2.13 - 修复 2.2.10 bug
|
|
18
|
+
mooho-base-admin-plus@2.2.14 - 筛选栏数据处理机制变化,修复默认值 bug
|
|
19
|
+
mooho-base-admin-plus@2.2.15 - 修改表格 open 时参数无法带入的 bug
|
|
20
|
+
mooho-base-admin-plus@2.3.0 - 表格只读文本字段增加强制单行、固定在最前选项
|
|
21
|
+
mooho-base-admin-plus@2.3.1 - 前端增加默认每页默认数量配置 layout.pageSize
|
|
22
|
+
mooho-base-admin-plus@2.3.2 - 修改表格 open 时参数无法带入的 bug
|
|
23
|
+
mooho-base-admin-plus@2.3.3 - 增加菜单筛选
|
|
24
|
+
mooho-base-admin-plus@2.3.4 - 菜单筛选默认关闭
|
|
25
|
+
mooho-base-admin-plus@2.3.5 - 解决菜单只能筛选两层的 bug
|
|
26
|
+
mooho-base-admin-plus@2.3.6 - 解决修改筛选导致的弹出选择框 bug
|
|
27
|
+
mooho-base-admin-plus@2.3.7 - 继续解决修改筛选导致的弹出选择框 bug
|
|
28
|
+
mooho-base-admin-plus@2.3.8 - 增加可筛选选择框支持
|
|
29
|
+
mooho-base-admin-plus@2.3.9 - 优化默认筛选参数:filter 的处理方式
|
|
30
|
+
mooho-base-admin-plus@2.3.10 - 可筛选选择框 bug 修复
|
|
31
|
+
mooho-base-admin-plus@2.3.11 - 弹出框增加全屏按钮
|
|
32
|
+
mooho-base-admin-plus@2.3.12 - 解决弹出框全屏按钮有时会关闭窗口的 bug
|
|
33
|
+
mooho-base-admin-plus@2.3.13 - 解决表格弹出框无法关闭的 bug
|
|
34
|
+
mooho-base-admin-plus@2.4.0 - 增加表格弹出显示表单
|
|
35
|
+
mooho-base-admin-plus@2.4.1 - 增加 int 类型时间戳显示支持
|
|
36
|
+
mooho-base-admin-plus@2.4.2 - 附件 json 的 file 字段支持 http 开头地址,用于外部链接
|
|
37
|
+
mooho-base-admin-plus@2.4.3 - 附件下载改为弹出新页,为了兼容 某些文件下载时直接打开,无法回退。如 pdf
|
|
38
|
+
mooho-base-admin-plus@2.4.4 - 附件下载 div 改为 span,解决点击空白处也会下载的问题
|
|
39
|
+
mooho-base-admin-plus@2.4.5 - 修复表格中显示图片报错的 bug
|
|
40
|
+
mooho-base-admin-plus@2.4.6 - 表格允许查看、允许编辑、允许删除属性增加函数类型
|
|
41
|
+
mooho-base-admin-plus@2.4.7 - 计算列触发条件优化
|
|
42
|
+
mooho-base-admin-plus@2.4.8 - 批量选择时无法触发选择
|
|
43
|
+
mooho-base-admin-plus@2.4.9 - 增加 ModalTable 的查看支持
|
|
44
|
+
mooho-base-admin-plus@2.4.10 - showData 支持多行显示(换行、空格)
|
|
45
|
+
mooho-base-admin-plus@2.4.11 - 增加 string 类型时间戳显示支持
|
|
46
|
+
mooho-base-admin-plus@2.4.12 - 增加 string 类型时间戳显示支持 bug 修复
|
|
47
|
+
mooho-base-admin-plus@2.4.13 - 增加 string 类型时间戳显示支持 bug 修复
|
|
48
|
+
mooho-base-admin-plus@2.4.14 - 修复草稿状态下点击历史显示所有的问题
|
|
49
|
+
mooho-base-admin-plus@2.4.15 - 修复自定义模型表格导出和打印的 bug
|
|
50
|
+
mooho-base-admin-plus@2.4.16 - 修复弹出表单全屏后高度不能 100%的 bug
|
|
51
|
+
mooho-base-admin-plus@2.4.17 - 分拆登录方法,应对 sso 登录
|
|
52
|
+
mooho-base-admin-plus@2.4.18 - 修复上一版本导致的 bug
|
|
53
|
+
mooho-base-admin-plus@2.4.19 - 修复自定义图标按钮无法显示的 bug
|
|
54
|
+
mooho-base-admin-plus@2.4.20 - 默认值下拉框优化
|
|
55
|
+
mooho-base-admin-plus@2.4.21 - 优化 login css 避免污染其他页面
|
|
56
|
+
mooho-base-admin-plus@2.4.22 - transfer bug 修复
|
|
57
|
+
mooho-base-admin-plus@2.4.23 - 表格加载完成触发 change 事件,解决自动计算无法触发的 bug
|
|
58
|
+
mooho-base-admin-plus@2.4.24 - 修复登录时未更新菜单的 bug
|
|
59
|
+
mooho-base-admin-plus@2.4.25 - 增加上传文件大小限制
|
|
60
|
+
mooho-base-admin-plus@2.4.26 - 优化计算列,避免转换对象
|
|
61
|
+
mooho-base-admin-plus@2.4.27 - 优化标题默认样式
|
|
62
|
+
mooho-base-admin-plus@2.4.28 - 修复可筛选下拉框选中内容会跳回原值的bug
|
|
63
|
+
mooho-base-admin-plus@2.4.29 - 修复新增、修改开放接口用户密码未加密的bug
|
|
64
|
+
mooho-base-admin-plus@2.4.30 - 批量选择支持默认值
|
|
65
|
+
mooho-base-admin-plus@2.4.31 - 增加自定义功能导入导出
|
|
66
|
+
mooho-base-admin-plus@2.4.32 - 修复切换强制换行后不会马上换行的bug
|
|
67
|
+
mooho-base-admin-plus@2.4.33 - 修复多选可筛选选择框无法删除已选项的bug
|
|
68
|
+
mooho-base-admin-plus@2.4.34 - 修复带参数的路由地址无法处理权限点的bug
|
|
69
|
+
mooho-base-admin-plus@2.4.35 - showMultiLine函数增加判断,非字符串不处理
|
|
70
|
+
mooho-base-admin-plus@2.4.36 - 增加了组件覆盖支持
|
|
71
|
+
mooho-base-admin-plus@2.4.37 - 增加component导出
|
|
72
|
+
mooho-base-admin-plus@2.4.38 - 修复上一版本bug
|
|
73
|
+
mooho-base-admin-plus@2.4.39 - 修复菜单管理界面无法用关键词查询的bug
|
|
74
|
+
mooho-base-admin-plus@2.4.40 - 表格序号列表头增加序号显示
|
|
@@ -43560,7 +43560,7 @@ const _sfc_main$_ = {
|
|
|
43560
43560
|
});
|
|
43561
43561
|
if (this.tableView.snEnable) {
|
|
43562
43562
|
this.columns.unshift({
|
|
43563
|
-
title: "
|
|
43563
|
+
title: this.$t("Front_Label_Sn"),
|
|
43564
43564
|
slot: "sn",
|
|
43565
43565
|
align: "center",
|
|
43566
43566
|
width: 60
|
|
@@ -303,7 +303,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
303
303
|
@binding {object} form \u8868\u5355\u5BF9\u8C61\r
|
|
304
304
|
`),require$$0.renderSlot(a.$slots,"bottom",{form:this})]),_:3},8,["model","rules"]),require$$0.createCommentVNode(` <FooterToolbar>\r
|
|
305
305
|
<Button type="primary" size="large">{{ $t('Front_Btn_Submit') }}</Button>\r
|
|
306
|
-
</FooterToolbar>`)])}var viewForm=_export_sfc(_sfc_main$$,[["render",_sfc_render$$],["__file","D:/Project/Mooho/FrontEnd/mooho-base-admin-plus/src/components/view/view-form.vue"]]),__glob_25_29=Object.freeze(Object.defineProperty({__proto__:null,default:viewForm},Symbol.toStringTag,{value:"Module"})),viewTable_vue_vue_type_style_index_0_scoped_true_lang="",getColumns=(a,r)=>{let o=a.viewColumns.filter(s=>s.parentCode==r.code);if(o.length>0)return{...r,title:r.name,renderHeader:(s,l)=>s("span",{innerHTML:l.column.name.replace("|","<br/>")}),key:r.code,align:r.align?r.align.toLowerCase():"center",children:o.length>0?o.map(s=>getColumns(a,s)):null};{let s={},l=localStorage.getItem("columnWidth_"+a.dataView.code);return l&&(s=JSON.parse(l)),{...r,title:r.name,renderHeader:(u,c)=>u("span",{innerHTML:c.column.name.replace("|","<br/>")}),key:r.code,dataType:r.dataType,format:r.displayFormat,width:s[r.code]?s[r.code]:r.controlWidth,minWidth:100,align:r.align?r.align.toLowerCase():"center",sortable:!a.dataView.sortDisable&&!r.sortDisable?"custom":!1,resizable:!0,slot:"normal"}}};const _sfc_main$_={mixins:[mixin$1,mixinPage],components:{tableFilter,tableSetting,filterSetting},data(){return{inited:!1,size:10,orderBy:null,tableView:{},columns:[],viewFilter:{},filterColumns:[],data:[],staticData:[],selectedData:[],current:1,total:0,setting:!1,dialogActive:!1,tableSettingActive:!1,filterSettingActive:!1,itemSelectActive:!1,commandButtons:[],preview:!1,imageUrl:null,isFullScreen:!1,commandButtonParams:null}},async created(){this.viewCode&&setTimeout(async()=>{await this.init(this.viewCode),this.$emit("after-init")}),this.viewCode&&this.autoLoad&&this.loadData()},activated(){},props:{title:{type:String},viewCode:{type:String},readonly:{type:Boolean,default:!1},embedded:{type:Boolean,default:!1},parentData:{type:Object,default(){return{}}},static:{type:Boolean,default:!1},filter:{type:Object,default(){return{}}},settingEnable:{type:Boolean,default:!0},autoLoad:{type:Boolean,default:!0},selectEnable:{type:Boolean,default:!1},checkCrossPage:{type:Boolean,default:!1},treeEnable:{type:Boolean,default:!1},treeLoad:{type:Function},hasChildren:{type:Function},height:{type:Number,default:null},createEnable:{type:Boolean,default:!0},editEnable:{type:[Boolean,Function],default:!0},showEnable:{type:[Boolean,Function],default:!0},removeEnable:{type:[Boolean,Function],default:!0},draggable:{type:Boolean,default:!1},filterEnable:{type:Boolean,default:!0},pageEnable:{type:Boolean,default:!0},filterDisable:{type:Boolean,default:!1},beforeLoadData:{type:Function},onSearch:{type:Function},summaryMethod:{type:Function},pageSizeOpts:{type:Array},spanMethod:{type:Function},loadDataEnable:{type:Boolean,default:!0},rowClassName:{type:Function}},computed:{maxHeight(){if(this.height==null){let a=1;return Setting.layout.autoFixRatio==!0&&window.screen.width<1920&&window.screen.width*window.devicePixelRatio<=1920&&!navigator.userAgent.match(/AppleWebKit.*Mobile.*/)&&!navigator.userAgent.match(/.*Android.*/)&&(a=1/window.devicePixelRatio),this.isFullScreen?document.body.offsetHeight/a-100-this.$refs.filterCommand.offsetHeight/a:document.body.offsetHeight/a-350}else return this.height},filterData(){return this.$refs.tableFilter?this.$refs.tableFilter.data:null}},watch:{},methods:{...mapActions("admin/dataView",{loadDataView:"load"}),async init(a,r,o){let s=await this.loadDataView(a);if(s&&!s.isExist&&a.indexOf("_")>=0&&(s=await this.loadDataView(a.split("_")[0])),s!=null){if(!s.isExist){typeof o=="function"?o():this.error("Front_Msg_View_Code_Not_Exist|"+a);return}if(this.tableView=s.dataView,this.tableView.columns=s.viewColumns,this.tableView.filterColumns=s.filterColumns,this.filterColumns=s.filterColumns,(this.tableView.commandButton||"").trim()?this.commandButtons=JSON.parse(this.tableView.commandButton):this.commandButtons=[],this.$emit("on-ready",this.tableView),this.columns=s.viewColumns.filter(l=>!(l.parentCode||"").trim()).map(l=>getColumns(s,l)),this.columns.forEach(l=>{l.name=this.getNameI18n(l),l.fixed=l.isFixed?"left":null}),this.tableView.snEnable&&this.columns.unshift({title:" ",slot:"sn",align:"center",width:60}),this.tableView.commandEnable){let l={title:" ",slot:"command",align:"center",width:this.embedded&&!this.tableView.commandWidth?60:this.tableView.commandWidth==null?90:(this.tableView.commandWidth+1)*28,fixed:"right"};this.embedded&&this.tableView.batchSelectEnable&&this.createEnable&&!this.readonly?(l.renderHeader=u=>u("div",{},[u(require$$0.resolveComponent("Button"),{type:"primary",shape:"circle",icon:"md-checkmark-circle-outline",size:"small",style:{height:"20px",width:"20px"},onClick:()=>{this.openSelectItem()}})]),this.itemSelectActive=!0,setTimeout(()=>{this.$refs.itemSelect.init(this.tableView.batchSelectDataModel+"Source",this.tableView.batchSelectDataModel+"Target",()=>{this.$refs.itemSelect.loadSource()})})):this.embedded&&this.tableView.createEnable&&this.createEnable&&!this.readonly&&(l.renderHeader=u=>u("div",{},[u(require$$0.resolveComponent("Button"),{type:"primary",shape:"circle",icon:"md-add",size:"small",style:{height:"20px",width:"20px"},onClick:()=>{this.addNew()}})])),this.columns.push(l)}if((this.selectEnable||this.tableView.checkEnable)&&this.columns.unshift({type:"selection",align:"center",width:60}),this.treeEnable&&this.columns.unshift({tree:!0,display:"inline",align:"left",width:100}),this.tableView.size?this.size=this.tableView.size:this.tableView.pageEnable&&this.pageEnable?this.size=Setting.layout.pageSize:this.size=1e3,this.tableView.sorting){let l=JSON.parse(this.tableView.sorting),u=[];for(let c in l)l[c]==="desc"?u.push("-"+c):u.push("+"+c);this.orderBy=u.join(",")}else this.orderBy=null;if(this.tableView.filtering){let l=JSON.parse(this.tableView.filtering);for(let u in l)this.viewFilter[u]=l[u]}else this.viewFilter={};this.tableView.keywordEnable&&!!(this.tableView.keywordColumn||"").trim()?this.viewFilter.keywordColumns=this.tableView.keywordColumn:this.viewFilter.keywordColumns=null,this.selectedData=[],this.inited=!0,this.initTrigger(),setTimeout(()=>{typeof r=="function"&&r()})}},async loadData(a){if(!this.loadDataEnable){this.total=0,this.data=[];return}if(!(!this.inited&&(await this.init(this.viewCode),!this.inited))){if(typeof this.beforeLoadData=="function"&&this.beforeLoadData(),a&&(this.staticData=this.copy(a)),this.static){let r=this.getFilterResult();this.total=r.length;let o=(this.current-1)*this.size;this.data=o+this.size>=r.length?r.slice(o,r.length):r.slice(o,o+this.size)}else{let r={...this.getAllFilter(),page:this.current,per:this.size,orderBy:this.orderBy};if(this.tableView.isGroupBy&&(r.isGroupBy=!0,r.groupColumn=JSON.parse(this.tableView.groupColumn),r.groupMethod=JSON.parse(this.tableView.groupMethod)),this.tableView.isCustom){let o=await customModelApi.query(this.tableView.model,r);this.total=o.totalCount,this.data=o.data}else if(this.tableView.isDataSource){let o=await dataSourceApi.query(this.tableView.dataSource,r);this.total=o.totalCount,this.data=o.table}else{let o=await modelApi.query(this.tableView.model,r,this.tableView.functionName,this.tableView.functionType);this.total=o.totalCount,this.data=o.data}if(this.tableView.isDynamicColumn&&(this.columns=this.columns.filter(o=>o.slot!="normal"),this.data.length>0)){let o=0;for(const s in this.data[0])this.columns.push({name:s,title:s,code:s,key:"column_"+o,dataType:"String",align:"center",slot:"normal",controlType:"Label",isShow:!0});o++}this.current>Math.ceil(this.total/this.size)&&(this.current=Math.ceil(this.total/this.size)),this.current<=0&&(this.current=1),this.checkCrossPage||this.tableView.checkCrossPage?this.data.forEach(o=>{o._checked=this.selectedData.some(s=>o.id===s.id)}):this.selectedData=[]}this.data.forEach(r=>{this.setShowStatus(r)}),this.treeEnable&&(this.data.forEach(r=>{(this.hasChildren==null||this.hasChildren(r))&&(r._loading=!1,r.children=[])}),this.data=this.copy(this.data)),this.initDataSource();for(let r=0;r<this.data.length;r++)this.calc(this.data[r]);this.$emit("on-load-data"),this.$emit("on-change",null,null,null),this.$refs.tableFilter}},create(){this.$emit("create")},edit(a,r){this.$emit("edit",{row:a,index:r})},show(a,r){this.$emit("show",{row:a,index:r})},remove(a,r){this.confirm("Front_Msg_Sure_To_Delete_Item",async()=>{this.embedded?(this.staticData.splice((this.current-1)*this.size+r,1),this.loadData(),this.$emit("on-change",a)):(this.tableView.isCustom?await customModelApi.remove(this.tableView.model,a.id):await modelApi.remove(this.tableView.model,a.id),this.success("Front_Msg_Success",()=>{this.loadData()}))})},getDefaultData(){let a={};return this.columns.forEach(r=>{if(r.defaultValue)if(r.defaultValue=="{today}"){let s=new Date().toISOString().replace(/T.*/,"");this.setData(a,r.code,new Date(s))}else if(r.defaultValue.startsWith("{today(")&&r.defaultValue.endsWith(")}")){let o=r.defaultValue.substr(7,r.defaultValue.length-9);this.setData(a,r.code,format$3(new Date,o))}else r.defaultValue=="{currentUserID}"?this.setData(a,r.code,this.info.id):r.defaultValue=="{currentUser}"?this.setData(a,r.code,this.info.name):r.dataType==="Integer"?this.setData(a,r.code,parseInt(r.defaultValue)):r.dataType==="Decimal"?this.setData(a,r.code,parseFloat(r.defaultValue)):r.dataType==="Boolean"&&r.defaultValue.toUpperCase=="TRUE"?this.setData(a,r.code,!0):r.dataType==="Boolean"&&r.defaultValue.toUpperCase=="FALSE"?this.setData(a,r.code,!1):this.setData(a,r.code,r.defaultValue);else r.dataType==="Boolean"?this.setData(a,r.code,!1):this.setData(a,r.code,null)}),a},addNew(){this.staticData.push(this.getDefaultData()),this.loadData()},getSelected(){return this.selectedData},setSelected(a){this.selectedData=[],a.forEach(r=>{this.selectedData.push(r)}),this.static?(this.staticData.forEach(r=>{r._checked=this.selectedData.some(o=>r.id===o.id)}),this.loadData()):this.data.forEach(r=>{r._checked=this.selectedData.some(o=>r.id===o.id)}),this.data=this.copy(this.data)},validate(){for(let a=0;a<this.staticData.length;a++){let r=this.staticData[a];for(let o=0;o<this.columns.length;o++){let s=this.columns[o];if(r._isShow&&r._isShow[s.code]==!1)continue;if(s.isShow==!1)continue;let l=s.isRequired;if((s.requiredJson||"").trim()){let u=JSON.parse(s.requiredJson);(u.type=="Condition"||u.type=="Expression")&&(l=this.judgeCondition(u,r))}if(l){let u=this.parseData(r,s.code);if(u==null||!(String(u)||"").trim())return this.error("Front_Msg_Row_Column_Required|"+(a+1)+"|"+s.name),!1}}}return!0},getData(){let a=null;return this.static?a=this.copy(this.staticData):a=this.copy(this.data),a.forEach(r=>{delete r._checked,delete r._dataSource,delete r._needRefresh,delete r._needClear,delete r._rawData}),a},resetFilter(){for(let a in this.filterData)delete this.filterData[a]},search(){typeof this.onSearch=="function"?this.onSearch():this.loadData()},async moreClick(a){!this.inited&&(await this.init(this.viewCode),!this.inited)||(this.static?a==="exportExcel"?dataViewApi.exportExcel(this.tableView,this.staticData,this.columns.filter(r=>r.slot=="normal")):a==="exportPdf"?dataViewApi.exportPdf(this.tableView,this.staticData,this.columns.filter(r=>r.slot=="normal")):a==="print"?dataViewApi.print(this.tableView,this.staticData,this.columns.filter(r=>r.slot=="normal")):a==="batchEdit"&&this.error("Front_Msg_Not_Supported"):a==="exportExcel"?this.exportExcel():a==="exportPdf"?this.exportPdf():a==="print"?this.print():a==="batchEdit"&&this.$refs.batchEditTable.init(this.tableView.batchEditView,async()=>{let r;this.tableView.isCustom?r=await customModelApi.query(this.tableView.model,{}):r=await modelApi.query(this.tableView.model,{}),this.$refs.batchEditTable.loadData(r.data),this.$refs.batchEditTable.open()}))},exportExcel(){let a={...this.getAllFilter(),orderBy:this.orderBy};this.tableView.isCustom?customModelApi.exportExcel(this.tableView,a):this.tableView.isDataSource?dataSourceApi.exportExcel(this.tableView,a):modelApi.exportExcel(this.tableView,a)},exportPdf(){let a={...this.getAllFilter(),orderBy:this.orderBy};this.tableView.isCustom?customModelApi.exportPdf(this.tableView,a):this.tableView.isDataSource?dataSourceApi.exportPdf(this.tableView,a):modelApi.exportPdf(this.tableView,a)},print(){let a={...this.getAllFilter(),orderBy:this.orderBy};this.tableView.isCustom?customModelApi.printList(this.tableView,a):this.tableView.isDataSource?dataSourceApi.printList(this.tableView,a):modelApi.printList(this.tableView,a)},initDataSource(){this.columns.forEach(a=>{(a.controlType=="Select"||a.controlType=="MultiSelect"||a.controlType=="SelectWithOther"||a.controlType=="ComboSelect"||a.controlType=="MultiComboSelect"||a.controlType=="Radio"||a.controlType=="CheckGroup")&&(a.isStaticItem?this.data.forEach(r=>{if(!r._dataSource)r._dataSource={},r._rawData={},r._needRefresh={},r._needClear={};else if(r._dataSource[a.code])return;r._dataSource[a.code]=[],r._rawData[a.code]=[],(a.itemData||"").trim()&&a.itemData.split(/[\n]/).forEach(o=>{if((o||"").trim())if(o.split(":").length>1){let s=o.split(":")[0],l=o.split(":")[1];r._dataSource[a.code].push({id:s,name:l})}else r._dataSource[a.code].push({id:o,name:o})})}):!!(a.source||"").trim()&&!(a.dataType&&a.dataType.startsWith("Enum:"))&&this.data.forEach(r=>{if(r._dataSource&&r._dataSource[a.code])return;let o=this.getParam(r,a,this.parentData);o!=null&&this.fillDataSource(r,a,o)}))})},initTrigger(){this.columns.forEach(a=>{a.triggers=[]}),this.columns.filter(a=>!a.isStaticItem&&!!(a.source||"").trim()&&!!(a.param||"").trim()&&!(a.dataType&&a.dataType.startsWith("Enum:"))).forEach(a=>{let r=JSON.parse(a.param);for(let o in r)this.columns.filter(s=>r[o]==s.code||r[o].split(".")[0]+"ID"==s.code).forEach(s=>{s.triggers.push(this.copy(a))})})},async fillDataSource(a,r,o){a._dataSource||(a._dataSource={},a._rawData={},a._needRefresh={},a._needClear={}),(r.controlType==="ComboSelect"||r.controlType==="MultiComboSelect")&&(o.per=20),this.disableLoader();let s;if(r.isSourceCustom?s=await customModelApi.query(r.source,o):s=await modelApi.query(r.source,o),this.enableLoader(),a._rawData[r.code]=s.data,a._dataSource[r.code]=s.data.map(l=>({id:(r.sourceDataCode||"").trim()?this.parseData(l,r.sourceDataCode):l.id,name:this.parseData(l,r.sourceDisplayCode)})),a&&this.parseData(a,r.code)==null&&r.isDefaultFirst&&s.data.length>0&&(this.setData(a,r.code,this.parseData(s.data[0],r.sourceDataCode)),r.sourceDataCode=="id"&&r.code.length>2)){let l=r.code.substr(0,r.code.length-2);if(a._rawData&&a._rawData[r.code]){let u=a._rawData[r.code].find(c=>c.id==this.parseData(a,r.code));this.setData(a,l,u)}}this.data=this.data.map(l=>l),this.onDataChange(a,r)},getDataSource(a,r){if(!r.isStaticItem&&r.dataType.startsWith("Enum:"))return this.getEnumList(r.dataType.split(":")[1]);if(a._dataSource!=null&&a._dataSource[r.code]!=null)return a._dataSource[r.code]},pageSizeChange(a){this.size=a,this.loadData()},sortChange({key:a,order:r}){let o=[];this.orderBy&&(o=this.orderBy.split(",")),o=o.filter(s=>s.substring(1)!==a),r==="asc"?o.unshift("+"+a):r==="desc"&&o.unshift("-"+a),this.orderBy=o.join(","),this.loadData()},columnWidthResize(a,r,o){let s={},l=localStorage.getItem("columnWidth_"+this.tableView.code);l&&(s=JSON.parse(l)),s[o.code]=a,localStorage.setItem("columnWidth_"+this.tableView.code,JSON.stringify(s))},onSelectDataChange(a,r,o){let s;r.code.endsWith("ID")&&(s=r.code.substr(0,r.code.length-2));let l=null;if(typeof o=="object")if(o instanceof Array){l=[];for(let u of o)typeof u=="object"?l.push(u):a._rawData&&a._rawData[r.code]?l.push(a._rawData[r.code].find(c=>this.parseData(c,r.sourceDataCode)==u)):l.push(u)}else l=o;else a._rawData&&a._rawData[r.code]?l=a._rawData[r.code].find(u=>this.parseData(u,r.sourceDataCode)==o):l=o;s&&this.setData(a,s,l),this.onDataChange(a,r,l)},onDataChange(a,r,o){for(this.setShowStatus(a),this.calc(a,r),this.$emit("on-change",a,r,o),(r==null||r.triggers!==[])&&this.columns.forEach(function(s){!s.isStaticItem&&!!(s.source||"").trim()&&!(s.dataType&&s.dataType.startsWith("Enum:"))&&(r==null||r.triggers.some(l=>l.code==s.code))&&a._needRefresh&&(a._needRefresh[s.code]=!0)});;){let s=this.columns.filter(l=>a._needRefresh&&a._needRefresh[l.code]==!0||a._needClear&&a._needClear[l.code]==!0)[0];if(s==null)break;if(a._needClear[s.code]&&this.parseData(a,s.code)!=null)this.setData(a,s.code,null),s.triggers.forEach(l=>{a._needClear[l.code]=!0});else if(a._needRefresh[s.code]&&!!(s.source||"").trim()&&!(s.dataType&&s.dataType.startsWith("Enum:"))){let l=this.getParam(a,s,this.parentData);s.controlType==="Select"||s.controlType==="SelectWithOther"||s.controlType==="ComboSelect"||s.controlType==="MulitSelect"||s.controlType==="Radio"||s.controlType==="CheckGroup"?l!=null?this.fillDataSource(a,s,l):(a._dataSource[s.code]=[],this.setData(a,s.code,null),s.triggers.forEach(u=>{a._needClear[u.code]=!0})):(s.controlType==="DialogSelect"||s.controlType==="MultiDialogSelect")&&l==null&&(this.setData(a,s.code,null),s.triggers.forEach(u=>{a._needClear[u.code]=!0}))}a._needClear[s.code]=!1,a._needRefresh[s.code]=!1}},calc(a,r){for(let o=0;o<this.columns.length;o++){let s=this.columns[o];if((s.calculate||"").trim()){let l=this.getTriggers(s.calculate);if(!r||l.some(u=>u==r.code)){let u=this.calculate(s.calculate,a);s.digit!=null&&(u=this.keepDecimal(u,s.digit,s.fixedDigit)),this.setData(a,s.code,u)}}}},onBlur(a,r){this.$emit("on-blur",a,r)},tableSettingOpen(){this.tableSettingActive=!0,setTimeout(()=>{this.$refs.tableSetting.open(this.tableView,this.copy(this.tableView.columns))})},filterSettingOpen(){this.filterSettingActive=!0,setTimeout(()=>{this.$refs.filterSetting.open(this.tableView,this.copy(this.tableView.filterColumns))})},onSelectionChange(a){this.getDataWithChildren(this.data).forEach(o=>{const s=this.selectedData.findIndex(l=>l.id==o.id);a.some(l=>l.id==o.id)?s==-1&&this.selectedData.push(o):s!=-1&&this.selectedData.splice(s,1)}),this.$emit("on-select-change")},onKeyup(a){if(a){var r=window.event?a.keyCode:a.which;if(!r||r!==0&&r!==1&&r!==13)return}this.search()},getAllFilter(){var r,o;let a={...this.viewFilter,...(r=this.filter)!=null?r:{},...(o=this.filterData)!=null?o:{}};for(let s in a)this.isJSON(a[s])?a[s]=JSON.parse(a[s]).join(","):typeof a[s]=="object"&&!(a[s]instanceof Date)&&delete a[s];return a},getFilterResult(){var r,o;let a=this.staticData;if(!this.filterDisable){let s={...this.viewFilter,...(r=this.filter)!=null?r:{},...(o=this.filterData)!=null?o:{}};for(let l in s){let u=l,c=s[l];c==null||c==""||this.filterColumns.some(d=>d.code==l&&d.operator=="Custom")||typeof c=="object"&&!(c instanceof Date)||u!="keywordColumns"&&(a=a.filter(d=>{if((u.startsWith("d_")||u.startsWith("m_")||u.startsWith("y_"))&&(u=u.substr(2)),u=="keyword"){let f=s.keywordColumns.split(",");for(let h=0;h<f.length;h++){let p=f[h];if(this.parseData(d,p)!=null&&this.parseData(d,p).indexOf(c)>=0)return!0}return!1}else if(u.endsWith("_g")){let f=u.substr(0,u.length-2);return c instanceof Date?new Date(this.parseData(d,f))>c:this.parseData(d,f)>c}else if(u.endsWith("_l")){let f=u.substr(0,u.length-2);return c instanceof Date?new Date(this.parseData(d,f))<c:this.parseData(d,f)<c}else if(u.endsWith("_ge")){let f=u.substr(0,u.length-3);return c instanceof Date?new Date(this.parseData(d,f))>=c:this.parseData(d,f)>=c}else if(u.endsWith("_le")){let f=u.substr(0,u.length-3);return c instanceof Date?new Date(this.parseData(d,f))<=c:this.parseData(d,f)<=c}else if(u.endsWith("_n")){let f=u.substr(0,u.length-2);if(typeof c=="string"){for(let h=0;h<c.split(",").length;h++)if(this.parseData(d,f)!=c.split(",")[h])return!0;return!1}else return c instanceof Date?new Date(this.parseData(d,f))!=c:this.parseData(d,f)!=c}else if(u.endsWith("_c")){let f=u.substr(0,u.length-2);return this.parseData(d,f)!=null&&this.parseData(d,f).indexOf(c)>=0}else{let f=u;return typeof c=="string"?this.isJSON(c)?JSON.parse(c).some(h=>h==this.parseData(d,f)):c.split(",").some(h=>h==this.parseData(d,f)):c instanceof Date?new Date(this.parseData(d,f))==c:this.parseData(d,f)==c}}))}}if((this.orderBy||"").trim()){let s=this.orderBy.split(",")[0],l=s.substr(0,1),u=s.substr(1);a.sort((c,d)=>{let f=this.parseData(c,u),h=this.parseData(d,u);return f==h?0:f>h||h==null?l=="+"?1:-1:l=="+"?-1:1})}return a},async onLoadData(a,r){if(this.treeLoad!=null){let o=await this.treeLoad(a);o.forEach(s=>{(this.hasChildren==null||this.hasChildren(s))&&(s._loading=!1,s.children=[])}),r(o)}},dragDrop(a,r){this.$emit("on-drag-drop",{index1:a,index2:r})},openSelectItem(){let a=[],r=this.tableView.batchSelectDataCode,o=r.substr(0,r.length-2);for(let s=0;s<this.staticData.length;s++)a.push(this.staticData[s][o]);this.$refs.itemSelect.setSelected(a),this.$refs.itemSelect.open()},saveItemSelect(){let a=this.$refs.itemSelect.getSelected(),r=this.tableView.batchSelectDataCode,o=r.substr(0,r.length-2);this.staticData=this.staticData.filter(s=>a.some(l=>l.id==s[r]));for(let s=0;s<a.length;s++)if(!this.staticData.some(l=>l[r]==a[s].id)){let l=this.getDefaultData();l[r]=a[s].id,l[o]=a[s],this.staticData.push(l)}this.loadData(this.staticData),this.$refs.itemSelect.close()},clickCommandButton(a,r){r.viewType=="TableView"?this.$refs.modalTable.init(r.viewCode,async()=>{if((r.formViewCode||"").trim()&&this.$refs.modalForm.init(r.formViewCode),this.commandButtonParams={},(r.params||"").trim()){let o=JSON.parse(r.params);for(let s=0;s<o.length;s++){let l=this.parseData(a,o[s].value);this.commandButtonParams[o[s].param]=l}}this.$refs.modalTable.open(this.commandButtonParams)}):this.$refs.modalForm.init(r.formViewCode,async()=>{this.$refs.modalForm.open(a)})},previewImage(a){this.imageUrl=a,this.preview=!0},handleSpan({row:a,column:r,rowIndex:o,columnIndex:s}){if(this.spanMethod!=null)return this.spanMethod(a,r,o,s);if(r.mergeSame){if(o!=0&&this.parseData(a,r.code)==this.parseData(this.data[o-1],r.code))return[0,0];let l=0;for(let u=o;u<this.data.length;u++)if(this.parseData(a,r.code)==this.parseData(this.data[u],r.code))l++;else return[l,1];return[l,1]}},judge(a,r,o){if((r||"").trim()){let s=JSON.parse(r);if(s.type=="Condition"||s.type=="Expression")return this.judgeCondition(s,o)}return a},isShow(a,r){return a._isShow!=null&&a._isShow[r.code]!=null?a._isShow[r.code]:r.isShow},isReadonly(a,r){return this.readonly==!0?!0:a._isReadonly!=null&&a._isReadonly[r.code]!=null?a._isReadonly[r.code]:r.isReadonly},batchSave(){!this.$refs.batchEditTable.validate()||this.confirm("Front_Msg_Sure_To_Save",async()=>{let a=this.$refs.batchEditTable.data;this.tableView.isCustom?await customModelApi.batchSave(this.tableView.model,a):await modelApi.batchSave(this.tableView.model,a),this.success("Front_Msg_Success",()=>{this.$refs.batchEditTable.close(),this.loadData()})})},rowData(a,r){return this.treeEnable?a:this.data[r]},getDataWithChildren(a){let r=[];return a.forEach(o=>{r.push(o),o.children&&(r=r.concat(this.getDataWithChildren(o.children)))}),r},setShowStatus(a){for(let r of this.columns){if((r.showJson||"").trim()){a._isShow==null&&(a._isShow={});let o=JSON.parse(r.showJson);(o.type=="Condition"||o.type=="Expression")&&(a._isShow[r.code]=this.judgeCondition(o,a))}if((r.readonlyJson||"").trim()){a._isReadonly==null&&(a._isReadonly={});let o=JSON.parse(r.readonlyJson);(o.type=="Condition"||o.type=="Expression")&&(a._isReadonly[r.code]=this.judgeCondition(o,a))}}},getNameI18n(a){if(a)if(this.layout.showI18n){if(a.code){let r="DataView_"+this.tableView.code+"_"+a.code,o=this.$t(r);return o==r?a.name:o}}else return a.name},up(a,r){let o=this.staticData;if(r>0){o.splice(r,1),o.splice(r-1,0,a);for(let s of o)delete s.id;this.loadData(o)}},down(a,r){let o=this.staticData;if(r<o.length-1){o.splice(r,1),o.splice(r+1,0,a);for(let s of o)delete s.id;this.loadData(o)}},clear(){this.staticData=[],this.data=[]},parseDataWithOther(a,r){let o=r.code,s=this.parseData(a,o+"_o"),l=this.parseData(a,o),u=this.getDataSource(a,r);return s!=null?s:l==null?null:u&&u.some(c=>c.id==l)?l:"__Other"},setDataWithOther(a,r,o){this.setData(a,r+"_o",o),o!="__Other"?this.setData(a,r,o):this.setData(a,r,null)},getJustify(a){return a=="Left"?"start":a=="Center"?"center":(a=="Right","end")},async loadOption(a,r,o){if(r.isStaticItem||r.dataType&&r.dataType.startsWith("Enum:"))return;let s=this.getParam(a,r);s!=null?(s[r.sourceDisplayCode+"_c"]=o,this.fillDataSource(a,r,s)):(a._rawData[r.code]=[],a._dataSource[r.code]=[],this.setData(a,r.code,null),r.triggers.forEach(l=>{l.needClear=!0}))},parseComboData(a,r,o){let s=this.parseData(a,r.code);return setTimeout(()=>{this.loadComboDataLabel(a,r,s,o)}),s},parseMultiComboData(a,r,o){let s=[],l=this.parseData(a,r.code);return this.isJSON(l)&&(s=JSON.parse(l)),setTimeout(()=>{this.loadComboDataLabel(a,r,s,o)}),s},async loadComboDataLabel(a,r,o,s){if(!(r.isStaticItem||r.dataType&&r.dataType.startsWith("Enum:"))&&this.$refs["control_"+r.code+"_"+s]&&o){let l=this.$refs["control_"+r.code+"_"+s].$data.values,u=[];if(r.controlType=="MultiComboSelect")o.forEach(c=>{if(!l.some(d=>d.value==c)){let d={value:c,label:null,disabled:!1};l.push(d),u.push(d)}});else if(!l.some(c=>c.value==o)){let c={value:o,label:null,disabled:!1};l.push(c),u.push(c)}if(u.length>0){let c=this.getParam(a,r);c[r.sourceDataCode]=u.map(f=>f.value).join(",");let d;r.isSourceCustom?d=await customModelApi.query(r.source,c):d=await modelApi.query(r.source,c),d.data.forEach(f=>{let h=this.parseData(f,r.sourceDataCode),p=this.parseData(f,r.sourceDisplayCode);r.controlType=="ComboSelect";let v=u.find(g=>g.value==h);v&&(v.label=p),this.$forceUpdate()})}}}}},_hoisted_1$Q={class:"title"},_hoisted_2$r={ref:"filterCommand"},_hoisted_3$m=["title","innerHTML"],_hoisted_4$h=["href","target"],_hoisted_5$9=["innerHTML"],_hoisted_6$8={key:10,style:{display:"flex"}},_hoisted_7$6=["href"],_hoisted_8$6={style:{margin:"auto 4px"}},_hoisted_9$6=["onClick","src"],_hoisted_10$4={class:"ivu-mt ivu-text-right"},_hoisted_11$3={style:{"text-align":"center"}},_hoisted_12$3=["download"],_hoisted_13$3=["src"];function _sfc_render$_(a,r,o,s,l,u){const c=require$$0.resolveComponent("Divider"),d=require$$0.resolveComponent("table-filter"),f=require$$0.resolveComponent("Button"),h=require$$0.resolveComponent("Icon"),p=require$$0.resolveComponent("DropdownItem"),v=require$$0.resolveComponent("DropdownMenu"),g=require$$0.resolveComponent("Dropdown"),y=require$$0.resolveComponent("FormItem"),$=require$$0.resolveComponent("Col"),_=require$$0.resolveComponent("Row"),C=require$$0.resolveComponent("Form"),b=require$$0.resolveComponent("Input"),w=require$$0.resolveComponent("Option"),x=require$$0.resolveComponent("Select"),D=require$$0.resolveComponent("dialog-select"),A=require$$0.resolveComponent("DatePicker"),E=require$$0.resolveComponent("TimePicker"),P=require$$0.resolveComponent("Checkbox"),O=require$$0.resolveComponent("Switch"),q=require$$0.resolveComponent("Radio"),M=require$$0.resolveComponent("RadioGroup"),R=require$$0.resolveComponent("CheckboxGroup"),L=require$$0.resolveComponent("Slider"),F=require$$0.resolveComponent("Table"),N=require$$0.resolveComponent("Page"),H=require$$0.resolveComponent("modal-table"),B=require$$0.resolveComponent("table-setting"),X=require$$0.resolveComponent("filter-setting"),J=require$$0.resolveComponent("item-select"),ie=require$$0.resolveComponent("modal-form"),de=require$$0.resolveComponent("Modal");return require$$0.openBlock(),require$$0.createElementBlock("div",{class:require$$0.normalizeClass({"full-screen":l.isFullScreen})},[o.title!=null?(require$$0.openBlock(),require$$0.createBlock(c,{key:0,plain:!0,dashed:"",orientation:"left",size:"small"},{default:require$$0.withCtx(()=>[require$$0.createElementVNode("span",_hoisted_1$Q,require$$0.toDisplayString(o.title),1)]),_:1})):require$$0.createCommentVNode("v-if",!0),require$$0.createCommentVNode(`\r
|
|
306
|
+
</FooterToolbar>`)])}var viewForm=_export_sfc(_sfc_main$$,[["render",_sfc_render$$],["__file","D:/Project/Mooho/FrontEnd/mooho-base-admin-plus/src/components/view/view-form.vue"]]),__glob_25_29=Object.freeze(Object.defineProperty({__proto__:null,default:viewForm},Symbol.toStringTag,{value:"Module"})),viewTable_vue_vue_type_style_index_0_scoped_true_lang="",getColumns=(a,r)=>{let o=a.viewColumns.filter(s=>s.parentCode==r.code);if(o.length>0)return{...r,title:r.name,renderHeader:(s,l)=>s("span",{innerHTML:l.column.name.replace("|","<br/>")}),key:r.code,align:r.align?r.align.toLowerCase():"center",children:o.length>0?o.map(s=>getColumns(a,s)):null};{let s={},l=localStorage.getItem("columnWidth_"+a.dataView.code);return l&&(s=JSON.parse(l)),{...r,title:r.name,renderHeader:(u,c)=>u("span",{innerHTML:c.column.name.replace("|","<br/>")}),key:r.code,dataType:r.dataType,format:r.displayFormat,width:s[r.code]?s[r.code]:r.controlWidth,minWidth:100,align:r.align?r.align.toLowerCase():"center",sortable:!a.dataView.sortDisable&&!r.sortDisable?"custom":!1,resizable:!0,slot:"normal"}}};const _sfc_main$_={mixins:[mixin$1,mixinPage],components:{tableFilter,tableSetting,filterSetting},data(){return{inited:!1,size:10,orderBy:null,tableView:{},columns:[],viewFilter:{},filterColumns:[],data:[],staticData:[],selectedData:[],current:1,total:0,setting:!1,dialogActive:!1,tableSettingActive:!1,filterSettingActive:!1,itemSelectActive:!1,commandButtons:[],preview:!1,imageUrl:null,isFullScreen:!1,commandButtonParams:null}},async created(){this.viewCode&&setTimeout(async()=>{await this.init(this.viewCode),this.$emit("after-init")}),this.viewCode&&this.autoLoad&&this.loadData()},activated(){},props:{title:{type:String},viewCode:{type:String},readonly:{type:Boolean,default:!1},embedded:{type:Boolean,default:!1},parentData:{type:Object,default(){return{}}},static:{type:Boolean,default:!1},filter:{type:Object,default(){return{}}},settingEnable:{type:Boolean,default:!0},autoLoad:{type:Boolean,default:!0},selectEnable:{type:Boolean,default:!1},checkCrossPage:{type:Boolean,default:!1},treeEnable:{type:Boolean,default:!1},treeLoad:{type:Function},hasChildren:{type:Function},height:{type:Number,default:null},createEnable:{type:Boolean,default:!0},editEnable:{type:[Boolean,Function],default:!0},showEnable:{type:[Boolean,Function],default:!0},removeEnable:{type:[Boolean,Function],default:!0},draggable:{type:Boolean,default:!1},filterEnable:{type:Boolean,default:!0},pageEnable:{type:Boolean,default:!0},filterDisable:{type:Boolean,default:!1},beforeLoadData:{type:Function},onSearch:{type:Function},summaryMethod:{type:Function},pageSizeOpts:{type:Array},spanMethod:{type:Function},loadDataEnable:{type:Boolean,default:!0},rowClassName:{type:Function}},computed:{maxHeight(){if(this.height==null){let a=1;return Setting.layout.autoFixRatio==!0&&window.screen.width<1920&&window.screen.width*window.devicePixelRatio<=1920&&!navigator.userAgent.match(/AppleWebKit.*Mobile.*/)&&!navigator.userAgent.match(/.*Android.*/)&&(a=1/window.devicePixelRatio),this.isFullScreen?document.body.offsetHeight/a-100-this.$refs.filterCommand.offsetHeight/a:document.body.offsetHeight/a-350}else return this.height},filterData(){return this.$refs.tableFilter?this.$refs.tableFilter.data:null}},watch:{},methods:{...mapActions("admin/dataView",{loadDataView:"load"}),async init(a,r,o){let s=await this.loadDataView(a);if(s&&!s.isExist&&a.indexOf("_")>=0&&(s=await this.loadDataView(a.split("_")[0])),s!=null){if(!s.isExist){typeof o=="function"?o():this.error("Front_Msg_View_Code_Not_Exist|"+a);return}if(this.tableView=s.dataView,this.tableView.columns=s.viewColumns,this.tableView.filterColumns=s.filterColumns,this.filterColumns=s.filterColumns,(this.tableView.commandButton||"").trim()?this.commandButtons=JSON.parse(this.tableView.commandButton):this.commandButtons=[],this.$emit("on-ready",this.tableView),this.columns=s.viewColumns.filter(l=>!(l.parentCode||"").trim()).map(l=>getColumns(s,l)),this.columns.forEach(l=>{l.name=this.getNameI18n(l),l.fixed=l.isFixed?"left":null}),this.tableView.snEnable&&this.columns.unshift({title:this.$t("Front_Label_Sn"),slot:"sn",align:"center",width:60}),this.tableView.commandEnable){let l={title:" ",slot:"command",align:"center",width:this.embedded&&!this.tableView.commandWidth?60:this.tableView.commandWidth==null?90:(this.tableView.commandWidth+1)*28,fixed:"right"};this.embedded&&this.tableView.batchSelectEnable&&this.createEnable&&!this.readonly?(l.renderHeader=u=>u("div",{},[u(require$$0.resolveComponent("Button"),{type:"primary",shape:"circle",icon:"md-checkmark-circle-outline",size:"small",style:{height:"20px",width:"20px"},onClick:()=>{this.openSelectItem()}})]),this.itemSelectActive=!0,setTimeout(()=>{this.$refs.itemSelect.init(this.tableView.batchSelectDataModel+"Source",this.tableView.batchSelectDataModel+"Target",()=>{this.$refs.itemSelect.loadSource()})})):this.embedded&&this.tableView.createEnable&&this.createEnable&&!this.readonly&&(l.renderHeader=u=>u("div",{},[u(require$$0.resolveComponent("Button"),{type:"primary",shape:"circle",icon:"md-add",size:"small",style:{height:"20px",width:"20px"},onClick:()=>{this.addNew()}})])),this.columns.push(l)}if((this.selectEnable||this.tableView.checkEnable)&&this.columns.unshift({type:"selection",align:"center",width:60}),this.treeEnable&&this.columns.unshift({tree:!0,display:"inline",align:"left",width:100}),this.tableView.size?this.size=this.tableView.size:this.tableView.pageEnable&&this.pageEnable?this.size=Setting.layout.pageSize:this.size=1e3,this.tableView.sorting){let l=JSON.parse(this.tableView.sorting),u=[];for(let c in l)l[c]==="desc"?u.push("-"+c):u.push("+"+c);this.orderBy=u.join(",")}else this.orderBy=null;if(this.tableView.filtering){let l=JSON.parse(this.tableView.filtering);for(let u in l)this.viewFilter[u]=l[u]}else this.viewFilter={};this.tableView.keywordEnable&&!!(this.tableView.keywordColumn||"").trim()?this.viewFilter.keywordColumns=this.tableView.keywordColumn:this.viewFilter.keywordColumns=null,this.selectedData=[],this.inited=!0,this.initTrigger(),setTimeout(()=>{typeof r=="function"&&r()})}},async loadData(a){if(!this.loadDataEnable){this.total=0,this.data=[];return}if(!(!this.inited&&(await this.init(this.viewCode),!this.inited))){if(typeof this.beforeLoadData=="function"&&this.beforeLoadData(),a&&(this.staticData=this.copy(a)),this.static){let r=this.getFilterResult();this.total=r.length;let o=(this.current-1)*this.size;this.data=o+this.size>=r.length?r.slice(o,r.length):r.slice(o,o+this.size)}else{let r={...this.getAllFilter(),page:this.current,per:this.size,orderBy:this.orderBy};if(this.tableView.isGroupBy&&(r.isGroupBy=!0,r.groupColumn=JSON.parse(this.tableView.groupColumn),r.groupMethod=JSON.parse(this.tableView.groupMethod)),this.tableView.isCustom){let o=await customModelApi.query(this.tableView.model,r);this.total=o.totalCount,this.data=o.data}else if(this.tableView.isDataSource){let o=await dataSourceApi.query(this.tableView.dataSource,r);this.total=o.totalCount,this.data=o.table}else{let o=await modelApi.query(this.tableView.model,r,this.tableView.functionName,this.tableView.functionType);this.total=o.totalCount,this.data=o.data}if(this.tableView.isDynamicColumn&&(this.columns=this.columns.filter(o=>o.slot!="normal"),this.data.length>0)){let o=0;for(const s in this.data[0])this.columns.push({name:s,title:s,code:s,key:"column_"+o,dataType:"String",align:"center",slot:"normal",controlType:"Label",isShow:!0});o++}this.current>Math.ceil(this.total/this.size)&&(this.current=Math.ceil(this.total/this.size)),this.current<=0&&(this.current=1),this.checkCrossPage||this.tableView.checkCrossPage?this.data.forEach(o=>{o._checked=this.selectedData.some(s=>o.id===s.id)}):this.selectedData=[]}this.data.forEach(r=>{this.setShowStatus(r)}),this.treeEnable&&(this.data.forEach(r=>{(this.hasChildren==null||this.hasChildren(r))&&(r._loading=!1,r.children=[])}),this.data=this.copy(this.data)),this.initDataSource();for(let r=0;r<this.data.length;r++)this.calc(this.data[r]);this.$emit("on-load-data"),this.$emit("on-change",null,null,null),this.$refs.tableFilter}},create(){this.$emit("create")},edit(a,r){this.$emit("edit",{row:a,index:r})},show(a,r){this.$emit("show",{row:a,index:r})},remove(a,r){this.confirm("Front_Msg_Sure_To_Delete_Item",async()=>{this.embedded?(this.staticData.splice((this.current-1)*this.size+r,1),this.loadData(),this.$emit("on-change",a)):(this.tableView.isCustom?await customModelApi.remove(this.tableView.model,a.id):await modelApi.remove(this.tableView.model,a.id),this.success("Front_Msg_Success",()=>{this.loadData()}))})},getDefaultData(){let a={};return this.columns.forEach(r=>{if(r.defaultValue)if(r.defaultValue=="{today}"){let s=new Date().toISOString().replace(/T.*/,"");this.setData(a,r.code,new Date(s))}else if(r.defaultValue.startsWith("{today(")&&r.defaultValue.endsWith(")}")){let o=r.defaultValue.substr(7,r.defaultValue.length-9);this.setData(a,r.code,format$3(new Date,o))}else r.defaultValue=="{currentUserID}"?this.setData(a,r.code,this.info.id):r.defaultValue=="{currentUser}"?this.setData(a,r.code,this.info.name):r.dataType==="Integer"?this.setData(a,r.code,parseInt(r.defaultValue)):r.dataType==="Decimal"?this.setData(a,r.code,parseFloat(r.defaultValue)):r.dataType==="Boolean"&&r.defaultValue.toUpperCase=="TRUE"?this.setData(a,r.code,!0):r.dataType==="Boolean"&&r.defaultValue.toUpperCase=="FALSE"?this.setData(a,r.code,!1):this.setData(a,r.code,r.defaultValue);else r.dataType==="Boolean"?this.setData(a,r.code,!1):this.setData(a,r.code,null)}),a},addNew(){this.staticData.push(this.getDefaultData()),this.loadData()},getSelected(){return this.selectedData},setSelected(a){this.selectedData=[],a.forEach(r=>{this.selectedData.push(r)}),this.static?(this.staticData.forEach(r=>{r._checked=this.selectedData.some(o=>r.id===o.id)}),this.loadData()):this.data.forEach(r=>{r._checked=this.selectedData.some(o=>r.id===o.id)}),this.data=this.copy(this.data)},validate(){for(let a=0;a<this.staticData.length;a++){let r=this.staticData[a];for(let o=0;o<this.columns.length;o++){let s=this.columns[o];if(r._isShow&&r._isShow[s.code]==!1)continue;if(s.isShow==!1)continue;let l=s.isRequired;if((s.requiredJson||"").trim()){let u=JSON.parse(s.requiredJson);(u.type=="Condition"||u.type=="Expression")&&(l=this.judgeCondition(u,r))}if(l){let u=this.parseData(r,s.code);if(u==null||!(String(u)||"").trim())return this.error("Front_Msg_Row_Column_Required|"+(a+1)+"|"+s.name),!1}}}return!0},getData(){let a=null;return this.static?a=this.copy(this.staticData):a=this.copy(this.data),a.forEach(r=>{delete r._checked,delete r._dataSource,delete r._needRefresh,delete r._needClear,delete r._rawData}),a},resetFilter(){for(let a in this.filterData)delete this.filterData[a]},search(){typeof this.onSearch=="function"?this.onSearch():this.loadData()},async moreClick(a){!this.inited&&(await this.init(this.viewCode),!this.inited)||(this.static?a==="exportExcel"?dataViewApi.exportExcel(this.tableView,this.staticData,this.columns.filter(r=>r.slot=="normal")):a==="exportPdf"?dataViewApi.exportPdf(this.tableView,this.staticData,this.columns.filter(r=>r.slot=="normal")):a==="print"?dataViewApi.print(this.tableView,this.staticData,this.columns.filter(r=>r.slot=="normal")):a==="batchEdit"&&this.error("Front_Msg_Not_Supported"):a==="exportExcel"?this.exportExcel():a==="exportPdf"?this.exportPdf():a==="print"?this.print():a==="batchEdit"&&this.$refs.batchEditTable.init(this.tableView.batchEditView,async()=>{let r;this.tableView.isCustom?r=await customModelApi.query(this.tableView.model,{}):r=await modelApi.query(this.tableView.model,{}),this.$refs.batchEditTable.loadData(r.data),this.$refs.batchEditTable.open()}))},exportExcel(){let a={...this.getAllFilter(),orderBy:this.orderBy};this.tableView.isCustom?customModelApi.exportExcel(this.tableView,a):this.tableView.isDataSource?dataSourceApi.exportExcel(this.tableView,a):modelApi.exportExcel(this.tableView,a)},exportPdf(){let a={...this.getAllFilter(),orderBy:this.orderBy};this.tableView.isCustom?customModelApi.exportPdf(this.tableView,a):this.tableView.isDataSource?dataSourceApi.exportPdf(this.tableView,a):modelApi.exportPdf(this.tableView,a)},print(){let a={...this.getAllFilter(),orderBy:this.orderBy};this.tableView.isCustom?customModelApi.printList(this.tableView,a):this.tableView.isDataSource?dataSourceApi.printList(this.tableView,a):modelApi.printList(this.tableView,a)},initDataSource(){this.columns.forEach(a=>{(a.controlType=="Select"||a.controlType=="MultiSelect"||a.controlType=="SelectWithOther"||a.controlType=="ComboSelect"||a.controlType=="MultiComboSelect"||a.controlType=="Radio"||a.controlType=="CheckGroup")&&(a.isStaticItem?this.data.forEach(r=>{if(!r._dataSource)r._dataSource={},r._rawData={},r._needRefresh={},r._needClear={};else if(r._dataSource[a.code])return;r._dataSource[a.code]=[],r._rawData[a.code]=[],(a.itemData||"").trim()&&a.itemData.split(/[\n]/).forEach(o=>{if((o||"").trim())if(o.split(":").length>1){let s=o.split(":")[0],l=o.split(":")[1];r._dataSource[a.code].push({id:s,name:l})}else r._dataSource[a.code].push({id:o,name:o})})}):!!(a.source||"").trim()&&!(a.dataType&&a.dataType.startsWith("Enum:"))&&this.data.forEach(r=>{if(r._dataSource&&r._dataSource[a.code])return;let o=this.getParam(r,a,this.parentData);o!=null&&this.fillDataSource(r,a,o)}))})},initTrigger(){this.columns.forEach(a=>{a.triggers=[]}),this.columns.filter(a=>!a.isStaticItem&&!!(a.source||"").trim()&&!!(a.param||"").trim()&&!(a.dataType&&a.dataType.startsWith("Enum:"))).forEach(a=>{let r=JSON.parse(a.param);for(let o in r)this.columns.filter(s=>r[o]==s.code||r[o].split(".")[0]+"ID"==s.code).forEach(s=>{s.triggers.push(this.copy(a))})})},async fillDataSource(a,r,o){a._dataSource||(a._dataSource={},a._rawData={},a._needRefresh={},a._needClear={}),(r.controlType==="ComboSelect"||r.controlType==="MultiComboSelect")&&(o.per=20),this.disableLoader();let s;if(r.isSourceCustom?s=await customModelApi.query(r.source,o):s=await modelApi.query(r.source,o),this.enableLoader(),a._rawData[r.code]=s.data,a._dataSource[r.code]=s.data.map(l=>({id:(r.sourceDataCode||"").trim()?this.parseData(l,r.sourceDataCode):l.id,name:this.parseData(l,r.sourceDisplayCode)})),a&&this.parseData(a,r.code)==null&&r.isDefaultFirst&&s.data.length>0&&(this.setData(a,r.code,this.parseData(s.data[0],r.sourceDataCode)),r.sourceDataCode=="id"&&r.code.length>2)){let l=r.code.substr(0,r.code.length-2);if(a._rawData&&a._rawData[r.code]){let u=a._rawData[r.code].find(c=>c.id==this.parseData(a,r.code));this.setData(a,l,u)}}this.data=this.data.map(l=>l),this.onDataChange(a,r)},getDataSource(a,r){if(!r.isStaticItem&&r.dataType.startsWith("Enum:"))return this.getEnumList(r.dataType.split(":")[1]);if(a._dataSource!=null&&a._dataSource[r.code]!=null)return a._dataSource[r.code]},pageSizeChange(a){this.size=a,this.loadData()},sortChange({key:a,order:r}){let o=[];this.orderBy&&(o=this.orderBy.split(",")),o=o.filter(s=>s.substring(1)!==a),r==="asc"?o.unshift("+"+a):r==="desc"&&o.unshift("-"+a),this.orderBy=o.join(","),this.loadData()},columnWidthResize(a,r,o){let s={},l=localStorage.getItem("columnWidth_"+this.tableView.code);l&&(s=JSON.parse(l)),s[o.code]=a,localStorage.setItem("columnWidth_"+this.tableView.code,JSON.stringify(s))},onSelectDataChange(a,r,o){let s;r.code.endsWith("ID")&&(s=r.code.substr(0,r.code.length-2));let l=null;if(typeof o=="object")if(o instanceof Array){l=[];for(let u of o)typeof u=="object"?l.push(u):a._rawData&&a._rawData[r.code]?l.push(a._rawData[r.code].find(c=>this.parseData(c,r.sourceDataCode)==u)):l.push(u)}else l=o;else a._rawData&&a._rawData[r.code]?l=a._rawData[r.code].find(u=>this.parseData(u,r.sourceDataCode)==o):l=o;s&&this.setData(a,s,l),this.onDataChange(a,r,l)},onDataChange(a,r,o){for(this.setShowStatus(a),this.calc(a,r),this.$emit("on-change",a,r,o),(r==null||r.triggers!==[])&&this.columns.forEach(function(s){!s.isStaticItem&&!!(s.source||"").trim()&&!(s.dataType&&s.dataType.startsWith("Enum:"))&&(r==null||r.triggers.some(l=>l.code==s.code))&&a._needRefresh&&(a._needRefresh[s.code]=!0)});;){let s=this.columns.filter(l=>a._needRefresh&&a._needRefresh[l.code]==!0||a._needClear&&a._needClear[l.code]==!0)[0];if(s==null)break;if(a._needClear[s.code]&&this.parseData(a,s.code)!=null)this.setData(a,s.code,null),s.triggers.forEach(l=>{a._needClear[l.code]=!0});else if(a._needRefresh[s.code]&&!!(s.source||"").trim()&&!(s.dataType&&s.dataType.startsWith("Enum:"))){let l=this.getParam(a,s,this.parentData);s.controlType==="Select"||s.controlType==="SelectWithOther"||s.controlType==="ComboSelect"||s.controlType==="MulitSelect"||s.controlType==="Radio"||s.controlType==="CheckGroup"?l!=null?this.fillDataSource(a,s,l):(a._dataSource[s.code]=[],this.setData(a,s.code,null),s.triggers.forEach(u=>{a._needClear[u.code]=!0})):(s.controlType==="DialogSelect"||s.controlType==="MultiDialogSelect")&&l==null&&(this.setData(a,s.code,null),s.triggers.forEach(u=>{a._needClear[u.code]=!0}))}a._needClear[s.code]=!1,a._needRefresh[s.code]=!1}},calc(a,r){for(let o=0;o<this.columns.length;o++){let s=this.columns[o];if((s.calculate||"").trim()){let l=this.getTriggers(s.calculate);if(!r||l.some(u=>u==r.code)){let u=this.calculate(s.calculate,a);s.digit!=null&&(u=this.keepDecimal(u,s.digit,s.fixedDigit)),this.setData(a,s.code,u)}}}},onBlur(a,r){this.$emit("on-blur",a,r)},tableSettingOpen(){this.tableSettingActive=!0,setTimeout(()=>{this.$refs.tableSetting.open(this.tableView,this.copy(this.tableView.columns))})},filterSettingOpen(){this.filterSettingActive=!0,setTimeout(()=>{this.$refs.filterSetting.open(this.tableView,this.copy(this.tableView.filterColumns))})},onSelectionChange(a){this.getDataWithChildren(this.data).forEach(o=>{const s=this.selectedData.findIndex(l=>l.id==o.id);a.some(l=>l.id==o.id)?s==-1&&this.selectedData.push(o):s!=-1&&this.selectedData.splice(s,1)}),this.$emit("on-select-change")},onKeyup(a){if(a){var r=window.event?a.keyCode:a.which;if(!r||r!==0&&r!==1&&r!==13)return}this.search()},getAllFilter(){var r,o;let a={...this.viewFilter,...(r=this.filter)!=null?r:{},...(o=this.filterData)!=null?o:{}};for(let s in a)this.isJSON(a[s])?a[s]=JSON.parse(a[s]).join(","):typeof a[s]=="object"&&!(a[s]instanceof Date)&&delete a[s];return a},getFilterResult(){var r,o;let a=this.staticData;if(!this.filterDisable){let s={...this.viewFilter,...(r=this.filter)!=null?r:{},...(o=this.filterData)!=null?o:{}};for(let l in s){let u=l,c=s[l];c==null||c==""||this.filterColumns.some(d=>d.code==l&&d.operator=="Custom")||typeof c=="object"&&!(c instanceof Date)||u!="keywordColumns"&&(a=a.filter(d=>{if((u.startsWith("d_")||u.startsWith("m_")||u.startsWith("y_"))&&(u=u.substr(2)),u=="keyword"){let f=s.keywordColumns.split(",");for(let h=0;h<f.length;h++){let p=f[h];if(this.parseData(d,p)!=null&&this.parseData(d,p).indexOf(c)>=0)return!0}return!1}else if(u.endsWith("_g")){let f=u.substr(0,u.length-2);return c instanceof Date?new Date(this.parseData(d,f))>c:this.parseData(d,f)>c}else if(u.endsWith("_l")){let f=u.substr(0,u.length-2);return c instanceof Date?new Date(this.parseData(d,f))<c:this.parseData(d,f)<c}else if(u.endsWith("_ge")){let f=u.substr(0,u.length-3);return c instanceof Date?new Date(this.parseData(d,f))>=c:this.parseData(d,f)>=c}else if(u.endsWith("_le")){let f=u.substr(0,u.length-3);return c instanceof Date?new Date(this.parseData(d,f))<=c:this.parseData(d,f)<=c}else if(u.endsWith("_n")){let f=u.substr(0,u.length-2);if(typeof c=="string"){for(let h=0;h<c.split(",").length;h++)if(this.parseData(d,f)!=c.split(",")[h])return!0;return!1}else return c instanceof Date?new Date(this.parseData(d,f))!=c:this.parseData(d,f)!=c}else if(u.endsWith("_c")){let f=u.substr(0,u.length-2);return this.parseData(d,f)!=null&&this.parseData(d,f).indexOf(c)>=0}else{let f=u;return typeof c=="string"?this.isJSON(c)?JSON.parse(c).some(h=>h==this.parseData(d,f)):c.split(",").some(h=>h==this.parseData(d,f)):c instanceof Date?new Date(this.parseData(d,f))==c:this.parseData(d,f)==c}}))}}if((this.orderBy||"").trim()){let s=this.orderBy.split(",")[0],l=s.substr(0,1),u=s.substr(1);a.sort((c,d)=>{let f=this.parseData(c,u),h=this.parseData(d,u);return f==h?0:f>h||h==null?l=="+"?1:-1:l=="+"?-1:1})}return a},async onLoadData(a,r){if(this.treeLoad!=null){let o=await this.treeLoad(a);o.forEach(s=>{(this.hasChildren==null||this.hasChildren(s))&&(s._loading=!1,s.children=[])}),r(o)}},dragDrop(a,r){this.$emit("on-drag-drop",{index1:a,index2:r})},openSelectItem(){let a=[],r=this.tableView.batchSelectDataCode,o=r.substr(0,r.length-2);for(let s=0;s<this.staticData.length;s++)a.push(this.staticData[s][o]);this.$refs.itemSelect.setSelected(a),this.$refs.itemSelect.open()},saveItemSelect(){let a=this.$refs.itemSelect.getSelected(),r=this.tableView.batchSelectDataCode,o=r.substr(0,r.length-2);this.staticData=this.staticData.filter(s=>a.some(l=>l.id==s[r]));for(let s=0;s<a.length;s++)if(!this.staticData.some(l=>l[r]==a[s].id)){let l=this.getDefaultData();l[r]=a[s].id,l[o]=a[s],this.staticData.push(l)}this.loadData(this.staticData),this.$refs.itemSelect.close()},clickCommandButton(a,r){r.viewType=="TableView"?this.$refs.modalTable.init(r.viewCode,async()=>{if((r.formViewCode||"").trim()&&this.$refs.modalForm.init(r.formViewCode),this.commandButtonParams={},(r.params||"").trim()){let o=JSON.parse(r.params);for(let s=0;s<o.length;s++){let l=this.parseData(a,o[s].value);this.commandButtonParams[o[s].param]=l}}this.$refs.modalTable.open(this.commandButtonParams)}):this.$refs.modalForm.init(r.formViewCode,async()=>{this.$refs.modalForm.open(a)})},previewImage(a){this.imageUrl=a,this.preview=!0},handleSpan({row:a,column:r,rowIndex:o,columnIndex:s}){if(this.spanMethod!=null)return this.spanMethod(a,r,o,s);if(r.mergeSame){if(o!=0&&this.parseData(a,r.code)==this.parseData(this.data[o-1],r.code))return[0,0];let l=0;for(let u=o;u<this.data.length;u++)if(this.parseData(a,r.code)==this.parseData(this.data[u],r.code))l++;else return[l,1];return[l,1]}},judge(a,r,o){if((r||"").trim()){let s=JSON.parse(r);if(s.type=="Condition"||s.type=="Expression")return this.judgeCondition(s,o)}return a},isShow(a,r){return a._isShow!=null&&a._isShow[r.code]!=null?a._isShow[r.code]:r.isShow},isReadonly(a,r){return this.readonly==!0?!0:a._isReadonly!=null&&a._isReadonly[r.code]!=null?a._isReadonly[r.code]:r.isReadonly},batchSave(){!this.$refs.batchEditTable.validate()||this.confirm("Front_Msg_Sure_To_Save",async()=>{let a=this.$refs.batchEditTable.data;this.tableView.isCustom?await customModelApi.batchSave(this.tableView.model,a):await modelApi.batchSave(this.tableView.model,a),this.success("Front_Msg_Success",()=>{this.$refs.batchEditTable.close(),this.loadData()})})},rowData(a,r){return this.treeEnable?a:this.data[r]},getDataWithChildren(a){let r=[];return a.forEach(o=>{r.push(o),o.children&&(r=r.concat(this.getDataWithChildren(o.children)))}),r},setShowStatus(a){for(let r of this.columns){if((r.showJson||"").trim()){a._isShow==null&&(a._isShow={});let o=JSON.parse(r.showJson);(o.type=="Condition"||o.type=="Expression")&&(a._isShow[r.code]=this.judgeCondition(o,a))}if((r.readonlyJson||"").trim()){a._isReadonly==null&&(a._isReadonly={});let o=JSON.parse(r.readonlyJson);(o.type=="Condition"||o.type=="Expression")&&(a._isReadonly[r.code]=this.judgeCondition(o,a))}}},getNameI18n(a){if(a)if(this.layout.showI18n){if(a.code){let r="DataView_"+this.tableView.code+"_"+a.code,o=this.$t(r);return o==r?a.name:o}}else return a.name},up(a,r){let o=this.staticData;if(r>0){o.splice(r,1),o.splice(r-1,0,a);for(let s of o)delete s.id;this.loadData(o)}},down(a,r){let o=this.staticData;if(r<o.length-1){o.splice(r,1),o.splice(r+1,0,a);for(let s of o)delete s.id;this.loadData(o)}},clear(){this.staticData=[],this.data=[]},parseDataWithOther(a,r){let o=r.code,s=this.parseData(a,o+"_o"),l=this.parseData(a,o),u=this.getDataSource(a,r);return s!=null?s:l==null?null:u&&u.some(c=>c.id==l)?l:"__Other"},setDataWithOther(a,r,o){this.setData(a,r+"_o",o),o!="__Other"?this.setData(a,r,o):this.setData(a,r,null)},getJustify(a){return a=="Left"?"start":a=="Center"?"center":(a=="Right","end")},async loadOption(a,r,o){if(r.isStaticItem||r.dataType&&r.dataType.startsWith("Enum:"))return;let s=this.getParam(a,r);s!=null?(s[r.sourceDisplayCode+"_c"]=o,this.fillDataSource(a,r,s)):(a._rawData[r.code]=[],a._dataSource[r.code]=[],this.setData(a,r.code,null),r.triggers.forEach(l=>{l.needClear=!0}))},parseComboData(a,r,o){let s=this.parseData(a,r.code);return setTimeout(()=>{this.loadComboDataLabel(a,r,s,o)}),s},parseMultiComboData(a,r,o){let s=[],l=this.parseData(a,r.code);return this.isJSON(l)&&(s=JSON.parse(l)),setTimeout(()=>{this.loadComboDataLabel(a,r,s,o)}),s},async loadComboDataLabel(a,r,o,s){if(!(r.isStaticItem||r.dataType&&r.dataType.startsWith("Enum:"))&&this.$refs["control_"+r.code+"_"+s]&&o){let l=this.$refs["control_"+r.code+"_"+s].$data.values,u=[];if(r.controlType=="MultiComboSelect")o.forEach(c=>{if(!l.some(d=>d.value==c)){let d={value:c,label:null,disabled:!1};l.push(d),u.push(d)}});else if(!l.some(c=>c.value==o)){let c={value:o,label:null,disabled:!1};l.push(c),u.push(c)}if(u.length>0){let c=this.getParam(a,r);c[r.sourceDataCode]=u.map(f=>f.value).join(",");let d;r.isSourceCustom?d=await customModelApi.query(r.source,c):d=await modelApi.query(r.source,c),d.data.forEach(f=>{let h=this.parseData(f,r.sourceDataCode),p=this.parseData(f,r.sourceDisplayCode);r.controlType=="ComboSelect";let v=u.find(g=>g.value==h);v&&(v.label=p),this.$forceUpdate()})}}}}},_hoisted_1$Q={class:"title"},_hoisted_2$r={ref:"filterCommand"},_hoisted_3$m=["title","innerHTML"],_hoisted_4$h=["href","target"],_hoisted_5$9=["innerHTML"],_hoisted_6$8={key:10,style:{display:"flex"}},_hoisted_7$6=["href"],_hoisted_8$6={style:{margin:"auto 4px"}},_hoisted_9$6=["onClick","src"],_hoisted_10$4={class:"ivu-mt ivu-text-right"},_hoisted_11$3={style:{"text-align":"center"}},_hoisted_12$3=["download"],_hoisted_13$3=["src"];function _sfc_render$_(a,r,o,s,l,u){const c=require$$0.resolveComponent("Divider"),d=require$$0.resolveComponent("table-filter"),f=require$$0.resolveComponent("Button"),h=require$$0.resolveComponent("Icon"),p=require$$0.resolveComponent("DropdownItem"),v=require$$0.resolveComponent("DropdownMenu"),g=require$$0.resolveComponent("Dropdown"),y=require$$0.resolveComponent("FormItem"),$=require$$0.resolveComponent("Col"),_=require$$0.resolveComponent("Row"),C=require$$0.resolveComponent("Form"),b=require$$0.resolveComponent("Input"),w=require$$0.resolveComponent("Option"),x=require$$0.resolveComponent("Select"),D=require$$0.resolveComponent("dialog-select"),A=require$$0.resolveComponent("DatePicker"),E=require$$0.resolveComponent("TimePicker"),P=require$$0.resolveComponent("Checkbox"),O=require$$0.resolveComponent("Switch"),q=require$$0.resolveComponent("Radio"),M=require$$0.resolveComponent("RadioGroup"),R=require$$0.resolveComponent("CheckboxGroup"),L=require$$0.resolveComponent("Slider"),F=require$$0.resolveComponent("Table"),N=require$$0.resolveComponent("Page"),H=require$$0.resolveComponent("modal-table"),B=require$$0.resolveComponent("table-setting"),X=require$$0.resolveComponent("filter-setting"),J=require$$0.resolveComponent("item-select"),ie=require$$0.resolveComponent("modal-form"),de=require$$0.resolveComponent("Modal");return require$$0.openBlock(),require$$0.createElementBlock("div",{class:require$$0.normalizeClass({"full-screen":l.isFullScreen})},[o.title!=null?(require$$0.openBlock(),require$$0.createBlock(c,{key:0,plain:!0,dashed:"",orientation:"left",size:"small"},{default:require$$0.withCtx(()=>[require$$0.createElementVNode("span",_hoisted_1$Q,require$$0.toDisplayString(o.title),1)]),_:1})):require$$0.createCommentVNode("v-if",!0),require$$0.createCommentVNode(`\r
|
|
307
307
|
@slot \u9876\u90E8\r
|
|
308
308
|
`),require$$0.renderSlot(a.$slots,"top",{},void 0,!0),require$$0.withDirectives(require$$0.createVNode(C,{model:o.filter,"label-width":l.tableView.filterTitleWidth?l.tableView.filterTitleWidth:a.layout.filterWidth,"label-colon":"\uFF1A","label-position":"right",class:"filter",onSubmit:r[3]||(r[3]=require$$0.withModifiers(()=>{},["prevent"]))},{default:require$$0.withCtx(()=>[require$$0.createElementVNode("div",_hoisted_2$r,[require$$0.createVNode(_,{gutter:24,type:"flex",justify:u.getJustify(l.tableView.filterAlign)},{default:require$$0.withCtx(()=>[require$$0.createCommentVNode(`\r
|
|
309
309
|
@slot \u7B5B\u9009\u680F\r
|
package/package.json
CHANGED