Commit 1565f202 by pangchong

feat: 插件优化

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