PageSourceSearch

https://www.titan-g.site/static/js/Index3.js

js titan-g.site collected 2026-10-09 23:20:43 UTC 4,333 bytes, 1 lines download raw bytes

1import{_ as w,M as X,B as M,b as p,c as h,a as t,g as l,e as s,F as y,r as v,p as x,j as k,o as _,i as d,w as m,s as u,t as F}from"./index.js";import{F as I}from"./Field.js";import"./ValidationMessage.js";const S={components:{Button:M,Field:I,Modal:X},data(){return{me:{},accounts:[],creationForm:this.createForm(),editForm:null}},async created(){[this.me,this.accounts]=await Promise.all([this.createForm().get("/api/me"),this.fetchPromotionAccounts()])},methods:{fetchPromotionAccounts(){return this.createForm().get("/api/promotion_accounts/")},async create(){await this.creationForm.post("/api/promotion_accounts/"),this.$refs.creationModal.hide(),this.accounts=await this.fetchPromotionAccounts(),this.showGlobalMessage("プロモーションアカウントを作成しました")},openEditModal(i){this.editForm=this.createForm({...i}),this.$refs.editModal.show()},async edit(){const i=this.editForm.model.id;await this.editForm.put(`/api/promotion_accounts/${i}/`),this.$refs.editModal.hide(),this.accounts=await this.fetchPromotionAccounts(),this.showGlobalMessage("プロモーションアカウント情報を更新しました")},async deleteAccount(i){window.confirm(`「${i.name}」を削除します。よろしいですか?`)&&(await this.createForm().delete(`/api/promotion_accounts/${i.id}/`),this.accounts=await this.fetchPromotionAccounts(),this.showGlobalMessage("プロモーションアカウントを削除しました"))}}},g=i=>(x("data-v-552c399b"),i=i(),k(),i),A={class:"main"},B=g(()=>t("h1",null,"プロモーションアカウント",-1)),C={class:"flex justify-content-flex-end"},V={class:"accounts"},G=g(()=>t("thead",null,[t("th",{style:{width:"20%"}}," アカウント名 "),t("th",{style:{width:"20%"}}," GoogleアカウントID名 "),t("th",{style:{width:"10%"}})],-1));function P(i,r,D,U,e,a){const n=p("Button"),c=p("Field"),f=p("Modal");return _(),h("div",A,[B,t("div",C,[l(n,{onClick:r[0]||(r[0]=o=>i.$refs.creationModal.show()),disabled:!e.me.is_owner},{default:s(()=>[d(" 作成する ")]),_:1},8,["disabled"]),l(f,{ref:"creationModal",title:"プロモーションアカウントを作成する",onSubmit:a.create,onHide:r[3]||(r[3]=o=>e.creationForm.clear())},{actions:s(()=>[l(n,{submit:""},{default:s(()=>[d(" 作成する ")]),_:1})]),default:s(()=>[l(c,{label:"アカウント名",error:e.creationForm.$errors.name},{default:s(()=>[m(t("input",{class:"form-control",type:"text","onUpdate:modelValue":r[1]||(r[1]=o=>e.creationForm.model.name=o),placeholder:"アカウント名"},null,512),[[u,e.creationForm.model.name]])]),_:1},8,["error"]),l(c,{label:"GoogleアカウントID",error:e.creationForm.$errors.google_customer_id},{default:s(()=>[m(t("input",{class:"form-control",type:"text","onUpdate:modelValue":r[2]||(r[2]=o=>e.creationForm.model.google_customer_id=o),placeholder:"XXX-XXX-XXXX"},null,512),[[u,e.creationForm.model.google_customer_id]])]),_:1},8,["error"])]),_:1},8,["onSubmit"])]),t("table",V,[G,t("tbody",null,[(_(!0),h(y,null,v(e.accounts,o=>(_(),h("tr",{key:o.id},[t("td",null,F(o.name),1),t("td",null,F(o.google_customer_id),1),t("td",null,[l(n,{onClick:b=>a.openEditModal(o),disabled:!e.me.is_owner},{default:s(()=>[d(" 編集 ")]),_:2},1032,["onClick","disabled"]),l(n,{color:"danger",onClick:b=>a.deleteAccount(o),disabled:!e.me.is_owner},{default:s(()=>[d(" 削除 ")]),_:2},1032,["onClick","disabled"])])]))),128))])]),l(f,{ref:"editModal",title:"プロモーションアカウント情報更新",onSubmit:a.edit,onHide:r[6]||(r[6]=o=>e.editForm.clear())},{actions:s(()=>[l(n,{submit:""},{default:s(()=>[d(" 更新する ")]),_:1})]),default:s(()=>[l(c,{label:"アカウント名",error:e.editForm.$errors.name},{default:s(()=>[m(t("input",{class:"form-control",type:"text","onUpdate:modelValue":r[4]||(r[4]=o=>e.editForm.model.name=o),placeholder:"アカウント名"},null,512),[[u,e.editForm.model.name]])]),_:1},8,["error"]),l(c,{label:"GoogleアカウントID",error:e.editForm.$errors.google_customer_id},{default:s(()=>[m(t("input",{class:"form-control",type:"text","onUpdate:modelValue":r[5]||(r[5]=o=>e.editForm.model.google_customer_id=o),placeholder:"XXX-XXX-XXXX"},null,512),[[u,e.editForm.model.google_customer_id]])]),_:1},8,["error"])]),_:1},8,["onSubmit"])])}const H=w(S,[["render",P],["__scopeId","data-v-552c399b"]]);export{H as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.