@pangu-backend-ui/apputil-core 0.0.4 → 0.0.5
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.
- package/index.js +1174 -475
- package/index.umd.cjs +1 -1
- package/package.json +3 -3
- package/style.css +1 -0
- package/types/store/ConfigStore.d.ts +7 -0
- package/types/types/InstallOptions.d.ts +1 -0
- package/types/views/VersionListView.vue.d.ts +88 -0
- package/types/views/components/VersionDialog.vue.d.ts +67 -0
package/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(u,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis<"u"?globalThis:u||self,e(u["pg-user-core"]={},u.Vue))})(this,function(u,e){"use strict";const L=[],$={OPEN_WEB:{name:"打开Web页面"},OPEN_VIEW:{name:"打开内置页面"},API_REQUEST:{name:"请求API"},EXEC_METHOD:{name:"执行方法"},CUSTOM:{name:"自定义"}},R={OPEN_WEB:{name:"打开Web页面"},OPEN_VIEW:{name:"打开内置页面"},API_REQUEST:{name:"请求API"},EXEC_METHOD:{name:"执行方法"},CUSTOM:{name:"自定义"}},I=e.defineComponent({__name:"BannerDialog",emits:["success"],setup(y,{expose:r,emit:i}){const m=e.ref(!1),o=e.ref({sceneCode:null,image:null,targetPath:null,clickEventType:"",params:null,shelfTimeArr:[]}),N=e.ref({sceneCode:[{required:!0,message:"请输入场景代码"}],image:[{required:!0,message:"请上传图片"}],targetPath:[{required:!0,message:"请输入目标地址"}],clickEventType:[{required:!0,message:"请选择点击事件类型"}]}),C=e.ref(!1),f=e.inject("http"),k=e.ref();function b(){var a;(a=k.value)==null||a.validate(t=>{if(t){C.value=!0;let s=`/api/app/banner/${V.value??""}/${V.value?"update":"create"}`,d={...o.value};d.shelfTime=null,d.offShelfTime=null,o.value.shelfTimeArr.length&&(d.shelfTime=o.value.shelfTimeArr[0],d.offShelfTime=o.value.shelfTimeArr[1]),f==null||f.post(s,d).then(c=>{var _;i("success"),(_=k.value)==null||_.resetFields(),m.value=!1}).finally(()=>{C.value=!1})}})}const g=e.ref([]),V=e.ref(null);function w(a,t){g.value=a,V.value=null,m.value=!0,e.nextTick(()=>{t&&(V.value=t.id,Object.assign(o.value,t),t.shelfTime&&t.offShelfTime&&(o.value.shelfTimeArr=[new Date(t.shelfTime),new Date(t.offShelfTime)]))})}function B(){var a;(a=k.value)==null||a.resetFields()}return r({show:w}),(a,t)=>{const s=e.resolveComponent("el-option"),d=e.resolveComponent("el-select"),c=e.resolveComponent("el-form-item"),_=e.resolveComponent("pg-upload"),x=e.resolveComponent("el-input"),p=e.resolveComponent("el-collapse-transition"),E=e.resolveComponent("el-date-picker"),S=e.resolveComponent("el-form"),A=e.resolveComponent("el-button"),D=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(D,{modelValue:m.value,"onUpdate:modelValue":t[6]||(t[6]=n=>m.value=n),width:"400",onClosed:B},{footer:e.withCtx(()=>[e.createVNode(A,{type:"primary",disabled:C.value,loading:C.value,onClick:b},{default:e.withCtx(()=>[e.createTextVNode("提交")]),_:1},8,["disabled","loading"])]),default:e.withCtx(()=>[e.createVNode(S,{ref_key:"form",ref:k,rules:N.value,model:o.value,"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(c,{label:"场景代码",prop:"sceneCode"},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:o.value.sceneCode,"onUpdate:modelValue":t[0]||(t[0]=n=>o.value.sceneCode=n),placeholder:"请输入/选择场景代码","allow-create":"",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,n=>(e.openBlock(),e.createBlock(s,{key:n,value:n,label:n},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(c,{label:"图片",prop:"image"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(_,{accept:"jpg,jpeg,png",modelValue:o.value.image,"onUpdate:modelValue":t[1]||(t[1]=n=>o.value.image=n),key:`img_${V.value}`,"list-type":"picture-card","upload-type":"banner",limit:1},null,8,["modelValue"]))]),_:1}),e.createVNode(c,{label:"点击事件类型",prop:"clickEventType"},{default:e.withCtx(()=>[e.createVNode(d,{placeholder:"请选择点击事件类型",modelValue:o.value.clickEventType,"onUpdate:modelValue":t[2]||(t[2]=n=>o.value.clickEventType=n)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref($),(n,T)=>(e.openBlock(),e.createBlock(s,{value:T,label:n.name},null,8,["value","label"]))),256))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(p,null,{default:e.withCtx(()=>[["OPEN_WEB","OPEN_VIEW","API_REQUEST"].indexOf(o.value.clickEventType)>=0?(e.openBlock(),e.createBlock(c,{key:0,label:"目标地址",prop:"targetPath"},{default:e.withCtx(()=>[e.createVNode(x,{placeholder:"请输入目标地址",modelValue:o.value.targetPath,"onUpdate:modelValue":t[3]||(t[3]=n=>o.value.targetPath=n)},null,8,["modelValue"])]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(c,{label:"目标地址参数",prop:"params"},{default:e.withCtx(()=>[e.createVNode(x,{type:"textarea",modelValue:o.value.params,"onUpdate:modelValue":t[4]||(t[4]=n=>o.value.params=n),placeholder:"请输入JSON格式的参数对象"},null,8,["modelValue"])]),_:1}),e.createVNode(c,{label:"生效时段",prop:"shelfTimeArr"},{default:e.withCtx(()=>[e.createVNode(E,{type:"datetimerange",modelValue:o.value.shelfTimeArr,"onUpdate:modelValue":t[5]||(t[5]=n=>o.value.shelfTimeArr=n),"start-placeholder":"上架时间","end-placeholder":"下架时间","default-time":[new Date(2e3,1,1,0,0,0),new Date(2e3,1,1,23,59,59)]},null,8,["modelValue","default-time"])]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["modelValue"])}}}),H=e.defineComponent({__name:"BannerListView",setup(y){const r=e.inject("http"),i=e.ref({sceneCode:null,status:null}),m=e.ref([]);function o(){r==null||r.get("/api/app/banner/all-scene-code").then(a=>{m.value=a.data})}const N=e.ref(),C=e.ref(!1);function f(){C.value=!!i.value.sceneCode,N.value.search()}function k(a){r==null||r.post(`/api/app/banner/${a}/publish`).then(t=>{f()})}function b(a){r==null||r.post(`/api/app/banner/${a}/off-shelf`).then(t=>{f()})}function g(a,t){r==null||r.post(`/api/app/banner/${a}/move-up`).then(s=>{i.value.sceneCode=t,f()})}function V(a,t){r==null||r.post(`/api/app/banner/${a}/move-down`).then(s=>{i.value.sceneCode=t,f()})}e.onBeforeMount(()=>{o()});const w=e.ref();function B(a){w.value.show(m.value,a)}return(a,t)=>{const s=e.resolveComponent("el-option"),d=e.resolveComponent("el-select"),c=e.resolveComponent("el-button"),_=e.resolveComponent("el-space"),x=e.resolveComponent("el-card"),p=e.resolveComponent("el-table-column"),E=e.resolveComponent("el-image"),S=e.resolveComponent("el-descriptions-item"),A=e.resolveComponent("el-descriptions"),D=e.resolveComponent("el-popover"),n=e.resolveComponent("el-tag"),T=e.resolveComponent("el-popconfirm"),F=e.resolveComponent("pg-table"),U=e.resolveDirective("permission");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(_,null,{default:e.withCtx(()=>[e.createVNode(d,{modelValue:i.value.sceneCode,"onUpdate:modelValue":t[0]||(t[0]=l=>i.value.sceneCode=l),placeholder:"场景代码",clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,h)=>(e.openBlock(),e.createBlock(s,{label:l,value:l,key:`sc_con_${h}`},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(d,{modelValue:i.value.status,"onUpdate:modelValue":t[1]||(t[1]=l=>i.value.status=l),placeholder:"状态",clearable:"",style:{width:"150px"}},{default:e.withCtx(()=>[e.createVNode(s,{label:"草稿",value:"DRAFT"}),e.createVNode(s,{label:"已发布",value:"PUBLISH"}),e.createVNode(s,{label:"已下架",value:"OFF_SHELF"})]),_:1},8,["modelValue"]),e.createVNode(c,{type:"primary",icon:"search",onClick:f},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1}),e.withDirectives((e.openBlock(),e.createBlock(c,{icon:"plus",onClick:t[2]||(t[2]=l=>B())},{default:e.withCtx(()=>[e.createTextVNode("创建Banner")]),_:1})),[[U,"CREATE_BANNER"]])]),_:1})]),_:1}),e.createVNode(F,{ref_key:"table",ref:N,"data-url":"/api/app/banner/page",onRowDbClick:t[3]||(t[3]=l=>a.$hasPer("UPDATE_BANNER")?B(l):null),condition:i.value,style:{"margin-top":"10px"}},{default:e.withCtx(()=>[C.value&&a.$hasPer("BANNER_SEQ_MOVE_UP_DOWN")?(e.openBlock(),e.createBlock(p,{key:0,align:"center",width:"80"},{default:e.withCtx(({row:l})=>[e.createVNode(_,{direction:"vertical"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ArrowUpBold",onClick:h=>g(l.id,l.sceneCode)},null,8,["onClick"]),e.createVNode(c,{icon:"ArrowDownBold",onClick:h=>V(l.id,l.sceneCode)},null,8,["onClick"])]),_:2},1024)]),_:1})):e.createCommentVNode("",!0),e.createVNode(p,{label:"场景代码",prop:"sceneCode",width:"150"}),e.createVNode(p,{label:"图片",width:"300",align:"center"},{default:e.withCtx(({row:l})=>[e.createVNode(E,{src:l.image,style:{"max-width":"300px"},"preview-src-list":[l.image],"preview-teleported":""},null,8,["src","preview-src-list"])]),_:1}),e.createVNode(p,{label:"点击事件类型",prop:"clickEventType",width:"120"},{default:e.withCtx(({row:l})=>[e.createTextVNode(e.toDisplayString(l.clickEventType?e.unref($)[l.clickEventType].name:""),1)]),_:1}),e.createVNode(p,{label:"目标地址",prop:"targetPath","show-overflow-tooltip":""}),e.createVNode(p,{label:"目标参数",width:"120","show-overflow-tooltip":""},{default:e.withCtx(({row:l})=>[l.params?(e.openBlock(),e.createBlock(D,{key:0,trigger:"hover",width:"350"},{reference:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.params.substring(0,100))+e.toDisplayString(l.params.length>100?"...":""),1)]),default:e.withCtx(()=>[l.params.startsWith("{")?(e.openBlock(),e.createBlock(A,{key:0,column:"1",border:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(JSON.parse(l.params),(h,P)=>(e.openBlock(),e.createBlock(S,{label:P,"min-width":"150"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h),1)]),_:2},1032,["label"]))),256))]),_:2},1024)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.params),1)],64))]),_:2},1024)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(p,{label:"上架时间",prop:"shelfTime",width:"180",align:"center"}),e.createVNode(p,{label:"下架时间",prop:"offShelfTime",width:"180",align:"center"}),e.createVNode(p,{label:"状态",align:"center",width:"88"},{default:e.withCtx(({row:l})=>[l.status=="DRAFT"?(e.openBlock(),e.createBlock(n,{key:0,type:"danger"},{default:e.withCtx(()=>[e.createTextVNode("草稿")]),_:1})):e.createCommentVNode("",!0),l.status=="PUBLISH"?(e.openBlock(),e.createBlock(n,{key:1,type:"success"},{default:e.withCtx(()=>[e.createTextVNode("已发布")]),_:1})):e.createCommentVNode("",!0),l.status=="OFF_SHELF"?(e.openBlock(),e.createBlock(n,{key:2,type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("已下架")]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(p,{align:"center",width:"90"},{default:e.withCtx(({row:l})=>[["DRAFT","OFF_SHELF"].indexOf(l.status)>=0&&a.$hasPer("BANNER_PUBLISH")?(e.openBlock(),e.createBlock(T,{key:0,onConfirm:h=>k(l.id),title:`确定要${l.status=="DRAFT"?"发布":"上架"}该Banner吗?`},{reference:e.withCtx(()=>[e.createVNode(c,{type:"success"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.status=="DRAFT"?"发布":"上架"),1)]),_:2},1024)]),_:2},1032,["onConfirm","title"])):e.createCommentVNode("",!0),l.status=="PUBLISH"&&a.$hasPer("BANNER_OFF_SHELF")?(e.openBlock(),e.createBlock(T,{key:1,onConfirm:h=>b(l.id),title:"确定要[下架]该Banner吗?"},{reference:e.withCtx(()=>[e.createVNode(c,{type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("下架")]),_:1})]),_:2},1032,["onConfirm"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["condition"]),e.createVNode(I,{ref_key:"bannerDialog",ref:w,onSuccess:f},null,512)],64)}}}),W=e.defineComponent({__name:"EntranceDialog",emits:["success"],setup(y,{expose:r,emit:i}){const m=e.ref(!1),o=e.ref({sceneCode:null,name:null,iconType:"NAME",icon:null,targetPath:null,clickEventType:"",params:null,shelfTimeArr:[]}),N=e.ref({sceneCode:[{required:!0,message:"请输入场景代码"}],name:[{required:!0,message:"请输入入口名称"}],iconType:[{required:!0,message:"请选择图标类型"}],icon:[{required:!0,message:`请${o.value.iconType=="NAME"?"输入图标名称":"上传图标图片"}`}],targetPath:[{required:!0,message:"请输入目标地址"}],clickEventType:[{required:!0,message:"请选择点击事件类型"}]}),C=e.ref(!1),f=e.inject("http"),k=e.ref();function b(){var a;(a=k.value)==null||a.validate(t=>{if(t){C.value=!0;let s=`/api/app/entrance/${V.value??""}/${V.value?"update":"create"}`,d={...o.value};d.shelfTime=null,d.offShelfTime=null,o.value.shelfTimeArr.length&&(d.shelfTime=o.value.shelfTimeArr[0],d.offShelfTime=o.value.shelfTimeArr[1]),f==null||f.post(s,d).then(c=>{var _;i("success"),(_=k.value)==null||_.resetFields(),m.value=!1}).finally(()=>{C.value=!1})}})}const g=e.ref([]),V=e.ref(null);function w(a,t){g.value=a,V.value=null,m.value=!0,e.nextTick(()=>{t&&(V.value=t.id,Object.assign(o.value,t),t.shelfTime&&t.offShelfTime&&(o.value.shelfTimeArr=[new Date(t.shelfTime),new Date(t.offShelfTime)]))})}function B(){var a;(a=k.value)==null||a.resetFields()}return r({show:w}),(a,t)=>{const s=e.resolveComponent("el-option"),d=e.resolveComponent("el-select"),c=e.resolveComponent("el-form-item"),_=e.resolveComponent("el-input"),x=e.resolveComponent("pg-upload"),p=e.resolveComponent("el-collapse-transition"),E=e.resolveComponent("el-date-picker"),S=e.resolveComponent("el-form"),A=e.resolveComponent("el-button"),D=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(D,{modelValue:m.value,"onUpdate:modelValue":t[9]||(t[9]=n=>m.value=n),width:"400",onClose:B},{footer:e.withCtx(()=>[e.createVNode(A,{type:"primary",disabled:C.value,loading:C.value,onClick:b},{default:e.withCtx(()=>[e.createTextVNode("提交")]),_:1},8,["disabled","loading"])]),default:e.withCtx(()=>[e.createVNode(S,{ref_key:"form",ref:k,rules:N.value,model:o.value,"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(c,{label:"场景代码",prop:"sceneCode"},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:o.value.sceneCode,"onUpdate:modelValue":t[0]||(t[0]=n=>o.value.sceneCode=n),placeholder:"请输入/选择场景代码","allow-create":"",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,n=>(e.openBlock(),e.createBlock(s,{key:n,value:n,label:n},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(c,{label:"入口名称",prop:"name"},{default:e.withCtx(()=>[e.createVNode(_,{placeholder:"请输入入口名称",modelValue:o.value.name,"onUpdate:modelValue":t[1]||(t[1]=n=>o.value.name=n)},null,8,["modelValue"])]),_:1}),e.createVNode(c,{label:"图标类型",prop:"iconType"},{default:e.withCtx(()=>[e.createVNode(d,{placeholder:"请选择图标类型",modelValue:o.value.iconType,"onUpdate:modelValue":t[2]||(t[2]=n=>o.value.iconType=n)},{default:e.withCtx(()=>[e.createVNode(s,{value:"NAME",label:"图标名称"}),e.createVNode(s,{value:"URL",label:"图标URL"})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(c,{label:"图标",prop:"icon"},{default:e.withCtx(()=>[o.value.iconType=="URL"?(e.openBlock(),e.createBlock(x,{accept:"jpg,jpeg,png,gif",modelValue:o.value.icon,"onUpdate:modelValue":t[3]||(t[3]=n=>o.value.icon=n),key:`img_${V.value}`,"list-type":"picture-card","upload-type":"entrance",limit:1},null,8,["modelValue"])):(e.openBlock(),e.createBlock(_,{key:1,modelValue:o.value.icon,"onUpdate:modelValue":t[4]||(t[4]=n=>o.value.icon=n),placeholder:"请输入图标名称",clearable:""},null,8,["modelValue"]))]),_:1}),e.createVNode(c,{label:"点击事件类型",prop:"clickEventType"},{default:e.withCtx(()=>[e.createVNode(d,{placeholder:"请选择点击事件类型",modelValue:o.value.clickEventType,"onUpdate:modelValue":t[5]||(t[5]=n=>o.value.clickEventType=n)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(R),(n,T)=>(e.openBlock(),e.createBlock(s,{value:T,label:n.name},null,8,["value","label"]))),256))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(p,null,{default:e.withCtx(()=>[["OPEN_WEB","OPEN_VIEW","API_REQUEST"].indexOf(o.value.clickEventType)>=0?(e.openBlock(),e.createBlock(c,{key:0,label:"目标地址",prop:"targetPath"},{default:e.withCtx(()=>[e.createVNode(_,{placeholder:"请输入目标地址",modelValue:o.value.targetPath,"onUpdate:modelValue":t[6]||(t[6]=n=>o.value.targetPath=n)},null,8,["modelValue"])]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(c,{label:"目标地址参数",prop:"params"},{default:e.withCtx(()=>[e.createVNode(_,{type:"textarea",modelValue:o.value.params,"onUpdate:modelValue":t[7]||(t[7]=n=>o.value.params=n),placeholder:"请输入JSON格式的参数对象"},null,8,["modelValue"])]),_:1}),e.createVNode(c,{label:"生效时段",prop:"shelfTimeArr"},{default:e.withCtx(()=>[e.createVNode(E,{type:"datetimerange",modelValue:o.value.shelfTimeArr,"onUpdate:modelValue":t[8]||(t[8]=n=>o.value.shelfTimeArr=n),"start-placeholder":"上架时间","end-placeholder":"下架时间","default-time":[new Date(2e3,1,1,0,0,0),new Date(2e3,1,1,23,59,59)]},null,8,["modelValue","default-time"])]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["modelValue"])}}}),M=e.defineComponent({__name:"EntranceListView",setup(y){const r=e.inject("http"),i=e.ref({sceneCode:null,status:null}),m=e.ref([]);function o(){r==null||r.get("/api/app/entrance/all-scene-code").then(a=>{m.value=a.data})}const N=e.ref(),C=e.ref(!1);function f(){C.value=!!i.value.sceneCode,N.value.search()}function k(a){r==null||r.post(`/api/app/entrance/${a}/publish`).then(t=>{f()})}function b(a){r==null||r.post(`/api/app/entrance/${a}/off-shelf`).then(t=>{f()})}function g(a,t){r==null||r.post(`/api/app/entrance/${a}/move-up`).then(s=>{i.value.sceneCode=t,f()})}function V(a,t){r==null||r.post(`/api/app/entrance/${a}/move-down`).then(s=>{i.value.sceneCode=t,f()})}e.onBeforeMount(()=>{o()});const w=e.ref();function B(a){w.value.show(m.value,a)}return(a,t)=>{const s=e.resolveComponent("el-option"),d=e.resolveComponent("el-select"),c=e.resolveComponent("el-button"),_=e.resolveComponent("el-space"),x=e.resolveComponent("el-card"),p=e.resolveComponent("el-table-column"),E=e.resolveComponent("el-image"),S=e.resolveComponent("el-descriptions-item"),A=e.resolveComponent("el-descriptions"),D=e.resolveComponent("el-popover"),n=e.resolveComponent("el-tag"),T=e.resolveComponent("el-popconfirm"),F=e.resolveComponent("pg-table"),U=e.resolveDirective("permission");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(_,null,{default:e.withCtx(()=>[e.createVNode(d,{modelValue:i.value.sceneCode,"onUpdate:modelValue":t[0]||(t[0]=l=>i.value.sceneCode=l),placeholder:"场景代码",clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,h)=>(e.openBlock(),e.createBlock(s,{label:l,value:l,key:`sc_con_${h}`},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(d,{modelValue:i.value.status,"onUpdate:modelValue":t[1]||(t[1]=l=>i.value.status=l),placeholder:"状态",clearable:"",style:{width:"150px"}},{default:e.withCtx(()=>[e.createVNode(s,{label:"草稿",value:"DRAFT"}),e.createVNode(s,{label:"已发布",value:"PUBLISH"}),e.createVNode(s,{label:"已下架",value:"OFF_SHELF"})]),_:1},8,["modelValue"]),e.createVNode(c,{type:"primary",icon:"search",onClick:f},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1}),e.withDirectives((e.openBlock(),e.createBlock(c,{icon:"plus",onClick:t[2]||(t[2]=l=>B())},{default:e.withCtx(()=>[e.createTextVNode("创建入口")]),_:1})),[[U,"CREATE_ENTRANCE"]])]),_:1})]),_:1}),e.createVNode(F,{ref_key:"table",ref:N,"data-url":"/api/app/entrance/page",onRowDbClick:t[3]||(t[3]=l=>a.$hasPer("UPDATE_ENTRANCE")?B(l):null),condition:i.value,style:{"margin-top":"10px"}},{default:e.withCtx(()=>[C.value&&a.$hasPer("ENTRANCE_SEQ_MOVE_UP_DOWN")?(e.openBlock(),e.createBlock(p,{key:0,align:"center",width:"80"},{default:e.withCtx(({row:l})=>[e.createVNode(_,{direction:"vertical"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ArrowUpBold",onClick:h=>g(l.id,l.sceneCode)},null,8,["onClick"]),e.createVNode(c,{icon:"ArrowDownBold",onClick:h=>V(l.id,l.sceneCode)},null,8,["onClick"])]),_:2},1024)]),_:1})):e.createCommentVNode("",!0),e.createVNode(p,{label:"场景代码",prop:"sceneCode",width:"150"}),e.createVNode(p,{label:"图标",width:"200",align:"center"},{default:e.withCtx(({row:l})=>[l.iconType=="URL"?(e.openBlock(),e.createBlock(E,{key:0,src:l.icon,style:{"max-width":"200px"},"preview-src-list":[l.icon],"preview-teleported":""},null,8,["src","preview-src-list"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.icon),1)],64))]),_:1}),e.createVNode(p,{label:"点击事件类型",prop:"clickEventType",width:"120"},{default:e.withCtx(({row:l})=>[e.createTextVNode(e.toDisplayString(l.clickEventType?e.unref(R)[l.clickEventType].name:""),1)]),_:1}),e.createVNode(p,{label:"目标地址",prop:"targetPath","show-overflow-tooltip":""}),e.createVNode(p,{label:"目标参数",width:"120","show-overflow-tooltip":""},{default:e.withCtx(({row:l})=>[l.params?(e.openBlock(),e.createBlock(D,{key:0,trigger:"hover",width:"350"},{reference:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.params.substring(0,100))+e.toDisplayString(l.params.length>100?"...":""),1)]),default:e.withCtx(()=>[l.params.startsWith("{")?(e.openBlock(),e.createBlock(A,{key:0,column:"1",border:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(JSON.parse(l.params),(h,P)=>(e.openBlock(),e.createBlock(S,{label:P,"min-width":"150"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h),1)]),_:2},1032,["label"]))),256))]),_:2},1024)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.params),1)],64))]),_:2},1024)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(p,{label:"上架时间",prop:"shelfTime",width:"180",align:"center"}),e.createVNode(p,{label:"下架时间",prop:"offShelfTime",width:"180",align:"center"}),e.createVNode(p,{label:"状态",align:"center",width:"88"},{default:e.withCtx(({row:l})=>[l.status=="DRAFT"?(e.openBlock(),e.createBlock(n,{key:0,type:"danger"},{default:e.withCtx(()=>[e.createTextVNode("草稿")]),_:1})):e.createCommentVNode("",!0),l.status=="PUBLISH"?(e.openBlock(),e.createBlock(n,{key:1,type:"success"},{default:e.withCtx(()=>[e.createTextVNode("已发布")]),_:1})):e.createCommentVNode("",!0),l.status=="OFF_SHELF"?(e.openBlock(),e.createBlock(n,{key:2,type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("已下架")]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(p,{align:"center",width:"90"},{default:e.withCtx(({row:l})=>[["DRAFT","OFF_SHELF"].indexOf(l.status)>=0&&a.$hasPer("ENTRANCE_PUBLISH")?(e.openBlock(),e.createBlock(T,{key:0,onConfirm:h=>k(l.id),title:`确定要${l.status=="DRAFT"?"发布":"上架"}该入口吗?`},{reference:e.withCtx(()=>[e.createVNode(c,{type:"success"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.status=="DRAFT"?"发布":"上架"),1)]),_:2},1024)]),_:2},1032,["onConfirm","title"])):e.createCommentVNode("",!0),l.status=="PUBLISH"&&a.$hasPer("ENTRANCE_OFF_SHELF")?(e.openBlock(),e.createBlock(T,{key:1,onConfirm:h=>b(l.id),title:"确定要[下架]该入口吗?"},{reference:e.withCtx(()=>[e.createVNode(c,{type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("下架")]),_:1})]),_:2},1032,["onConfirm"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["condition"]),e.createVNode(W,{ref_key:"entranceDialog",ref:w,onSuccess:f},null,512)],64)}}}),j={install:(y,r)=>{let i=r.router,m=i.getRoutes().find(o=>o.path=="/");m&&m.meta&&(i.addRoute({path:"/app/banner",name:"AppBanner",redirect:"/app/banner/list",component:m.meta.commonLayout,children:[{path:"list",name:"BannerListView",component:H}]}),i.addRoute({path:"/app/entrance",name:"AppEntrance",redirect:"/app/entrance/list",component:m.meta.commonLayout,children:[{path:"list",name:"EntranceListView",component:M}]}))}},O=(y,r)=>{L.forEach(i=>y.use(i)),y.use(j,r)},q={install:O};u.default=q,u.install=O,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(A,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus"),require("@pangu-backend-ui/common"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","@pangu-backend-ui/common","pinia"],e):(A=typeof globalThis<"u"?globalThis:A||self,e(A["pg-user-core"]={},A.Vue,A["element-plus"],A.common,A.pinia))})(this,function(A,e,R,P,M){"use strict";const j=[],L={OPEN_WEB:{name:"打开Web页面"},OPEN_VIEW:{name:"打开内置页面"},API_REQUEST:{name:"请求API"},EXEC_METHOD:{name:"执行方法"},CUSTOM:{name:"自定义"}},$={OPEN_WEB:{name:"打开Web页面"},OPEN_VIEW:{name:"打开内置页面"},API_REQUEST:{name:"请求API"},EXEC_METHOD:{name:"执行方法"},CUSTOM:{name:"自定义"}},W=e.defineComponent({__name:"BannerDialog",emits:["success"],setup(B,{expose:s,emit:d}){const m=e.ref(!1),a=e.ref({sceneCode:null,image:null,targetPath:null,clickEventType:"",params:null,shelfTimeArr:[]}),N=e.ref({sceneCode:[{required:!0,message:"请输入场景代码"}],image:[{required:!0,message:"请上传图片"}],targetPath:[{required:!0,message:"请输入目标地址"}],clickEventType:[{required:!0,message:"请选择点击事件类型"}]}),u=e.ref(!1),o=e.inject("http"),x=e.ref();function b(){var r;(r=x.value)==null||r.validate(t=>{if(t){u.value=!0;let c=`/api/app/banner/${C.value??""}/${C.value?"update":"create"}`,_={...a.value};_.shelfTime=null,_.offShelfTime=null,a.value.shelfTimeArr.length&&(_.shelfTime=a.value.shelfTimeArr[0],_.offShelfTime=a.value.shelfTimeArr[1]),o==null||o.post(c,_).then(p=>{var g;d("success"),(g=x.value)==null||g.resetFields(),m.value=!1}).finally(()=>{u.value=!1})}})}const k=e.ref([]),C=e.ref(null);function E(r,t){k.value=r,C.value=null,m.value=!0,e.nextTick(()=>{t&&(C.value=t.id,Object.assign(a.value,t),t.shelfTime&&t.offShelfTime&&(a.value.shelfTimeArr=[new Date(t.shelfTime),new Date(t.offShelfTime)]))})}function T(){var r;(r=x.value)==null||r.resetFields()}return s({show:E}),(r,t)=>{const c=e.resolveComponent("el-option"),_=e.resolveComponent("el-select"),p=e.resolveComponent("el-form-item"),g=e.resolveComponent("pg-upload"),U=e.resolveComponent("el-input"),n=e.resolveComponent("el-collapse-transition"),F=e.resolveComponent("el-date-picker"),V=e.resolveComponent("el-form"),f=e.resolveComponent("el-button"),I=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(I,{modelValue:m.value,"onUpdate:modelValue":t[6]||(t[6]=i=>m.value=i),width:"400",onClosed:T},{footer:e.withCtx(()=>[e.createVNode(f,{type:"primary",disabled:u.value,loading:u.value,onClick:b},{default:e.withCtx(()=>[e.createTextVNode("提交")]),_:1},8,["disabled","loading"])]),default:e.withCtx(()=>[e.createVNode(V,{ref_key:"form",ref:x,rules:N.value,model:a.value,"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(p,{label:"场景代码",prop:"sceneCode"},{default:e.withCtx(()=>[e.createVNode(_,{modelValue:a.value.sceneCode,"onUpdate:modelValue":t[0]||(t[0]=i=>a.value.sceneCode=i),placeholder:"请输入/选择场景代码","allow-create":"",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,i=>(e.openBlock(),e.createBlock(c,{key:i,value:i,label:i},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(p,{label:"图片",prop:"image"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(g,{accept:"jpg,jpeg,png",modelValue:a.value.image,"onUpdate:modelValue":t[1]||(t[1]=i=>a.value.image=i),key:`img_${C.value}`,"list-type":"picture-card","upload-type":"banner",limit:1},null,8,["modelValue"]))]),_:1}),e.createVNode(p,{label:"点击事件类型",prop:"clickEventType"},{default:e.withCtx(()=>[e.createVNode(_,{placeholder:"请选择点击事件类型",modelValue:a.value.clickEventType,"onUpdate:modelValue":t[2]||(t[2]=i=>a.value.clickEventType=i)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),(i,w)=>(e.openBlock(),e.createBlock(c,{value:w,label:i.name},null,8,["value","label"]))),256))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>[["OPEN_WEB","OPEN_VIEW","API_REQUEST"].indexOf(a.value.clickEventType)>=0?(e.openBlock(),e.createBlock(p,{key:0,label:"目标地址",prop:"targetPath"},{default:e.withCtx(()=>[e.createVNode(U,{placeholder:"请输入目标地址",modelValue:a.value.targetPath,"onUpdate:modelValue":t[3]||(t[3]=i=>a.value.targetPath=i)},null,8,["modelValue"])]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(p,{label:"目标地址参数",prop:"params"},{default:e.withCtx(()=>[e.createVNode(U,{type:"textarea",modelValue:a.value.params,"onUpdate:modelValue":t[4]||(t[4]=i=>a.value.params=i),placeholder:"请输入JSON格式的参数对象"},null,8,["modelValue"])]),_:1}),e.createVNode(p,{label:"生效时段",prop:"shelfTimeArr"},{default:e.withCtx(()=>[e.createVNode(F,{type:"datetimerange",modelValue:a.value.shelfTimeArr,"onUpdate:modelValue":t[5]||(t[5]=i=>a.value.shelfTimeArr=i),"start-placeholder":"上架时间","end-placeholder":"下架时间","default-time":[new Date(2e3,1,1,0,0,0),new Date(2e3,1,1,23,59,59)]},null,8,["modelValue","default-time"])]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["modelValue"])}}}),z=e.defineComponent({__name:"BannerListView",setup(B){const s=e.inject("http"),d=e.ref({sceneCode:null,status:null}),m=e.ref([]);function a(){s==null||s.get("/api/app/banner/all-scene-code").then(r=>{m.value=r.data})}const N=e.ref(),u=e.ref(!1);function o(){u.value=!!d.value.sceneCode,N.value.search()}function x(r){s==null||s.post(`/api/app/banner/${r}/publish`).then(t=>{o()})}function b(r){s==null||s.post(`/api/app/banner/${r}/off-shelf`).then(t=>{o()})}function k(r,t){s==null||s.post(`/api/app/banner/${r}/move-up`).then(c=>{d.value.sceneCode=t,o()})}function C(r,t){s==null||s.post(`/api/app/banner/${r}/move-down`).then(c=>{d.value.sceneCode=t,o()})}e.onBeforeMount(()=>{a()});const E=e.ref();function T(r){E.value.show(m.value,r)}return(r,t)=>{const c=e.resolveComponent("el-option"),_=e.resolveComponent("el-select"),p=e.resolveComponent("el-button"),g=e.resolveComponent("el-space"),U=e.resolveComponent("el-card"),n=e.resolveComponent("el-table-column"),F=e.resolveComponent("el-image"),V=e.resolveComponent("el-descriptions-item"),f=e.resolveComponent("el-descriptions"),I=e.resolveComponent("el-popover"),i=e.resolveComponent("el-tag"),w=e.resolveComponent("el-popconfirm"),S=e.resolveComponent("pg-table"),D=e.resolveDirective("permission");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[e.createVNode(_,{modelValue:d.value.sceneCode,"onUpdate:modelValue":t[0]||(t[0]=l=>d.value.sceneCode=l),placeholder:"场景代码",clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,y)=>(e.openBlock(),e.createBlock(c,{label:l,value:l,key:`sc_con_${y}`},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(_,{modelValue:d.value.status,"onUpdate:modelValue":t[1]||(t[1]=l=>d.value.status=l),placeholder:"状态",clearable:"",style:{width:"150px"}},{default:e.withCtx(()=>[e.createVNode(c,{label:"草稿",value:"DRAFT"}),e.createVNode(c,{label:"已发布",value:"PUBLISH"}),e.createVNode(c,{label:"已下架",value:"OFF_SHELF"})]),_:1},8,["modelValue"]),e.createVNode(p,{type:"primary",icon:"search",onClick:o},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1}),e.withDirectives((e.openBlock(),e.createBlock(p,{icon:"plus",onClick:t[2]||(t[2]=l=>T())},{default:e.withCtx(()=>[e.createTextVNode("创建Banner")]),_:1})),[[D,"CREATE_BANNER"]])]),_:1})]),_:1}),e.createVNode(S,{ref_key:"table",ref:N,"data-url":"/api/app/banner/page",onRowDbClick:t[3]||(t[3]=l=>r.$hasPer("UPDATE_BANNER")?T(l):null),condition:d.value,style:{"margin-top":"10px"}},{default:e.withCtx(()=>[u.value&&r.$hasPer("BANNER_SEQ_MOVE_UP_DOWN")?(e.openBlock(),e.createBlock(n,{key:0,align:"center",width:"80"},{default:e.withCtx(({row:l})=>[e.createVNode(g,{direction:"vertical"},{default:e.withCtx(()=>[e.createVNode(p,{icon:"ArrowUpBold",onClick:y=>k(l.id,l.sceneCode)},null,8,["onClick"]),e.createVNode(p,{icon:"ArrowDownBold",onClick:y=>C(l.id,l.sceneCode)},null,8,["onClick"])]),_:2},1024)]),_:1})):e.createCommentVNode("",!0),e.createVNode(n,{label:"场景代码",prop:"sceneCode",width:"150"}),e.createVNode(n,{label:"图片",width:"300",align:"center"},{default:e.withCtx(({row:l})=>[e.createVNode(F,{src:l.image,style:{"max-width":"300px"},"preview-src-list":[l.image],"preview-teleported":""},null,8,["src","preview-src-list"])]),_:1}),e.createVNode(n,{label:"点击事件类型",prop:"clickEventType",width:"120"},{default:e.withCtx(({row:l})=>[e.createTextVNode(e.toDisplayString(l.clickEventType?e.unref(L)[l.clickEventType].name:""),1)]),_:1}),e.createVNode(n,{label:"目标地址",prop:"targetPath","show-overflow-tooltip":""}),e.createVNode(n,{label:"目标参数",width:"120","show-overflow-tooltip":""},{default:e.withCtx(({row:l})=>[l.params?(e.openBlock(),e.createBlock(I,{key:0,trigger:"hover",width:"350"},{reference:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.params.substring(0,100))+e.toDisplayString(l.params.length>100?"...":""),1)]),default:e.withCtx(()=>[l.params.startsWith("{")?(e.openBlock(),e.createBlock(f,{key:0,column:"1",border:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(JSON.parse(l.params),(y,O)=>(e.openBlock(),e.createBlock(V,{label:O,"min-width":"150"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y),1)]),_:2},1032,["label"]))),256))]),_:2},1024)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.params),1)],64))]),_:2},1024)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(n,{label:"上架时间",prop:"shelfTime",width:"180",align:"center"}),e.createVNode(n,{label:"下架时间",prop:"offShelfTime",width:"180",align:"center"}),e.createVNode(n,{label:"状态",align:"center",width:"88"},{default:e.withCtx(({row:l})=>[l.status=="DRAFT"?(e.openBlock(),e.createBlock(i,{key:0,type:"danger"},{default:e.withCtx(()=>[e.createTextVNode("草稿")]),_:1})):e.createCommentVNode("",!0),l.status=="PUBLISH"?(e.openBlock(),e.createBlock(i,{key:1,type:"success"},{default:e.withCtx(()=>[e.createTextVNode("已发布")]),_:1})):e.createCommentVNode("",!0),l.status=="OFF_SHELF"?(e.openBlock(),e.createBlock(i,{key:2,type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("已下架")]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(n,{align:"center",width:"90"},{default:e.withCtx(({row:l})=>[["DRAFT","OFF_SHELF"].indexOf(l.status)>=0&&r.$hasPer("BANNER_PUBLISH")?(e.openBlock(),e.createBlock(w,{key:0,onConfirm:y=>x(l.id),title:`确定要${l.status=="DRAFT"?"发布":"上架"}该Banner吗?`},{reference:e.withCtx(()=>[e.createVNode(p,{type:"success"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.status=="DRAFT"?"发布":"上架"),1)]),_:2},1024)]),_:2},1032,["onConfirm","title"])):e.createCommentVNode("",!0),l.status=="PUBLISH"&&r.$hasPer("BANNER_OFF_SHELF")?(e.openBlock(),e.createBlock(w,{key:1,onConfirm:y=>b(l.id),title:"确定要[下架]该Banner吗?"},{reference:e.withCtx(()=>[e.createVNode(p,{type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("下架")]),_:1})]),_:2},1032,["onConfirm"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["condition"]),e.createVNode(W,{ref_key:"bannerDialog",ref:E,onSuccess:o},null,512)],64)}}}),Q=e.defineComponent({__name:"EntranceDialog",emits:["success"],setup(B,{expose:s,emit:d}){const m=e.ref(!1),a=e.ref({sceneCode:null,name:null,iconType:"NAME",icon:null,targetPath:null,clickEventType:"",params:null,shelfTimeArr:[]}),N=e.ref({sceneCode:[{required:!0,message:"请输入场景代码"}],name:[{required:!0,message:"请输入入口名称"}],iconType:[{required:!0,message:"请选择图标类型"}],icon:[{required:!0,message:`请${a.value.iconType=="NAME"?"输入图标名称":"上传图标图片"}`}],targetPath:[{required:!0,message:"请输入目标地址"}],clickEventType:[{required:!0,message:"请选择点击事件类型"}]}),u=e.ref(!1),o=e.inject("http"),x=e.ref();function b(){var r;(r=x.value)==null||r.validate(t=>{if(t){u.value=!0;let c=`/api/app/entrance/${C.value??""}/${C.value?"update":"create"}`,_={...a.value};_.shelfTime=null,_.offShelfTime=null,a.value.shelfTimeArr.length&&(_.shelfTime=a.value.shelfTimeArr[0],_.offShelfTime=a.value.shelfTimeArr[1]),o==null||o.post(c,_).then(p=>{var g;d("success"),(g=x.value)==null||g.resetFields(),m.value=!1}).finally(()=>{u.value=!1})}})}const k=e.ref([]),C=e.ref(null);function E(r,t){k.value=r,C.value=null,m.value=!0,e.nextTick(()=>{t&&(C.value=t.id,Object.assign(a.value,t),t.shelfTime&&t.offShelfTime&&(a.value.shelfTimeArr=[new Date(t.shelfTime),new Date(t.offShelfTime)]))})}function T(){var r;(r=x.value)==null||r.resetFields()}return s({show:E}),(r,t)=>{const c=e.resolveComponent("el-option"),_=e.resolveComponent("el-select"),p=e.resolveComponent("el-form-item"),g=e.resolveComponent("el-input"),U=e.resolveComponent("pg-upload"),n=e.resolveComponent("el-collapse-transition"),F=e.resolveComponent("el-date-picker"),V=e.resolveComponent("el-form"),f=e.resolveComponent("el-button"),I=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(I,{modelValue:m.value,"onUpdate:modelValue":t[9]||(t[9]=i=>m.value=i),width:"400",onClose:T},{footer:e.withCtx(()=>[e.createVNode(f,{type:"primary",disabled:u.value,loading:u.value,onClick:b},{default:e.withCtx(()=>[e.createTextVNode("提交")]),_:1},8,["disabled","loading"])]),default:e.withCtx(()=>[e.createVNode(V,{ref_key:"form",ref:x,rules:N.value,model:a.value,"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(p,{label:"场景代码",prop:"sceneCode"},{default:e.withCtx(()=>[e.createVNode(_,{modelValue:a.value.sceneCode,"onUpdate:modelValue":t[0]||(t[0]=i=>a.value.sceneCode=i),placeholder:"请输入/选择场景代码","allow-create":"",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,i=>(e.openBlock(),e.createBlock(c,{key:i,value:i,label:i},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(p,{label:"入口名称",prop:"name"},{default:e.withCtx(()=>[e.createVNode(g,{placeholder:"请输入入口名称",modelValue:a.value.name,"onUpdate:modelValue":t[1]||(t[1]=i=>a.value.name=i)},null,8,["modelValue"])]),_:1}),e.createVNode(p,{label:"图标类型",prop:"iconType"},{default:e.withCtx(()=>[e.createVNode(_,{placeholder:"请选择图标类型",modelValue:a.value.iconType,"onUpdate:modelValue":t[2]||(t[2]=i=>a.value.iconType=i)},{default:e.withCtx(()=>[e.createVNode(c,{value:"NAME",label:"图标名称"}),e.createVNode(c,{value:"URL",label:"图标URL"})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(p,{label:"图标",prop:"icon"},{default:e.withCtx(()=>[a.value.iconType=="URL"?(e.openBlock(),e.createBlock(U,{accept:"jpg,jpeg,png,gif",modelValue:a.value.icon,"onUpdate:modelValue":t[3]||(t[3]=i=>a.value.icon=i),key:`img_${C.value}`,"list-type":"picture-card","upload-type":"entrance",limit:1},null,8,["modelValue"])):(e.openBlock(),e.createBlock(g,{key:1,modelValue:a.value.icon,"onUpdate:modelValue":t[4]||(t[4]=i=>a.value.icon=i),placeholder:"请输入图标名称",clearable:""},null,8,["modelValue"]))]),_:1}),e.createVNode(p,{label:"点击事件类型",prop:"clickEventType"},{default:e.withCtx(()=>[e.createVNode(_,{placeholder:"请选择点击事件类型",modelValue:a.value.clickEventType,"onUpdate:modelValue":t[5]||(t[5]=i=>a.value.clickEventType=i)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref($),(i,w)=>(e.openBlock(),e.createBlock(c,{value:w,label:i.name},null,8,["value","label"]))),256))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>[["OPEN_WEB","OPEN_VIEW","API_REQUEST"].indexOf(a.value.clickEventType)>=0?(e.openBlock(),e.createBlock(p,{key:0,label:"目标地址",prop:"targetPath"},{default:e.withCtx(()=>[e.createVNode(g,{placeholder:"请输入目标地址",modelValue:a.value.targetPath,"onUpdate:modelValue":t[6]||(t[6]=i=>a.value.targetPath=i)},null,8,["modelValue"])]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(p,{label:"目标地址参数",prop:"params"},{default:e.withCtx(()=>[e.createVNode(g,{type:"textarea",modelValue:a.value.params,"onUpdate:modelValue":t[7]||(t[7]=i=>a.value.params=i),placeholder:"请输入JSON格式的参数对象"},null,8,["modelValue"])]),_:1}),e.createVNode(p,{label:"生效时段",prop:"shelfTimeArr"},{default:e.withCtx(()=>[e.createVNode(F,{type:"datetimerange",modelValue:a.value.shelfTimeArr,"onUpdate:modelValue":t[8]||(t[8]=i=>a.value.shelfTimeArr=i),"start-placeholder":"上架时间","end-placeholder":"下架时间","default-time":[new Date(2e3,1,1,0,0,0),new Date(2e3,1,1,23,59,59)]},null,8,["modelValue","default-time"])]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["modelValue"])}}}),X=e.defineComponent({__name:"EntranceListView",setup(B){const s=e.inject("http"),d=e.ref({sceneCode:null,status:null}),m=e.ref([]);function a(){s==null||s.get("/api/app/entrance/all-scene-code").then(r=>{m.value=r.data})}const N=e.ref(),u=e.ref(!1);function o(){u.value=!!d.value.sceneCode,N.value.search()}function x(r){s==null||s.post(`/api/app/entrance/${r}/publish`).then(t=>{o()})}function b(r){s==null||s.post(`/api/app/entrance/${r}/off-shelf`).then(t=>{o()})}function k(r,t){s==null||s.post(`/api/app/entrance/${r}/move-up`).then(c=>{d.value.sceneCode=t,o()})}function C(r,t){s==null||s.post(`/api/app/entrance/${r}/move-down`).then(c=>{d.value.sceneCode=t,o()})}e.onBeforeMount(()=>{a()});const E=e.ref();function T(r){E.value.show(m.value,r)}return(r,t)=>{const c=e.resolveComponent("el-option"),_=e.resolveComponent("el-select"),p=e.resolveComponent("el-button"),g=e.resolveComponent("el-space"),U=e.resolveComponent("el-card"),n=e.resolveComponent("el-table-column"),F=e.resolveComponent("el-image"),V=e.resolveComponent("el-descriptions-item"),f=e.resolveComponent("el-descriptions"),I=e.resolveComponent("el-popover"),i=e.resolveComponent("el-tag"),w=e.resolveComponent("el-popconfirm"),S=e.resolveComponent("pg-table"),D=e.resolveDirective("permission");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[e.createVNode(_,{modelValue:d.value.sceneCode,"onUpdate:modelValue":t[0]||(t[0]=l=>d.value.sceneCode=l),placeholder:"场景代码",clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,y)=>(e.openBlock(),e.createBlock(c,{label:l,value:l,key:`sc_con_${y}`},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(_,{modelValue:d.value.status,"onUpdate:modelValue":t[1]||(t[1]=l=>d.value.status=l),placeholder:"状态",clearable:"",style:{width:"150px"}},{default:e.withCtx(()=>[e.createVNode(c,{label:"草稿",value:"DRAFT"}),e.createVNode(c,{label:"已发布",value:"PUBLISH"}),e.createVNode(c,{label:"已下架",value:"OFF_SHELF"})]),_:1},8,["modelValue"]),e.createVNode(p,{type:"primary",icon:"search",onClick:o},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1}),e.withDirectives((e.openBlock(),e.createBlock(p,{icon:"plus",onClick:t[2]||(t[2]=l=>T())},{default:e.withCtx(()=>[e.createTextVNode("创建入口")]),_:1})),[[D,"CREATE_ENTRANCE"]])]),_:1})]),_:1}),e.createVNode(S,{ref_key:"table",ref:N,"data-url":"/api/app/entrance/page",onRowDbClick:t[3]||(t[3]=l=>r.$hasPer("UPDATE_ENTRANCE")?T(l):null),condition:d.value,style:{"margin-top":"10px"}},{default:e.withCtx(()=>[u.value&&r.$hasPer("ENTRANCE_SEQ_MOVE_UP_DOWN")?(e.openBlock(),e.createBlock(n,{key:0,align:"center",width:"80"},{default:e.withCtx(({row:l})=>[e.createVNode(g,{direction:"vertical"},{default:e.withCtx(()=>[e.createVNode(p,{icon:"ArrowUpBold",onClick:y=>k(l.id,l.sceneCode)},null,8,["onClick"]),e.createVNode(p,{icon:"ArrowDownBold",onClick:y=>C(l.id,l.sceneCode)},null,8,["onClick"])]),_:2},1024)]),_:1})):e.createCommentVNode("",!0),e.createVNode(n,{label:"场景代码",prop:"sceneCode",width:"150"}),e.createVNode(n,{label:"图标",width:"200",align:"center"},{default:e.withCtx(({row:l})=>[l.iconType=="URL"?(e.openBlock(),e.createBlock(F,{key:0,src:l.icon,style:{"max-width":"200px"},"preview-src-list":[l.icon],"preview-teleported":""},null,8,["src","preview-src-list"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.icon),1)],64))]),_:1}),e.createVNode(n,{label:"点击事件类型",prop:"clickEventType",width:"120"},{default:e.withCtx(({row:l})=>[e.createTextVNode(e.toDisplayString(l.clickEventType?e.unref($)[l.clickEventType].name:""),1)]),_:1}),e.createVNode(n,{label:"目标地址",prop:"targetPath","show-overflow-tooltip":""}),e.createVNode(n,{label:"目标参数",width:"120","show-overflow-tooltip":""},{default:e.withCtx(({row:l})=>[l.params?(e.openBlock(),e.createBlock(I,{key:0,trigger:"hover",width:"350"},{reference:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.params.substring(0,100))+e.toDisplayString(l.params.length>100?"...":""),1)]),default:e.withCtx(()=>[l.params.startsWith("{")?(e.openBlock(),e.createBlock(f,{key:0,column:"1",border:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(JSON.parse(l.params),(y,O)=>(e.openBlock(),e.createBlock(V,{label:O,"min-width":"150"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y),1)]),_:2},1032,["label"]))),256))]),_:2},1024)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.params),1)],64))]),_:2},1024)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(n,{label:"上架时间",prop:"shelfTime",width:"180",align:"center"}),e.createVNode(n,{label:"下架时间",prop:"offShelfTime",width:"180",align:"center"}),e.createVNode(n,{label:"状态",align:"center",width:"88"},{default:e.withCtx(({row:l})=>[l.status=="DRAFT"?(e.openBlock(),e.createBlock(i,{key:0,type:"danger"},{default:e.withCtx(()=>[e.createTextVNode("草稿")]),_:1})):e.createCommentVNode("",!0),l.status=="PUBLISH"?(e.openBlock(),e.createBlock(i,{key:1,type:"success"},{default:e.withCtx(()=>[e.createTextVNode("已发布")]),_:1})):e.createCommentVNode("",!0),l.status=="OFF_SHELF"?(e.openBlock(),e.createBlock(i,{key:2,type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("已下架")]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(n,{align:"center",width:"90"},{default:e.withCtx(({row:l})=>[["DRAFT","OFF_SHELF"].indexOf(l.status)>=0&&r.$hasPer("ENTRANCE_PUBLISH")?(e.openBlock(),e.createBlock(w,{key:0,onConfirm:y=>x(l.id),title:`确定要${l.status=="DRAFT"?"发布":"上架"}该入口吗?`},{reference:e.withCtx(()=>[e.createVNode(p,{type:"success"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.status=="DRAFT"?"发布":"上架"),1)]),_:2},1024)]),_:2},1032,["onConfirm","title"])):e.createCommentVNode("",!0),l.status=="PUBLISH"&&r.$hasPer("ENTRANCE_OFF_SHELF")?(e.openBlock(),e.createBlock(w,{key:1,onConfirm:y=>b(l.id),title:"确定要[下架]该入口吗?"},{reference:e.withCtx(()=>[e.createVNode(p,{type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("下架")]),_:1})]),_:2},1032,["onConfirm"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["condition"]),e.createVNode(Q,{ref_key:"entranceDialog",ref:E,onSuccess:o},null,512)],64)}}}),H=M.defineStore("pg-app-util-core-config-store",()=>{const B=[];return{defaultTesterUserIds:e.computed(()=>B)}}),ae="",G=(B,s)=>{const d=B.__vccOpts||B;for(const[m,a]of s)d[m]=a;return d},K={class:"dialog-footer"},Y=G({__name:"VersionDialog",emits:["success"],setup(B,{expose:s,emit:d}){const m=e.inject<P.Http>"http",a=e.ref("CREATE"),N=e.computed(()=>a.value==="EDIT"),u=e.ref(!1),o=e.ref({appCode:null,platform:"ANDROID",versionName:null,versionNumber:null,category:"SELF",isForce:!1,isHot:!0,activationTime:null,pkgUrl:null,wgtUrl:null,description:null,testerIdJsonStr:""}),x=e.ref(),b=H();e.onMounted(()=>{b.defaultTesterUserIds.length&&(o.value.testerIdJsonStr=b.defaultTesterUserIds.join(","))});let k=null;const C=e.ref(!1);async function E(V){u.value=!0,a.value=V?"EDIT":"CREATE",k=V,V&&(C.value=V.status=="RELEASE",console.log(V.status),Object.assign(o.value,V),V.testerIdJsonStr&&(o.value.testerIdJsonStr=JSON.parse(V.testerIdJsonStr).join(",")),x.value=V.isHot?V.wgtUrl:V.pkgUrl),await F(),V&&p(V.appCode)}function T(V){o.value.isHot?o.value.wgtUrl=V.fileUrl:o.value.pkgUrl=V.fileUrl}function r(){o.value={appCode:null,platform:"ANDROID",versionName:null,category:"SELF",isForce:!1,isHot:!0,activationTime:null,pkgUrl:null,wgtUrl:null,testerIdJsonStr:""}}function t(){u.value=!u.value}const c=e.ref();function _(){c.value.validate(V=>{V&&(N.value?m.post(`/api/app/version/${k.id}`,{...o.value,testerIdJsonStr:o.value.testerIdJsonStr?JSON.stringify(JSON.parse("["+o.value.testerIdJsonStr+"]")):null}).then(f=>{t(),d("success")}):m.post("/api/app/version",{...o.value,testerIdJsonStr:o.value.testerIdJsonStr?JSON.stringify(JSON.parse("["+o.value.testerIdJsonStr+"]")):null}).then(f=>{t(),d("success")}))})}function p(V){n.value.find(I=>I.code===V).platform=="IOS"?o.value.platform="IOS":o.value.platform="ANDROID"}const g=e.ref();function U(){o.value.wgtUrl=null,o.value.pkgUrl=null,g.value&&g.value.clearFileList()}const n=e.ref([]);async function F(){if(n.value.length<=0){const V=await m.get("/api/app/all");n.value=V.data}}return s({show:E}),(V,f)=>{const I=e.resolveComponent("el-option"),i=e.resolveComponent("el-select"),w=e.resolveComponent("el-form-item"),S=e.resolveComponent("el-col"),D=e.resolveComponent("el-row"),l=e.resolveComponent("el-input"),y=e.resolveComponent("el-date-picker"),O=e.resolveComponent("el-checkbox"),te=e.resolveComponent("pg-upload"),le=e.resolveComponent("el-form"),q=e.resolveComponent("el-button"),oe=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(oe,{title:e.unref(N)?"编辑App版本":"发布App版本",modelValue:u.value,"onUpdate:modelValue":f[10]||(f[10]=h=>u.value=h),width:"700px",onClosed:r},{footer:e.withCtx(()=>[e.createElementVNode("div",K,[e.createVNode(q,{onClick:t},{default:e.withCtx(()=>[e.createTextVNode("取 消")]),_:1}),e.createVNode(q,{type:"primary",onClick:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)?"提 交":"创 建"),1)]),_:1})])]),default:e.withCtx(()=>[e.createVNode(le,{model:o.value,ref_key:"publishModalForm",ref:c},{default:e.withCtx(()=>[e.createVNode(D,null,{default:e.withCtx(()=>[e.createVNode(S,{span:24},{default:e.withCtx(()=>[e.createVNode(w,{label:"应用","label-width":"100px",prop:"appCode",rules:[{required:!0,message:"请选择应用",trigger:"blur"}]},{default:e.withCtx(()=>[e.createVNode(i,{modelValue:o.value.appCode,"onUpdate:modelValue":f[0]||(f[0]=h=>o.value.appCode=h),disabled:e.unref(N)&&C.value,placeholder:"请选择要发布的平台",style:{width:"100%"},onChange:p},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,h=>(e.openBlock(),e.createBlock(I,{key:h.code,label:h.name,value:h.code},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1}),e.createVNode(D,null,{default:e.withCtx(()=>[e.createVNode(S,{span:12},{default:e.withCtx(()=>[e.createVNode(w,{label:"版本名称","label-width":"100px",prop:"versionName",rules:[{required:!0,message:"请输入版本名称",trigger:"blur"}]},{default:e.withCtx(()=>[e.createVNode(l,{modelValue:o.value.versionName,"onUpdate:modelValue":f[1]||(f[1]=h=>o.value.versionName=h),disabled:e.unref(N)&&C.value,placeholder:"例: 1.1.2"},null,8,["modelValue","disabled"])]),_:1})]),_:1}),e.createVNode(S,{span:12},{default:e.withCtx(()=>[e.createVNode(w,{label:"版本编号","label-width":"100px",prop:"versionNumber",rules:[{required:!0,message:"请输入版本编号",trigger:"blur"}]},{default:e.withCtx(()=>[e.createVNode(l,{modelValue:o.value.versionNumber,"onUpdate:modelValue":f[2]||(f[2]=h=>o.value.versionNumber=h),disabled:e.unref(N)&&C.value,type:"number",min:"1",placeholder:"例: 112"},null,8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1}),e.createVNode(D,null,{default:e.withCtx(()=>[e.createVNode(S,{span:12},{default:e.withCtx(()=>[e.createVNode(w,{label:"启用时间","label-width":"100px"},{default:e.withCtx(()=>[e.createVNode(y,{modelValue:o.value.activationTime,"onUpdate:modelValue":f[3]||(f[3]=h=>o.value.activationTime=h),type:"datetime",placeholder:"选择启用时间",disabled:e.unref(N)&&C.value},null,8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1}),e.createVNode(D,null,{default:e.withCtx(()=>[e.createVNode(S,{span:12},{default:e.withCtx(()=>[e.createVNode(w,{label:"是否热更新","label-width":"100px"},{default:e.withCtx(()=>[e.createVNode(O,{modelValue:o.value.isHot,"onUpdate:modelValue":f[4]||(f[4]=h=>o.value.isHot=h),onChange:U,disabled:e.unref(N)&&C.value},null,8,["modelValue","disabled"])]),_:1})]),_:1}),e.createVNode(S,{span:12},{default:e.withCtx(()=>[e.createVNode(w,{label:"是否强制","label-width":"100px"},{default:e.withCtx(()=>[e.createVNode(O,{modelValue:o.value.isForce,"onUpdate:modelValue":f[5]||(f[5]=h=>o.value.isForce=h),placeholder:"请选择是否强制",disabled:e.unref(N)&&C.value},null,8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1}),o.value.category=="APP_STORE"?(e.openBlock(),e.createBlock(D,{key:0},{default:e.withCtx(()=>[e.createVNode(S,{span:24},{default:e.withCtx(()=>[e.createVNode(w,{label:"市场地址","label-width":"100px",prop:"pkgUrl",rules:[{required:!0,message:"应用市场地址",trigger:"blur"}]},{default:e.withCtx(()=>[e.createVNode(l,{modelValue:o.value.pkgUrl,"onUpdate:modelValue":f[6]||(f[6]=h=>o.value.pkgUrl=h),placeholder:"应用市场地址"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})):e.createCommentVNode("",!0),e.createVNode(D,null,{default:e.withCtx(()=>[e.createVNode(S,{span:24},{default:e.withCtx(()=>[e.createVNode(w,{label:"版本描述","label-width":"100px",prop:"description",rules:[{required:!0,message:"请输入版本描述",trigger:"blur"}]},{default:e.withCtx(()=>[e.createVNode(l,{type:"textarea",modelValue:o.value.description,"onUpdate:modelValue":f[7]||(f[7]=h=>o.value.description=h),autosize:{minRows:4},placeholder:"请输入版本描述"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.unref(N)&&C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D,{key:1},{default:e.withCtx(()=>[e.createVNode(S,{span:24},{default:e.withCtx(()=>[e.createVNode(w,{label:"测试用户","label-width":"100px",prop:"testerIdJsonStr"},{default:e.withCtx(()=>[e.createVNode(l,{type:"textarea",modelValue:o.value.testerIdJsonStr,"onUpdate:modelValue":f[8]||(f[8]=h=>o.value.testerIdJsonStr=h),autosize:{minRows:4},placeholder:"请输入测试用户ID。 例子: 10000, 100202, 100203"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})),o.value.platform=="ANDROID"||o.value.platform=="IOS"&&o.value.isHot?(e.openBlock(),e.createBlock(D,{key:2},{default:e.withCtx(()=>[e.createVNode(S,{span:24},{default:e.withCtx(()=>[e.createVNode(w,{label:o.value.isHot?"上传更新包":"上传安装包","label-width":"100px",rules:[{required:!0,message:"请上传更新包",trigger:"blur"}]},{default:e.withCtx(()=>[e.createVNode(te,{ref_key:"appPkgUploader",ref:g,modelValue:x.value,"onUpdate:modelValue":f[9]||(f[9]=h=>x.value=h),drag:!0,multiple:!1,tips:"热更新下只能上传wgt格式的文件,非热更新下只能上传apk格式的文件",autoUpload:!0,uploadType:"appPkg",accept:o.value.isHot?".wgt":"application/vnd.android.package-archive",disabled:e.unref(N)&&C.value,onOnSuccess:T},null,8,["modelValue","accept","disabled"])]),_:1},8,["label"])]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["title","modelValue"])}}},[["__scopeId","data-v-9e13a1f7"]]),Z={__name:"VersionListView",setup(B){const s=e.ref({platform:null,isHot:null,status:null}),d=e.inject<P.Http>"http",m=e.ref();function a(){m.value.search()}const N=e.ref();function u(b){N.value.show(b)}async function o(b){await d.post(`/api/app/version/${b}/publish`),a(),R.ElMessage.success("发布成功")}async function x(b){await d.post(`/api/app/version/${b}/offline`),a(),R.ElMessage.success("下架成功")}return(b,k)=>{const C=e.resolveComponent("el-option"),E=e.resolveComponent("el-select"),T=e.resolveComponent("el-button"),r=e.resolveComponent("el-space"),t=e.resolveComponent("el-card"),c=e.resolveComponent("el-table-column"),_=e.resolveComponent("el-tag"),p=e.resolveComponent("el-popconfirm"),g=e.resolveComponent("pg-table"),U=e.resolveDirective("permission");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(t,null,{default:e.withCtx(()=>[e.createVNode(r,null,{default:e.withCtx(()=>[e.createVNode(E,{modelValue:s.value.isHot,"onUpdate:modelValue":k[0]||(k[0]=n=>s.value.isHot=n),placeholder:"热更新/整包更新",style:{width:"180px"},clearable:""},{default:e.withCtx(()=>[e.createVNode(C,{label:"热更新",value:"true"}),e.createVNode(C,{label:"整包更新",value:"false"})]),_:1},8,["modelValue"]),e.createVNode(E,{modelValue:s.value.status,"onUpdate:modelValue":k[1]||(k[1]=n=>s.value.status=n),placeholder:"状态",style:{width:"120px"},clearable:""},{default:e.withCtx(()=>[e.createVNode(C,{label:"测试",value:"TEST"}),e.createVNode(C,{label:"发布",value:"RELEASE"}),e.createVNode(C,{label:"下架",value:"OFFLINE"})]),_:1},8,["modelValue"]),e.createVNode(T,{type:"primary",icon:"search",onClick:a},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1}),e.withDirectives((e.openBlock(),e.createBlock(T,{icon:"plus",onClick:k[2]||(k[2]=n=>u())},{default:e.withCtx(()=>[e.createTextVNode("新建版本")]),_:1})),[[U,"CREATE_BANNER"]])]),_:1})]),_:1}),e.createVNode(g,{ref_key:"table",ref:m,"data-url":"/api/app/version/page-search",onRowDbClick:k[3]||(k[3]=n=>u(n)),condition:s.value,style:{"margin-top":"10px"}},{default:e.withCtx(()=>[e.createVNode(c,{label:"ID",prop:"id",align:"center",width:"60px"}),e.createVNode(c,{label:"应用",prop:"appName",align:"center",width:"120px","show-overflow-tooltip":""}),e.createVNode(c,{label:"应用平台",prop:"appPlatform",align:"center",width:"100px","show-overflow-tooltip":""}),e.createVNode(c,{label:"版本名称",prop:"versionName",align:"center",width:"90","show-overflow-tooltip":""}),e.createVNode(c,{label:"版本编号",prop:"versionNumber",align:"center",width:"90","show-overflow-tooltip":""}),e.createVNode(c,{label:"强制更新",prop:"isForce",align:"center",width:"90","show-overflow-tooltip":""},{default:e.withCtx(({row:n})=>[n.isForce?(e.openBlock(),e.createBlock(_,{key:0,type:"warning",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("是")]),_:1})):(e.openBlock(),e.createBlock(_,{key:1,type:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("否")]),_:1}))]),_:1}),e.createVNode(c,{label:"整包更新",prop:"isHot",align:"center",width:"90","show-overflow-tooltip":""},{default:e.withCtx(({row:n})=>[n.isHot?(e.openBlock(),e.createBlock(_,{key:0,type:"warning",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("否")]),_:1})):(e.openBlock(),e.createBlock(_,{key:1,type:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("是")]),_:1}))]),_:1}),e.createVNode(c,{label:"启用时间",width:"150px",prop:"activationTime",align:"center","show-overflow-tooltip":""}),e.createVNode(c,{label:"状态",width:"100",align:"center"},{default:e.withCtx(({row:n})=>[e.createVNode(_,{type:n.status=="RELEASE"?"success":n.status=="OFFLINE"?"danger":"warning"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.status=="RELEASE"?"发布":n.status=="OFFLINE"?"下线":"测试"),1)]),_:2},1032,["type"])]),_:1}),e.createVNode(c,{label:"安装包/更新包地址",prop:"pkgUrl",align:"center","show-overflow-tooltip":""},{default:e.withCtx(({row:n})=>[e.createTextVNode(e.toDisplayString(n.isHot?n.wgtUrl:n.pkgUrl),1)]),_:1}),e.createVNode(c,{label:"操作",align:"center",width:"160px"},{default:e.withCtx(({row:n})=>[n.status=="RELEASE"?(e.openBlock(),e.createBlock(p,{key:0,title:`确定下架版本[${n.versionName}]吗?`,onConfirm:F=>x(n.id)},{reference:e.withCtx(()=>[e.createVNode(T,{type:"danger"},{default:e.withCtx(()=>[e.createTextVNode("下架")]),_:1})]),_:2},1032,["title","onConfirm"])):e.createCommentVNode("",!0),n.status=="TEST"||n.status=="OFFLINE"?(e.openBlock(),e.createBlock(p,{key:1,title:"是否确定发布该版本?",onConfirm:F=>o(n.id)},{reference:e.withCtx(()=>[e.createVNode(T,{type:"success"},{default:e.withCtx(()=>[e.createTextVNode("发布")]),_:1})]),_:2},1032,["onConfirm"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["condition"]),e.createVNode(Y,{ref_key:"versionDiloag",ref:N,onSuccess:a},null,512)],64)}}},v={install:(B,s)=>{let d=s.router,m=d.getRoutes().find(a=>a.path=="/");m&&m.meta&&(d.addRoute({path:"/app/banner",name:"AppBanner",redirect:"/app/banner/list",component:m.meta.commonLayout,children:[{path:"list",name:"BannerListView",component:z}]}),d.addRoute({path:"/app/entrance",name:"AppEntrance",redirect:"/app/entrance/list",component:m.meta.commonLayout,children:[{path:"list",name:"EntranceListView",component:X}]}),d.addRoute({path:"/app/version",name:"AppVersion",redirect:"/app/version/list",component:m.meta.commonLayout,children:[{path:"list",name:"AppVersionListView",component:Z}]}))}},J=(B,s)=>{j.forEach(m=>B.use(m)),B.use(v,s);const d=H();if(s.defaultTesterUserIds)for(let m of s.defaultTesterUserIds)d.defaultTesterUserIds.push(m)},ee={install:J};A.default=ee,A.install=J,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pangu-backend-ui/apputil-core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
7
7
|
"unpkg": "index.umd.cjs",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"vue": "^3.2.45",
|
|
22
22
|
"vue-router": "^4.1.6",
|
|
23
23
|
"pinia": "^2.0.28",
|
|
24
|
-
"@pangu-backend-ui/
|
|
25
|
-
"@pangu-backend-ui/
|
|
24
|
+
"@pangu-backend-ui/admin-core": "^0.0.5",
|
|
25
|
+
"@pangu-backend-ui/common": "^0.0.31"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public",
|
package/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-9e13a1f7] .pg-upload-hidden-upload{width:100%!important}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const useAppUtilCoreConfigStore: import("pinia").StoreDefinition<"pg-app-util-core-config-store", import("pinia")._UnwrapAll<Pick<{
|
|
2
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
3
|
+
}, never>>, Pick<{
|
|
4
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
5
|
+
}, "defaultTesterUserIds">, Pick<{
|
|
6
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
7
|
+
}, never>>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export default _sfc_main;
|
|
2
|
+
declare namespace _sfc_main {
|
|
3
|
+
function setup(__props: any, { expose }: {
|
|
4
|
+
expose: any;
|
|
5
|
+
}): {
|
|
6
|
+
condition: import("vue").Ref<{
|
|
7
|
+
platform: null;
|
|
8
|
+
isHot: null;
|
|
9
|
+
status: null;
|
|
10
|
+
}>;
|
|
11
|
+
http: boolean;
|
|
12
|
+
table: import("vue").Ref<any>;
|
|
13
|
+
search: () => void;
|
|
14
|
+
versionDiloag: import("vue").Ref<any>;
|
|
15
|
+
showVersionDialog: (appVersion: any) => void;
|
|
16
|
+
publish: (versionId: any) => Promise<void>;
|
|
17
|
+
offline: (versionId: any) => Promise<void>;
|
|
18
|
+
inject: typeof inject;
|
|
19
|
+
ref: typeof ref;
|
|
20
|
+
VersionDialog: {
|
|
21
|
+
emits: string[];
|
|
22
|
+
setup(__props: any, { expose, emit: emits }: {
|
|
23
|
+
expose: any;
|
|
24
|
+
emit: any;
|
|
25
|
+
}): {
|
|
26
|
+
http: boolean;
|
|
27
|
+
emits: any;
|
|
28
|
+
mode: import("vue").Ref<string>;
|
|
29
|
+
editMode: import("vue").ComputedRef<boolean>;
|
|
30
|
+
visible: import("vue").Ref<boolean>;
|
|
31
|
+
form: import("vue").Ref<{
|
|
32
|
+
appCode: null;
|
|
33
|
+
platform: string;
|
|
34
|
+
versionName: null;
|
|
35
|
+
versionNumber: null;
|
|
36
|
+
category: string;
|
|
37
|
+
isForce: boolean;
|
|
38
|
+
isHot: boolean;
|
|
39
|
+
activationTime: null;
|
|
40
|
+
pkgUrl: null;
|
|
41
|
+
wgtUrl: null;
|
|
42
|
+
description: null;
|
|
43
|
+
testerIdJsonStr: string;
|
|
44
|
+
}>;
|
|
45
|
+
fileUrl: import("vue").Ref<any>;
|
|
46
|
+
appUtilConfigStore: import("pinia").Store<"pg-app-util-core-config-store", import("pinia")._UnwrapAll<Pick<{
|
|
47
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
48
|
+
}, never>>, Pick<{
|
|
49
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
50
|
+
}, "defaultTesterUserIds">, Pick<{
|
|
51
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
52
|
+
}, never>>;
|
|
53
|
+
toEditAppVerion: any;
|
|
54
|
+
inPublishStatus: import("vue").Ref<boolean>;
|
|
55
|
+
show: (appVerion: any) => Promise<void>;
|
|
56
|
+
fileUploadOnSuccess: (param: any) => void;
|
|
57
|
+
onClose: () => void;
|
|
58
|
+
switchPublishModal: () => void;
|
|
59
|
+
publishModalForm: import("vue").Ref<any>;
|
|
60
|
+
publishNewVersion: () => void;
|
|
61
|
+
onAppChanged: (appCode: any) => void;
|
|
62
|
+
appPkgUploader: import("vue").Ref<any>;
|
|
63
|
+
hotChangeEvent: () => void;
|
|
64
|
+
fillTester: (idsStr: any) => void;
|
|
65
|
+
applications: import("vue").Ref<never[]>;
|
|
66
|
+
getAllApplications: () => Promise<void>;
|
|
67
|
+
inject: typeof inject;
|
|
68
|
+
nextTick: typeof import("vue").nextTick;
|
|
69
|
+
ref: typeof ref;
|
|
70
|
+
onMounted: (hook: () => any, target?: import("vue").ComponentInternalInstance | null | undefined) => false | Function | undefined;
|
|
71
|
+
computed: typeof import("@vue/reactivity").computed;
|
|
72
|
+
readonly ElMessage: import("element-plus/es/utils").SFCInstallWithContext<import("element-plus").Message>;
|
|
73
|
+
readonly Http: any;
|
|
74
|
+
readonly useAppUtilCoreConfigStore: import("pinia").StoreDefinition<"pg-app-util-core-config-store", import("pinia")._UnwrapAll<Pick<{
|
|
75
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
76
|
+
}, never>>, Pick<{
|
|
77
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
78
|
+
}, "defaultTesterUserIds">, Pick<{
|
|
79
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
80
|
+
}, never>>;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
readonly Http: any;
|
|
84
|
+
readonly ElMessage: import("element-plus/es/utils").SFCInstallWithContext<import("element-plus").Message>;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
import { inject } from "@vue/runtime-core";
|
|
88
|
+
import { ref } from "@vue/runtime-core";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export default _sfc_main;
|
|
2
|
+
declare namespace _sfc_main {
|
|
3
|
+
const emits: string[];
|
|
4
|
+
function setup(__props: any, { expose, emit: emits }: {
|
|
5
|
+
expose: any;
|
|
6
|
+
emit: any;
|
|
7
|
+
}): {
|
|
8
|
+
http: boolean;
|
|
9
|
+
emits: any;
|
|
10
|
+
mode: import("vue").Ref<string>;
|
|
11
|
+
editMode: import("vue").ComputedRef<boolean>;
|
|
12
|
+
visible: import("vue").Ref<boolean>;
|
|
13
|
+
form: import("vue").Ref<{
|
|
14
|
+
appCode: null;
|
|
15
|
+
platform: string;
|
|
16
|
+
versionName: null;
|
|
17
|
+
versionNumber: null;
|
|
18
|
+
category: string;
|
|
19
|
+
isForce: boolean;
|
|
20
|
+
isHot: boolean;
|
|
21
|
+
activationTime: null;
|
|
22
|
+
pkgUrl: null;
|
|
23
|
+
wgtUrl: null;
|
|
24
|
+
description: null;
|
|
25
|
+
testerIdJsonStr: string;
|
|
26
|
+
}>;
|
|
27
|
+
fileUrl: import("vue").Ref<any>;
|
|
28
|
+
appUtilConfigStore: import("pinia").Store<"pg-app-util-core-config-store", import("pinia")._UnwrapAll<Pick<{
|
|
29
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
30
|
+
}, never>>, Pick<{
|
|
31
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
32
|
+
}, "defaultTesterUserIds">, Pick<{
|
|
33
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
34
|
+
}, never>>;
|
|
35
|
+
toEditAppVerion: any;
|
|
36
|
+
inPublishStatus: import("vue").Ref<boolean>;
|
|
37
|
+
show: (appVerion: any) => Promise<void>;
|
|
38
|
+
fileUploadOnSuccess: (param: any) => void;
|
|
39
|
+
onClose: () => void;
|
|
40
|
+
switchPublishModal: () => void;
|
|
41
|
+
publishModalForm: import("vue").Ref<any>;
|
|
42
|
+
publishNewVersion: () => void;
|
|
43
|
+
onAppChanged: (appCode: any) => void;
|
|
44
|
+
appPkgUploader: import("vue").Ref<any>;
|
|
45
|
+
hotChangeEvent: () => void;
|
|
46
|
+
fillTester: (idsStr: any) => void;
|
|
47
|
+
applications: import("vue").Ref<never[]>;
|
|
48
|
+
getAllApplications: () => Promise<void>;
|
|
49
|
+
inject: typeof inject;
|
|
50
|
+
nextTick: typeof nextTick;
|
|
51
|
+
ref: typeof ref;
|
|
52
|
+
onMounted: (hook: () => any, target?: import("vue").ComponentInternalInstance | null | undefined) => false | Function | undefined;
|
|
53
|
+
computed: typeof import("@vue/reactivity").computed;
|
|
54
|
+
readonly ElMessage: import("element-plus/es/utils").SFCInstallWithContext<import("element-plus").Message>;
|
|
55
|
+
readonly Http: any;
|
|
56
|
+
readonly useAppUtilCoreConfigStore: import("pinia").StoreDefinition<"pg-app-util-core-config-store", import("pinia")._UnwrapAll<Pick<{
|
|
57
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
58
|
+
}, never>>, Pick<{
|
|
59
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
60
|
+
}, "defaultTesterUserIds">, Pick<{
|
|
61
|
+
defaultTesterUserIds: import("vue").ComputedRef<number[]>;
|
|
62
|
+
}, never>>;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
import { inject } from "@vue/runtime-core";
|
|
66
|
+
import { nextTick } from "@vue/runtime-core";
|
|
67
|
+
import { ref } from "@vue/runtime-core";
|