maiResult.19fec382.js 4.5 KB

1
  1. var e=Object.defineProperty,t=Object.defineProperties,s=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,r=(t,s,n)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n,i=(e,t)=>{for(var s in t||(t={}))o.call(t,s)&&r(e,s,t[s]);if(n)for(var s of n(t))a.call(t,s)&&r(e,s,t[s]);return e},c=(e,n)=>t(e,s(n));import{d as u,h as l,H as h,T as d,a as p}from"./vendor.075d5207.js";import{B as f}from"./Loading.b1502e0b.js";import{c as m}from"./index.aa033d06.js";const y={qi:4,blood:4,fluids:4,humor:4},g=e=>{const t={title:[],desc:[]};return e?(e.forEach((e=>{t.title.push(e.name_cn),t.desc.push(e.explaination_cn)})),t):t},v={new_food_propose:"饮食",new_sport_propose:"运动",other_propose:"生活"},x=e=>{const t=["qi","blood","fluids","humor"],s={level:Object.assign({},y),text:[],desc:[]};for(const o of t){const t=e[o];t&&(s.level[o]=(n=t.score)<50?7:n>=50&&n<80?6:n>=80&&n<90?5:n>=90&&n<=110?4:n>110&&n<120?3:n>=120&&n<150?2:n>=150?1:4,s.text.push(t.text),s.desc.push(t.desc))}var n;return s},b=e=>{const t=["phlegm","dampness","chill","fever"],s={value:[],text:[],desc:[]};for(const n of t){const t=e[n];t&&(t.score>0&&(s.value.push(n),s.desc.push(t.desc)),t.text&&s.text.push(t.text))}return s},j=e=>{const t=["new_food_propose","new_sport_propose","other_propose"],s=[];for(const n of t){const t=e[n];t&&t[n]&&s.push({title:v[n],desc:t[n]})}return s},_=e=>{const t={text:[],desc:[]};return e.desc&&(t.text=[...e.desc.desc]),e.desc_detail&&(t.desc=[...e.desc_detail.desc_detail]),t},k=e=>{const t=[];return["taiyang","yangming","shaoyang","shaoyin","jueyin","taiyin"].forEach((s=>{e[s]&&t.push({key:s,text:e[s]})})),t},O={shu:"",hua:"",xian:"",fu:"",kong:""},w=(e,t,s)=>{const n=(e=>{const t={shu:0,chi:0};return e>180?t.shu=6:e<=180&&e>150?t.shu=5:e<=150&&e>130?t.shu=4:e<=130&&e>110?t.shu=3:e<=110&&e>100?t.shu=2:e<=100&&e>=90?t.shu=1:e<90&&e>60?(t.shu=0,t.chi=0):e<=60&&e>50?t.chi=1:e<=50&&e>45?t.chi=2:e<=45&&(t.chi=3),t})(t),o={};let a={shu:0,chi:0,hua:0,xi:0,xian:0,ruan:0,fu:0,chen:0,kong:0,shi:0};const r=[["shu","chi"],["hua","xi"],["xian","ruan"],["fu","chen"],["kong","shi"]],i=e.xian[0]>e.ruan[0]||e.xian[0]===e.ruan[0]&&e.xian[1]>e.ruan[1],c=n.shu>0;for(const d in e){const t=d;a[t]=e[t][0]}a=Object.assign(Object.assign({},a),n);const u=Object.assign({},O);let l=0;for(const d of r){const e=d[0],t=d[1],s=a[e]-a[t];s>0?(o[e]={level:a[e],division:!1},u[e]="left"):s<0?(u[e]="right",o[t]={level:a[t],division:!1}):(l++,o[e]={level:a[e],division:!1},o[t]={level:a[t],division:!1})}l===r.length&&delete o.hua,o.shu&&(o.shu.division=i),o.fu&&(o.fu.division=!c),o.chen&&(o.chen.division=i);const h={};return s.forEach((e=>{for(const t in o){if(0===o[t].level)continue;let s="";"shu"===t&&i&&(s="2"),"chen"!==t||i||(s="2"),h[`${t}${s}_${e.key}`]=!0}})),{mais:o,duadMai:u,lj:h}},E=e=>null!==e&&"object"==typeof e,T=(e,t=200)=>e?e.includes("aliyun")?`${e}?x-oss-process=image/resize,h_${t}`.replace(/https:|http:/,""):e:"",$=u({name:"Toast",props:{duration:{type:Number,default:2e3},mask:{type:Boolean,default:!0},message:{type:String,default:""},type:{type:String,default:"text"}},setup(e){const t=l(!0);return()=>{let s;return clearTimeout(s),s=setTimeout((()=>{t.value=!1}),e.duration),h(d,{name:"fade"},{default:()=>h(f,{mask:e.mask,message:e.message,type:e.type,visible:t.value})})}}}),P={duration:2e3,mask:!0,message:"",type:"text"},B=(e,t)=>{const s=i({},((e,t)=>E(e)?c(i(i({},P),e),{type:t}):c(i({},P),{message:e,type:t}))(t,e));["success","fail","text"].includes(s.type)||(s.type="text");const n=s.duration,o=document.createElement("div");o.style.display="block",o.style.color="white",document.body.appendChild(o);const a=p($,{duration:n,mask:(null==s?void 0:s.mask)||!0,message:(null==s?void 0:s.message)||"",type:null==s?void 0:s.type});a.mount(o),setTimeout((()=>{a.unmount(),o.remove()}),n+300)},S=e=>t=>{B(e,t)},q=e=>{E(e)?B(e.type,e):B(P.type,e)};q.success=S("success"),q.fail=S("fail"),q.text=S("text");const I=(e,t={cun:"",guan:"",chi:"",summary:[]})=>{const s={branch:i({},m),total:""};if(!e)return s;return["cun","guan","chi"].forEach((n=>{s.branch[n]={mai:(t[n]||"").replace(/,/g,"、"),value:e[n]||""}})),s.total=(t.summary||[]).join(" "),s},L=e=>{if(!e)return;const t=e.split("-");return 3===t.length?{name:t[0],mac:t[2],v:`${parseInt(t[1])}.X`}:void 0},z=(e,t)=>{if(t){return{0:"Left hand",1:"Right hand",2:"Both hands"}[e]||""}return{0:"左手",1:"右手",2:"总体"}[e]||""};export{q as T,z as a,k as b,I as c,g as d,x as e,b as f,w as g,j as h,_ as i,L as j,T as k};