Commit 52f7f6b2 by pangchong

feat: 调整

parent 0561260c
import { createSSRApp } from 'vue'
import App from './App.vue'
import pinia from './store'
import message from '@/utils/message'
import * as message from '@/utils/message'
import * as tool from '@/utils/tool'
// 引入字体
import '@/static/font/iconfont.css'
//消息提示
uni.$message = message
//工具方法
uni.$tool = tool
export function createApp() {
const app = createSSRApp(App)
app.use(pinia)
......
<template>
<global-page :showNavbar="false">
<template #top>
<global-navbar :title="details.appraisee !== '-1' ? details.appraisee : ''">
<global-navbar :title="showData(details.appraisee)">
<template #left>
<uni-icons type="left" size="16" @tap="goBack"></uni-icons>
</template>
......@@ -71,6 +71,7 @@
import { onLoad } from '@dcloudio/uni-app'
import CardDetails from './components/card-details.vue'
import { ref } from 'vue'
import { showData } from '@/utils/tool'
const details = ref({
id: '1771004152946348034',
......
......@@ -6,8 +6,8 @@
<view class="item-title">
<view class="desc">
<view class="type">{{ item.status == 1 ? 'OPEN' : 'ClOSE' }}</view>
<view class="txt">{{ item.appraisee !== '-1' ? item.appraisee : '' }}</view>
<view class="place">{{ item.department !== '-1' ? item.department : '' }}</view>
<view class="txt">{{ showData(item.appraisee) }}</view>
<view class="place">{{ showData(item.department) }}</view>
</view>
<score-details v-if="item.score > 0" :type="item.eventType == 1 ? 'success' : 'warning'">{{ item.score }}</score-details>
</view>
......@@ -24,6 +24,7 @@
import { ref } from 'vue'
import { getRqmListApi, getRqmOptionsApi } from '@/api/appraisal-record'
import { onLoad } from '@dcloudio/uni-app'
import { showData } from '@/utils/tool'
const tabList = ref([
{ name: 'OPEN', value: 1 },
......
// utils/message.js
export default {
showToast(msg, options) {
uni.showToast({
title: msg || '操作失败',
icon: 'none',
duration: 2000,
...options
});
}
export const showToast = (msg, options) => {
uni.showToast({
title: msg || '操作失败',
icon: 'none',
duration: 2000,
...options
});
}
\ No newline at end of file
// utils/tool.js
export const showData = (data) => {
if (typeof data === 'undefined' || data === null) {
return ''
}
if (typeof data === 'string' && data.trim() === '') {
return ''
}
if (data.trim() === '-1' || data.trim() === -1) {
return ''
}
if (Array.isArray(data) && data.length === 0) {
return ''
}
if (typeof data === 'object' && Object.keys(data).length === 0) {
return ''
}
return data
}
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