cnhis-design-vue 3.1.42-beta.42 → 3.1.42-beta.43
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/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
- package/es/components/form-render/src/components/renderer/dist/levelSearchCascader.d.ts +77 -0
- package/es/components/form-render/src/components/renderer/dist/searchCascade.d.ts +75 -0
- package/es/components/iho-table/src/plugins/dist/highLightSetPlugin.d.ts +3 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/defaultRendererPlugin.d.ts +3 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/seqRendererPlugin.d.ts +3 -0
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/components/search-cascader/index.d.ts +12 -1
- package/es/components/search-cascader/src/SearchCascader.vue.d.ts +12 -1
- package/es/components/search-cascader/src/SearchCascader.vue.js +1 -1
- package/es/components/search-cascader/src/components/SearchMenu.d.ts +8 -1
- package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
- package/es/components/search-cascader/src/components/dist/SearchMenu.d.ts +57 -0
- package/es/components/search-cascader/src/components/dist/SearchMenu1.d.ts +57 -0
- package/es/components/search-cascader/src/constants/index.d.ts +1 -0
- package/es/components/search-cascader/src/constants/index.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
- package/es/env.d.ts +25 -24
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export const __esModule: true;
|
|
2
|
+
export const LEVEL_SEARCH_CASCADER: vue_2.DefineComponent<{
|
|
3
|
+
options: {
|
|
4
|
+
type: ArrayConstructor;
|
|
5
|
+
default: () => never[];
|
|
6
|
+
};
|
|
7
|
+
labelField: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
valueField: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
autograph: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
lazyRequest: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
requestCache: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
wordbook: {
|
|
28
|
+
type: ObjectConstructor;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
onChange: {};
|
|
32
|
+
value: {
|
|
33
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
34
|
+
};
|
|
35
|
+
}, () => any, any, {}, {}, vue_2.ComponentOptionsMixin, vue_2.ComponentOptionsMixin, "update:value"[], "update:value", vue_2.VNodeProps & vue_2.AllowedComponentProps & vue_2.ComponentCustomProps, Readonly<vue_2.ExtractPropTypes<{
|
|
36
|
+
options: {
|
|
37
|
+
type: ArrayConstructor;
|
|
38
|
+
default: () => never[];
|
|
39
|
+
};
|
|
40
|
+
labelField: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
valueField: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
autograph: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
lazyRequest: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
requestCache: {
|
|
57
|
+
type: BooleanConstructor;
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
60
|
+
wordbook: {
|
|
61
|
+
type: ObjectConstructor;
|
|
62
|
+
required: true;
|
|
63
|
+
};
|
|
64
|
+
onChange: {};
|
|
65
|
+
value: {
|
|
66
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
67
|
+
};
|
|
68
|
+
}>> & {
|
|
69
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
options: unknown[];
|
|
72
|
+
labelField: string;
|
|
73
|
+
valueField: string;
|
|
74
|
+
lazyRequest: boolean;
|
|
75
|
+
requestCache: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
import vue_2 = require("vue");
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export const __esModule: true;
|
|
2
|
+
export const SEARCH_CASCADER: vue_2.DefineComponent<{
|
|
3
|
+
options: {
|
|
4
|
+
type: ArrayConstructor;
|
|
5
|
+
default: () => never[];
|
|
6
|
+
};
|
|
7
|
+
depth: {
|
|
8
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
9
|
+
};
|
|
10
|
+
urlConfig: {
|
|
11
|
+
type: ObjectConstructor;
|
|
12
|
+
};
|
|
13
|
+
requestCache: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: boolean;
|
|
16
|
+
};
|
|
17
|
+
onFocus: {
|
|
18
|
+
type: FunctionConstructor;
|
|
19
|
+
};
|
|
20
|
+
filterable: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
labelField: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
valueField: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
onChange: {};
|
|
33
|
+
value: {};
|
|
34
|
+
}, () => any, any, {}, {}, vue_2.ComponentOptionsMixin, vue_2.ComponentOptionsMixin, "update:value"[], "update:value", vue_2.VNodeProps & vue_2.AllowedComponentProps & vue_2.ComponentCustomProps, Readonly<vue_2.ExtractPropTypes<{
|
|
35
|
+
options: {
|
|
36
|
+
type: ArrayConstructor;
|
|
37
|
+
default: () => never[];
|
|
38
|
+
};
|
|
39
|
+
depth: {
|
|
40
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
41
|
+
};
|
|
42
|
+
urlConfig: {
|
|
43
|
+
type: ObjectConstructor;
|
|
44
|
+
};
|
|
45
|
+
requestCache: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
49
|
+
onFocus: {
|
|
50
|
+
type: FunctionConstructor;
|
|
51
|
+
};
|
|
52
|
+
filterable: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
labelField: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
valueField: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
default: string;
|
|
63
|
+
};
|
|
64
|
+
onChange: {};
|
|
65
|
+
value: {};
|
|
66
|
+
}>> & {
|
|
67
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
options: unknown[];
|
|
70
|
+
labelField: string;
|
|
71
|
+
valueField: string;
|
|
72
|
+
requestCache: boolean;
|
|
73
|
+
filterable: boolean;
|
|
74
|
+
}>;
|
|
75
|
+
import vue_2 = require("vue");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,reactive as t,ref as a,watch as o,nextTick as i,openBlock as n,createElementBlock as l,normalizeClass as s,unref as r,createCommentVNode as u,Fragment as c,createBlock as p,mergeProps as d,createElementVNode as m,normalizeStyle as v,createVNode as f,withCtx as g,renderList as y,toDisplayString as b,createTextVNode as k,resolveDynamicComponent as S,h as C}from"vue";import h from"./hooks/use-noData.js";import{getScaleViewState as w}from"./hooks/scaleview-state.js";import{ScaleViewComputed as E}from"./hooks/scaleview-computed.js";import{ScaleViewInit as _}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as A}from"./hooks/scaleview-submit.js";import{handleQueryParams as O,isCollection as j,isEvaluation as T}from"./utils/judge-types.js";import{useEvent as L}from"./hooks/use-event.js";import D from"./components/NoData.vue.js";import P from"../../../shared/components/SvgIcon/SvgIcon.vue.js";import x from"./components/EvaluateCountdown.vue.js";import B from"./components/EvaluatePage.vue.js";import F from"./components/AnswerParse.vue.js";import I from"./components/ScaleScore.js";import{useDialog as N,useMessage as q,NForm as M,NFormItem as R,NButton as K}from"naive-ui";import V from"../../../_virtual/plugin-vue_export-helper.js";const H=["innerHTML"],U={key:0,class:"required-text"},W={key:1,class:"evalute-label"},J=["onClick"],Y={key:1,class:"footer"};var X=V(e({__name:"ScaleView",props:{guageData:{type:Object,default:()=>({})},styleSetting:{type:Object,default:()=>({})},ids:{type:Object,default:()=>({guage_id:"",db_id:void 0})},params:{default:()=>({}),type:Object},noBtn:{type:[Boolean,String,Number],default:!1},hideBtn:{type:[Boolean,String,Number],default:!1},isLock:{type:[Boolean,String,Number],default:!1},type:{type:String,default:""},openType:{type:String,default:""},scaleApiConfig:{type:Object,default:()=>({})},getSelectOptions:{type:Function,default:()=>Promise.resolve([])},getSearchOptions:{type:Function,default:()=>Promise.resolve([])},getCascadeOptions:{type:Function,default:()=>Promise.resolve([])},getLabelList:{type:Function,default:()=>Promise.resolve([])},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},uploadPictureUrl:{type:String,default:""},uploadFileUrl:{type:String,default:""},ak:{type:String,default:"KP3BZ-OAC3W-PY6RY-OJ6DV-JYKN3-H6F72"},sourceType:{type:String,default:""},getChunkUploadConfig:{type:Function,default:()=>Promise.resolve({})}},emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:V,emit:X}){const G=e,{ScaleViewState:Q}=w(),Z=t(Q),$=N(),z=q(),ee=a(null),te=a(null),{noDataState:ae,setNoData:oe,resetNodata:ie}=h(),ne=O(),{showEvatip:le,isFormBoldOpen:se,scaleStyle:re,handlePageClass:ue,isShowItem:ce,handleShowQuestionNumber:pe,hasScore:de,isPreviewScale:me,showEvaluateEntry:ve,showEvaluateCoundownPage:fe,showSaveBtn:ge,showEvaluateLabel:ye,showAnswerParse:be,propsConfig:ke,evaluatePageProps:Se,evaluateCountdownProps:Ce,skipCover:he,scaleEdit:we}=E(G,Z,{query:ne}),{initForm:Ee}=_(G,Z,X,{query:ne}),{submitMethod:_e}=A(G,Z,X,{query:ne}),{nextLogicEvent:Ae,handleDynamicDataRelation:Oe}=L(G,Z);(()=>{let{id:e}=ne;e&&(Z.shareId=e)})();const je=e=>{try{ie(),Ee(e)}catch(e){console.log(e,"--error"),Z.spinning=!1,Z.hasFrontAddress=!1,oe(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};o((()=>G.ids),((e,t)=>{t?e.guage_id&&e.guage_id!=t.guage_id&&je(e):e.guage_id&&je(e)}),{immediate:!0}),o((()=>G.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;Z.form={},Z.formArray=[];const t=JSON.parse(JSON.stringify(e));i((()=>{Ee(t)}))}),{immediate:!0});const Te=e=>{Z.showEvaluateSettingWrap=!1,Z.showEvaluateCountdown=!!e,X("startWriteScale")},Le=()=>{console.log("----closeEvaluateCountdown"),Z.showEvaluateCountdown=!1,me.value||(Z.banSubmit=!0,_e(),$.warning({title:"温馨提示",content:"测评时间到了,结束测评!",maskClosable:!1,positiveText:"确定",onPositiveClick:()=>({})}))},De=e=>{$.warning({title:"提示",content:()=>C("div",{class:"evatip-container"},[C("span","答案解析:"),C("p",e)]),class:"c-evatip-dialog-wrap",showIcon:!1,positiveText:"确定",negativeText:"关闭",maskClosable:!1,onPositiveClick(){},onNegativeClick(){}})},Pe=(e,t,a)=>{console.log(e,"--val");let{choiceObj:o,isSetObj:i}=a||{};switch(t.type.includes("SELECT")||(Z.form[t.val_key]=e),t.type){case"SELECT":case"EVALUATE_SELECT":{let{value:a,list:o=[]}=e;Z.form[t.val_key]=a,Ae(e,t,Z.formArray),Oe(o,t,Z.formArray)}break;case"RADIO_BLOCK":case"CHECKBOX_BLOCK":i&&(Z.choiceComObj[t.val_key]=o),Ae(e,t,Z.formArray);break;case"EVALUATE_RADIO_BLOCK":case"EVALUATE_CHECKBOX_BLOCK":Ae(e,t,Z.formArray);break;case"DATE":case"TIME":case"DATETIME":case"SEARCH_CASCADE":Z.submitForm[t.val_key]=e}},xe=(e,t)=>{console.log(t),Z.form[t.val_key]=e},Be=e=>{if(!e||!e.length)return{labelStr:"",labels:[]};const t=e||[],a=[],o=[];return t.forEach((e=>{o.push(e),a.push(e.labelName)})),Z.labelSelectedList=t,{labelStr:a.join(","),labels:o}},Fe=()=>{var e;if(!Z.formArray.find((e=>T(e.type))))return void Ie("确认要提交吗?");let{evaluateResultSetting:t}=Z.config;if(!t||!Object.keys(t).length&&!ve.value||we.value)return void Ie("确认要结束测评吗?");if("formIframe"==G.openType&&ve.value)return void X("submitNoRequest");let a="确定要提前结束测评吗?";if(fe.value&&(null==(e=ee.value)?void 0:e.getCountdownObj)){const e=ee.value.getCountdownObj(),{setAnswered:t,totalLen:o}=e;t<o?a="存在未作答的题目,确定要提前结束测评吗?":!(null==Z?void 0:Z.showEvaluateCountdown)&&(a="确认要结束测评吗?")}Ie(a)},Ie=e=>{$.warning({title:"温馨提示",content:()=>C("div",{style:{paddingLeft:"30px"}},e),positiveText:"确定",negativeText:"取消",maskClosable:!1,closable:!1,positiveButtonProps:{type:"primary"},onPositiveClick:()=>{Ne()},onNegativeClick(){}})},Ne=()=>{var e;null==(e=te.value)||e.validate((e=>{var t;if(e){console.log(e);let a=(null==(t=e[0])?void 0:t[0])||{},o=a.field,i=a.message,n=Z.formArray.find((e=>e.databaseTitle===o));return n&&(o=n.title),z.error(o+i),!1}_e()}))},qe=()=>{X("onCloseSetting")};return V({getScaleData:()=>({...Z}),onSubmit:Fe,cancel:qe}),(e,t)=>(n(),l("div",{class:s(["c-scale",{"c-scale-nobtn":r(ge)}])},[u(' <template v-if="state.spinning">\
|
|
1
|
+
import{defineComponent as e,reactive as t,ref as a,watch as o,nextTick as i,openBlock as n,createElementBlock as l,normalizeClass as s,unref as r,createCommentVNode as u,Fragment as c,createBlock as p,mergeProps as d,createElementVNode as m,normalizeStyle as v,createVNode as f,withCtx as g,renderList as y,toDisplayString as b,createTextVNode as k,resolveDynamicComponent as S,h as C}from"vue";import h from"./hooks/use-noData.js";import{getScaleViewState as w}from"./hooks/scaleview-state.js";import{ScaleViewComputed as E}from"./hooks/scaleview-computed.js";import{ScaleViewInit as _}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as A}from"./hooks/scaleview-submit.js";import{handleQueryParams as O,isCollection as j,isEvaluation as T}from"./utils/judge-types.js";import{useEvent as L}from"./hooks/use-event.js";import D from"./components/NoData.vue.js";import P from"../../../shared/components/SvgIcon/SvgIcon.vue.js";import x from"./components/EvaluateCountdown.vue.js";import B from"./components/EvaluatePage.vue.js";import F from"./components/AnswerParse.vue.js";import I from"./components/ScaleScore.js";import{useDialog as N,useMessage as q,NForm as M,NFormItem as R,NButton as K}from"naive-ui";import V from"../../../_virtual/plugin-vue_export-helper.js";const H=["innerHTML"],U={key:0,class:"required-text"},W={key:1,class:"evalute-label"},J=["onClick"],Y={key:1,class:"footer"};var X=V(e({__name:"ScaleView",props:{guageData:{type:Object,default:()=>({})},styleSetting:{type:Object,default:()=>({})},ids:{type:Object,default:()=>({guage_id:"",db_id:void 0})},params:{default:()=>({}),type:Object},noBtn:{type:[Boolean,String,Number],default:!1},hideBtn:{type:[Boolean,String,Number],default:!1},isLock:{type:[Boolean,String,Number],default:!1},type:{type:String,default:""},openType:{type:String,default:""},scaleApiConfig:{type:Object,default:()=>({})},getSelectOptions:{type:Function,default:()=>Promise.resolve([])},getSearchOptions:{type:Function,default:()=>Promise.resolve([])},getCascadeOptions:{type:Function,default:()=>Promise.resolve([])},getLabelList:{type:Function,default:()=>Promise.resolve([])},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},uploadPictureUrl:{type:String,default:""},uploadFileUrl:{type:String,default:""},ak:{type:String,default:"KP3BZ-OAC3W-PY6RY-OJ6DV-JYKN3-H6F72"},sourceType:{type:String,default:""},getChunkUploadConfig:{type:Function,default:()=>Promise.resolve({})}},emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:V,emit:X}){const G=e,{ScaleViewState:Q}=w(),Z=t(Q),$=N(),z=q(),ee=a(null),te=a(null),{noDataState:ae,setNoData:oe,resetNodata:ie}=h(),ne=O(),{showEvatip:le,isFormBoldOpen:se,scaleStyle:re,handlePageClass:ue,isShowItem:ce,handleShowQuestionNumber:pe,hasScore:de,isPreviewScale:me,showEvaluateEntry:ve,showEvaluateCoundownPage:fe,showSaveBtn:ge,showEvaluateLabel:ye,showAnswerParse:be,propsConfig:ke,evaluatePageProps:Se,evaluateCountdownProps:Ce,skipCover:he,scaleEdit:we}=E(G,Z,{query:ne}),{initForm:Ee}=_(G,Z,X,{query:ne}),{submitMethod:_e}=A(G,Z,X,{query:ne}),{nextLogicEvent:Ae,handleDynamicDataRelation:Oe}=L(G,Z);(()=>{let{id:e}=ne;e&&(Z.shareId=e)})();const je=e=>{try{ie(),Ee(e)}catch(e){console.log(e,"--error"),Z.spinning=!1,Z.hasFrontAddress=!1,oe(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};o((()=>G.ids),((e,t)=>{t?e.guage_id&&e.guage_id!=t.guage_id&&je(e):e.guage_id&&je(e)}),{immediate:!0}),o((()=>G.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;Z.form={},Z.formArray=[];const t=JSON.parse(JSON.stringify(e));i((()=>{Ee(t)}))}),{immediate:!0});const Te=e=>{Z.showEvaluateSettingWrap=!1,Z.showEvaluateCountdown=!!e,X("startWriteScale")},Le=()=>{console.log("----closeEvaluateCountdown"),Z.showEvaluateCountdown=!1,me.value||(Z.banSubmit=!0,_e(),$.warning({title:"温馨提示",content:"测评时间到了,结束测评!",maskClosable:!1,positiveText:"确定",onPositiveClick:()=>({})}))},De=e=>{$.warning({title:"提示",content:()=>C("div",{class:"evatip-container"},[C("span","答案解析:"),C("p",e)]),class:"c-evatip-dialog-wrap",showIcon:!1,positiveText:"确定",negativeText:"关闭",maskClosable:!1,onPositiveClick(){},onNegativeClick(){}})},Pe=(e,t,a)=>{console.log(e,"--val");let{choiceObj:o,isSetObj:i}=a||{};switch(t.type.includes("SELECT")||(Z.form[t.val_key]=e),t.type){case"SELECT":case"EVALUATE_SELECT":{let{value:a,list:o=[]}=e;Z.form[t.val_key]=a,Ae(e,t,Z.formArray),Oe(o,t,Z.formArray)}break;case"RADIO_BLOCK":case"CHECKBOX_BLOCK":i&&(Z.choiceComObj[t.val_key]=o),Ae(e,t,Z.formArray);break;case"EVALUATE_RADIO_BLOCK":case"EVALUATE_CHECKBOX_BLOCK":Ae(e,t,Z.formArray);break;case"DATE":case"TIME":case"DATETIME":case"SEARCH_CASCADE":Z.submitForm[t.val_key]=e}},xe=(e,t)=>{console.log(t),Z.form[t.val_key]=e},Be=e=>{if(!e||!e.length)return{labelStr:"",labels:[]};const t=e||[],a=[],o=[];return t.forEach((e=>{o.push(e),a.push(e.labelName)})),Z.labelSelectedList=t,{labelStr:a.join(","),labels:o}},Fe=()=>{var e;if(!Z.formArray.find((e=>T(e.type))))return void Ie("确认要提交吗?");let{evaluateResultSetting:t}=Z.config;if(!t||!Object.keys(t).length&&!ve.value||we.value)return void Ie("确认要结束测评吗?");if("formIframe"==G.openType&&ve.value)return void X("submitNoRequest");let a="确定要提前结束测评吗?";if(fe.value&&(null==(e=ee.value)?void 0:e.getCountdownObj)){const e=ee.value.getCountdownObj(),{setAnswered:t,totalLen:o}=e;t<o?a="存在未作答的题目,确定要提前结束测评吗?":!(null==Z?void 0:Z.showEvaluateCountdown)&&(a="确认要结束测评吗?")}Ie(a)},Ie=e=>{$.warning({title:"温馨提示",content:()=>C("div",{style:{paddingLeft:"30px"}},e),positiveText:"确定",negativeText:"取消",maskClosable:!1,closable:!1,positiveButtonProps:{type:"primary"},onPositiveClick:()=>{Ne()},onNegativeClick(){}})},Ne=()=>{var e;null==(e=te.value)||e.validate((e=>{var t;if(e){console.log(e);let a=(null==(t=e[0])?void 0:t[0])||{},o=a.field,i=a.message,n=Z.formArray.find((e=>e.databaseTitle===o));return n&&(o=n.title),z.error(o+i),!1}_e()}))},qe=()=>{X("onCloseSetting")};return V({getScaleData:()=>({...Z}),onSubmit:Fe,cancel:qe}),(e,t)=>(n(),l("div",{class:s(["c-scale",{"c-scale-nobtn":r(ge)}])},[u(' <template v-if="state.spinning">\n <n-spin :show="state.spinning" description="加载中"></n-spin>\n </template> '),Z.spinning||Z.hasFrontAddress?u("v-if",!0):(n(),l(c,{key:0},[r(ae).noData?(n(),p(D,{key:0,noDataImg:r(ae).noDataImg,noDataTip:r(ae).noDataTip},null,8,["noDataImg","noDataTip"])):(n(),l(c,{key:1},[r(ve)&&!r(he)?(n(),p(B,d({key:0},r(Se),{onWriteGuage:Te}),null,16)):(n(),l(c,{key:1},[r(fe)?(n(),p(x,d({key:0,ref_key:"countdownDom",ref:ee},r(Ce),{onCloseEvaluateCountdown:Le}),null,16)):u("v-if",!0),m("div",{class:s(["scale-container",{"scale-container-nopadding":r(ue),"scale-container-hasfooter":r(ge)}]),style:v(r(re))},[r(de)?(n(),p(r(I),{key:0,config:Z.config,maxScore:Z.maxScore},null,8,["config","maxScore"])):u("v-if",!0),f(r(M),{ref_key:"formRef",ref:te,model:Z.form,rules:Z.rules,"require-mark-placement":"left",class:"main"},{default:g((()=>[(n(!0),l(c,null,y(Z.formArray,((e,t)=>(n(),l(c,{key:(e.id||e.seq)+t},[r(ce)(e)?(n(),p(r(R),{key:0,path:e.val_key,"show-label":!r(j)(e.type),class:"c-scle-form-item"},{label:g((()=>[m("span",{class:s({"scale-label-required":r(se)(e)}),innerHTML:r(pe)(e)},null,10,H),r(se)(e)?(n(),l("span",U,"(必填)")):u("v-if",!0),r(ye)(e)?(n(),l("span",W,b(r(ye)(e)),1)):u("v-if",!0),r(le)(e)?(n(),l("span",{key:2,class:"evalute-tip",onClick:t=>(async e=>{var t;if(Z.evatipMap[e.id])return void De(Z.evatipMap[e.id]);let a="getSubjectAnswer";const o=(null==(t=G.scaleApiConfig)?void 0:t[a])||null;if(!o||"function"!=typeof o)return void z.error(`${a} Is not a function`);let i=await o(e.id);i&&(Z.evatipMap[e.id]||(Z.evatipMap[e.id]=i,De(i)))})(e)},[f(r(P),{"icon-class":"a-xitongtubiaotishi"}),k(" 查看提示 ")],8,J)):u("v-if",!0)])),default:g((()=>[(n(),p(S(e.renderCom),d(r(ke)(e,t),{key:(e.id||e.seq)+t,onScaleChange:Pe,onOnChange:t=>((e,t)=>{Z.form[t.val_key]=Be(e)})(t,e),onVodFileList:xe}),null,16,["onOnChange"])),r(be)(e)?(n(),p(F,{key:0,item:e},null,8,["item"])):u("v-if",!0)])),_:2},1032,["path","show-label"])):u("v-if",!0)],64)))),128))])),_:1},8,["model","rules"])],6),r(ge)?(n(),l("div",Y,[u(" 分享的链接 隐藏取消按钮 "),"guage"!==G.sourceType?(n(),p(r(K),{key:0,onClick:qe},{default:g((()=>[k("取消")])),_:1})):u("v-if",!0),G.isLock?u("v-if",!0):(n(),p(r(K),{key:1,onClick:Fe,disabled:Z.banSubmit,type:"primary"},{default:g((()=>[k("保存")])),_:1},8,["disabled"]))])):u("v-if",!0)],64))],64))],64))],2))}}),[["__file","ScaleView.vue"]]);export{X as default};
|
|
@@ -101,9 +101,11 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
101
101
|
emitValue: (value: string | import("../../../es/shared/types").AnyObject[]) => void;
|
|
102
102
|
onClear: () => void;
|
|
103
103
|
onClick: (evt: Event) => void;
|
|
104
|
+
onKeydown: (evt: KeyboardEvent) => void;
|
|
104
105
|
cssVariable: {
|
|
105
106
|
'--menu-width': number;
|
|
106
107
|
};
|
|
108
|
+
eventBus: import("../../../es/shared/types").AnyObject;
|
|
107
109
|
uuid: string;
|
|
108
110
|
show: import("vue").Ref<boolean> | import("vue").WritableComputedRef<boolean>;
|
|
109
111
|
patternContent: import("vue").Ref<string>;
|
|
@@ -114,11 +116,13 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
114
116
|
inputRef: import("vue").Ref<any>;
|
|
115
117
|
popoverRef: import("vue").Ref<any>;
|
|
116
118
|
currentNode: import("vue").Ref<import("../../../es/shared/types").AnyObject | undefined>;
|
|
119
|
+
cursorNode: import("vue").Ref<import("../../../es/shared/types").AnyObject | undefined>;
|
|
117
120
|
loadingNode: import("vue").Ref<import("../../../es/shared/types").Nullable<import("../../../es/shared/types").AnyObject>>;
|
|
118
121
|
search: (payload?: {
|
|
119
122
|
type: "search" | "update";
|
|
120
123
|
node: import("../../../es/shared/types").AnyObject;
|
|
121
124
|
} | undefined, keyword?: string | undefined) => Promise<void>;
|
|
125
|
+
changeCursorNode: (node: import("../../../es/shared/types").AnyObject) => void;
|
|
122
126
|
NInput: any;
|
|
123
127
|
NPopover: any;
|
|
124
128
|
SearchMenu: import("vue").DefineComponent<{
|
|
@@ -141,7 +145,10 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
141
145
|
currentNode: {
|
|
142
146
|
type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
|
|
143
147
|
};
|
|
144
|
-
|
|
148
|
+
cursorNode: {
|
|
149
|
+
type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
|
|
150
|
+
};
|
|
151
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("nodeClick" | "changeCursor")[], "nodeClick" | "changeCursor", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
145
152
|
childKey: {
|
|
146
153
|
type: StringConstructor;
|
|
147
154
|
default: string;
|
|
@@ -161,8 +168,12 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
161
168
|
currentNode: {
|
|
162
169
|
type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
|
|
163
170
|
};
|
|
171
|
+
cursorNode: {
|
|
172
|
+
type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
|
|
173
|
+
};
|
|
164
174
|
}>> & {
|
|
165
175
|
onNodeClick?: ((...args: any[]) => any) | undefined;
|
|
176
|
+
onChangeCursor?: ((...args: any[]) => any) | undefined;
|
|
166
177
|
}, {
|
|
167
178
|
options: import("../../../es/shared/types").AnyObject[];
|
|
168
179
|
valueKey: string;
|
|
@@ -103,9 +103,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
103
103
|
emitValue: (value: ValueType) => void;
|
|
104
104
|
onClear: () => void;
|
|
105
105
|
onClick: (evt: Event) => void;
|
|
106
|
+
onKeydown: (evt: KeyboardEvent) => void;
|
|
106
107
|
cssVariable: {
|
|
107
108
|
'--menu-width': number;
|
|
108
109
|
};
|
|
110
|
+
eventBus: AnyObject;
|
|
109
111
|
uuid: string;
|
|
110
112
|
show: import("vue").Ref<boolean> | import("vue").WritableComputedRef<boolean>;
|
|
111
113
|
patternContent: import("vue").Ref<string>;
|
|
@@ -116,11 +118,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
116
118
|
inputRef: import("vue").Ref<any>;
|
|
117
119
|
popoverRef: import("vue").Ref<any>;
|
|
118
120
|
currentNode: import("vue").Ref<AnyObject | undefined>;
|
|
121
|
+
cursorNode: import("vue").Ref<AnyObject | undefined>;
|
|
119
122
|
loadingNode: import("vue").Ref<Nullable<AnyObject>>;
|
|
120
123
|
search: (payload?: {
|
|
121
124
|
type: 'search' | 'update';
|
|
122
125
|
node: AnyObject;
|
|
123
126
|
}, keyword?: string) => Promise<void>;
|
|
127
|
+
changeCursorNode: (node: AnyObject) => void;
|
|
124
128
|
NInput: any;
|
|
125
129
|
NPopover: any;
|
|
126
130
|
SearchMenu: import("vue").DefineComponent<{
|
|
@@ -143,7 +147,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
143
147
|
currentNode: {
|
|
144
148
|
type: PropType<AnyObject>;
|
|
145
149
|
};
|
|
146
|
-
|
|
150
|
+
cursorNode: {
|
|
151
|
+
type: PropType<AnyObject>;
|
|
152
|
+
};
|
|
153
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("nodeClick" | "changeCursor")[], "nodeClick" | "changeCursor", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
147
154
|
childKey: {
|
|
148
155
|
type: StringConstructor;
|
|
149
156
|
default: string;
|
|
@@ -163,8 +170,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
163
170
|
currentNode: {
|
|
164
171
|
type: PropType<AnyObject>;
|
|
165
172
|
};
|
|
173
|
+
cursorNode: {
|
|
174
|
+
type: PropType<AnyObject>;
|
|
175
|
+
};
|
|
166
176
|
}>> & {
|
|
167
177
|
onNodeClick?: ((...args: any[]) => any) | undefined;
|
|
178
|
+
onChangeCursor?: ((...args: any[]) => any) | undefined;
|
|
168
179
|
}, {
|
|
169
180
|
options: AnyObject[];
|
|
170
181
|
valueKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,provide as a,computed as l,ref as t,nextTick as r,
|
|
1
|
+
import{defineComponent as e,provide as a,computed as l,ref as t,nextTick as r,watch as o,openBlock as u,createBlock as n,unref as s,isRef as i,normalizeStyle as c,withCtx as v,createVNode as d,withModifiers as p,createElementVNode as f,renderSlot as y}from"vue";import{uuidGenerator as h}from"../../../shared/utils/index.js";import{NOOP as m}from"@vue/shared";import{useDebounceFn as g,useEventBus as b,useVModel as w,onClickOutside as k}from"@vueuse/core";import{isString as S,isArray as _,isFunction as K,isObject as C}from"lodash-es";import{NPopover as N,NInput as P}from"naive-ui";import{InjectionSearchCascaderCheckAbleLevel as j,InjectionKeyboardEventBus as x,InjectionSearchCascaderLoadingNode as A,InjectionSearchCascaderValue as U}from"./constants/index.js";import{useCssVariable as V}from"./hooks/useCssVariable.js";import{SearchMenu as F}from"./components/SearchMenu.js";import L from"../../../_virtual/plugin-vue_export-helper.js";const B=["id"];var E=L(e({__name:"SearchCascader",props:{value:{type:[String,Array]},show:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},childKey:{type:String,default:"children"},placeholder:{type:String,default:"请选择"},editPlaceholder:{type:String,default:"请输入关键字进行搜索"},options:{type:Array,default:()=>[]},search:{type:Function},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},checkAbleLevel:{type:[Number,String],default:"last"},beforeSetValue:{type:Function}},emits:["update:value","focus","update:show"],setup(e,{emit:L}){const E=e;function I(){var e;e=[],Promise.resolve(K(E.beforeSetValue)?E.beforeSetValue(e):e).then((e=>L("update:value",e)),m)}function R(e){var a;"INPUT"===(null==(a=e.target)?void 0:a.tagName)&&J()}const T=g((e=>{var a;"INPUT"!==(null==(a=e.target)?void 0:a.tagName)||"Enter"!==e.code||z.value?$.emit(e.key):J()}),50),M=V(),$=b("cascaderKeydown"),q=h(),z=w(E,"show",L);a(j,l((()=>E.checkAbleLevel))),a(x,$);const D=t(""),G=l({get:()=>z.value?D.value:S(E.value)?E.value:_(E.value)?E.value.reduce(((e,a,l)=>0===l?a[E.labelKey]:e+" / "+a[E.labelKey]),""):"",set(e){D.value=e,ee(void 0,e)}});function H(e){L("focus",e)}function J(){z.value||(z.value=!0,D.value="",ee())}async function O(){var e;z.value=!1,null==(e=Q.value)||e.blur()}const Q=t();k(Q,(e=>{var a;if(!z.value)return;const l=e;if(!l.target)return O();!function(e){let a=!1,l=e;for(;l;){if(l.id===q){a=!0;break}l=l.parentElement}return a}(l.target)?O():null==(a=Q.value)||a.focus()}));const W=t(),X=t(),Y=t(),Z=t(null);a(A,Z),a(U,l((()=>E.value)));const ee=g((async(e,a)=>{var l;const{type:t,node:o}=e||{};try{if("update"===t)return void(K(E.search)&&E.search({...o,isLeaf:!0}));Z.value=o;const e=await(K(E.search)&&E.search(o,a));X.value=C(e)?e:o}finally{Z.value=null,await r(),null==(l=W.value)||l.syncPosition()}}),400),ae=e=>{Y.value=e};return o((()=>E.show),(e=>{e&&(Y.value={})})),(a,l)=>(u(),n(s(N),{class:"search-cascader",trigger:"manual",show:s(z),"onUpdate:show":l[1]||(l[1]=e=>i(z)?z.value=e:null),"show-arrow":!1,placement:"bottom-start",style:c(s(M)),width:e.options.length?void 0:"trigger",ref_key:"popoverRef",ref:W},{trigger:v((()=>[d(s(P),{class:"search-cascader__input",placeholder:s(z)?e.editPlaceholder:e.placeholder,clearable:e.clearable,onClear:I,value:s(G),"onUpdate:value":l[0]||(l[0]=e=>i(G)?G.value=e:null),ref_key:"inputRef",ref:Q,onFocus:H,onClick:R,onKeydown:p(s(T),["prevent"])},null,8,["placeholder","clearable","value","onKeydown"])])),default:v((()=>[f("section",{id:s(q)},[d(s(F),{"label-key":e.labelKey,"value-key":e.valueKey,options:e.options,onNodeClick:s(ee),onChangeCursor:ae,"current-node":X.value,"cursor-node":Y.value},{empty:v((()=>[y(a.$slots,"empty")])),_:3},8,["label-key","value-key","options","onNodeClick","current-node","cursor-node"])],8,B)])),_:3},8,["show","style","width"]))}}),[["__file","SearchCascader.vue"]]);export{E as default};
|
|
@@ -20,7 +20,10 @@ export declare const SearchMenu: import("vue").DefineComponent<{
|
|
|
20
20
|
currentNode: {
|
|
21
21
|
type: PropType<AnyObject>;
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
cursorNode: {
|
|
24
|
+
type: PropType<AnyObject>;
|
|
25
|
+
};
|
|
26
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("nodeClick" | "changeCursor")[], "nodeClick" | "changeCursor", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
27
|
childKey: {
|
|
25
28
|
type: StringConstructor;
|
|
26
29
|
default: string;
|
|
@@ -40,8 +43,12 @@ export declare const SearchMenu: import("vue").DefineComponent<{
|
|
|
40
43
|
currentNode: {
|
|
41
44
|
type: PropType<AnyObject>;
|
|
42
45
|
};
|
|
46
|
+
cursorNode: {
|
|
47
|
+
type: PropType<AnyObject>;
|
|
48
|
+
};
|
|
43
49
|
}>> & {
|
|
44
50
|
onNodeClick?: ((...args: any[]) => any) | undefined;
|
|
51
|
+
onChangeCursor?: ((...args: any[]) => any) | undefined;
|
|
45
52
|
}, {
|
|
46
53
|
options: AnyObject[];
|
|
47
54
|
valueKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as
|
|
1
|
+
import{defineComponent as e,computed as r,inject as t,createVNode as o,withModifiers as n,ref as a,createTextVNode as l}from"vue";import{traverse as c}from"../../../../shared/utils/index.js";import{Reload as s,ChevronForward as u}from"@vicons/ionicons5";import{NOOP as i}from"@vue/shared";import{useVirtualList as d}from"@vueuse/core";import{isNumber as p,isArray as f,isEqual as v,isString as y,isFunction as h}from"lodash-es";import{NCheckbox as m}from"naive-ui";import{InjectionSearchCascaderLoadingNode as g,InjectionSearchCascaderValue as N,InjectionSearchCascaderCheckAbleLevel as C,InjectionKeyboardEventBus as b}from"../constants/index.js";const k=e({props:{options:{type:Array,default:()=>[]},activeNodes:{type:Array,default:()=>[]},level:{type:Number,required:!0},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},cursorNode:{type:Object,default:()=>({})}},emits:["nodeClick","changeCursor"],setup(e,{emit:a}){const l=r((()=>e.options)),{list:c,containerProps:h,wrapperProps:k}=d(l,{itemHeight:32,overscan:5}),K=t(g),_=t(N),x=t(C),A=t(b),S=r((()=>p(x.value)&&x.value<=e.level));function j(e){return Object.keys(e).length<=0}function w(r){return e.cursorNode==r}function I(r){const t=function(e){const r=[e];let t=e;for(;t.parent;)t=t.parent,r.unshift(t);return r}(r);if(f(_.value))return v(o(t,e.valueKey),o(_.value,e.valueKey));if(y(_.value)){const r=_.value.split("/").map((e=>e.trim()));return v(r,o(t,e.labelKey))}return!1;function o(e,r){return e.map((e=>e[r]))}}function O(e){const r=h.ref.value;if(r){const t=32*e-(null==r?void 0:r.clientHeight);r.scrollTo(0,t>0?t:0)}}return A.on((function(r){function t(){return S.value?a("nodeClick",{type:"update",node:e.cursorNode}):a("nodeClick",{type:"search",node:e.cursorNode})}if("ArrowUp"===r){if(j(e.cursorNode))return;const r=l.value.findIndex((r=>r===e.cursorNode));if(r>=0){const e=0===r?l.value.length-1:r-1,t=l.value[e];a("changeCursor",t),O(e+3)}}if("ArrowRight"===r){if(j(e.cursorNode))return;a("nodeClick",{type:"search",node:e.cursorNode}),a("changeCursor",{})}if("ArrowDown"===r){if(j(e.cursorNode))return a("changeCursor",l.value[0]);const r=l.value.findIndex((r=>r===e.cursorNode));if(r>=0){const e=r>=l.value.length-1?0:r+1,t=l.value[e];a("changeCursor",t),O(e+1)}}if("ArrowLeft"===r&&e.activeNodes.length){const r=e.activeNodes.slice(-1);a("changeCursor",r[0])}" "===r&&t(),"Enter"===r&&t()})),()=>o("div",{class:"search-cascader__optionWrapper",ref:h.ref,style:h.style,onScroll:h.onScroll},[o("div",{style:k.value.style},[c.value.map((r=>{return o("div",{class:["search-cascader__option",{"search-cascader__option--active":(t=r.data,(null==(l=e.activeNodes)?void 0:l.includes(t))||w(r.data))}],onClick:()=>a("nodeClick",{type:"search",node:r.data}),title:r.data[e.labelKey]},[o("div",{class:"search-cascader__optionText"},[S.value?o(m,{style:{marginRight:"8px"},checked:I(r.data),onClick:n(i,["stop"]),onUpdateChecked:e=>e&&function(e){a("nodeClick",{type:"update",node:e})}(r.data)},null):null,r.data[e.labelKey]]),K.value===r.data?o(s,{class:"rotate"},null):r.data.isLeaf?null:o(u,null,null)]);var t,l}))])])}}),K=e({props:{childKey:{type:String,default:"children"},options:{type:Array,default:()=>[]},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},currentNode:{type:Object},cursorNode:{type:Object}},emits:["nodeClick","changeCursor"],setup(e,{slots:r,emit:t}){const n=a([]);function s(r,a){return o(k,{level:a+1,labelKey:e.labelKey,valueKey:e.valueKey,activeNodes:n.value,onNodeClick:e=>t("nodeClick",e),onChangeCursor:e=>t("changeCursor",e),options:r,cursorNode:e.cursorNode},null)}function u(r){let t=!1;return c(r,((r,o)=>{r===e.currentNode&&(t=!0,o())}),["children"]),t}function i(){if(!f(e.options)||!e.currentNode)return[];const r=[e.options];let t=e.options;for(n.value.length=0;f(t);){const o=t.find(u);if(!o)break;n.value.push(o),t=o[e.childKey],r.push(t)}if(e.cursorNode){const t=r.findIndex((r=>r.findIndex((r=>r===e.cursorNode))>=0));if(t>=0){const e=r.slice(0,t+1);return n.value.splice(t,r.length),e}}return r}return()=>o("section",{class:"search-cascader__menuWrapper"},[f(e.options)&&e.options.length?e.currentNode?i().map(s):s(e.options,0):o("section",{class:"search-cascader__emptyWrapper"},[h(r.empty)?r.empty():o("section",null,[l("empty")])])])}});export{K as SearchMenu};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const __esModule: true;
|
|
2
|
+
export const SearchMenu: vue_1.DefineComponent<{
|
|
3
|
+
childKey: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
options: {
|
|
8
|
+
type: ArrayConstructor;
|
|
9
|
+
default: () => never[];
|
|
10
|
+
};
|
|
11
|
+
labelKey: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
valueKey: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
currentNode: {
|
|
20
|
+
type: ObjectConstructor;
|
|
21
|
+
};
|
|
22
|
+
cursorNode: {
|
|
23
|
+
type: ObjectConstructor;
|
|
24
|
+
};
|
|
25
|
+
}, () => any, any, {}, {}, vue_1.ComponentOptionsMixin, vue_1.ComponentOptionsMixin, ("nodeClick" | "changeCursor")[], "nodeClick" | "changeCursor", vue_1.VNodeProps & vue_1.AllowedComponentProps & vue_1.ComponentCustomProps, Readonly<vue_1.ExtractPropTypes<{
|
|
26
|
+
childKey: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
options: {
|
|
31
|
+
type: ArrayConstructor;
|
|
32
|
+
default: () => never[];
|
|
33
|
+
};
|
|
34
|
+
labelKey: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
valueKey: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
currentNode: {
|
|
43
|
+
type: ObjectConstructor;
|
|
44
|
+
};
|
|
45
|
+
cursorNode: {
|
|
46
|
+
type: ObjectConstructor;
|
|
47
|
+
};
|
|
48
|
+
}>> & {
|
|
49
|
+
onNodeClick?: ((...args: any[]) => any) | undefined;
|
|
50
|
+
onChangeCursor?: ((...args: any[]) => any) | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
options: unknown[];
|
|
53
|
+
valueKey: string;
|
|
54
|
+
childKey: string;
|
|
55
|
+
labelKey: string;
|
|
56
|
+
}>;
|
|
57
|
+
import vue_1 = require("vue");
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const __esModule: true;
|
|
2
|
+
export const SearchMenu: vue_1.DefineComponent<{
|
|
3
|
+
childKey: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
options: {
|
|
8
|
+
type: ArrayConstructor;
|
|
9
|
+
default: () => never[];
|
|
10
|
+
};
|
|
11
|
+
labelKey: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
valueKey: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
currentNode: {
|
|
20
|
+
type: ObjectConstructor;
|
|
21
|
+
};
|
|
22
|
+
cursorNode: {
|
|
23
|
+
type: ObjectConstructor;
|
|
24
|
+
};
|
|
25
|
+
}, () => any, any, {}, {}, vue_1.ComponentOptionsMixin, vue_1.ComponentOptionsMixin, ("nodeClick" | "changeCursor")[], "nodeClick" | "changeCursor", vue_1.VNodeProps & vue_1.AllowedComponentProps & vue_1.ComponentCustomProps, Readonly<vue_1.ExtractPropTypes<{
|
|
26
|
+
childKey: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
options: {
|
|
31
|
+
type: ArrayConstructor;
|
|
32
|
+
default: () => never[];
|
|
33
|
+
};
|
|
34
|
+
labelKey: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
valueKey: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
currentNode: {
|
|
43
|
+
type: ObjectConstructor;
|
|
44
|
+
};
|
|
45
|
+
cursorNode: {
|
|
46
|
+
type: ObjectConstructor;
|
|
47
|
+
};
|
|
48
|
+
}>> & {
|
|
49
|
+
onNodeClick?: ((...args: any[]) => any) | undefined;
|
|
50
|
+
onChangeCursor?: ((...args: any[]) => any) | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
options: unknown[];
|
|
53
|
+
valueKey: string;
|
|
54
|
+
childKey: string;
|
|
55
|
+
labelKey: string;
|
|
56
|
+
}>;
|
|
57
|
+
import vue_1 = require("vue");
|
|
@@ -3,3 +3,4 @@ import { ComputedRef, InjectionKey, Ref } from 'vue';
|
|
|
3
3
|
export declare const InjectionSearchCascaderLoadingNode: InjectionKey<Ref<Nullable<AnyObject>>>;
|
|
4
4
|
export declare const InjectionSearchCascaderValue: InjectionKey<ComputedRef<AnyObject[] | string>>;
|
|
5
5
|
export declare const InjectionSearchCascaderCheckAbleLevel: InjectionKey<ComputedRef<'last' | number>>;
|
|
6
|
+
export declare const InjectionKeyboardEventBus: InjectionKey<Ref<Nullable<AnyObject>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=Symbol("InjectionSearchCascaderLoadingNode "),
|
|
1
|
+
const e=Symbol("InjectionSearchCascaderLoadingNode "),o=Symbol("InjectionSearchCascaderValue "),a=Symbol("InjectionSearchCascaderCheckAbleLevel"),c=Symbol("InjectionKeyboardEventBus");export{c as InjectionKeyboardEventBus,a as InjectionSearchCascaderCheckAbleLevel,e as InjectionSearchCascaderLoadingNode,o as InjectionSearchCascaderValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as t,ref as e,reactive as l,computed as a,watch as i,openBlock as n,createElementBlock as
|
|
1
|
+
import{defineComponent as t,ref as e,reactive as l,computed as a,watch as i,openBlock as n,createElementBlock as s,unref as d,createCommentVNode as o,withDirectives as r,createElementVNode as c,normalizeClass as b,createVNode as u,withCtx as p,Fragment as f,renderList as h,createBlock as y,createTextVNode as v,toDisplayString as m,vShow as g,nextTick as C}from"vue";import{useMessage as L,NAnchor as I,NAnchorLink as S}from"naive-ui";import E from"./components/label-classify.vue.js";import{handleLabelColor as w}from"../../../shared/utils/vexutils.js";import x from"../../../_virtual/plugin-vue_export-helper.js";import A from"xe-utils";const O={key:0,class:"label-disable-wrap"},K=[c("p",{class:"label-disable-title"},"无可选标签",-1),c("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],j={style:{height:"100%"}},k={class:"label-wrap"},T=["id"],_={class:"edit-label-type"};var B=x(t({__name:"LabelFormContent",props:{item:{default:()=>({})},isEdit:{type:Boolean,default:!0},isLock:{type:Boolean,default:!1},labelSelectedList:null,isChangeWindow:{type:Boolean},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},labelOptions:null,sourceType:{default:""},explicit:{type:Boolean,default:!1}},emits:["explicitOnChange","change","updateLabelData"],setup(t,{expose:x,emit:B}){const D=t,F=L(),V=e(null),P=l({editLabelItem:{},inited:!1,labelSelectedEdit:[],labelAnchorKey:"",cacheAnchorKey:"",labelConfig:{}});let N=e(0);const W=a((()=>{if(!P.inited)return!1;let t=P.labelConfig;return!t||Object.keys(t).every((e=>!t[e].itemList))})),$=a((()=>{let t=[].concat(...P.labelSelectedEdit,...D.labelSelectedList);return J(t,"labelId")})),q=a((()=>{const t=$.value||[];return Array.isArray(t)?t.map((t=>t.labelId)):[]})),J=(t,e)=>{let l={};return t.reduce(((t,a)=>(!l[a[e]]&&(l[a[e]]=t.push(a)),t)),[])},R=()=>{if(P.labelSelectedEdit=$.value,"object"==typeof P.labelConfig){Object.keys(P.labelConfig||{}).forEach((t=>{var e;let l=(null==(e=P.labelConfig[t])?void 0:e.itemList)||[];l.length&&l.forEach((t=>{q.value.includes(t.labelId)&&(t.isSelect=!0)}))}))}},z=(t,e)=>{if(!t)return;let l=Object.keys(t)||[];if(!l.length)return;let a=t[l[0]].curKey;if(e&&"string"==typeof e){let[i]=e.split("~"),n=l.find((e=>t[e]&&t[e].curKey&&t[e].curKey.includes(i)));n&&(a=t[n].curKey)}a&&Y(a)},G=(t,e)=>{e.showAdd=!0;const l=t.target.nextElementSibling;C((()=>{var t;null==(t=null==l?void 0:l.firstChild)||t.focus()}))},H=(t,e)=>{setTimeout((()=>{e.addVal?Q(e):e.showAdd=!1}),150)},M=(t,e)=>{e.addVal="",e.showAdd=!1},Q=async t=>{var e;if(!!t.itemList.filter((t=>!(t.isPublic&&1==t.isPublic))).find((e=>e.labelName===t.addVal)))return F.error("标签名称重复!"),!1;let l="";l=(null==(e=t.itemList)?void 0:e.length)?t.itemList[0].parentColor||t.parentColor||"":(null==t?void 0:t.parentColor)||"";const a={type:t.typeId,name:t.addVal,parentColor:l},{status:i}=await D.saveLabelItem(a,t);i&&(F.success("添加成功!"),B("updateLabelData"),t.showAdd=!1)},U=(t,e,l,a)=>{var i;const n=l.itemList,s=l.multipleChoice;let d=(null==(i=P.labelSelectedEdit)?void 0:i.length)&&A.clone(P.labelSelectedEdit,!0)||[];if(t){if(d.some((t=>t.labelId==e.labelId)))return;if(2==s){const{typeId:t,labelId:l}=e;d=d.filter((e=>e.typeId!==t)),n.forEach((t=>{t.labelId!==l&&(t.isSelect=!1)}))}d.push(e)}else{const t=d.findIndex((t=>t.labelId==e.labelId));-1!=t&&d.splice(t,1)}P.labelSelectedEdit=[...d],N.value++,D.explicit&&B("explicitOnChange",[...P.labelSelectedEdit])},X=async t=>{const{status:e}=await D.deleteLabel(t,D.item);if(e){F.success("删除成功!");for(const e in P.labelConfig){const l=P.labelConfig[e].itemList.findIndex((e=>e.labelId==t.labelId));-1!=l&&P.labelConfig[e].itemList.splice(l,1)}const e=P.labelSelectedEdit||[],l=D.labelSelectedList||[];if(e&&e.length){const l=e.findIndex((e=>e.labelId==t.labelId));-1!=l&&e.splice(l,1)}if(l&&l.length){const e=l.findIndex((e=>e.labelId==t.labelId));-1!=e&&l.splice(e,1),B("change",[...l],D.item)}B("updateLabelData")}else F.warning("删除失败")},Y=t=>{t&&setTimeout((()=>{let e,l="#"+t;e=V.value.querySelector("a[href='"+l+"']"),e&&e.click(),P.labelAnchorKey=t}),32)},Z=t=>{t.preventDefault()},tt=t=>{if(!t)return;let e=t.slice(1);P.cacheAnchorKey=e},et=()=>{var t;return null==(t=V.value)?void 0:t.querySelector(".right-label-wrap")};return i((()=>D.labelOptions),(t=>{t&&(()=>{var t;if(D.isLock)return;const e=JSON.parse(JSON.stringify(D.labelOptions));for(let l in e){let a=(null==(t=e[l])?void 0:t.typeId)||"";Object.assign(e[l],{curKey:`${l}_${a}}`})}P.labelConfig=e,C((()=>{let t;R(),D.explicit&&P.inited&&(t=P.labelAnchorKey),z(P.labelConfig,t),P.inited=!0}))})()}),{immediate:!0,deep:!0}),x({resetShowAdd:()=>{let{labelObj:t}=P.editLabelItem;if(t&&Object.keys(t).length)for(let e in t){let l=t[e];Object.assign(l,{showAdd:!1})}},handleLabelForm:t=>{t([...P.labelSelectedEdit||[]])},handleResetOptions:()=>{},hanldeSetLabelItem:(t,e)=>{if("object"==typeof P.labelConfig){Object.keys(P.labelConfig||{}).forEach((l=>{var a;let i=(null==(a=P.labelConfig[l])?void 0:a.itemList)||[];i.length&&i.forEach((l=>{t==l.labelId&&(l.isSelect=e)}))}))}if(!1===e&&Array.isArray(P.labelSelectedEdit)){const e=P.labelSelectedEdit.findIndex((e=>e.labelId==t));-1!=e&&P.labelSelectedEdit.splice(e,1)}}}),(e,l)=>(n(),s("div",{class:"c-label-form-content",ref_key:"labelFormContent",ref:V},[d(W)?(n(),s("div",O,K)):o("v-if",!0),r(c("div",j,[c("div",k,[o(" 表单内嵌打开标签组件的样式 "),o(' <div v-if="explicit" class="explicit-continer">\n\t\t\t\t\t<n-tabs :value="state.labelAnchorKey" type="card" @change="labelAnchorTabsOnChange" tab-position="top">\n\t\t\t\t\t\t<template v-for="(v, i) in state.labelConfig">\n\t\t\t\t\t\t\t<n-tab-pane :name="v.curKey">\n\t\t\t\t\t\t\t\t<span slot="tab">\n\t\t\t\t\t\t\t\t\t{{ i }}\n\t\t\t\t\t\t\t\t\t<span class="edit-label-type">({{ v.multipleChoice == 2 ? \'单\' : \'多\' }}选)</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<div class="explicit-label-wrap left-label-wrap">\n\t\t\t\t\t\t\t\t\t<div class="edit-label-content">\n\t\t\t\t\t\t\t\t\t\t<labelClassify\n\t\t\t\t\t\t\t\t\t\t\t:classifyItem="v"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelChange="handleLabelChange"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelColor="handleLabelColor"\n\t\t\t\t\t\t\t\t\t\t\t:handleDelLabel="handleDelLabel"\n\t\t\t\t\t\t\t\t\t\t\t:hanldeBlur="hanldeBlur"\n\t\t\t\t\t\t\t\t\t\t\t:handleAddLabel="handleAddLabel"\n\t\t\t\t\t\t\t\t\t\t\t:clearaddVal="clearaddVal"\n\t\t\t\t\t\t\t\t\t\t\t:isEdit="isEdit"\n\t\t\t\t\t\t\t\t\t\t\t:sourceType="sourceType"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</n-tab-pane>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</n-tabs>\n\t\t\t\t</div> '),o("\n\t\t\t\t\t普通标签样式\n\t\t\t\t\tv-else\n\t\t\t\t\texplicit\n\t\t\t\t "),c("div",{class:b(["left-label-wrap",{"total-left-label-wrap":t.isChangeWindow}])},[u(d(I),{"offset-target":et,type:"block",onClick:Z,onChange:tt},{default:p((()=>[(n(!0),s(f,null,h(P.labelConfig,((t,e)=>(n(),y(d(S),{href:`#${t.curKey}`,title:String(e)},null,8,["href","title"])))),256))])),_:1})],2),o(' v-if="!explicit" '),c("div",{class:b(["right-label-wrap",{"total-right-label-wrap":t.isChangeWindow}])},[(n(!0),s(f,null,h(P.labelConfig,((e,l)=>(n(),s("div",{key:l,class:"edit-label-content"},[c("div",{class:"edit-label",id:e.curKey},[v(m(l)+" ",1),c("span",_,"("+m(2==e.multipleChoice?"单":"多")+"选)",1)],8,T),u(E,{classifyItem:e,handleLabelChange:U,handleLabelColor:d(w),handleDelLabel:X,hanldeBlur:H,handleAddLabel:G,clearaddVal:M,isEdit:t.isEdit,sourceType:t.sourceType},null,8,["classifyItem","handleLabelColor","isEdit","sourceType"])])))),128))],2)])],512),[[g,!d(W)]])],512))}}),[["__file","LabelFormContent.vue"]]);export{B as default};
|
package/es/env.d.ts
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
|
|
3
|
-
interface ImportMetaEnv {
|
|
4
|
-
readonly VITE_APP_TYPE: string;
|
|
5
|
-
// 更多环境变量...
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface ImportMeta {
|
|
9
|
-
readonly env: ImportMetaEnv;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
declare module '*.vue' {
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
import type { App, defineComponent } from 'vue';
|
|
15
|
-
// // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
16
|
-
// // const component: DefineComponent<{}, {}, any>
|
|
17
|
-
const component: ReturnType<typeof defineComponent> & {
|
|
18
|
-
install(app: App): void;
|
|
19
|
-
};
|
|
20
|
-
// @ts-ignore
|
|
21
|
-
export default component;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare module '*.js';
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
interface ImportMetaEnv {
|
|
4
|
+
readonly VITE_APP_TYPE: string;
|
|
5
|
+
// 更多环境变量...
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface ImportMeta {
|
|
9
|
+
readonly env: ImportMetaEnv;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module '*.vue' {
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
import type { App, defineComponent } from 'vue';
|
|
15
|
+
// // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
16
|
+
// // const component: DefineComponent<{}, {}, any>
|
|
17
|
+
const component: ReturnType<typeof defineComponent> & {
|
|
18
|
+
install(app: App): void;
|
|
19
|
+
};
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
export default component;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.js';
|
|
25
|
+
|