class Providers extends React.Component { constructor(props) { super(props); this.Lang = props.Lang; /* this.MID = props.mid; if (this.MID == null) this.MID = 0; this.stat = props.stat; if (this.stat == null) this.stat = e=>{return null} this.listUsers = props.listUsers; if (this.listUsers == null) this.listUsers = [];*/ this.setTitle = props.setTitle; this.onLoad = props.onLoad; this.refName = React.createRef(); } state = { providers:[], selPrvrConts:null, bAddPrvr:false, // 추가 창 editPrvr:null // 수정 중인 제작사 (null 이면 닫힘) }; async componentDidMount() { this.styleMain = R5.wStyle(` #Prvrs { position:absolute; left:0; right:0; top:0; bottom:0; display:flex; flex-direction:column; background:#fff; margin:10dp; } #Prvrs .tablebox { position:relative; flex:1; min-height:0; overflow-y:scroll; } #Prvrs .listtable { width:100%; border-spacing:0; border:1px solid #888; } #Prvrs .listtable .pnt { cursor:pointer; text-decoration:underline; color:#00a; } #Prvrs .listtable .pnt:hover { background-color:#fdd; } #Prvrs .listtable th { font-size:12dp; line-height:14dp; white-space:pre-wrap; padding:2dp 0; border-right:1px solid #ccc; border-bottom:1px solid #888; background:#ddd; } #Prvrs .listtable td { height:30dp; text-align:center; font-size:14dp; padding:0 5dp; border-right:1px solid #ddd; border-bottom:1px solid #888; } #Prvrs .Conts { position:absolute; left:100%; top:-10dp; width:calc(100% + 20dp); height:calc(100% + 20dp); visibility:hidden; opacity:0; } #Prvrs .Conts.view { left:-10dp; visibility:visible; opacity:1; transition: left 300ms ease-in, opacity 300ms ease-in; } #Prvrs .controlbox { position:relative; flex-shrink:0; height:50dp; } #Prvrs .btn_add { position:relative; height:28dp; padding:0 12dp; margin:10dp 20dp 0 0; font-size:15dp; line-height:28dp; border-radius:5dp; background-color:#eee; border:1px solid #ccc; float:right; cursor:pointer; } #Prvrs .btn_add:hover { background-color:#fee; border:1px solid #555; } #Prvrs .popup { position:absolute; left:0; right:0; top:0; bottom:0; background:rgba(0,0,0,0.35); z-index:10; } #Prvrs .popup .dlg { position:absolute; left:50%; top:50%; width:340dp; box-sizing:border-box; padding:20dp; background:#fff; border:1px solid #888; border-radius:8dp; transform:translate(-50%,-50%); } #Prvrs .popup .dlg .dtitle { font-size:17dp; font-weight:bold; color:#222; margin-bottom:14dp; } #Prvrs .popup .dlg .drow .cap { display:block; font-size:12dp; color:#666; margin-bottom:3dp; } #Prvrs .popup .dlg .drow input { box-sizing:border-box; width:100%; height:32dp; font-size:15dp; padding:0 8dp; border:1px solid #bbb; border-radius:4dp; } #Prvrs .popup .dlg .drow input:focus { border-color:#3988ff; } #Prvrs .popup .dlg .dbtns { margin-top:16dp; text-align:right; } #Prvrs .popup .dlg .dbtns input { height:30dp; padding:0 14dp; margin-left:6dp; font-size:14dp; border-radius:4dp; border:1px solid #bbb; background:#f4f4f4; cursor:pointer; } #Prvrs .popup .dlg .dbtns input.ok { color:#fff; border-color:#3988ff; background:#3988ff; } `); this.downloadData(); } downloadData() { let fd = new FormData(); axios.post('/api/providers/', fd) .then(res=>{ //console.log(res); if (res.data.code != 0){ alert(res.data.msg); return } let providers = res.data.providers; this.setState({ providers:providers }); if (this.onLoad) this.onLoad(); }) .catch(e=>{}); } componentWillUnmount() { if (this.styleMain != null) { this.styleMain.destroy(); this.styleMain = null; } } render() { return
| id | {this.Lang("name","pl_table")} | {this.Lang("conts","pl_table")} | {this.Lang("create","pl_table")} |
|---|---|---|---|
| {d.pid} | {/* 이름을 누르면 그 제작사를 수정한다 */}this.setState({ editPrvr:d, bAddPrvr:false })}>{d.name} | this.showContents(d)}>{d.ccnt} | {(new Date(d.cdate * 1000)).toLocaleString()} |