yifengyide/public/dist/assets/foundation-45dcdf25.js

2 lines
3.8 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{d as z,a as p,r as A,o as B,bd as H,h as s,b as y,c as G,w as l,e as a,f as i,A as M,j as N,z as q,be as E,bf as I,bg as L,a2 as R,$ as T,U as Z}from"./index-7b3f5fdc.js";import{c as F}from"./index-a832a56d.js";import{s as J}from"./index-ed1abe32.js";import{Z as K}from"./index-44f083e6.js";import{V as O}from"./index-a513db85.js";import{a as P}from"./index-e96dc078.js";import{w as Q}from"./index-354ab616.js";import{w as W}from"./index-81f068f9.js";import{j as X}from"./index-d0b57c12.js";const Y={style:{padding:"10px"}},ee=["onClick"],oe=["onClick"],te=["onClick"],_e=z({__name:"foundation",setup(ne){const _=p([]),r=p(!1),c=p(1),e=A({project_code:"",project_name:"",base_score:0,scoring_type:"",pid:0});B(()=>{d()});const d=()=>{H({}).then(o=>{console.log(o),o.code==1?_.value=o.data:s.msg(o.msg,{icon:2})})},u=(o,t)=>{console.log(o),r.value=!0,e.id=0,e.scoring_type=o.scoring_type,e.pid=t,c.value=1},v=o=>{console.log(o),r.value=!0,e.id=o.id,e.project_name=o.project_name,e.pid=o.pid,e.project_code=o.project_code,e.base_score=o.base_score,e.scoring_type=o.scoring_type,c.value=2},b=async o=>{var t=await E({id:o.id});console.log(t),t.code==1?(s.msg("删除成功!",{icon:1}),d()):s.msg(t.msg,{icon:2})},h=[{title:"项目名称",width:"100px",key:"project_name"},{title:"基础分值",width:"200px",key:"base_score"},{title:"操作",width:"180px",customSlot:"operator",key:"operator",align:"center",fixed:"right"}],k=p([{text:"确认",callback:async()=>{if(console.log(e),e.project_name==""&&s.msg("项目名称不能为空!",{icon:2}),e.project_code==""&&s.msg("项目代码不能为空!",{icon:2}),(e.base_score==""||e.base_score==0)&&s.msg("基础分值不能为空或为0",{icon:2,time:1e3}),c.value==1)var o=await I(e);else var o=await L(e);console.log(o),o.code==1?(s.msg("提交成功!",{icon:1}),r.value=!1,d()):s.msg(o.msg,{icon:2})}},{text:"取消",callback:()=>{r.value=!1}}]);return(o,t)=>{const x=R,w=W,j=Q,C=P,V=O,D=K,f=T,$=J,S=X,g=F,U=Z;return y(),G(g,{style:{padding:"20px"}},{default:l(()=>[a(V,null,{default:l(()=>[i("div",Y,[t[5]||(t[5]=i("span",{style:{"font-size":"18px","vertical-align":"center","margin-right":"20px"}},"基础评分列表",-1)),a(x,{size:"sm",border:"green",onClick:t[0]||(t[0]=n=>{r.value=!0,e.pid=0,e.id=0,c.value=1})},{default:l(()=>t[4]||(t[4]=[M("新增")])),_:1})]),a(C,{size:"lg",ref:"tableRef6","children-column-name":"children",columns:h,"data-source":_.value},{operator:l(({data:n})=>[a(j,{size:"lg"},{default:l(()=>[i("span",{style:{color:"#00A394",cursor:"pointer"},onClick:m=>u(n,n.pid)},"平级新增",8,ee),n.pid==0?(y(),N("span",{key:0,style:{color:"#00A394",cursor:"pointer"},onClick:m=>u(n,n.id)},"子级新增",8,oe)):q("",!0),i("span",{style:{color:"#00A394",cursor:"pointer"},onClick:m=>v(n)},"编辑",8,te),a(w,{trigger:"click",content:"确定要删除吗?",onConfirm:m=>b(n)},{default:l(()=>t[6]||(t[6]=[i("span",{style:{color:"#00A394",cursor:"pointer"}},"删除",-1)])),_:2},1032,["onConfirm"])]),_:2},1024)]),_:1},8,["data-source"])]),_:1}),a(U,{modelValue:r.value,"onUpdate:modelValue":t[3]||(t[3]=n=>r.value=n),title:c.value==1?"新增考评项目":"编辑考评项目",type:4,shade:!0,area:["950px","100%"],btn:k.value},{default:l(()=>[a(g,{fluid:"true",style:{padding:"20px"}},{default:l(()=>[a(S,{model:e},{default:l(()=>[a(f,{required:"",label:"项目名称",prop:"project_name"},{default:l(()=>[a(D,{placeholder:"请输入项目名称",modelValue:e.project_name,"onUpdate:modelValue":t[1]||(t[1]=n=>e.project_name=n)},null,8,["modelValue"])]),_:1}),a(f,{required:"",label:"基础分值",prop:"base_score"},{default:l(()=>[a($,{modelValue:e.base_score,"onUpdate:modelValue":t[2]||(t[2]=n=>e.base_score=n),position:"right"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1})]),_:1},8,["modelValue","title","btn"])]),_:1})}}});export{_e as default};