no message

This commit is contained in:
kuaifan 2025-05-08 10:28:37 +08:00
parent 006bc6ceda
commit 66ea277a59
2 changed files with 32 additions and 4 deletions

View File

@ -47,6 +47,13 @@
@error="error"/> @error="error"/>
</DrawerOverlay> </DrawerOverlay>
</template> </template>
<!--选择用户-->
<UserSelect
ref="userSelect"
v-model="userSelectOptions.value"
v-bind="userSelectOptions.config"
module/>
</div> </div>
</template> </template>
@ -104,11 +111,13 @@ import store from "../../store";
export default { export default {
name: "MicroApps", name: "MicroApps",
directives: {TransferDom}, directives: {TransferDom},
components: {MicroContent, DrawerOverlay}, components: {UserSelect, MicroContent, DrawerOverlay},
data() { data() {
return { return {
apps: [], apps: [],
userSelectOptions: {value: [], config: {}},
} }
}, },
@ -244,6 +253,22 @@ export default {
} }
return 1000; return 1000;
}, },
selectUsers: async (params) => {
if (!$A.isJson(params)) {
params = {value: params}
}
if ($A.isArray(params.value)) {
params.value = params.value ? [params.value] : []
}
this.userSelectOptions.value = params.value
delete params.value
this.userSelectOptions.config = params
return await new Promise(resolve => {
this.$refs.userSelect.onSelection((res) => {
return resolve(res)
})
})
},
popoutWindow: async (config) => { popoutWindow: async (config) => {
let appConfig = {} let appConfig = {}
if (config.url) { if (config.url) {

View File

@ -297,6 +297,7 @@ export default {
values: [], values: [],
selects: [], selects: [],
callback: null,
recents: [], recents: [],
contacts: [], contacts: [],
@ -683,12 +684,13 @@ export default {
}, this.searchCache.length > 0 ? 300 : 0) }, this.searchCache.length > 0 ? 300 : 0)
}, },
onSelection() { onSelection(callback = null) {
if (this.disabled) { if (this.disabled) {
return return
} }
this.$nextTick(_ => { this.$nextTick(_ => {
this.selects = $A.cloneJSON(this.values) this.selects = $A.cloneJSON(this.values)
this.callback = typeof callback === 'function' ? callback : null
this.showModal = true this.showModal = true
}) })
}, },
@ -794,11 +796,12 @@ export default {
this.$emit('input', this.values) this.$emit('input', this.values)
this.$emit('on-submit', this.values) this.$emit('on-submit', this.values)
if (!this.beforeSubmit) { const beforeSubmit = this.callback || this.beforeSubmit;
if (!beforeSubmit) {
this.hide() this.hide()
return return
} }
const before = this.beforeSubmit(); const before = beforeSubmit(this.values);
if (before && before.then) { if (before && before.then) {
this.submittIng++ this.submittIng++
before.then(() => { before.then(() => {