cnhis-design-vue 3.1.41-beta.7 → 3.1.41-beta.9
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/README.md +87 -87
- package/es/components/button-print/src/utils/print.d.ts +1 -1
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/useFormField.d.ts +1 -0
- package/es/components/form-render/src/hooks/useFormField.js +1 -1
- package/es/components/form-render/src/utils/dom.d.ts +2 -1
- package/es/components/form-render/src/utils/dom.js +1 -1
- package/es/components/iho-table/index.d.ts +2 -2
- package/es/components/iho-table/src/IhoTable.vue.d.ts +2 -2
- package/es/components/iho-table/src/IhoTable.vue.js +1 -1
- package/es/components/iho-table/src/plugins/{filterPlugin → filterRenderPlugin}/filter.vue.d.ts +15 -74
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.js +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +6 -6
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue.d.ts +0 -3
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/components/table-filter/index.d.ts +2 -71
- package/es/components/table-filter/src/classification/Classification-com.vue.d.ts +2 -20
- package/es/components/table-filter/src/classification/Classification-com.vue.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -1
- package/es/components/table-filter/src/components/search-filter/index.vue.js +1 -1
- package/es/components/table-filter/src/components/set-classification/index.vue.d.ts +2 -18
- package/es/components/table-filter/src/components/set-classification/index.vue.js +1 -1
- package/es/components/table-filter/src/components/table-modal/index.vue.js +1 -1
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.d.ts +0 -51
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.js +1 -1
- package/es/components/table-filter/style/index.css +1 -1
- package/es/env.d.ts +24 -24
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/callback/src/components/form.d.ts +0 -0
- package/es/components/callback/src/components/page.d.ts +0 -0
- package/es/components/callback/src/components/table.d.ts +0 -0
- package/es/components/callback/src/types/index.d.ts +0 -0
- package/es/components/callback/src/types/index.js +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.js +0 -1
- package/es/components/iho-table/src/plugins/filterPlugin/index.d.ts +0 -1
- package/es/components/iho-table/src/plugins/filterPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/filterPlugin/types.d.ts +0 -7
- package/es/components/iho-table/src/plugins/filterPlugin/types.js +0 -1
- package/es/components/table-filter/src/components/age-com/index.vue.d.ts +0 -119
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.d.ts +0 -199
- package/es/components/table-filter/src/components/button-icon/getBtnIcon.d.ts +0 -2
- package/es/components/table-filter/src/components/button-icon/getBtnIcon.js +0 -1
- package/es/components/table-filter/src/components/c-tree-select/tree-select.vue.d.ts +0 -90
- package/es/components/table-filter/src/components/multi-select/multi-select.vue.d.ts +0 -113
- package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.d.ts +0 -266
- package/es/components/table-filter/src/components/range-age/index.vue.d.ts +0 -248
- package/es/components/table-filter/src/const/dataOptions.d.ts +0 -12
- package/es/components/table-filter/src/const/dataOptions.js +0 -1
- package/es/components/table-filter/src/directive/preventReClick.d.ts +0 -4
- package/es/components/table-filter/src/directive/preventReClick.js +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
# 安装
|
|
2
|
-
|
|
3
|
-
```shell
|
|
4
|
-
npm i cnhis-design-vue@[版本号]
|
|
5
|
-
# or
|
|
6
|
-
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## 1.全局引入
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
// main.ts
|
|
13
|
-
import { createApp } from 'vue';
|
|
14
|
-
import App from './App.vue';
|
|
15
|
-
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
-
import cui from 'cnhis-design-vue';
|
|
17
|
-
|
|
18
|
-
const app = createApp(App);
|
|
19
|
-
app.use(cui).mount('#app');
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## 2. 按需引入
|
|
23
|
-
|
|
24
|
-
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
-
|
|
26
|
-
### 2.1 样式处理方式1 (按需引入样式)
|
|
27
|
-
|
|
28
|
-
```shell
|
|
29
|
-
# 安装自动导入样式的插件
|
|
30
|
-
npm i -d vite-plugin-style-import
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
// vite.config.ts
|
|
35
|
-
import { defineConfig } from 'vite';
|
|
36
|
-
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
-
|
|
38
|
-
export default defineConfig({
|
|
39
|
-
plugins: [
|
|
40
|
-
// ...otherPlugins
|
|
41
|
-
createStyleImportPlugin({
|
|
42
|
-
libs: [
|
|
43
|
-
{
|
|
44
|
-
libraryName: 'cnhis-design-vue',
|
|
45
|
-
esModule: true,
|
|
46
|
-
ensureStyleFile: true,
|
|
47
|
-
resolveStyle: name => {
|
|
48
|
-
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 2.2 样式处理方式2 (全局引入样式)
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
// main.ts
|
|
61
|
-
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## 3.FAQ
|
|
65
|
-
|
|
66
|
-
### 3.1 项目打包后样式丢失
|
|
67
|
-
|
|
68
|
-
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
// vite.config.ts
|
|
72
|
-
import { defineConfig } from 'vite';
|
|
73
|
-
|
|
74
|
-
export default defineConfig({
|
|
75
|
-
build: {
|
|
76
|
-
rollupOptions: {
|
|
77
|
-
// ..otherOptions
|
|
78
|
-
output: {
|
|
79
|
-
dir: './dist',
|
|
80
|
-
manualChunks: {
|
|
81
|
-
'cnhis-vendor': ['cnhis-design-vue']
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
```
|
|
1
|
+
# 安装
|
|
2
|
+
|
|
3
|
+
```shell
|
|
4
|
+
npm i cnhis-design-vue@[版本号]
|
|
5
|
+
# or
|
|
6
|
+
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## 1.全局引入
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
// main.ts
|
|
13
|
+
import { createApp } from 'vue';
|
|
14
|
+
import App from './App.vue';
|
|
15
|
+
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
+
import cui from 'cnhis-design-vue';
|
|
17
|
+
|
|
18
|
+
const app = createApp(App);
|
|
19
|
+
app.use(cui).mount('#app');
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 2. 按需引入
|
|
23
|
+
|
|
24
|
+
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
+
|
|
26
|
+
### 2.1 样式处理方式1 (按需引入样式)
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
# 安装自动导入样式的插件
|
|
30
|
+
npm i -d vite-plugin-style-import
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// vite.config.ts
|
|
35
|
+
import { defineConfig } from 'vite';
|
|
36
|
+
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
+
|
|
38
|
+
export default defineConfig({
|
|
39
|
+
plugins: [
|
|
40
|
+
// ...otherPlugins
|
|
41
|
+
createStyleImportPlugin({
|
|
42
|
+
libs: [
|
|
43
|
+
{
|
|
44
|
+
libraryName: 'cnhis-design-vue',
|
|
45
|
+
esModule: true,
|
|
46
|
+
ensureStyleFile: true,
|
|
47
|
+
resolveStyle: name => {
|
|
48
|
+
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 2.2 样式处理方式2 (全局引入样式)
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// main.ts
|
|
61
|
+
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 3.FAQ
|
|
65
|
+
|
|
66
|
+
### 3.1 项目打包后样式丢失
|
|
67
|
+
|
|
68
|
+
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// vite.config.ts
|
|
72
|
+
import { defineConfig } from 'vite';
|
|
73
|
+
|
|
74
|
+
export default defineConfig({
|
|
75
|
+
build: {
|
|
76
|
+
rollupOptions: {
|
|
77
|
+
// ..otherOptions
|
|
78
|
+
output: {
|
|
79
|
+
dir: './dist',
|
|
80
|
+
manualChunks: {
|
|
81
|
+
'cnhis-vendor': ['cnhis-design-vue']
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
```
|
|
@@ -42,7 +42,7 @@ export declare class Print {
|
|
|
42
42
|
_queryPrintFile(formatId: string, params?: string): Promise<any>;
|
|
43
43
|
_browserPrint(result: AnyObject, mode: string): Promise<string | void>;
|
|
44
44
|
preview({ templateId, formatId, params, btnprint }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<any>;
|
|
45
|
-
printDirect({ templateId, formatId, params, print, printdlgshow, nobillnode }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func, mode?: string): Promise<any>;
|
|
45
|
+
printDirect({ templateId, formatId, params, print, printdlgshow, nobillnode, isDownloadFile }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func, mode?: string): Promise<any>;
|
|
46
46
|
private _downloadPDF;
|
|
47
47
|
/**
|
|
48
48
|
* 下载pdf
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as n}from"./dialog.js";import{getFileUrl as s,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{format as l}from"date-fns";const d=t.create({timeout:1e3,withCredentials:!1}),h=t.create({withCredentials:!1}),c=`${window.location.protocol}//${window.location.host}`,p=`${c}/fdp-api/print/assembly/printIReport`,u=`${c}/bi-api/reprot/print/open/client/getRemote`,m=`${c}/printService/file`;let w=null;class f{constructor(){var t;if(this.webview=null,this.dialog=new i,this.dialogPreview=new n,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.messageHandlerQueue=[],w)return w;w=this;const e=window;this.webview=null==(t=e.chrome)?void 0:t.webview,this.webview&&(this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler),this.postMessage({exec:"config",data:""}))}messageHandler(t){var e;const i=this.messageHandlerQueue.shift();if(!i)return console.log("当前回执",t,"没有可用的handler");const{resolve:n,reject:s}=i;try{const{exec:i}=JSON.parse(t.data);"config"===i&&(this.downloadPath=(null==(e=JSON.parse(t.data).res)?void 0:e.downloadpath)||""),console.log(t),n(JSON.parse(t.data).res)}catch(t){s(t)}}async postMessage(t){return this.webview?new Promise(((e,i)=>{this.messageHandlerQueue.push({resolve:e,reject:i}),this.webview.postMessage(t)})):Promise.reject()}destroy(){this.webview&&this.currentMessageHandler&&(this.webview.removeEventListener("message",this.currentMessageHandler),this.currentMessageHandler=void 0)}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{d({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):h({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:n(i)}):h({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[n]}).then((({data:t})=>t));function n(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleResult(t,e){if("success"!==t.result){const i={type:"printError",message:t.message||t.Message,result:t.result,errinfo:t.errinfo};return null==e||e(i),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,n){const s={templateId:t,formatId:e,params:i,cmdid:"7"},r=await this._queryServicesPrint(s);return this._handleQueryPrintDataResult(r,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:n,print:s,printdlgshow:r="1",nobillnode:a="1",btnprint:o="1"}){const d={templateId:t,formatId:e,params:i,cmdid:n,nobillnode:a,printdlgshow:r,btnprint:o};if(s){try{s=JSON.parse(s)}catch(t){}d.print=s}else this.isRemote&&(d.print={print:"1",type:"
|
|
1
|
+
import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as n}from"./dialog.js";import{getFileUrl as s,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{format as l}from"date-fns";const d=t.create({timeout:1e3,withCredentials:!1}),h=t.create({withCredentials:!1}),c=`${window.location.protocol}//${window.location.host}`,p=`${c}/fdp-api/print/assembly/printIReport`,u=`${c}/bi-api/reprot/print/open/client/getRemote`,m=`${c}/printService/file`;let w=null;class f{constructor(){var t;if(this.webview=null,this.dialog=new i,this.dialogPreview=new n,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.messageHandlerQueue=[],w)return w;w=this;const e=window;this.webview=null==(t=e.chrome)?void 0:t.webview,this.webview&&(this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler),this.postMessage({exec:"config",data:""}))}messageHandler(t){var e;const i=this.messageHandlerQueue.shift();if(!i)return console.log("当前回执",t,"没有可用的handler");const{resolve:n,reject:s}=i;try{const{exec:i}=JSON.parse(t.data);"config"===i&&(this.downloadPath=(null==(e=JSON.parse(t.data).res)?void 0:e.downloadpath)||""),console.log(t),n(JSON.parse(t.data).res)}catch(t){s(t)}}async postMessage(t){return this.webview?new Promise(((e,i)=>{this.messageHandlerQueue.push({resolve:e,reject:i}),this.webview.postMessage(t)})):Promise.reject()}destroy(){this.webview&&this.currentMessageHandler&&(this.webview.removeEventListener("message",this.currentMessageHandler),this.currentMessageHandler=void 0)}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{d({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):h({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:n(i)}):h({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[n]}).then((({data:t})=>t));function n(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleResult(t,e){if("success"!==t.result){const i={type:"printError",message:t.message||t.Message,result:t.result,errinfo:t.errinfo};return null==e||e(i),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,n){const s={templateId:t,formatId:e,params:i,cmdid:"7"},r=await this._queryServicesPrint(s);return this._handleQueryPrintDataResult(r,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:n,print:s,printdlgshow:r="1",nobillnode:a="1",btnprint:o="1"}){const d={templateId:t,formatId:e,params:i,cmdid:n,nobillnode:a,printdlgshow:r,btnprint:o};if(s){try{s=JSON.parse(s)}catch(t){}d.print=s}else this.isRemote&&(d.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${l(new Date,"yyyyMMddHHmmss")}`});return await this._queryServicesPrint(d)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:n}){const s={};let r={};try{r=Object.assign({},s,JSON.parse(i))}catch(t){r=s}const a={templateId:t,formatId:e,cmdid:"9",token:n,params:JSON.stringify(r)};return await this._queryServicesPrint(a)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await h({method:"get",url:u})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=c+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await h({method:"post",url:p,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,n=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=n[n.length-1],o=await s(`${m}/${a}`),l=r(null,e,o);if("preview"===e)return l}}async preview({templateId:t,formatId:e,params:i="",btnprint:n},s,l){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==l?void 0:l("获取文件失败!");const n=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,n),void(null==s||s({file:t}))}await this._queryProxyOrigin();const d=await this._testConnection();if(!this._handleResultTest(d,l))return!1;const h=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",btnprint:n});if(!h)return!1;const c=this._handleResult(h,l);if(!c)return!1;if(this.isRemote){const t=await this._browserPrint(c,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}s&&s(c)}async printDirect({templateId:t,formatId:e,params:i="",print:n,printdlgshow:s,nobillnode:o,isDownloadFile:l=!0},d,h,c="printDirect"){if(a(e)){const t=await this._queryPrintFile(e,i);return t?(r(t,c),void(null==d||d({file:t}))):null==h?void 0:h("获取文件失败!")}await this._queryProxyOrigin();const p=await this._testConnection();if(!this._handleResultTest(p,h))return!1;const u=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:n,printdlgshow:s,nobillnode:o});if(!u)return!1;const m=this._handleResult(u,h);if(!m)return!1;l&&["downloadPDF"].includes(c)&&await this._browserPrint(m,c),d&&d(m)}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):h.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}downloadPDF(t,i,n){this.webview&&this.downloadPath&&(t.print.filename=this.downloadPath.replace(/\\/g,"/")),this.printDirect(t,(async s=>{if(s||n(null),a(t.formatId))return i(s);const r=this,o=await async function(t){const i=[],n=JSON.parse(t);if(!e(n))return await r._downloadPDF("");if(1===n.length)return await r._downloadPDF(n[0]||"");for(let t=0,e=n.length;t<e;t++)i.push(await r._downloadPDF(n[t]||""));return i}(s.filedir);i(o)}),(t=>n(t)),"downloadPDF")}async print({templateId:t,formatId:e,params:i=""},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this.queryPrintData({templateId:t,formatId:e,params:i},void 0,s);if(!a)return!1;const o=this.printFileData({formatId:e,file:a.file,printerName:a.printerName},void 0,s);if(!o)return!1;n&&n(o)}async queryPrintData({templateId:t,formatId:e,params:i=""},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._handleEventQueryPrintData(t,e,i,s);return!!a&&(n&&n(a),a)}async printFileData({formatId:t,file:e,printerName:i="Default"},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,s);return!!o&&(n&&n(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:n},s,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:n}),l=this._handleResult(o,r);if(!l)return!1;s&&s(l)}async addPrintFormat({templateId:t,params:e,token:i},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,s);if(!o)return!1;n&&n(o)}}export{f as Print};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{AsyncQueue,useAsyncQueue}from"./src/hooks/useAsyncQueue.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{combineExtendKey,createInputSlot,createSlot,createUrlConfigParams,formRenderLog,injectOrProvide,isNestedFieldType,isNestedType,keywordMatcher,mergeDeepProperties,parseNumberFromMaybeString,presetRequestHandler,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export*from"@formily/core";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,
|
|
1
|
+
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{AsyncQueue,useAsyncQueue}from"./src/hooks/useAsyncQueue.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{combineExtendKey,createInputSlot,createSlot,createUrlConfigParams,formRenderLog,injectOrProvide,isNestedFieldType,isNestedType,keywordMatcher,mergeDeepProperties,parseNumberFromMaybeString,presetRequestHandler,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export*from"@formily/core";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,queryDecoratorByAddress,queryDecoratorByFieldKey,queryInput}from"./src/utils/dom.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./src/utils/schema.js";const o=r;o.install=function(r){s(r,o,e+"FormRender")};export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as r,computed as o,ref as t,onUnmounted as l,createVNode as i,mergeProps as s}from"vue";import{arrayed as a,widthAppend as m}from"../../../../../shared/utils/index.js";import{isVoidField as n}from"@formily/core";import{observe as u,autorun as f}from"@formily/reactive";import{connect as d,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isArray as c,isString as y}from"lodash-es";import{NFormItem as _}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import b from"../tooltipMessage.vue.js";import{InjectionFormUUID as x,InjectionFormGraph as j,InjectionAnnotation as I}from"../../constants/index.js";import{useComplexOptionsSpan as k}from"../../hooks/useComplexOptions.js";import{dotEscape as h}from"../../utils/schema.js";import{useFormField as F}from"../../hooks/useFormField.js";import{validateMessageParser as L}from"../../utils/index.js";const q=d(e({props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},annotation:{},fieldItem:{}},setup(e,{slots:a}){const{field:d,fieldKey:p}=F(),
|
|
1
|
+
import{defineComponent as e,inject as r,computed as o,ref as t,onUnmounted as l,createVNode as i,mergeProps as s}from"vue";import{arrayed as a,widthAppend as m}from"../../../../../shared/utils/index.js";import{isVoidField as n}from"@formily/core";import{observe as u,autorun as f}from"@formily/reactive";import{connect as d,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isArray as c,isString as y}from"lodash-es";import{NFormItem as _}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import b from"../tooltipMessage.vue.js";import{InjectionFormUUID as x,InjectionFormGraph as j,InjectionAnnotation as I}from"../../constants/index.js";import{useComplexOptionsSpan as k}from"../../hooks/useComplexOptions.js";import{dotEscape as h}from"../../utils/schema.js";import{useFormField as F}from"../../hooks/useFormField.js";import{validateMessageParser as L}from"../../utils/index.js";const q=d(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},annotation:{},fieldItem:{}},setup(e,{slots:a}){const{field:d,fieldKey:p,fieldAddress:y}=F(),L=r(x),q=o((()=>h(`${L}-${y.value}`))),K=t(!1);if(n(d.value)&&c(e.suffixFields)){const o=r(j);l(u(o,v((()=>{n(d.value)&&c(e.suffixFields)&&(K.value=e.suffixFields.some((e=>{const r=d.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else l(f((()=>{K.value=Reflect.get(d.value,"required")})));const R=r(I),S=o({get(){var r,o;return null!=(o=null==(r=R.value)?void 0:r[e.propertyKey])?o:""},set(r){R.value={property:e.propertyKey,value:r}}});const A=o((()=>R.value&&!1!==e.annotation)),E=o((()=>e.label&&" "!==e.label)),V=o((()=>{let r=0;return A.value&&(r+=18),e.remark&&(r+=18),r}));function $(){return E.value?i("section",{class:"form-render__formItemLabel"},[i("span",{class:"form-render__formItemLabel--text",style:{marginRight:m(V.value)}},[e.label]),V.value?i("section",{class:"form-render__formItemLabel--operation"},[e.remark?i("div",{class:"form-render__formItemLabel--tooltip"},[i(b,{message:e.remark},null)]):null,A.value?i(g,{class:"form-render__formItemLabel--annotation",modelValue:S.value,"onUpdate:modelValue":e=>S.value=e},null):null]):null]):null}const{getSpan:w}=k();return()=>i(_,s({class:"form-render__formItem",style:{"--form-item-column":w(L,d.value.address,!1)+e.span}},{id:q.value,uuid:L,"widget-type":d.value.componentType,"field-key":h(p.value),"field-address":h(y.value),required:K.value}),{...a,label:$})}}),p({title:"label"},((e,r)=>{const o=n(r)?void 0:a(r.selfErrors).length?function(e,r){if(!y(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>L(e,r))).join(",");return L(r.defined_error_msg,r)}(a(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:o,"validation-status":o?"error":void 0}})));export{q as FORM_ITEM};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as
|
|
1
|
+
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isArray as s,isFunction as a}from"lodash-es";import{nextTick as m}from"vue";import"../../index.js";import{FormItemLineBarDepKeyPrepend as u,NESTED_FORM_ITEM_TYPE as f}from"../constants/index.js";import{queryDecoratorByAddress as l,queryInput as d,queryDecoratorByFieldKey as c,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as g,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as h}from"../utils/schema.js";function I({formModel:t,formRenderRef:n,formUUID:a,getFieldList:f,formItemDepsCollector:p}){return{validate(r="*"){return t.validate(r).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(o,[]):e)));function o(t,r){if(!i(r))return t;let o=!1;return s(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(m)),o=!0)})),!o&&t.push(m(r)),t}function m(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),s=e.messages.map((e=>function(e,t){var r;return t&&i(t.fieldItem)?g(null!=(r=t.fieldItem.defined_error_msg)?r:e,t.fieldItem):e}(e,r.get("decoratorProps")))),m=l(e.address,n.value,a);return{...e,messages:s,title:o,decoratorElement:m,...d(m)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=v(f(),r)),r},setFormValues(e,i=!0){i&&(e=y(f(),e)),t.setFieldState("*",(t=>{r(t)&&(t.value=o.getIn(e,t.path))}))},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return s();const o=c(e,t,a);if(o)return s(o);const i=h(e,r);return i?(p.trigger(u+i,!0),await m(),s(c(e,t,a))):s();function s(e){return{decoratorElement:e,...d(e)}}}(e,n.value,f()):null}}function x({props:e,formRenderRef:r,formModel:o}){return{onKeydown:function i(s){var m;if(!e.enterToNextWidget||!r.value)return;const u=t(s.target,(e=>e.classList.contains("form-render__formItem")));if(!u)return;const l=`.form-render__formItem${f.map((e=>`:not([widget-type=${e}])`)).join("")}`,d=Array.from(r.value.querySelectorAll(l)),c=d.findIndex((e=>e.id===u.id));if(!~c)return;const{widget:g,field:v}=p(d,c,s.target);if(g)if(a(e.enterToNextWidget)){const t=v&&o.query(v).take();!t||e.enterToNextWidget(null==(m=t.decoratorProps)?void 0:m.fieldItem)?y():i({target:g})}else y();async function y(){await n(0),g.focus()}}}}export{x as useFormDomEvent,I as useFormExposeEvent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useField as e}from"@formily/vue";import{computed as t}from"vue";function
|
|
1
|
+
import{useField as e}from"@formily/vue";import{computed as t}from"vue";function r(){const r=e();return{field:r,title:t((()=>r.value.title)),fieldKey:t((()=>r.value.props.name.toString())),fieldAddress:t((()=>r.value.address.toString()))}}export{r as useFormField};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Nullable } from '../../../../../es/shared/types';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function queryDecoratorByFieldKey(key: string, wrapperElement: HTMLElement, formUUID: string): HTMLElement | null;
|
|
3
|
+
export declare function queryDecoratorByAddress(key: string, wrapperElement: HTMLElement, formUUID: string): HTMLElement | null;
|
|
3
4
|
export declare function queryInput(decoratorElement?: Nullable<HTMLElement>): {
|
|
4
5
|
widgetElement: HTMLInputElement | null | undefined;
|
|
5
6
|
widgetElementList: HTMLInputElement[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dotEscape as e}from"./schema.js";function t(t,r,n){return r.querySelector(e(
|
|
1
|
+
import{dotEscape as e}from"./schema.js";function t(t,r,n){return r.querySelector(`[uuid=${n}][field-key=${e(t)}]`)}function r(t,r,n){return r.querySelector(`[uuid=${n}][field-address=${e(t)}]`)}function n(e){var t;return{widgetElement:null==e?void 0:e.querySelector("input"),widgetElementList:Array.from(null!=(t=null==e?void 0:e.querySelectorAll("input"))?t:[])}}function i(e,t,r){const n=d(e[t],r);if(n)return{widget:n,field:u(e[t])};let i=null,l=null;return e.slice(t+1).some((e=>{const t=i=d(e);return t&&(l=u(e)),t})),{widget:i,field:l};function u(e){return e&&e.getAttribute("field-key")}function d(e,t){const r=Array.from(e.querySelectorAll("textarea,input,[tabindex]")),n=t?r.findIndex((e=>e===t)):-1;return r.slice(n+1).find((e=>!Reflect.get(e,"disabled")&&!Array.from(e.classList).some((e=>e.endsWith("--disabled")))))}}export{i as findNextWidget,r as queryDecoratorByAddress,t as queryDecoratorByFieldKey,n as queryInput};
|
|
@@ -104,8 +104,6 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
104
104
|
__emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", ...args: any[]) => void;
|
|
105
105
|
eventListener: import("./src/hooks/tapHooks/useEventHooks").IhoTableEventListener;
|
|
106
106
|
emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", ...args: any[]) => void;
|
|
107
|
-
uuid: string;
|
|
108
|
-
$table: import("vue").Ref<import("vxe-table").VxeTableInstance | undefined>;
|
|
109
107
|
hooks: Readonly<{
|
|
110
108
|
configHooks: import("../../../es/components/iho-table/src/types").AbstractConfigHooks;
|
|
111
109
|
fieldHooks: import("../../../es/components/iho-table/src/types").AbstractFieldHooks;
|
|
@@ -115,6 +113,8 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
115
113
|
domInsertHooks: import("../../../es/components/iho-table/src/types").AbstractDomInsertHooks;
|
|
116
114
|
exposeHooks: import("../../../es/components/iho-table/src/types").AbstractExposeHooks;
|
|
117
115
|
}>;
|
|
116
|
+
uuid: string;
|
|
117
|
+
$table: import("vue").Ref<import("vxe-table").VxeTableInstance | undefined>;
|
|
118
118
|
configRef: import("vue").Ref<{
|
|
119
119
|
[x: string]: unknown;
|
|
120
120
|
size?: import("vxe-table").SizeType | undefined;
|
|
@@ -103,8 +103,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
103
103
|
__emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", ...args: any[]) => void;
|
|
104
104
|
eventListener: import("../../../../es/components/iho-table/src/hooks/tapHooks/useEventHooks").IhoTableEventListener;
|
|
105
105
|
emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", ...args: any[]) => void;
|
|
106
|
-
uuid: string;
|
|
107
|
-
$table: import("vue").Ref<VxeTableInstance | undefined>;
|
|
108
106
|
hooks: Readonly<{
|
|
109
107
|
configHooks: import("../../../../es/components/iho-table/src/types").AbstractConfigHooks;
|
|
110
108
|
fieldHooks: import("../../../../es/components/iho-table/src/types").AbstractFieldHooks;
|
|
@@ -114,6 +112,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
114
112
|
domInsertHooks: import("../../../../es/components/iho-table/src/types").AbstractDomInsertHooks;
|
|
115
113
|
exposeHooks: import("../../../../es/components/iho-table/src/types").AbstractExposeHooks;
|
|
116
114
|
}>;
|
|
115
|
+
uuid: string;
|
|
116
|
+
$table: import("vue").Ref<VxeTableInstance | undefined>;
|
|
117
117
|
configRef: import("vue").Ref<{
|
|
118
118
|
[x: string]: unknown;
|
|
119
119
|
size?: import("vxe-table").SizeType | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,provide as t,computed as a,ref as o,watch as l,resolveComponent as s,openBlock as n,createElementBlock as i,unref as r,createBlock as u,resolveDynamicComponent as d,createVNode as f,mergeProps as c,createSlots as p,renderList as
|
|
1
|
+
import{defineComponent as e,provide as t,computed as a,ref as o,watch as l,resolveComponent as s,openBlock as n,createElementBlock as i,unref as r,createBlock as u,resolveDynamicComponent as d,createVNode as f,mergeProps as c,createSlots as p,renderList as v,withCtx as m,createCommentVNode as b,renderSlot as g}from"vue";import{uuidGenerator as x}from"../../../shared/utils/index.js";import{useDebounceFn as h}from"@vueuse/core";import{promiseTimeout as k}from"@vueuse/shared";import{isFunction as y}from"lodash-es";import{VxeTableEventNameList as C,InjectionIhoTableEmits as j,InjectionIhoTableAnnotation as D,InjectionIhoTableUUID as _,InjectionIhoTableInstance as $,InjectionIhoTableConfig as H,InjectionIhoTableFieldList as A,InjectionIhoTableHandler as L}from"./constants/index.js";import{createTableHooks as T,applyTableConfigHooks as w,applyTableFieldHooks as R,createTableEventHandlers as E,createDomInsertComponent as F,createDataTransfer as I}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as O}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as S}from"./utils/index.js";import q from"../../../_virtual/plugin-vue_export-helper.js";const z=["id"];var B=q(e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object}},emits:["formChange","settingClick","formClick","keyboard",...C],setup(e,{expose:C,emit:q}){var B,G;const J=e,K=O(),M=function(e,...t){q(e,...t);const a=r(U)[S(e)];y(a)&&a(...t),K.trigger(e,...t)};t(j,M);const N=T();t(D,a((()=>J.annotation)));const P=x();t(_,P);const Q=o();t($,Q);const U=o({uuid:null!=(G=null==(B=J.tableConfig)?void 0:B.uuid)?G:P});t(H,U);const V=h(W,10);function W(){U.value=w(N,J.tableConfig),U.value.uuid=P}const X=o([]);t(A,X);const Y=h(Z,10);function Z(){X.value=R(N,J.fieldList,U.value,{$table:Q,emits:M})}const ee=I(N,U,Q),te=o([]),ae=h(oe,10);async function oe(){var e;te.value=await ee(J.tableData),null==(e=Q.value)||e.recalculate(!0)}const le={updateTableDataRef:ae,updateConfigRef:V,updateFieldListRef:Y};t(L,le);const se=E({hooks:N,config:U,$table:Q,context:le,emits:M}),ne=a((()=>({...U.value,...se})));l((()=>J.tableConfig),(()=>{V(),Y(),ae()}),{deep:!0}),l((()=>J.fieldList),(()=>{Y(),ae()}),{deep:!0}),l([()=>J.tableData,()=>{var e;return null==(e=J.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=U.value.treeConfig)?void 0:e.expandAll)&&(await k(11),null==(t=Q.value)||t.setAllTreeExpand(!0))})),l((()=>[...J.tableData]),ae),W(),Z(),oe();const{header:ie,footer:re}=F(N);return C({$table:Q,async loadData(e){var t;null==(t=Q.value)||t.loadData(await ee(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),...N.exposeHooks.expose.call({},U,{$table:Q,emits:M})}),N.setupHooks.setup.call(U,X),(e,t)=>{const a=s("vxe-grid");return n(),i("section",{class:"iho-table",id:r(P)},[(n(),u(d(r(ie)))),f(a,c({ref_key:"$table",ref:Q},r(ne),{columns:X.value,data:te.value}),p({_:2},[v(e.$slots,((t,a)=>({name:a,fn:m((()=>[b(" 实际上所有的vxe-grid插槽都支持 "),g(e.$slots,a)]))})))]),1040,["columns","data"]),(n(),u(d(r(re))))],8,z)}}}),[["__file","IhoTable.vue"]]);export{B as default};
|
package/es/components/iho-table/src/plugins/{filterPlugin → filterRenderPlugin}/filter.vue.d.ts
RENAMED
|
@@ -1,62 +1,28 @@
|
|
|
1
|
-
import { AnyObject } from '../../../../../../es/shared/types';
|
|
2
1
|
import { CSSProperties, PropType, ref } from 'vue';
|
|
3
|
-
import { VxeColumnPropTypes, VxeTablePropTypes } from 'vxe-table';
|
|
2
|
+
import { VxeColumnPropTypes, VxeTableConstructor, VxeTableDefines, VxeTableMethods, VxeTablePrivateMethods, VxeTablePropTypes } from 'vxe-table';
|
|
4
3
|
declare const _default: import("vue").DefineComponent<{
|
|
5
4
|
payload: {
|
|
6
|
-
type: PropType<VxeColumnPropTypes.
|
|
5
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
7
6
|
required: true;
|
|
8
7
|
};
|
|
9
|
-
sortable: {
|
|
10
|
-
type: BooleanConstructor;
|
|
11
|
-
};
|
|
12
|
-
options: {
|
|
13
|
-
type: PropType<AnyObject[]>;
|
|
14
|
-
default: () => never[];
|
|
15
|
-
};
|
|
16
|
-
checked: {
|
|
17
|
-
type: PropType<string[]>;
|
|
18
|
-
required: true;
|
|
19
|
-
};
|
|
20
|
-
sortStatus: {
|
|
21
|
-
type: PropType<VxeTablePropTypes.SortOrder>;
|
|
22
|
-
};
|
|
23
8
|
}, {
|
|
24
9
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
25
10
|
payload: {
|
|
26
|
-
type: PropType<VxeColumnPropTypes.
|
|
27
|
-
required: true;
|
|
28
|
-
};
|
|
29
|
-
sortable: {
|
|
30
|
-
type: BooleanConstructor;
|
|
31
|
-
};
|
|
32
|
-
options: {
|
|
33
|
-
type: PropType<AnyObject[]>;
|
|
34
|
-
default: () => never[];
|
|
35
|
-
};
|
|
36
|
-
checked: {
|
|
37
|
-
type: PropType<string[]>;
|
|
11
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
38
12
|
required: true;
|
|
39
13
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}>>;
|
|
47
|
-
emits: (event: "update:checked" | "update:sortStatus", ...args: any[]) => void;
|
|
48
|
-
uuid: string;
|
|
49
|
-
configRef: import("vue").Ref<import("../../types").IhoTableConfig>;
|
|
50
|
-
checkedRef: import("vue").Ref<string[]> | import("vue").WritableComputedRef<string[]>;
|
|
51
|
-
sortStatusRef: import("vue").Ref<VxeTablePropTypes.SortOrder | undefined> | import("vue").WritableComputedRef<VxeTablePropTypes.SortOrder | undefined>;
|
|
14
|
+
}>> & {}>>;
|
|
15
|
+
sortable: import("vue").ComputedRef<any>;
|
|
16
|
+
optionsRef: import("vue").ComputedRef<VxeTableDefines.FilterOption[] & VxeColumnPropTypes.Filter[]>;
|
|
17
|
+
checkedRef: import("vue").WritableComputedRef<string[]>;
|
|
18
|
+
$table: (VxeTableConstructor & VxeTablePrivateMethods & VxeTableMethods) | undefined;
|
|
19
|
+
sortStatusRef: import("vue").WritableComputedRef<"desc" | "asc" | null>;
|
|
52
20
|
checkedCacheRef: import("vue").Ref<string[]>;
|
|
53
|
-
filterVisible: import("vue").Ref<boolean>;
|
|
54
21
|
searchFilterText: import("vue").Ref<string>;
|
|
55
|
-
toggleFilterVisible: () => void;
|
|
56
22
|
close: () => void;
|
|
57
23
|
OPTION_ITEM_HEIGHT: number;
|
|
58
24
|
VIEW_CAPACITY: number;
|
|
59
|
-
list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<
|
|
25
|
+
list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<VxeTableDefines.FilterOption>[]>;
|
|
60
26
|
containerProps: {
|
|
61
27
|
ref: import("vue").Ref<any>;
|
|
62
28
|
onScroll: () => void;
|
|
@@ -73,15 +39,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
73
39
|
checkAll: import("vue").WritableComputedRef<boolean>;
|
|
74
40
|
containerStyleWithHeight: import("vue").ComputedRef<CSSProperties>;
|
|
75
41
|
confirmFilter: () => void;
|
|
42
|
+
reset: () => void;
|
|
76
43
|
sortStatusList: {
|
|
77
44
|
status: VxeTablePropTypes.SortOrder;
|
|
78
45
|
text: string;
|
|
79
46
|
}[];
|
|
80
47
|
setSort: (value: VxeTablePropTypes.SortOrder) => void;
|
|
81
|
-
|
|
82
|
-
editable: import("vue").ComputedRef<boolean | undefined>;
|
|
83
|
-
wrapperStyle: import("vue").ComputedRef<CSSProperties>;
|
|
84
|
-
FunnelSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
48
|
+
CheckmarkOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
85
49
|
NButton: any;
|
|
86
50
|
NButtonGroup: any;
|
|
87
51
|
NCheckbox: any;
|
|
@@ -135,35 +99,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
135
99
|
readonly disabled: boolean | undefined;
|
|
136
100
|
readonly defaultValue: (string | number)[] | null;
|
|
137
101
|
}>;
|
|
138
|
-
NEllipsis: any;
|
|
139
|
-
NIcon: any;
|
|
140
102
|
NInput: any;
|
|
141
|
-
NPopover: any;
|
|
142
103
|
ref: typeof ref;
|
|
143
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
104
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
144
105
|
payload: {
|
|
145
|
-
type: PropType<VxeColumnPropTypes.
|
|
146
|
-
required: true;
|
|
147
|
-
};
|
|
148
|
-
sortable: {
|
|
149
|
-
type: BooleanConstructor;
|
|
150
|
-
};
|
|
151
|
-
options: {
|
|
152
|
-
type: PropType<AnyObject[]>;
|
|
153
|
-
default: () => never[];
|
|
154
|
-
};
|
|
155
|
-
checked: {
|
|
156
|
-
type: PropType<string[]>;
|
|
106
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
157
107
|
required: true;
|
|
158
108
|
};
|
|
159
|
-
|
|
160
|
-
type: PropType<VxeTablePropTypes.SortOrder>;
|
|
161
|
-
};
|
|
162
|
-
}>> & {
|
|
163
|
-
"onUpdate:checked"?: ((...args: any[]) => any) | undefined;
|
|
164
|
-
"onUpdate:sortStatus"?: ((...args: any[]) => any) | undefined;
|
|
165
|
-
}, {
|
|
166
|
-
options: AnyObject[];
|
|
167
|
-
sortable: boolean;
|
|
168
|
-
}>;
|
|
109
|
+
}>>, {}>;
|
|
169
110
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,computed as l,inject as t,ref as a,onDeactivated as u,openBlock as o,createElementBlock as n,unref as i,Fragment as r,renderList as s,createElementVNode as v,normalizeClass as c,createBlock as d,createCommentVNode as p,createTextVNode as f,toDisplayString as m,createVNode as h,isRef as _,withCtx as y,normalizeStyle as g}from"vue";import{widthAppend as b}from"../../../../../shared/utils/index.js";import{CheckmarkOutline as k}from"@vicons/ionicons5";import{useVirtualList as C}from"@vueuse/core";import{NInput as x,NCheckbox as S,NCheckboxGroup as $,NButtonGroup as E,NButton as j}from"naive-ui";import w from"../../../../../_virtual/plugin-vue_export-helper.js";const A={class:"iho-table__filterWrapper"},I={key:0},L=["onClick"],U={class:"iho-table__filterListItem"},B={class:"iho-table__filterFooter"};var F=w(e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const w=e,F=l((()=>{var e,l,t;return null==(t=null==(l=null==(e=w.payload)?void 0:e.column.editRender)?void 0:l.props)?void 0:t.sortable})),O=l((()=>{var e,l,t;return null!=(t=null==(l=null==(e=w.payload)?void 0:e.column)?void 0:l.filters)?t:[]})),P=l({get:()=>O.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),set(e){if(w.payload)return O.value.forEach((l=>{w.payload.$panel.changeOption(null,e.includes(l.value),l)})),w.payload.$panel.confirmFilter(new CustomEvent("click"))}}),W=t("$xetable"),Z=l({get(){if(!W)return null;const e=W.getSortColumns().find((e=>{var l;return e.column===(null==(l=w.payload)?void 0:l.column)}));return e?e.order:null},set(e){W&&w.payload&&w.payload.$panel&&W.triggerSortEvent(new CustomEvent("click"),w.payload.column,e)}}),q=a([...P.value]),z=a("");function D(){W&&(W.reactData.filterStore.visible=!1)}u(D);const{list:H,containerProps:R,wrapperProps:G}=C(l((()=>z.value?O.value.filter((e=>`${e.label}`.includes(z.value))):O.value)),{itemHeight:32,overscan:3}),J=l((()=>!!q.value.length&&q.value.length!==O.value.length)),K=l({get:()=>q.value.length===O.value.length&&0!==O.value.length,set:e=>{q.value=e?O.value.map((e=>e.value)):[]}}),M=l((()=>({...R.style,height:b(320)})));function N(){P.value=q.value,D()}function Q(){q.value=[]}const T=[{status:"asc",text:"升序 A to Z"},{status:"desc",text:"降序 Z to A"}];return(e,l)=>(o(),n("section",A,[i(F)?(o(),n("div",I,[(o(),n(r,null,s(T,(e=>v("div",{key:e.status,class:c(["iho-table__filterButton",{"iho-table__filterButton--active":i(Z)===e.status}]),onClick:l=>{return t=e.status,Z.value=t,void D();var t}},[i(Z)===e.status?(o(),d(i(k),{key:0,class:"iho-table__sortActiveIcon"})):p("v-if",!0),f(" "+m(e.text),1)],10,L))),64))])):p("v-if",!0),i(O).length>5?(o(),d(i(x),{key:1,value:z.value,"onUpdate:value":l[0]||(l[0]=e=>z.value=e)},null,8,["value"])):p("v-if",!0),v("div",U,[h(i(S),{label:"全选",checked:i(K),"onUpdate:checked":l[1]||(l[1]=e=>_(K)?K.value=e:null),indeterminate:i(J)},null,8,["checked","indeterminate"])]),h(i($),{value:q.value,"onUpdate:value":l[3]||(l[3]=e=>q.value=e)},{default:y((()=>[v("section",{ref:i(R).ref,style:g(i(M)),onScroll:l[2]||(l[2]=(...e)=>i(R).onScroll&&i(R).onScroll(...e)),class:"iho-table__filterListWrapper"},[v("section",{style:g(i(G).style)},[(o(!0),n(r,null,s(i(H),(e=>(o(),n("div",{class:"iho-table__filterListItem",key:e.data.value},[h(i(S),{value:e.data.value,label:e.data.label},null,8,["value","label"])])))),128))],4)],36)])),_:1},8,["value"]),v("footer",B,[v("section",null,m(`已选择${q.value.length}项`),1),h(i(E),{size:"small"},{default:y((()=>[h(i(j),{onClick:Q},{default:y((()=>[f("清空")])),_:1}),h(i(j),{onClick:D},{default:y((()=>[f("取消")])),_:1}),h(i(j),{type:"primary",onClick:N},{default:y((()=>[f("确定")])),_:1})])),_:1})])]))}}),[["__file","filter.vue"]]);export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function filterRenderPlugin(): import("../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createVNode as e}from"vue";import{jsonParse as t,arrayed as r}from"../../../../../shared/utils/index.js";import{isObject as i,first as l,isArray as o}from"lodash-es";import"../../../index.js";import{IHO_TABLE_NUMBER_STATUS as n}from"../../constants/index.js";import{IhoTableRenderHelper as s,IhoTableUtils as a}from"../../utils/index.js";import u from"./filter.vue.js";import{defineTablePlugin as d}from"../../hooks/useTablePlugin.js";function p(){const p="filterRenderPlugin";return d({name:p,vxe(t){t.renderer.mixin({filterRenderPlugin:{showFilterFooter:!1,renderFilter:(t,r)=>e(u,{payload:r},null)}})},apply(e){e.fieldHooks.field.tap(p,(e=>{var r,u,d,p,f,c;const m=null==(r=e.editRender)?void 0:r.props;if(!i(m))return e;const v=t(m.fieldSetting||"");if(!s.hasFilter(v))return e;e.editRender={...e.editRender,props:{...null==(u=e.editRender)?void 0:u.props,sortable:e.sortable}},e.filterRender={name:"filterRenderPlugin"};let h=null!=(f=null==(p=null==(d=v.mapping)?void 0:d.mappingFiled)?void 0:p.reduce(((e,t)=>{const r=l(t.value);return i(r)&&e.push({label:r.key,value:r.value,data:r.value}),e}),[]))?f:[];return function(e){const t=["SEARCH","SELECT","RADIO","CHECKBOX"];return(e.notParticipatingSearch||"")!==n.POSITIVE&&t.includes(a.getCellType(e))&&o(e.options)&&e.options.length}(m)&&(h=null!=(c=m.options)?c:[]),e.filters=h,e.sortable?e.headerClassName=({$table:e,column:t})=>{const r=["iho-table__hideSortIcon"];return e.isSort(t)&&r.push("is--filter-active"),r}:e.headerClassName="iho-table__hideSortIcon",e})),e.exposeHooks.expose.tap(p,((e,t,{$table:i})=>(Object.assign(e,{setSort(e,t){i.value&&i.value.sort(e,t)},setFilter(e,t){if(!i.value)return;const l=i.value.getColumnByField(e);if(!l||!o(l.filters))return;const n=r(t);l.filters.forEach((e=>{e.checked=n.includes(e.value)})),i.value.updateData()}}),e)))}})}export{p as filterRenderPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./defaultConfigPlugin/index.js";import*as i from"./
|
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./defaultConfigPlugin/index.js";import*as i from"./filterRenderPlugin/index.js";import*as n from"./keyboardEventPlugin/index.js";import*as d from"./lowCodeFieldAdaptorPlugin/index.js";import*as s from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as t from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as l from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as g from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as u from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as o from"./rendererPlugins/editableWidgets/timeRendererPlugin.js";import*as P from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as a from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as m from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as x from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as p from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as f from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as R from"./rowClickPlugin/index.js";import*as j from"./rowGroupSettingPlugin/index.js";import*as b from"./virtualTreePlugin/index.js";import{separateMetaModule as w}from"../../../../shared/utils/index.js";var c=w(Object.assign({"./anchorPlugin/index.tsx":e,"./defaultConfigPlugin/index.ts":r,"./filterRenderPlugin/index.tsx":i,"./keyboardEventPlugin/index.ts":n,"./lowCodeFieldAdaptorPlugin/index.tsx":d,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":s,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":t,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":l,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":g,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":u,"./rendererPlugins/editableWidgets/timeRendererPlugin.tsx":o,"./rendererPlugins/widgets/checkRendererPlugin.tsx":P,"./rendererPlugins/widgets/colorRendererPlugin.tsx":a,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":m,"./rendererPlugins/widgets/labelRendererPlugin.tsx":x,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":p,"./rendererPlugins/widgets/seqRendererPlugin.tsx":f,"./rowClickPlugin/index.ts":R,"./rowGroupSettingPlugin/index.ts":j,"./virtualTreePlugin/index.ts":b}));export{c as default};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { AnyObject, MaybeString, TupleToUnion } from '../../../../../es/shared/types';
|
|
1
|
+
import { AnyObject, ArrayAble, MaybeString, TupleToUnion } from '../../../../../es/shared/types';
|
|
2
2
|
import { VxeTableProps, VxeTableDefines, VxeTableInstance, VxeColumnPropTypes } from 'vxe-table';
|
|
3
3
|
import { VxeTableListeners } from 'vxe-table/types/table';
|
|
4
4
|
import { IHO_TABLE_STRING_STATUS, IhoTableEventNameTuple, IhoTableRowGroupSequence } from '../../../../../es/components/iho-table/src/constants';
|
|
5
|
-
import { FilterState } from '../../../../../es/components/iho-table/src/plugins/filterPlugin/types';
|
|
6
5
|
export * from './pluginType';
|
|
7
6
|
export interface IhoTableRowGroupItem {
|
|
8
7
|
groupName?: string;
|
|
@@ -38,9 +37,7 @@ export declare namespace IhoTableLowCodeField {
|
|
|
38
37
|
mapping?: {
|
|
39
38
|
type: string;
|
|
40
39
|
mappingFiled: Array<{
|
|
41
|
-
value: Array<
|
|
42
|
-
options: AnyObject[];
|
|
43
|
-
}>;
|
|
40
|
+
value: Array<Record<'key' | 'value', string>>;
|
|
44
41
|
}>;
|
|
45
42
|
};
|
|
46
43
|
};
|
|
@@ -67,6 +64,7 @@ export declare type LowCodeTableFieldItem = {
|
|
|
67
64
|
componentProps: AnyObject;
|
|
68
65
|
options: {
|
|
69
66
|
label?: string;
|
|
67
|
+
key?: string;
|
|
70
68
|
value: string;
|
|
71
69
|
disabled?: boolean;
|
|
72
70
|
}[];
|
|
@@ -109,5 +107,7 @@ export declare type IhoTableAnchorItem = {
|
|
|
109
107
|
};
|
|
110
108
|
export declare type IhoTableExpose = {
|
|
111
109
|
$table: VxeTableInstance;
|
|
112
|
-
|
|
110
|
+
loadData(data: AnyObject[]): void;
|
|
111
|
+
setSort(field: string, value: 'asc' | 'desc' | null): void;
|
|
112
|
+
setFilter(field: string, value: ArrayAble<string>): void;
|
|
113
113
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as e,
|
|
1
|
+
import{inject as e,unref as n,toRaw as t,createVNode as r}from"vue";import{jsonParse as o,findAncestor as i}from"../../../../shared/utils/index.js";import{promiseTimeout as u}from"@vueuse/shared";import{isNumber as l,cloneDeep as c,isString as a,isObject as d}from"lodash-es";import{InjectionIhoTableEmits as s,InjectionIhoTableConfig as f,IHO_TABLE_STRING_STATUS as m,IHO_TABLE_NUMBER_STATUS as v}from"../constants/index.js";function p(e){return console.warn(`[IhoTable]: ${e}`)}const I=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function h(){var n,t,r;const o=e(f);return o||p("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(n=null==o?void 0:o.value)?void 0:n.rowConfig)?void 0:t.height)?r:32}function g(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function E(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}async function C(e,t){return r()||await u(0),r()||function(){const n=+e.colWidth;return l(n)?n:64}();function r(){var r,o;return null==(o=null==(r=n(t))?void 0:r.getColumnByField(e.field))?void 0:o.renderWidth}}function w(n){const r=e(s);function o(){var e;return{value:n.row[n.column.field],row:n.row,column:{...n.column,...null==(e=n.column.editRender)?void 0:e.props},index:n.rowIndex>-1?n.rowIndex:n.$rowIndex}}function i(e={}){r("formChange",{...o(),...c(t(e))})}function u(e={}){r("formClick",{...o(),...c(t(e))})}return{emitFormChange:function(){i()},emitFormClick:function(){u()},emitFormChangeWithParams:i,emitFormClickWithParams:u}}const T=Object.freeze({createDefaultRenderCell:function(){return function(e,{row:n,column:t}){return[r("span",null,[n[t.field]])]}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...w(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){return a(e)&&(e=o(e||"")),d(e)&&((n=e).notParticipatingSearch!==m.POSITIVE&&"manual"===(null==(t=n.mapping)?void 0:t.type));var n,t}}),P=Object.freeze({isPositive:e=>e===v.POSITIVE||e===m.POSITIVE,isNegative:e=>e===v.NEGATIVE||e===m.NEGATIVE,notPositive:e=>e!==v.POSITIVE&&e!==m.POSITIVE,notNegative:e=>e!==v.NEGATIVE&&e!==m.NEGATIVE}),O=(e,n)=>({$event:t,column:r})=>{var o;if((null==(o=r.editRender)?void 0:o.name)!==e)return!0;const u=null==t?void 0:t.target;return!d(u)||!i(u,n)};export{T as IhoTableRenderHelper,P as IhoTableStatusHelper,I as IhoTableUtils,p as IhoTableWarn,O as createIhoTableClearActivedInterceptor,g as eventListener2EventName,E as eventName2EventListener,C as getColumnRenderWidth,h as getRowHeight,w as useIhoTableFormEvent};
|