cnhis-design-vue 3.1.42-beta.45 → 3.1.42-beta.46

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.
Files changed (32) hide show
  1. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  2. package/es/components/big-table/src/components/edit-form/edit-select-table.d.ts +1 -1
  3. package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
  4. package/es/components/big-table/src/hooks/useEvent.js +1 -1
  5. package/es/components/big-table/src/hooks/useFormat.js +1 -1
  6. package/es/components/big-table/src/hooks/useNestTable.js +1 -1
  7. package/es/components/big-table/src/hooks/useTableParse.js +1 -1
  8. package/es/components/big-table/src/utils.d.ts +11 -1
  9. package/es/components/big-table/src/utils.js +1 -1
  10. package/es/components/scale-view/index.js +1 -1
  11. package/es/components/scale-view/src/components/formitem/dist/r-address.d.ts +36 -0
  12. package/es/components/scale-view/src/components/formitem/r-address.js +1 -1
  13. package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
  14. package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
  15. package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
  16. package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
  17. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  18. package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
  19. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  20. package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
  21. package/es/components/scale-view/src/hooks/use-evaluate.js +1 -1
  22. package/es/components/scale-view/src/hooks/use-event.js +1 -1
  23. package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
  24. package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
  25. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.js +1 -1
  26. package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
  27. package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.js +1 -1
  28. package/es/shared/utils/vexutils.d.ts +2 -3
  29. package/es/shared/utils/vexutils.js +1 -1
  30. package/es/shared/utils/vexutilsExpand.d.ts +254 -0
  31. package/es/shared/utils/vexutilsExpand.js +1 -0
  32. package/package.json +2 -2
@@ -1 +1 @@
1
- import{computed as e}from"vue";import{isEvaluation as t}from"../utils/judge-types.js";import a from"xe-utils";import n from"moment";import{componentMapStr as i}from"./use-component.js";const o=(o,l,r)=>{const{query:s}=r,u=(new Date).getTime(),v=e((()=>1==(null==s?void 0:s.formBoldOpen))),c=e((()=>e=>{var a;return!!t(e.type)&&(1==(null==s?void 0:s.evatip)||1==(null==(a=o.params)?void 0:a.evatip))})),d=e((()=>{var e;return(null==(e=l.config)?void 0:e.evaluateResultSetting)||{}})),m=e((()=>{const{evaluateTime:e}=d.value;return+e})),p=e((()=>{var e;return null==(e=d.value)?void 0:e.evaluateStartTime})),f=e((()=>{const e=new Date(p.value);return!!a.isValidDate(e)&&e})),g=e((()=>{if(!p.value||!m.value)return!1;if(!f.value)return!1;const e=n(p.value).add(m.value,"minutes").valueOf();return u>=e})),h=e((()=>{const e=f.value;if(!e)return!1;const t=n(e).valueOf();return u<t})),C=e((()=>e=>{const t=e.required;return o.styleSetting&&Object.keys(o.styleSetting).length&&"formBoldOpen"in o.styleSetting?t&&o.styleSetting.formBoldOpen:t&&v.value})),S=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})`}})),w=e((()=>!("customList"==o.type&&!o.noBtn)&&!(!o.noBtn&&!o.hideBtn))),y=e((()=>e=>X(e))),E=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;return`${i}&nbsp;<span style="color:#2d7aff;" class="score-i">${H(e)}</span>`})),L=e((()=>{const{config:e}=l;return!(!e||!Object.keys(e).length)&&"totalScore"in e})),O=e((()=>{var e;return(null==(e=o.ids)?void 0:e.guage_id)&&o.noBtn})),b=e((()=>{const e=o.params||{};if(!("skipCover"in e))return!1;return e.skipCover&&!h.value&&!g.value})),B=e((()=>!O.value&&l.showEvaluatePage&&l.showEvaluateSettingWrap&&!l.isFinished&&!o.noBtn&&!o.hideBtn)),A=e((()=>!O.value&&!B.value&&l.showEvaluateCountdownWrap&&!l.isFinished&&!o.noBtn&&!o.hideBtn)),T=e((()=>{const{evaluateResultSetting:e={}}=l.config;return(Object.values(e).filter((e=>{if(e)return!0}))||[]).length})),k=e((()=>l.paramsEvaluate&&Object.keys(l.paramsEvaluate).length)),R=e((()=>{const e=window.location.search||window.location.hash;if(!e)return;const t=["evaname","evadesc","evast","evadur","evaan"].find((t=>e.includes(t)));return l.paramsEvaluate||t})),_=e((()=>{var e;return 1==s.isEdit||1==(null==(e=o.params)?void 0:e.isEdit)})),U=e((()=>1==l.isFinished&&_.value)),F=e((()=>T.value||R.value?!o.noBtn&&!o.hideBtn&&(!l.isFinished||_.value):!o.noBtn&&!o.hideBtn)),P=e((()=>T.value||R.value?!!o.hideBtn||!!o.isLock||l.isFinished&&!_.value:!!o.hideBtn||!!o.isLock)),j=e((()=>e=>({EVALUATE_RADIO_BLOCK:"单选题",EVALUATE_CHECKBOX_BLOCK:"多选题"}[e.type]))),D=e((()=>e=>{var t;if(U.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(!a.isValidDate(new Date(r)))return v;const c=n(r).add(s,"minutes").diff(n(),"seconds",!0);return v&&c<=0})),V=e((()=>"customList"===o.type?"保存":"提交")),N=e((()=>({getSelectOptions:o.getSelectOptions,getSearchOptions:o.getSearchOptions,openType:o.openType}))),x=e((()=>({getCascadeOptions:o.getCascadeOptions}))),$=e((()=>({uploadPictureUrl:o.uploadPictureUrl,uploadFileUrl:o.uploadFileUrl}))),K=e((()=>({ak:o.ak}))),I=e((()=>({source:"guage",getChunkUploadConfig:o.getChunkUploadConfig}))),M=e((()=>({selectedList:l.labelSelectedList,getLabelList:o.getLabelList,deleteLabel:o.deleteLabel,saveLabelItem:o.saveLabelItem,sourceType:o.sourceType}))),q={RSelectCom:N.value,RCascaderCom:x.value,RUploadCom:$.value,RMapCom:K.value,RVodChunkUploadCom:I.value,CSelectLabelCom:M.value},J=e((()=>(e,t)=>{var a;const n=i[e.type],o=q[n]||{},r={form:l.form,item:e,index:t,isLock:P.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&&(delete r.form,delete r.index),r})),X=(e,t)=>{if(e.hide)return!1;const{form:n={},formArray:i=[]}=l;let o={};if(t){let t=e.setting;if(e.setting&&a.isJSON(e.setting)&&(t=JSON.parse(e.setting)),o=a.isString(t.callbackCondition)?JSON.parse(t.callbackCondition):t.callbackCondition,!o||!o.condition||!o.condition.length)return!0}else o=a.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=z(t);return a.isArray(n[o])?n[o].some((t=>e.value.includes(t))):e.value.includes(n[o])}));e.isShow="OR"==u?t.some((e=>e)):"AND"==u?t.every((e=>e)):t[0]}return e.isShow},z=e=>e.databaseTitle||e.title,H=e=>{const{minScore:t=0,maxScore:a=0,scoreType:n}=e.scoreConfigs||{};return`(${a}分)`},Q=e((()=>{var e;return{formArray:l.formArray,evaluateResultConfig:(null==(e=l.config)?void 0:e.evaluateResultConfig)||{},evaluateResultSetting:d.value,isFinished:l.isFinished,maxScore:l.maxScore}})),W=e((()=>{var e;return{formArray:l.formArray,evaluateResultConfig:(null==(e=l.config)?void 0:e.evaluateResultConfig)||{},evaluateResultSetting:d.value,form:l.form,isFinished:l.isFinished,currentTime:l.currentTime,showEvaluateCountdown:l.showEvaluateCountdown}}));return{showEvatip:c,isFormBoldOpen:C,scaleStyle:S,handlePageClass:w,isShowItem:y,handleShowQuestionNumber:E,hasScore:L,isPreviewScale:O,showEvaluateEntry:B,showEvaluateCoundownPage:A,hasEvaluateResultSetting:T,hasparamsEvaluate:k,hasDefault:R,showSaveBtn:F,componentDisable:P,showEvaluateLabel:j,showAnswerParse:D,tipMsg:V,propsConfig:J,showEvent:X,formKey:z,evaluatePageProps:Q,evaluateCountdownProps:W,skipCover:b,scaleEdit:U}};export{o as ScaleViewComputed};
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}=r,u=(new Date).getTime(),v=e((()=>1==(null==s?void 0:s.formBoldOpen))),c=e((()=>e=>{var a;return!!t(e.type)&&(1==(null==s?void 0:s.evatip)||1==(null==(a=o.params)?void 0:a.evatip))})),d=e((()=>{var e;return(null==(e=l.config)?void 0:e.evaluateResultSetting)||{}})),m=e((()=>{const{evaluateTime:e}=d.value;return+e})),p=e((()=>{var e;return null==(e=d.value)?void 0:e.evaluateStartTime})),f=e((()=>{const e=new Date(p.value);return!!n.isValidDate(e)&&e})),g=e((()=>{if(!p.value||!m.value)return!1;if(!f.value)return!1;const e=a(p.value).add(m.value,"minutes").valueOf();return u>=e})),h=e((()=>{const e=f.value;if(!e)return!1;const t=a(e).valueOf();return u<t})),C=e((()=>e=>{const t=e.required;return o.styleSetting&&Object.keys(o.styleSetting).length&&"formBoldOpen"in o.styleSetting?t&&o.styleSetting.formBoldOpen:t&&v.value})),S=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})`}})),E=e((()=>!("customList"==o.type&&!o.noBtn)&&!(!o.noBtn&&!o.hideBtn))),w=e((()=>e=>X(e))),y=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;return`${i}&nbsp;<span style="color:#2d7aff;" class="score-i">${H(e)}</span>`})),L=e((()=>{const{config:e}=l;return!(!e||!Object.keys(e).length)&&"totalScore"in e})),O=e((()=>{var e;return(null==(e=o.ids)?void 0:e.guage_id)&&o.noBtn})),b=e((()=>{const e=o.params||{};if(!("skipCover"in e))return!1;return e.skipCover&&!h.value&&!g.value})),B=e((()=>!O.value&&l.showEvaluatePage&&l.showEvaluateSettingWrap&&!l.isFinished&&!o.noBtn&&!o.hideBtn)),A=e((()=>!O.value&&!B.value&&l.showEvaluateCountdownWrap&&!l.isFinished&&!o.noBtn&&!o.hideBtn)),T=e((()=>{const{evaluateResultSetting:e={}}=l.config;return(Object.values(e).filter((e=>{if(e)return!0}))||[]).length})),k=e((()=>l.paramsEvaluate&&Object.keys(l.paramsEvaluate).length)),R=e((()=>{const e=window.location.search||window.location.hash;if(!e)return;const t=["evaname","evadesc","evast","evadur","evaan"].find((t=>e.includes(t)));return l.paramsEvaluate||t})),_=e((()=>{var e;return 1==s.isEdit||1==(null==(e=o.params)?void 0:e.isEdit)})),U=e((()=>1==l.isFinished&&_.value)),F=e((()=>T.value||R.value?!o.noBtn&&!o.hideBtn&&(!l.isFinished||_.value):!o.noBtn&&!o.hideBtn)),j=e((()=>T.value||R.value?!!o.hideBtn||!!o.isLock||l.isFinished&&!_.value:!!o.hideBtn||!!o.isLock)),P=e((()=>e=>({EVALUATE_RADIO_BLOCK:"单选题",EVALUATE_CHECKBOX_BLOCK:"多选题"}[e.type]))),D=e((()=>e=>{var t;if(U.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 c=a(r).add(s,"minutes").diff(a(),"seconds",!0);return v&&c<=0})),x=e((()=>"customList"===o.type?"保存":"提交")),V=e((()=>({getSelectOptions:o.getSelectOptions,getSearchOptions:o.getSearchOptions,openType:o.openType}))),N=e((()=>({getCascadeOptions:o.getCascadeOptions}))),$=e((()=>({uploadPictureUrl:o.uploadPictureUrl,uploadFileUrl:o.uploadFileUrl}))),K=e((()=>({ak:o.ak}))),I=e((()=>({source:"guage",getChunkUploadConfig:o.getChunkUploadConfig}))),M=e((()=>({selectedList:l.labelSelectedList,getLabelList:o.getLabelList,deleteLabel:o.deleteLabel,saveLabelItem:o.saveLabelItem,sourceType:o.sourceType}))),q={RSelectCom:V.value,RCascaderCom:N.value,RUploadCom:$.value,RMapCom:K.value,RVodChunkUploadCom:I.value,CSelectLabelCom:M.value},J=e((()=>(e,t)=>{var a;const n=i[e.type],o=q[n]||{},r={form:l.form,item:e,index:t,isLock:j.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&&(delete r.form,delete r.index),r})),X=(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=z(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},z=e=>e.databaseTitle||e.title,H=e=>{const{minScore:t=0,maxScore:a=0,scoreType:n}=e.scoreConfigs||{};return`(${a}分)`},Q=e((()=>{var e;return{formArray:l.formArray,evaluateResultConfig:(null==(e=l.config)?void 0:e.evaluateResultConfig)||{},evaluateResultSetting:d.value,isFinished:l.isFinished,maxScore:l.maxScore}})),W=e((()=>{var e;return{formArray:l.formArray,evaluateResultConfig:(null==(e=l.config)?void 0:e.evaluateResultConfig)||{},evaluateResultSetting:d.value,form:l.form,isFinished:l.isFinished,currentTime:l.currentTime,showEvaluateCountdown:l.showEvaluateCountdown}}));return{showEvatip:c,isFormBoldOpen:C,scaleStyle:S,handlePageClass:E,isShowItem:w,handleShowQuestionNumber:y,hasScore:L,isPreviewScale:O,showEvaluateEntry:B,showEvaluateCoundownPage:A,hasEvaluateResultSetting:T,hasparamsEvaluate:k,hasDefault:R,showSaveBtn:F,componentDisable:j,showEvaluateLabel:P,showAnswerParse:D,tipMsg:x,propsConfig:J,showEvent:X,formKey:z,evaluatePageProps:Q,evaluateCountdownProps:W,skipCover:b,scaleEdit:U}};export{o as ScaleViewComputed};
@@ -1 +1 @@
1
- import{handleQueryParams as e,getQueryVariable as t}from"../utils/judge-types.js";import a from"./use-noData.js";import n from"xe-utils";import"moment";import{componentMap as i}from"./use-component.js";import{useEvent as l}from"./use-event.js";import{ScaleViewComputed as s}from"./scaleview-computed.js";import{ScaleViewValidate as r}from"./scaleview-validate.js";import{useDialog as o}from"naive-ui";const u=(u,v,c,f)=>{const d=o(),{setNoData:m}=a(),{hasEvaluateResultSetting:p,hasparamsEvaluate:g,hasDefault:S,formKey:C}=s(u,v,f),{formatRules:E}=r(u,v,f),{nextLogicEvent:O}=l(u,v),A=e=>{const t=null==e?void 0:e.evaluateStartTime;t&&!n.isValidDate(new Date(t))&&n.isValidDate(new Date(Number(t)))&&(e.evaluateStartTime=Number(t))},y=()=>{var t;if(!p.value)return!!S.value&&("evaluateResultSetting"in v.config||(v.config.evaluateResultSetting={}),(t=>{let a=e();g.value&&(a=v.paramsEvaluate),a.evaname&&(t.evaluateName=a.evaname),a.evadesc&&(t.evaluateExplain=a.evadesc),a.evast&&(t.evaluateStartTime=a.evast),a.evadur&&(t.evaluateTime=a.evadur),a.evaan&&("true"===a.evaan||a.evaan,t.evaluateAnswer=a.evaan),A(t)})(v.config.evaluateResultSetting),v.showEvaluatePage=!0,void(v.showEvaluateCountdownWrap=!0));const{evaluateResultSetting:a={}}=v.config;if(!a||!Object.keys(a).length)return;v.showEvaluateCountdownWrap=!0;const{evaluateStartTime:i}=a,{evaluateName:l}=(null==(t=v.originConfig)?void 0:t.evaluateResultSetting)||{};if(i)return!(!n.isValidDate(new Date(i))&&!l)&&void(v.showEvaluatePage=!0);v.showEvaluatePage=!0},h=(e,t)=>{const a=e.find((e=>t===e.value));return a?a.key:t},R=(e,t)=>{if(["RADIO_BLOCK","CHECKBOX_BLOCK"].includes(t)&&e&&(e&&n.isJSON(e)&&(e=JSON.parse(e)),e.length))return!0},L=t=>{var a,i;if(!t||!t.length)return;const l=e();if((null==u?void 0:u.noBtn)||(null==l?void 0:l.noBtn))return;const s=t.find((e=>"FRONT_ADDRESS"===e.type));if(!s||!Object.keys(s).length)return;let r;if(s.setting&&n.isJSON(s.setting)&&(r=JSON.parse(s.setting)),!r||!Object.keys(r).length)return;if(1==(null==l?void 0:l.redirect)||1==(null==(a=u.params)?void 0:a.redirect)||3==l.isEdit||3==(null==(i=u.params)?void 0:i.isEdit))return;const{frontAddress:o}=r;if(o){const e=window.location.href;let t="?";o.includes("?")&&(t="&");return`${o}${t}redirect_url=${encodeURIComponent(e)}`}},N=e=>{const t=["evaname","evadesc","evast","evadur","evaan"],a={};for(const n in e){const i=e[n];t.includes(n)&&i&&(a[n]=i)}return a},b=t=>{if(!t||!Object.keys(t).length)return;let a=e()||{};g.value&&(a=v.paramsEvaluate);const n={evaluateName:"evaname",evaluateExplain:"evadesc",evaluateStartTime:"evast",evaluateTime:"evadur",evaluateAnswer:"evaan"};for(const e in t){const i=t[e];if(i&&"evaluateAnswer"!=e&&"string"==typeof i&&i.includes("${")){const n=i.replace(/\$\{([^}]+)\}/g,((e,t)=>{let n;return t.startsWith("form.")&&(n=a[t.split(".")[1]]),n||""}));t[e]=n}else{let i=a[n[e]];"evaluateAnswer"==e&&(i="true"===i||1==i),a[n[e]]&&(t[e]=i)}}if(S.value){const e={evaname:"evaluateName",evadesc:"evaluateExplain",evast:"evaluateStartTime",evadur:"evaluateTime",evaan:"evaluateAnswer"};["evaname","evadesc","evast","evadur","evaan"].forEach((n=>{const i=e[n];if(!t[i]){let e=a[n];"evaan"==n&&(e="true"===e||1==e),a[n]&&(t[i]=e)}}))}A(t)},T=e=>{let t=1;return e.map((a=>{const l=C(a);(l||"").replace(/\n/g,""),a.showTitle=a.title,a.val_key=l,a.renderCom=i[a.type],a.isShow=!0,Object.keys(a).forEach((e=>{n.isJSON(a[e])&&"LOCATION"!=a.type&&(a[e]=JSON.parse(a[e]))}));var s;return["LINEBAR","TITLE","PROMPT","IMGCARD","RICH_TEXT"].indexOf(a.type)<0&&!a.hide&&(a.softcode=t++),("SELECT"==(s=a.type)||"RADIO_BLOCK"==s||"CHECKBOX_BLOCK"==s||"SEARCH_CASCADE"==s||"EVALUATE_RADIO_BLOCK"==s||"EVALUATE_CHECKBOX_BLOCK"==s||"EVALUATE_SELECT"==s)&&(((e,t)=>{R(e,t)&&e.forEach(((e,t)=>{"other"!==e.key&&(e.key=t+1),(e.prefix||e.suffix)&&(e.value=e.prefix||e.suffix)}))})(a.options,a.type),"SEARCH_CASCADE"!=a.type&&(a.dbValue?O(a.dbValue,a,e):a.setting.defaultValue&&O(a.setting.defaultValue,a,e))),a})).map((t=>(((e,t)=>{const a=n.isString(t.relationLogic)?JSON.parse(t.relationLogic):t.relationLogic,{condition:i}=a||{};i&&i.length&&(i.forEach((t=>{const a=e.find((e=>e.seq==t.subject_seq));if(!a)return;if(!R(a.options,a.type))return;let n=t.value;Array.isArray(n)?(n=n.map((e=>h(a.options,e))),t.value=n):t.value=h(a.options,n)})),t.relationLogic=a)})(e,t),(e=>{const{nextLogic:t,options:a,type:n}=e||{};if(!t||!R(a,n))return;const{condition:i}=t||{};i&&i.length&&i.forEach((e=>{let t=e.value;Array.isArray(t)?(t=t.map((e=>h(a,e))),e.value=t):e.value=h(a,t)}))})(t),"CHECKBOX_BLOCK"===t.type&&t.dbValue&&!Array.isArray(t.dbValue)&&"customList"===u.type&&(t.dbValue=t.dbValue.split(",").filter((e=>!!e))),t)))},w=e=>{const a={};let i;return e.forEach((e=>{var l,s,r,o;const c=e.val_key,{type:f}=e;let d;if(e.dbValue)d=e.dbValue;else if(3==(null==(l=e.setting)?void 0:l.defValType)){const a=null==(r=null==(s=e.setting)?void 0:s.outDefaultValue)?void 0:r.urlKey;if(a){const n=a.split(",");if(n.length>1){const e=n.map((e=>{const a=t(e,v,u.params);return a?decodeURIComponent(a):null})).filter(Boolean);e.length&&(d=e)}else{let a=t(n[0],v,u.params);a&&(a=decodeURIComponent(a),d="CHECKBOX_BLOCK"==e.type?a.split():a)}}}switch(f){case"LOCATION":a[c]=d||"";break;case"SEARCH_CASCADE":case"UPFILE":case"UPPICTURE":a[c]=d||[];break;case"ADDRESS":a[c]=d||"",v.defaultAddress=d||{};break;case"LABEL":a[c]=d||{},n.isObject(d)?v.labelSelectedList=(null==d?void 0:d.labels)||[]:Array.isArray(d)?v.labelSelectedList=d:v.labelSelectedList=[];break;case"TITLE":a[c]=e.title;break;case"IMGCARD":a[c]=(null==(o=e.setting)?void 0:o.imgUrl)||"";break;case"CHECKBOX_BLOCK":d&&!Array.isArray(d)&&"customList"===u.type?a[c]=d.split(",").filter((e=>!!e)):(i=d||e.setting.defaultValue,n.isJSON(i)&&(i=JSON.parse(i)),a[c]=i);break;default:i=d||e.setting.defaultValue,n.isJSON(i)&&(i=JSON.parse(i)),a[c]=i}})),a};return{initForm:e=>{var t;let{list:a=[],map:i={},isFinished:l=!1}=e;const s=L(a);if(s)return void(window.location.href=s);if(i.maxScore&&(v.maxScore=i.maxScore),v.isFinished=l,e.isNotFilled)return v.spinning=!1,v.hasFrontAddress=!1,void m(!0,"未查询到量表填写记录");if(e.isLackCustomer&&d.info({title:"已设置填写次数限制",content:"请在包含用户信息的环境中打开此量表",maskClosable:!1,onPositiveClick(){c("onCloseSetting")}}),v.config=i,"evaluateResultConfig"in i&&n.isJSON(i.evaluateResultConfig)&&(v.config.evaluateResultConfig=JSON.parse(i.evaluateResultConfig)),"evaluateResultSetting"in i&&n.isJSON(i.evaluateResultSetting)&&(v.config.evaluateResultSetting=JSON.parse(i.evaluateResultSetting),(null==(t=v.config)?void 0:t.randomId)&&v.config.evaluateResultSetting&&(v.config.evaluateResultSetting.evaluateName=v.config.name,v.config.evaluateResultSetting.evaluateExplain=v.config.remark)),v.originConfig=JSON.parse(JSON.stringify(v.config)),u.params&&Object.keys(u.params).length){const e=N(u.params);e&&Object.keys(e).length&&(v.paramsEvaluate=e)}b(v.config.evaluateResultSetting),y(),v.defaultFormArray=JSON.parse(JSON.stringify(a));const r=v.filterArr;a=a.filter((e=>!r.includes(e.type))),v.formArray=T(a||[]),v.form=w(v.formArray),v.rules=E(v.formArray),v.fontSize=e.fontSize,v.spinning=!1,v.hasFrontAddress=!1}}};export{u as ScaleViewInit};
1
+ import{handleQueryParams as e,getQueryVariable as t}from"../utils/judge-types.js";import a from"./use-noData.js";import"xe-utils";import"moment";import i from"../../../../shared/utils/vexutilsExpand.js";import{componentMap as n}from"./use-component.js";import{useEvent as l}from"./use-event.js";import{ScaleViewComputed as s}from"./scaleview-computed.js";import{ScaleViewValidate as r}from"./scaleview-validate.js";import{useDialog as o}from"naive-ui";const u=(u,v,c,f)=>{const d=o(),{setNoData:m}=a(),{hasEvaluateResultSetting:p,hasparamsEvaluate:g,hasDefault:S,formKey:E}=s(u,v,f),{formatRules:C}=r(u,v,f),{nextLogicEvent:O}=l(u,v),A=e=>{const t=null==e?void 0:e.evaluateStartTime;t&&!i.isValidDate(new Date(t))&&i.isValidDate(new Date(Number(t)))&&(e.evaluateStartTime=Number(t))},y=()=>{var t;if(!p.value)return!!S.value&&("evaluateResultSetting"in v.config||(v.config.evaluateResultSetting={}),(t=>{let a=e();g.value&&(a=v.paramsEvaluate),a.evaname&&(t.evaluateName=a.evaname),a.evadesc&&(t.evaluateExplain=a.evadesc),a.evast&&(t.evaluateStartTime=a.evast),a.evadur&&(t.evaluateTime=a.evadur),a.evaan&&("true"===a.evaan||a.evaan,t.evaluateAnswer=a.evaan),A(t)})(v.config.evaluateResultSetting),v.showEvaluatePage=!0,void(v.showEvaluateCountdownWrap=!0));const{evaluateResultSetting:a={}}=v.config;if(!a||!Object.keys(a).length)return;v.showEvaluateCountdownWrap=!0;const{evaluateStartTime:n}=a,{evaluateName:l}=(null==(t=v.originConfig)?void 0:t.evaluateResultSetting)||{};if(n)return!(!i.isValidDate(new Date(n))&&!l)&&void(v.showEvaluatePage=!0);v.showEvaluatePage=!0},h=(e,t)=>{const a=e.find((e=>t===e.value));return a?a.key:t},R=(e,t)=>{if(["RADIO_BLOCK","CHECKBOX_BLOCK"].includes(t)&&e&&(e&&i.isJSON(e)&&(e=JSON.parse(e)),e.length))return!0},L=t=>{var a,n;if(!t||!t.length)return;const l=e();if((null==u?void 0:u.noBtn)||(null==l?void 0:l.noBtn))return;const s=t.find((e=>"FRONT_ADDRESS"===e.type));if(!s||!Object.keys(s).length)return;let r;if(s.setting&&i.isJSON(s.setting)&&(r=JSON.parse(s.setting)),!r||!Object.keys(r).length)return;if(1==(null==l?void 0:l.redirect)||1==(null==(a=u.params)?void 0:a.redirect)||3==l.isEdit||3==(null==(n=u.params)?void 0:n.isEdit))return;const{frontAddress:o}=r;if(o){const e=window.location.href;let t="?";o.includes("?")&&(t="&");return`${o}${t}redirect_url=${encodeURIComponent(e)}`}},N=e=>{const t=["evaname","evadesc","evast","evadur","evaan"],a={};for(const i in e){const n=e[i];t.includes(i)&&n&&(a[i]=n)}return a},b=t=>{if(!t||!Object.keys(t).length)return;let a=e()||{};g.value&&(a=v.paramsEvaluate);const i={evaluateName:"evaname",evaluateExplain:"evadesc",evaluateStartTime:"evast",evaluateTime:"evadur",evaluateAnswer:"evaan"};for(const e in t){const n=t[e];if(n&&"evaluateAnswer"!=e&&"string"==typeof n&&n.includes("${")){const i=n.replace(/\$\{([^}]+)\}/g,((e,t)=>{let i;return t.startsWith("form.")&&(i=a[t.split(".")[1]]),i||""}));t[e]=i}else{let n=a[i[e]];"evaluateAnswer"==e&&(n="true"===n||1==n),a[i[e]]&&(t[e]=n)}}if(S.value){const e={evaname:"evaluateName",evadesc:"evaluateExplain",evast:"evaluateStartTime",evadur:"evaluateTime",evaan:"evaluateAnswer"};["evaname","evadesc","evast","evadur","evaan"].forEach((i=>{const n=e[i];if(!t[n]){let e=a[i];"evaan"==i&&(e="true"===e||1==e),a[i]&&(t[n]=e)}}))}A(t)},T=e=>{let t=1;return e.map((a=>{const l=E(a);(l||"").replace(/\n/g,""),a.showTitle=a.title,a.val_key=l,a.renderCom=n[a.type],a.isShow=!0,Object.keys(a).forEach((e=>{i.isJSON(a[e])&&"LOCATION"!=a.type&&(a[e]=JSON.parse(a[e]))}));var s;return["LINEBAR","TITLE","PROMPT","IMGCARD","RICH_TEXT"].indexOf(a.type)<0&&!a.hide&&(a.softcode=t++),("SELECT"==(s=a.type)||"RADIO_BLOCK"==s||"CHECKBOX_BLOCK"==s||"SEARCH_CASCADE"==s||"EVALUATE_RADIO_BLOCK"==s||"EVALUATE_CHECKBOX_BLOCK"==s||"EVALUATE_SELECT"==s)&&(((e,t)=>{R(e,t)&&e.forEach(((e,t)=>{"other"!==e.key&&(e.key=t+1),(e.prefix||e.suffix)&&(e.value=e.prefix||e.suffix)}))})(a.options,a.type),"SEARCH_CASCADE"!=a.type&&(a.dbValue?O(a.dbValue,a,e):a.setting.defaultValue&&O(a.setting.defaultValue,a,e))),a})).map((t=>(((e,t)=>{const a=i.isString(t.relationLogic)?JSON.parse(t.relationLogic):t.relationLogic,{condition:n}=a||{};n&&n.length&&(n.forEach((t=>{const a=e.find((e=>e.seq==t.subject_seq));if(!a)return;if(!R(a.options,a.type))return;let i=t.value;Array.isArray(i)?(i=i.map((e=>h(a.options,e))),t.value=i):t.value=h(a.options,i)})),t.relationLogic=a)})(e,t),(e=>{const{nextLogic:t,options:a,type:i}=e||{};if(!t||!R(a,i))return;const{condition:n}=t||{};n&&n.length&&n.forEach((e=>{let t=e.value;Array.isArray(t)?(t=t.map((e=>h(a,e))),e.value=t):e.value=h(a,t)}))})(t),"CHECKBOX_BLOCK"===t.type&&t.dbValue&&!Array.isArray(t.dbValue)&&"customList"===u.type&&(t.dbValue=t.dbValue.split(",").filter((e=>!!e))),t)))},w=e=>{const a={};let n;return e.forEach((e=>{var l,s,r,o;const c=e.val_key,{type:f}=e;let d;if(e.dbValue)d=e.dbValue;else if(3==(null==(l=e.setting)?void 0:l.defValType)){const a=null==(r=null==(s=e.setting)?void 0:s.outDefaultValue)?void 0:r.urlKey;if(a){const i=a.split(",");if(i.length>1){const e=i.map((e=>{const a=t(e,v,u.params);return a?decodeURIComponent(a):null})).filter(Boolean);e.length&&(d=e)}else{let a=t(i[0],v,u.params);a&&(a=decodeURIComponent(a),d="CHECKBOX_BLOCK"==e.type?a.split():a)}}}switch(f){case"LOCATION":a[c]=d||"";break;case"SEARCH_CASCADE":case"UPFILE":case"UPPICTURE":a[c]=d||[];break;case"ADDRESS":a[c]=d||"",v.defaultAddress=d||{};break;case"LABEL":a[c]=d||{},i.isObject(d)?v.labelSelectedList=(null==d?void 0:d.labels)||[]:Array.isArray(d)?v.labelSelectedList=d:v.labelSelectedList=[];break;case"TITLE":a[c]=e.title;break;case"IMGCARD":a[c]=(null==(o=e.setting)?void 0:o.imgUrl)||"";break;case"CHECKBOX_BLOCK":d&&!Array.isArray(d)&&"customList"===u.type?a[c]=d.split(",").filter((e=>!!e)):(n=d||e.setting.defaultValue,i.isJSON(n)&&(n=JSON.parse(n)),a[c]=n);break;default:n=d||e.setting.defaultValue,i.isJSON(n)&&(n=JSON.parse(n)),a[c]=n}})),a};return{initForm:e=>{var t;let{list:a=[],map:n={},isFinished:l=!1}=e;const s=L(a);if(s)return void(window.location.href=s);if(n.maxScore&&(v.maxScore=n.maxScore),v.isFinished=l,e.isNotFilled)return v.spinning=!1,v.hasFrontAddress=!1,void m(!0,"未查询到量表填写记录");if(e.isLackCustomer&&d.info({title:"已设置填写次数限制",content:"请在包含用户信息的环境中打开此量表",maskClosable:!1,onPositiveClick(){c("onCloseSetting")}}),v.config=n,"evaluateResultConfig"in n&&i.isJSON(n.evaluateResultConfig)&&(v.config.evaluateResultConfig=JSON.parse(n.evaluateResultConfig)),"evaluateResultSetting"in n&&i.isJSON(n.evaluateResultSetting)&&(v.config.evaluateResultSetting=JSON.parse(n.evaluateResultSetting),(null==(t=v.config)?void 0:t.randomId)&&v.config.evaluateResultSetting&&(v.config.evaluateResultSetting.evaluateName=v.config.name,v.config.evaluateResultSetting.evaluateExplain=v.config.remark)),v.originConfig=JSON.parse(JSON.stringify(v.config)),u.params&&Object.keys(u.params).length){const e=N(u.params);e&&Object.keys(e).length&&(v.paramsEvaluate=e)}b(v.config.evaluateResultSetting),y(),v.defaultFormArray=JSON.parse(JSON.stringify(a));const r=v.filterArr;a=a.filter((e=>!r.includes(e.type))),v.formArray=T(a||[]),v.form=w(v.formArray),v.rules=C(v.formArray),v.fontSize=e.fontSize,v.spinning=!1,v.hasFrontAddress=!1}}};export{u as ScaleViewInit};
@@ -1 +1 @@
1
- import{isOnlyOptions as t,getQueryVariable as e}from"../utils/judge-types.js";import i from"xe-utils";import s from"moment";import{ScaleViewComputed as r}from"./scaleview-computed.js";const o=(o,n,a,f)=>{const{showEvent:p,formKey:m}=r(o,n,f),d=()=>{const e=Object.assign({},n.form,n.submitForm),i={};if(!Object.keys(e).length)return{};for(const r in e){const a=n.formArray.find((t=>m(t)==r));if(r&&a){let f;if(a&&a.databaseTitle&&(f=a.databaseTitle),"customList"==o.type&&a&&a.setting&&1!=a.setting.startToStop&&e[r]&&"DATETIME"==a.type&&(a.setting&&"time"==a.setting.dateType&&e[r]&&(e[r]=s().format("YYYY-MM-DD ")+e[r]),a.setting&&"date"==a.setting.dateType&&e[r]&&(e[r]=s(e[r]).format("YYYY-MM-DD ")+s().format("HH:mm:ss"))),i[f||r]=e[r]?e[r]:null,t(a.type)){const{options:t}=a,s=a.val_key,o=n.choiceComObj[s],f=e[r];if("RADIO_BLOCK"===a.type&&f&&(i[s]=c(f,t,o)),"CHECKBOX_BLOCK"===a.type&&(null==f?void 0:f.length)){const e=u(f,t,o);i[s]=e}}}else i[r]=e[r]}return console.log("res",i),i},u=(t,e,i)=>{const s=[];let r,o=0;for(;o<t.length;o++){r=t[o];const n=e.find(((t,e)=>e+1===r));if(n&&!n.prefix&&!n.suffix){s.push(n.value);continue}const a=c(r,e,i);s.push(a)}return s},c=(t,e,i)=>{const{othersText:s,optionsPreSuffixObj:r={}}=i||{};if("other"===t)return s||"其他";const o=e.find(((e,i)=>i+1===t));if(!o)return;if(!o.prefix&&!o.suffix)return o.value;let n=r[t]||"";return o.prefix?n=o.prefix+n:n+=o.suffix,n};return{submitMethod:()=>{const t=n.defaultFormArray.find((t=>"SPREAD_PARAMS"===t.type));if(t){i.isJSON(t.setting)&&(t.setting=JSON.parse(t.setting));const s=m(t);n.submitForm[s]=t.setting.spreadParams.domains.map((t=>{const i={};return"1"==t.valueType?i[t.name]=t.value:"2"==t.valueType&&(i[t.name]=e(t.value,n,o.params)),i}))}const s=n.defaultFormArray.find((t=>"CHECKBOX_BLOCK"==t.type));s&&Array.isArray(n.form[s.title])&&"customList"===o.type&&(n.form[s.title]=n.form[s.title].join(","));const r=d();let f;if("customList"===o.type)f={definedListId:o.ids.guage_id,dbId:o.ids.db_id,scoreJson:JSON.stringify(r)};else{const{guageId:t,randomId:e}=n.config;f=Object.assign(o.params,{guageId:t,scoreJson:JSON.stringify(r),randomId:e})}n.shareId&&(f.shareId=n.shareId);const u=n.defaultFormArray.find((t=>"SUCCESS_TIP"===t.type));if(u){const t=i.isJSON(u.setting)?JSON.parse(u.setting):u.setting;f.tipSetting=JSON.stringify({tipMode:t.tipMode,tipType:t.tipType,tipText:t.tipText,tipApi:t.tipApi})}const c=n.defaultFormArray.find((t=>"CALLBACK_INTERFACE"===t.type));let l=!1;c&&(l=p(c,!0)),a("onSubmit",f,c,l)}}};export{o as ScaleViewSubmit};
1
+ import{isOnlyOptions as t,getQueryVariable as e}from"../utils/judge-types.js";import"xe-utils";import i from"moment";import s from"../../../../shared/utils/vexutilsExpand.js";import{ScaleViewComputed as r}from"./scaleview-computed.js";const o=(o,n,a,f)=>{const{showEvent:p,formKey:m}=r(o,n,f),d=()=>{const e=Object.assign({},n.form,n.submitForm),s={};if(!Object.keys(e).length)return{};for(const r in e){const a=n.formArray.find((t=>m(t)==r));if(r&&a){let f;if(a&&a.databaseTitle&&(f=a.databaseTitle),"customList"==o.type&&a&&a.setting&&1!=a.setting.startToStop&&e[r]&&"DATETIME"==a.type&&(a.setting&&"time"==a.setting.dateType&&e[r]&&(e[r]=i().format("YYYY-MM-DD ")+e[r]),a.setting&&"date"==a.setting.dateType&&e[r]&&(e[r]=i(e[r]).format("YYYY-MM-DD ")+i().format("HH:mm:ss"))),s[f||r]=e[r]?e[r]:null,t(a.type)){const{options:t}=a,i=a.val_key,o=n.choiceComObj[i],f=e[r];if("RADIO_BLOCK"===a.type&&f&&(s[i]=l(f,t,o)),"CHECKBOX_BLOCK"===a.type&&(null==f?void 0:f.length)){const e=u(f,t,o);s[i]=e}}}else s[r]=e[r]}return console.log("res",s),s},u=(t,e,i)=>{const s=[];let r,o=0;for(;o<t.length;o++){r=t[o];const n=e.find(((t,e)=>e+1===r));if(n&&!n.prefix&&!n.suffix){s.push(n.value);continue}const a=l(r,e,i);s.push(a)}return s},l=(t,e,i)=>{const{othersText:s,optionsPreSuffixObj:r={}}=i||{};if("other"===t)return s||"其他";const o=e.find(((e,i)=>i+1===t));if(!o)return;if(!o.prefix&&!o.suffix)return o.value;let n=r[t]||"";return o.prefix?n=o.prefix+n:n+=o.suffix,n};return{submitMethod:()=>{const t=n.defaultFormArray.find((t=>"SPREAD_PARAMS"===t.type));if(t){s.isJSON(t.setting)&&(t.setting=JSON.parse(t.setting));const i=m(t);n.submitForm[i]=t.setting.spreadParams.domains.map((t=>{const i={};return"1"==t.valueType?i[t.name]=t.value:"2"==t.valueType&&(i[t.name]=e(t.value,n,o.params)),i}))}const i=n.defaultFormArray.find((t=>"CHECKBOX_BLOCK"==t.type));i&&Array.isArray(n.form[i.title])&&"customList"===o.type&&(n.form[i.title]=n.form[i.title].join(","));const r=d();let f;if("customList"===o.type)f={definedListId:o.ids.guage_id,dbId:o.ids.db_id,scoreJson:JSON.stringify(r)};else{const{guageId:t,randomId:e}=n.config;f=Object.assign(o.params,{guageId:t,scoreJson:JSON.stringify(r),randomId:e})}n.shareId&&(f.shareId=n.shareId);const u=n.defaultFormArray.find((t=>"SUCCESS_TIP"===t.type));if(u){const t=s.isJSON(u.setting)?JSON.parse(u.setting):u.setting;f.tipSetting=JSON.stringify({tipMode:t.tipMode,tipType:t.tipType,tipText:t.tipText,tipApi:t.tipApi})}const l=n.defaultFormArray.find((t=>"CALLBACK_INTERFACE"===t.type));let c=!1;l&&(c=p(l,!0)),a("onSubmit",f,l,c)}}};export{o as ScaleViewSubmit};
@@ -1 +1 @@
1
- import e from"xe-utils";import"moment";import{ScaleViewComputed as r}from"./scaleview-computed.js";const t=(t,i,n)=>{const{formKey:s}=r(t,i,n),o=(e,r)=>{let{address:t}=r||{};return!!t||new Error("必填")},l=(e,r)=>{if(!r||!Object.keys(r).length)return new Error("必填");let{labelStr:t,labels:i=[]}=r;return!(!t||!i.length)||new Error("必填")},a=(e,r)=>{let t=(i=r,Object.prototype.toString.call(i));var i;if("[object Object]"==t){if(r&&Object.keys(r).length)return!0}else if("[object Array]"==t){if(r&&r.length)return!0}else if("[object Number]"==t){if(r||0===r)return!0}else if(r)return!0;return new Error("必填")},u=["LABEL","ADDRESS"];return{formatRules:r=>{const n={};return r.forEach((r=>{let c=r.val_key;if(n[c]=[],r.required&&!u.includes(r.type)&&n[c].push({required:r.required,message:"必填",trigger:"change",validator:a}),"MOBILE"==r.type&&r.validation)n[c].push({pattern:/^1[3456789]\d{9}$/,message:"格式错误",trigger:"blur"});else if("ID_CARD"==r.type&&r.validation)n[c].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[c].push({validator:o,trigger:"change"});else if("LABEL"==r.type&&r.required)n[c].push({validator:l,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[c].push({validator:(e,n)=>i[t](e,n,r),trigger:"change"})}else"RADIO_BLOCK"===r.type?(i.choiceComObj[s(r)]={},n[c].push({validator:(e,t)=>((e,r,t)=>{if(!r)return!0;let{options:n}=t;if(!n.length||"other"===r)return!0;const o=s(t);let{optionsPreSuffixObj:l={}}=i.choiceComObj[o]||{},a=n.find(((e,t)=>t+1===r));if(!a||a.importability)return!0;if((a.prefix||a.suffix)&&!l[r])return new Error("请完善选项");return!0})(0,t,r),trigger:["change","blur"]})):"CHECKBOX_BLOCK"===r.type&&(i.choiceComObj[s(r)]={},n[c].push({validator:(e,t)=>((e,r,t)=>{if(!r||!r.length)return!0;let{options:n}=t;if(!n.length)return!0;let o,l=0,a=r.length;const u=s(t);let{optionsPreSuffixObj:c={}}=i.choiceComObj[u]||{};for(;l<a;l++){if(o=r[l],"other"===o)continue;let e=n.find(((e,r)=>r+1===o));if(e&&!e.importability&&(e.prefix||e.suffix)&&!c[o])return new Error("请完善选项")}return!0})(0,t,r),trigger:["change","blur"]}))})),n}}};export{t as ScaleViewValidate};
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:s}=r(t,i,n),o=(e,r)=>{let{address:t}=r||{};return!!t||new Error("必填")},l=(e,r)=>{if(!r||!Object.keys(r).length)return new Error("必填");let{labelStr:t,labels:i=[]}=r;return!(!t||!i.length)||new Error("必填")},a=(e,r)=>{let t=(i=r,Object.prototype.toString.call(i));var i;if("[object Object]"==t){if(r&&Object.keys(r).length)return!0}else if("[object Array]"==t){if(r&&r.length)return!0}else if("[object Number]"==t){if(r||0===r)return!0}else if(r)return!0;return new Error("必填")},u=["LABEL","ADDRESS"];return{formatRules:r=>{const n={};return r.forEach((r=>{let c=r.val_key;if(n[c]=[],r.required&&!u.includes(r.type)&&n[c].push({required:r.required,message:"必填",trigger:"change",validator:a}),"MOBILE"==r.type&&r.validation)n[c].push({pattern:/^1[3456789]\d{9}$/,message:"格式错误",trigger:"blur"});else if("ID_CARD"==r.type&&r.validation)n[c].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[c].push({validator:o,trigger:"change"});else if("LABEL"==r.type&&r.required)n[c].push({validator:l,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[c].push({validator:(e,n)=>i[t](e,n,r),trigger:"change"})}else"RADIO_BLOCK"===r.type?(i.choiceComObj[s(r)]={},n[c].push({validator:(e,t)=>((e,r,t)=>{if(!r)return!0;let{options:n}=t;if(!n.length||"other"===r)return!0;const o=s(t);let{optionsPreSuffixObj:l={}}=i.choiceComObj[o]||{},a=n.find(((e,t)=>t+1===r));if(!a||a.importability)return!0;if((a.prefix||a.suffix)&&!l[r])return new Error("请完善选项");return!0})(0,t,r),trigger:["change","blur"]})):"CHECKBOX_BLOCK"===r.type&&(i.choiceComObj[s(r)]={},n[c].push({validator:(e,t)=>((e,r,t)=>{if(!r||!r.length)return!0;let{options:n}=t;if(!n.length)return!0;let o,l=0,a=r.length;const u=s(t);let{optionsPreSuffixObj:c={}}=i.choiceComObj[u]||{};for(;l<a;l++){if(o=r[l],"other"===o)continue;let e=n.find(((e,r)=>r+1===o));if(e&&!e.importability&&(e.prefix||e.suffix)&&!c[o])return new Error("请完善选项")}return!0})(0,t,r),trigger:["change","blur"]}))})),n}}};export{t as ScaleViewValidate};
@@ -1 +1 @@
1
- import{reactive as e,computed as t,onMounted as u,onUnmounted as n}from"vue";import a from"moment";import r from"xe-utils";const i=(i,l,o)=>{const{emit:v}=o,s=e({totalLen:0,timer:null,countdownStr:"",isTimeOut:!1,countdownRed:!1,filterArr:["LINEBAR","TITLE","CALLBACK_INTERFACE","SPREAD_PARAMS","REDIRECT","FRONT_ADDRESS","PROMPT","IMGCARD","RETURN_PATH","RICH_TEXT","SUCCESS_TIP"]}),m=t((()=>{var e;return null==(e=i.evaluateResultSetting)?void 0:e.evaluateStartTime})),d=t((()=>{const e=new Date(m.value);return!!r.isValidDate(e)&&e})),T=t((()=>{const{evaluateTime:e}=i.evaluateResultSetting;return+e})),c=t((()=>{if(!f.value)return!1;if(!T.value)return!1;const e=a(m.value).add(T.value,"minutes").valueOf();return l.curTime>=e||i.isFinished})),S=t((()=>c.value||l.banStart?"测评已结束":"开始测评")),R=t((()=>d.value&&!s.isTimeOut||c.value)),f=t((()=>!(!m.value||!d.value))),w=t((()=>{if(!m.value)return T.value;if(!T.value)return!1;if(d.value)return!0;const e=a(m.value).add(T.value,"minutes").valueOf();return l.curTime<e}));u((()=>{g()})),n((()=>{g()}));const E=e=>{g();const t=e-(new Date).getTime();if(t<=0)return s.countdownStr="00:00:00",s.isTimeOut=!0,void("countdown"==l.source&&v("closeEvaluateCountdown"));t<=9e5&&!s.countdownRed&&(s.countdownRed=!0);let u=parseInt(String(t/1e3/60/60/24))+"",n=parseInt(String(t/1e3/60/60%24)),a=parseInt(String(t/1e3/60%60)),r=parseInt(String(t/1e3%60));u&&(u+=":"),n=n>9?n+":":"0"+n+":",a=a>9?a+":":"0"+a+":",r=r>9?r:"0"+r,s.countdownStr=`${u}${n}${a}${r}`,s.timer=setTimeout((function(){E(e)}),1e3)},g=()=>{s.timer&&clearTimeout(s.timer),s.countdownRed=!1};return{evaluateState:s,evaluateStartTime:m,getEvaluateStartTime:d,getEvaluateText:S,showCountdown:w,showRange:f,getTotalLen:()=>{var e;const t=null==(e=i.formArray)?void 0:e.filter((e=>!s.filterArr.includes(e.type)&&!e.hide));t&&t.length&&(s.totalLen=t.length)},countdown:E,clearTimer:g,disabledEvaluate:R,isBanStart:()=>{if(!m.value||!T.value)return!1;if(!d.value)return!1;const e=a(m.value).add(T.value,"minutes").valueOf();return(new Date).getTime()>=e},getEvaluateTime:T}};export{i as useEvaluate};
1
+ import{reactive as e,computed as t,onMounted as u,onUnmounted as n}from"vue";import a from"moment";import"xe-utils";import r from"../../../../shared/utils/vexutilsExpand.js";const i=(i,l,o)=>{const{emit:v}=o,s=e({totalLen:0,timer:null,countdownStr:"",isTimeOut:!1,countdownRed:!1,filterArr:["LINEBAR","TITLE","CALLBACK_INTERFACE","SPREAD_PARAMS","REDIRECT","FRONT_ADDRESS","PROMPT","IMGCARD","RETURN_PATH","RICH_TEXT","SUCCESS_TIP"]}),m=t((()=>{var e;return null==(e=i.evaluateResultSetting)?void 0:e.evaluateStartTime})),d=t((()=>{const e=new Date(m.value);return!!r.isValidDate(e)&&e})),T=t((()=>{const{evaluateTime:e}=i.evaluateResultSetting;return+e})),c=t((()=>{if(!f.value)return!1;if(!T.value)return!1;const e=a(m.value).add(T.value,"minutes").valueOf();return l.curTime>=e||i.isFinished})),S=t((()=>c.value||l.banStart?"测评已结束":"开始测评")),R=t((()=>d.value&&!s.isTimeOut||c.value)),f=t((()=>!(!m.value||!d.value))),E=t((()=>{if(!m.value)return T.value;if(!T.value)return!1;if(d.value)return!0;const e=a(m.value).add(T.value,"minutes").valueOf();return l.curTime<e}));u((()=>{g()})),n((()=>{g()}));const w=e=>{g();const t=e-(new Date).getTime();if(t<=0)return s.countdownStr="00:00:00",s.isTimeOut=!0,void("countdown"==l.source&&v("closeEvaluateCountdown"));t<=9e5&&!s.countdownRed&&(s.countdownRed=!0);let u=parseInt(String(t/1e3/60/60/24))+"",n=parseInt(String(t/1e3/60/60%24)),a=parseInt(String(t/1e3/60%60)),r=parseInt(String(t/1e3%60));u&&(u+=":"),n=n>9?n+":":"0"+n+":",a=a>9?a+":":"0"+a+":",r=r>9?r:"0"+r,s.countdownStr=`${u}${n}${a}${r}`,s.timer=setTimeout((function(){w(e)}),1e3)},g=()=>{s.timer&&clearTimeout(s.timer),s.countdownRed=!1};return{evaluateState:s,evaluateStartTime:m,getEvaluateStartTime:d,getEvaluateText:S,showCountdown:E,showRange:f,getTotalLen:()=>{var e;const t=null==(e=i.formArray)?void 0:e.filter((e=>!s.filterArr.includes(e.type)&&!e.hide));t&&t.length&&(s.totalLen=t.length)},countdown:w,clearTimer:g,disabledEvaluate:R,isBanStart:()=>{if(!m.value||!T.value)return!1;if(!d.value)return!1;const e=a(m.value).add(T.value,"minutes").valueOf();return(new Date).getTime()>=e},getEvaluateTime:T}};export{i as useEvaluate};
@@ -1 +1 @@
1
- import e from"xe-utils";import"moment";const t=(t,i)=>{const n=e=>e.databaseTitle||e.title;return{nextLogicEvent:(t,o,s=[],l)=>{const{nextLogic:r,seq:c}=o;if(r&&r.next_logic_is&&r.condition.length){let _=9999,a=0;l||(_=((e=[])=>{const t=e.map((e=>"end"==e.next_subject?9999:+(e.next_subject||9999)));return Math.max.call(null,...t)})(r.condition),a=((e,t)=>{const{seq:o}=e;let s,l=t.map((e=>!!(e.seq>o&&e.isShow&&e.__isLogic__)&&e)),r=0,c=0,_=l.length;for(;c<_;c++){s=l[c];let e=i.form[n(s)];if(!e)continue;if(Array.isArray(e)&&!e.length)continue;const{nextLogic:t,seq:o,__isLogic__:_,__lastSeq__:a}=s;if(t.next_logic_is&&t.condition.length&&a){r=a;break}}return r})(o,s)),r.condition.some((n=>{const{value:l,next_subject:f}=n,m="end"==f?9999:f;if(a&&a>c&&a<_&&(_=a),"condition"==r.next_logic){let e=!1;if(e=Array.isArray(t)?t.includes(l):t===l,o.__isLogic__=e,o.__lastSeq__=c+1,e)return s.forEach((e=>{if(e.seq>c&&e.seq<m){e.isShow=!1;const t=e.val_key;i.form[t]&&(i.form[t]="")}else e.seq>=m&&e.seq<_&&(e.isShow=!0)})),!0;s.forEach((e=>{e.seq>c&&e.seq<m&&(e.isShow=!0)}))}else if("uncondition"==r.next_logic){let n=e.isEmpty(t);o.__isLogic__=!n,o.__lastSeq__=c+1,s.forEach((e=>{const t=e.val_key;e.seq>c&&e.seq<m&&(e.isShow=n,n||i.form[t]&&(i.form[t]=""))}))}}))}},handleDynamicDataRelation:(e,t,n)=>{let{targetSource:o}=t;if(!o||!Object.keys(o).length)return;if(!o.target_id)return;let{relationParam:s=[]}=o;s.length&&s.forEach((t=>{let o=n.find((e=>e.seq===t.relationElement));const s=o.val_key;if(o)if(e.length){let n=e.map((e=>e[t.relationField]||"/"))||"";i.form[s]=n.join(",")}else i.form[s]=""}))}}};export{t as useEvent};
1
+ import"xe-utils";import"moment";import e from"../../../../shared/utils/vexutilsExpand.js";const t=(t,i)=>{const n=e=>e.databaseTitle||e.title;return{nextLogicEvent:(t,o,s=[],l)=>{const{nextLogic:r,seq:c}=o;if(r&&r.next_logic_is&&r.condition.length){let _=9999,a=0;l||(_=((e=[])=>{const t=e.map((e=>"end"==e.next_subject?9999:+(e.next_subject||9999)));return Math.max.call(null,...t)})(r.condition),a=((e,t)=>{const{seq:o}=e;let s,l=t.map((e=>!!(e.seq>o&&e.isShow&&e.__isLogic__)&&e)),r=0,c=0,_=l.length;for(;c<_;c++){s=l[c];let e=i.form[n(s)];if(!e)continue;if(Array.isArray(e)&&!e.length)continue;const{nextLogic:t,seq:o,__isLogic__:_,__lastSeq__:a}=s;if(t.next_logic_is&&t.condition.length&&a){r=a;break}}return r})(o,s)),r.condition.some((n=>{const{value:l,next_subject:f}=n,m="end"==f?9999:f;if(a&&a>c&&a<_&&(_=a),"condition"==r.next_logic){let e=!1;if(e=Array.isArray(t)?t.includes(l):t===l,o.__isLogic__=e,o.__lastSeq__=c+1,e)return s.forEach((e=>{if(e.seq>c&&e.seq<m){e.isShow=!1;const t=e.val_key;i.form[t]&&(i.form[t]="")}else e.seq>=m&&e.seq<_&&(e.isShow=!0)})),!0;s.forEach((e=>{e.seq>c&&e.seq<m&&(e.isShow=!0)}))}else if("uncondition"==r.next_logic){let n=e.isEmpty(t);o.__isLogic__=!n,o.__lastSeq__=c+1,s.forEach((e=>{const t=e.val_key;e.seq>c&&e.seq<m&&(e.isShow=n,n||i.form[t]&&(i.form[t]=""))}))}}))}},handleDynamicDataRelation:(e,t,n)=>{let{targetSource:o}=t;if(!o||!Object.keys(o).length)return;if(!o.target_id)return;let{relationParam:s=[]}=o;s.length&&s.forEach((t=>{let o=n.find((e=>e.seq===t.relationElement));const s=o.val_key;if(o)if(e.length){let n=e.map((e=>e[t.relationField]||"/"))||"";i.form[s]=n.join(",")}else i.form[s]=""}))}}};export{t as useEvent};
@@ -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 d,createCommentVNode as o,withDirectives as r,createElementVNode as c,normalizeClass as b,createVNode as u,withCtx as p,Fragment as f,renderList as h,createBlock as y,createTextVNode as v,toDisplayString as m,vShow as g,nextTick as C}from"vue";import{useMessage as L,NAnchor as I,NAnchorLink as S}from"naive-ui";import E from"./components/label-classify.vue.js";import{handleLabelColor as w}from"../../../shared/utils/vexutils.js";import x from"../../../_virtual/plugin-vue_export-helper.js";import A from"xe-utils";const O={key:0,class:"label-disable-wrap"},K=[c("p",{class:"label-disable-title"},"无可选标签",-1),c("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],j={style:{height:"100%"}},k={class:"label-wrap"},T=["id"],_={class:"edit-label-type"};var B=x(t({__name:"LabelFormContent",props:{item:{default:()=>({})},isEdit:{type:Boolean,default:!0},isLock:{type:Boolean,default:!1},labelSelectedList:null,isChangeWindow:{type:Boolean},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},labelOptions:null,sourceType:{default:""},explicit:{type:Boolean,default:!1}},emits:["explicitOnChange","change","updateLabelData"],setup(t,{expose:x,emit:B}){const D=t,F=L(),V=e(null),P=l({editLabelItem:{},inited:!1,labelSelectedEdit:[],labelAnchorKey:"",cacheAnchorKey:"",labelConfig:{}});let N=e(0);const W=a((()=>{if(!P.inited)return!1;let t=P.labelConfig;return!t||Object.keys(t).every((e=>!t[e].itemList))})),$=a((()=>{let t=[].concat(...P.labelSelectedEdit,...D.labelSelectedList);return J(t,"labelId")})),q=a((()=>{const t=$.value||[];return Array.isArray(t)?t.map((t=>t.labelId)):[]})),J=(t,e)=>{let l={};return t.reduce(((t,a)=>(!l[a[e]]&&(l[a[e]]=t.push(a)),t)),[])},R=()=>{if(P.labelSelectedEdit=$.value,"object"==typeof P.labelConfig){Object.keys(P.labelConfig||{}).forEach((t=>{var e;let l=(null==(e=P.labelConfig[t])?void 0:e.itemList)||[];l.length&&l.forEach((t=>{q.value.includes(t.labelId)&&(t.isSelect=!0)}))}))}},z=(t,e)=>{if(!t)return;let l=Object.keys(t)||[];if(!l.length)return;let a=t[l[0]].curKey;if(e&&"string"==typeof e){let[i]=e.split("~"),n=l.find((e=>t[e]&&t[e].curKey&&t[e].curKey.includes(i)));n&&(a=t[n].curKey)}a&&Y(a)},G=(t,e)=>{e.showAdd=!0;const l=t.target.nextElementSibling;C((()=>{var t;null==(t=null==l?void 0:l.firstChild)||t.focus()}))},H=(t,e)=>{setTimeout((()=>{e.addVal?Q(e):e.showAdd=!1}),150)},M=(t,e)=>{e.addVal="",e.showAdd=!1},Q=async t=>{var e;if(!!t.itemList.filter((t=>!(t.isPublic&&1==t.isPublic))).find((e=>e.labelName===t.addVal)))return F.error("标签名称重复!"),!1;let l="";l=(null==(e=t.itemList)?void 0:e.length)?t.itemList[0].parentColor||t.parentColor||"":(null==t?void 0:t.parentColor)||"";const a={type:t.typeId,name:t.addVal,parentColor:l},{status:i}=await D.saveLabelItem(a,t);i&&(F.success("添加成功!"),B("updateLabelData"),t.showAdd=!1)},U=(t,e,l,a)=>{var i;const n=l.itemList,s=l.multipleChoice;let d=(null==(i=P.labelSelectedEdit)?void 0:i.length)&&A.clone(P.labelSelectedEdit,!0)||[];if(t){if(d.some((t=>t.labelId==e.labelId)))return;if(2==s){const{typeId:t,labelId:l}=e;d=d.filter((e=>e.typeId!==t)),n.forEach((t=>{t.labelId!==l&&(t.isSelect=!1)}))}d.push(e)}else{const t=d.findIndex((t=>t.labelId==e.labelId));-1!=t&&d.splice(t,1)}P.labelSelectedEdit=[...d],N.value++,D.explicit&&B("explicitOnChange",[...P.labelSelectedEdit])},X=async t=>{const{status:e}=await D.deleteLabel(t,D.item);if(e){F.success("删除成功!");for(const e in P.labelConfig){const l=P.labelConfig[e].itemList.findIndex((e=>e.labelId==t.labelId));-1!=l&&P.labelConfig[e].itemList.splice(l,1)}const e=P.labelSelectedEdit||[],l=D.labelSelectedList||[];if(e&&e.length){const l=e.findIndex((e=>e.labelId==t.labelId));-1!=l&&e.splice(l,1)}if(l&&l.length){const e=l.findIndex((e=>e.labelId==t.labelId));-1!=e&&l.splice(e,1),B("change",[...l],D.item)}B("updateLabelData")}else F.warning("删除失败")},Y=t=>{t&&setTimeout((()=>{let e,l="#"+t;e=V.value.querySelector("a[href='"+l+"']"),e&&e.click(),P.labelAnchorKey=t}),32)},Z=t=>{t.preventDefault()},tt=t=>{if(!t)return;let e=t.slice(1);P.cacheAnchorKey=e},et=()=>{var t;return null==(t=V.value)?void 0:t.querySelector(".right-label-wrap")};return i((()=>D.labelOptions),(t=>{t&&(()=>{var t;if(D.isLock)return;const e=JSON.parse(JSON.stringify(D.labelOptions));for(let l in e){let a=(null==(t=e[l])?void 0:t.typeId)||"";Object.assign(e[l],{curKey:`${l}_${a}}`})}P.labelConfig=e,C((()=>{let t;R(),D.explicit&&P.inited&&(t=P.labelAnchorKey),z(P.labelConfig,t),P.inited=!0}))})()}),{immediate:!0,deep:!0}),x({resetShowAdd:()=>{let{labelObj:t}=P.editLabelItem;if(t&&Object.keys(t).length)for(let e in t){let l=t[e];Object.assign(l,{showAdd:!1})}},handleLabelForm:t=>{t([...P.labelSelectedEdit||[]])},handleResetOptions:()=>{},hanldeSetLabelItem:(t,e)=>{if("object"==typeof P.labelConfig){Object.keys(P.labelConfig||{}).forEach((l=>{var a;let i=(null==(a=P.labelConfig[l])?void 0:a.itemList)||[];i.length&&i.forEach((l=>{t==l.labelId&&(l.isSelect=e)}))}))}if(!1===e&&Array.isArray(P.labelSelectedEdit)){const e=P.labelSelectedEdit.findIndex((e=>e.labelId==t));-1!=e&&P.labelSelectedEdit.splice(e,1)}}}),(e,l)=>(n(),s("div",{class:"c-label-form-content",ref_key:"labelFormContent",ref:V},[d(W)?(n(),s("div",O,K)):o("v-if",!0),r(c("div",j,[c("div",k,[o(" 表单内嵌打开标签组件的样式 "),o(' <div v-if="explicit" class="explicit-continer">\n\t\t\t\t\t<n-tabs :value="state.labelAnchorKey" type="card" @change="labelAnchorTabsOnChange" tab-position="top">\n\t\t\t\t\t\t<template v-for="(v, i) in state.labelConfig">\n\t\t\t\t\t\t\t<n-tab-pane :name="v.curKey">\n\t\t\t\t\t\t\t\t<span slot="tab">\n\t\t\t\t\t\t\t\t\t{{ i }}\n\t\t\t\t\t\t\t\t\t<span class="edit-label-type">({{ v.multipleChoice == 2 ? \'单\' : \'多\' }}选)</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<div class="explicit-label-wrap left-label-wrap">\n\t\t\t\t\t\t\t\t\t<div class="edit-label-content">\n\t\t\t\t\t\t\t\t\t\t<labelClassify\n\t\t\t\t\t\t\t\t\t\t\t:classifyItem="v"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelChange="handleLabelChange"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelColor="handleLabelColor"\n\t\t\t\t\t\t\t\t\t\t\t:handleDelLabel="handleDelLabel"\n\t\t\t\t\t\t\t\t\t\t\t:hanldeBlur="hanldeBlur"\n\t\t\t\t\t\t\t\t\t\t\t:handleAddLabel="handleAddLabel"\n\t\t\t\t\t\t\t\t\t\t\t:clearaddVal="clearaddVal"\n\t\t\t\t\t\t\t\t\t\t\t:isEdit="isEdit"\n\t\t\t\t\t\t\t\t\t\t\t:sourceType="sourceType"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</n-tab-pane>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</n-tabs>\n\t\t\t\t</div> '),o("\n\t\t\t\t\t普通标签样式\n\t\t\t\t\tv-else\n\t\t\t\t\texplicit\n\t\t\t\t "),c("div",{class:b(["left-label-wrap",{"total-left-label-wrap":t.isChangeWindow}])},[u(d(I),{"offset-target":et,type:"block",onClick:Z,onChange:tt},{default:p((()=>[(n(!0),s(f,null,h(P.labelConfig,((t,e)=>(n(),y(d(S),{href:`#${t.curKey}`,title:String(e)},null,8,["href","title"])))),256))])),_:1})],2),o(' v-if="!explicit" '),c("div",{class:b(["right-label-wrap",{"total-right-label-wrap":t.isChangeWindow}])},[(n(!0),s(f,null,h(P.labelConfig,((e,l)=>(n(),s("div",{key:l,class:"edit-label-content"},[c("div",{class:"edit-label",id:e.curKey},[v(m(l)+" ",1),c("span",_,"("+m(2==e.multipleChoice?"单":"多")+"选)",1)],8,T),u(E,{classifyItem:e,handleLabelChange:U,handleLabelColor:d(w),handleDelLabel:X,hanldeBlur:H,handleAddLabel:G,clearaddVal:M,isEdit:t.isEdit,sourceType:t.sourceType},null,8,["classifyItem","handleLabelColor","isEdit","sourceType"])])))),128))],2)])],512),[[g,!d(W)]])],512))}}),[["__file","LabelFormContent.vue"]]);export{B as default};
1
+ import{defineComponent as t,ref as e,reactive as l,computed as a,watch as i,openBlock as n,createElementBlock as s,unref as d,createCommentVNode as o,withDirectives as r,createElementVNode as c,normalizeClass as b,createVNode as u,withCtx as p,Fragment as f,renderList as h,createBlock as y,createTextVNode as v,toDisplayString as m,vShow as g,nextTick as C}from"vue";import{useMessage as L,NAnchor as I,NAnchorLink as S}from"naive-ui";import E from"./components/label-classify.vue.js";import{handleLabelColor as w}from"../../../shared/utils/vexutils.js";import x from"../../../_virtual/plugin-vue_export-helper.js";import A from"../../../shared/utils/vexutilsExpand.js";const O={key:0,class:"label-disable-wrap"},j=[c("p",{class:"label-disable-title"},"无可选标签",-1),c("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],K={style:{height:"100%"}},k={class:"label-wrap"},T=["id"],_={class:"edit-label-type"};var B=x(t({__name:"LabelFormContent",props:{item:{default:()=>({})},isEdit:{type:Boolean,default:!0},isLock:{type:Boolean,default:!1},labelSelectedList:null,isChangeWindow:{type:Boolean},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},labelOptions:null,sourceType:{default:""},explicit:{type:Boolean,default:!1}},emits:["explicitOnChange","change","updateLabelData"],setup(t,{expose:x,emit:B}){const D=t,F=L(),V=e(null),P=l({editLabelItem:{},inited:!1,labelSelectedEdit:[],labelAnchorKey:"",cacheAnchorKey:"",labelConfig:{}});let N=e(0);const W=a((()=>{if(!P.inited)return!1;let t=P.labelConfig;return!t||Object.keys(t).every((e=>!t[e].itemList))})),$=a((()=>{let t=[].concat(...P.labelSelectedEdit,...D.labelSelectedList);return J(t,"labelId")})),q=a((()=>{const t=$.value||[];return Array.isArray(t)?t.map((t=>t.labelId)):[]})),J=(t,e)=>{let l={};return t.reduce(((t,a)=>(!l[a[e]]&&(l[a[e]]=t.push(a)),t)),[])},R=()=>{if(P.labelSelectedEdit=$.value,"object"==typeof P.labelConfig){Object.keys(P.labelConfig||{}).forEach((t=>{var e;let l=(null==(e=P.labelConfig[t])?void 0:e.itemList)||[];l.length&&l.forEach((t=>{q.value.includes(t.labelId)&&(t.isSelect=!0)}))}))}},z=(t,e)=>{if(!t)return;let l=Object.keys(t)||[];if(!l.length)return;let a=t[l[0]].curKey;if(e&&"string"==typeof e){let[i]=e.split("~"),n=l.find((e=>t[e]&&t[e].curKey&&t[e].curKey.includes(i)));n&&(a=t[n].curKey)}a&&Y(a)},G=(t,e)=>{e.showAdd=!0;const l=t.target.nextElementSibling;C((()=>{var t;null==(t=null==l?void 0:l.firstChild)||t.focus()}))},H=(t,e)=>{setTimeout((()=>{e.addVal?Q(e):e.showAdd=!1}),150)},M=(t,e)=>{e.addVal="",e.showAdd=!1},Q=async t=>{var e;if(!!t.itemList.filter((t=>!(t.isPublic&&1==t.isPublic))).find((e=>e.labelName===t.addVal)))return F.error("标签名称重复!"),!1;let l="";l=(null==(e=t.itemList)?void 0:e.length)?t.itemList[0].parentColor||t.parentColor||"":(null==t?void 0:t.parentColor)||"";const a={type:t.typeId,name:t.addVal,parentColor:l},{status:i}=await D.saveLabelItem(a,t);i&&(F.success("添加成功!"),B("updateLabelData"),t.showAdd=!1)},U=(t,e,l,a)=>{var i;const n=l.itemList,s=l.multipleChoice;let d=(null==(i=P.labelSelectedEdit)?void 0:i.length)&&A.clone(P.labelSelectedEdit,!0)||[];if(t){if(d.some((t=>t.labelId==e.labelId)))return;if(2==s){const{typeId:t,labelId:l}=e;d=d.filter((e=>e.typeId!==t)),n.forEach((t=>{t.labelId!==l&&(t.isSelect=!1)}))}d.push(e)}else{const t=d.findIndex((t=>t.labelId==e.labelId));-1!=t&&d.splice(t,1)}P.labelSelectedEdit=[...d],N.value++,D.explicit&&B("explicitOnChange",[...P.labelSelectedEdit])},X=async t=>{const{status:e}=await D.deleteLabel(t,D.item);if(e){F.success("删除成功!");for(const e in P.labelConfig){const l=P.labelConfig[e].itemList.findIndex((e=>e.labelId==t.labelId));-1!=l&&P.labelConfig[e].itemList.splice(l,1)}const e=P.labelSelectedEdit||[],l=D.labelSelectedList||[];if(e&&e.length){const l=e.findIndex((e=>e.labelId==t.labelId));-1!=l&&e.splice(l,1)}if(l&&l.length){const e=l.findIndex((e=>e.labelId==t.labelId));-1!=e&&l.splice(e,1),B("change",[...l],D.item)}B("updateLabelData")}else F.warning("删除失败")},Y=t=>{t&&setTimeout((()=>{let e,l="#"+t;e=V.value.querySelector("a[href='"+l+"']"),e&&e.click(),P.labelAnchorKey=t}),32)},Z=t=>{t.preventDefault()},tt=t=>{if(!t)return;let e=t.slice(1);P.cacheAnchorKey=e},et=()=>{var t;return null==(t=V.value)?void 0:t.querySelector(".right-label-wrap")};return i((()=>D.labelOptions),(t=>{t&&(()=>{var t;if(D.isLock)return;const e=JSON.parse(JSON.stringify(D.labelOptions));for(let l in e){let a=(null==(t=e[l])?void 0:t.typeId)||"";Object.assign(e[l],{curKey:`${l}_${a}}`})}P.labelConfig=e,C((()=>{let t;R(),D.explicit&&P.inited&&(t=P.labelAnchorKey),z(P.labelConfig,t),P.inited=!0}))})()}),{immediate:!0,deep:!0}),x({resetShowAdd:()=>{let{labelObj:t}=P.editLabelItem;if(t&&Object.keys(t).length)for(let e in t){let l=t[e];Object.assign(l,{showAdd:!1})}},handleLabelForm:t=>{t([...P.labelSelectedEdit||[]])},handleResetOptions:()=>{},hanldeSetLabelItem:(t,e)=>{if("object"==typeof P.labelConfig){Object.keys(P.labelConfig||{}).forEach((l=>{var a;let i=(null==(a=P.labelConfig[l])?void 0:a.itemList)||[];i.length&&i.forEach((l=>{t==l.labelId&&(l.isSelect=e)}))}))}if(!1===e&&Array.isArray(P.labelSelectedEdit)){const e=P.labelSelectedEdit.findIndex((e=>e.labelId==t));-1!=e&&P.labelSelectedEdit.splice(e,1)}}}),(e,l)=>(n(),s("div",{class:"c-label-form-content",ref_key:"labelFormContent",ref:V},[d(W)?(n(),s("div",O,j)):o("v-if",!0),r(c("div",K,[c("div",k,[o(" 表单内嵌打开标签组件的样式 "),o(' <div v-if="explicit" class="explicit-continer">\n\t\t\t\t\t<n-tabs :value="state.labelAnchorKey" type="card" @change="labelAnchorTabsOnChange" tab-position="top">\n\t\t\t\t\t\t<template v-for="(v, i) in state.labelConfig">\n\t\t\t\t\t\t\t<n-tab-pane :name="v.curKey">\n\t\t\t\t\t\t\t\t<span slot="tab">\n\t\t\t\t\t\t\t\t\t{{ i }}\n\t\t\t\t\t\t\t\t\t<span class="edit-label-type">({{ v.multipleChoice == 2 ? \'单\' : \'多\' }}选)</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<div class="explicit-label-wrap left-label-wrap">\n\t\t\t\t\t\t\t\t\t<div class="edit-label-content">\n\t\t\t\t\t\t\t\t\t\t<labelClassify\n\t\t\t\t\t\t\t\t\t\t\t:classifyItem="v"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelChange="handleLabelChange"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelColor="handleLabelColor"\n\t\t\t\t\t\t\t\t\t\t\t:handleDelLabel="handleDelLabel"\n\t\t\t\t\t\t\t\t\t\t\t:hanldeBlur="hanldeBlur"\n\t\t\t\t\t\t\t\t\t\t\t:handleAddLabel="handleAddLabel"\n\t\t\t\t\t\t\t\t\t\t\t:clearaddVal="clearaddVal"\n\t\t\t\t\t\t\t\t\t\t\t:isEdit="isEdit"\n\t\t\t\t\t\t\t\t\t\t\t:sourceType="sourceType"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</n-tab-pane>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</n-tabs>\n\t\t\t\t</div> '),o("\n\t\t\t\t\t普通标签样式\n\t\t\t\t\tv-else\n\t\t\t\t\texplicit\n\t\t\t\t "),c("div",{class:b(["left-label-wrap",{"total-left-label-wrap":t.isChangeWindow}])},[u(d(I),{"offset-target":et,type:"block",onClick:Z,onChange:tt},{default:p((()=>[(n(!0),s(f,null,h(P.labelConfig,((t,e)=>(n(),y(d(S),{href:`#${t.curKey}`,title:String(e)},null,8,["href","title"])))),256))])),_:1})],2),o(' v-if="!explicit" '),c("div",{class:b(["right-label-wrap",{"total-right-label-wrap":t.isChangeWindow}])},[(n(!0),s(f,null,h(P.labelConfig,((e,l)=>(n(),s("div",{key:l,class:"edit-label-content"},[c("div",{class:"edit-label",id:e.curKey},[v(m(l)+" ",1),c("span",_,"("+m(2==e.multipleChoice?"单":"多")+"选)",1)],8,T),u(E,{classifyItem:e,handleLabelChange:U,handleLabelColor:d(w),handleDelLabel:X,hanldeBlur:H,handleAddLabel:G,clearaddVal:M,isEdit:t.isEdit,sourceType:t.sourceType},null,8,["classifyItem","handleLabelColor","isEdit","sourceType"])])))),128))],2)])],512),[[g,!d(W)]])],512))}}),[["__file","LabelFormContent.vue"]]);export{B as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,reactive as t,computed as a,onMounted as i,watch as o,openBlock as s,createElementBlock as n,Fragment as d,createElementVNode as c,createBlock as b,unref as m,withCtx as r,renderList as p,normalizeStyle as u,createVNode as L,toDisplayString as y,withDirectives as h,normalizeClass as C,createTextVNode as f,vShow as g,createCommentVNode as v,mergeProps as I,nextTick as w}from"vue";import{NSpace as x,NTag as S,NTooltip as k,NIcon as O,NModal as N}from"naive-ui";import{AddCircleOutline as j}from"@vicons/ionicons5";import W from"./LabelFormContent.vue.js";import{handleLabelColor as P}from"../../../shared/utils/vexutils.js";import _ from"xe-utils";const B={class:"c-select-label"},A=c("span",null,"常用",-1),E={key:2,class:"outexplicit"},H=c("span",null,"选择标签",-1),z={class:"svg-wrap"};var F=e({__name:"SelectLabel",props:{selectedList:{type:Array,default:()=>[]},item:{type:Object,default:()=>({})},isDetail:{type:Boolean,default:!1},isLock:{type:Boolean,default:!1},sourceType:{type:String,default:""},explicit:{type:Boolean,default:!1},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},queryCommonlabels:{type:Function,default:()=>Promise.resolve({data:{}})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})}},emits:["onChange"],setup(e,{emit:F}){const V=e,T=l(null),U=t({labelVisible:!1,editLabelItem:{},labelSelectedList:[],labelSelectedEdit:[],inited:!1,isChangeWindow:!1,modalWidth:"763px",modalHeight:"404px",maxHeight:"404px",commonLabelList:[],multipleChoiceConfig:{}});const D=a((()=>{const e=(null==V?void 0:V.item)||{};return(1==e.is_edit||e.isShow)&&!V.isDetail})),$=(e,l)=>{e.length&&e.forEach((e=>{let t=l.some((l=>l.labelId==e.labelId));e.isSelect=t}))},q=(e,l)=>{let t=U.multipleChoiceConfig,a=U.labelSelectedList||[];if(e){if(a.some((e=>e.labelId==l.labelId)))return;"2"==t[l.typeId]&&(a=a.filter((e=>e.typeId!==l.typeId))),a.push(l)}else{const e=a.findIndex((e=>e.labelId==l.labelId));-1!=e&&a.splice(e,1)}F("onChange",[...a]),U.labelSelectedList=a},J=e=>{V.isLock||(V.explicit||"init"===e||(U.labelVisible=!0),M(V.item))},R=()=>{var e;V.explicit||(null==(e=T.value)||e.resetShowAdd(),U.editLabelItem.showAdd=!1,U.editLabelItem={},U.inited=!1,U.modalWidth="763px",U.modalHeight="404px",U.maxHeight="404px",U.isChangeWindow=!1,U.labelVisible=!1)},K=()=>{U.isChangeWindow=!U.isChangeWindow;let e=document.body.clientHeight;U.modalWidth="763px"===U.modalWidth?"100%":"763px",U.modalHeight="404px"===U.modalHeight?e-110+"px":"404px",U.maxHeight="auto"===U.modalHeight?"404px":"none"},G=()=>{var e;null==(e=T.value)||e.handleLabelForm((e=>{F("onChange",[...e]),U.labelSelectedList=e,$(U.commonLabelList,e),R()}))},M=async(e,l)=>{const{rows:t,results:a}=await V.getLabelList(e,{update:l}),i=t||[],o={},s=`${e.val_key}_${e.name}`,n=l?[...U.labelSelectedEdit||[]]:[...U.labelSelectedList||[]];i.forEach((e=>{e.cacheKey=s,e.isSelect=!1,o[e.typeName]?o[e.typeName].itemList.push({...e}):o[e.typeName]={itemList:[{...e}],showAdd:!1,addVal:"",typeName:e.typeName,typeId:e.typeId}})),a&&(e.labelObj=o,e.labelList=i),l&&(U.labelSelectedEdit=n),U.editLabelItem=e,Q(a)},Q=e=>{if(!e)return!1;let l=Object.keys(e),t={},a=(e.typeList||[]).reduce(((e,l)=>(t[l.typeId]=l.multipleChoice,e[l.typeName]={multipleChoice:l.multipleChoice,parentColor:l.parentColor,allowCreateByPersonal:l.allowCreateByPersonal},e)),{});V.explicit&&(U.multipleChoiceConfig=t),l.forEach((l=>{var t,i,o,s,n,d,c;"typeList"!==l&&("emptyTypes"!==l?_.isPlainObject(e[l])?U.editLabelItem.labelObj[l]?(U.editLabelItem.labelObj[l].isNoAdd=!0,U.editLabelItem.labelObj[l].multipleChoice=null==(i=a[l])?void 0:i.multipleChoice,U.editLabelItem.labelObj[l].allowCreateByPersonal=null==(o=a[l])?void 0:o.allowCreateByPersonal,U.editLabelItem.labelObj[l].parentColor=null==(s=a[l])?void 0:s.parentColor):U.editLabelItem.labelObj[l]={addVal:"",showAdd:!1,itemList:!1,typeId:"",typeName:l,allowCreateByPersonal:null==(t=a[l])?void 0:t.allowCreateByPersonal,...a[l]||{}}:(U.editLabelItem.labelObj[l].multipleChoice=null==(n=a[l])?void 0:n.multipleChoice,U.editLabelItem.labelObj[l].allowCreateByPersonal=null==(d=a[l])?void 0:d.allowCreateByPersonal,U.editLabelItem.labelObj[l].parentColor=null==(c=a[l])?void 0:c.parentColor):e[l].forEach((e=>{U.editLabelItem.labelObj[e.typeName]={addVal:"",showAdd:!1,itemList:[],typeId:e.typeId,typeName:e.typeName,allowCreateByPersonal:e.allowCreateByPersonal,...a[e.typeName]||{}}})))}))},X=()=>{M(V.item,!0)},Y=()=>{G()},Z=(e,l)=>{V.explicit&&w((()=>{var t;null==(t=T.value)||t.hanldeSetLabelItem(e,l)}))};return i((()=>{V.explicit?J():(async e=>{const{rows:l,results:t}=await V.getLabelList(e);if(!t)return!1;let a=(t.typeList||[]).reduce(((e,l)=>(e[l.typeId]=l.multipleChoice,e)),{});U.multipleChoiceConfig=a})(V.item)})),o((()=>V.selectedList),(e=>{if(e){let l=Array.isArray(e)?e:[];U.labelSelectedList=JSON.parse(JSON.stringify(l)),$(U.commonLabelList,U.labelSelectedList)}}),{immediate:!0,deep:!0}),o((()=>{var e;return null==(e=V.item)?void 0:e.label_type}),(e=>{e&&"form"==V.sourceType&&(async e=>{var l;let{data:t={}}=await V.queryCommonlabels(e)||{};if("SUCCESS"!==t.result)return;let a=(null==(l=t.map)?void 0:l.rows)||[];$(a,U.labelSelectedList),U.commonLabelList=a})(e)}),{immediate:!0,deep:!0}),(l,t)=>(s(),n(d,null,[c("div",B,[e.explicit?v("v-if",!0):(s(),b(m(x),{key:0,align:"center"},{default:r((()=>[(s(!0),n(d,null,p(U.labelSelectedList,(e=>(s(),b(m(S),{bordered:!1,key:e.labelId,style:u(m(P)(e,!0)),closable:m(D),onClose:l=>(e=>{const l=U.labelSelectedList||[],t=l.findIndex((l=>l.labelId==e.labelId));-1!=t&&l.splice(t,1),F("onChange",[...l]),U.labelSelectedList=l,Z(e.labelId,!1)})(e),size:"small"},{default:r((()=>[L(m(k),{placement:"top-start"},{trigger:r((()=>[c("span",null,y(e.labelName),1)])),default:r((()=>[c("span",null,y(e.labelName),1)])),_:2},1024)])),_:2},1032,["style","closable","onClose"])))),128)),e.explicit?v("v-if",!0):h((s(),n("span",{key:0,class:C(["form-add-icon form-add-icon-label",{disable:e.isLock}]),onClick:J},[L(m(O),{class:"add-icon",component:m(j)},null,8,["component"]),f(" 新增 ")],2)),[[g,m(D)]])])),_:1})),"form"==e.sourceType&&U.commonLabelList.length&&m(D)&&!e.explicit?(s(),b(m(x),{key:1,align:"center",class:"common-label"},{default:r((()=>[A,(s(!0),n(d,null,p(U.commonLabelList,((e,l)=>(s(),b(m(S),{checkable:"",checked:e.isSelect,"onUpdate:checked":l=>function(e,l){l.isSelect=e,q(e,l)}(l,e),key:l,style:u(m(P)(e)),size:"small"},{default:r((()=>[L(m(k),{placement:"top-start"},{trigger:r((()=>[c("span",null,y(e.labelName),1)])),default:r((()=>[c("span",null,y(e.labelName),1)])),_:2},1024)])),_:2},1032,["checked","onUpdate:checked","style"])))),128))])),_:1})):v("v-if",!0),e.explicit&&m(D)?(s(),n("div",E,[L(W,I(l.$attrs,{ref_key:"labelFormContentRef",ref:T,explicit:e.explicit,labelSelectedList:U.labelSelectedList,isChangeWindow:U.isChangeWindow,labelOptions:U.editLabelItem.labelObj,deleteLabel:e.deleteLabel,saveLabelItem:e.saveLabelItem,onUpdateLabelData:X,onExplicitOnChange:Y}),null,16,["explicit","labelSelectedList","isChangeWindow","labelOptions","deleteLabel","saveLabelItem"])])):v("v-if",!0)]),v(" 弹窗 "),L(m(N),{preset:"dialog",class:C(["label-form-modal-wrap modal-wrap standard-modal standard-modal-white",{"modal-screen":U.isChangeWindow}]),show:U.labelVisible,"onUpdate:show":t[0]||(t[0]=e=>U.labelVisible=e),onPositiveClick:G,onNegativeClick:R,onClose:R,"mask-closable":!1,"close-on-esc":!1,"show-icon":!1,"negative-text":"取消","positive-text":"确定",style:u({width:U.modalWidth})},{header:r((()=>[H,c("div",z,[c("i",{onClick:K,class:C(["iconfont-select-label",U.isChangeWindow?"icon-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-select-label-menzhenyishengzhanxitongtubiaozuidahua"])},null,2)])])),default:r((()=>[L(W,I(l.$attrs,{ref_key:"labelFormContentRef",ref:T,labelSelectedList:U.labelSelectedList,isChangeWindow:U.isChangeWindow,labelOptions:U.editLabelItem.labelObj,sourceType:e.sourceType,deleteLabel:e.deleteLabel,saveLabelItem:e.saveLabelItem,onUpdateLabelData:X}),null,16,["labelSelectedList","isChangeWindow","labelOptions","sourceType","deleteLabel","saveLabelItem"])])),_:1},8,["show","class","style"])],64))}});export{F as default};
1
+ import{defineComponent as e,ref as l,reactive as t,computed as a,onMounted as i,watch as o,openBlock as s,createElementBlock as n,Fragment as d,createElementVNode as c,createBlock as b,unref as m,withCtx as r,renderList as p,normalizeStyle as u,createVNode as L,toDisplayString as h,withDirectives as y,normalizeClass as C,createTextVNode as f,vShow as g,createCommentVNode as v,mergeProps as I,nextTick as w}from"vue";import{NSpace as x,NTag as S,NTooltip as k,NIcon as O,NModal as j}from"naive-ui";import{AddCircleOutline as N}from"@vicons/ionicons5";import W from"./LabelFormContent.vue.js";import{handleLabelColor as P}from"../../../shared/utils/vexutils.js";import _ from"../../../shared/utils/vexutilsExpand.js";const B={class:"c-select-label"},E=c("span",null,"常用",-1),A={key:2,class:"outexplicit"},H=c("span",null,"选择标签",-1),z={class:"svg-wrap"};var F=e({__name:"SelectLabel",props:{selectedList:{type:Array,default:()=>[]},item:{type:Object,default:()=>({})},isDetail:{type:Boolean,default:!1},isLock:{type:Boolean,default:!1},sourceType:{type:String,default:""},explicit:{type:Boolean,default:!1},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},queryCommonlabels:{type:Function,default:()=>Promise.resolve({data:{}})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})}},emits:["onChange"],setup(e,{emit:F}){const V=e,T=l(null),U=t({labelVisible:!1,editLabelItem:{},labelSelectedList:[],labelSelectedEdit:[],inited:!1,isChangeWindow:!1,modalWidth:"763px",modalHeight:"404px",maxHeight:"404px",commonLabelList:[],multipleChoiceConfig:{}});const D=a((()=>{const e=(null==V?void 0:V.item)||{};return(1==e.is_edit||e.isShow)&&!V.isDetail})),$=(e,l)=>{e.length&&e.forEach((e=>{let t=l.some((l=>l.labelId==e.labelId));e.isSelect=t}))},q=(e,l)=>{let t=U.multipleChoiceConfig,a=U.labelSelectedList||[];if(e){if(a.some((e=>e.labelId==l.labelId)))return;"2"==t[l.typeId]&&(a=a.filter((e=>e.typeId!==l.typeId))),a.push(l)}else{const e=a.findIndex((e=>e.labelId==l.labelId));-1!=e&&a.splice(e,1)}F("onChange",[...a]),U.labelSelectedList=a},J=e=>{V.isLock||(V.explicit||"init"===e||(U.labelVisible=!0),M(V.item))},R=()=>{var e;V.explicit||(null==(e=T.value)||e.resetShowAdd(),U.editLabelItem.showAdd=!1,U.editLabelItem={},U.inited=!1,U.modalWidth="763px",U.modalHeight="404px",U.maxHeight="404px",U.isChangeWindow=!1,U.labelVisible=!1)},K=()=>{U.isChangeWindow=!U.isChangeWindow;let e=document.body.clientHeight;U.modalWidth="763px"===U.modalWidth?"100%":"763px",U.modalHeight="404px"===U.modalHeight?e-110+"px":"404px",U.maxHeight="auto"===U.modalHeight?"404px":"none"},G=()=>{var e;null==(e=T.value)||e.handleLabelForm((e=>{F("onChange",[...e]),U.labelSelectedList=e,$(U.commonLabelList,e),R()}))},M=async(e,l)=>{const{rows:t,results:a}=await V.getLabelList(e,{update:l}),i=t||[],o={},s=`${e.val_key}_${e.name}`,n=l?[...U.labelSelectedEdit||[]]:[...U.labelSelectedList||[]];i.forEach((e=>{e.cacheKey=s,e.isSelect=!1,o[e.typeName]?o[e.typeName].itemList.push({...e}):o[e.typeName]={itemList:[{...e}],showAdd:!1,addVal:"",typeName:e.typeName,typeId:e.typeId}})),a&&(e.labelObj=o,e.labelList=i),l&&(U.labelSelectedEdit=n),U.editLabelItem=e,Q(a)},Q=e=>{if(!e)return!1;let l=Object.keys(e),t={},a=(e.typeList||[]).reduce(((e,l)=>(t[l.typeId]=l.multipleChoice,e[l.typeName]={multipleChoice:l.multipleChoice,parentColor:l.parentColor,allowCreateByPersonal:l.allowCreateByPersonal},e)),{});V.explicit&&(U.multipleChoiceConfig=t),l.forEach((l=>{var t,i,o,s,n,d,c;"typeList"!==l&&("emptyTypes"!==l?_.isPlainObject(e[l])?U.editLabelItem.labelObj[l]?(U.editLabelItem.labelObj[l].isNoAdd=!0,U.editLabelItem.labelObj[l].multipleChoice=null==(i=a[l])?void 0:i.multipleChoice,U.editLabelItem.labelObj[l].allowCreateByPersonal=null==(o=a[l])?void 0:o.allowCreateByPersonal,U.editLabelItem.labelObj[l].parentColor=null==(s=a[l])?void 0:s.parentColor):U.editLabelItem.labelObj[l]={addVal:"",showAdd:!1,itemList:!1,typeId:"",typeName:l,allowCreateByPersonal:null==(t=a[l])?void 0:t.allowCreateByPersonal,...a[l]||{}}:(U.editLabelItem.labelObj[l].multipleChoice=null==(n=a[l])?void 0:n.multipleChoice,U.editLabelItem.labelObj[l].allowCreateByPersonal=null==(d=a[l])?void 0:d.allowCreateByPersonal,U.editLabelItem.labelObj[l].parentColor=null==(c=a[l])?void 0:c.parentColor):e[l].forEach((e=>{U.editLabelItem.labelObj[e.typeName]={addVal:"",showAdd:!1,itemList:[],typeId:e.typeId,typeName:e.typeName,allowCreateByPersonal:e.allowCreateByPersonal,...a[e.typeName]||{}}})))}))},X=()=>{M(V.item,!0)},Y=()=>{G()},Z=(e,l)=>{V.explicit&&w((()=>{var t;null==(t=T.value)||t.hanldeSetLabelItem(e,l)}))};return i((()=>{V.explicit?J():(async e=>{const{rows:l,results:t}=await V.getLabelList(e);if(!t)return!1;let a=(t.typeList||[]).reduce(((e,l)=>(e[l.typeId]=l.multipleChoice,e)),{});U.multipleChoiceConfig=a})(V.item)})),o((()=>V.selectedList),(e=>{if(e){let l=Array.isArray(e)?e:[];U.labelSelectedList=JSON.parse(JSON.stringify(l)),$(U.commonLabelList,U.labelSelectedList)}}),{immediate:!0,deep:!0}),o((()=>{var e;return null==(e=V.item)?void 0:e.label_type}),(e=>{e&&"form"==V.sourceType&&(async e=>{var l;let{data:t={}}=await V.queryCommonlabels(e)||{};if("SUCCESS"!==t.result)return;let a=(null==(l=t.map)?void 0:l.rows)||[];$(a,U.labelSelectedList),U.commonLabelList=a})(e)}),{immediate:!0,deep:!0}),(l,t)=>(s(),n(d,null,[c("div",B,[e.explicit?v("v-if",!0):(s(),b(m(x),{key:0,align:"center"},{default:r((()=>[(s(!0),n(d,null,p(U.labelSelectedList,(e=>(s(),b(m(S),{bordered:!1,key:e.labelId,style:u(m(P)(e,!0)),closable:m(D),onClose:l=>(e=>{const l=U.labelSelectedList||[],t=l.findIndex((l=>l.labelId==e.labelId));-1!=t&&l.splice(t,1),F("onChange",[...l]),U.labelSelectedList=l,Z(e.labelId,!1)})(e),size:"small"},{default:r((()=>[L(m(k),{placement:"top-start"},{trigger:r((()=>[c("span",null,h(e.labelName),1)])),default:r((()=>[c("span",null,h(e.labelName),1)])),_:2},1024)])),_:2},1032,["style","closable","onClose"])))),128)),e.explicit?v("v-if",!0):y((s(),n("span",{key:0,class:C(["form-add-icon form-add-icon-label",{disable:e.isLock}]),onClick:J},[L(m(O),{class:"add-icon",component:m(N)},null,8,["component"]),f(" 新增 ")],2)),[[g,m(D)]])])),_:1})),"form"==e.sourceType&&U.commonLabelList.length&&m(D)&&!e.explicit?(s(),b(m(x),{key:1,align:"center",class:"common-label"},{default:r((()=>[E,(s(!0),n(d,null,p(U.commonLabelList,((e,l)=>(s(),b(m(S),{checkable:"",checked:e.isSelect,"onUpdate:checked":l=>function(e,l){l.isSelect=e,q(e,l)}(l,e),key:l,style:u(m(P)(e)),size:"small"},{default:r((()=>[L(m(k),{placement:"top-start"},{trigger:r((()=>[c("span",null,h(e.labelName),1)])),default:r((()=>[c("span",null,h(e.labelName),1)])),_:2},1024)])),_:2},1032,["checked","onUpdate:checked","style"])))),128))])),_:1})):v("v-if",!0),e.explicit&&m(D)?(s(),n("div",A,[L(W,I(l.$attrs,{ref_key:"labelFormContentRef",ref:T,explicit:e.explicit,labelSelectedList:U.labelSelectedList,isChangeWindow:U.isChangeWindow,labelOptions:U.editLabelItem.labelObj,deleteLabel:e.deleteLabel,saveLabelItem:e.saveLabelItem,onUpdateLabelData:X,onExplicitOnChange:Y}),null,16,["explicit","labelSelectedList","isChangeWindow","labelOptions","deleteLabel","saveLabelItem"])])):v("v-if",!0)]),v(" 弹窗 "),L(m(j),{preset:"dialog",class:C(["label-form-modal-wrap modal-wrap standard-modal standard-modal-white",{"modal-screen":U.isChangeWindow}]),show:U.labelVisible,"onUpdate:show":t[0]||(t[0]=e=>U.labelVisible=e),onPositiveClick:G,onNegativeClick:R,onClose:R,"mask-closable":!1,"close-on-esc":!1,"show-icon":!1,"negative-text":"取消","positive-text":"确定",style:u({width:U.modalWidth})},{header:r((()=>[H,c("div",z,[c("i",{onClick:K,class:C(["iconfont-select-label",U.isChangeWindow?"icon-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-select-label-menzhenyishengzhanxitongtubiaozuidahua"])},null,2)])])),default:r((()=>[L(W,I(l.$attrs,{ref_key:"labelFormContentRef",ref:T,labelSelectedList:U.labelSelectedList,isChangeWindow:U.isChangeWindow,labelOptions:U.editLabelItem.labelObj,sourceType:e.sourceType,deleteLabel:e.deleteLabel,saveLabelItem:e.saveLabelItem,onUpdateLabelData:X}),null,16,["labelSelectedList","isChangeWindow","labelOptions","sourceType","deleteLabel","saveLabelItem"])])),_:1},8,["show","class","style"])],64))}});export{F as default};
@@ -1 +1 @@
1
- import{defineComponent as e,reactive as o,computed as l,onMounted as i,openBlock as s,createElementBlock as t,withDirectives as a,normalizeClass as r,unref as n,createElementVNode as d,Fragment as u,vShow as p,createCommentVNode as m,createVNode as c,withCtx as v,normalizeStyle as f,toDisplayString as g,createTextVNode as h,withModifiers as k,createBlock as y}from"vue";import b from"xe-utils";import"moment";import{getVodData as C}from"../hooks/vod-data.js";import{VodComputed as U}from"../hooks/vod-computed.js";import L from"../../../../shared/components/player-vod/video-modal.js";import V from"../vod-upload-modal.js";import{NIcon as _,NButton as D}from"naive-ui";import{PlayCircleSharp as O,PlayCircleOutline as w,RemoveCircleSharp as S}from"@vicons/ionicons5";import x from"../../../../shared/assets/img/video_default_cover.png.js";import j from"../../../../shared/assets/img/video.png.js";import F from"../../../../shared/assets/img/success.png.js";import z from"../../../../shared/components/VueDraggable/src/vuedraggable.js";import N from"../../../../_virtual/plugin-vue_export-helper.js";const M={class:"c-upload"},A={class:"chunk-btn-content"},J={class:"c-uploader-btn"},B=["src"],P=d("div",{class:"uploader-text"},[d("p",null,"点击上传"),d("span",{class:"guage-text"},"上传视频(不超过50M)")],-1),E=["src"],T=d("div",{class:"uploader-text"},[d("p",null,"上传视频")],-1),R={class:"vod-wrap c-uploader-preview-wrap"},G={key:0,class:"vod-def-bg vod-uploading"},H={class:"vod-def-bg vod-done"},K=["src"],$=["src"],q={class:"c-icon-wrap"},I={class:"vod-def-bg vod-error"},Q=["src"],W={class:"tooltip-wrap error-wrap"},X=["onClick"];var Y=N(e({__name:"vod-chunk-upload",props:{formData:{type:Object,default:()=>({})},source:String,limitNum:{default:1},defFileList:{default:""},isLock:Boolean,isDetail:{type:Boolean,default:!1},getChunkUploadConfig:{type:Function,default:()=>Promise.resolve({})}},emits:["vodFileList"],setup(e,{emit:N}){const Y=e,{VodState:Z}=C(),ee=o(Z),oe={},{isShowBtn:le,maskHeight:ie,showPercent:se,allow_format:te,defaultValue:ae,isDisabled:re,max_size:ne,maxlength:de}=U(Y,ee,{mainForm:oe});console.log(le.value,"----isShowBtn---",Y.formData.title),l((()=>ue()));const ue=()=>{const{formData:e}=Y;let o=[];if(o="guage"===Y.source?Y.defFileList:null==oe?void 0:oe.handleSysParams(oe.defaultValue[e.name]||e.default_val),o=JSON.parse(JSON.stringify(o)),!o)return[];let l=[];return Array.isArray(o)&&(l=[...o]),b.isJSON(o)&&(l=JSON.parse(o)),Array.isArray(l)?(l.forEach((e=>{e.thumbUrl=e.vodCoverUrl||void 0,e.uid=(-Math.random()).toString(),e.status="done"})),ee.fileList=l,console.log(ee.fileList,"----list---list"),pe(l),l):[]},pe=e=>{if(!Array.isArray(e))return"";const{formData:o,source:l}=Y;let i=[];e.forEach((e=>{if("done"===e.status&&(e.response&&"00000"==e.response.code||e.url)){const{data:o={}}=e.response||{};e.url||o.videoUrl;let l=e.vodCoverUrl||o.vodCoverUrl;i.push({name:e.name,size:e.size,url:e.url||o.videoUrl,vodCoverUrl:l,uid:e.id||e.uid||(-Math.random()).toString()})}})),console.log(i,"---resList---",Y.formData.title);let s=JSON.stringify(i);"guage"!==l?oe.baseForm.setFieldsValue({[o.val_key]:s}):N("vodFileList",s,Y.formData)},me=(e,o)=>{let l,i;if(e.type&&(i=e.type),e.url||e.videoUrl){if(l=e.url||e.videoUrl,!i){let e=l.split(".");i=`video/${e[e.length-1]}`}}else l=URL.createObjectURL(e.originFileObj);ee.playerOptions={sources:[{type:i,src:l}]},ee.videoVisible=!0},ce=()=>{ee.videoVisible=!1},ve=()=>{re.value||(ee.chunkUploadVisible=!0)},fe=e=>{let o=[];e.forEach((e=>{let l=e.videoCoverPic||void 0;o.push({name:e.videoName||e.name,url:e.videoUrl||e.url,size:e.size,vodCoverUrl:l,status:"done",uid:(-Math.random()).toString()})})),ee.fileList.push(...o),pe(ee.fileList)},ge=()=>{pe(ee.fileList)};return i((()=>{ue()})),(o,l)=>(s(),t("div",M,[e.isDetail||Y.isLock?m("v-if",!0):a((s(),t("div",{key:0,class:r(["c-chunk-uploader-btn",{"disable-upload":n(re)}]),onClick:ve},[d("div",A,[d("div",J,["guage"==Y.source?(s(),t(u,{key:0},[d("img",{src:n(j),class:"guage-img"},null,8,B),P],64)):(s(),t(u,{key:1},[d("img",{src:n(j),class:"guage-img"},null,8,E),T],64))])])],2)),[[p,n(le)]]),c(n(z),{modelValue:ee.fileList,"onUpdate:modelValue":l[0]||(l[0]=e=>ee.fileList=e),animation:"150",itemKey:"uid",disabled:n(re).value,options:ee.draggableOptions,onUpdate:ge,class:"drag-content"},{item:v((({element:o,index:l})=>{return[d("div",R,[m(" 上传中 "),"uploading"===o.status?(s(),t("div",G,[m(" TODO: 封面图补充 "),d("div",{class:"uploading-mask",style:f({height:n(ie)(o)})},[d("span",null,g(n(se)(o.percent))+"%",1)],4)])):"done"===o.status?(s(),t(u,{key:1},[m(" 上传完成 "),d("div",H,[d("img",{src:(i=o,i.thumbUrl?i.thumbUrl:x),class:"vod-cover-img"},null,8,K),d("div",{class:r(["tooltip-wrap",{"is-new":o.isNew}])},[d("img",{src:n(F),class:"upload-img"},null,8,$),h(" 上传成功 ")],2),m(" 播放图标 "),d("div",q,[c(n(_),{component:n(O),class:"icon-play theme_filled",onClick:k((e=>me(o)),["prevent","stop"])},null,8,["component","onClick"]),c(n(_),{component:n(w),class:"icon-play theme_outlined",onClick:k((e=>me(o)),["prevent","stop"])},null,8,["component","onClick"])])])],2112)):"error"===o.status?(s(),t(u,{key:2},[m(" 上传失败 "),d("div",I,[d("img",{src:o.thumbUrl,class:"vod-cover-img"},null,8,Q),d("div",W,[d("span",null,g(o.message?o.message:"上传失败,继续上传?"),1),c(n(D),{size:"small",onClick:k((e=>{}),["prevent","stop"])},{default:v((()=>[h("确定")])),_:2},1032,["onClick"])])])],2112)):m("v-if",!0),!["done","error"].includes(o.status)||n(re)||e.isDetail?m("v-if",!0):(s(),t("div",{key:3,onClick:k((e=>{return o=l,ee.fileList.splice(o,1),void pe(ee.fileList);var o}),["stop"]),class:"uploader-preview-delete"},[c(n(_),{class:"pre-delete",component:n(S)},null,8,["component"])],8,X))])];var i})),_:1},8,["modelValue","disabled","options"]),ee.videoVisible?(s(),y(n(L),{key:1,visible:ee.videoVisible,formData:Y.formData,playerOptions:ee.playerOptions,onCloseVideoModal:ce},null,8,["visible","formData","playerOptions"])):m("v-if",!0),c(n(V),{modelValue:ee.chunkUploadVisible,"onUpdate:modelValue":l[1]||(l[1]=e=>ee.chunkUploadVisible=e),modalTitle:Y.formData.name,max_size:n(ne),maxLength:n(de),propsCategoryMap:n(te),defaultList:ee.fileList,getChunkUploadConfig:e.getChunkUploadConfig,onGetSumbitList:fe},null,8,["modelValue","modalTitle","max_size","maxLength","propsCategoryMap","defaultList","getChunkUploadConfig"])]))}}),[["__file","vod-chunk-upload.vue"]]);export{Y as default};
1
+ import{defineComponent as e,reactive as o,computed as l,onMounted as s,openBlock as i,createElementBlock as t,withDirectives as a,normalizeClass as r,unref as n,createElementVNode as d,Fragment as u,vShow as p,createCommentVNode as m,createVNode as c,withCtx as v,normalizeStyle as f,toDisplayString as g,createTextVNode as h,withModifiers as k,createBlock as y}from"vue";import"xe-utils";import"moment";import b from"../../../../shared/utils/vexutilsExpand.js";import{getVodData as C}from"../hooks/vod-data.js";import{VodComputed as U}from"../hooks/vod-computed.js";import L from"../../../../shared/components/player-vod/video-modal.js";import V from"../vod-upload-modal.js";import{NIcon as _,NButton as D}from"naive-ui";import{PlayCircleSharp as x,PlayCircleOutline as O,RemoveCircleSharp as w}from"@vicons/ionicons5";import S from"../../../../shared/assets/img/video_default_cover.png.js";import j from"../../../../shared/assets/img/video.png.js";import F from"../../../../shared/assets/img/success.png.js";import z from"../../../../shared/components/VueDraggable/src/vuedraggable.js";import N from"../../../../_virtual/plugin-vue_export-helper.js";const M={class:"c-upload"},A={class:"chunk-btn-content"},J={class:"c-uploader-btn"},B=["src"],E=d("div",{class:"uploader-text"},[d("p",null,"点击上传"),d("span",{class:"guage-text"},"上传视频(不超过50M)")],-1),P=["src"],T=d("div",{class:"uploader-text"},[d("p",null,"上传视频")],-1),R={class:"vod-wrap c-uploader-preview-wrap"},G={key:0,class:"vod-def-bg vod-uploading"},H={class:"vod-def-bg vod-done"},K=["src"],$=["src"],q={class:"c-icon-wrap"},I={class:"vod-def-bg vod-error"},Q=["src"],W={class:"tooltip-wrap error-wrap"},X=["onClick"];var Y=N(e({__name:"vod-chunk-upload",props:{formData:{type:Object,default:()=>({})},source:String,limitNum:{default:1},defFileList:{default:""},isLock:Boolean,isDetail:{type:Boolean,default:!1},getChunkUploadConfig:{type:Function,default:()=>Promise.resolve({})}},emits:["vodFileList"],setup(e,{emit:N}){const Y=e,{VodState:Z}=C(),ee=o(Z),oe={},{isShowBtn:le,maskHeight:se,showPercent:ie,allow_format:te,defaultValue:ae,isDisabled:re,max_size:ne,maxlength:de}=U(Y,ee,{mainForm:oe});console.log(le.value,"----isShowBtn---",Y.formData.title),l((()=>ue()));const ue=()=>{const{formData:e}=Y;let o=[];if(o="guage"===Y.source?Y.defFileList:null==oe?void 0:oe.handleSysParams(oe.defaultValue[e.name]||e.default_val),o=JSON.parse(JSON.stringify(o)),!o)return[];let l=[];return Array.isArray(o)&&(l=[...o]),b.isJSON(o)&&(l=JSON.parse(o)),Array.isArray(l)?(l.forEach((e=>{e.thumbUrl=e.vodCoverUrl||void 0,e.uid=(-Math.random()).toString(),e.status="done"})),ee.fileList=l,console.log(ee.fileList,"----list---list"),pe(l),l):[]},pe=e=>{if(!Array.isArray(e))return"";const{formData:o,source:l}=Y;let s=[];e.forEach((e=>{if("done"===e.status&&(e.response&&"00000"==e.response.code||e.url)){const{data:o={}}=e.response||{};e.url||o.videoUrl;let l=e.vodCoverUrl||o.vodCoverUrl;s.push({name:e.name,size:e.size,url:e.url||o.videoUrl,vodCoverUrl:l,uid:e.id||e.uid||(-Math.random()).toString()})}})),console.log(s,"---resList---",Y.formData.title);let i=JSON.stringify(s);"guage"!==l?oe.baseForm.setFieldsValue({[o.val_key]:i}):N("vodFileList",i,Y.formData)},me=(e,o)=>{let l,s;if(e.type&&(s=e.type),e.url||e.videoUrl){if(l=e.url||e.videoUrl,!s){let e=l.split(".");s=`video/${e[e.length-1]}`}}else l=URL.createObjectURL(e.originFileObj);ee.playerOptions={sources:[{type:s,src:l}]},ee.videoVisible=!0},ce=()=>{ee.videoVisible=!1},ve=()=>{re.value||(ee.chunkUploadVisible=!0)},fe=e=>{let o=[];e.forEach((e=>{let l=e.videoCoverPic||void 0;o.push({name:e.videoName||e.name,url:e.videoUrl||e.url,size:e.size,vodCoverUrl:l,status:"done",uid:(-Math.random()).toString()})})),ee.fileList.push(...o),pe(ee.fileList)},ge=()=>{pe(ee.fileList)};return s((()=>{ue()})),(o,l)=>(i(),t("div",M,[e.isDetail||Y.isLock?m("v-if",!0):a((i(),t("div",{key:0,class:r(["c-chunk-uploader-btn",{"disable-upload":n(re)}]),onClick:ve},[d("div",A,[d("div",J,["guage"==Y.source?(i(),t(u,{key:0},[d("img",{src:n(j),class:"guage-img"},null,8,B),E],64)):(i(),t(u,{key:1},[d("img",{src:n(j),class:"guage-img"},null,8,P),T],64))])])],2)),[[p,n(le)]]),c(n(z),{modelValue:ee.fileList,"onUpdate:modelValue":l[0]||(l[0]=e=>ee.fileList=e),animation:"150",itemKey:"uid",disabled:n(re).value,options:ee.draggableOptions,onUpdate:ge,class:"drag-content"},{item:v((({element:o,index:l})=>{return[d("div",R,[m(" 上传中 "),"uploading"===o.status?(i(),t("div",G,[m(" TODO: 封面图补充 "),d("div",{class:"uploading-mask",style:f({height:n(se)(o)})},[d("span",null,g(n(ie)(o.percent))+"%",1)],4)])):"done"===o.status?(i(),t(u,{key:1},[m(" 上传完成 "),d("div",H,[d("img",{src:(s=o,s.thumbUrl?s.thumbUrl:S),class:"vod-cover-img"},null,8,K),d("div",{class:r(["tooltip-wrap",{"is-new":o.isNew}])},[d("img",{src:n(F),class:"upload-img"},null,8,$),h(" 上传成功 ")],2),m(" 播放图标 "),d("div",q,[c(n(_),{component:n(x),class:"icon-play theme_filled",onClick:k((e=>me(o)),["prevent","stop"])},null,8,["component","onClick"]),c(n(_),{component:n(O),class:"icon-play theme_outlined",onClick:k((e=>me(o)),["prevent","stop"])},null,8,["component","onClick"])])])],2112)):"error"===o.status?(i(),t(u,{key:2},[m(" 上传失败 "),d("div",I,[d("img",{src:o.thumbUrl,class:"vod-cover-img"},null,8,Q),d("div",W,[d("span",null,g(o.message?o.message:"上传失败,继续上传?"),1),c(n(D),{size:"small",onClick:k((e=>{}),["prevent","stop"])},{default:v((()=>[h("确定")])),_:2},1032,["onClick"])])])],2112)):m("v-if",!0),!["done","error"].includes(o.status)||n(re)||e.isDetail?m("v-if",!0):(i(),t("div",{key:3,onClick:k((e=>{return o=l,ee.fileList.splice(o,1),void pe(ee.fileList);var o}),["stop"]),class:"uploader-preview-delete"},[c(n(_),{class:"pre-delete",component:n(w)},null,8,["component"])],8,X))])];var s})),_:1},8,["modelValue","disabled","options"]),ee.videoVisible?(i(),y(n(L),{key:1,visible:ee.videoVisible,formData:Y.formData,playerOptions:ee.playerOptions,onCloseVideoModal:ce},null,8,["visible","formData","playerOptions"])):m("v-if",!0),c(n(V),{modelValue:ee.chunkUploadVisible,"onUpdate:modelValue":l[1]||(l[1]=e=>ee.chunkUploadVisible=e),modalTitle:Y.formData.name,max_size:n(ne),maxLength:n(de),propsCategoryMap:n(te),defaultList:ee.fileList,getChunkUploadConfig:e.getChunkUploadConfig,onGetSumbitList:fe},null,8,["modelValue","modalTitle","max_size","maxLength","propsCategoryMap","defaultList","getChunkUploadConfig"])]))}}),[["__file","vod-chunk-upload.vue"]]);export{Y as default};
@@ -41,7 +41,7 @@ declare const _default: import("vue").DefineComponent<{
41
41
  isAlias?: boolean | undefined;
42
42
  };
43
43
  isDisabledTooltip: import("vue").Ref<boolean>;
44
- curContent: import("vue").ComputedRef<string>;
44
+ curContent: import("vue").ComputedRef<string | number>;
45
45
  $refName: any;
46
46
  onMouseOver: (str: any) => void;
47
47
  onMouseOut: () => void;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as l,openBlock as o,createElementBlock as i,createVNode as a,unref as r,withCtx as n,createElementVNode as s,normalizeClass as u,renderSlot as f,toDisplayString as p,createTextVNode as m}from"vue";import{NTooltip as c}from"naive-ui";import v from"xe-utils";import"moment";import d from"../../../_virtual/plugin-vue_export-helper.js";const _={class:"text-over-tooltip-components"};var x=d(e({__name:"TextOverTooltip",props:{content:null,className:null,refName:null,effect:{default:"dark"},placement:{default:"top"},tooltipTitle:{default:""},isAlias:{type:Boolean}},setup(e){const d=e;let x=t(!1);const N=l((()=>{let e=d.tooltipTitle||d.content||"";return v.isNumber(e)?e.toString():e})),T=t(null),h=()=>{x.value=!1};return(t,l)=>(o(),i("div",_,[a(r(c),{effect:e.effect,show:r(x),placement:e.placement},{trigger:n((()=>[s("div",{class:u(["ellipsis",e.className]),onMouseover:l[0]||(l[0]=t=>(e=>{if(d.isAlias)return void(x.value=!0);let t=T.value.parentNode.offsetWidth,l=T.value.offsetWidth;x.value=l>t})(e.refName)),onMouseout:h},[s("i",{ref:e=>{e&&(T.value=e)}},[f(t.$slots,"default"),s("i",null,p(e.content),1)],512)],34)])),default:n((()=>[m(" "+p(r(N)),1)])),_:3},8,["effect","show","placement"])]))}}),[["__file","TextOverTooltip.vue"]]);export{x as default};
1
+ import{defineComponent as e,ref as t,computed as l,openBlock as o,createElementBlock as i,createVNode as a,unref as r,withCtx as s,createElementVNode as u,normalizeClass as n,renderSlot as p,toDisplayString as f,createTextVNode as m}from"vue";import{NTooltip as v}from"naive-ui";import"xe-utils";import"moment";import c from"../../utils/vexutilsExpand.js";import d from"../../../_virtual/plugin-vue_export-helper.js";const x={class:"text-over-tooltip-components"};var _=d(e({__name:"TextOverTooltip",props:{content:null,className:null,refName:null,effect:{default:"dark"},placement:{default:"top"},tooltipTitle:{default:""},isAlias:{type:Boolean}},setup(e){const d=e;let _=t(!1);const N=l((()=>{let e=d.tooltipTitle||d.content||"";return c.isNumber(e)?e.toString():e})),T=t(null),h=()=>{_.value=!1};return(t,l)=>(o(),i("div",x,[a(r(v),{effect:e.effect,show:r(_),placement:e.placement},{trigger:s((()=>[u("div",{class:n(["ellipsis",e.className]),onMouseover:l[0]||(l[0]=t=>(e=>{if(d.isAlias)return void(_.value=!0);let t=T.value.parentNode.offsetWidth,l=T.value.offsetWidth;_.value=l>t})(e.refName)),onMouseout:h},[u("i",{ref:e=>{e&&(T.value=e)}},[p(t.$slots,"default"),u("i",null,f(e.content),1)],512)],34)])),default:s((()=>[m(" "+f(r(N)),1)])),_:3},8,["effect","show","placement"])]))}}),[["__file","TextOverTooltip.vue"]]);export{_ as default};
@@ -4,8 +4,7 @@ export function handleLabelColor(item: any, isSelect: any): {
4
4
  background: string;
5
5
  borderColor: string;
6
6
  };
7
- export function isJSON(str: any): boolean;
8
- export default XEUtils;
7
+ export default vexutilsExpand;
9
8
  export { moment };
10
- import XEUtils from "xe-utils";
9
+ import vexutilsExpand from "./vexutilsExpand";
11
10
  import moment from "moment";
@@ -1 +1 @@
1
- import r from"xe-utils";export{default}from"xe-utils";export{default as moment}from"moment";function o(o,f){var e;let l="#5585f5",a={blue:"#0000ff",sky:"#87ceeb",azure:"#f0ffff",palegreen:"#98fb98",yellow:"#ffff00",darkorange:"#ff8c00",magenta:"#ff00ff",purple:"#800080",maroon:"#800000",orange:"#ffa500",green:"#008000",red:"#ff0000",grey:"#808080"};if(null==(e=null==o?void 0:o.color)?void 0:e.includes("-")){l=a[o.color.split("-")[1]]||"#5585f5"}else l=o.color||"#5585f5";const b=r.hexToRGBA(l)||{r:85,g:133,b:245,a:1};if(f)return{color:"#fff",background:`rgba(${b.r}, ${b.g}, ${b.b})`,borderColor:`rgba(${b.r}, ${b.g}, ${b.b})`};if(o.isSelect)return{color:"#fff",background:`rgba(${b.r}, ${b.g}, ${b.b})`,borderColor:`rgba(${b.r}, ${b.g}, ${b.b})`};return{color:!(o.isPublic&&1==o.isPublic)?"rgba(28, 28, 28, 1)":"rgba(33, 33, 33, 0.6)",background:"rgba(250, 250, 250, 1)",borderColor:"rgba(213, 213, 213, 0.8)"}}export{o as handleLabelColor};
1
+ import r from"xe-utils";export{default as moment}from"moment";import o from"./vexutilsExpand.js";export{default}from"./vexutilsExpand.js";function f(o,f){var e;let l="#5585f5",a={blue:"#0000ff",sky:"#87ceeb",azure:"#f0ffff",palegreen:"#98fb98",yellow:"#ffff00",darkorange:"#ff8c00",magenta:"#ff00ff",purple:"#800080",maroon:"#800000",orange:"#ffa500",green:"#008000",red:"#ff0000",grey:"#808080"};if(null==(e=null==o?void 0:o.color)?void 0:e.includes("-")){l=a[o.color.split("-")[1]]||"#5585f5"}else l=o.color||"#5585f5";const b=r.hexToRGBA(l)||{r:85,g:133,b:245,a:1};if(f)return{color:"#fff",background:`rgba(${b.r}, ${b.g}, ${b.b})`,borderColor:`rgba(${b.r}, ${b.g}, ${b.b})`};if(o.isSelect)return{color:"#fff",background:`rgba(${b.r}, ${b.g}, ${b.b})`,borderColor:`rgba(${b.r}, ${b.g}, ${b.b})`};return{color:!(o.isPublic&&1==o.isPublic)?"rgba(28, 28, 28, 1)":"rgba(33, 33, 33, 0.6)",background:"rgba(250, 250, 250, 1)",borderColor:"rgba(213, 213, 213, 0.8)"}}export{f as handleLabelColor};
@@ -0,0 +1,254 @@
1
+ declare const _default: {
2
+ parseCondition: (conList: any, data: any, fieldList: any) => boolean;
3
+ getFieldByKey: (fieldKey: any, fieldList: any) => any;
4
+ getConnection: (cObj: any, fVal: any, field: any) => boolean;
5
+ getBetween: (value: any, type: any, comVal: any) => boolean | undefined;
6
+ convertDate: (str: any) => Date | undefined;
7
+ addDate: (tempDate: any, days: any, unit: any) => Date | undefined;
8
+ addDiDate: (curDate: any, count: any, unit: string | undefined, type: any) => {
9
+ startTime: number;
10
+ endTime: number;
11
+ };
12
+ getCurSeasonFirstDay: () => Date;
13
+ isNumber: (val: any) => boolean;
14
+ isDate: (data: any) => boolean;
15
+ isJSON(str: any): boolean;
16
+ /**
17
+ * 获取按钮自定义颜色
18
+ * @param {string} v
19
+ */
20
+ getBtnStyle(v: string): {
21
+ 'border-color': any;
22
+ color: any;
23
+ 'background-color'?: undefined;
24
+ } | {
25
+ color: any;
26
+ 'border-color'?: undefined;
27
+ 'background-color'?: undefined;
28
+ } | {
29
+ 'background-color': any;
30
+ 'border-color': any;
31
+ color?: undefined;
32
+ };
33
+ oldColorMap(str: any): any;
34
+ validateBirthday(val: any, title: any, type: any): boolean;
35
+ handleImageSize(item: any, defaultHeight: any): {
36
+ display: string;
37
+ height: any;
38
+ };
39
+ /**
40
+ * 大数组复制
41
+ * @param {*} arr 复制的数据
42
+ * @param {*} size 每次操作的数据量
43
+ * @returns {Array}
44
+ */
45
+ handleBigArrayCopy(arr: any, size?: any): any[];
46
+ getAlphafloat(a: any, alpha: any): number;
47
+ hexToRGBA(hex: any, alpha: any): "" | {
48
+ r: any;
49
+ g: any;
50
+ b: any;
51
+ a: any;
52
+ };
53
+ /**
54
+ *
55
+ * 时间转换
56
+ * @param {type} type 时间戳类型
57
+ * @param {time} time 时间戳
58
+ */
59
+ formatTime(type: any, time: any): string;
60
+ formatDate(date: any, isShowYear?: boolean): any;
61
+ imgs2imgArr(imgs: any): any;
62
+ filterOption(input: any, option: any): boolean;
63
+ /**
64
+ * 转换含有###的值
65
+ * @param {*} item
66
+ * @param {*} k key
67
+ * @returns
68
+ */
69
+ stringToValue(item: any, k?: any): any;
70
+ notEmpty(text: any): boolean;
71
+ anyNotEmpty(text: any): any;
72
+ handleMultiTips(str: any, arr?: {}): any;
73
+ /**
74
+ * 变量转换
75
+ * @param {string} str
76
+ * @param {object} obj
77
+ * @param {string | number} noval // 没有值,默认赋值
78
+ */
79
+ handleSysParams(str: string, obj?: object, noval?: string | number): string;
80
+ /**
81
+ * 按钮setting中params参数解析
82
+ */
83
+ setParamsValue(paramsList: any, dbData: any): {};
84
+ isPlainObject(obj: any): boolean;
85
+ VERSION: string;
86
+ setup: typeof import("xe-utils/ctor").setup;
87
+ mixin: typeof import("xe-utils/ctor").mixin;
88
+ commafy: typeof import("xe-utils").commafy;
89
+ getDateDiff: typeof import("xe-utils").getDateDiff;
90
+ getWhatWeek: typeof import("xe-utils").getWhatWeek;
91
+ toDateString: typeof import("xe-utils").toDateString;
92
+ assign: typeof import("xe-utils").assign;
93
+ objectEach: typeof import("xe-utils").objectEach;
94
+ lastObjectEach: typeof import("xe-utils").lastObjectEach;
95
+ objectMap: typeof import("xe-utils").objectMap;
96
+ merge: typeof import("xe-utils").merge;
97
+ map: typeof import("xe-utils").map;
98
+ some: typeof import("xe-utils").some;
99
+ every: typeof import("xe-utils").every;
100
+ includeArrays: typeof import("xe-utils").includeArrays;
101
+ arrayEach: typeof import("xe-utils").arrayEach;
102
+ lastArrayEach: typeof import("xe-utils").lastArrayEach;
103
+ uniq: typeof import("xe-utils").uniq;
104
+ union: typeof import("xe-utils").union;
105
+ toArray: typeof import("xe-utils").toArray;
106
+ orderBy: typeof import("xe-utils").orderBy;
107
+ sortBy: typeof import("xe-utils").orderBy;
108
+ shuffle: typeof import("xe-utils").shuffle;
109
+ sample: typeof import("xe-utils").sample;
110
+ slice: typeof import("xe-utils").slice;
111
+ filter: typeof import("xe-utils").filter;
112
+ findKey: typeof import("xe-utils").findKey;
113
+ includes: typeof import("xe-utils").includes;
114
+ find: typeof import("xe-utils").find;
115
+ findLast: typeof import("xe-utils").findLast;
116
+ reduce: typeof import("xe-utils").reduce;
117
+ copyWithin: typeof import("xe-utils").copyWithin;
118
+ chunk: typeof import("xe-utils").chunk;
119
+ zip: typeof import("xe-utils").zip;
120
+ unzip: typeof import("xe-utils").unzip;
121
+ zipObject: typeof import("xe-utils").zipObject;
122
+ pluck: typeof import("xe-utils").pluck;
123
+ invoke: typeof import("xe-utils").invoke;
124
+ toArrayTree: typeof import("xe-utils").toArrayTree;
125
+ toTreeArray: typeof import("xe-utils").toTreeArray;
126
+ findTree: typeof import("xe-utils").findTree;
127
+ eachTree: typeof import("xe-utils").eachTree;
128
+ mapTree: typeof import("xe-utils").mapTree;
129
+ filterTree: typeof import("xe-utils").filterTree;
130
+ searchTree: typeof import("xe-utils").searchTree;
131
+ arrayIndexOf: typeof import("xe-utils").arrayIndexOf;
132
+ arrayLastIndexOf: typeof import("xe-utils").arrayLastIndexOf;
133
+ hasOwnProp: typeof import("xe-utils").hasOwnProp;
134
+ isArray: typeof import("xe-utils").isArray;
135
+ isNull: typeof import("xe-utils").isNull;
136
+ isNaN: typeof import("xe-utils").isNaN;
137
+ isUndefined: typeof import("xe-utils").isUndefined;
138
+ isFunction: typeof import("xe-utils").isFunction;
139
+ isObject: typeof import("xe-utils").isObject;
140
+ isString: typeof import("xe-utils").isString;
141
+ isLeapYear: typeof import("xe-utils").isLeapYear;
142
+ eqNull: typeof import("xe-utils").eqNull;
143
+ each: typeof import("xe-utils").each;
144
+ forOf: typeof import("xe-utils").forOf;
145
+ lastForOf: typeof import("xe-utils").lastForOf;
146
+ indexOf: typeof import("xe-utils").indexOf;
147
+ lastIndexOf: typeof import("xe-utils").lastIndexOf;
148
+ keys: typeof import("xe-utils").keys;
149
+ values: typeof import("xe-utils").values;
150
+ clone: typeof import("xe-utils").clone;
151
+ getSize: typeof import("xe-utils").getSize;
152
+ lastEach: typeof import("xe-utils").lastEach;
153
+ remove: typeof import("xe-utils").remove;
154
+ clear: typeof import("xe-utils").clear;
155
+ isFinite: typeof import("xe-utils").isFinite;
156
+ isFloat: typeof import("xe-utils").isFloat;
157
+ isInteger: typeof import("xe-utils").isInteger;
158
+ isBoolean: typeof import("xe-utils").isBoolean;
159
+ isRegExp: typeof import("xe-utils").isRegExp;
160
+ isError: typeof import("xe-utils").isError;
161
+ isTypeError: typeof import("xe-utils").isTypeError;
162
+ isEmpty: typeof import("xe-utils").isEmpty;
163
+ isSymbol: typeof import("xe-utils").isSymbol;
164
+ isArguments: typeof import("xe-utils").isArguments;
165
+ isElement: typeof import("xe-utils").isElement;
166
+ isDocument: typeof import("xe-utils").isDocument;
167
+ isWindow: typeof import("xe-utils").isWindow;
168
+ isFormData: typeof import("xe-utils").isFormData;
169
+ isMap: typeof import("xe-utils").isMap;
170
+ isWeakMap: typeof import("xe-utils").isWeakMap;
171
+ isSet: typeof import("xe-utils").isSet;
172
+ isWeakSet: typeof import("xe-utils").isWeakSet;
173
+ isMatch: typeof import("xe-utils").isMatch;
174
+ isEqual: typeof import("xe-utils").isEqual;
175
+ isEqualWith: typeof import("xe-utils").isEqualWith;
176
+ getType: typeof import("xe-utils").getType;
177
+ uniqueId: typeof import("xe-utils").uniqueId;
178
+ findIndexOf: typeof import("xe-utils").findIndexOf;
179
+ findLastIndexOf: typeof import("xe-utils").findLastIndexOf;
180
+ toStringJSON: typeof import("xe-utils").toStringJSON;
181
+ toJSONString: typeof import("xe-utils").toJSONString;
182
+ entries: typeof import("xe-utils").entries;
183
+ pick: typeof import("xe-utils").pick;
184
+ omit: typeof import("xe-utils").omit;
185
+ first: typeof import("xe-utils").first;
186
+ last: typeof import("xe-utils").last;
187
+ has: typeof import("xe-utils").has;
188
+ get: typeof import("xe-utils").get;
189
+ set: typeof import("xe-utils").set;
190
+ groupBy: typeof import("xe-utils").groupBy;
191
+ countBy: typeof import("xe-utils").countBy;
192
+ range: typeof import("xe-utils").range;
193
+ destructuring: typeof import("xe-utils").destructuring;
194
+ random: typeof import("xe-utils").random;
195
+ max: typeof import("xe-utils").max;
196
+ min: typeof import("xe-utils").min;
197
+ round: typeof import("xe-utils").round;
198
+ ceil: typeof import("xe-utils").ceil;
199
+ floor: typeof import("xe-utils").floor;
200
+ toInteger: typeof import("xe-utils").toInteger;
201
+ toNumber: typeof import("xe-utils").toNumber;
202
+ add: typeof import("xe-utils").add;
203
+ subtract: typeof import("xe-utils").subtract;
204
+ multiply: typeof import("xe-utils").multiply;
205
+ divide: typeof import("xe-utils").divide;
206
+ sum: typeof import("xe-utils").sum;
207
+ mean: typeof import("xe-utils").mean;
208
+ getWhatYear: typeof import("xe-utils").getWhatYear;
209
+ getWhatQuarter: typeof import("xe-utils").getWhatQuarter;
210
+ getWhatMonth: typeof import("xe-utils").getWhatMonth;
211
+ getWhatDay: typeof import("xe-utils").getWhatDay;
212
+ toStringDate: typeof import("xe-utils").toStringDate;
213
+ now: typeof import("xe-utils").now;
214
+ timestamp: typeof import("xe-utils").timestamp;
215
+ isValidDate: typeof import("xe-utils").isValidDate;
216
+ isDateSame: typeof import("xe-utils").isDateSame;
217
+ getYearDay: typeof import("xe-utils").getYearDay;
218
+ getYearWeek: typeof import("xe-utils").getYearWeek;
219
+ getMonthWeek: typeof import("xe-utils").getMonthWeek;
220
+ getDayOfYear: typeof import("xe-utils").getDayOfYear;
221
+ getDayOfMonth: typeof import("xe-utils").getDayOfMonth;
222
+ padEnd: typeof import("xe-utils").padEnd;
223
+ padStart: typeof import("xe-utils").padStart;
224
+ repeat: typeof import("xe-utils").repeat;
225
+ trim: typeof import("xe-utils").trim;
226
+ trimRight: typeof import("xe-utils").trimRight;
227
+ trimLeft: typeof import("xe-utils").trimLeft;
228
+ escape: typeof import("xe-utils").escape;
229
+ unescape: typeof import("xe-utils").unescape;
230
+ camelCase: typeof import("xe-utils").camelCase;
231
+ kebabCase: typeof import("xe-utils").kebabCase;
232
+ startsWith: typeof import("xe-utils").startsWith;
233
+ endsWith: typeof import("xe-utils").endsWith;
234
+ template: typeof import("xe-utils").template;
235
+ toFormatString: typeof import("xe-utils").toFormatString;
236
+ toString: typeof import("xe-utils").toString;
237
+ toValueString: typeof import("xe-utils").toValueString;
238
+ property: typeof import("xe-utils").property;
239
+ bind: typeof import("xe-utils").bind;
240
+ once: typeof import("xe-utils").once;
241
+ after: typeof import("xe-utils").after;
242
+ before: typeof import("xe-utils").before;
243
+ throttle: typeof import("xe-utils").throttle;
244
+ debounce: typeof import("xe-utils").debounce;
245
+ delay: typeof import("xe-utils").delay;
246
+ unserialize: typeof import("xe-utils").unserialize;
247
+ serialize: typeof import("xe-utils").serialize;
248
+ parseUrl: typeof import("xe-utils").parseUrl;
249
+ getBaseURL: typeof import("xe-utils").getBaseURL;
250
+ locat: typeof import("xe-utils").locat;
251
+ cookie: import("xe-utils").cookie;
252
+ browse: typeof import("xe-utils").browse;
253
+ };
254
+ export default _default;