Преглед на файлове

app2.0 人员选择组件

娄底高职分支
ndbs преди 2 години
родител
ревизия
672f00948f
променени са 1 файла, в които са добавени 25 реда и са изтрити 9 реда
  1. +25
    -9
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/organize-picker.vue

+ 25
- 9
Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/organize-picker.vue Целия файл

@@ -7,7 +7,12 @@

<!-- #ifndef MP-DINGTALK -->
<l-label @click="click" :arrow="!readonly" :required="required" :title="title">
{{ display || displayPlaceholder }}
<!-- {{ display || displayPlaceholder }} -->
<view style="white-space: normal;min-height: 54px;display: flex;align-items: center;justify-content: right;">
<view style="line-height: 24px;">
{{ display || displayPlaceholder }}
</view>
</view>
</l-label>
<!-- #endif -->
</template>
@@ -24,7 +29,8 @@ export default {
placeholder: {},
readonly: {},
rootId: {},
rootType: {}
rootType: {},
multiple: {}
},

methods: {
@@ -34,16 +40,18 @@ export default {
}

this.ONCE('select-organize', data => {
this.$emit('input', data.id)
this.$emit('change', data.id)
this.$emit('input', data.id||data.map(t=>t.id).toString())
this.$emit('change', data.id||data.map(t=>t.id).toString())
})

const rootType = this.rootType || { user: 'department', department: 'company', company: 'company' }[this.type]
const rootId = this.rootId

let url_ = this.multiple?"select-organize-multiple":"select-organize"
this.SET_PARAM(this.value)
const url = rootId
? `/pages/common/select-organize?type=${this.type}&rootId=${rootId}&rootType=${rootType}`
: `/pages/common/select-organize?type=${this.type}`
? `/pages/common/${url_}?type=${this.type}&rootId=${rootId}&rootType=${rootType}`
: `/pages/common/${url_}?type=${this.type}`

this.NAV_TO(url)
}
@@ -54,8 +62,16 @@ export default {
if (!this.value) {
return this.placeholder
}
const orgItem = this.GET_GLOBAL(this.type)[this.value]

const list = this.GET_GLOBAL(this.type)
let values = this.value instanceof Array?this.value:this.value.split(",")
if(values.length>1){
const orgItems = values.map(t=>list[t]?list[t].name:'').toString()
return orgItems
}
const orgItem = list[this.value]
return orgItem ? orgItem.name : this.placeholder
},



Зареждане…
Отказ
Запис