Commit db40d35a by liujinbo

Merge branch 'refs/heads/master' into master_ljb

parents 403e90de 87e3107b
...@@ -11,21 +11,51 @@ import CAHK from '/static/mocp/image/air-company/cahk.png' ...@@ -11,21 +11,51 @@ import CAHK from '/static/mocp/image/air-company/cahk.png'
export const airlinePicMapping = { export const airlinePicMapping = {
'8L': XPHK, '8L': XPHK,
'LKA': XPHK, LKA: XPHK,
'HNA': HNHK, HNA: HNHK,
'HU': HNHK, HU: HNHK,
'DRJ': SDHK, DRJ: SDHK,
'GCE': TJHK, GCE: TJHK,
'GS': TJHK, GS: TJHK,
'GCH': GLHK, GCH: GLHK,
'GT': GLHK, GT: GLHK,
'WAC': CAHK, WAC: CAHK,
'GXA': TJHK, // 北部湾航空 GXA: TJHK, // 北部湾航空
'YZJ': JPHK, YZJ: JPHK,
'CTJ': TJHK, // 天津货运航空 CTJ: TJHK, // 天津货运航空
'CGH': GLHK, CGH: GLHK,
'CGN': CAHK, // 长安航空 CGN: CAHK, // 长安航空
'CUH': WLMQHK, CUH: WLMQHK,
'FZA': FZHK, FZA: FZHK,
'GCA': HNHK GCA: HNHK
}
export const acOwnIconMapper = {
GT: 'guilinhangkong',
'9H': 'changanhangkong', // 长安航空
HT: 'tianjinhangkong',
UQ: 'wulumuqihangkong',
DRJ: 'shouduhangkong',
JD: 'shouduhangkong',
FU: 'fuzhouhangkong',
CN: 'hainanhangkong', // 大新华航空
HNA: 'hainanhangkong',
GS: 'tianjinhangkong',
GX: 'beibuwanhangkong', // 北部湾航空
HU: 'hainanhangkong',
'8L': 'xiangpenghangkong',
PN: 'xibuhangkong',
Y8: 'jinpenghangkong',
LKA: 'xiangpenghangkong',
GCE: 'tianjinhangkong',
GCH: 'guilinhangkong',
WAC: 'xibuhangkong',
GXA: 'beibuwanhangkong-01',
YZJ: 'jinpenghangkong',
CTJ: 'tianjinghuoyunhangkong',
CGH: 'guilinhangkong',
CGN: 'changanhangkong',
CUH: 'wulumuqihangkong',
FZA: 'fuzhouhangkong',
GCA: 'hainanhangkong'
} }
<template> <template>
<!-- 配合global-page-swiper实现左右滑动 --> <!-- 配合global-page-swiper实现左右滑动 -->
<view class="content"> <view class="mocp-content">
<z-paging <z-paging
:auto="auto" :auto="auto"
:refresher-enabled="refresherEnabled" :refresher-enabled="refresherEnabled"
...@@ -171,6 +171,7 @@ const getDataList = computed({ ...@@ -171,6 +171,7 @@ const getDataList = computed({
} }
}) })
defineExpose({ defineExpose({
getDataList,
reload: () => { reload: () => {
paging.value?.reload() paging.value?.reload()
}, },
...@@ -179,10 +180,20 @@ defineExpose({ ...@@ -179,10 +180,20 @@ defineExpose({
} }
}) })
</script> </script>
<script>
<style> export default {
options: {
styleIsolation: 'shared'
}
}
</script>
<style lang="scss" scoped>
/* 注意:父节点需要固定高度,z-paging的height:100%才会生效 */ /* 注意:父节点需要固定高度,z-paging的height:100%才会生效 */
.content { .mocp-content {
height: 100%; height: 100%;
//多选框
:deep(.u-checkbox__icon-wrap) {
min-width: 18px;
}
} }
</style> </style>
...@@ -65,7 +65,16 @@ ...@@ -65,7 +65,16 @@
:transformData="transformData" :transformData="transformData"
> >
<template #="{ dataList }"> <template #="{ dataList }">
<up-checkbox-group v-model="chooseValue" v-if="chooseDataType == 'checkbox'">
<template v-for="(item, index) in dataList" :key="index"> <template v-for="(item, index) in dataList" :key="index">
<up-checkbox :name="index" v-if="chooseDataType == 'checkbox'">
<template #label>
<slot :item="item" :index="index"></slot>
</template>
</up-checkbox>
</template>
</up-checkbox-group>
<template v-for="(item, index) in dataList" :key="index" v-else>
<slot :item="item" :index="index"></slot> <slot :item="item" :index="index"></slot>
</template> </template>
</template> </template>
...@@ -85,11 +94,11 @@ ...@@ -85,11 +94,11 @@
</template> </template>
<script setup> <script setup>
import { computed, nextTick, onUnmounted, ref } from 'vue' import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
// 获取屏幕边界到安全区域距离 // 获取屏幕边界到安全区域距离
const { safeAreaInsets } = uni.getSystemInfoSync() const { safeAreaInsets } = uni.getSystemInfoSync()
const es = defineEmits(['handleLeftClick', 'handleRightClick', 'handleFooterClick']) const es = defineEmits(['handleLeftClick', 'handleRightClick', 'handleFooterClick', 'handleChooseData'])
const ps = defineProps({ const ps = defineProps({
background: { background: {
type: String, type: String,
...@@ -213,6 +222,19 @@ const ps = defineProps({ ...@@ -213,6 +222,19 @@ const ps = defineProps({
type: Boolean, type: Boolean,
default: true default: true
}, },
//选择数据的类型'checkbox' | 'radio'
chooseDataType: {
type: String,
default: ''
},
mapFieldName: {
type: String,
default: ''
},
mapFieldSplit: {
type: String,
default: ','
},
//查询参数 //查询参数
params: { params: {
type: Object, type: Object,
...@@ -284,6 +306,16 @@ const getStyle = computed(() => { ...@@ -284,6 +306,16 @@ const getStyle = computed(() => {
} }
return style return style
}) })
//监听选择
const chooseValue = ref([])
watch(chooseValue, (value) => {
let data = value.map((index) => pagingArr.value[current.value]?.getDataList[index])
if (ps.mapFieldName) {
data = data.map((v) => v[ps.mapFieldName]).join(ps.mapFieldSplit)
}
console.log(data)
es('handleChooseData', data)
})
const current = ref(ps.current) const current = ref(ps.current)
// tabs通知swiper切换 // tabs通知swiper切换
const tabsChange = (item) => { const tabsChange = (item) => {
...@@ -329,9 +361,11 @@ const pages = getCurrentPages() ...@@ -329,9 +361,11 @@ const pages = getCurrentPages()
const pagingArr = ref([]) const pagingArr = ref([])
defineExpose({ defineExpose({
reload: () => { reload: () => {
chooseValue.value = []
pagingArr.value[current.value]?.reload() pagingArr.value[current.value]?.reload()
}, },
updateCache: () => { updateCache: () => {
chooseValue.value = []
pagingArr.value[current.value]?.updateCache() pagingArr.value[current.value]?.updateCache()
} }
}) })
......
...@@ -47,9 +47,20 @@ ...@@ -47,9 +47,20 @@
</template> </template>
<!-- 滚动内容 --> <!-- 滚动内容 -->
<view class="mocp-content" :style="getStyle"> <view class="mocp-content" :style="getStyle">
<template v-for="(item, index) in getDataList" :key="index" v-if="isDataList || localData"> <template v-if="isDataList || localData">
<up-checkbox-group v-model="chooseValue" v-if="chooseDataType == 'checkbox'">
<template v-for="(item, index) in getDataList" :key="index">
<up-checkbox :name="index" v-if="chooseDataType == 'checkbox'">
<template #label>
<slot :item="item" :index="index"></slot> <slot :item="item" :index="index"></slot>
</template> </template>
</up-checkbox>
</template>
</up-checkbox-group>
<template v-for="(item, index) in getDataList" :key="index" v-else>
<slot :item="item" :index="index"></slot>
</template>
</template>
<slot v-else></slot> <slot v-else></slot>
</view> </view>
<!-- 底部 --> <!-- 底部 -->
...@@ -65,10 +76,10 @@ ...@@ -65,10 +76,10 @@
</template> </template>
<script setup> <script setup>
import { filterEmptyValues } from 'mocp/utils/tool' import { filterEmptyValues } from 'mocp/utils/tool'
import { computed, nextTick, onUnmounted, ref } from 'vue' import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
const dataList = ref([]) const dataList = ref([])
const es = defineEmits(['query', 'handleLeftClick', 'handleRightClick', 'handleFooterClick']) const es = defineEmits(['query', 'handleLeftClick', 'handleRightClick', 'handleFooterClick', 'handleChooseData'])
const paging = ref() const paging = ref()
const ps = defineProps({ const ps = defineProps({
background: { background: {
...@@ -183,6 +194,19 @@ const ps = defineProps({ ...@@ -183,6 +194,19 @@ const ps = defineProps({
type: Boolean, type: Boolean,
default: false default: false
}, },
//选择数据的类型'checkbox' | 'radio'
chooseDataType: {
type: String,
default: ''
},
mapFieldName: {
type: String,
default: ''
},
mapFieldSplit: {
type: String,
default: ','
},
//查询参数 //查询参数
params: { params: {
type: Object, type: Object,
...@@ -267,6 +291,15 @@ const scroll = () => { ...@@ -267,6 +291,15 @@ const scroll = () => {
}, 500) }, 500)
// #endif // #endif
} }
//监听选择
const chooseValue = ref([])
watch(chooseValue, (value) => {
let data = value.map((index) => getDataList.value[index])
if (ps.mapFieldName) {
data = data.map((v) => v[ps.mapFieldName]).join(ps.mapFieldSplit)
}
es('handleChooseData', data)
})
// 获取屏幕边界到安全区域距离 // 获取屏幕边界到安全区域距离
const { safeAreaInsets } = uni.getSystemInfoSync() const { safeAreaInsets } = uni.getSystemInfoSync()
//列表加载 //列表加载
...@@ -353,9 +386,11 @@ const handleFooterClick = () => { ...@@ -353,9 +386,11 @@ const handleFooterClick = () => {
const pages = getCurrentPages() const pages = getCurrentPages()
defineExpose({ defineExpose({
reload: () => { reload: () => {
chooseValue.value = []
paging.value?.reload() paging.value?.reload()
}, },
updateCache: () => { updateCache: () => {
chooseValue.value = []
paging.value?.updateCache() paging.value?.updateCache()
} }
}) })
...@@ -391,6 +426,10 @@ export default { ...@@ -391,6 +426,10 @@ export default {
} }
} }
} }
//多选框
:deep(.u-checkbox__icon-wrap) {
min-width: 18px;
}
} }
.cancel { .cancel {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
auto auto
> >
<template #default="{ item }"> <template #default="{ item }">
<view v-for="item in dataList" :key="item.id" class="item" @tap="goDetails(item)"> <view class="item" @tap="goDetails(item)">
<view class="item-title"> <view class="item-title">
<view class="desc"> <view class="desc">
<custom-state :value="item.status == 1 ? 'OPEN' : 'CLOSE'"></custom-state> <custom-state :value="item.status == 1 ? 'OPEN' : 'CLOSE'"></custom-state>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment