cnhis-design-vue 3.2.5-beta.53 → 3.2.5-beta.54
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/big-table/index.d.ts +1 -1
- package/es/components/big-table/src/BigTable.vue.d.ts +1 -1
- package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/field-set/index.d.ts +4 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +0 -13
- package/es/components/field-set/src/FieldColor.vue2.js +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +0 -13
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/Index.vue.d.ts +4 -1
- package/es/components/field-set/src/Index.vue2.js +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- 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/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- 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
|
+
```
|
|
@@ -610,7 +610,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
610
610
|
setGroupTreeExpand: () => void;
|
|
611
611
|
resetTableInlineEditStatus: () => false | undefined;
|
|
612
612
|
renderAnnotation: (columnConfig: import("../../shared/types").AnyObject) => JSX.Element | null;
|
|
613
|
-
toolTipTitle: (item: any, type?: any) => (JSX.Element | null)[]
|
|
613
|
+
toolTipTitle: (item: any, type?: any) => (() => any) | (JSX.Element | null)[];
|
|
614
614
|
triggerExpand: (e: any, isExpand: any) => void;
|
|
615
615
|
getOtherConfigInit: () => any;
|
|
616
616
|
refreshTable: () => void;
|
|
@@ -612,7 +612,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
612
612
|
setGroupTreeExpand: () => void;
|
|
613
613
|
resetTableInlineEditStatus: () => false | undefined;
|
|
614
614
|
renderAnnotation: (columnConfig: AnyObject) => JSX.Element | null;
|
|
615
|
-
toolTipTitle: (item: any, type?: any) => (JSX.Element | null)[]
|
|
615
|
+
toolTipTitle: (item: any, type?: any) => (() => any) | (JSX.Element | null)[];
|
|
616
616
|
triggerExpand: (e: any, isExpand: any) => void;
|
|
617
617
|
getOtherConfigInit: () => any;
|
|
618
618
|
refreshTable: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,watch as n,withDirectives as s,openBlock as
|
|
1
|
+
import{defineComponent as e,ref as t,watch as n,withDirectives as s,openBlock as r,createElementBlock as i,normalizeStyle as o,unref as a,createElementVNode as c,toDisplayString as l,createVNode as u,createCommentVNode as d,withCtx as f,Fragment as p,renderList as m,createBlock as g,createTextVNode as v,vShow as h}from"vue";import{NIcon as M,NPopover as y,NTooltip as k,NUpload as x,NUploadTrigger as C,NButton as T}from"naive-ui";import{format as b}from"date-fns";import{useState as w}from"../hooks/useState.js";import{useSession as E}from"../hooks/useSession.js";import{emojis as I}from"../utils/emoji.js";import{MESSAGE_TYPE as _}from"../constants/index.js";import{uploadFileApi as R}from"../api/index.js";import{CloseCircleOutline as j}from"@vicons/ionicons5";import{cloneDeep as L}from"lodash-es";import{simplifyMessage as S}from"../utils/index.js";const F={key:0,class:"reference-content-box"},H={class:"reference-content"},K=["innerHTML"],D={class:"tool-box"},N=c("span",null,[c("i",{class:"chat--iconfont chat--icon-face"})],-1),J={class:"emoji-box"},O=c("span",null,"默认表情",-1),A={class:"list-box"},G=["onClick"],U=["src"],X=[c("i",{class:"chat--iconfont chat--icon-good"},null,-1)],z=["onClick"],B=[c("i",{class:"chat--iconfont chat--icon-image"},null,-1)],q=["onClick"],P=[c("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],Q={class:"btn-box"},V=c("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var W=e({__name:"ChatFooter",setup(e){const W=t(),Y=t(""),{state:Z,stompClient:$}=w(),{setCurrentSessionItem:ee}=E(Z),te=t(!1);function ne(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),ie()))}function se(){var e,t;Y.value=(null==(t=null==(e=W.value)?void 0:e.innerText)?void 0:t.trim())||""}async function re(e,t){const{file:n,name:s}=e.file,r=new FormData;r.append("sender",Z.userInfo.id),r.append("file",n);const i=await R(r);if(!i)return console.log("上传失败");oe({chatMessageType:t,msg:t===_.FILE?s:i,url:i})}function ie(){if(!(Y.value.length>2e3))return Y.value?void oe({msg:Y.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function oe(e){const{chatMessageType:t=_.TEXT,msg:n,url:s}=e,r={msg:n,chatMessageType:t};t===_.FILE&&(r.fileUrl=s),[_.TEXT,_.BLEND].includes(t)&&(W.value.innerHTML="",Y.value=""),Z.currentReferenceMsg.id&&(r.referenceContent=L(Z.currentReferenceMsg),Z.currentReferenceMsg.id="");const i=b(new Date,"yyyy-MM-dd HH:mm:ss");Z.currentMsg={content:r,sender:Z.userInfo.id,id:"",sendTime:i,sending:!0,fail:!1},Z.isAppendMsg=!0,ee({lastMessageSendTime:i,lastMessage:r,sortTime:i});try{$.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:r,receiver:Z.currentSessionItem.receiver})),Z.currentMsg={...Z.currentMsg,fail:!1}}catch(e){Z.currentMsg={...Z.currentMsg,fail:!0}}finally{Z.currentMsg={...Z.currentMsg,sending:!1}}}return n((()=>Z.currentReferenceMsg.id),(e=>{var t;e&&(null==(t=W.value)||t.focus())})),(e,t)=>s((r(),i("section",{class:"chat-footer",style:o({cursor:a(Z).id?"default":"not-allowed"})},[a(Z).currentReferenceMsg.id?(r(),i("div",F,[c("div",H,[c("span",null,l(a(Z).currentReferenceMsg.senderName)+":",1),c("pre",{innerHTML:a(S)(a(Z).currentReferenceMsg.content)},null,8,K)]),u(a(M),{component:a(j),onClick:t[0]||(t[0]=()=>a(Z).currentReferenceMsg.id="")},null,8,["component"])])):d("v-if",!0),c("div",D,[u(a(y),{show:te.value,"onUpdate:show":t[1]||(t[1]=e=>te.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[N])),default:f((()=>[c("div",J,[d(' <span>最近使用</span>\r\n\t\t\t\t\t<div class="list-box">\r\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\r\n\t\t\t\t\t\t\t<i>\r\n\t\t\t\t\t\t\t\t<img :src="img" />\r\n\t\t\t\t\t\t\t</i>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</div> '),O,c("div",A,[(r(!0),i(p,null,m(a(I).default,(([e,t])=>(r(),g(a(k),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[c("i",{onClick:()=>function(e){te.value=!1,oe({chatMessageType:_.EMOJI,msg:e})}(e)},[c("img",{src:t},null,8,U)],8,G)])),default:f((()=>[v(" "+l(e),1)])),_:2},1024)))),128))])])])),_:1},8,["show"]),c("span",{onClick:t[2]||(t[2]=()=>oe({chatMessageType:a(_).EMOJI,msg:0}))},X),u(a(x),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>re(e,a(_).IMAGE))},{default:f((()=>[u(a(C),{abstract:""},{default:f((({handleClick:e})=>[c("span",{onClick:e},B,8,z)])),_:1})])),_:1}),u(a(x),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>re(e,a(_).FILE))},{default:f((()=>[u(a(C),{abstract:""},{default:f((({handleClick:e})=>[c("span",{onClick:e},P,8,q)])),_:1})])),_:1})]),s(c("div",{ref_key:"inputRef",ref:W,class:"input-box",contenteditable:"",onKeydown:ne,onInput:se},null,544),[[h,a(Z).id]]),c("div",Q,[V,u(a(T),{type:"primary",round:"",disabled:!Y.value,onClick:ie},{default:f((()=>[v("发送")])),_:1},8,["disabled"])])],4)),[[h,a(Z).id]])}});export{W as default};
|
|
@@ -28,6 +28,9 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
28
28
|
default: () => never[];
|
|
29
29
|
};
|
|
30
30
|
}, {
|
|
31
|
+
attrs: {
|
|
32
|
+
[x: string]: unknown;
|
|
33
|
+
};
|
|
31
34
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
32
35
|
showTabNames: {
|
|
33
36
|
type: import("vue").PropType<import("./src/types").FieldSetTab[]>;
|
|
@@ -61,7 +64,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
61
64
|
emit: (event: "save", ...args: any[]) => void;
|
|
62
65
|
setRefs: import("../../shared/types").AnyObject;
|
|
63
66
|
primaryColor: import("vue").Ref<string>;
|
|
64
|
-
rowHeight:
|
|
67
|
+
rowHeight: import("vue").ComputedRef<"52px" | "auto">;
|
|
65
68
|
tabList: import("vue").ComputedRef<{
|
|
66
69
|
name: import("./src/types").FieldSetTab;
|
|
67
70
|
tab: string;
|
|
@@ -4,10 +4,6 @@ import { setStyle, setColorInfo } from './utils';
|
|
|
4
4
|
import { FieldSetColumnItem } from '../../../components/field-set/src/types';
|
|
5
5
|
import { AnyObject } from '../../../shared/types';
|
|
6
6
|
declare const _default: import("vue").DefineComponent<{
|
|
7
|
-
rowHeight: {
|
|
8
|
-
type: NumberConstructor;
|
|
9
|
-
default: number;
|
|
10
|
-
};
|
|
11
7
|
footerFlag: {
|
|
12
8
|
type: BooleanConstructor;
|
|
13
9
|
default: boolean;
|
|
@@ -22,10 +18,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
18
|
};
|
|
23
19
|
}, {
|
|
24
20
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
25
|
-
rowHeight: {
|
|
26
|
-
type: NumberConstructor;
|
|
27
|
-
default: number;
|
|
28
|
-
};
|
|
29
21
|
footerFlag: {
|
|
30
22
|
type: BooleanConstructor;
|
|
31
23
|
default: boolean;
|
|
@@ -1677,10 +1669,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1677
1669
|
}>;
|
|
1678
1670
|
setStyle: typeof setStyle;
|
|
1679
1671
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save")[], "close" | "save", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1680
|
-
rowHeight: {
|
|
1681
|
-
type: NumberConstructor;
|
|
1682
|
-
default: number;
|
|
1683
|
-
};
|
|
1684
1672
|
footerFlag: {
|
|
1685
1673
|
type: BooleanConstructor;
|
|
1686
1674
|
default: boolean;
|
|
@@ -1698,7 +1686,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1698
1686
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
1699
1687
|
}, {
|
|
1700
1688
|
defaultList: AnyObject[];
|
|
1701
|
-
rowHeight: number;
|
|
1702
1689
|
footerFlag: boolean;
|
|
1703
1690
|
isFieldColor: boolean;
|
|
1704
1691
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,reactive as t,openBlock as i,createElementBlock as o,createElementVNode as a,Fragment as s,renderList as r,normalizeStyle as u,unref as d,toDisplayString as n,createCommentVNode as f,createVNode as c,withCtx as p,mergeProps as m,renderSlot as v,createTextVNode as y,createBlock as b}from"vue";import{NButton as h}from"naive-ui";import
|
|
1
|
+
import{defineComponent as e,ref as l,reactive as t,openBlock as i,createElementBlock as o,createElementVNode as a,Fragment as s,renderList as r,normalizeStyle as u,unref as d,toDisplayString as n,createCommentVNode as f,createVNode as c,withCtx as p,mergeProps as m,renderSlot as v,createTextVNode as y,createBlock as b}from"vue";import{NButton as h}from"naive-ui";import x from"../../../shared/components/VueDraggable/src/vuedraggable.js";import g from"./components/Row.vue.js";import k from"./components/edit-dialog.vue.js";import{cloneDeep as _,omit as w}from"lodash-es";import{setColorInfo as C,setStyle as F}from"./utils/index.js";import{uuidGenerator as j}from"../../../shared/utils/index.js";import{format as A}from"date-fns";const D={class:"main-wrapper"},S={class:"main-wrapper__table-header"},V={class:"main-wrapper__table-body",ref:"tableBodyRef"},B=["tabindex"],E={key:0,class:"main-wrapper__table-footer"};var R=e({__name:"FieldColor",props:{footerFlag:{type:Boolean,default:!0},isFieldColor:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close"],setup(e,{expose:R,emit:L}){const M=e,U=l(!1),Y=l(null),H=l([]),I=l([{title:"名称",type:"text",field:"name"},{title:"字段",type:"text",field:"title"},{title:"创建时间",type:"text",field:"createDate"},{title:"效果",type:"text",field:"result"},{title:"颜色",type:"color",field:"color"},{title:"颜色应用于",type:"select",checkedAll:!1,disabledAll:!1,field:"colorScope"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"status"},{title:"操作",type:"custom",field:"opt"}]),N=t({columns:I,data:H,onEdit:function(e){Y.value=_(e),U.value=!0},isHighlightRow:!M.isFieldColor});function T(){L("save")}function $(){L("close")}function q(){Y.value=null,U.value=!0}function z(e){if(C(e),Y.value){const l=H.value.findIndex((l=>l.uuid===e.uuid));H.value.splice(l,1,e)}else{const l=A(new Date,"yyyy-MM-dd");H.value.push({...e,createDate:l,uuid:j()})}}return I.value.forEach((e=>{e.isShow=function(e){return!("result"===e.field&&M.isFieldColor||"title"===e.field&&!M.isFieldColor)}(e)})),H.value=M.defaultList.concat(H.value),H.value.forEach((e=>{e.uuid=j(),e.status="Y"===e.status,C(e)})),R({getTableFields:function(){return H.value.map((e=>{const l=_(e);return l.status=l.status?"Y":"N",w(l,["uuid","style","result"])}))}}),(l,t)=>(i(),o("div",D,[a("div",S,[(i(!0),o(s,null,r(I.value,((e,l)=>(i(),o(s,{key:l},[e.isShow?(i(),o("span",{key:0,class:"table-cell",style:u(d(F)(e,l))},n(e.title),5)):f("v-if",!0)],64)))),128))]),a("div",V,[c(d(x),{modelValue:H.value,"onUpdate:modelValue":t[0]||(t[0]=e=>H.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:l})=>[e.hide?f("v-if",!0):(i(),o("div",{key:0,class:"item",tabindex:l},[c(g,m(N,{element:e,index:l}),null,16,["element","index"])],8,B))])),_:1},8,["modelValue"])],512),e.footerFlag?(i(),o("div",E,[f(" 底部按钮插槽 "),v(l.$slots,"colorSetFooter",{},(()=>[c(d(h),{style:{"margin-right":"8px"},onClick:$},{default:p((()=>[y("取消")])),_:1}),c(d(h),{style:{"margin-right":"8px"},onClick:q},{default:p((()=>[y("新增")])),_:1}),c(d(h),{type:"primary",onClick:T},{default:p((()=>[y("保存")])),_:1})]))])):f("v-if",!0),U.value?(i(),b(k,{key:1,visible:U.value,"onUpdate:visible":t[1]||(t[1]=e=>U.value=e),"is-field-color":e.isFieldColor,row:Y.value,onConfirm:z},null,8,["visible","is-field-color","row"])):f("v-if",!0)]))}});export{R as default};
|
|
@@ -4,10 +4,6 @@ import { FilterSetItem, FieldSetColumnItem } from '../../../components/field-set
|
|
|
4
4
|
import { AnyObject } from '../../../shared/types';
|
|
5
5
|
import { COLUMNLIST_MAP } from './constants/filter';
|
|
6
6
|
declare const _default: import("vue").DefineComponent<{
|
|
7
|
-
rowHeight: {
|
|
8
|
-
type: NumberConstructor;
|
|
9
|
-
default: number;
|
|
10
|
-
};
|
|
11
7
|
footerFlag: {
|
|
12
8
|
type: BooleanConstructor;
|
|
13
9
|
default: boolean;
|
|
@@ -18,10 +14,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
18
14
|
};
|
|
19
15
|
}, {
|
|
20
16
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
-
rowHeight: {
|
|
22
|
-
type: NumberConstructor;
|
|
23
|
-
default: number;
|
|
24
|
-
};
|
|
25
17
|
footerFlag: {
|
|
26
18
|
type: BooleanConstructor;
|
|
27
19
|
default: boolean;
|
|
@@ -504,10 +496,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
504
496
|
}>;
|
|
505
497
|
setStyle: typeof setStyle;
|
|
506
498
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save" | "reset")[], "close" | "save" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
507
|
-
rowHeight: {
|
|
508
|
-
type: NumberConstructor;
|
|
509
|
-
default: number;
|
|
510
|
-
};
|
|
511
499
|
footerFlag: {
|
|
512
500
|
type: BooleanConstructor;
|
|
513
501
|
default: boolean;
|
|
@@ -522,7 +510,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
522
510
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
523
511
|
}, {
|
|
524
512
|
defaultList: FilterSetItem[];
|
|
525
|
-
rowHeight: number;
|
|
526
513
|
footerFlag: boolean;
|
|
527
514
|
}>;
|
|
528
515
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,reactive as i,watch as l,openBlock as a,createElementBlock as d,createElementVNode as r,Fragment as
|
|
1
|
+
import{defineComponent as e,ref as t,reactive as i,watch as l,openBlock as a,createElementBlock as d,createElementVNode as r,Fragment as c,renderList as o,normalizeStyle as s,unref as n,createBlock as u,withCtx as p,createTextVNode as m,toDisplayString as f,createCommentVNode as h,createVNode as v,mergeProps as k,renderSlot as b}from"vue";import{NCheckbox as x,NPopconfirm as y,NButton as g}from"naive-ui";import _ from"../../../shared/components/VueDraggable/src/vuedraggable.js";import w from"./components/Row.vue.js";import{cloneDeep as A}from"lodash-es";import{isShowExplicitRequired as F,setStyle as R}from"./utils/index.js";import{COLUMNLIST_MAP as j}from"./constants/filter.js";const C={class:"main-wrapper"},q={class:"main-wrapper__table-header"},V={class:"main-wrapper__table-body",ref:"tableBodyRef"},H=["tabindex"],S={key:0,class:"main-wrapper__table-footer"};var U=e({__name:"FieldFilter",props:{footerFlag:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:U,emit:E}){const L=e,B=t([]),O=t([]),T=i({columns:B,data:O,onUpdateChecked:function({checked:e,column:t}){const i=!e||z(t.field);t.checkedAll=!i}}),D=()=>{E("save")},N=()=>{E("close")};function P(){O.value=A(L.defaultList),$(),E("reset")}function $(){B.value=Object.entries(j).map((([e,t])=>{const i=function(e){return e?["isShowSearch","filterExplicit","explicitRequired"].includes(e)?"checkbox":["defaultValue"].includes(e)?"select":["customTitle"].includes(e)?"input":["width"].includes(e)?"inputNumber":"text":"text"}(e),l={isShow:!0,title:t,type:i,field:e};return"checkbox"===i&&Object.assign(l,{checkedAll:!z(e),disabledAll:!1,isHeadCheckHide:["filterExplicit","explicitRequired"].includes(e)}),l}))}function z(e){return O.value.some((t=>("explicitRequired"!==e||F(t))&&!t[e]))}return l((()=>L.defaultList),(e=>{e.length>0&&(O.value=A(e),$())}),{immediate:!0,deep:!0}),U({getTableFields:()=>O.value}),(t,i)=>(a(),d("div",C,[r("div",q,[(a(!0),d(c,null,o(B.value,((e,t)=>(a(),d(c,{key:t},[e.isShow?(a(),d("span",{key:0,class:"table-cell",style:s(n(R)(e,t))},["checkbox"!==e.type||e.isHeadCheckHide?(a(),d(c,{key:1},[m(f(e.title),1)],64)):(a(),u(n(x),{key:0,checked:e.checkedAll,"onUpdate:checked":[t=>e.checkedAll=t,t=>{return i=t,l=e.field,void O.value.forEach((e=>{("explicitRequired"!==l||"explicitRequired"===l&&F(e))&&(e[l]=i)}));var i,l}],disabled:e.disabledAll},{default:p((()=>[m(f(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"]))],4)):h("v-if",!0)],64)))),128))]),r("div",V,[v(n(_),{modelValue:O.value,"onUpdate:modelValue":i[0]||(i[0]=e=>O.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:t})=>[e.hide?h("v-if",!0):(a(),d("div",{key:0,class:"item",tabindex:t},[v(w,k(T,{element:e,idx:t+1}),null,16,["element","idx"])],8,H))])),_:1},8,["modelValue"])],512),e.footerFlag?(a(),d("div",S,[h(" 底部按钮插槽 "),b(t.$slots,"fieldFilterFooter",{},(()=>[v(n(y),{onPositiveClick:P},{trigger:p((()=>[v(n(g),{style:{"margin-right":"8px"}},{default:p((()=>[m("恢复默认设置")])),_:1})])),default:p((()=>[m(" 确认要恢复系统默认设置吗? ")])),_:1}),v(n(g),{style:{"margin-right":"8px"},onClick:N},{default:p((()=>[m("取消")])),_:1}),v(n(g),{type:"primary",onClick:D},{default:p((()=>[m("保存")])),_:1})]))])):h("v-if",!0)]))}});export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as l,ref as t,computed as i,reactive as o,watch as d,openBlock as a,createElementBlock as r,createBlock as s,unref as n,withKeys as u,withModifiers as c,createCommentVNode as f,createElementVNode as h,Fragment as p,renderList as m,normalizeStyle as y,withCtx as v,createTextVNode as b,toDisplayString as g,createVNode as k,normalizeClass as x,mergeProps as w,renderSlot as S}from"vue";import{NInput as A,NCheckbox as _,NTooltip as C,NIcon as D,NPopconfirm as F,NButton as W}from"naive-ui";import E from"../../../shared/components/VueDraggable/src/vuedraggable.js";import H from"./components/Row.vue.js";import{isArray as M,cloneDeep as N,isString as P,omit as q}from"lodash-es";import{isDisable as B,setStyle as R,isDraggableItem as V,isDraggable as j,getGroupTree as I}from"./utils/index.js";import{uuidGenerator as U}from"../../../shared/utils/index.js";import{HelpCircleSharp as O}from"@vicons/ionicons5";const T={class:"main-wrapper"},K={class:"main-wrapper__table-header"},G=h("span",null,"数值越小,优先级越高",-1),L=["tabindex"],$={key:1,class:"main-wrapper__table-footer"};var z=e({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]},showSeq:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},showSortPriority:{type:Boolean,default:!1},showHeadFilter:{type:Boolean,default:!1},fieldShowMaxValue:{type:Number},rowDraggable:{type:Boolean,default:!0},fieldDescribeMode:{type:String,default:"tooltip"}},emits:["save","close","reset"],setup(e,{expose:z,emit:J}){const Q=e,X={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"}
|
|
1
|
+
import{defineComponent as e,useAttrs as l,ref as t,computed as i,reactive as o,watch as d,openBlock as a,createElementBlock as r,createBlock as s,unref as n,withKeys as u,withModifiers as c,createCommentVNode as f,createElementVNode as h,Fragment as p,renderList as m,normalizeStyle as y,withCtx as v,createTextVNode as b,toDisplayString as g,createVNode as k,normalizeClass as x,mergeProps as w,renderSlot as S}from"vue";import{NInput as A,NCheckbox as _,NTooltip as C,NIcon as D,NPopconfirm as F,NButton as W}from"naive-ui";import E from"../../../shared/components/VueDraggable/src/vuedraggable.js";import H from"./components/Row.vue.js";import{isArray as M,cloneDeep as N,isString as P,omit as q}from"lodash-es";import{isDisable as B,setStyle as R,isDraggableItem as V,isDraggable as j,getGroupTree as I}from"./utils/index.js";import{uuidGenerator as U}from"../../../shared/utils/index.js";import{HelpCircleSharp as O}from"@vicons/ionicons5";const T={class:"main-wrapper"},K={class:"main-wrapper__table-header"},G=h("span",null,"数值越小,优先级越高",-1),L=["tabindex"],$={key:1,class:"main-wrapper__table-footer"};var z=e({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]},showSeq:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},showSortPriority:{type:Boolean,default:!1},showHeadFilter:{type:Boolean,default:!1},fieldShowMaxValue:{type:Number},rowDraggable:{type:Boolean,default:!0},fieldDescribeMode:{type:String,default:"tooltip"}},emits:["save","close","reset"],setup(e,{expose:z,emit:J}){const Q=e,X={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"};l();const Y=t(""),Z=t(),ee=t([]),le=t([{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!!Q.fieldShowMaxValue,field:"show",fieldShowMaxValue:Q.fieldShowMaxValue},{title:"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:"默认排序",type:"select",field:"sortDirection"},{title:"排序优先级",type:"select",field:"sortPriority"},{title:"固定",type:"select",field:"fixedWay"},{title:"自定义标题",type:"input",field:"alias"},{title:"列宽",type:"inputNumber",field:"columnWidth"},{title:"表头筛选",type:"checkbox",isHeadCheckHide:!0,field:"isShowHeaderFilter"}]),te=i((()=>ee.value.flat())),ie=i((()=>te.value.some((e=>e.feildDescribe)))),oe=o({columns:le,data:te,onUpdateChecked:function({checked:e,column:l}){const t=!e||he(l.field);l.checkedAll=!t},draggable:Q.rowDraggable,isFieldSet:!0,fieldDescribeMode:Q.fieldDescribeMode}),de={keyword:Y.value,idx:0,startIdx:0},ae=()=>{J("save")},re=()=>{J("close")};function se(){ee.value=ne(),fe(),J("reset")}function ne(){const e=N(Q.fields).map((e=>({...e,uuid:U()})));return Object.keys(X).forEach((l=>{e.forEach((e=>{"old"==Q.type&&Reflect.has(e,l)&&("isFixed"==l?e.fixedWay=1==e[l]?"LEFT":2==e[l]?"RIGHT":"NONE":["isShow","isSort"].includes(l)&&"boolean"!=typeof l?e[X[l]]=1==e[l]:e[X[l]]=e[l],Reflect.deleteProperty(e,l)),e.columnWidth=+e.columnWidth||null,Reflect.has(e,"alias")||(e.alias=""),Reflect.has(e,"bold")||(e.bold=!1),e.draggable=!!j(e)}))})),function(e){if(Q.groupSetting){return I(Q.groupSetting,e).reduce(((t,i)=>{const o=P(i)?e.find((e=>e.name===i)):l(i.children);return o&&t.push(o),t}),[])}return e;function l(t){const i=[];return t.forEach((t=>{if(t.children)i.push(...l(t.children));else{const l=e.find((e=>e.name===t));l&&i.push(l)}})),i}}(e)}function ue(){const e=de.keyword!==Y.value;let l=Y.value?te.value.findIndex(((l,t)=>{var i;if(null==(i=l.title)?void 0:i.includes(Y.value))return!!e||t>de.idx})):0;-1!==l||e||(l=de.startIdx),Z.value.scrollTop=52*l,Object.assign(de,{keyword:Y.value,idx:l},e?{startIdx:l}:{})}function ce(e){var l;return!!Y.value&&(null==(l=e.title)?void 0:l.includes(Y.value))}function fe(){var e,l;(null==(e=Q.showColumnNames)?void 0:e.length)&&(le.value=le.value.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=Q.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=Q.customColumns)?void 0:l.length)&&le.value.push(...Q.customColumns),"column"===Q.fieldDescribeMode&&ie.value&&le.value.push({title:"字段描述",type:"text",field:"feildDescribe"}),Q.showSeq&&le.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),le.value.forEach((e=>{if(e.isShow=function(e){return!(["editable","required"].includes(e.field)&&!Q.isEdit||"sortPriority"===e.field&&!Q.showSortPriority||"isShowHeaderFilter"===e.field&&!Q.showHeadFilter)}(e),"checkbox"===e.type){const l=ee.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!he(e.field)&&!l}}))}function he(e){return ee.value.flat().some((l=>!B(l,e)&&!l[e]&&"0001"!=l.id))}function pe(e){return!!V(e.relatedContext.element)}return d([()=>Q.fields,()=>{var e;return null==(e=Q.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(ee.value=ne(),fe())}),{immediate:!0,deep:!0}),z({getTableFields:function(){let e=[];return e="old"==Q.type?te.value.map(((e,l)=>({id:e.id,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth,bold:e.bold,sortDirection:e.sortDirection,sortPriority:e.sortPriority,...Q.isEdit?{required:e.required,editable:e.editable}:{}}))):te.value,e.map((e=>q(e,["uuid"])))}}),(l,t)=>(a(),r("div",T,[e.showSearch?(a(),s(n(A),{key:0,class:"main-wrapper__search-wrapper",value:Y.value,"onUpdate:value":t[0]||(t[0]=e=>Y.value=e),valueModifiers:{trim:!0},placeholder:"请输入字段标题",onKeydown:u(c(ue,["prevent"]),["enter"])},null,8,["value","onKeydown"])):f("v-if",!0),h("div",K,[(a(!0),r(p,null,m(le.value,((e,l)=>(a(),r(p,{key:l},[e.isShow?(a(),r("span",{key:0,class:"table-cell",style:y(n(R)(e,l))},["checkbox"!==e.type||e.isHeadCheckHide?(a(),r(p,{key:1},[b(g(e.title),1)],64)):(a(),s(n(_),{key:0,checked:e.checkedAll,"onUpdate:checked":[l=>e.checkedAll=l,l=>{return t=l,i=e.field,void te.value.forEach((e=>{B(e,i)||(e[i]=t)}));var t,i}],disabled:e.disabledAll},{default:v((()=>[b(g(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===e.field?(a(),s(n(C),{key:2,trigger:"hover"},{trigger:v((()=>[k(n(D),{component:n(O),style:{top:"2px"}},null,8,["component"])])),default:v((()=>[G])),_:1})):f("v-if",!0)],4)):f("v-if",!0)],64)))),128))]),h("div",{class:"main-wrapper__table-body",ref_key:"tableBodyRef",ref:Z},[k(n(E),{modelValue:ee.value,"onUpdate:modelValue":t[1]||(t[1]=e=>ee.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:pe,disabled:!e.rowDraggable},{item:v((({element:e,index:l})=>[e.hide?f("v-if",!0):(a(),r("div",{key:0,class:x(["item",n(V)(e)?"":"disabled"]),tabindex:l},[n(M)(e)?(a(!0),r(p,{key:0},m(e,((e,t)=>(a(),s(H,w(oe,{key:t,element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"])))),128)):(a(),s(H,w({key:1},oe,{element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"]))],10,L))])),_:1},8,["modelValue","disabled"])],512),e.footerFlag?(a(),r("div",$,[f(" 底部按钮插槽 "),S(l.$slots,"footer",{},(()=>[k(n(F),{onPositiveClick:se},{trigger:v((()=>[k(n(W),{style:{"margin-right":"8px"}},{default:v((()=>[b("恢复默认设置")])),_:1})])),default:v((()=>[b(" 确认要恢复系统默认设置吗? ")])),_:1}),k(n(W),{style:{"margin-right":"8px"},onClick:re},{default:v((()=>[b("取消")])),_:1}),k(n(W),{type:"primary",onClick:ae},{default:v((()=>[b("保存")])),_:1})]))])):f("v-if",!0)]))}});export{z as default};
|
|
@@ -30,6 +30,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
30
|
default: () => never[];
|
|
31
31
|
};
|
|
32
32
|
}, {
|
|
33
|
+
attrs: {
|
|
34
|
+
[x: string]: unknown;
|
|
35
|
+
};
|
|
33
36
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
34
37
|
showTabNames: {
|
|
35
38
|
type: PropType<FieldSetTab[]>;
|
|
@@ -59,7 +62,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
59
62
|
emit: (event: "save", ...args: any[]) => void;
|
|
60
63
|
setRefs: AnyObject;
|
|
61
64
|
primaryColor: import("vue").Ref<string>;
|
|
62
|
-
rowHeight:
|
|
65
|
+
rowHeight: import("vue").ComputedRef<"52px" | "auto">;
|
|
63
66
|
tabList: import("vue").ComputedRef<{
|
|
64
67
|
name: FieldSetTab;
|
|
65
68
|
tab: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,
|
|
1
|
+
import{defineComponent as e,useAttrs as l,provide as t,reactive as i,ref as a,computed as r,openBlock as o,createElementBlock as s,normalizeStyle as d,unref as n,createBlock as f,withCtx as m,Fragment as u,renderList as b,resolveDynamicComponent as h,mergeProps as y,createSlots as p,renderSlot as v,h as F}from"vue";import{useThemeVars as g,NTabs as c,NTabPane as w}from"naive-ui";import C from"./FieldSet.vue.js";import L from"./FieldColor.vue.js";import T from"./TableStyle.vue.js";import S from"./FieldFilter.vue.js";import{InjectionFieldList as _,InjectionQueryWordbookData as j}from"./constants/index.js";var $=e({__name:"Index",props:{showTabNames:{type:Array,default:()=>["field"]},fieldColorList:{type:Array,default:()=>[]},highlightRowColorList:{type:Array,default:()=>[]},fieldList:{type:Object},queryWordbookData:{type:Function},fieldFilterList:{type:Array,default:()=>[]}},emits:["save"],setup(e,{expose:$,emit:k}){const x=e,R=l();t(_,x.fieldList),t(j,x.queryWordbookData);const A=i({}),q=a(g().value.primaryColor),D=r((()=>"showSearch"in R&&!1!==R.showSearch||"show-search"in R&&!1!==R["show-search"]?"52px":"auto")),N=r((()=>[{name:"field",tab:"字段设置",render:()=>F(C)},{name:"fieldColor",tab:"字段颜色",render:()=>F(L,{isFieldColor:!0,defaultList:x.fieldColorList})},{name:"highlightRow",tab:"高亮行",render:()=>F(L,{isFieldColor:!1,defaultList:x.highlightRowColorList})},{name:"tableStyle",tab:"表格样式",render:()=>F(T)},{name:"fieldFilter",tab:"高级筛选",render:()=>F(S,{defaultList:x.fieldFilterList})}].filter((e=>x.showTabNames.includes(e.name)))));function W(){var e,l,t,i,a;k("save",{tableFields:null==(e=A.field)?void 0:e.getTableFields(),tableFieldColors:null==(l=A.fieldColor)?void 0:l.getTableFields(),tableHighlightRows:null==(t=A.highlightRow)?void 0:t.getTableFields(),tableStyle:null==(i=A.tableStyle)?void 0:i.getTableFields(),tableFilters:null==(a=A.fieldFilter)?void 0:a.getTableFields()})}function H(e,l){A[l]=e}return $({getTableFields:function(e){var l;return null==(l=A[e||"field"])?void 0:l.getTableFields()}}),(e,l)=>(o(),s("div",{class:"c-field-set",style:d({"--row-height":n(D),"--primary-color":q.value})},[n(N).length>1?(o(),f(n(c),{key:0,type:"line",naimated:""},{default:m((()=>[(o(!0),s(u,null,b(n(N),(l=>(o(),f(n(w),{key:l.name,name:l.name,tab:l.tab,"display-directive":"show"},{default:m((()=>[(o(),f(h(l.render()),y(e.$attrs,{ref_for:!0,ref:e=>H(e,l.name),onSave:W}),p({_:2},[b(e.$slots,((l,t)=>({name:t,fn:m((()=>[v(e.$slots,t)]))})))]),1040))])),_:2},1032,["name","tab"])))),128))])),_:3})):(o(),f(h(n(N)[0].render()),y({key:1},e.$attrs,{ref:e=>H(e,n(N)[0].name),onSave:W}),p({_:2},[b(e.$slots,((l,t)=>({name:t,fn:m((()=>[v(e.$slots,t)]))})))]),1040))],4))}});export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.c-field-set{height:100%;width:100%}.c-field-set__color-picker .n-color-picker-trigger__value{display:none}.c-field-set .main-wrapper{display:flex;flex-flow:column nowrap;height:100%;width:100%}.c-field-set .main-wrapper__search-wrapper.n-input{margin-bottom:12px;width:50%}.c-field-set .main-wrapper .item{background:#fff}.c-field-set .main-wrapper .item:active{background:#f2f2f2;box-shadow:0 0 10px 0 #d5d5d5}.c-field-set .main-wrapper .item:focus{background-color:#f2f2f2}.c-field-set .main-wrapper .item.disabled{cursor:not-allowed}.c-field-set .main-wrapper .item .row{align-items:center;border-bottom:1px solid #e8e8e8;display:flex;height:var(--row-height);padding:
|
|
1
|
+
.c-field-set{height:100%;width:100%}.c-field-set__color-picker .n-color-picker-trigger__value{display:none}.c-field-set .main-wrapper{display:flex;flex-flow:column nowrap;height:100%;width:100%}.c-field-set .main-wrapper__search-wrapper.n-input{margin-bottom:12px;width:50%}.c-field-set .main-wrapper .item{background:#fff}.c-field-set .main-wrapper .item:active{background:#f2f2f2;box-shadow:0 0 10px 0 #d5d5d5}.c-field-set .main-wrapper .item:focus{background-color:#f2f2f2}.c-field-set .main-wrapper .item.disabled{cursor:not-allowed}.c-field-set .main-wrapper .item .row{align-items:center;border-bottom:1px solid #e8e8e8;display:flex;height:var(--row-height);padding:8px 0}.c-field-set .main-wrapper .table-cell{box-sizing:border-box;color:inherit;display:inline-block;padding:0 5px}.c-field-set .main-wrapper .table-cell .highlight{background-color:var(--primary-color);color:#fff}.c-field-set .main-wrapper .table-cell .c-field-set__color-picker{display:block}.c-field-set .main-wrapper__table-header{align-items:center;background:#f2f2f4;border:1px solid #f2f2f2;display:flex;height:52px}.c-field-set .main-wrapper__table-header .n-checkbox.n-checkbox--disabled .n-checkbox__label{color:var(--n-text-color)}.c-field-set .main-wrapper__table-body{flex:1;overflow-y:auto}.c-field-set .main-wrapper__table-footer{border-top:1px solid #d5d5d5;padding:12px 0}.c-field-set .main-wrapper .set-item{padding:10px 0}.c-field-set .main-wrapper .set-item.table-item{border-top:1px solid #e8e8e8;width:50%}.c-field-set .main-wrapper .set-item.table-item h4{font-size:16px;font-weight:400;margin-bottom:12px}.c-field-set .main-wrapper .set-item.table-item .table-style{background:#e5e5e5;border:2px solid #cfcfcf;border-radius:4px;cursor:pointer;margin-bottom:10px;padding:20px 0 0}.c-field-set .main-wrapper .set-item.table-item .table-style .table-bg{background:#fff;border-radius:5px;margin:0 20px 20px;padding:10px}.c-field-set .main-wrapper .set-item.table-item .table-style .table-bg img{width:100%}.c-field-set .main-wrapper .set-item.table-item .table-style__desc{align-items:center;background:#fff;display:flex;padding:10px}.c-field-set .main-wrapper .set-item.table-item .table-style__desc .n-icon{color:var(--c-primary-color);font-size:20px}.c-field-set .main-wrapper .set-item.table-item .table-style__desc .circle{border:1px solid #d5d5d5;border-radius:50%;display:inline-block;height:18px;width:18px}.c-field-set .main-wrapper .set-item.table-item .table-style__desc span{margin-left:5px}.c-field-set .main-wrapper .set-item.table-item .table-style.active{background:#e2ebfa;border:2px solid var(--c-primary-color)}.c-field-set__color-block{display:inline-block;margin-left:20px;position:relative}.c-field-set__color-block:before{background-color:var(--color);border-radius:2px;content:"";height:14px;left:-20px;position:absolute;top:3px;width:14px}.c-field-set__space{width:100%}.c-field-set__space>div:first-child{width:80%}.c-field-set__space .filter-btn{color:var(--c-primary-color);cursor:pointer}.c-field-set__condition .opt-btn{cursor:pointer;display:inline-flex}.c-field-set__condition .condition-wrapper__item{align-items:center;display:flex;margin-top:10px}.c-field-set__condition .condition-wrapper__item .item-index{margin-right:10px}.c-field-set__condition .condition-wrapper__item>.n-date-picker,.c-field-set__condition .condition-wrapper__item>.n-input,.c-field-set__condition .condition-wrapper__item>.n-input-number,.c-field-set__condition .condition-wrapper__item>.n-select{margin-right:10px;width:20%}.c-field-set__condition .sql-expression-wrapper{margin-top:10px}
|