DetailForm-c592b8d8-CP_-OJTq.js 11 KB

12
  1. import{f as te,e as ie,w as le,d as ne,ag as D,aq as c,ar as p,as as E,k as I,aD as $,F as M,aC as J,aB as U,at as m,au as V}from"./vue-vendor-Be68asQ6.js";import{co as ae,u as re,cw as oe,f as _,b as se,aF as B,j as de,aH as ue,ax as pe,av as ce,cz as me,d as fe,aL as ge,cx as he,H as N}from"./index-BFfnEkVs.js";import{bY as ye,bZ as ve,b_ as ke}from"./antd-vue-vendor-DcqS7Wvq.js";import{L as we}from"./useExtendComponent-bb98e568-D2z9GsqT.js";import{a as be}from"./index-CgB-9WQb.js";import"./componentMap-BUTAcOmo.js";import"./index-CETWS1o0.js";import"./index-D68l__AG.js";import"./constant-fa63bd66-Ddbq-fz2.js";import"./index-DPdfb5jl.js";import"./user.api-BMRcwGEd.js";import"./customExpression-BHJdu2h2.js";import"./index-D2G57Sln.js";import"./useListPage-aOfrd-Tw.js";import"./LinkTableListPiece-e016b8e6-BV6j69dt.js";import"./OnlineSelectCascade-d631ed72-woz5vuX0.js";import"./JModalTip-a927f85d-cvoo-Gj-.js";import"./vxe-table-vendor-DHF2TRpV.js";import"./JUpload-cB_Qj2H2.js";import"./useForm-kcRIHoe0.js";import"./BasicForm-Cv-dsB-e.js";import"./index-BZ_MXCtW.js";import"./index-BIPzXG41.js";import"./index-CXEQnmRq.js";import"./useTimeout-Ca5eqGu-.js";import"./useIntersectionObserver-Bl62RIZ4.js";import"./BasicModal-D4gc2R81.js";import"./useWindowSizeFn-BTSGGcie.js";import"./BasicTable-CuSLkXEu.js";import"./injectionKey-DPVn4AgL.js";import"./JAreaLinkage-BNOKwn5l.js";import"./areaDataUtil-Cik-Rc_P.js";import"./JSelectUser-DCwPqRxp.js";import"./props-BPxWJPuD.js";import"./JSelectBiz-Be8KsC5j.js";import"./JSelectDept-DT6g7V5M.js";import"./index-BNFwynfr.js";import"./bem-BvvqSl-N.js";import"./props-Cw7AfxGV.js";import"./useContextMenu-BDwmjIwb.js";import"./JCodeEditor-CSivhUhT.js";import"./useFormItem-CtGMPcLp.js";import"./htmlmixed-DNSd26j0.js";import"./vue-DbzutmLn.js";/* empty css */import"./JAddInput-BBXQvvpq.js";import"./index-BOEzG86y.js";import"./depart.api-CDwTvdwQ.js";import"./JPopup-DKJW27Yk.js";import"./EasyCronInput-wCv2YMHn.js";import"./JEllipsis-C04xKxcI.js";import"./download-CjoX0_mR.js";import"./base64Conver-24EVOS6V.js";import"./index-D1703ozz.js";import"./index-Bi7PIj53.js";import"./useCountdown-B7iR27pS.js";import"./useFormItemSingle-nLM0QlcI.js";import"./index-iuayQczx.js";import"./index-DJQB4_Pr.js";var xe=Object.defineProperty,W=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable,Y=(a,d,u)=>d in a?xe(a,d,{enumerable:!0,configurable:!0,writable:!0,value:u}):a[d]=u,De=(a,d)=>{for(var u in d||(d={}))Ce.call(d,u)&&Y(a,u,d[u]);if(W)for(var u of W(d))Fe.call(d,u)&&Y(a,u,d[u]);return a},h=(a,d,u)=>new Promise((w,b)=>{var L=s=>{try{k(u.next(s))}catch(g){b(g)}},x=s=>{try{k(u.throw(s))}catch(g){b(g)}},k=s=>s.done?w(s.value):Promise.resolve(s.value).then(L,x);k((u=u.apply(a,d)).next())});function Le(a){const d={},u=[],w=te({}),{createMessage:b}=re(),L=ie(()=>a.containerClass?`jeecg-detail-form ${a.containerClass}`:"jeecg-detail-form");le(()=>a.data,e=>h(this,null,function*(){if(e){let n=a.schemas,l={};if(n&&n.length>0)for(let i of n){let t=i.field;try{l[t]=yield x(i)}catch(o){}}w.value=l}}),{deep:!0,immediate:!0});function x(e){return h(this,null,function*(){let n=a.data;if(n){let l=n[e.field];if(!l&&l!=="0"&&l!==0)return"";let i=l,t=e.view;if(t=="list"||t=="radio"||t=="checkbox"||t=="list_multi")i=yield k(e,n);else if(t=="sel_search")i=yield g(e,n);else if(t=="cat_tree")i=yield O(e,n);else if(t=="link_table")i=yield X(e,n);else if(t=="sel_depart")i=yield y(e,n);else if(t=="sel_user")i=yield j(e,n);else if(t=="pca")i=oe(l);else if(t=="link_down")i=yield S(e,n);else if(t=="sel_tree")i=yield v(e,n);else if(t=="switch")i=yield T(e,n);else if(t=="image"||t=="file")i=A(e,n);else if(t=="popup_dict"){const o=n[`${e.field}_dictText`];o!==void 0&&(i=o)}else if(u.indexOf(e.field)>=0){let o=d[e.field];o&&o.length>0&&(i=_(o,l))}return i}return""})}function k(e,n){return h(this,null,function*(){let l=s(e),i=n[e.field];if(!l)return i;let t=se(l);if(t&&t.length>0)return _(t,i);{let o=[];if(d[l]?o=d[l]:o=(yield B(l))||[],o&&o.length>0)return d[l]=o,_(o,i)}return""})}function s(e){let n="",{dictCode:l,dictTable:i,dictText:t}=e;return i?n=encodeURI(`${i},${t},${l}`):n=l,n}function g(e,n){return h(this,null,function*(){let l=s(e),i=n[e.field];if(!i)return"";let t=[];return d[l+i]?t=d[l+i]:t=(yield de.get({url:`/sys/dict/loadDictItem/${l}`,params:{key:i}}))||[],t&&t.length>0?(d[l+i]=t,t.join(",")):""})}function O(e,n){return h(this,null,function*(){let l=n[e.field];if(!l)return"";let i=(yield ue({ids:l}))||[];return i&&i.length>0?i.join(","):""})}function y(e,n){return h(this,null,function*(){let l=n[e.field];if(!l)return"";let i=r(e),t=i.store||"id",o=i.text||"departName",f=(yield pe({ids:l,primaryKey:t}))||[];if(f&&f.length>0){let C=[];for(let F of f)F[o]?C.push(F[o]):C.push(F.title);return C.join(",")}return""})}function j(e,n){return h(this,null,function*(){let l=n[e.field];if(!l)return"";let i=r(e),t={[i.store||"username"]:l},o=((yield ce(t))||{}).records||[];if(o&&o.length>0){let f=[],C=i.text||"realname";for(let F of o)f.push(F[C]);return f.join(",")}return""})}function r(e){let n={},{fieldExtendJson:l}=e;if(l&&typeof l=="string")try{let i=JSON.parse(l);n=De({},i)}catch(i){}return n}function S(e,n){return h(this,null,function*(){let{dictTable:l,field:i}=e,t=[];if(d[i])t=d[i];else if(l){let o=JSON.parse(l);if(o){let{table:f,txt:C,key:F,linkField:H}=o,Z=`${f},${C},${F}`;if(t=[...(yield B(Z))||[]],t&&t.length>0&&(d[i]=t,H)){let ee=H.split(",");for(let P of ee)d[P]=t,u.push(P)}}}if(t&&t.length>0){let o=n[i];return _(t,o)}return""})}function v(e,n){return h(this,null,function*(){let{dict:l,field:i}=e,t=[];if(d[i]?t=d[i]:l&&(t=yield B(l)),t&&t.length>0){let o=n[i];return _(t,o)}return""})}function T(e,n){return h(this,null,function*(){let{fieldExtendJson:l,field:i}=e,t=["Y","N"];l&&(t=JSON.parse(l));let o=[{value:t[0],text:"是"},{value:t[1],text:"否"},{value:t[0]+"",text:"是"},{value:t[1]+"",text:"否"}],f=n[i];return me(o,f)})}function z(e){return e.span?e.span:a.span}function A(e,n){let l=n[e.field];if(!l)return[];let i=l.split(","),t=[];for(let o of i){let f=fe(o)||"";f&&t.push(f)}return t}function q(e){e&&window.open(e)}function Q(e){let n=w.value[e];if(!n||n.length==0){b.warning("无图片!");return}ge({imageList:n})}function R(e){return e?e.substring(e.lastIndexOf("/")+1):""}const G=["file","image","markdown","umeditor"];function K(e){return G.indexOf(e.view)>=0?a.span==12?"span12":a.span==8?"span8":a.span==6?"span6":"span24":""}function X(e,n){return h(this,null,function*(){let l=n[e.field];return r(e).showType=="select"?l?n[e.field+"_dictText"]:"":l?n[e.field]:""})}return{formContainerClass:L,detailFormData:w,getItemSpan:z,handleDownloadFile:q,handleViewImage:Q,getFilename:R,getLabelWidthClass:K}}const Ie=ne({name:"DetailForm",components:{DownloadOutlined:ke,EyeOutlined:ve,PaperClipOutlined:ye,LinkTableCard:we,MarkdownViewer:be},props:{span:N.number.def(24),schemas:N.array.def([]),data:N.object.def({}),containerClass:N.string.def("")},setup(a){const{formContainerClass:d,detailFormData:u,getItemSpan:w,handleDownloadFile:b,handleViewImage:L,getFilename:x,getLabelWidthClass:k}=Le(a);return{formContainerClass:d,detailFormData:u,getItemSpan:w,handleDownloadFile:b,handleViewImage:L,getFilename:x,getLabelWidthClass:k,filterLable:s=>{if(s.fieldExtendJson){const g=JSON.parse(s.fieldExtendJson);if(g.labelLength&&s.label.length>4)return s.label.substr(0,g.labelLength)}return s.label},filter:(s,g,O)=>{if(g=="date"&&typeof s=="string"){if(!s)return"";let y=O.fieldExtendJson;return y&&(y=JSON.parse(y),y.picker&&y.picker!="default")?he(s)[y.picker]:s.split(" ").shift()}else return s},textareaLineBreak:s=>(s&&s.includes(`
  2. `)&&(s=s.replace(/\n/g,"<br>")),s)}}}),Oe={key:1,class:"detail-item"},Te=["title"],_e={key:0,class:"item-content"},Me=["innerHTML"],Ne=["innerHTML"],je={key:3,class:"item-content",style:{display:"block","padding-top":"10px"}},Se={key:0},Ee={key:4,class:"item-content"},Je={class:"ant-upload-list ant-upload-list-picture-card"},Ve={class:"ant-upload-list-picture-card-container",style:{"margin-top":"8px"}},Be={class:"ant-upload-list-item ant-upload-list-item-done ant-upload-list-item-list-type-picture-card","data-has-actions":"true"},He={class:"ant-upload-list-item-info"},Pe=["src","onClick"],$e={class:"ant-upload-list-item-actions"},Ue={key:5,class:"item-content"},We={class:"ant-upload-list ant-upload-list-text"},Ye={class:""},ze={class:"ant-upload-list-item ant-upload-list-item-done ant-upload-list-item-list-type-text"},Ae={class:"ant-upload-list-item-info"},qe={class:"ant-upload-span"},Qe={class:"ant-upload-text-icon"},Re=["href"],Ge={class:"ant-upload-list-item-card-actions"},Ke={key:6,class:"item-content"};function Xe(a,d,u,w,b,L){const x=D("MarkdownViewer"),k=D("link-table-card"),s=D("download-outlined"),g=D("eye-outlined"),O=D("paper-clip-outlined"),y=D("a-col"),j=D("a-row");return p(),c("div",{class:E(a.formContainerClass)},[I(j,null,{default:$(()=>[(p(!0),c(M,null,J(a.schemas,(r,S)=>(p(),U(y,{key:S,span:a.getItemSpan(r)},{default:$(()=>[r.hidden?(p(),c(M,{key:0},[],64)):(p(),c("div",Oe,[m("div",{class:E(["item-title",a.getLabelWidthClass(r)]),title:r.label},V(a.filterLable(r))+": ",11,Te),r.view==="markdown"?(p(),c("div",_e,[I(x,{value:a.detailFormData[r.field],"onUpdate:value":v=>a.detailFormData[r.field]=v,placeholder:""},null,8,["value","onUpdate:value"])])):r.isHtml?(p(),c("div",{key:1,class:E(["item-content",r.view]),innerHTML:a.detailFormData[r.field]},null,10,Me)):r.view=="textarea"?(p(),c("div",{key:2,class:"item-content",innerHTML:a.textareaLineBreak(a.detailFormData[r.field])},null,8,Ne)):r.isCard?(p(),c("div",je,[a.detailFormData[r.field]?(p(),U(k,{key:1,disabled:"",detail:"",value:a.detailFormData[r.field],valueField:r.dictCode,textField:r.dictText,tableName:r.dictTable,multi:r.multi},null,8,["value","valueField","textField","tableName","multi"])):(p(),c("span",Se))])):r.isImage?(p(),c("div",Ee,[m("div",Je,[(p(!0),c(M,null,J(a.detailFormData[r.field],v=>(p(),c("div",Ve,[m("span",null,[m("div",Be,[m("div",He,[m("img",{src:v,alt:"图片不存在",class:"ant-upload-list-item-image",onClick:T=>a.handleViewImage(r.field)},null,8,Pe)]),m("span",$e,[I(s,{onClick:T=>a.handleDownloadFile(v)},null,8,["onClick"]),I(g,{onClick:T=>a.handleViewImage(r.field)},null,8,["onClick"])])])])]))),256))])])):r.isFile?(p(),c("div",Ue,[m("div",We,[(p(!0),c(M,null,J(a.detailFormData[r.field],v=>(p(),c("div",Ye,[m("span",null,[m("div",ze,[m("div",Ae,[m("span",qe,[m("div",Qe,[I(O)]),m("a",{href:v,target:"_blank",rel:"noopener noreferrer",class:"ant-upload-list-item-name"},V(a.getFilename(v)),9,Re),m("span",Ge,[I(s,{onClick:T=>a.handleDownloadFile(v)},null,8,["onClick"])])])])])])]))),256))])])):(p(),c("div",Ke,V(a.filter(a.detailFormData[r.field],r.view,r)),1))]))]),_:2},1032,["span"]))),128))]),_:1})],2)}const ni=ae(Ie,[["render",Xe],["__scopeId","data-v-05ca0a61"]]);export{ni as default};