配置easycom,目前页面中因为需要用到getName方法,所以先不使用
This commit is contained in:
67
components/oa/oa-project-select/index.vue
Normal file
67
components/oa/oa-project-select/index.vue
Normal file
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<uni-data-select
|
||||
v-model="innerValue"
|
||||
:localdata="projectOptions"
|
||||
:placeholder="placeholder"
|
||||
:clear="clear"
|
||||
:filterable="filterable"
|
||||
@change="onChange"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniDataSelect from '@/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue'
|
||||
import { listProject } from '@/api/oa/project'
|
||||
|
||||
export default {
|
||||
name: 'OaProjectSelect',
|
||||
components: { uniDataSelect },
|
||||
props: {
|
||||
value: [String, Number],
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择项目'
|
||||
},
|
||||
clear: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
filterable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
projectOptions: [],
|
||||
innerValue: this.value
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.innerValue = val
|
||||
},
|
||||
innerValue(val) {
|
||||
this.$emit('input', val)
|
||||
this.$emit('update:value', val)
|
||||
this.$emit('change', val)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getProjectOptions()
|
||||
},
|
||||
methods: {
|
||||
getProjectOptions() {
|
||||
listProject().then(res => {
|
||||
this.projectOptions = (res.rows || []).map(item => ({
|
||||
text: item.projectName,
|
||||
value: item.projectId
|
||||
}))
|
||||
})
|
||||
},
|
||||
onChange(val) {
|
||||
this.innerValue = val
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
0
components/oa/oa-user-select/index.vue
Normal file
0
components/oa/oa-user-select/index.vue
Normal file
Reference in New Issue
Block a user