@gct-paas/design-web 0.1.4-dev.9 → 0.1.5-dev.1
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/dist/index.min.css +2 -1
- package/dist/loader.esm.min.js +1 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +7 -8
- package/es/components/form-component/FieldCheckbox.d.ts +38 -0
- package/es/components/form-component/FieldCheckbox.mjs +71 -0
- package/es/components/form-component/FieldRadio.d.ts +38 -0
- package/es/components/form-component/FieldRadio.mjs +64 -0
- package/es/components/form-component/FieldSelect.d.ts +82 -0
- package/es/components/form-component/FieldSelect.mjs +174 -0
- package/es/components/form-component/field-emptyValue.d.ts +6 -0
- package/es/components/form-component/field-label/ref-card-label-design.vue.d.ts +17 -0
- package/es/components/form-component/field-label/ref-card-label-design.vue.mjs +6 -0
- package/es/components/form-component/field-label/ref-card-label-design.vue_vue_type_script_setup_true_lang.mjs +122 -0
- package/es/components/form-component/field-label/ref-card-label-design.vue_vue_type_style_index_0_lang.css +9 -0
- package/es/components/form-component/field-label/selectTag.vue.d.ts +10 -0
- package/es/components/form-component/field-label/selectTag.vue.mjs +5 -0
- package/es/components/form-component/field-label/selectTag.vue_vue_type_script_setup_true_lang.mjs +22 -0
- package/es/components/form-component/field-label/tag-label.vue.d.ts +36 -0
- package/es/components/form-component/field-label/tag-label.vue.mjs +7 -0
- package/es/components/form-component/field-label/tag-label.vue_vue_type_script_setup_true_lang.mjs +143 -0
- package/es/components/form-component/field-label/tag-label.vue_vue_type_style_index_0_scoped_a1ded441_lang.css +15 -0
- package/es/components/form-component/field-label/tag-layout.vue.d.ts +21 -0
- package/es/components/form-component/field-label/tag-layout.vue.mjs +7 -0
- package/es/components/form-component/field-label/tag-layout.vue_vue_type_script_setup_true_lang.mjs +16 -0
- package/es/components/form-component/field-label/tag-layout.vue_vue_type_style_index_0_scoped_85e6a8f5_lang.css +12 -0
- package/es/components/form-component/field-label/tag-span.vue.d.ts +21 -0
- package/es/components/form-component/field-label/tag-span.vue.mjs +7 -0
- package/es/components/form-component/field-label/tag-span.vue_vue_type_script_setup_true_lang.mjs +25 -0
- package/es/components/form-component/field-label/tag-span.vue_vue_type_style_index_0_scoped_3bf855f6_lang.css +31 -0
- package/es/components/form-component/field-readonly.vue.d.ts +22 -0
- package/es/components/form-component/field-readonly.vue.mjs +5 -0
- package/es/components/form-component/field-readonly.vue_vue_type_script_setup_true_lang.mjs +81 -0
- package/es/components/form-component/index.css +40 -0
- package/es/components/form-component/index.d.ts +8 -0
- package/es/components/form-component/index.mjs +7 -0
- package/es/components/index.d.ts +1 -1
- package/es/components/index.mjs +8 -0
- package/es/index.mjs +14 -15
- package/es/loader.d.ts +1 -0
- package/package.json +23 -18
- package/dist/index.esm.min.mjs +0 -1606
- package/dist/index.min.cjs +0 -57
- package/dist/index.system.min.js +0 -57
- package/es/components/I18nSelect/index.d.ts +0 -7
- package/es/components/I18nSelect/src/i18n-modal.vue.d.ts +0 -21
- package/es/components/I18nSelect/src/i18n-modal.vue.mjs +0 -151
- package/es/components/I18nSelect/src/i18n-modal.vue2.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-select-btn.css +0 -58
- package/es/components/I18nSelect/src/i18n-select-btn.vue.d.ts +0 -18
- package/es/components/I18nSelect/src/i18n-select-btn.vue.mjs +0 -7
- package/es/components/I18nSelect/src/i18n-select-btn.vue2.mjs +0 -138
- package/es/components/I18nSelect/src/i18n-select-container.css +0 -6
- package/es/components/I18nSelect/src/i18n-select-container.vue.d.ts +0 -10
- package/es/components/I18nSelect/src/i18n-select-container.vue.mjs +0 -7
- package/es/components/I18nSelect/src/i18n-select-container.vue2.mjs +0 -250
- package/es/components/I18nSelect/src/i18n-select-input-form.vue.d.ts +0 -15
- package/es/components/I18nSelect/src/i18n-select-input-form.vue.mjs +0 -57
- package/es/components/I18nSelect/src/i18n-select-input-form.vue2.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-select-input.css +0 -3
- package/es/components/I18nSelect/src/i18n-select-input.vue.d.ts +0 -51
- package/es/components/I18nSelect/src/i18n-select-input.vue.mjs +0 -7
- package/es/components/I18nSelect/src/i18n-select-input.vue2.mjs +0 -129
- package/es/components/I18nSelect/src/i18n-select-modal.vue.d.ts +0 -4
- package/es/components/I18nSelect/src/i18n-select-modal.vue.mjs +0 -21
- package/es/components/I18nSelect/src/i18n-select-modal.vue2.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.d.ts +0 -15
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.mjs +0 -57
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue2.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-select-textarea.css +0 -17
- package/es/components/I18nSelect/src/i18n-select-textarea.vue.d.ts +0 -26
- package/es/components/I18nSelect/src/i18n-select-textarea.vue.mjs +0 -7
- package/es/components/I18nSelect/src/i18n-select-textarea.vue2.mjs +0 -93
- package/es/components/I18nSelect/src/useI18nSelect.d.ts +0 -13
- package/es/components/I18nSelect/src/useI18nSelect.mjs +0 -51
package/dist/index.min.css
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
.
|
|
1
|
+
.tag[data-v-3bf855f6]{padding:4px 6px;line-height:1}.tag+.tag[data-v-3bf855f6]{margin-left:5px}.tag-radius[data-v-3bf855f6]{background:var(--v650d3ac5);border-radius:4px}.tag-linear_radius[data-v-3bf855f6]{border:1px solid var(--v650d3ac5);border-radius:4px}.tag-big_radius[data-v-3bf855f6]{background:var(--v650d3ac5);border-radius:100px}.tag-linear_big_radius[data-v-3bf855f6]{border:1px solid var(--v650d3ac5);border-radius:100px}.tag-dashed_radius[data-v-3bf855f6]{border:1px dashed var(--v650d3ac5);border-radius:4px}.tag-status[data-v-3bf855f6]{background:var(--v650d3ac5);border-radius:14px 4px 4px}.tag-label-disabled[data-v-85e6a8f5]{opacity:.5}.label-ellipsis[data-v-85e6a8f5]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label-wrap[data-v-85e6a8f5]{word-break:break-all;white-space:wrap}.tag-label-disabled[data-v-a1ded441]{opacity:.5}.label-ellipsis[data-v-a1ded441]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label-wrap[data-v-a1ded441]{word-break:break-all;white-space:wrap}.select-text[data-v-a1ded441]{min-width:16px}.field-radio-group .ant-radio-wrapper.ant-radio-wrapper-disabled .ant-radio-checked.ant-radio-disabled .ant-radio-inner{background-color:#fff;border:1px solid var(--ant-primary-3)!important}.field-radio-group .ant-radio-wrapper.ant-radio-wrapper-disabled .ant-radio-checked.ant-radio-disabled .ant-radio-inner:after{background:var(--ant-primary-3)}.field-radio-group--readonly .ant-radio-wrapper{pointer-events:none}.field-radio-group--readonly .ant-radio-wrapper .ant-radio-checked .ant-radio-inner{background-color:#fff;border:1px solid var(--ant-primary-4)!important}.field-radio-group--readonly .ant-radio-wrapper .ant-radio-checked .ant-radio-inner:after{background:var(--ant-primary-4)}.field-checkbox-group .ant-checkbox-wrapper.ant-checkbox-wrapper-disabled .ant-checkbox-checked.ant-checkbox-disabled .ant-checkbox-inner{background-color:var(--ant-primary-3);border:1px solid var(--ant-primary-3)!important}.field-checkbox-group .ant-checkbox-wrapper.ant-checkbox-wrapper-disabled .ant-checkbox-checked.ant-checkbox-disabled .ant-checkbox-inner:after{border-color:#fff}.field-checkbox-group .ant-checkbox-wrapper.ant-checkbox-wrapper-disabled .ant-checkbox-checked.ant-checkbox-disabled:after{border:1px solid var(--ant-primary-3)!important}.field-checkbox-group--readonly .ant-checkbox-wrapper{pointer-events:none}.field-checkbox-group--readonly .ant-checkbox-wrapper .ant-checkbox-checked .ant-checkbox-inner{background-color:var(--ant-primary-4);border:1px solid var(--ant-primary-4)!important}.field-checkbox-group--readonly .ant-checkbox-wrapper .ant-checkbox-checked .ant-checkbox-inner:after{border-color:#fff}.field-checkbox-group--readonly .ant-checkbox-wrapper .ant-checkbox-checked:after{border:1px solid var(--ant-primary-4)!important}.gct-ref-card-popover{box-shadow:0 2px 6px #0000001a}.gct-ref-card-popover .ant-popover-inner-content{padding:0}.gct-ref-card-popover .ant-popover-arrow{display:none}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CARD_TRIGGER_ENUM as e,FIELD_TYPE as l,FormComponents as t,TagTypeEnum as a,cssLoader as o,t as r}from"@gct-paas/core";import{Fragment as i,computed as n,createBlock as s,createCommentVNode as d,createElementBlock as u,createElementVNode as p,createTextVNode as v,createVNode as c,defineComponent as g,h as y,inject as b,isVNode as m,mergeProps as f,normalizeClass as x,normalizeStyle as S,openBlock as h,reactive as _,ref as C,renderList as k,renderSlot as E,resolveComponent as T,toDisplayString as P,toRef as w,unref as L,useCssVars as O,withCtx as W,withModifiers as B}from"vue";import{Avatar as N,Checkbox as j,CheckboxGroup as A,Radio as F,RadioGroup as M,Select as R}from"ant-design-vue";import{isString as U,pick as I}from"lodash-es";import{IconNext as D,transformUrl as V}from"@gct-paas/core-web";import{schemaToStyle as q,transformField2Component as $}from"@gct-paas/design";var z=(e,l)=>{const t=e.__vccOpts||e;for(const[a,o]of l)t[a]=o;return t},K=/* @__PURE__ */z(/* @__PURE__ */g({__name:"tag-span",props:{tagStyle:{}},setup(e){O(e=>({v650d3ac5:o.value}));const l=e,t=w(()=>{var e;return(null===(e=l.tagStyle)||void 0===e?void 0:e.tagType)||a.RADIUS}),o=w(()=>{var e;return(null===(e=l.tagStyle)||void 0===e?void 0:e.color)||"#f0f0f0"}),r=w(()=>`tag-${t.value}`);return(e,l)=>(h(),u("span",{class:x(["tag cursor-pointer",r.value])},[E(e.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-3bf855f6"]]),H=/* @__PURE__ */z(/* @__PURE__ */g({__name:"tag-layout",props:{labelLayout:{},disabled:{type:Boolean}},setup:e=>(l,t)=>{var a,o,r,i;return h(),u("span",{class:x([e.disabled?"tag-label-disabled":null,!(null===(a=e.labelLayout)||void 0===a?void 0:a.hasLabelWidth)||"left"!==(null===(o=e.labelLayout)||void 0===o?void 0:o.layout.label)&&"horizontal"!=(null===(r=e.labelLayout)||void 0===r?void 0:r.layout)?"":"ellipsis"==(null===(i=e.labelLayout)||void 0===i?void 0:i.overLabelDisplay)?"label-ellipsis":"label-wrap"])},[E(l.$slots,"default",{},void 0,!0)],2)}}),[["__scopeId","data-v-85e6a8f5"]]),G={class:"select-text"},J={class:"select-text"},Q={key:0},X=/* @__PURE__ */z(/* @__PURE__ */g({__name:"tag-label",props:{tagWidgetStyle:{},type:{},disabled:{type:Boolean},label:{},isDesign:{type:Boolean},closable:{type:Boolean},showTagStyle:{type:Boolean,default:!0},avatar:{},iconExtraProps:{},iconProps:{}},emits:["on-close"],setup(e){const t=e,a=_gct.platformStore.themeSetting,o=b("labelLayout",{}),g=n(()=>{var e;let a=t.label??"";if((!a||a.length<=0)&&t.isDesign){var o;const e=t.type&&(null===(o=$(t.type))||void 0===o?void 0:o.example)||"";a=e?U(e)?r(e):e.map(e=>r(e)):""}return t.showTagStyle&&(null===(e=t.tagWidgetStyle)||void 0===e?void 0:e.tagStyleOpen)||t.type===l.ENUM_MULTI||t.type===l.ENUM?a?U(a)?a.split(","):a:[]:a instanceof Array?a.join(","):a+""}),m=w(()=>{var e;const l=null===(e=t.tagWidgetStyle)||void 0===e?void 0:e.contentFont;return l?q(l):{}}),f=(e="")=>{var l,a;const o=(null===(l=t.iconExtraProps)||void 0===l?void 0:l[e])||{},r={};return(null==o?void 0:o.textColor)&&Object.assign(r,{color:null==o?void 0:o.textColor}),(null===(a=m.value)||void 0===a?void 0:a.color)?m.value:{wordBreak:"break-all",...m.value,...r}},x={render:({$attrs:e})=>{if(e.labelName){var l;const o=(null===(l=t.iconExtraProps)||void 0===l?void 0:l[e.labelName])||t.iconProps||{};if(!(null==o?void 0:o.icon))return;return y(D,{size:16,value:null==o?void 0:o.icon,color:(null==o?void 0:o.iconColor)||a.themeColor,style:"vertical-align: text-bottom; margin-right: 3px"})}}};return(a,r)=>{var n;return e.showTagStyle&&(null===(n=e.tagWidgetStyle)||void 0===n?void 0:n.tagStyleOpen)?(h(),s(H,{key:0,disabled:!!e.disabled,"label-layout":L(o)},{default:W(()=>[(h(!0),u(i,null,k(g.value,(l,o)=>(h(),s(K,{key:o,"tag-style":e.tagWidgetStyle.tagStyle,style:S(f(l))},{default:W(()=>[t.avatar?(h(),s(L(N),{key:0,src:L(V)(t.avatar),size:20,style:{"margin-top":"-5px"},class:"mr4px"},null,8,["src"])):d("",!0),c(x,{"label-name":l},null,8,["label-name"]),p("span",G,P(l),1),e.closable?(h(),s(L(D),{key:1,size:15,value:"icon-park:close-small",style:{verticalAlign:"text-bottom","--color":"rgba(0,0,0,.45)",lineHeight:"1",marginLeft:"2px"},onClick:r[0]||(r[0]=B(e=>a.$emit("on-close"),["prevent","stop"]))})):d("",!0)]),_:2},1032,["tag-style","style"]))),128))]),_:1},8,["disabled","label-layout"])):e.type===L(l).ENUM_MULTI||e.type===L(l).ENUM?(h(),s(H,{key:1,disabled:!!e.disabled,"label-layout":L(o)},{default:W(()=>[(h(!0),u(i,null,k(g.value,(l,t)=>{var a;return h(),u("span",{key:t,style:S(f(l)),class:"mr-5px"},[c(x,{"label-name":l},null,8,["label-name"]),p("span",J,P(l)+P(!(null===(a=e.tagWidgetStyle)||void 0===a?void 0:a.tagStyleOpen)&&t<g.value.length-1?",":""),1)],4)}),128)),g.value.length?d("",!0):(h(),u("span",Q," "))]),_:1},8,["disabled","label-layout"])):(h(),s(H,{key:2,style:S(f(g.value)),disabled:!!e.disabled,"label-layout":L(o),class:"select-text leading-none ell"},{default:W(()=>[v(P(g.value||" "),1)]),_:1},8,["style","disabled","label-layout"]))}}}),[["__scopeId","data-v-a1ded441"]]),Y={key:0,class:"w100% ell"},Z={key:0,class:"gct-custom-tag ml8px"},ee=/* @__PURE__ */g({__name:"field-readonly",props:{isTooltip:{type:Boolean},label:{},type:{},modelValue:{},tagWidgetStyle:{},disabled:{type:Boolean},iconExtraProps:{}},setup(e){const t=e,a=C(!1),o=n(()=>Array.isArray(t.label)?t.label.join(","):t.label),r=n(()=>X);function i(e){var l;if(!t.isTooltip)return;const o=null===(l=e.target)||void 0===l?void 0:l.parentNode;o.scrollWidth>o.clientWidth&&(a.value=!0)}function p(){a.value=!1}return(n,g)=>{const y=T("a-tooltip");return h(),s(y,{placement:"topLeft",visible:a.value},{title:W(()=>[v(P(o.value),1)]),default:W(()=>{var a;return[t.type===L(l).RDO_REF?(h(),u("div",Y,[c(L(r),f(n.$attrs,{label:e.label,"tag-widget-style":t.tagWidgetStyle,disabled:t.disabled,"icon-extra-props":t.iconExtraProps,onMouseenter:i,onMouseleave:p}),null,16,["label","tag-widget-style","disabled","icon-extra-props"]),t.type===L(l).RDO_REF&&t.modelValue&&!(null===(a=t.modelValue)||void 0===a?void 0:a.includes(":"))?(h(),u("span",Z," 默认 ")):d("",!0)])):(h(),s(L(r),f({key:1},n.$attrs,{label:e.label,"tag-widget-style":t.tagWidgetStyle,disabled:t.disabled,"icon-extra-props":t.iconExtraProps,onMouseenter:i,onMouseleave:p}),null,16,["label","tag-widget-style","disabled","icon-extra-props"]))]}),_:1},8,["visible"])}}}),le=/* @__PURE__ */g({__name:"selectTag",props:{tagWidgetStyle:{}},setup(e){const l=e,t=w(()=>{return l.tagWidgetStyle.tagStyleOpen?l.tagWidgetStyle:{tagStyleOpen:!0,contentFont:null===(e=l.tagWidgetStyle)||void 0===e?void 0:e.contentFont};var e});return(e,l)=>(h(),s(X,{"tag-widget-style":t.value},null,8,["tag-widget-style"]))}}),te=/* @__PURE__ */g({name:"FieldSelect",props:{design:Boolean,disabled:Boolean,readonly:Boolean,selectExtraProps:Object,fieldType:{type:String,required:!0},type:{type:String,required:!0},tagStyle:{type:Object,required:!0},options:Array,value:[String,Number],maxTagCount:{type:[Number,String],default:5},maxTagTextLength:{type:Number,default:6},selectOptionLabel:{type:String}},setup(e,{emit:l}){const a=n({get:()=>e.value,set(e){l("update:value",e)}}),o=(l,{name:t,iconExtraProps:a,otherParams:o={}})=>y(l,{tagWidgetStyle:e.tagStyle,type:e.fieldType,label:t,disabled:e.disabled,iconExtraProps:a,...o}),r=n(()=>(e.options??[]).map(l=>{var t;const{iconColor:a,icon:r,textColor:i}=l._item||{};return{...l,[(null===(t=e.selectExtraProps)||void 0===t?void 0:t.optionLabelProp)||"titleLabel"]:o(X,{name:l.label,iconExtraProps:{[l.label]:{icon:r,iconColor:a,textColor:i}}})}}));function i(e,l){var t;const{_DICT:a={}}=e,o=e[l];return(null===(t=a[l])||void 0===t||null===(t=t[o])||void 0===t?void 0:t.join(","))??o??e.id_}const s=n(()=>{if(e.readonly){var l;const t=(null===(l=r.value)||void 0===l?void 0:l.filter(l=>{var t;return"multiple"===(null===(t=e.selectExtraProps)||void 0===t?void 0:t.mode)?Array.isArray(a.value)&&a.value.includes(l.value):l.value===a.value}))??[],o=Object.fromEntries((null==t?void 0:t.map(e=>[e.label,I((null==e?void 0:e._item)||{},["iconColor","icon","textColor"])]))??[]);return{labels:t.map(e=>e.label),icons:o}}return{}}),d={option:l=>{const{label:a,_item:r={}}=l;return e.type===t.Userpicker?c("div",{class:"flex items-center"},[c(N,{size:30,style:"margin: 0 8px;min-width:32px",src:V(r.avatar)},null),c("div",{style:"width:calc(100% - 35px)"},[c("div",{class:" w100% ell",title:a},[a]),c("div",{class:"text-[#8F8F8F] text-[12px] mt2px"},[r.masterOrgName])])]):o(X,{name:e.selectOptionLabel?i(r,e.selectOptionLabel):a,iconExtraProps:{[a]:I(r,["iconColor","icon","textColor"])},otherParams:{showTagStyle:!1}})}},u=l=>{var t;const{label:a,option:o,closable:r,onClose:i}=l,{_item:n={}}=o||{};return(({name:l,title:t,iconExtraProps:a,avatar:o,otherParams:r={}})=>c(le,f({tagWidgetStyle:e.tagStyle,type:e.fieldType,label:l,avatar:o,title:(null==t?void 0:t.length)>e.maxTagTextLength?t:null,disabled:e.disabled,iconExtraProps:a},r),null))({name:a,title:null==o?void 0:o.label,avatar:null==o||null===(t=o._item)||void 0===t?void 0:t.avatar,iconExtraProps:{[a]:I(n,["iconColor","icon","textColor"])},otherParams:{closable:r,"onOn-close":i,style:"margin-right: 4px"}})};return()=>{var l,t,i,n;return e.readonly?o(ee,{name:null===(l=s.value)||void 0===l?void 0:l.labels,iconExtraProps:null===(t=s.value)||void 0===t?void 0:t.icons}):c(R,f({class:["field-select","w100%"],value:a.value,"onUpdate:value":e=>a.value=e,options:r.value,disabled:e.disabled,optionLabelProp:"titleLabel",tagRender:u,showArrow:!0,maxTagCount:e.maxTagCount,maxTagTextLength:e.maxTagTextLength,dropdownMatchSelectWidth:180,dropdownClassName:"multiple"===(null===(i=e.selectExtraProps)||void 0===i?void 0:i.mode)?"gct-project-select-dropdown gct-project-select-multiple vxe-table--ignore-clear":"gct-project-select-dropdown vxe-table--ignore-clear"},e.selectExtraProps),(null===(n=e.selectExtraProps)||void 0===n?void 0:n.optionNoStyle)?null:d)}}}),ae=/* @__PURE__ */g({name:"FieldRadio",props:{design:Boolean,disabled:Boolean,readonly:Boolean,fieldType:{type:String,required:!0},tagStyle:{type:Object,required:!0},options:Array,value:[String,Number]},setup(e,{emit:l}){const t=n({get:()=>e.value,set(e){l("update:value",e)}});return()=>{let l;return c(M,{value:t.value,"onUpdate:value":e=>t.value=e,disabled:e.disabled,class:["field-radio-group",e.readonly?"field-radio-group--readonly":""]},"function"==typeof(a=l=(e.options??[]).map(l=>{const t=l,{icon:a,iconColor:o,textColor:r}=(null==t?void 0:t._item)||{};return c(F,{key:t.value,value:t.value},{default:()=>[c(ee,{tagWidgetStyle:e.tagStyle,type:e.fieldType,label:t.label,disabled:e.disabled,iconExtraProps:{[t.label]:{icon:a,iconColor:o,textColor:r}}},null)]})}))||"[object Object]"===Object.prototype.toString.call(a)&&!m(a)?l:{default:()=>[l]});var a}}}),oe=/* @__PURE__ */g({name:"FieldCheckbox",props:{design:Boolean,disabled:Boolean,readonly:Boolean,fieldType:{type:String,required:!0},tagStyle:{type:Object,required:!0},options:Array,value:[String,Number]},setup(e,{emit:t}){const a=e.fieldType===l.BOOLEAN,o=n({get:()=>a?[e.value]:Array.isArray(e.value)?e.value:e.value?e.value.split(","):void 0,set(e){if(a){const l=null==e?void 0:e[0];t("update:value",null==l||"boolean"!=typeof l?Boolean(l):!!l)}else t("update:value",e)}}),r=n(()=>a?(e.options??[]).filter(e=>e.value):e.options??[]);return()=>c(A,{value:o.value,"onUpdate:value":e=>o.value=e,disabled:e.disabled,class:["field-checkbox-group",e.readonly?"field-checkbox-group--readonly":""]},{default:()=>{var l;return[null===(l=r.value)||void 0===l?void 0:l.map(l=>{const t=l,{icon:a,iconColor:o,textColor:r}=(null==t?void 0:t._item)||{};return c(j,{key:t.value,value:t.value},{default:()=>[c(ee,{tagWidgetStyle:e.tagStyle,type:e.fieldType,label:t.label,disabled:e.disabled,iconExtraProps:{[t.label]:{icon:a,iconColor:o,textColor:r}}},null)]})})]}})}}),re=["src"],ie=["src"],ne=["onMouseup"],se={key:1},de=/* @__PURE__ */g({__name:"ref-card-label-design",props:{tagWidgetStyle:{},disabled:{type:Boolean},trigger:{},modelKey:{},refCardId:{},type:{}},setup(l){const t=l,a=C(""),o=w(()=>t.trigger===e.HOVER?"primary-gct-hover":"primary-gct"),d=b("labelLayout",{}),v=_({}),g=n(()=>{var e;const l=t.type?null===(e=$(t.type))||void 0===e?void 0:e.example:[];return(l?"string"==typeof l?[r(l)]:l.map(e=>r(e)):[]).map(e=>({value:e,label:e}))}),y=w(()=>{var e;const l=null===(e=t.tagWidgetStyle)||void 0===e?void 0:e.contentFont;return l?q(l):{}}),m=w(()=>{var e;return(null===(e=y.value)||void 0===e?void 0:e.color)?y.value:{wordBreak:"break-all",...y.value}}),f=async(e,l)=>{e&&(a.value=(await _api.apaas.commonInfoCard.getGetById({id:t.refCardId,modelKey:t.modelKey,type:"CARD"})).screenShoot??""),v[l.value]=e};function E(e){f(!0,e)}return(e,t)=>{const r=T("a-popover");return g.value.length?(h(),s(H,{key:0,disabled:!!l.disabled,"label-layout":L(d)},{default:W(()=>{var e;return[(null===(e=l.tagWidgetStyle)||void 0===e?void 0:e.tagStyleOpen)?(h(!0),u(i,{key:0},k(g.value,(e,t)=>(h(),s(r,{key:t,trigger:l.trigger,visible:!!v[e.value],placement:"bottomLeft",color:"#fff","overlay-class-name":"gct-ref-card-popover min-w100px min-h30px max-h96vh",onVisibleChange:l=>f(l,e)},{content:W(()=>[p("img",{src:a.value},null,8,re)]),default:W(()=>[c(K,{"tag-style":l.tagWidgetStyle.tagStyle,onMouseup:B(l=>E(e),["stop"])},{default:W(()=>[p("span",{class:x(["select-text cursor-pointer",o.value]),style:S(m.value)},P(e.label),7)]),_:2},1032,["tag-style","onMouseup"])]),_:2},1032,["trigger","visible","onVisibleChange"]))),128)):(h(!0),u(i,{key:1},k(g.value,(e,n)=>(h(),u(i,{key:n},[p("span",null,P(n?",":""),1),c(r,{"overlay-class-name":"gct-ref-card-popover min-w100px min-h30px max-h96vh",visible:!!v[e.value],trigger:l.trigger,color:"#fff",placement:"bottomLeft",onVisibleChange:l=>f(l,e)},{content:W(()=>[p("img",{src:a.value},null,8,ie)]),default:W(()=>[p("span",{class:x(["select-text cursor-pointer",o.value]),style:S(m.value),onClick:t[0]||(t[0]=B(()=>{},["stop"])),onMouseup:B(l=>E(e),["stop"])},P(e.label),47,ne)]),_:2},1032,["visible","trigger","onVisibleChange"])],64))),128))]}),_:1},8,["disabled","label-layout"])):(h(),u("span",se," "))}}}),ue=new URL("./index.min.css",import.meta.url);o.load(ue.href);export{oe as FieldCheckbox,ae as FieldRadio,te as FieldSelect,de as RefCardLabelDesign,ee as fieldReadonly,le as selectTag,X as taglabel};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return target;
|
|
1
|
+
//#region \0plugin-vue:export-helper
|
|
2
|
+
var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
3
|
+
const target = sfc.__vccOpts || sfc;
|
|
4
|
+
for (const [key, val] of props) target[key] = val;
|
|
5
|
+
return target;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
export {
|
|
7
|
+
//#endregion
|
|
8
|
+
export { _plugin_vue_export_helper_default as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { CheckboxGroupProps } from 'ant-design-vue';
|
|
3
|
+
import { FIELD_TYPE } from '@gct-paas/core';
|
|
4
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
5
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
|
+
design: BooleanConstructor;
|
|
7
|
+
disabled: BooleanConstructor;
|
|
8
|
+
readonly: BooleanConstructor;
|
|
9
|
+
fieldType: {
|
|
10
|
+
type: PropType<FIELD_TYPE>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
tagStyle: {
|
|
14
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
options: PropType<CheckboxGroupProps["options"]>;
|
|
18
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
19
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
design: BooleanConstructor;
|
|
21
|
+
disabled: BooleanConstructor;
|
|
22
|
+
readonly: BooleanConstructor;
|
|
23
|
+
fieldType: {
|
|
24
|
+
type: PropType<FIELD_TYPE>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
tagStyle: {
|
|
28
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
options: PropType<CheckboxGroupProps["options"]>;
|
|
32
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
33
|
+
}>> & Readonly<{}>, {
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
design: boolean;
|
|
36
|
+
readonly: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import field_readonly_default from "./field-readonly.vue.mjs";
|
|
2
|
+
import './index.css';/* empty css */
|
|
3
|
+
import { computed, createVNode, defineComponent } from "vue";
|
|
4
|
+
import { Checkbox, CheckboxGroup } from "ant-design-vue";
|
|
5
|
+
import { FIELD_TYPE } from "@gct-paas/core";
|
|
6
|
+
//#region src/components/form-component/FieldCheckbox.tsx
|
|
7
|
+
var FieldCheckbox_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "FieldCheckbox",
|
|
9
|
+
props: {
|
|
10
|
+
design: Boolean,
|
|
11
|
+
disabled: Boolean,
|
|
12
|
+
readonly: Boolean,
|
|
13
|
+
fieldType: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
tagStyle: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
options: Array,
|
|
22
|
+
value: [String, Number]
|
|
23
|
+
},
|
|
24
|
+
setup(props, { emit }) {
|
|
25
|
+
const isBool = props.fieldType === FIELD_TYPE.BOOLEAN;
|
|
26
|
+
const currentValue = computed({
|
|
27
|
+
get() {
|
|
28
|
+
if (isBool) return [props.value];
|
|
29
|
+
return Array.isArray(props.value) ? props.value : props.value ? props.value.split(",") : void 0;
|
|
30
|
+
},
|
|
31
|
+
set(value) {
|
|
32
|
+
if (isBool) {
|
|
33
|
+
const bool = value?.[0];
|
|
34
|
+
if (bool === void 0 || bool === null || typeof bool !== "boolean") emit("update:value", Boolean(bool));
|
|
35
|
+
else emit("update:value", !!bool);
|
|
36
|
+
} else emit("update:value", value);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const options = computed(() => {
|
|
40
|
+
if (isBool) return (props.options ?? []).filter((item) => item.value);
|
|
41
|
+
return props.options ?? [];
|
|
42
|
+
});
|
|
43
|
+
return () => {
|
|
44
|
+
return createVNode(CheckboxGroup, {
|
|
45
|
+
"value": currentValue.value,
|
|
46
|
+
"onUpdate:value": ($event) => currentValue.value = $event,
|
|
47
|
+
"disabled": props.disabled,
|
|
48
|
+
"class": ["field-checkbox-group", props.readonly ? "field-checkbox-group--readonly" : ""]
|
|
49
|
+
}, { default: () => [options.value?.map((option) => {
|
|
50
|
+
const optionItem = option;
|
|
51
|
+
const { icon, iconColor, textColor } = optionItem?._item || {};
|
|
52
|
+
return createVNode(Checkbox, {
|
|
53
|
+
"key": optionItem.value,
|
|
54
|
+
"value": optionItem.value
|
|
55
|
+
}, { default: () => [createVNode(field_readonly_default, {
|
|
56
|
+
"tagWidgetStyle": props.tagStyle,
|
|
57
|
+
"type": props.fieldType,
|
|
58
|
+
"label": optionItem.label,
|
|
59
|
+
"disabled": props.disabled,
|
|
60
|
+
"iconExtraProps": { [optionItem.label]: {
|
|
61
|
+
icon,
|
|
62
|
+
iconColor,
|
|
63
|
+
textColor
|
|
64
|
+
} }
|
|
65
|
+
}, null)] });
|
|
66
|
+
})] });
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
export { FieldCheckbox_default as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { RadioGroupProps } from 'ant-design-vue';
|
|
3
|
+
import { FIELD_TYPE } from '@gct-paas/core';
|
|
4
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
5
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
|
+
design: BooleanConstructor;
|
|
7
|
+
disabled: BooleanConstructor;
|
|
8
|
+
readonly: BooleanConstructor;
|
|
9
|
+
fieldType: {
|
|
10
|
+
type: PropType<FIELD_TYPE>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
tagStyle: {
|
|
14
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
options: PropType<RadioGroupProps["options"]>;
|
|
18
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
19
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
design: BooleanConstructor;
|
|
21
|
+
disabled: BooleanConstructor;
|
|
22
|
+
readonly: BooleanConstructor;
|
|
23
|
+
fieldType: {
|
|
24
|
+
type: PropType<FIELD_TYPE>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
tagStyle: {
|
|
28
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
options: PropType<RadioGroupProps["options"]>;
|
|
32
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
33
|
+
}>> & Readonly<{}>, {
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
design: boolean;
|
|
36
|
+
readonly: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import field_readonly_default from "./field-readonly.vue.mjs";
|
|
2
|
+
import './index.css';/* empty css */
|
|
3
|
+
import { computed, createVNode, defineComponent, isVNode } from "vue";
|
|
4
|
+
import { Radio, RadioGroup } from "ant-design-vue";
|
|
5
|
+
//#region src/components/form-component/FieldRadio.tsx
|
|
6
|
+
function _isSlot(s) {
|
|
7
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
8
|
+
}
|
|
9
|
+
var FieldRadio_default = /* @__PURE__ */ defineComponent({
|
|
10
|
+
name: "FieldRadio",
|
|
11
|
+
props: {
|
|
12
|
+
design: Boolean,
|
|
13
|
+
disabled: Boolean,
|
|
14
|
+
readonly: Boolean,
|
|
15
|
+
fieldType: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
tagStyle: {
|
|
20
|
+
type: Object,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
options: Array,
|
|
24
|
+
value: [String, Number]
|
|
25
|
+
},
|
|
26
|
+
setup(props, { emit }) {
|
|
27
|
+
const currentValue = computed({
|
|
28
|
+
get() {
|
|
29
|
+
return props.value;
|
|
30
|
+
},
|
|
31
|
+
set(value) {
|
|
32
|
+
emit("update:value", value);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return () => {
|
|
36
|
+
let _slot;
|
|
37
|
+
return createVNode(RadioGroup, {
|
|
38
|
+
"value": currentValue.value,
|
|
39
|
+
"onUpdate:value": ($event) => currentValue.value = $event,
|
|
40
|
+
"disabled": props.disabled,
|
|
41
|
+
"class": ["field-radio-group", props.readonly ? "field-radio-group--readonly" : ""]
|
|
42
|
+
}, _isSlot(_slot = (props.options ?? []).map((option) => {
|
|
43
|
+
const optionItem = option;
|
|
44
|
+
const { icon, iconColor, textColor } = optionItem?._item || {};
|
|
45
|
+
return createVNode(Radio, {
|
|
46
|
+
"key": optionItem.value,
|
|
47
|
+
"value": optionItem.value
|
|
48
|
+
}, { default: () => [createVNode(field_readonly_default, {
|
|
49
|
+
"tagWidgetStyle": props.tagStyle,
|
|
50
|
+
"type": props.fieldType,
|
|
51
|
+
"label": optionItem.label,
|
|
52
|
+
"disabled": props.disabled,
|
|
53
|
+
"iconExtraProps": { [optionItem.label]: {
|
|
54
|
+
icon,
|
|
55
|
+
iconColor,
|
|
56
|
+
textColor
|
|
57
|
+
} }
|
|
58
|
+
}, null)] });
|
|
59
|
+
})) ? _slot : { default: () => [_slot] });
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
//#endregion
|
|
64
|
+
export { FieldRadio_default as default };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { SelectProps } from 'ant-design-vue';
|
|
3
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
4
|
+
import { FIELD_TYPE, FormComponents } from '@gct-paas/core';
|
|
5
|
+
interface ISelectExtraProps {
|
|
6
|
+
mode?: 'multiple' | undefined;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
optionLabelProp?: string | undefined;
|
|
9
|
+
allowClear?: boolean;
|
|
10
|
+
showSearch?: boolean;
|
|
11
|
+
optionNoStyle?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
14
|
+
design: BooleanConstructor;
|
|
15
|
+
disabled: BooleanConstructor;
|
|
16
|
+
readonly: BooleanConstructor;
|
|
17
|
+
selectExtraProps: PropType<ISelectExtraProps>;
|
|
18
|
+
fieldType: {
|
|
19
|
+
type: PropType<FIELD_TYPE>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
type: {
|
|
23
|
+
type: PropType<FormComponents>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
tagStyle: {
|
|
27
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
options: PropType<SelectProps["options"]>;
|
|
31
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
32
|
+
maxTagCount: {
|
|
33
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
36
|
+
maxTagTextLength: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
default: number;
|
|
39
|
+
};
|
|
40
|
+
selectOptionLabel: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
};
|
|
43
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
46
|
+
design: BooleanConstructor;
|
|
47
|
+
disabled: BooleanConstructor;
|
|
48
|
+
readonly: BooleanConstructor;
|
|
49
|
+
selectExtraProps: PropType<ISelectExtraProps>;
|
|
50
|
+
fieldType: {
|
|
51
|
+
type: PropType<FIELD_TYPE>;
|
|
52
|
+
required: true;
|
|
53
|
+
};
|
|
54
|
+
type: {
|
|
55
|
+
type: PropType<FormComponents>;
|
|
56
|
+
required: true;
|
|
57
|
+
};
|
|
58
|
+
tagStyle: {
|
|
59
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
60
|
+
required: true;
|
|
61
|
+
};
|
|
62
|
+
options: PropType<SelectProps["options"]>;
|
|
63
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
64
|
+
maxTagCount: {
|
|
65
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
66
|
+
default: number;
|
|
67
|
+
};
|
|
68
|
+
maxTagTextLength: {
|
|
69
|
+
type: NumberConstructor;
|
|
70
|
+
default: number;
|
|
71
|
+
};
|
|
72
|
+
selectOptionLabel: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
};
|
|
75
|
+
}>> & Readonly<{}>, {
|
|
76
|
+
disabled: boolean;
|
|
77
|
+
maxTagCount: string | number;
|
|
78
|
+
maxTagTextLength: number;
|
|
79
|
+
design: boolean;
|
|
80
|
+
readonly: boolean;
|
|
81
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
82
|
+
export default _default;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import tag_label_default from "./field-label/tag-label.vue.mjs";
|
|
2
|
+
import field_readonly_default from "./field-readonly.vue.mjs";
|
|
3
|
+
import selectTag_default from "./field-label/selectTag.vue.mjs";
|
|
4
|
+
import './index.css';/* empty css */
|
|
5
|
+
import { computed, createVNode, defineComponent, h, mergeProps } from "vue";
|
|
6
|
+
import { Avatar, Select } from "ant-design-vue";
|
|
7
|
+
import { FormComponents } from "@gct-paas/core";
|
|
8
|
+
import { pick } from "lodash-es";
|
|
9
|
+
import { transformUrl } from "@gct-paas/core-web";
|
|
10
|
+
//#region src/components/form-component/FieldSelect.tsx
|
|
11
|
+
var FieldSelect_default = /* @__PURE__ */ defineComponent({
|
|
12
|
+
name: "FieldSelect",
|
|
13
|
+
props: {
|
|
14
|
+
design: Boolean,
|
|
15
|
+
disabled: Boolean,
|
|
16
|
+
readonly: Boolean,
|
|
17
|
+
selectExtraProps: Object,
|
|
18
|
+
fieldType: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
type: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
tagStyle: {
|
|
27
|
+
type: Object,
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
options: Array,
|
|
31
|
+
value: [String, Number],
|
|
32
|
+
maxTagCount: {
|
|
33
|
+
type: [Number, String],
|
|
34
|
+
default: 5
|
|
35
|
+
},
|
|
36
|
+
maxTagTextLength: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 6
|
|
39
|
+
},
|
|
40
|
+
selectOptionLabel: { type: String }
|
|
41
|
+
},
|
|
42
|
+
setup(props, { emit }) {
|
|
43
|
+
const currentValue = computed({
|
|
44
|
+
get() {
|
|
45
|
+
return props.value;
|
|
46
|
+
},
|
|
47
|
+
set(value) {
|
|
48
|
+
emit("update:value", value);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const renderTag = (com, { name, iconExtraProps, otherParams = {} }) => {
|
|
52
|
+
return h(com, {
|
|
53
|
+
tagWidgetStyle: props.tagStyle,
|
|
54
|
+
type: props.fieldType,
|
|
55
|
+
label: name,
|
|
56
|
+
disabled: props.disabled,
|
|
57
|
+
iconExtraProps,
|
|
58
|
+
...otherParams
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
const renderSelectTag = ({ name, title, iconExtraProps, avatar, otherParams = {} }) => {
|
|
62
|
+
return createVNode(selectTag_default, mergeProps({
|
|
63
|
+
"tagWidgetStyle": props.tagStyle,
|
|
64
|
+
"type": props.fieldType,
|
|
65
|
+
"label": name,
|
|
66
|
+
"avatar": avatar,
|
|
67
|
+
"title": title?.length > props.maxTagTextLength ? title : null,
|
|
68
|
+
"disabled": props.disabled,
|
|
69
|
+
"iconExtraProps": iconExtraProps
|
|
70
|
+
}, otherParams), null);
|
|
71
|
+
};
|
|
72
|
+
const options = computed(() => {
|
|
73
|
+
return (props.options ?? []).map((item) => {
|
|
74
|
+
const { iconColor, icon, textColor } = item._item || {};
|
|
75
|
+
return {
|
|
76
|
+
...item,
|
|
77
|
+
[props.selectExtraProps?.optionLabelProp || "titleLabel"]: renderTag(tag_label_default, {
|
|
78
|
+
name: item.label,
|
|
79
|
+
iconExtraProps: { [item.label]: {
|
|
80
|
+
icon,
|
|
81
|
+
iconColor,
|
|
82
|
+
textColor
|
|
83
|
+
} }
|
|
84
|
+
})
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
function getLabelByDict(item, key) {
|
|
89
|
+
const { _DICT = {} } = item;
|
|
90
|
+
const value = item[key];
|
|
91
|
+
return _DICT[key]?.[value]?.join(",") ?? value ?? item.id_;
|
|
92
|
+
}
|
|
93
|
+
const selectInfo = computed(() => {
|
|
94
|
+
if (props.readonly) {
|
|
95
|
+
const list = options.value?.filter((item) => {
|
|
96
|
+
if (props.selectExtraProps?.mode === "multiple") return Array.isArray(currentValue.value) && currentValue.value.includes(item.value);
|
|
97
|
+
return item.value === currentValue.value;
|
|
98
|
+
}) ?? [];
|
|
99
|
+
const icons = Object.fromEntries(list?.map((item) => {
|
|
100
|
+
return [item.label, pick(item?._item || {}, [
|
|
101
|
+
"iconColor",
|
|
102
|
+
"icon",
|
|
103
|
+
"textColor"
|
|
104
|
+
])];
|
|
105
|
+
}) ?? []);
|
|
106
|
+
return {
|
|
107
|
+
labels: list.map((e) => e.label),
|
|
108
|
+
icons
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return {};
|
|
112
|
+
});
|
|
113
|
+
const slot = { option: (data) => {
|
|
114
|
+
const { label, _item = {} } = data;
|
|
115
|
+
if (props.type === FormComponents.Userpicker) return createVNode("div", { "class": "flex items-center" }, [createVNode(Avatar, {
|
|
116
|
+
"size": 30,
|
|
117
|
+
"style": "margin: 0 8px;min-width:32px",
|
|
118
|
+
"src": transformUrl(_item.avatar)
|
|
119
|
+
}, null), createVNode("div", { "style": "width:calc(100% - 35px)" }, [createVNode("div", {
|
|
120
|
+
"class": " w100% ell",
|
|
121
|
+
"title": label
|
|
122
|
+
}, [label]), createVNode("div", { "class": "text-[#8F8F8F] text-[12px] mt2px" }, [_item.masterOrgName])])]);
|
|
123
|
+
else return renderTag(tag_label_default, {
|
|
124
|
+
name: props.selectOptionLabel ? getLabelByDict(_item, props.selectOptionLabel) : label,
|
|
125
|
+
iconExtraProps: { [label]: pick(_item, [
|
|
126
|
+
"iconColor",
|
|
127
|
+
"icon",
|
|
128
|
+
"textColor"
|
|
129
|
+
]) },
|
|
130
|
+
otherParams: { showTagStyle: false }
|
|
131
|
+
});
|
|
132
|
+
} };
|
|
133
|
+
const tagRender = (data) => {
|
|
134
|
+
const { label, option, closable, onClose } = data;
|
|
135
|
+
const { _item = {} } = option || {};
|
|
136
|
+
return renderSelectTag({
|
|
137
|
+
name: label,
|
|
138
|
+
title: option?.label,
|
|
139
|
+
avatar: option?._item?.avatar,
|
|
140
|
+
iconExtraProps: { [label]: pick(_item, [
|
|
141
|
+
"iconColor",
|
|
142
|
+
"icon",
|
|
143
|
+
"textColor"
|
|
144
|
+
]) },
|
|
145
|
+
otherParams: {
|
|
146
|
+
closable,
|
|
147
|
+
"onOn-close": onClose,
|
|
148
|
+
style: "margin-right: 4px"
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
return () => {
|
|
153
|
+
return props.readonly ? renderTag(field_readonly_default, {
|
|
154
|
+
name: selectInfo.value?.labels,
|
|
155
|
+
iconExtraProps: selectInfo.value?.icons
|
|
156
|
+
}) : createVNode(Select, mergeProps({
|
|
157
|
+
"class": ["field-select", "w100%"],
|
|
158
|
+
"value": currentValue.value,
|
|
159
|
+
"onUpdate:value": ($event) => currentValue.value = $event,
|
|
160
|
+
"options": options.value,
|
|
161
|
+
"disabled": props.disabled,
|
|
162
|
+
"optionLabelProp": "titleLabel",
|
|
163
|
+
"tagRender": tagRender,
|
|
164
|
+
"showArrow": true,
|
|
165
|
+
"maxTagCount": props.maxTagCount,
|
|
166
|
+
"maxTagTextLength": props.maxTagTextLength,
|
|
167
|
+
"dropdownMatchSelectWidth": 180,
|
|
168
|
+
"dropdownClassName": props.selectExtraProps?.mode === "multiple" ? "gct-project-select-dropdown gct-project-select-multiple vxe-table--ignore-clear" : "gct-project-select-dropdown vxe-table--ignore-clear"
|
|
169
|
+
}, props.selectExtraProps), props.selectExtraProps?.optionNoStyle ? null : slot);
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
//#endregion
|
|
174
|
+
export { FieldSelect_default as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
2
|
+
/**空值显示逻辑 */
|
|
3
|
+
export declare function emptyValueDisplay(widget: LowCodeWidget.FieldSchema, value: IObject): {
|
|
4
|
+
RenderEmptyValue: import('vue').DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import('vue').PublicProps>;
|
|
5
|
+
isEmpty: import('vue').ComputedRef<boolean | undefined>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
2
|
+
import { CARD_TRIGGER_ENUM, FIELD_TYPE } from '@gct-paas/core';
|
|
3
|
+
export interface Props {
|
|
4
|
+
tagWidgetStyle?: {
|
|
5
|
+
tagStyleOpen: boolean;
|
|
6
|
+
contentFont: LowCodeWidget.FontStyle;
|
|
7
|
+
tagStyle?: LowCodeWidget.TagConfigStyle;
|
|
8
|
+
};
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
trigger: CARD_TRIGGER_ENUM;
|
|
11
|
+
modelKey: string;
|
|
12
|
+
/**信息卡的id */
|
|
13
|
+
refCardId: string;
|
|
14
|
+
type: FIELD_TYPE;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import ref_card_label_design_vue_vue_type_script_setup_true_lang_default from "./ref-card-label-design.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
import './ref-card-label-design.vue_vue_type_style_index_0_lang.css';/* empty css */
|
|
3
|
+
//#region src/components/form-component/field-label/ref-card-label-design.vue
|
|
4
|
+
var ref_card_label_design_default = ref_card_label_design_vue_vue_type_script_setup_true_lang_default;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { ref_card_label_design_default as default };
|