cnhis-design-vue 3.2.14-beta.19 → 3.2.14-beta.21
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/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
- package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
- package/es/components/big-table/src/BigTable.vue2.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-date.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-time.js +1 -1
- package/es/components/big-table/src/components/input-button.vue2.js +1 -1
- package/es/components/big-table/src/hooks/useTableParse.js +1 -1
- 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/button-print/src/components/IdentityVerification.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
- package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
- package/es/components/classification/src/index.vue2.js +1 -1
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/expand-field/src/index.vue2.js +1 -1
- package/es/components/expand-field/src/utils/constant.js +1 -1
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldColor.vue2.js +1 -1
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/Index.vue2.js +1 -1
- package/es/components/field-set/src/TableStyle.vue2.js +1 -1
- package/es/components/field-set/src/components/condition.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/src/constants/filter.js +1 -1
- package/es/components/field-set/src/constants/index.js +1 -1
- package/es/components/form-config/index.d.ts +108 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +108 -3
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.js +1 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -0
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/src/hooks/useLocale.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/iho-chat/index.d.ts +55 -2
- package/es/components/iho-chat/src/Index.vue.d.ts +55 -2
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +11 -2
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.d.ts +11 -2
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +45 -0
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
- package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
- package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
- package/es/components/map/src/Map.vue2.js +1 -1
- package/es/components/picture-clipper/src/PictureClipper.vue2.js +1 -1
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-cascader.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-select.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
- package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
- package/es/components/select-label/src/components/label-classify.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/SelectPersonType.vue2.js +1 -1
- package/es/components/select-person/src/index.vue2.js +1 -1
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
- package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/helpers/options.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/selectExtraMap.js +1 -1
- package/es/components/table-filter/src/tool/baseOptions.js +1 -1
- package/es/components/template-render/src/components/index.d.ts +23 -23
- package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/ai__avatar.png.js +1 -1
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/logo.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as
|
1
|
+
import{defineComponent as e,computed as a,ref as n,watch as t,nextTick as l,openBlock as i,createElementBlock as o,renderSlot as d,createVNode as r,unref as u,withCtx as s,mergeProps as w,createElementVNode as g,normalizeClass as p,createBlock as f,resolveDynamicComponent as c,createCommentVNode as v,createTextVNode as y,Fragment as m,renderList as _,toDisplayString as x,h as I}from"vue";import{isArray as C,isString as L,isNumber as h,isFunction as B,isObject as b,pick as k}from"lodash-es";import{NPopover as P,NImage as E,NDivider as U,NSpace as H,NButton as z,NTag as T,NEllipsis as j}from"naive-ui";import F from"../../../../form-render/index.js";const N={class:"c-info-header__patient"},R={class:"c-info-header__patientHeader"},$={key:0,class:"c-info-header__patientHeader--name"},S={key:1,class:"c-info-header__patientHeader--sex"},V={key:2,class:"c-info-header__patientHeader--age"};var D=e({__name:"index",props:{patientInfo:{default:()=>({})},patientEditable:{type:Boolean}},setup(e){const D=e,M=a((()=>D.patientInfo&&C(D.patientInfo.tagList)?D.patientInfo.tagList.filter((e=>e.render||L(e.content)&&e.content)):[])),O={warning:"#fcc200",info:"rgba(45, 122, 255, 0.1)"},W={warning:"#fff",info:"#2563F4"};function q({type:e="warning"}){return{color:O[e],textColor:W[e]}}function A(e){return()=>L(e)||h(e)?e:B(e)?e():b(e)?I(e):null}const G=n(!1),J=a((()=>{var e,a,n,t,l,i,o,d,r,u,s,w,g,p,f,c;return D.patientEditable?[{val_key:"name",is_null:"0",is_empty:"0",alias:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.116"))||"姓名",html_type:"INPUT",...D.patientInfo.nameProps},{val_key:"sex",alias:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.122"))||"性别",html_type:"SELECT",is_null:"0",option:[{text:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.205"))||"未知",value:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.205"))||"未知"},{text:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.203"))||"男",value:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.203"))||"男"},{text:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.204"))||"女",value:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.204"))||"女"}],...D.patientInfo.sexProps},{val_key:"age",alias:"年龄",html_type:"INPUT_NUMBER",is_null:"0",is_empty:"0",decoratorProps:{style:{flex:2}},...D.patientInfo.ageProps,suffixConfig:{alias:"年龄单位",is_null:"0",val_key:"ageUnit",html_type:"SELECT",decoratorProps:{style:{flex:1}},option:[{value:(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.144"))||"天",text:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.144"))||"天"},{value:(null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.347"))||"月",text:(null==(w=window.getLanguageByCode)?void 0:w.call(window,"10010.1.347"))||"月"},{value:"岁",text:"岁"},{value:(null==(g=window.getLanguageByCode)?void 0:g.call(window,"10010.1.350"))||"小时",text:(null==(p=window.getLanguageByCode)?void 0:p.call(window,"10010.1.350"))||"小时"},{value:"分",text:"分"},{value:(null==(f=window.getLanguageByCode)?void 0:f.call(window,"10010.1.346"))||"周",text:(null==(c=window.getLanguageByCode)?void 0:c.call(window,"10010.1.346"))||"周"}],...D.patientInfo.ageUnitProps}}]:[]})),K=n();async function Q(){K.value&&(await K.value.validate(),Object.assign(D.patientInfo,k(K.value.getFormValues(),["name","sex","age","ageUnit"])),G.value=!1)}return t(G,(async e=>{await l(),e&&K.value&&K.value.setFormValues(D.patientInfo||{})})),(a,n)=>(i(),o("section",N,[d(a.$slots,"avatar",{},(()=>[r(u(P),null,{trigger:s((()=>[r(u(E),w({style:{"border-radius":"50%"},width:36,height:36,"preview-disabled":"",src:e.patientInfo.avatar},e.patientInfo.avatarProps),null,16,["src"])])),default:s((()=>[r(u(E),w({width:200,"preview-disabled":"",src:e.patientInfo.avatarPreview||e.patientInfo.avatar},e.patientInfo.avatarPreviewProps),null,16,["src"])])),_:1})])),g("section",null,[g("header",R,[r(u(P),{disabled:!e.patientEditable,trigger:"manual",placement:"bottom",show:G.value},{trigger:s((()=>{var a;return[g("section",{class:p(["c-info-header__patientHeaderWrapper",{"in-edit":G.value}]),onDblclick:n[0]||(n[0]=a=>e.patientEditable&&(G.value=!0))},[e.patientInfo.name?(i(),o("div",$,[(i(),f(c(A(e.patientInfo.name))))])):v("v-if",!0),e.patientInfo.sex?(i(),o("div",S,[y(" / "),(i(),f(c(A(e.patientInfo.sex))))])):v("v-if",!0),null!=e.patientInfo.age?(i(),o("div",V,[y(" / "),(i(),f(c(A(e.patientInfo.age)))),(i(),f(c(A(null!=(a=e.patientInfo.ageUnit)?a:"岁"))))])):v("v-if",!0)],34)]})),default:s((()=>[r(u(F),{column:"6",size:"small","label-placement":"left",style:{width:"200px",margin:"4px 0 -8px 0"},"field-list":u(J),ref_key:"formRenderRef",ref:K},null,8,["field-list"]),r(u(U),{style:{margin:"8px -14px",width:"calc(100% + 28px)"}}),r(u(H),{justify:"end"},{default:s((()=>[r(u(z),{size:"small",onClick:n[1]||(n[1]=e=>G.value=!1)},{default:s((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),r(u(z),{size:"small",type:"info",onClick:Q},{default:s((()=>[y("确认")])),_:1})])),_:1})])),_:1},8,["disabled","show"]),d(a.$slots,"tags",{tagList:u(M)},(()=>[(i(!0),o(m,null,_(e.patientInfo.tagList||[],(e=>(i(),f(u(T),w({key:e.content,size:"medium",bordered:!1,color:q(e)},e),{default:s((()=>[e.render?(i(),f(c(e.render),{key:0})):(i(),f(u(j),{key:1,style:{"max-width":"96px"}},{default:s((()=>[y(x(e.content),1)])),_:2},1024))])),_:2},1040,["color"])))),128))]))]),d(a.$slots,"avatarInfo")])]))}});export{D as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{
|
1
|
+
import{createElementVNode as e,defineComponent as l,ref as o,provide as t,computed as a,unref as n,openBlock as u,createBlock as i,normalizeStyle as s,withCtx as r,createVNode as d,mergeProps as c,createElementBlock as p,normalizeClass as f,Fragment as m,renderList as v,createCommentVNode as y,createTextVNode as g,toDisplayString as h}from"vue";import{NPopover as k,NInputNumber as w,NSpace as V,NIcon as b}from"naive-ui";import{Close as x,GitCompareOutline as C,ArrowUndoSharp as S}from"@vicons/ionicons5";import j from"./components/NumberPanel.vue.js";import{useDraggable as O}from"@vueuse/core";import{useTheme as _}from"../../../shared/hooks/useTheme.js";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../shared/hooks/useScrollLoading.js";import{defaultCssVars as I}from"./constants/index.js";var B;const D=e("span",null,(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.142"))||"键盘",-1),N={class:"keys"},K=["onClick"];var L=l({__name:"Keyboard",props:{mode:{type:String,default:"english"},drag:{type:Boolean,default:!1},positionInitialValue:{type:Object,default:()=>({x:0,y:0})},defaultValue:{type:Number},value:{type:Number},panel:{type:Boolean,default:!0},moveOffset:{type:Object,default:()=>({x:0,y:0})}},emits:["change","keydown"],setup(l,{expose:B,emit:L}){const R=l,U="QWERTYUIOPASDFGHJKLZXCVBNM.",E=["Switch"," ","Undo","Enter"],F=U.split("").concat(E),H=U.split(".")[0].split("").sort().concat(["."],E),J=_(I,"Keyboard");let M=o(Date.now());t("toSelectInputContent",M);const P=a((()=>"english"===R.mode)),Q=a((()=>({mode:R.mode,defaultValue:R.defaultValue,value:R.value,positionInitialValue:R.positionInitialValue,moveOffset:R.moveOffset,drag:R.drag,onChange:q}))),T=a((()=>`${JSON.stringify(J.value).replace(/\{|\}|\"/g,"").replace(/,/g,";")};${(null==Y?void 0:Y.value)||""}`)),$=o(F.slice()),A=o(),G=o(),W=o(),X=o(),Y=function(){R.defaultValue&&(X.value=R.defaultValue);if(P.value&&R.drag){const{x:e,y:l,style:o}=O(G,{initialValue:R.positionInitialValue,preventDefault:!0,handle:W,onMove:(e,l)=>{var o,t,a,n;e.x+=null!=(t=null==(o=R.moveOffset)?void 0:o.x)?t:0,e.y+=null!=(n=null==(a=R.moveOffset)?void 0:a.y)?n:0}});return o}}();function Z(e){"Switch"!==e?L("keydown",e):$.value="Q"===$.value[0]?H.slice():F.slice()}function q(e){var l;null==(l=A.value)||l.setShow(!1),X.value=e,L("change",e)}return B({select:function(){M.value=Date.now()}}),(o,t)=>n(P)||l.panel?!n(P)&&l.panel?(u(),i(j,c({key:1},n(Q),{style:n(J)}),null,16,["style"])):(u(),p("div",{key:2,class:f(["c-keyboard-english",{isFixed:l.drag}]),ref_key:"englishKeyboardRef",ref:G,style:s(n(T))},[d(n(V),{"wrap-item":!1,align:"center",justify:"space-between",ref_key:"keyboardDragRef",ref:W,style:s({cursor:l.drag?"move":"default"})},{default:r((()=>[D,d(n(b),{onClick:t[1]||(t[1]=e=>Z("close")),component:n(x)},null,8,["component"])])),_:1},8,["style"]),e("div",N,[(u(!0),p(m,null,v($.value,((e,l)=>{var o;return u(),p("span",{key:e,class:f(["key"+l]),onClick:l=>Z(e)},["Switch"===e?(u(),i(n(b),{key:0,component:n(C)},null,8,["component"])):y("v-if",!0),"Undo"===e?(u(),i(n(b),{key:1,component:n(S)},null,8,["component"])):y("v-if",!0),g(" "+h(E.includes(e)&&"Enter"!==e?""===e?(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.143"))||"空格":"":e),1)],10,K)})),128))])],6)):(u(),i(n(k),{key:0,ref_key:"popoverRef",ref:A,trigger:"click","show-arrow":!1,placement:"bottom-start",style:s([{padding:"0"},n(J)]),"display-directive":"show"},{trigger:r((()=>[d(n(w),{value:X.value,"onUpdate:value":t[0]||(t[0]=e=>X.value=e),"show-button":!1},null,8,["value"])])),default:r((()=>[d(j,{mode:l.mode,defaultValue:l.defaultValue,onChange:q},null,8,["mode","defaultValue"])])),_:1},8,["style"]))}});export{L as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent,computed,ref,watch,openBlock,createElementBlock,normalizeClass,normalizeStyle,unref,createElementVNode,createVNode,withCtx,Fragment,renderList,toDisplayString,createBlock,createCommentVNode,nextTick}from"vue";import{NSpace,NIcon}from"naive-ui";import{ArrowUndoSharp}from"@vicons/ionicons5";import InputNumber from"./InputNumber.vue.js";import{useDraggable}from"@vueuse/core";import{getNumber}from"../utils/index.js";const _hoisted_1={class:"keys"},_hoisted_2=["onClick"],_hoisted_3=["onClick"],_hoisted_4={class:"btns"},_hoisted_5=["onClick"],_hoisted_6={class:"inputs"},_hoisted_7={class:"inputs-right"},_hoisted_8=createElementVNode("hr",null,null,-1);var _sfc_main=defineComponent({__name:"NumberPanel",props:{defaultValue:{type:Number},value:{type:Number},mode:{type:String},positionInitialValue:{type:Object,default:()=>({x:0,y:0})},moveOffset:{type:Object,default:()=>({x:0,y:0})},drag:{type:Boolean,default:!1}},emits:["change"],setup(__props,{emit:emit}){const props=__props,NUMBERKEYS="1234567890.",DAYS=[3,7,14,30],DOSENUMBERKEYS="123/456*789-0.+",CALCULATIONSYMBOLS=["+","-","*","/"],isNumber=computed((()=>"number"===props.mode)),isDay=computed((()=>"day"===props.mode&&!isNumber.value)),isDose=computed((()=>"dose"===props.mode&&!isNumber.value)),numberKeys=computed((()=>(isDose.value?DOSENUMBERKEYS:NUMBERKEYS).split(""))),days=ref(DAYS),doses=ref([2,3,4,5,6,7,8]),inputValue=ref(""),integerValue=ref(),numeratorValue=ref(),denominatorValue=ref(),inputValueStatus=ref("success"),numeratorValueStatus=ref("success"),denominatorValueStatus=ref("success"),keyboardRef=ref(null),inputRef=ref(null),style=init();function init(){if(props.defaultValue&&(inputValue.value=props.defaultValue.toString()),props.drag){const{x:e,y:t,style:a}=useDraggable(keyboardRef,{initialValue:props.positionInitialValue,onMove:(e,t)=>{var a,u,n,l;e.x+=null!=(u=null==(a=props.moveOffset)?void 0:a.x)?u:0,e.y+=null!=(l=null==(n=props.moveOffset)?void 0:n.y)?l:0}});return a}}async function setFocus(){var e,t,a;const u=null==(a=null==(t=null==(e=inputRef.value)?void 0:e.$childrenRefs)?void 0:t.$refs)?void 0:a.inputElRef;await nextTick(),u.focus()}function keydown(key){switch(key){case"Undo":updateValue(key);break;case"Enter":if(!validator())return void(inputValueStatus.value="error");emit("change",eval(inputValue.value)),setFocus();break;default:"number"==typeof key?(inputValue.value=key.toString(),setInputValueStatus(),setFocus()):updateValue(key)}}function onKeydown(e){["Enter"].includes(e.key)&&keydown("Enter")}async function updateValue(e){var t,a,u;const n=null==(u=null==(a=null==(t=inputRef.value)?void 0:t.$childrenRefs)?void 0:a.$refs)?void 0:u.inputElRef,{selectionStart:l,selectionEnd:o}=n,r=inputValue.value.split("");if("Undo"===e){const e=l===o?1:o-l,t=l===o?l-1:l;inputValue.value&&t>-1&&r.splice(t,e)}else r.splice(l,o-l,e);inputValue.value=r.join(""),await nextTick(),n.focus();const s="Undo"===e?l?o>l?l:l-1:0:l+1;n.setSelectionRange(s,s),setInputValueStatus()}function validator(){if(!inputValue.value)return!1;if(CALCULATIONSYMBOLS.slice(2).includes(inputValue.value[0]))return!1;if(CALCULATIONSYMBOLS.includes(inputValue.value[inputValue.value.length-1]))return!1;const e=[];let t=[];const a=inputValue.value.split("");a.forEach(((u,n)=>{CALCULATIONSYMBOLS.includes(u)?(e.push(t.join("")),t=[]):(t.push(u),n===a.length-1&&e.push(t.join("")))}));return!!e.every(((e,t)=>0===t&&!e||/^\d*(.\d+)?$/.test(e)))}function updateFraction(e){setInputStatus(inputValue,inputValueStatus)&&(inputValue.value=(Math.round(+inputValue.value*(1/e)*100)/100).toString(),setInputValueStatus())}function calculateFraction(){if(!setInputStatus(inputValue,inputValueStatus)||!setInputStatus(numeratorValue,numeratorValueStatus,!0)||!setInputStatus(denominatorValue,denominatorValueStatus,!0))return;const e=getNumber(integerValue.value)+getNumber(numeratorValue.value)/getNumber(denominatorValue.value);inputValue.value=(Math.round(+inputValue.value*e*100)/100).toString(),setInputValueStatus()}function setInputStatus(e,t,a){if((a||e.value&&"."!==e.value)&&(!a||e.value))return!0;t.value="error"}function setInputValueStatus(){inputValueStatus.value=inputValue.value?"success":"error"}return watch((()=>props.value),(e=>inputValue.value=(e||"").toString()),{immediate:!0}),(e,t)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["c-keyboard",{isFixed:__props.drag}]),ref_key:"keyboardRef",ref:keyboardRef,style:normalizeStyle(unref(style)),onKeydown:onKeydown},[createElementVNode("div",{class:normalizeClass(["left",{isDose:unref(isDose)}])},[createVNode(InputNumber,{ref_key:"inputRef",ref:inputRef,modelValue:inputValue.value,"onUpdate:modelValue":t[0]||(t[0]=e=>inputValue.value=e),status:inputValueStatus.value,"onUpdate:status":t[1]||(t[1]=e=>inputValueStatus.value=e)},null,8,["modelValue","status"]),createElementVNode("div",_hoisted_1,[createVNode(unref(NSpace),{class:"margin-offset","wrap-item":!1},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(numberKeys),(e=>(openBlock(),createElementBlock("span",{key:e,class:normalizeClass("0"===e?"is-0":""),onClick:t=>keydown(e)},toDisplayString(e),11,_hoisted_2)))),128))])),_:1}),createVNode(unref(NSpace),{class:"margin-offset","wrap-item":!1},{default:withCtx((()=>[createElementVNode("span",{class:"opt",onClick:t[2]||(t[2]=e=>keydown("Undo"))},[createVNode(unref(NIcon),{component:unref(ArrowUndoSharp)},null,8,["component"])]),createElementVNode("span",{class:"opt",onClick:t[3]||(t[3]=e=>keydown("Enter"))},"确定")])),_:1})])],2),unref(isDay)?(openBlock(),createBlock(unref(NSpace),{key:0,class:"right-days","wrap-item":!1,justify:"center",vertical:""},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(days.value,(e=>
|
1
|
+
import{defineComponent,computed,ref,watch,openBlock,createElementBlock,normalizeClass,normalizeStyle,unref,createElementVNode,createVNode,withCtx,Fragment,renderList,toDisplayString,createBlock,createCommentVNode,nextTick}from"vue";import{NSpace,NIcon}from"naive-ui";import{ArrowUndoSharp}from"@vicons/ionicons5";import InputNumber from"./InputNumber.vue.js";import{useDraggable}from"@vueuse/core";import{getNumber}from"../utils/index.js";const _hoisted_1={class:"keys"},_hoisted_2=["onClick"],_hoisted_3=["onClick"],_hoisted_4={class:"btns"},_hoisted_5=["onClick"],_hoisted_6={class:"inputs"},_hoisted_7={class:"inputs-right"},_hoisted_8=createElementVNode("hr",null,null,-1);var _sfc_main=defineComponent({__name:"NumberPanel",props:{defaultValue:{type:Number},value:{type:Number},mode:{type:String},positionInitialValue:{type:Object,default:()=>({x:0,y:0})},moveOffset:{type:Object,default:()=>({x:0,y:0})},drag:{type:Boolean,default:!1}},emits:["change"],setup(__props,{emit:emit}){const props=__props,NUMBERKEYS="1234567890.",DAYS=[3,7,14,30],DOSENUMBERKEYS="123/456*789-0.+",CALCULATIONSYMBOLS=["+","-","*","/"],isNumber=computed((()=>"number"===props.mode)),isDay=computed((()=>"day"===props.mode&&!isNumber.value)),isDose=computed((()=>"dose"===props.mode&&!isNumber.value)),numberKeys=computed((()=>(isDose.value?DOSENUMBERKEYS:NUMBERKEYS).split(""))),days=ref(DAYS),doses=ref([2,3,4,5,6,7,8]),inputValue=ref(""),integerValue=ref(),numeratorValue=ref(),denominatorValue=ref(),inputValueStatus=ref("success"),numeratorValueStatus=ref("success"),denominatorValueStatus=ref("success"),keyboardRef=ref(null),inputRef=ref(null),style=init();function init(){if(props.defaultValue&&(inputValue.value=props.defaultValue.toString()),props.drag){const{x:e,y:t,style:a}=useDraggable(keyboardRef,{initialValue:props.positionInitialValue,onMove:(e,t)=>{var a,u,n,l;e.x+=null!=(u=null==(a=props.moveOffset)?void 0:a.x)?u:0,e.y+=null!=(l=null==(n=props.moveOffset)?void 0:n.y)?l:0}});return a}}async function setFocus(){var e,t,a;const u=null==(a=null==(t=null==(e=inputRef.value)?void 0:e.$childrenRefs)?void 0:t.$refs)?void 0:a.inputElRef;await nextTick(),u.focus()}function keydown(key){switch(key){case"Undo":updateValue(key);break;case"Enter":if(!validator())return void(inputValueStatus.value="error");emit("change",eval(inputValue.value)),setFocus();break;default:"number"==typeof key?(inputValue.value=key.toString(),setInputValueStatus(),setFocus()):updateValue(key)}}function onKeydown(e){["Enter"].includes(e.key)&&keydown("Enter")}async function updateValue(e){var t,a,u;const n=null==(u=null==(a=null==(t=inputRef.value)?void 0:t.$childrenRefs)?void 0:a.$refs)?void 0:u.inputElRef,{selectionStart:l,selectionEnd:o}=n,r=inputValue.value.split("");if("Undo"===e){const e=l===o?1:o-l,t=l===o?l-1:l;inputValue.value&&t>-1&&r.splice(t,e)}else r.splice(l,o-l,e);inputValue.value=r.join(""),await nextTick(),n.focus();const s="Undo"===e?l?o>l?l:l-1:0:l+1;n.setSelectionRange(s,s),setInputValueStatus()}function validator(){if(!inputValue.value)return!1;if(CALCULATIONSYMBOLS.slice(2).includes(inputValue.value[0]))return!1;if(CALCULATIONSYMBOLS.includes(inputValue.value[inputValue.value.length-1]))return!1;const e=[];let t=[];const a=inputValue.value.split("");a.forEach(((u,n)=>{CALCULATIONSYMBOLS.includes(u)?(e.push(t.join("")),t=[]):(t.push(u),n===a.length-1&&e.push(t.join("")))}));return!!e.every(((e,t)=>0===t&&!e||/^\d*(.\d+)?$/.test(e)))}function updateFraction(e){setInputStatus(inputValue,inputValueStatus)&&(inputValue.value=(Math.round(+inputValue.value*(1/e)*100)/100).toString(),setInputValueStatus())}function calculateFraction(){if(!setInputStatus(inputValue,inputValueStatus)||!setInputStatus(numeratorValue,numeratorValueStatus,!0)||!setInputStatus(denominatorValue,denominatorValueStatus,!0))return;const e=getNumber(integerValue.value)+getNumber(numeratorValue.value)/getNumber(denominatorValue.value);inputValue.value=(Math.round(+inputValue.value*e*100)/100).toString(),setInputValueStatus()}function setInputStatus(e,t,a){if((a||e.value&&"."!==e.value)&&(!a||e.value))return!0;t.value="error"}function setInputValueStatus(){inputValueStatus.value=inputValue.value?"success":"error"}return watch((()=>props.value),(e=>inputValue.value=(e||"").toString()),{immediate:!0}),(e,t)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["c-keyboard",{isFixed:__props.drag}]),ref_key:"keyboardRef",ref:keyboardRef,style:normalizeStyle(unref(style)),onKeydown:onKeydown},[createElementVNode("div",{class:normalizeClass(["left",{isDose:unref(isDose)}])},[createVNode(InputNumber,{ref_key:"inputRef",ref:inputRef,modelValue:inputValue.value,"onUpdate:modelValue":t[0]||(t[0]=e=>inputValue.value=e),status:inputValueStatus.value,"onUpdate:status":t[1]||(t[1]=e=>inputValueStatus.value=e)},null,8,["modelValue","status"]),createElementVNode("div",_hoisted_1,[createVNode(unref(NSpace),{class:"margin-offset","wrap-item":!1},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(numberKeys),(e=>(openBlock(),createElementBlock("span",{key:e,class:normalizeClass("0"===e?"is-0":""),onClick:t=>keydown(e)},toDisplayString(e),11,_hoisted_2)))),128))])),_:1}),createVNode(unref(NSpace),{class:"margin-offset","wrap-item":!1},{default:withCtx((()=>{var e;return[createElementVNode("span",{class:"opt",onClick:t[2]||(t[2]=e=>keydown("Undo"))},[createVNode(unref(NIcon),{component:unref(ArrowUndoSharp)},null,8,["component"])]),createElementVNode("span",{class:"opt",onClick:t[3]||(t[3]=e=>keydown("Enter"))},(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])],2),unref(isDay)?(openBlock(),createBlock(unref(NSpace),{key:0,class:"right-days","wrap-item":!1,justify:"center",vertical:""},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(days.value,(e=>{var t;return openBlock(),createElementBlock("span",{class:"btn",key:e,onClick:t=>keydown(e)},toDisplayString(e)+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.144"))||"天"),9,_hoisted_3)})),128))])),_:1})):createCommentVNode("v-if",!0),unref(isDose)?(openBlock(),createBlock(unref(NSpace),{key:1,class:"right-dose","wrap-item":!1},{default:withCtx((()=>[createElementVNode("div",_hoisted_4,[(openBlock(!0),createElementBlock(Fragment,null,renderList(doses.value,(e=>(openBlock(),createElementBlock("span",{class:"btn",key:e,onClick:t=>updateFraction(e)},"1/"+toDisplayString(e),9,_hoisted_5)))),128))]),createVNode(unref(NSpace),{justify:"center",vertical:"","wrap-item":!1},{default:withCtx((()=>{var e;return[createElementVNode("div",_hoisted_6,[createVNode(InputNumber,{integer:"",modelValue:integerValue.value,"onUpdate:modelValue":t[4]||(t[4]=e=>integerValue.value=e)},null,8,["modelValue"]),createElementVNode("div",_hoisted_7,[createVNode(InputNumber,{integer:"",modelValue:numeratorValue.value,"onUpdate:modelValue":t[5]||(t[5]=e=>numeratorValue.value=e),status:numeratorValueStatus.value,"onUpdate:status":t[6]||(t[6]=e=>numeratorValueStatus.value=e)},null,8,["modelValue","status"]),_hoisted_8,createVNode(InputNumber,{integer:"",modelValue:denominatorValue.value,"onUpdate:modelValue":t[7]||(t[7]=e=>denominatorValue.value=e),status:denominatorValueStatus.value,"onUpdate:status":t[8]||(t[8]=e=>denominatorValueStatus.value=e)},null,8,["modelValue","status"])])]),createElementVNode("span",{class:"btn",onClick:calculateFraction},(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.145"))||"分子式剂量")]})),_:1})])),_:1})):createCommentVNode("v-if",!0)],38))}});export{_sfc_main as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,reactive as a,computed as t,onMounted as n,openBlock as s,createElementBlock as o,createElementVNode as
|
1
|
+
import{defineComponent as e,reactive as a,computed as t,onMounted as n,openBlock as s,createElementBlock as o,createElementVNode as l,createVNode as r,unref as i,withCtx as c,createTextVNode as d,toDisplayString as p,Fragment as m,renderList as u,createCommentVNode as g}from"vue";import{useMessage as v,NInput as q,NButton as L}from"naive-ui";const h={class:"c-map"},y={class:"search-container"},f={class:"map-input-search"},k={class:"input-addon"},w=l("div",{id:"map-core"},null,-1),_={key:0,class:"address-list"},S=["onClick"],P={class:"title"};var C=e({__name:"Map",props:{locationProp:{type:String,default:""},ak:{type:String,default:"KP3BZ-OAC3W-PY6RY-OJ6DV-JYKN3-H6F72"}},emits:["selectLocation"],setup(e,{emit:C}){const O=e,T=a({qq:null,searchKey:"",centrePoint:{},location:{lng:"",lat:""},localObj:{},map:null,ac:null,addressList:[],markers:[],timeout:null,searchService:null,geocoder:{}}),M=t((()=>{var e,a;return null==(a=null==(e=T.addressList)?void 0:e[0])?void 0:a.name})),B=t((()=>O.locationProp&&JSON.parse(O.locationProp)||null)),I=v(),E=e=>{if(e&&"geolocation"==e.module){T.location.lng=e.lng,T.location.lat=e.lat;const a=new T.qq.maps.LatLng(e.lat,e.lng);x({latLng:a}),K({lat:e.lat,lng:e.lng})}else console.log("用户不允许获取地理位置"),T.location.lng=113.275,T.location.lat=23.117},K=e=>{const a=T.qq;var t=new a.maps.LatLng(e.lat,e.lng);T.centrePoint=t,T.map.panTo(t);const n=new a.maps.Marker({position:t,map:T.map});T.markers.push(n)},N=e=>{for(var a;a=e.pop();)a.setMap(null)},b=()=>{T.markers&&T.markers.length&&N(T.markers),T.markers=[]},x=(e={})=>{const a=T.qq,t=e.latLng,n=new a.maps.Geocoder;n.setComplete((e=>{if("GEO_INFO"===e.type){var t=new a.maps.LatLngBounds,n=e.detail.nearPois||[];b(),T.addressList=n||[];for(let e=0;e<n.length;e++){const o=n[e];var s=new a.maps.Marker({map:T.map});s.setPosition(o.latLng),s.setTitle(e+1),T.markers.push(s),t.extend(o.latLng)}T.map.fitBounds(t)}var o=e.detail.location||{};K(o)})),n.setError((function(){alert("出错了,请输入正确的经纬度!!!")})),n.getAddress(t)},A=()=>{let e=T.searchKey;e&&(T.markers&&T.markers.length&&N(T.markers),T.searchService.setLocation(""),T.searchService.setPageCapacity(50),T.searchService.search(e))},G=(e,a)=>{const t=T.qq,{name:n,address:s,latLng:o}=e,{lat:l,lng:r}=o,i=new t.maps.Geocoder;i.setComplete((function(e){if("GEO_INFO"===e.type){const{addressComponents:{province:a,city:t,district:o,country:i}}=e.detail,c=JSON.stringify({name:n,address:s,province:a,city:t,district:o,country:i,lat:l,lng:r});C("selectLocation",{locationProp:c,isInit:!1})}})),i.setError((function(){alert("出错了,请输入正确的经纬度!!!")})),i.getAddress(o)},J=e=>{var a={zoom:12,center:new e.maps.LatLng(39.916527,116.397128),mapTypeId:e.maps.MapTypeId.ROADMAP};T.map=new e.maps.Map(document.getElementById("map-core"),a);const{lat:t,lng:n,address:s}=B.value||{};if(t&&n){const a=new e.maps.LatLng(t,n);x({latLng:a})}else s?setTimeout((()=>{A()}),300):new T.qq.maps.Geolocation(O.ak,"qqmap").getLocation(E,(function(e){console.log(e)}),{timeout:9e3});T.qq.maps.event.addDomListener(T.map,"click",(function(e){x({latLng:e.latLng})}))},Y=e=>{T.qq=e,setTimeout((()=>{J(e),(()=>{const e=T.qq;T.searchService=new e.maps.SearchService({complete:function(a){var t,n,s=a.detail.pois||[],o=new e.maps.LatLngBounds;if("CITY_LIST"===a.type)return T.searchService.setLocation(a.detail.cities[0].cityName),void T.searchService.search(T.searchKey);if(T.addressList=s||[],b(),"POI_LIST"===a.type)for(var l=0,r=s.length;l<r;l++){var i=s[l];o.extend(i.latLng),t=l,n=void 0,(n=new e.maps.Marker({map:T.map})).setPosition(s[t].latLng),n.setTitle(l+1),T.markers.push(n)}T.map.fitBounds(o)},error:function(e){console.log(e),"NO_RESULTS"!==e?I.warning("地址检索先输入城市名称"):I.warning("查无结果!")},autoExtend:!0})})()}),0)},j=()=>{(()=>{var e,a;let t=window;if(t.qq)return t.qq._preloader?t.qq._preloader:Promise.resolve(t.qq);{const n=O.ak||(null==(a=null==(e=t._qq)?void 0:e.call(t))?void 0:a.ak);return t.qq={},t.qq._preloader=new Promise((e=>{t._initBaiduMap=function(){e(t.qq),t.document.body.removeChild(a),t.qq._preloader=null,t._initBaiduMap=null};const a=document.createElement("script");window.document.body.appendChild(a),a.src=`https://map.qq.com/api/js?v=2.exp&key=${n}&callback=_initBaiduMap`;const s=document.createElement("script");window.document.body.appendChild(s),s.src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"})),t.qq._preloader}})().then(Y)};return n((()=>{setTimeout((()=>{j()}),200)})),(e,a)=>(s(),o("div",h,[l("div",y,[l("div",f,[r(i(q),{value:T.searchKey,"onUpdate:value":a[0]||(a[0]=e=>T.searchKey=e),placeholder:"请输入地址","enter-button":"检索"},null,8,["value"]),l("span",k,[r(i(L),{type:"primary",size:"small",onClick:A},{default:c((()=>[d("检索")])),_:1})])])]),w,T.addressList&&T.addressList.length?(s(),o("ul",_,[l("li",null,[d(" 地址:"+p(i(M))+" ",1),r(i(L),{type:"primary",size:"small",onClick:a[1]||(a[1]=e=>G(T.addressList[0]))},{default:c((()=>{var e;return[d((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})]),(s(!0),o(m,null,u(T.addressList,((e,a)=>(s(),o("li",{class:"address-item",key:a},[l("div",{onClick:a=>G(e)},[l("div",P,p(e.name),1),l("span",null,p(e.address),1)],8,S)])))),128))])):g("v-if",!0)]))}});export{C as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as a,watch as t,nextTick as n,onBeforeUnmount as c,openBlock as i,createElementBlock as r,createElementVNode as s,createVNode as l,unref as o,withCtx as u,createTextVNode as v}from"vue";import{fabric as
|
1
|
+
import{defineComponent as e,ref as a,watch as t,nextTick as n,onBeforeUnmount as c,openBlock as i,createElementBlock as r,createElementVNode as s,createVNode as l,unref as o,withCtx as u,createTextVNode as v}from"vue";import{fabric as d}from"../../../shared/utils/fabricjs/index.js";import{NButton as p}from"naive-ui";import{isString as f}from"lodash-es";const h={class:"c-picture-clipper"},m={class:"canvas-right"},g={key:0,class:"preview-border"},w=["src"],y={class:"btns"};var C=e({__name:"PictureClipper",props:{source:{type:[String,File]}},emits:["save"],setup(e,{emit:C}){const P=e,b=500,k={x:250,y:270},R={originX:"center",originY:"center",left:k.x,top:k.y},_=a(null),L=a(),j={canvas:null,img:null,clipPath:null};function S(){var e;if(!j.canvas)return;const{width:a=0,height:t=0,left:n=0,top:c=0,scaleX:i=1,scaleY:r=1}=j.clipPath,s=a*i,l=t*r;L.value=null==(e=j.canvas)?void 0:e.toDataURL({left:n-s/2,top:c-l/2,width:s,height:l})}function U(){j.canvas&&C("save",L.value)}function x(e){var a;j.canvas&&(null==(a=j.clipPath)||a.setCoords().set({...R,...e,scaleX:1,scaleY:1}),F(),L.value="")}function F(){const{canvas:e,clipPath:a}=j;e&&a&&(j.canvas.discardActiveObject(),j.clipPath.bringToFront(),j.canvas.setActiveObject(j.clipPath))}return t((()=>P.source),(async e=>{e&&(await n(),async function(){const{minLength:e,sourceScale:a,sourceUrl:t}=await function(){return new Promise(((a,t)=>{if(f(P.source))e(P.source).then((e=>a(e)));else if(Object.prototype.toString.call(P.source).includes("File")){const t=new FileReader;t.onload=n=>{e(t.result).then((e=>a(e)))},t.readAsDataURL(P.source)}}));function e(e){return new Promise(((a,t)=>{const n=d.util.createImage();n.src=e,n.onload=t=>{const{width:c,height:i}=n;a({sourceScale:c>=i?b/c:b/i,minLength:Math.min(c,i),sourceUrl:e})}}))}}();j.canvas||(j.canvas=new d.Canvas(_.value,{width:b,height:b,backgroundColor:"#fff",selection:!1,containerClass:"c-picture-clipper__canvas",fireRightClick:!0}));j.img&&j.canvas.remove(j.img),d.Image.fromURL(t,(function(e){e.scale(a).set({...R,evented:!1,selectable:!1}),j.canvas.add(e),j.img=e,F()}));const n=e*a;j.clipPath?x({width:n,height:n}):(j.clipPath=new d.Rect({...R,width:n,height:n,fill:"transparent",lockRotation:!0,borderColor:"#5585f5",cornerColor:"#5585f5",cornerSize:10,transparentCorners:!1}),j.canvas.add(j.clipPath),F(),j.canvas.on("mouse:down",(e=>{F()})))}())}),{immediate:!0}),c((()=>{var e,a;null==(e=j.canvas)||e.off(),null==(a=j.canvas)||a.clear()})),(e,a)=>(i(),r("div",h,[s("canvas",{ref_key:"canvasRef",ref:_},null,512),s("div",m,[L.value?(i(),r("img",{key:1,src:L.value,alt:""},null,8,w)):(i(),r("span",g)),s("div",y,[l(o(p),{onClick:a[0]||(a[0]=()=>x())},{default:u((()=>[v("撤销")])),_:1}),l(o(p),{type:"primary",onClick:S},{default:u((()=>[v("预览")])),_:1}),l(o(p),{type:"primary",onClick:U},{default:u((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1})])])]))}});export{C as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as l,provide as a,computed as t,watch as i,onMounted as n,openBlock as r,createElementBlock as u,createElementVNode as
|
1
|
+
import{defineComponent as e,ref as l,provide as a,computed as t,watch as i,onMounted as n,openBlock as r,createElementBlock as u,createElementVNode as o,Fragment as s,renderList as c,unref as d,normalizeClass as f,createCommentVNode as v,createVNode as m,withCtx as p,createTextVNode as g,toDisplayString as h,createBlock as k,withDirectives as b,vShow as y,isRef as C}from"vue";import{useMessage as w,NPopover as _,NModal as A,NCard as S,NIcon as x,NButton as F,NForm as q,NFormItem as N,NInput as j}from"naive-ui";import{CloseOutline as I,AddOutline as E}from"@vicons/ionicons5";import L from"../../table-filter/src/hooks/useMixins.js";import R from"../../table-filter/src/hooks/useRenderWidget.js";import U from"../../table-filter/src/hooks/useAdvanced.js";import B from"../../table-filter/src/components/render-widget/index.vue.js";import{WidgetTypeEnums as T}from"../../table-filter/src/types/enums.js";import"moment/locale/zh-cn";import{cloneDeep as D}from"lodash-es";import{InjectionFilterApiConfig as O,InjectionFilterSearchConfig as P}from"../../table-filter/src/constants/index.js";const V={class:"quick-search-block quick-search-table"},z={class:"quick-row"},M={class:"quick-item-title"},Q={class:"quick-item-col"},W={class:"svg-wrap"},G={class:"flex_right"},J={class:"class-filter-content"},Y={class:"quickSearch-content"},H=o("span",{class:"label"},"父类名称:",-1),K=["onDblclick","onClick"],X={class:"s-content"};var Z=e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},quickSearchConfig:{type:Array,default:()=>[]},tableId:{type:String,default:""},selectCriticalNum:{type:Number,default:10},filterApiConfig:{type:Object}},emits:["getFilterParam","onFilterSearch","clearQuickSearchConfig"],setup(e,{expose:Z,emit:$}){const ee=e,le={classname:{required:!0,message:"请输入分类名称",trigger:["input","blur"]}},ae=w(),{handleGetConfigApi:te,outQuickSearchFn:ie}=L(),{getRenderSearchConObj:ne,resetRenderWidgetValue:re,isRender:ue}=R(),{transformData:oe,getCacheDef:se,transformParams:ce}=U(),de=l(null),fe=l({classname:""});let ve=l(!1),me=l([]),pe=l([]),ge=l(!1),he=l("");const ke=l(),be=l(),ye=l([]);a(O,ee.filterApiConfig),a(P,me);let Ce=t((()=>!!pe.value.length&&pe.value.some((e=>e.isAdd)))),we=t((()=>(e,l="name")=>e.alias||e[l]));function _e(){return function(e){if(!Array.isArray(e))return[];let l=[];for(let a=0;a<e.length;a++){let t=e[a];const i=ne(t);!l.find((e=>e.field_key===i.field_key))&&i&&l.push(i)}return l.filter((e=>e.value))}(me.value)||[]}function Ae(){var e;null==(e=de.value)||e.validate((e=>{var l;if(e)return;let a=_e();a.length||(a=[]);let t=null==(l=pe.value.filter((e=>e.selected))[0])?void 0:l.value;!async function(e){var l;try{if(!await te(e,"requestSaveTableCondiTion",{},ee.filterApiConfig))return;ve.value=!1,null==(l=de.value)||l.restoreValidation(),fe.value.classname="",pe.value=[],Ne()}catch(e){console.log(e)}}({tableId:ee.tableId||"",setting:JSON.stringify({displayCategory:t,name:fe.value.classname,conObj:a.map((e=>(e.unit&&(e.value=[]),e.widgetType===T.SELECTDYNAMIC&&(e.dynamicBaseList=e.value.map((e=>e.includes("&")?{label:e.split("&")[0],value:e.split("&")[1]}:{label:e,value:e})),e.value=e.value.map((e=>e.includes("&")?e.split("&")[1]:e))),e)))}),conditionList:"[]"})}))}function Se(e){setTimeout((()=>{be.value&&be.value.focus()}),100),ge.value=!0}function xe(){ge.value=!1,he.value&&(pe.value.forEach((e=>e.selected=!1)),pe.value.push({disabled:!0,value:he.value,selected:!0,isAdd:!0}),he.value="")}function Fe(e){!function(e){pe.value.splice(e,1)}(e)}function qe(){ve.value=!1}function Ne(){je(me.value),$("clearQuickSearchConfig")}function je(e){Array.isArray(e)&&(e.forEach((e=>{re(e)})),ie.handlerInitSearchItem(me.value))}return i((()=>ee.searchFieldList),(e=>{e&&e.length>0&&function(){let e=D(oe(ee.searchFieldList,{_filterApiConfig:ee.filterApiConfig,_selectCriticalNum:ee.selectCriticalNum})).filter((e=>1==e.isShowSearch&&1!=e.filterExplicit))||[];me.value=e||[],ie.handlerInitSearchItem(me.value)}()}),{immediate:!0,deep:!0}),i((()=>me),(()=>{const e=_e()||[],l=ce(e);$("getFilterParam",e,l),ye.value.forEach((e=>e(l)))}),{deep:!0}),n((()=>{const e=ee.quickSearchConfig;if(e&&e.length>0)return l=e,void me.value.forEach((e=>{var a,t;if(ue(e)){const i=l.find((l=>l.field_key===e.columnName));i&&(null==(a=i.value)?void 0:a.length)>0&&(e.value=se(e,i.value),e.unit=null!=(t=i.unit)?t:"")}}));var l;je(me.value)})),Z({openSaveToCalss:function(){let e=_e();e&&(e.length>0?ve.value=!0:ae.warning("请设置搜索条件"))},clearData:Ne,onFilterSearch:function(){let e=_e()||[];const l=ce(e);return $("onFilterSearch",e,l,!1),me.value},getFilterParams:function(){const e=_e()||[];return ce(e)},setFilterParams:function(e){const l=e?Object.keys(e):[];l.length>0&&me.value.forEach((a=>{var t;if(ue(a)&&l.includes(a.columnName)){const l=e[a.columnName];a.value=Array.isArray(l)&&!1===(null==(t=a.widgetCfg)?void 0:t.multiple)?l[0]:l}}))},getOriginalConfig:function(){return ee.searchFieldList},onFilterChange:function(e){ye.value.push(e)}}),(e,l)=>{var a;return r(),u("div",null,[o("div",V,[(r(!0),u(s,null,c(d(me),(e=>(r(),u("div",{class:f(["quick-item",{"quick-block":e._isBlock}]),key:e.sid||e.columnName},[o("div",z,[v(" title "),o("div",M,[m(d(_),{trigger:"hover"},{trigger:p((()=>[g(h(d(we)(e,"title")),1)])),default:p((()=>[o("span",null,h(d(we)(e,"title")),1)])),_:2},1024)]),v(" content "),o("div",Q,[v(" 直接渲染组件 "),e.isRender?(r(),k(B,{key:0,cfg:e,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,unit:e.unit,"onUpdate:unit":l=>e.unit=l},null,8,["cfg","modelValue","onUpdate:modelValue","unit","onUpdate:unit"])):v("v-if",!0)])])],2)))),128))]),v(" 保存到分类的弹窗 "),m(d(A),{show:d(ve),maskClosable:!1,"positive-text":"确认","negative-text":(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.28"))||"取消",onPositiveClick:Ae,onNegativeClick:qe,class:"classification-modal-block"},{default:p((()=>[m(d(S),{title:"设置筛选分类",style:{width:"520px"},bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":p((()=>[o("div",W,[m(d(x),{component:d(I),size:"24",onClick:qe},null,8,["component"])])])),footer:p((()=>[o("div",G,[m(d(F),{onClick:qe},{default:p((()=>{var e;return[g((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),m(d(F),{type:"info",onClick:Ae},{default:p((()=>[g("确认")])),_:1})])])),default:p((()=>[o("div",J,[m(d(q),{ref_key:"formRef",ref:de,"label-placement":"left",rules:le,model:fe.value},{default:p((()=>[m(d(N),{label:"筛选集名称",path:"classname"},{default:p((()=>[m(d(j),{value:fe.value.classname,"onUpdate:value":l[0]||(l[0]=e=>fe.value.classname=e),placeholder:"请输入分类名称",clearable:""},null,8,["value"])])),_:1})])),_:1},8,["model"]),o("div",Y,[H,(r(!0),u(s,null,c(d(pe),((e,l)=>(r(),u("div",{class:"parent-name",key:l,onDblclick:l=>function(e){e.disabled=!1,setTimeout((()=>{ke.value.length>0&&ke.value[0].focus()}),100)}(e),onClick:a=>function(e,l){e.disabled&&(pe.value.forEach(((e,a)=>{a!==l&&(e.selected=!1)})),e.selected=!e.selected)}(e,l)},[e.disabled?(r(),u("div",{key:0,class:f(["edit-tag",{"edit-tag-select":e.selected&&e.disabled}])},[o("div",X,h(e.value),1),m(d(x),{component:d(I),class:"anticon-close",size:"20",onClick:e=>Fe(l)},null,8,["component","onClick"])],2)):(r(),k(d(j),{key:1,ref_for:!0,ref_key:"parentInputRef",ref:ke,class:"parent-input",style:{width:"100px"},value:e.value,"onUpdate:value":l=>e.value=l,disabled:e.disabled,onBlur:()=>e.disabled=!0,maxlength:20},null,8,["value","onUpdate:value","disabled","onBlur"]))],40,K)))),128)),d(Ce)?v("v-if",!0):(r(),u(s,{key:0},[b(m(d(F),{dashed:"",icon:"plus",class:"ant-btn",onClick:Se},{default:p((()=>[m(d(x),{component:d(E),size:"20"},null,8,["component"]),g("添加分类 ")])),_:1},512),[[y,!d(ge)]]),b(m(d(j),{ref_key:"parentInputAddRef",ref:be,class:"parent-input",style:{width:"100px"},value:d(he),"onUpdate:value":l[1]||(l[1]=e=>C(he)?he.value=e:he=e),valueModifiers:{trim:!0},onBlur:xe,maxlength:20},null,8,["value"]),[[y,d(ge)]])],64))])])])),_:1})])),_:1},8,["show"])])}}});export{Z as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as a,computed as t,openBlock as l,createElementBlock as o,createVNode as n,unref as r,mergeProps as u,isRef as i,withCtx as
|
1
|
+
import{defineComponent as e,ref as a,computed as t,openBlock as l,createElementBlock as o,createVNode as n,unref as r,mergeProps as u,isRef as i,withCtx as c,createElementVNode as s,normalizeProps as v,guardReactiveProps as p,Fragment as d,renderList as m,normalizeClass as y,toDisplayString as f,createBlock as h,createCommentVNode as K,renderSlot as _}from"vue";import{jsonParse as g}from"../../../../shared/utils/index.js";import{Checkmark as S}from"@vicons/ionicons5";import{useVModel as b,useVirtualList as w}from"@vueuse/core";import{isObject as k}from"lodash-es";import M from"./BaseSearch.js";import{NIcon as C}from"naive-ui";var L;const j={class:"recommend-search"},x=["onClick"],P=["title"],A=s("section",{class:"recommend-search__empty"},"暂无数据",-1);var O=e({__name:"RecommendSelect",props:{value:{type:[String,Number]},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},placeholder:{type:String,default:(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.147"))||"请选择"},editPlaceholder:{type:String,default:"请输入关键字进行搜索"},options:{type:Array,default:()=>[]},commonList:{type:Array,default:()=>[]},recentList:{type:Array,default:()=>[]}},emits:["update:value","search","delete","choose","clear","openMenu","closeMenu"],setup(e,{emit:L}){const O=e,B=a(!1),R=t((()=>B.value?O.editPlaceholder:O.placeholder)),U=a();function $(e){return g(e.itemObj)}const H=t((()=>O.commonList.map($))),N=t((()=>O.recentList.map($))),T=t((()=>O.options.filter((e=>{return H.value.every(a)&&N.value.every(a);function a(a){return a[O.valueKey]!==e[O.valueKey]}}))));function q(e){let a="";return[...E.value,U.value].find((t=>{if(k(t)&&t[O.valueKey]===e)return a=t[O.labelKey],!0})),a}const z=a(),D=b(O,"value",L),E=t((()=>[...H.value,...N.value,...T.value]));function F(e=""){L("search",e)}function G(){F(),L("openMenu")}function I(){L("closeMenu")}function J(){D.value=null,L("clear")}function Q(e){var a,t;k(e)&&(D.value=e[O.valueKey],null==(a=z.value)||a.closeMenu(),U.value=e,t=e[O.valueKey],L("choose",{value:t,option:{...U.value}}))}const{list:V,wrapperProps:W,containerProps:X}=w(E,{itemHeight:32,overscan:5});return(a,t)=>(l(),o("section",j,[n(r(M),u({ref_key:"baseSearchRef",ref:z,value:r(D),"onUpdate:value":t[0]||(t[0]=e=>i(D)?D.value=e:null),show:B.value,"onUpdate:show":t[1]||(t[1]=e=>B.value=e),"display-value":q(r(D)),placeholder:r(R),onOpenMenu:G,onCloseMenu:I,onSearch:F,onClear:J},a.$attrs),{menu:c((()=>[r(E).length?(l(),o("section",u({key:0,class:"recommend-search__optionContainer",style:{height:"256px"}},r(X)),[s("section",v(p(r(W))),[(l(!0),o(d,null,m(r(V),(a=>(l(),o("div",{onClick:e=>Q(a.data),key:a.data[e.valueKey],class:y(["recommend-search__option",{"is-active":a.data[e.valueKey]===r(D)}])},[s("div",{class:"recommend-search__optionText",title:a.data.itemObj},f(a.data[e.labelKey]),9,P),a.data[e.valueKey]===r(D)?(l(),h(r(C),{key:0,component:r(S)},null,8,["component"])):K("v-if",!0)],10,x)))),128))],16)],16)):_(a.$slots,"empty",{key:1},(()=>[A]))])),_:3},16,["value","show","display-value","placeholder"])]))}});export{O as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,reactive as o,ref as t,watch as a,nextTick as n,openBlock as s,createElementBlock as i,normalizeClass as l,unref as r,createCommentVNode as m,Fragment as c,createBlock as u,mergeProps as d,createElementVNode as p,normalizeStyle as
|
1
|
+
import{defineComponent as e,reactive as o,ref as t,watch as a,nextTick as n,openBlock as s,createElementBlock as i,normalizeClass as l,unref as r,createCommentVNode as m,Fragment as c,createBlock as u,mergeProps as d,createElementVNode as p,normalizeStyle as v,createVNode as f,withCtx as g,renderList as h,toDisplayString as w,createTextVNode as y,resolveDynamicComponent as k,renderSlot as S}from"vue";import C from"./hooks/use-noData.js";import{ScaleViewProps as b}from"./hooks/scaleview-props.js";import{getScaleViewState as D}from"./hooks/scaleview-state.js";import{ScaleViewComputed as E}from"./hooks/scaleview-computed.js";import{ScaleViewInit as j}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as _}from"./hooks/scaleview-submit.js";import{ScaleViewMethods as x}from"./hooks/scaleview-methods.js";import{handleQueryParams as F,isCollection as P}from"./utils/judge-types.js";import{useEvent as q}from"./hooks/use-event.js";import"xe-utils";import"moment";import L from"../../../shared/utils/vexutilsExpand.js";import N from"./components/NoData.vue.js";import R from"./components/EvaluateCountdown.vue.js";import A from"./components/EvaluatePage.vue.js";import M from"./components/AnswerParse.vue.js";import O from"./components/ScaleScore.js";import T from"./components/DescribeContent.vue.js";import{NForm as V,NFormItem as B,NButton as I}from"naive-ui";const J=["innerHTML"],G={key:0,class:"required-text"},W={key:1,class:"evalute-label"},H=["onClick"],Q=p("i",{class:"scale-view-iconfont icon-scale-view-dengpao"},null,-1),$={key:1,class:"footer"};var z=e({__name:"ScaleView",props:b,emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:b,emit:z}){const K=e,{ScaleViewState:U}=D(),X=o(U),Y=t(null),Z=t(null),ee=t(null),{noDataState:oe,setNoData:te,resetNodata:ae}=C(),ne=F(),{showEvatip:se,isFormBoldOpen:ie,scaleStyle:le,handlePageClass:re,isShowItem:me,handleShowQuestionNumber:ce,hasScore:ue,isPreviewScale:de,showEvaluateEntry:pe,showEvaluateCoundownPage:ve,showScaleFooter:fe,isCancelBtn:ge,isSaveBtn:he,showEvaluateLabel:we,showAnswerParse:ye,propsConfig:ke,evaluatePageProps:Se,evaluateCountdownProps:Ce,isEvaluetaResSituation:be,disableEdit:De,desStart:Ee,desEnd:je,desContent:_e}=E(K,X,{query:ne,scaleViewDom:Y}),{initForm:xe}=j(K,X,z,{query:ne}),{submitMethod:Fe,onSubmitData:Pe,onSubmitForm:qe,handleScoreJson:Le}=_(K,X,z,{query:ne,formRef:ee,countdownDom:Z}),{nextLogicEvent:Ne,handleDynamicDataRelation:Re}=q(K,X),{scaleChange:Ae,labelChange:Me,vodFileList:Oe,writeGuage:Te,closeEvaluateCountdown:Ve,showEvaTipModal:Be}=x(K,X,z,{nextLogicEvent:Ne,handleDynamicDataRelation:Re,isPreviewScale:de,submitMethod:Fe,isEvaluetaResSituation:be,handleScoreJson:Le,disableEdit:De});(()=>{let{id:e}=ne;e&&(X.shareId=e)})();const Ie=e=>{try{ae(),xe(e)}catch(e){console.log(e,"--error"),X.spinning=!1,X.hasFrontAddress=!1,te(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};a((()=>K.ids),((e,o)=>{o?e.guage_id&&e.guage_id!=o.guage_id&&Ie(e):e.guage_id&&Ie(e)}),{immediate:!0}),a((()=>K.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;X.form={},X.formArray=[];const o=JSON.parse(JSON.stringify(e));n((()=>{xe(o)}))}),{immediate:!0});const Je=L.debounce(Pe,300),Ge=()=>{z("onCloseSetting")};return b({getScaleData:()=>({...X}),onSubmitForm:qe,cancel:Ge}),(e,o)=>(s(),i("div",{class:l(["c-scale-view-block",{"c-scale-view-block-hasfooter":r(fe)}]),ref_key:"scaleViewDom",ref:Y},[m(' <template v-if="state.spinning">\n <n-spin :show="state.spinning" description="加载中"></n-spin>\n </template> '),X.spinning||X.hasFrontAddress?m("v-if",!0):(s(),i(c,{key:0},[r(oe).noData?(s(),u(N,{key:0,noDataImg:r(oe).noDataImg,noDataTip:r(oe).noDataTip},null,8,["noDataImg","noDataTip"])):(s(),i(c,{key:1},[r(pe)?(s(),u(A,d({key:0},r(Se),{onWriteGuage:r(Te)}),null,16,["onWriteGuage"])):(s(),i(c,{key:1},[r(ve)?(s(),u(R,d({key:0,ref_key:"countdownDom",ref:Z},r(Ce),{onCloseEvaluateCountdown:r(Ve)}),null,16,["onCloseEvaluateCountdown"])):m("v-if",!0),p("div",{class:l(["scale-container",{"scale-container-nopadding":r(re),"scale-container-hasfooter":r(fe)}]),style:v(r(le))},[r(ue)?(s(),u(r(O),{key:0,config:X.config,maxScore:X.maxScore},null,8,["config","maxScore"])):m("v-if",!0),r(Ee)?(s(),u(T,{key:1,content:r(_e)},null,8,["content"])):m("v-if",!0),f(r(V),{ref_key:"formRef",ref:ee,model:X.form,rules:X.rules,"require-mark-placement":"left",class:"main"},{default:g((()=>[(s(!0),i(c,null,h(X.formArray,((e,o)=>(s(),i(c,{key:(e.id||e.seq)+o},[r(me)(e)?(s(),u(r(B),{key:0,path:e.val_key,"show-label":!r(P)(e.type),class:"c-scle-form-item"},{label:g((()=>[p("span",{class:l({"scale-label-required":r(ie)(e)}),innerHTML:r(ce)(e)},null,10,J),r(ie)(e)?(s(),i("span",G,"(必填)")):m("v-if",!0),r(we)(e)?(s(),i("span",W,w(r(we)(e)),1)):m("v-if",!0),r(se)(e)?(s(),i("span",{key:2,class:"evalute-tip",onClick:o=>r(Be)(e)},[Q,y(" 查看提示 ")],8,H)):m("v-if",!0)])),default:g((()=>[(s(),u(k(e.renderCom),d(r(ke)(e,o),{key:(e.id||e.seq)+o,onScaleChange:r(Ae),onOnChange:o=>r(Me)(o,e),onVodFileList:r(Oe)}),null,16,["onScaleChange","onOnChange","onVodFileList"])),r(ye)(e)?(s(),u(M,{key:0,item:e},null,8,["item"])):m("v-if",!0)])),_:2},1032,["path","show-label"])):m("v-if",!0)],64)))),128))])),_:1},8,["model","rules"]),r(je)?(s(),u(T,{key:2,content:r(_e)},null,8,["content"])):m("v-if",!0)],6),r(fe)?(s(),i("div",$,[m(" 分享的链接 隐藏取消按钮 "),r(ge)?(s(),u(r(I),{key:0,onClick:Ge},{default:g((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1})):m("v-if",!0),r(he)?(s(),u(r(I),{key:1,onClick:r(Je),disabled:X.banSubmit,type:"primary"},{default:g((()=>[y(" 保存 ")])),_:1},8,["onClick","disabled"])):m("v-if",!0),S(e.$slots,"extendBtn")])):m("v-if",!0)],64))],64))],64))],2))}});export{z as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,reactive as t,createVNode as a,resolveComponent as n}from"vue";import{NCascader as r,NEmpty as l}from"naive-ui";import i from"../LoadingCom.vue.js";var c=e({name:"RCascader",components:{NCascader:r,NEmpty:l,LoadingCom:i},props:{form:{type:Object,default:()=>{}},item:{type:Object,default:()=>{}},isLock:{type:Boolean,default:!1},getCascadeOptions:{type:Function,default:()=>Promise.resolve([])}},emits:["scaleChange"],setup(e,r){let c=t({cascaderValue:void 0,curOptions:[],fetching:!1});const
|
1
|
+
import{defineComponent as e,reactive as t,createVNode as a,resolveComponent as n}from"vue";import{NCascader as r,NEmpty as l}from"naive-ui";import i from"../LoadingCom.vue.js";var c=e({name:"RCascader",components:{NCascader:r,NEmpty:l,LoadingCom:i},props:{form:{type:Object,default:()=>{}},item:{type:Object,default:()=>{}},isLock:{type:Boolean,default:!1},getCascadeOptions:{type:Function,default:()=>Promise.resolve([])}},emits:["scaleChange"],setup(e,r){let c=t({cascaderValue:void 0,curOptions:[],fetching:!1});const o=(e,t)=>{if(!e.length||!t||!t.length)return;let a=0,n=t.length;t[0];let r,l=e;for(;a<n;a++){let e=t[a];if(!l.length)return!1;if(r=l.find((t=>t.value===e)),0===a&&!r)return!1;if(a===n-1&&!r)return!1;if(a===n-1&&r)break;l=r.children||[]}r&&(c.cascaderValue=r.theUniqueKey)},u=(e,t)=>e.map(((e,a)=>{var n;e.curIndex=a+1;let r=e.level||0;return e.path=`${e.curIndex}`,r&&t&&(e.path=`${t.path}-${e.curIndex}`),e.theUniqueKey=e.path,e.hasOwnProperty("children")&&!e.children.length&&delete e.children,(null==(n=e.children)?void 0:n.length)&&u(e.children,e),e}));(async t=>{var a;if(!t||!Object.keys(t).length)return;let n=JSON.parse(JSON.stringify(t)),r=e.form[e.item.val_key],l=[];if(!(null==(a=n.targetSource)?void 0:a.target_id))return l=u(n.options||[]),c.curOptions=l,void o(l,r);try{c.fetching=!0,l=await e.getCascadeOptions(n),c.curOptions=l,o(l,r),c.fetching=!1}catch(e){c.fetching=!1}})(e.item);const d=(t,a,n)=>{let l=n.map((e=>e.value));c.cascaderValue=t,r.emit("scaleChange",l,e.item)};return()=>{var t;return a(n("n-cascader"),{value:c.cascaderValue,"onUpdate:value":e=>c.cascaderValue=e,filterable:!0,clearable:!0,placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.147"))||"请选择","check-strategy":"parent","value-field":"theUniqueKey",disabled:e.isLock,options:c.curOptions,"show-path":!0,cascade:!1,"on-update:value":d},{empty:()=>c.fetching?a(i,null,null):a(l,null,null)})}}});export{c as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as o,reactive as e,createVNode as
|
1
|
+
import{defineComponent as o,reactive as e,createVNode as a,resolveComponent as t}from"vue";import{NModal as i,NInput as n,NIcon as p}from"naive-ui";import"xe-utils";import"moment";import l from"../../../../../shared/utils/vexutilsExpand.js";import{AlertCircleOutline as s}from"@vicons/ionicons5";import r from"../../../../map/index.js";var m=o({name:"RMap",components:{NModal:i,NInput:n,NIcon:p,CMap:r},props:{form:{type:Object,default:()=>({})},item:{type:Object,default:()=>({})},isLock:{type:Boolean,default:!1},locationProp:{type:String,default:""},ak:{type:String,default:"KP3BZ-OAC3W-PY6RY-OJ6DV-JYKN3-H6F72"}},emits:["scaleChange"],setup(o,i){const n=o.form[o.item.val_key],p=e({mapVisible:!1,mapLocation:""}),m=o=>{if(l.isJSON(o)){const e=JSON.parse(o);return e.address||e.name}return""};p.mapLocation=m(n);const c=e=>{const{locationProp:a,isInit:t}=e;p.mapLocation=m(a),i.emit("scaleChange",a,o.item),p.mapVisible=!1},d=()=>{o.isLock||(p.mapVisible=!0)};return()=>{return a("div",{class:{"c-map-container":!o.isLock}},[a(t("n-input"),{value:p.mapLocation,readonly:!0,class:"map-input","on-click":d,placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.147"))||"请选择"},{prefix:()=>a(t("n-icon"),{size:"18",component:s},null)}),a(t("n-modal"),{class:"c-scale-map-modal",show:p.mapVisible,"onUpdate:show":o=>p.mapVisible=o,preset:"card",style:{width:"800px",height:"80vh"}},{default:()=>[a(r,{locationProp:o.locationProp,ak:o.ak,onSelectLocation:c},null)]})]);var e}}});export{m as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,reactive as t,computed as l,watch as a,createVNode as i,resolveComponent as o}from"vue";import{NSelect as n,NEmpty as u}from"naive-ui";import r from"../LoadingCom.vue.js";var s=e({name:"RSelect",components:{NSelect:n,NEmpty:u,LoadingCom:r},props:{form:{type:Object,default:()=>({})},item:{type:Object,default:()=>({})},isLock:{type:Boolean,default:!1},getSelectOptions:{type:Function,default:()=>Promise.resolve([])},getSearchOptions:{type:Function,default:()=>Promise.resolve([])},openType:{type:String,default:""}},emits:["scaleChange"],setup(e,n){const s=t({choiceValue:[],selectParams:{tableType:"TABLE_LIST",pageSize:20,page:1},cloneItem:{},columnName:"",showField:"",curOptions:[],fieldList:[],buttonList:[],fetching:!1,searchKeyword:""});e.openType;const c=l((()=>e.form[e.item.val_key])),v=l((()=>{var t,l;return!!(null==(l=null==(t=e.item)?void 0:t.setting)?void 0:l.isMultiple)})),
|
1
|
+
import{defineComponent as e,reactive as t,computed as l,watch as a,createVNode as i,resolveComponent as o}from"vue";import{NSelect as n,NEmpty as u}from"naive-ui";import r from"../LoadingCom.vue.js";var s=e({name:"RSelect",components:{NSelect:n,NEmpty:u,LoadingCom:r},props:{form:{type:Object,default:()=>({})},item:{type:Object,default:()=>({})},isLock:{type:Boolean,default:!1},getSelectOptions:{type:Function,default:()=>Promise.resolve([])},getSearchOptions:{type:Function,default:()=>Promise.resolve([])},openType:{type:String,default:""}},emits:["scaleChange"],setup(e,n){const s=t({choiceValue:[],selectParams:{tableType:"TABLE_LIST",pageSize:20,page:1},cloneItem:{},columnName:"",showField:"",curOptions:[],fieldList:[],buttonList:[],fetching:!1,searchKeyword:""});e.openType;const c=l((()=>e.form[e.item.val_key])),v=l((()=>{var t,l;return!!(null==(l=null==(t=e.item)?void 0:t.setting)?void 0:l.isMultiple)})),d=l((()=>{const{targetSource:t={},options:l=[],optionType:a}=e.item||{};return!(!t.target_id||!l.length&&3!=a)})),p=l((()=>{const{targetSource:t={}}=e.item||{};return!!t.target_id&&!d.value})),m=l((()=>{var t;const{target_id:l,values:a}=(null==(t=e.item)?void 0:t.targetSource)||{};return l&&a?d.value?a||"value":a:"value"})),g=l((()=>{var t;const{target_id:l,showField:a}=(null==(t=e.item)?void 0:t.targetSource)||{};return l&&a?d.value?a||"label":a:"label"})),h=async()=>{const{targetSource:t,type:l,options:a=[],optionType:i=1}=s.cloneItem;if(s.showField="label",null==t?void 0:t.target_id)if(d.value)s.curOptions=(e=>e&&e.length?e.map((e=>("cascadeData"in e&&Object.assign(e,{...e.cascadeData}),m.value in e||(e[m.value]=e.value||e.label),g.value in e||(e[g.value]=e.label),e))):[])(a);else try{s.fetching=!0,s.curOptions=await e.getSelectOptions(s.cloneItem),s.fetching=!1,s.columnName=null==t?void 0:t.values,s.showField=(null==t?void 0:t.showField)||(null==t?void 0:t.values)}catch(e){s.fetching=!1}},f=async t=>{if(p.value){s.searchKeyword=t;try{s.curOptions=await e.getSearchOptions({values:s.columnName,showField:s.showField,keyword:t},s.cloneItem)}catch(e){console.log(e)}}},y=async e=>{var t;if(!e||!p.value)return;if(!c.value&&s.searchKeyword)return void f();if(!c.value||!(null==(t=s.curOptions)?void 0:t.length))return;s.curOptions.find((e=>e[m.value]===c.value))||f(c.value)},O=t=>{const l={value:"",list:[]};let a;return t&&Array.isArray(t)?(l.value=t,t.length?(t.forEach((e=>{a=w(e),a&&l.list.push(a)})),void n.emit("scaleChange",l,e.item,l)):(l.list=[],void n.emit("scaleChange",l,e.item,l))):(l.value=t,a=w(t),a&&l.list.push(a),void n.emit("scaleChange",l,e.item,l))},w=e=>s.curOptions.find((t=>t.value===e));return a((()=>e.item),(e=>{e&&Object.keys(e).length&&(e=>{var t;s.cloneItem=JSON.parse(JSON.stringify(e));let l=s.cloneItem.options||[];"EVALUATE_SELECT"===e.type&&(l=(null==(t=s.cloneItem.scoreConfigs)?void 0:t.scoreRules)||[]),s.curOptions=l,h()})(e)}),{immediate:!0}),()=>{var t;return i(o("n-select"),{value:e.form[e.item.val_key],"onUpdate:value":[t=>e.form[e.item.val_key]=t,O],filterable:!0,clearable:!0,placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.147"))||"请选择","value-field":m.value,"label-field":g.value,multiple:v.value,disabled:e.isLock,loading:s.fetching,options:s.curOptions,remote:p.value,onSearch:f,"onUpdate:show":y},{empty:()=>s.fetching?i(r,null,null):i(u,null,null)})}}});export{s as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as l,computed as i,createVNode as
|
1
|
+
import{defineComponent as e,ref as l,computed as i,createVNode as n,createTextVNode as a,resolveComponent as o,Fragment as t}from"vue";import{NButton as s,NIcon as c,NSpace as u,useDialog as r}from"naive-ui";import m from"./standard-modal.js";import d from"./sign-com.js";import{EyeOutline as v,TrashOutline as p}from"@vicons/ionicons5";import{api as g}from"v-viewer";var f=e({name:"RSign",components:{NButton:s,NIcon:c,NSpace:u,StandardModal:m,SignCom:d},props:{form:{type:Object,default:()=>({})},item:{type:Object,default:()=>({})},isLock:{type:Boolean,default:!1}},emits:["scaleChange"],setup(e,s){const u=l(null),m=l(!1),d=l([]),f=r(),w=i((()=>{var l,i;return(null==(i=null==(l=e.item)?void 0:l.setting)?void 0:i.limitPic)||1})),C=i((()=>d.value.length<w.value&&!e.isLock));(()=>{const l=e.form[e.item.val_key];l&&Array.isArray(l)&&l.length&&(d.value=l)})();const k=()=>{m.value=!1},y=()=>{u.value.reset()},h=()=>{u.value.generate().then((l=>{console.log(l),d.value.push(l),s.emit("scaleChange",d.value,e.item),k()})).catch((e=>{console.log(e)}))},b=()=>{e.isLock||(m.value=!0)},L=()=>n("div",{class:"sigan-content-wrap"},[d.value.map(((l,i)=>n("div",{class:"sign-item"},[n("img",{src:l.url},null),n("div",null,[n(c,{component:v,onClick:()=>(e=>{const l=d.value.map((e=>e.url)).filter(Boolean);l.length&&g({images:l,options:{toolbar:!0,initialViewIndex:e}})})(i)},null),!e.isLock&&n(c,{component:p,onClick:()=>(l=>{var i,n;e.isLock||f.warning({title:"提示",content:"确认要删除签名吗?",positiveText:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.27"))||"确定",negativeText:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.28"))||"取消",maskClosable:!1,closable:!1,positiveButtonProps:{type:"primary"},onPositiveClick:()=>{d.value.splice(l,1),s.emit("scaleChange",d.value,e.item)},onNegativeClick(){}})})(i)},null)])]))),C.value&&n("div",{class:"add-sign-wrap",onClick:b},[n("i",{class:"scale-view-iconfont icon-scale-view-qianming"},null),n("span",null,[a("添加签名")])])]),B=()=>n(o("standard-modal"),{class:"r-sign-modal",visible:m.value,title:e.item.title,modalWidth:"652px",modalHeight:"476px",handleOk:h,cancel:k},{default:()=>n(o("sign-com"),{ref:u,isCrop:!0},null),action:()=>n(t,null,[n(o("n-space"),null,{default:()=>[n(o("n-button"),{size:"small",onClick:k},{default:()=>{var e;return[a((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]}}),n(o("n-button"),{size:"small",onClick:y,type:"primary"},{default:()=>[a("重签")]}),n(o("n-button"),{size:"small",onClick:h,type:"primary"},{default:()=>[a("确认")]})]})])});return()=>n("div",{class:"c-sign-wrap"},[L(),B()])}});export{f as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as i,reactive as
|
1
|
+
import{defineComponent as e,computed as i,reactive as l,ref as t,createVNode as a,resolveComponent as n}from"vue";import{NModal as o,NButton as d,NTooltip as s}from"naive-ui";var c=e({name:"StandardModal",components:{NModal:o,NButton:d,NTooltip:s},props:{title:{type:[Function,String],default:""},changeSize:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},modalWidth:{type:String,default:""},modalHeight:{type:String,default:""},handleOk:{type:Function,default:()=>({})},cancel:{type:Function,default:()=>({})},visible:{type:Boolean,default:!1}},emits:["update:visible","onClose"],setup(e,o){const d=i((()=>e.modalWidth||"50vw")),s=i((()=>e.modalHeight||"50vh")),c=l({modalWidth:d.value,modalHeight:s.value,maxHeight:"620px",isChangeWindow:!1}),u=t(!1),h=()=>{e.handleOk()},v=()=>{e.cancel(),o.emit("update:visible",!1)},g=()=>{const i=null==e?void 0:e.title,l=typeof i;return a("div",{class:"n-dialog__title-content"},["string"===l?a("div",null,[i]):null,"function"===l?a("div",null,[i()]):null,a("div",{class:"svg-wrap"},[e.changeSize?a("i",{onClick:()=>(document.body.clientHeight,void Object.assign(c,{isChangeWindow:!c.isChangeWindow,modalWidth:c.modalWidth===d.value?"100vw":d.value,modalHeight:c.modalHeight===s.value?"100vh":s.value})),class:u.value?"scale-view-iconfont icon-scale-view-menzhenyishengzhanxitongtubiaozuixiaohua2":"scale-view-iconfont icon-scale-view-menzhenyishengzhanxitongtubiaozuidahua"},null):null,e.closable?a("i",{class:"scale-view-iconfont icon-scale-view-menzhenyishengzhanxitongtubiaoguanbi",onClick:()=>v()},null):null])])};return()=>(()=>{var i;const l={...o.slots};return l.header||(l.header=g),a(n("n-modal"),{class:"c-scale-modal-container",show:e.visible,"mask-closable":!1,"show-icon":!1,closable:!1,style:{width:c.modalWidth,height:c.modalHeight},preset:"dialog","positive-text":"确认","negative-text":(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.28"))||"取消","on-positive-click":h,"on-negative-click":v,positiveButtonProps:{type:"primary"}},{...l})})()}});export{c as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{computed as e}from"vue";import{isEvaluation as t}from"../utils/judge-types.js";import"xe-utils";import a from"moment";import
|
1
|
+
import{computed as e}from"vue";import{isEvaluation as t}from"../utils/judge-types.js";import"xe-utils";import a from"moment";import n from"../../../../shared/utils/vexutilsExpand.js";import{componentMapStr as i}from"./use-component.js";const o=(o,l,r)=>{const{query:s,scaleViewDom:u}=r,v=(new Date).getTime(),d=e((()=>{var e,t;return null==(t=null==(e=l.originConfig)?void 0:e.otherSetting)?void 0:t.desLocation})),c=e((()=>{var e,t;return null==(t=null==(e=l.originConfig)?void 0:e.otherSetting)?void 0:t.desContent})),g=e((()=>"start"===d.value&&!!c.value)),m=e((()=>"end"===d.value&&!!c.value)),p=e((()=>{var e;return s.importId||(null==(e=o.params)?void 0:e.importId)})),f=e((()=>1==(null==s?void 0:s.formBoldOpen))),h=e((()=>e=>{var a;return!p.value&&(!!t(e.type)&&(1==(null==s?void 0:s.evatip)||1==(null==(a=o.params)?void 0:a.evatip)))})),C=e((()=>{var e;return(null==(e=l.config)?void 0:e.evaluateResultSetting)||{}})),S=e((()=>{const{evaluateTime:e}=C.value;return+e})),w=e((()=>{var e;return null==(e=C.value)?void 0:e.evaluateStartTime})),E=e((()=>{const e=new Date(w.value);return!!n.isValidDate(e)&&e})),L=e((()=>{const{evaluetaResSituation:e}=C.value||{};return e})),y=e((()=>{const{evaluateZeroTip:e}=C.value||{};return e})),O=e((()=>{if(!w.value||!S.value)return!1;if(!E.value)return!1;const e=a(w.value).add(S.value,"minutes").valueOf();return v>=e})),b=e((()=>{const e=E.value;if(!e)return!1;const t=a(e).valueOf();return v<t})),B=e((()=>e=>{const t=e.required;return o.styleSetting&&Object.keys(o.styleSetting).length&&"formBoldOpen"in o.styleSetting?t&&o.styleSetting.formBoldOpen:t&&f.value})),R=e((()=>{let e=l.fontSize;if(!e||"S"===e)return;e={L:"large",M:"medium",XS:"extrasmall"}[e];const t=e&&(null==o?void 0:o.fontSizeObj[e])||1,a=Math.floor(100/t*1e4)/1e4;return{width:`${a}%`,height:`${a}%`,transform:`scale(${t})`}})),T=e((()=>!("customList"==o.type&&!o.noBtn)&&!(!o.noBtn&&!o.hideBtn))),k=e((()=>e=>ie(e))),A=e((()=>e=>{var a;const{type:n}=e||{},i=!1===(null==(a=l.config)?void 0:a.autoQuestionNumber)?e.showTitle:`${e.softcode}、${e.showTitle}`;if(!t(n))return i;const o=le(e);return o||y.value?`${i} <span style="color:#2d7aff;" class="score-i">${o}</span>`:i})),j=e((()=>{const{config:e}=l;return!p.value&&(!(!e||!Object.keys(e).length)&&"totalScore"in e)})),_=e((()=>{var e;return(null==(e=o.ids)?void 0:e.guage_id)&&o.noBtn})),U=e((()=>{const e=o.params||{};if(!("skipCover"in e))return!1;return e.skipCover&&!b.value&&!O.value})),F=e((()=>_.value||l.isFinished&&!p.value||o.noBtn||o.hideBtn)),D=e((()=>l.showEvaluatePage&&l.showEvaluateSettingWrap&&!F.value&&!U.value)),P=e((()=>!j.value&&!D.value&&l.showEvaluateCountdownWrap&&!F.value)),V=e((()=>{const{evaluateResultSetting:e={}}=l.config;return(Object.values(e).filter((e=>{if(e)return!0}))||[]).length})),x=e((()=>l.paramsEvaluate&&Object.keys(l.paramsEvaluate).length)),$=e((()=>{const e=window.location.search||window.location.hash;if(!e)return;const t=["evaname","evadesc","evast","evadur","evaan","evasit","evaztip"].find((t=>e.includes(t)));return l.paramsEvaluate||t})),I=e((()=>{var e;return 1==s.isEdit||1==(null==(e=o.params)?void 0:e.isEdit)||p.value})),N=e((()=>1==l.isFinished&&I.value)),K=e((()=>V.value||$.value?!o.noBtn&&!o.hideBtn&&(!l.isFinished||I.value):!o.noBtn&&!o.hideBtn)),M=e((()=>K.value&&"guage"!==o.sourceType)),q=e((()=>K.value&&!o.isLock)),J=e((()=>o.hasExtendBtn?!o.printingHideBtn:M.value||q.value)),z=e((()=>V.value||$.value?!!o.hideBtn||!!o.isLock||l.isFinished&&!I.value:!!o.hideBtn||!!o.isLock)),H=e((()=>e=>{var t,a;return{EVALUATE_RADIO_BLOCK:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.298"))||"单选",EVALUATE_CHECKBOX_BLOCK:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.100"))||"多选"}[e.type]})),X=e((()=>e=>{var t;if(N.value)return!1;const{evaluateAnswer:i,checkAnswerMode:o,evaluateStartTime:r,evaluateTime:s}=(null==(t=l.config)?void 0:t.evaluateResultSetting)||{},u=(null==e?void 0:e.scoreConfigs)||0,v=i&&l.isFinished&&["EVALUATE_RADIO_BLOCK","EVALUATE_CHECKBOX_BLOCK","EVALUATE_SELECT","EVALUATE_INPUT"].includes(e.type)&&u;if(!r||!s||o&&1==o)return v;if(!n.isValidDate(new Date(r)))return v;const d=a(r).add(s,"minutes").diff(a(),"seconds",!0);return v&&d<=0})),Q=e((()=>{var e;return"customList"===o.type?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存":"提交"})),W=e((()=>({getSelectOptions:o.getSelectOptions,getSearchOptions:o.getSearchOptions,openType:o.openType}))),Z=e((()=>({getCascadeOptions:o.getCascadeOptions}))),G=e((()=>({uploadPictureUrl:o.uploadPictureUrl,uploadFileUrl:o.uploadFileUrl}))),Y=e((()=>({ak:o.ak}))),ee=e((()=>({source:"guage",getChunkUploadConfig:o.getChunkUploadConfig}))),te=e((()=>({selectedList:l.labelSelectedList,selectedListObj:l.labelSelectedListObj,getLabelList:o.getLabelList,deleteLabel:o.deleteLabel,saveLabelItem:o.saveLabelItem,sourceType:o.sourceType}))),ae={RSelectCom:W.value,RCascaderCom:Z.value,RUploadCom:G.value,RMapCom:Y.value,RVodChunkUploadCom:ee.value},ne=e((()=>(e,t)=>{var a;const n=i[e.type],o=ae[n]||{},r={form:l.form,item:e,index:t,isLock:z.value,...o};return"RVodChunkUploadCom"===n&&Object.assign(r,{formData:e,limitNum:(null==(a=e.setting)?void 0:a.limitPic)||1,defFileList:l.form[e.val_key]}),"RMapCom"===n&&Object.assign(r,{locationProp:l.form[e.val_key]}),"CSelectLabelCom"===n&&(Object.assign(r,{...te.value}),delete r.form,delete r.index),r})),ie=(e,t)=>{if(e.hide)return!1;const{form:a={},formArray:i=[]}=l;let o={};if(t){let t=e.setting;if(e.setting&&n.isJSON(e.setting)&&(t=JSON.parse(e.setting)),o=n.isString(t.callbackCondition)?JSON.parse(t.callbackCondition):t.callbackCondition,!o||!o.condition||!o.condition.length)return!0}else o=n.isString(e.relationLogic)?JSON.parse(e.relationLogic):e.relationLogic;if(!o||!Object.keys(o).length)return!0;const{relation_logic_is:r,condition:s,relation_logic:u}=o;if(r){const t=s.map((e=>{const t=i.filter((t=>t.seq==e.subject_seq))[0],o=oe(t);return n.isArray(a[o])?a[o].some((t=>e.value.includes(t))):e.value.includes(a[o])}));e.isShow="OR"==u?t.some((e=>e)):"AND"==u?t.every((e=>e)):t[0]}return e.isShow},oe=e=>e.databaseTitle||e.title,le=e=>{const{maxScore:t=0,minScore:a=0,scoreType:n}=e.scoreConfigs||{};return"eachOptionScore"===n&&a<0?`(${a}-${t}分)`:t||y.value?`(${t}分)`:void 0},re=e((()=>{var e;return{formArray:l.formArray,evaluateResultConfig:(null==(e=l.config)?void 0:e.evaluateResultConfig)||{},evaluateResultSetting:C.value,isFinished:l.isFinished,maxScore:l.maxScore,skipCover:U.value}})),se=e((()=>{var e;return{formArray:l.formArray,evaluateResultConfig:(null==(e=l.config)?void 0:e.evaluateResultConfig)||{},evaluateResultSetting:C.value,form:l.form,isFinished:l.isFinished,currentTime:l.currentTime,showEvaluateCountdown:l.showEvaluateCountdown,isEvaluetaResSituation:L.value,evaResultObj:l.evaResultObj,scaleViewDom:u.value}}));return{showEvatip:h,isFormBoldOpen:B,scaleStyle:R,handlePageClass:T,isShowItem:k,handleShowQuestionNumber:A,hasScore:j,isPreviewScale:_,showEvaluateEntry:D,showEvaluateCoundownPage:P,hasEvaluateResultSetting:V,hasparamsEvaluate:x,hasDefault:$,showScaleFooter:J,isCancelBtn:M,isSaveBtn:q,componentDisable:z,showEvaluateLabel:H,showAnswerParse:X,tipMsg:Q,propsConfig:ne,showEvent:ie,formKey:oe,evaluatePageProps:re,evaluateCountdownProps:se,skipCover:U,scaleEdit:N,isEvaluetaResSituation:L,disableEdit:F,isImportScale:p,desStart:g,desEnd:m,desContent:c}};export{o as ScaleViewComputed};
|
@@ -1 +1 @@
|
|
1
|
-
import{h as e}from"vue";import{useDialog as a,useMessage as t}from"naive-ui";const i=(i,o,n,l)=>{const s=a(),r=t(),{nextLogicEvent:c,handleDynamicDataRelation:u,isPreviewScale:v,submitMethod:
|
1
|
+
import{h as e}from"vue";import{useDialog as a,useMessage as t}from"naive-ui";const i=(i,o,n,l)=>{const s=a(),r=t(),{nextLogicEvent:c,handleDynamicDataRelation:u,isPreviewScale:v,submitMethod:d,isEvaluetaResSituation:E,handleScoreJson:p,disableEdit:C}=l,g=a=>{var t;s.warning({title:"提示",content:()=>e("div",{class:"evatip-container"},[e("span","答案解析:"),e("p",a)]),class:"c-evatip-dialog-wrap",showIcon:!1,positiveText:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.27"))||"确定",negativeText:"关闭",maskClosable:!1,onPositiveClick(){},onNegativeClick(){}})};return{scaleChange:(e,a,t)=>{const{choiceObj:n,isSetObj:l}=t||{};switch(a.type.includes("SELECT")||(o.form[a.val_key]=e),a.type){case"SELECT":case"EVALUATE_SELECT":{const{value:t,list:i=[]}=e;o.form[a.val_key]=t,c(e,a,o.formArray),u(i,a,o.formArray)}break;case"RADIO_BLOCK":case"CHECKBOX_BLOCK":l&&(o.choiceComObj[a.val_key]=n),c(e,a,o.formArray);break;case"EVALUATE_RADIO_BLOCK":case"EVALUATE_CHECKBOX_BLOCK":c(e,a,o.formArray);break;case"DATE":case"TIME":case"DATETIME":case"SEARCH_CASCADE":o.submitForm[a.val_key]=e}!C.value&&E.value&&a.type.includes("EVALUATE_")&&(async()=>{var e;const a=null==(e=i.scaleApiConfig)?void 0:e.getEvaluateResult;if(!a||"function"!=typeof a)return void r.error("getEvaluateResult Is not a function");const{guageId:t}=o.config;if(!t)return;const n=p(),l={gaugeId:t,scoreJson:JSON.stringify(n)},s=await a(l);if(!s)return;const c={...s};delete c.itemScoreMap,o.evaResultObj=c})()},labelChange:(e,a)=>{o.form[a.val_key]=((e,a)=>{const t=a.val_key;if(!e||!e.length)return t&&(o.labelSelectedListObj[t]=[]),{labelStr:"",labels:[]};const i=e||[],n=[],l=[];return i.forEach((e=>{l.push(e),n.push(e.labelName)})),o.labelSelectedList=i,t&&(o.labelSelectedListObj[t]=i),{labelStr:n.join(","),labels:l}})(e,a)},vodFileList:(e,a)=>{o.form[a.val_key]=e},writeGuage:e=>{o.showEvaluateSettingWrap=!1,o.showEvaluateCountdown=!!e,n("startWriteScale")},closeEvaluateCountdown:()=>{var e;o.showEvaluateCountdown=!1,v.value||(o.banSubmit=!0,d(),s.warning({title:"温馨提示",content:"测评时间到了,结束测评!",maskClosable:!1,positiveText:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定",onPositiveClick:()=>({})}))},showEvaTipModal:async e=>{var a;if(o.evatipMap[e.id])return void g(o.evatipMap[e.id]);const t="getSubjectAnswer",n=(null==(a=i.scaleApiConfig)?void 0:a[t])||null;if(!n||"function"!=typeof n)return void r.error(`${t} Is not a function`);const l=await n(e.id);l&&(o.evatipMap[e.id]||(o.evatipMap[e.id]=l,g(l)))}}};export{i as ScaleViewMethods};
|
@@ -1 +1 @@
|
|
1
|
-
import{h as t}from"vue";import{isSortItem as e,isOnlyOptions as i,isEvaluation as o,getQueryVariable as n}from"../utils/judge-types.js";import"xe-utils";import s from"moment";import r from"../../../../shared/utils/vexutilsExpand.js";import{ScaleViewComputed as a}from"./scaleview-computed.js";import{useDialog as l,useMessage as u}from"naive-ui";const f=(f,d,m,p)=>{const c=l(),g=u(),{formRef:v,countdownDom:y}=p,{showEvent:C,formKey:h,showEvaluateEntry:b,scaleEdit:O,showEvaluateCoundownPage:
|
1
|
+
import{h as t}from"vue";import{isSortItem as e,isOnlyOptions as i,isEvaluation as o,getQueryVariable as n}from"../utils/judge-types.js";import"xe-utils";import s from"moment";import r from"../../../../shared/utils/vexutilsExpand.js";import{ScaleViewComputed as a}from"./scaleview-computed.js";import{useDialog as l,useMessage as u}from"naive-ui";const f=(f,d,m,p)=>{const c=l(),g=u(),{formRef:v,countdownDom:y}=p,{showEvent:C,formKey:h,showEvaluateEntry:b,scaleEdit:O,showEvaluateCoundownPage:w,skipCover:A,hasScore:S}=a(f,d,p),T=()=>{const t=d.defaultFormArray.find((t=>"SPREAD_PARAMS"===t.type));if(t){r.isJSON(t.setting)&&(t.setting=JSON.parse(t.setting));const e=h(t);d.submitForm[e]=t.setting.spreadParams.domains.map((t=>{const e={};return"1"==t.valueType?e[t.name]=t.value:"2"==t.valueType&&(e[t.name]=n(t.value,d,f.params)),e}))}const e=d.defaultFormArray.find((t=>"CHECKBOX_BLOCK"==t.type));e&&Array.isArray(d.form[e.title])&&"customList"===f.type&&(d.form[e.title]=d.form[e.title].join(","));const i=x();let o;if("customList"===f.type)o={definedListId:f.ids.guage_id,dbId:f.ids.db_id,scoreJson:JSON.stringify(i)};else{const{guageId:t,randomId:e}=d.config;o=Object.assign(f.params,{guageId:t,scoreJson:JSON.stringify(i),randomId:e})}d.shareId&&(o.shareId=d.shareId);const s=d.defaultFormArray.find((t=>"SUCCESS_TIP"===t.type));if(s){const t=r.isJSON(s.setting)?JSON.parse(s.setting):s.setting;o.tipSetting=JSON.stringify({tipMode:t.tipMode,tipType:t.tipType,tipText:t.tipText,tipApi:t.tipApi})}const a=d.defaultFormArray.find((t=>"CALLBACK_INTERFACE"===t.type));let l=!1;a&&(l=C(a,!0));return{params:o,hasCallbackItem:a,isCallback:l}},E=(t,e)=>{if(!e.length)return e;const{type:o,options:n,scoreConfigs:s}=t;let r=n;if("EVALUATE_CHECKBOX_BLOCK"===o&&(r=(null==s?void 0:s.scoreRules)||[]),!r.length)return e;const a=i(o)?"key":"value",l=[];return r.forEach((t=>{const i=t[a];e.includes(i)&&l.push(i)})),l},x=()=>{const t=Object.assign({},d.form,d.submitForm),o={};if(!Object.keys(t).length)return{};for(const n in t){const r=d.formArray.find((t=>h(t)==n));if(n&&r){let a=n,l=t[n]?t[n]:null;if(r&&r.databaseTitle&&(a=r.databaseTitle),"customList"==f.type&&r&&r.setting&&1!=r.setting.startToStop&&t[n]&&"DATETIME"==r.type&&(r.setting&&"time"==r.setting.dateType&&t[n]&&(t[n]=s().format("YYYY-MM-DD ")+t[n]),r.setting&&"date"==r.setting.dateType&&t[n]&&(t[n]=s(t[n]).format("YYYY-MM-DD ")+s().format("HH:mm:ss"))),e(r)&&l&&(l=E(r,l),l=(null==l?void 0:l.length)?l:null),i(r.type)&&l){const{options:t}=r,e=r.val_key,i=d.choiceComObj[e];if("RADIO_BLOCK"===r.type&&l&&(l=L(l,t,i)),"CHECKBOX_BLOCK"===r.type&&(null==l?void 0:l.length)){l=I(l,t,i)}}o[a]=l}else o[n]=t[n]}return o},I=(t,e,i)=>{const o=[];let n,s=0;for(;s<t.length;s++){n=t[s];const r=e.find(((t,e)=>e+1===n));if(r&&!r.prefix&&!r.suffix){o.push(r.value);continue}const a=L(n,e,i);o.push(a)}return o},L=(t,e,i)=>{const{othersText:o,optionsPreSuffixObj:n={}}=i||{};if("other"===t)return o||"其他";const s=e.find(((e,i)=>i+1===t));if(!s)return;if(!s.prefix&&!s.suffix)return s.value;let r=n[t]||"";return s.prefix?r=s.prefix+r:r+=s.suffix,r},j=()=>new Promise((t=>{var e;null==(e=v.value)||e.validate((e=>{var i;if(e){console.log(e);const o=(null==(i=e[0])?void 0:i[0])||{};let n=o.field;const s=o.message,r=d.formArray.find((t=>t.databaseTitle===n));return r&&(n=r.title),g.error(n+s),t(!1),!1}{const e=T();t(e)}}))})),B=e=>{var i,o;c.warning({title:"温馨提示",content:()=>t("div",{style:{paddingLeft:"30px"}},e),positiveText:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.27"))||"确定",negativeText:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.28"))||"取消",maskClosable:!1,closable:!1,positiveButtonProps:{type:"primary"},onPositiveClick:async()=>{const t=await j();m("onSubmit",t)},onNegativeClick(){}})};return{submitMethod:T,confirmSubmit:B,onSubmitForm:j,onSubmitData:()=>{var t;if(!d.formArray.find((t=>o(t.type))))return void B("确认要提交吗?");const{evaluateResultSetting:e}=d.config;if(!e||!Object.keys(e).length&&!b.value||O.value)return void B("确认要结束测评吗?");if("formIframe"==f.openType&&b.value)return void m("submitNoRequest");let i="确定要提前结束测评吗?";if(w.value&&(null==(t=y.value)?void 0:t.getCountdownObj)){const t=y.value.getCountdownObj(),{setAnswered:e,totalLen:o}=t;if(e<o)i="存在未作答的题目,确定要提前结束测评吗?";else{!(d.showEvaluateCountdown&&!A.value)&&(i="确认要结束测评吗?")}}A.value&&S.value&&(i="确认要结束测评吗?"),B(i)},handleScoreJson:x}};export{f as ScaleViewSubmit};
|
@@ -1 +1 @@
|
|
1
|
-
import"xe-utils";import"moment";import e from"../../../../shared/utils/vexutilsExpand.js";import{ScaleViewComputed as r}from"./scaleview-computed.js";const t=(t,i,n)=>{const{formKey:
|
1
|
+
import"xe-utils";import"moment";import e from"../../../../shared/utils/vexutilsExpand.js";import{ScaleViewComputed as r}from"./scaleview-computed.js";const t=(t,i,n)=>{const{formKey:o}=r(t,i,n),l=(e,r)=>{var t;let{address:i}=r||{};return!!i||new Error((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.248"))||"必填")},a=(e,r)=>{var t,i;if(!r||!Object.keys(r).length)return new Error((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.248"))||"必填");let{labelStr:n,labels:o=[]}=r;return!(!n||!o.length)||new Error((null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.248"))||"必填")},s=(e,r)=>{var t;let i=(n=r,Object.prototype.toString.call(n));var n;if("[object Object]"==i){if(r&&Object.keys(r).length)return!0}else if("[object Array]"==i){if(r&&r.length)return!0}else if("[object Number]"==i){if(r||0===r)return!0}else if(r)return!0;return new Error((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.248"))||"必填")},u=["LABEL","ADDRESS"];return{formatRules:r=>{const n={};return r.forEach((r=>{var d;let g=r.val_key;if(n[g]=[],r.required&&!u.includes(r.type)&&n[g].push({required:r.required,message:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.248"))||"必填",trigger:"change",validator:s}),"MOBILE"==r.type&&r.validation)n[g].push({pattern:/^1[3456789]\d{9}$/,message:"格式错误",trigger:"blur"});else if("ID_CARD"==r.type&&r.validation)n[g].push({pattern:/^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9]|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}))$/,message:"格式错误",trigger:"blur"});else if("ADDRESS"==r.type&&r.required)(r=>{let t={addressType:"province-city-district-address"};return t=e.isJSON(r.setting)?JSON.parse(r.setting):r.setting,t.addressType.includes("address")})(r)&&n[g].push({validator:l,trigger:"change"});else if("LABEL"==r.type&&r.required)n[g].push({validator:a,trigger:"change"});else if("DATETIME"==r.type&&"customList"==t.type){let t=(r=>{let t=r.setting;return e.isJSON(t)&&(t=JSON.parse(t)),t.dateMaxType})(r);if(!t)return;let i={1:"checkDateMaxCur",2:"checkDateMaxSet",3:"checkDateMaxOther"};n[g].push({validator:(e,n)=>i[t](e,n,r),trigger:"change"})}else"RADIO_BLOCK"===r.type?(i.choiceComObj[o(r)]={},n[g].push({validator:(e,t)=>((e,r,t)=>{if(!r)return!0;let{options:n}=t;if(!n.length||"other"===r)return!0;const l=o(t);let{optionsPreSuffixObj:a={}}=i.choiceComObj[l]||{},s=n.find(((e,t)=>t+1===r));if(!s||s.importability)return!0;if((s.prefix||s.suffix)&&!a[r])return new Error("请完善选项");return!0})(0,t,r),trigger:["change","blur"]})):"CHECKBOX_BLOCK"===r.type&&(i.choiceComObj[o(r)]={},n[g].push({validator:(e,t)=>((e,r,t)=>{if(!r||!r.length)return!0;let{options:n}=t;if(!n.length)return!0;let l,a=0,s=r.length;const u=o(t);let{optionsPreSuffixObj:d={}}=i.choiceComObj[u]||{};for(;a<s;a++){if(l=r[a],"other"===l)continue;let e=n.find(((e,r)=>r+1===l));if(e&&!e.importability&&(e.prefix||e.suffix)&&!d[l])return new Error("请完善选项")}return!0})(0,t,r),trigger:["change","blur"]}))})),n}}};export{t as ScaleViewValidate};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as a,provide as l,ref as t,nextTick as o,watch as r,openBlock as u,createBlock as n,unref as s,mergeProps as i,isRef as d,withCtx as c,createElementVNode as v,createVNode as p,createCommentVNode as f,normalizeStyle as h,renderSlot as y}from"vue";import{useTheme as m}from"../../../shared/hooks/useTheme.js";import{useEventBus as b,useVModel as g,onClickOutside as
|
1
|
+
import{defineComponent as e,computed as a,provide as l,ref as t,nextTick as o,watch as r,openBlock as u,createBlock as n,unref as s,mergeProps as i,isRef as d,withCtx as c,createElementVNode as v,createVNode as p,createCommentVNode as f,normalizeStyle as h,renderSlot as y}from"vue";import{useTheme as m}from"../../../shared/hooks/useTheme.js";import{useEventBus as b,useVModel as g,onClickOutside as w,useDebounceFn as k}from"@vueuse/core";import"date-fns";import{isArray as S,isString as C,isObject as j,isFunction as K}from"lodash-es";import{isPromise as P,NOOP as _}from"@vue/shared";import{uuidGenerator as N}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NPopover as x,NInput as L}from"naive-ui";import"../../../shared/hooks/useScrollLoading.js";import A from"./components/ClearIcon.vue.js";import{InjectionSearchCascaderCheckAbleLevel as B,InjectionKeyboardEventBus as U,InjectionSearchCascaderLoadingNode as W,InjectionSearchCascaderValue as F}from"./constants/index.js";import{SearchMenu as I}from"./components/SearchMenu.js";var T;const V={style:{width:"100%"}},E=["id"];var O=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:(null==(T=window.getLanguageByCode)?void 0:T.call(window,"10010.1.147"))||"请选择"},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},menuWidth:{type:[Number,String],default:150},disabled:Boolean,inputProps:{type:Object},popperProps:{type:Object}},emits:["update:value","focus","update:show"],setup(e,{expose:T,emit:O}){const R=e,$=m();const H=a((()=>!R.disabled&&R.clearable&&(S(R.value)?R.value.length:!!R.value)));function M(){!function(e){if(!K(R.beforeSetValue))return O("update:value",e);const a=R.beforeSetValue(e);P(a)?a.then((e=>O("update:value",e)),_):O("update:value",a)}([])}function q(e){var a;"INPUT"===(null==(a=e.target)?void 0:a.tagName)&&ae()}const z=e=>{var a;"INPUT"!==(null==(a=e.target)?void 0:a.tagName)||"Enter"!==e.code||Q.value?G.emit(e.key,e):ae()},D=a((()=>({"--menu-width":R.menuWidth}))),G=b("cascaderKeydown"),J=N(),Q=g(R,"show",O);l(B,a((()=>R.checkAbleLevel))),l(U,G);const X=t(""),Y=a((()=>C(R.value)&&R.value?R.value:S(R.value)&&R.value.length?R.value.map((e=>j(e)?e[R.labelKey]:e)).join(" / "):R.editPlaceholder)),Z=a({get:()=>Q.value?X.value:C(R.value)?R.value:S(R.value)?R.value.reduce(((e,a,l)=>0===l?a[R.labelKey]:e+" / "+a[R.labelKey]),""):"",set(e){X.value=e,se(void 0,e)}});function ee(e){O("focus",e)}function ae(){Q.value||R.disabled||(Q.value=!0,X.value="",se())}async function le(){var e;Q.value=!1,null==(e=te.value)||e.blur()}const te=t();w(te,(e=>{var a;if(!Q.value)return;const l=e;if(!l.target)return le();!function(e){let a=!1,l=e;for(;l;){if(l.id===J){a=!0;break}l=l.parentElement}return a}(l.target)?le():null==(a=te.value)||a.focus()}));const oe=t(),re=t(),ue=t(),ne=t(null);l(W,ne),l(F,a((()=>R.value)));const se=k((async(e,a)=>{var l;const{type:t,node:r,dbClick:u}=e||{};try{if("update"===t)return void(K(R.search)&&R.search({...r,isLeaf:!0}));ne.value=r;const e=await(K(R.search)&&R.search(r,a,u));re.value=j(e)||S(e)?e:r}finally{ne.value=null,await o(),null==(l=oe.value)||l.syncPosition()}}),400),ie=e=>{ue.value=e};return r((()=>R.show),(e=>{e&&(ue.value={})})),T({getWidth(){var e;if(!te.value)return 0;const a=null==(e=te.value)?void 0:e.$el;return a?a.clientWidth:void 0},setCursor(e){ue.value=e}}),(a,l)=>(u(),n(s(x),i({class:"search-cascader",trigger:"manual",show:s(Q),"onUpdate:show":l[1]||(l[1]=e=>d(Q)?Q.value=e:null),"show-arrow":!1,placement:"bottom-start",style:s(D),disabled:e.disabled,width:e.options.length?void 0:"trigger",ref_key:"popoverRef",ref:oe},e.popperProps),{trigger:c((()=>[v("div",V,[p(s(L),i({disabled:e.disabled,class:{"search-cascader__input":!e.disabled},placeholder:s(Q)?s(Y):e.placeholder,clearable:!1,value:s(Z),"onUpdate:value":l[0]||(l[0]=e=>d(Z)?Z.value=e:null),readonly:!s(Q),ref_key:"inputRef",ref:te,onFocus:ee,onClick:q,onKeydown:z},e.inputProps),{suffix:c((()=>[s(H)?(u(),n(A,{key:0,onClick:M})):f("v-if",!0)])),_:1},16,["disabled","class","placeholder","value","readonly"])])])),default:c((()=>[v("section",{id:s(J)},[p(s(I),{style:h(s($)),"label-key":e.labelKey,"value-key":e.valueKey,options:e.options,onNodeClick:s(se),onChangeCursor:ie,"current-node":re.value,"cursor-node":ue.value},{empty:c((()=>[y(a.$slots,"empty")])),_:3},8,["style","label-key","value-key","options","onNodeClick","current-node","cursor-node"])],8,E)])),_:3},16,["show","style","disabled","width"]))}});export{O as default};
|
@@ -1 +1 @@
|
|
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
|
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"../../../shared/utils/vexutilsExpand.js";const A={key:0,class:"label-disable-wrap"},O=[c("p",{class:"label-disable-title"},"无可选标签",-1),c("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],K={style:{height:"100%"}},j={class:"label-wrap"},k=["id"],T={class:"edit-label-type"};var B=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:B,emit:D}){const V=t,F=L(),P=e(null),_=l({editLabelItem:{},inited:!1,labelSelectedEdit:[],labelAnchorKey:"",cacheAnchorKey:"",labelConfig:{}});let N=e(0);const W=a((()=>{if(!_.inited)return!1;let t=_.labelConfig;return!t||Object.keys(t).every((e=>!t[e].itemList))})),$=a((()=>{let t=[].concat(..._.labelSelectedEdit,...V.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(_.labelSelectedEdit=$.value,"object"==typeof _.labelConfig){Object.keys(_.labelConfig||{}).forEach((t=>{var e;let l=(null==(e=_.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 V.saveLabelItem(a,t);i&&(F.success("添加成功!"),D("updateLabelData"),t.showAdd=!1)},U=(t,e,l,a)=>{var i;const n=l.itemList,s=l.multipleChoice;let d=(null==(i=_.labelSelectedEdit)?void 0:i.length)&&x.clone(_.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)}_.labelSelectedEdit=[...d],N.value++,V.explicit&&D("explicitOnChange",[..._.labelSelectedEdit])},X=async t=>{const{status:e}=await V.deleteLabel(t,V.item);if(e){F.success("删除成功!");for(const e in _.labelConfig){const l=_.labelConfig[e].itemList.findIndex((e=>e.labelId==t.labelId));-1!=l&&_.labelConfig[e].itemList.splice(l,1)}const e=_.labelSelectedEdit||[],l=V.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),D("change",[...l],V.item)}D("updateLabelData")}else F.warning("删除失败")},Y=t=>{t&&setTimeout((()=>{let e,l="#"+t;e=P.value.querySelector("a[href='"+l+"']"),e&&e.click(),_.labelAnchorKey=t}),32)},Z=t=>{t.preventDefault()},tt=t=>{if(!t)return;let e=t.slice(1);_.cacheAnchorKey=e},et=()=>{var t;return null==(t=P.value)?void 0:t.querySelector(".right-label-wrap")};return i((()=>V.labelOptions),(t=>{t&&(()=>{var t;if(V.isLock)return;const e=JSON.parse(JSON.stringify(V.labelOptions));for(let l in e){let a=(null==(t=e[l])?void 0:t.typeId)||"";Object.assign(e[l],{curKey:`${l}_${a}}`})}_.labelConfig=e,C((()=>{let t;R(),V.explicit&&_.inited&&(t=_.labelAnchorKey),z(_.labelConfig,t),_.inited=!0}))})()}),{immediate:!0,deep:!0}),B({resetShowAdd:()=>{let{labelObj:t}=_.editLabelItem;if(t&&Object.keys(t).length)for(let e in t){let l=t[e];Object.assign(l,{showAdd:!1})}},handleLabelForm:t=>{t([..._.labelSelectedEdit||[]])},handleResetOptions:()=>{},hanldeSetLabelItem:(t,e)=>{if("object"==typeof _.labelConfig){Object.keys(_.labelConfig||{}).forEach((l=>{var a;let i=(null==(a=_.labelConfig[l])?void 0:a.itemList)||[];i.length&&i.forEach((l=>{t==l.labelId&&(l.isSelect=e)}))}))}if(!1===e&&Array.isArray(_.labelSelectedEdit)){const e=_.labelSelectedEdit.findIndex((e=>e.labelId==t));-1!=e&&_.labelSelectedEdit.splice(e,1)}}}),(e,l)=>(n(),s("div",{class:"c-label-form-content",ref_key:"labelFormContent",ref:P},[d(W)?(n(),s("div",A,O)):o("v-if",!0),r(c("div",K,[c("div",j,[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(_.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(_.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",T,"("+m(2==e.multipleChoice?"单":"多")+"选)",1)],8,k),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))}});export{B as default};
|