|
@@ -40,7 +40,11 @@ |
|
|
{{ item.F_Title || '(草稿 · 待编辑)' }} |
|
|
{{ item.F_Title || '(草稿 · 待编辑)' }} |
|
|
<l-icon v-if="item.F_EnabledMark === 2" type="edit" /> |
|
|
<l-icon v-if="item.F_EnabledMark === 2" type="edit" /> |
|
|
</view> |
|
|
</view> |
|
|
<view class="item-desc">{{ item.F_SchemeName }}</view> |
|
|
|
|
|
|
|
|
<view class="item-desc"> |
|
|
|
|
|
{{ item.F_SchemeName }} |
|
|
|
|
|
<text style="margin-left: 15px;">{{item.F_CreateUserName}}</text> |
|
|
|
|
|
<text style="margin-left: 15px;">{{ displayListItem(item, 'F_DepartmentId')}}</text> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<!-- tag 区 --> |
|
|
<!-- tag 区 --> |
|
|
<view class="tag-bar"> |
|
|
<view class="tag-bar"> |
|
@@ -53,6 +57,12 @@ |
|
|
{{ tag.text }} |
|
|
{{ tag.text }} |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</l-list-item> |
|
|
</l-list-item> |
|
|
</l-list> |
|
|
</l-list> |
|
@@ -84,7 +94,7 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import moment from 'moment' |
|
|
import moment from 'moment' |
|
|
|
|
|
|
|
|
|
|
|
import get from 'lodash/get' |
|
|
let currentScroll = 0 |
|
|
let currentScroll = 0 |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
@@ -105,7 +115,19 @@ export default { |
|
|
modal: false, |
|
|
modal: false, |
|
|
selectItem: null, |
|
|
selectItem: null, |
|
|
|
|
|
|
|
|
pageHeight: '' |
|
|
|
|
|
|
|
|
pageHeight: '', |
|
|
|
|
|
// 数据源 |
|
|
|
|
|
dataSource: { |
|
|
|
|
|
F_DepartmentId: [] |
|
|
|
|
|
}, |
|
|
|
|
|
// 数据项的数据类型、结构 |
|
|
|
|
|
scheme: { |
|
|
|
|
|
F_DepartmentId: { |
|
|
|
|
|
type: "select", |
|
|
|
|
|
dataSource: '1', |
|
|
|
|
|
dataSourceId: 'ApplyDept' |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@@ -121,6 +143,19 @@ export default { |
|
|
// 初始化页面 |
|
|
// 初始化页面 |
|
|
async init() { |
|
|
async init() { |
|
|
this.ON('task-list-change', this.refreshList) |
|
|
this.ON('task-list-change', this.refreshList) |
|
|
|
|
|
|
|
|
|
|
|
// 拉取加载列表和数据源 |
|
|
|
|
|
await Promise.all([ |
|
|
|
|
|
this.FETCH_DATASOURCE('classdata').then(result => { |
|
|
|
|
|
console.log(result) |
|
|
|
|
|
this.dataSource.F_DepartmentId = result.data.map(t => ({ |
|
|
|
|
|
text: t.name, |
|
|
|
|
|
value: t.id |
|
|
|
|
|
})); |
|
|
|
|
|
}), |
|
|
|
|
|
() => {} |
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
await this.fetchList() |
|
|
await this.fetchList() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@@ -337,7 +372,43 @@ export default { |
|
|
// 滚动时记录当前滚动的位置 |
|
|
// 滚动时记录当前滚动的位置 |
|
|
listScroll(e) { |
|
|
listScroll(e) { |
|
|
currentScroll = e.detail.scrollTop |
|
|
currentScroll = e.detail.scrollTop |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
// 显示列表中的标题项 |
|
|
|
|
|
displayListItem(item, field) { |
|
|
|
|
|
const fieldItem = this.scheme[field] |
|
|
|
|
|
const value = item[field] |
|
|
|
|
|
|
|
|
|
|
|
switch (fieldItem.type) { |
|
|
|
|
|
case 'currentInfo': |
|
|
|
|
|
case 'organize': |
|
|
|
|
|
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), |
|
|
|
|
|
`${value}.name`, '') |
|
|
|
|
|
|
|
|
|
|
|
case 'radio': |
|
|
|
|
|
case 'select': |
|
|
|
|
|
const selectItem = this.dataSource[field].find(t => t.value === String(value)) |
|
|
|
|
|
console.log(selectItem) |
|
|
|
|
|
return get(selectItem, 'text', '') |
|
|
|
|
|
|
|
|
|
|
|
case 'checkbox': |
|
|
|
|
|
if (!value || value.split(',').length <= 0) { |
|
|
|
|
|
return '' |
|
|
|
|
|
} |
|
|
|
|
|
const checkboxItems = value.split(',') |
|
|
|
|
|
return this.dataSource[field].filter(t => checkboxItems.includes(t.value)).map(t => t.text).join( |
|
|
|
|
|
',') |
|
|
|
|
|
|
|
|
|
|
|
case 'datetime': |
|
|
|
|
|
if (!value) { |
|
|
|
|
|
return '' |
|
|
|
|
|
} |
|
|
|
|
|
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : |
|
|
|
|
|
'YYYY-MM-DD HH:mm') |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
|
return value === null || value === undefined ? '' : value |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|