2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
|
|
import{ay as Ve,az as Ae,aQ as xe,aA as Se,aO as ze,aP as Ne,aB as p,aC as _,aU as Ue,aV as Le,b6 as Pe,aL as Re,aD as n,aE as s,aW as S,aH as l,aG as t,aK as v,aJ as r,b2 as y,aI as i,aF as u,aX as M,aY as B,b1 as z,bX as Ee,bY as Te,aS as N,bZ as oe,bW as Ie,b_ as Fe,b$ as O,c0 as Me,b3 as Be,c1 as Oe}from"./admin-DgPvPHD7.js";import{l as We}from"./permission-api-KeGpSf5X.js";import"./workspace-D2rVZOhW.js";const De={class:"p-16-24"},Je={class:"ml-4 color-text-primary"},He={class:"flex-between mb-16"},Ke={class:"complex-search"},Xe={class:"table-name flex align-center"},Ye=["src"],qe={class:"filter"},Ge={class:"form-item mb-16"},Qe={class:"text-right"},Ze={key:0,class:"flex align-center"},je={class:"color-text-primary"},ea={key:1,class:"flex align-center"},aa={class:"color-text-primary"},la={class:"filter"},ta={class:"form-item mb-16 ml-4"},oa={class:"text-right"},na={class:"mr-8"},sa={class:"mr-8"},pa=Ve({__name:"ApplicationResourceIndex",setup(ia){const ne=Ae();xe();const{user:H,application:se}=Se(),f=ze(()=>Ne.application.systemManage),ie=()=>f.value.overview_read()||f.value.access_read()||f.value.edit()||f.value.chat_log_read()||f.value.chat_user_read(),re=()=>f.value.export()||f.value.delete()||f.value.auth(),K=p();function ue(e){K.value.open(e.id)}const W=p([]);function ce(e){var m,V;(V=(m=e==null?void 0:e.work_flow)==null?void 0:m.nodes)==null||V.filter(c=>c.id==="base-node").map(c=>{W.value=c.properties.api_input_field_list?c.properties.api_input_field_list.map(d=>({name:d.variable,value:d.default_value})):c.properties.input_field_list?c.properties.input_field_list.filter(d=>d.assignment_method==="api_input").map(d=>({name:d.variable,value:d.default_value})):[]});const o=X(W.value)?"?"+X(W.value):"";O.getAccessToken(e.id,L).then(c=>{var d;window.open(se.location+((d=c==null?void 0:c.data)==null?void 0:d.access_token)+o)})}function X(e){const o=new URLSearchParams;return e.forEach(m=>{o.append(encodeURIComponent(m.name),encodeURIComponent(m.value))}),o.toString()}function pe(e){Me(`${_("views.application.delete.confirmTitle")}${e.name} ?`,_("views.application.delete.confirmMessage"),{confirmButtonText:_("common.confirm"),cancelButtonText:_("common.cancel"),confirmButtonClass:"danger"}).then(()=>{O.delApplication(e.id,L).then(()=>{const o=P.value.findIndex(m=>m.id===e.id);P.value.splice(o,1),Be(_("common.deleteSuccess"))})}).catch(()=>{})}const me=e=>{O.exportApplication(e.id,e.name,L).catch(o=>{o.response.status!==403&&o.response.data.text().then(m=>{Oe(`${_("views.application.tip.ExportError")}:${JSON.parse(m).message}`)})})},g=p("name"),b=p({name:"",create_user:"",type:""}),Y=p([]),de=p([{label:_("views.application.workflow"),value:"WORK_FLOW"},{label:_("views.application.simple"),value:"SIMPLE"}]),L=p(!1),P=p([]),D=Ue({current_page:1,page_size:20,total:0}),R=p([]),E=p(!1),$=p([]),T=p(!1),C=p([]),ve=p([{label:_("views.application.status.published"),value:!0},{label:_("views.application.status.unpublished"),value:!1}]),U=p(""),I=p([]);Le([()=>R.value,()=>U.value],()=>{U.value.length||(I.value=R.value),I.value=R.value.filter(e=>e.label.toLowerCase().includes(U.value.toLowerCase()))},{immediate:!0});function q(e){e==="clear"&&($.value=[]),U.value="",w(),E.value=!1}function G(e){e==="clear"&&(C.value=[]),w(),T.value=!1}async function _e(){if(H.isEE()){const e=await We("workspace").getSystemWorkspaceList(L);R.value=e.data.map(o=>({label:o.name,value:o.id}))}}const fe=()=>{b.value={name:"",create_user:"",type:""}};function w(){const e={};b.value[g.value]&&(e[g.value]=b.value[g.value]),$.value.length>0&&(e.workspace_ids=JSON.stringify($.value)),C.value.length>0&&(e.status=JSON.stringify(C.value)),O.getApplication(D,e,L).then(o=>{var m,V;D.total=(m=o.data)==null?void 0:m.total,P.value=(V=o.data)==null?void 0:V.records})}return Pe(()=>{_e(),w(),Re.getAllMemberList("").then(e=>{Y.value=e.data})}),(e,o)=>{const m=n("el-breadcrumb-item"),V=n("el-breadcrumb"),c=n("el-option"),d=n("el-select"),Q=n("el-input"),be=n("el-avatar"),F=n("el-icon"),k=n("el-table-column"),Z=n("el-tag"),j=n("Filter"),h=n("el-button"),ee=n("el-check
|