물건 화면 복사 기능 관련 콘솔제거 & 버튼 추가
This commit is contained in:
parent
db7a055e22
commit
66ea82b9a3
@ -50,17 +50,15 @@ export default function Stuff() {
|
||||
// }
|
||||
// Navigator clipboard api needs a secure context (https)
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
console.log('확인11', value)
|
||||
await navigator.clipboard
|
||||
.writeText(value)
|
||||
.then(() => {
|
||||
alert(getMessage('stuff.detail.header.successCopy'))
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch(() => {
|
||||
alert(getMessage('stuff.detail.header.failCopy'))
|
||||
})
|
||||
} else {
|
||||
console.log('확인22', value)
|
||||
// Use the 'out of viewport hidden text area' trick
|
||||
const textArea = document.createElement('textArea')
|
||||
textArea.value = value
|
||||
@ -73,7 +71,6 @@ export default function Stuff() {
|
||||
textArea.select()
|
||||
|
||||
try {
|
||||
console.log('deprecated::document.execCommand(`copy`)', document.execCommand('copy'))
|
||||
document.execCommand('copy')
|
||||
alert(getMessage('stuff.detail.header.successCopy'))
|
||||
} catch (err) {
|
||||
|
||||
@ -1449,15 +1449,32 @@ export default function StuffDetail() {
|
||||
</components.NoOptionsMessage>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{(editMode === 'NEW' && (
|
||||
<form onSubmit={handleSubmit(onValid)}>
|
||||
<div className="sub-table-box">
|
||||
<div className="promise-gudie">
|
||||
<span className="important">*</span>
|
||||
{getMessage('stuff.detail.required')}
|
||||
<div className="promise-title-wrap">
|
||||
<div className="promise-gudie">
|
||||
<span className="important">*</span>
|
||||
{getMessage('stuff.detail.required')}
|
||||
</div>
|
||||
<div className="left-unit-box">
|
||||
{!isFormValid ? (
|
||||
<Button className="btn-origin grey mr5" onPress={onTempSave}>
|
||||
{getMessage('stuff.detail.btn.tempSave')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button type="submit" className="btn-origin navy mr5">
|
||||
{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
)}
|
||||
<Link href="/management/stuff" scroll={false}>
|
||||
<button type="button" className="btn-origin grey">
|
||||
{getMessage('stuff.detail.btn.moveList')}
|
||||
</button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<div className="infomation-table">
|
||||
<table>
|
||||
@ -1952,8 +1969,46 @@ export default function StuffDetail() {
|
||||
<>
|
||||
<form onSubmit={handleSubmit(onValid)}>
|
||||
<div className="sub-table-box">
|
||||
<div className="promise-gudie">
|
||||
<span className="important">*</span> {getMessage('stuff.detail.required')}
|
||||
<div className="promise-title-wrap">
|
||||
<div className="promise-gudie">
|
||||
<span className="important">*</span> {getMessage('stuff.detail.required')}
|
||||
</div>
|
||||
{managementState?.tempFlg === '0' ? (
|
||||
<>
|
||||
<div className="left-unit-box">
|
||||
<Link href="/management/stuff" scroll={false}>
|
||||
<button type="button" className="btn-origin grey mr5">
|
||||
{getMessage('stuff.detail.btn.moveList')}
|
||||
</button>
|
||||
</Link>
|
||||
<Button type="submit" className="btn-origin navy mr5">
|
||||
{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
<Button type="button" className="btn-origin grey" onPress={onDelete}>
|
||||
{getMessage('stuff.detail.btn.delete')}
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<div className="left-unit-box">
|
||||
{!isFormValid ? (
|
||||
<Button className="btn-origin grey mr5" onPress={onTempSave}>
|
||||
{getMessage('stuff.detail.btn.tempSave')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button type="submit" className="btn-origin navy mr5">
|
||||
{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
)}
|
||||
<Link href="/management/stuff" scroll={false}>
|
||||
<button type="button" className="btn-origin grey">
|
||||
{getMessage('stuff.detail.btn.moveList')}
|
||||
</button>
|
||||
</Link>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<div className="infomation-wrap">
|
||||
<div className="infomation-table">
|
||||
|
||||
@ -22,17 +22,15 @@ export default function StuffHeader() {
|
||||
|
||||
const copyObjectNo = async (objectNo) => {
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
console.log('확인11', objectNo)
|
||||
await navigator.clipboard
|
||||
.writeText(objectNo)
|
||||
.then(() => {
|
||||
alert(getMessage('stuff.detail.header.successCopy'))
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch(() => {
|
||||
alert(getMessage('stuff.detail.header.failCopy'))
|
||||
})
|
||||
} else {
|
||||
console.log('확인22', objectNo)
|
||||
// Use the 'out of viewport hidden text area' trick
|
||||
const textArea = document.createElement('textArea')
|
||||
textArea.value = objectNo
|
||||
@ -45,7 +43,6 @@ export default function StuffHeader() {
|
||||
textArea.select()
|
||||
|
||||
try {
|
||||
console.log('deprecated::document.execCommand(`copy`)', document.execCommand('copy'))
|
||||
document.execCommand('copy')
|
||||
alert(getMessage('stuff.detail.header.successCopy'))
|
||||
} catch (err) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user