This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
forked from adempiere/adempiere-vue
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix: Dialog Functionality * Fix: Dialog Functionality
- Loading branch information
Showing
9 changed files
with
412 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/views/ADempiere/ReportViewerEngine/dialog/contactSend.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template> | ||
<el-form-item> | ||
<template slot="label"> | ||
{{ $t('report.reportEnginer.optionsImport.contactsSend') }} | ||
</template> | ||
<el-select | ||
v-model="contantSend" | ||
filterable | ||
allow-create | ||
@change="setUser" | ||
@visible-change="searchUser" | ||
> | ||
<el-option | ||
v-for="(item, key) in listUserSend" | ||
:key="key" | ||
:label="item.label" | ||
:value="item.value" | ||
/> | ||
</el-select> | ||
</el-form-item> | ||
</template> | ||
<script> | ||
import store from '@/store' | ||
import { defineComponent, ref } from '@vue/composition-api' | ||
import { isEmptyValue } from '@/utils/ADempiere/valueUtils' | ||
export default defineComponent({ | ||
name: 'contactSend', | ||
setup() { | ||
const contantSend = ref('') | ||
const listUserSend = ref([]) | ||
function searchUser() { | ||
store.dispatch('ListUser') | ||
.then(response => { | ||
if (!isEmptyValue(response)) { | ||
const { records } = response | ||
listUserSend.value = records.map(item => { | ||
return { | ||
label: item.values.DisplayColumn, | ||
value: item.id | ||
} | ||
}) | ||
} | ||
}) | ||
} | ||
function setUser(data) { | ||
store.commit('setContactSend', data) | ||
} | ||
return { | ||
contantSend, | ||
listUserSend, | ||
setUser, | ||
searchUser | ||
} | ||
} | ||
}) | ||
</script> |
93 changes: 93 additions & 0 deletions
93
src/views/ADempiere/ReportViewerEngine/dialog/copyLink.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<template> | ||
<div> | ||
<p style="width: 630px; margin: 0 auto; font-size: 14px; text-align: center;"> | ||
{{ $t('component.attachment.share.description') }} | ||
</p> | ||
<p style="text-align: center;"> | ||
<b> | ||
{{ $t('component.attachment.share.timeText') }} | ||
</b> | ||
</p> | ||
<el-radio-group | ||
v-model="validTime" | ||
style="display: flex; justify-content: center;" | ||
@change="loadData" | ||
> | ||
<el-radio :label="3600">1 {{ ' ' + $t('component.attachment.share.time.hour') }}</el-radio> | ||
<el-radio :label="21600">6 {{ ' ' + $t('component.attachment.share.time.hours') }}</el-radio> | ||
<el-radio :label="86400">1 {{ ' ' + $t('component.attachment.share.time.day') }}</el-radio> | ||
<el-radio :label="259200">3 {{ ' ' + $t('component.attachment.share.time.days') }}</el-radio> | ||
<el-radio :label="604800">7 {{ ' ' + $t('component.attachment.share.time.days') }}</el-radio> | ||
</el-radio-group> | ||
<el-input | ||
v-model="linkShare" | ||
disabled | ||
style="margin-top: 10px" | ||
> | ||
<i | ||
v-if="isLoading" | ||
slot="prefix" | ||
class="el-icon-loading" | ||
/> | ||
<i | ||
v-else | ||
slot="prefix" | ||
class="el-input__icon el-icon-document-copy" | ||
@click="copyValue" | ||
/> | ||
</el-input> | ||
</div> | ||
</template> | ||
<script> | ||
import { defineComponent, ref } from '@vue/composition-api' | ||
import { | ||
requestShareResources | ||
} from '@/api/ADempiere/file-management/resource-reference.ts' | ||
import { copyToClipboard } from '@/utils/ADempiere/coreUtils.js' | ||
import { isEmptyValue } from '@/utils/ADempiere/valueUtils' | ||
export default defineComponent({ | ||
name: 'copyLink', | ||
props: { | ||
reportOutput: { | ||
type: Object, | ||
required: false | ||
} | ||
}, | ||
setup(props) { | ||
const isLoading = ref(false) | ||
const linkShare = ref('') | ||
const validTime = ref(3600) | ||
function loadData() { | ||
isLoading.value = true | ||
requestShareResources({ | ||
fileName: props.reportOutput.name, | ||
seconds: validTime.value | ||
}) | ||
.then(response => { | ||
linkShare.value = response | ||
}) | ||
.finally(() => { | ||
isLoading.value = false | ||
}) | ||
} | ||
function copyValue() { | ||
let textToCopy = linkShare.value | ||
if (isEmptyValue(textToCopy)) { | ||
textToCopy = '' | ||
} | ||
copyToClipboard({ | ||
text: textToCopy, | ||
isShowMessage: true | ||
}) | ||
} | ||
loadData() | ||
return { | ||
isLoading, | ||
linkShare, | ||
validTime, | ||
copyValue, | ||
loadData | ||
} | ||
} | ||
}) | ||
</script> |
Oops, something went wrong.