Commit 1565f202 by pangchong

feat: 插件优化

parent 41d45c11
......@@ -120,7 +120,7 @@ const defaultValue = ref()
watch(
() => ps.modelValue,
() => {
if (ps.modelValue != ps.emptyValue) {
if (ps.modelValue != 0 && ps.modelValue != ps.emptyValue) {
labelValue.value = parseInt(ps.modelValue)
defaultValue.value = parseInt(ps.modelValue)
} else {
......
......@@ -28,6 +28,6 @@ const getIconStyle = computed(() => {
<style lang="scss" scoped>
.iconfont {
position: relative;
bottom: -2rpx;
bottom: -1.5rpx;
}
</style>
......@@ -54,8 +54,7 @@
</z-paging>
</template>
<script setup>
import { debounce } from 'lodash'
import { computed, nextTick, ref } from 'vue'
import { computed, ref } from 'vue'
const dataList = ref([])
const es = defineEmits(['query', 'handleLeftClick', 'handleRightClick', 'handleFooterClick'])
......@@ -194,13 +193,17 @@ const getStyle = computed(() => {
return style
})
//监听滚动
const scroll = debounce(() => {
const scrollTime = ref(null)
const scroll = () => {
// #ifdef APP
nextTick(() => {
if (scrollTime.value) {
clearTimeout(scrollTime.value)
}
scrollTime.value = setTimeout(() => {
uni.$emit('$upload-show', {})
})
}, 500)
// #endif
})
}
const complete = (data) => {
paging.value?.complete(data || true)
}
......
......@@ -115,6 +115,9 @@ const getContentStyle = computed(() => {
//下拉框显示的内容
const labelValue = ref('')
const getLabelValue = computed(() => {
if (labelValue.value == ps.emptyValue) {
return ps.placeholder
}
return labelValue.value || ps.placeholder
})
//获取下拉框class
......
......@@ -23,6 +23,7 @@
</view>
</view>
</view>
<global-empty v-if="getFileList.length == 0 && !showUpload">暂无文件</global-empty>
<template v-if="showUpload">
<view class="upload-button" v-if="isLoading">
<up-loading-icon text="上传中" textSize="14"></up-loading-icon>
......@@ -57,7 +58,7 @@
</template>
<script setup>
import { computed, nextTick, ref, watch } from 'vue'
import { computed, ref, watch } from 'vue'
import { cloneDeep } from 'lodash'
import { httpInterceptor } from 'mocp/utils/http'
import { onBeforeUnmount } from 'vue'
......@@ -78,7 +79,7 @@ const ps = defineProps({
},
typeField: {
type: String,
default: 'fileType'
default: 'fileExt'
},
url: {
type: String,
......@@ -144,13 +145,13 @@ const previewFile = (fileUrl) => {
},
fail: function () {
uni.hideLoading()
uni.$mocpMessage.showToast('打开文件失败')
uni.$mocpMessage.showToast('打开文件失败,请重新打开')
}
})
},
fail: function () {
uni.hideLoading()
uni.$mocpMessage.showToast('打开文件失败')
uni.$mocpMessage.showToast('打开文件失败,请重新打开')
}
})
}
......
......@@ -25,7 +25,10 @@
<global-field label="航站:" :value="baseStore.getTerminalObject[details.terminal] || '-'"></global-field>
</view>
<view class="details-body-field">
<global-field label="日期:" :value="timeStampFormat(details.dateTime, { format: 'YYYY/MM/DD HH:mm' })"></global-field>
<global-field
label="日期:"
:value="timeStampFormat(details.dateTime, { format: 'YYYY/MM/DD HH:mm' }) || '-'"
></global-field>
<global-field label="航班号:" :value="details.flight || '-'"></global-field>
</view>
<view class="details-body-field">
......@@ -53,7 +56,7 @@
</view>
<view class="details-body-item">
<view class="title">附件</view>
<global-upload :fileList="getFileList" :showUpload="false" typeField="fileExt"></global-upload>
<global-upload :fileList="getFileList" :showUpload="false"></global-upload>
</view>
</view>
</view>
......
......@@ -10,7 +10,7 @@
<view class="mocp-form">
<up-form labelPosition="left" labelWidth="auto" :model="formData">
<up-form-item label="状态" :borderBottom="true">
<global-picker pickAlign="right" v-model="formData.state" clearable dictkey="md_state"></global-picker>
<global-picker pickAlign="right" v-model="formData.state" dictkey="md_state"></global-picker>
</up-form-item>
<up-form-item label="机号" :borderBottom="true">
<global-picker
......@@ -42,6 +42,7 @@
mode="datetime"
format="YYYY/MM/DD HH:mm"
placeholder="请选择日期"
:emptyValue="0"
></global-date>
</up-form-item>
<up-form-item label="航班号" :borderBottom="true">
......@@ -60,6 +61,7 @@
mode="datetime"
format="YYYY/MM/DD HH:mm"
placeholder="请选择日期"
:emptyValue="0"
></global-date>
</up-form-item>
<up-form-item label="运行决策类型" :borderBottom="true">
......@@ -89,7 +91,6 @@
<up-form-item label="附件" :borderBottom="true" labelPosition="top">
<global-upload
:fileList="getFileList"
typeField="fileExt"
v-model="formData.file"
mapFieldName="ids"
@getFileList="getFileDataList"
......@@ -110,7 +111,6 @@
<global-picker
pickAlign="right"
v-model="formData.decisionState"
clearable
style="margin-top: 24rpx"
dictkey="md_decisionState"
></global-picker>
......
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