Commit 9582a027 by pangchong

feat: 引入uview-plus

parent 260b15d3
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"types": [ "types": [
"@dcloudio/types", "@dcloudio/types",
"@uni-helper/uni-app-types", "@uni-helper/uni-app-types",
"@uni-helper/uni-ui-types" "@uni-helper/uni-ui-types",
"uview-plus/types"
] ]
} }
} }
\ No newline at end of file
...@@ -23,9 +23,12 @@ ...@@ -23,9 +23,12 @@
"@dcloudio/uni-mp-xhs": "3.0.0-4010520240507001", "@dcloudio/uni-mp-xhs": "3.0.0-4010520240507001",
"@dcloudio/uni-quickapp-webview": "3.0.0-4010520240507001", "@dcloudio/uni-quickapp-webview": "3.0.0-4010520240507001",
"@dcloudio/uni-ui": "^1.5.5", "@dcloudio/uni-ui": "^1.5.5",
"clipboard": "^2.0.11",
"dayjs": "^1.11.11",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"pina": "^0.20.2204228", "pina": "^0.20.2204228",
"pinia-plugin-persistedstate": "^3.2.1", "pinia-plugin-persistedstate": "^3.2.1",
"uview-plus": "^3.2.22",
"vue": "^3.4.21", "vue": "^3.4.21",
"vue-i18n": "^9.1.9" "vue-i18n": "^9.1.9"
}, },
...@@ -5381,6 +5384,16 @@ ...@@ -5381,6 +5384,16 @@
"dev": true, "dev": true,
"peer": true "peer": true
}, },
"node_modules/clipboard": {
"version": "2.0.11",
"resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz",
"integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
"dependencies": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"node_modules/cliui": { "node_modules/cliui": {
"version": "7.0.4", "version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
...@@ -5644,6 +5657,11 @@ ...@@ -5644,6 +5657,11 @@
"node": ">=10" "node": ">=10"
} }
}, },
"node_modules/dayjs": {
"version": "1.11.11",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.11.tgz",
"integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg=="
},
"node_modules/debug": { "node_modules/debug": {
"version": "4.3.4", "version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
...@@ -5723,6 +5741,11 @@ ...@@ -5723,6 +5741,11 @@
"node": ">=0.4.0" "node": ">=0.4.0"
} }
}, },
"node_modules/delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
},
"node_modules/depd": { "node_modules/depd": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
...@@ -6425,6 +6448,14 @@ ...@@ -6425,6 +6448,14 @@
"node": ">=4" "node": ">=4"
} }
}, },
"node_modules/good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
"dependencies": {
"delegate": "^3.1.2"
}
},
"node_modules/gopd": { "node_modules/gopd": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
...@@ -10365,6 +10396,11 @@ ...@@ -10365,6 +10396,11 @@
"resolved": "https://registry.npmjs.org/scule/-/scule-1.3.0.tgz", "resolved": "https://registry.npmjs.org/scule/-/scule-1.3.0.tgz",
"integrity": "sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==" "integrity": "sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g=="
}, },
"node_modules/select": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz",
"integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=="
},
"node_modules/semver": { "node_modules/semver": {
"version": "6.3.1", "version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
...@@ -10833,6 +10869,11 @@ ...@@ -10833,6 +10869,11 @@
"resolved": "https://registry.npmjs.org/timm/-/timm-1.7.1.tgz", "resolved": "https://registry.npmjs.org/timm/-/timm-1.7.1.tgz",
"integrity": "sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw==" "integrity": "sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw=="
}, },
"node_modules/tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
},
"node_modules/tinycolor2": { "node_modules/tinycolor2": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz",
...@@ -11216,6 +11257,18 @@ ...@@ -11216,6 +11257,18 @@
"node": ">= 0.4.0" "node": ">= 0.4.0"
} }
}, },
"node_modules/uview-plus": {
"version": "3.2.22",
"resolved": "https://registry.npmmirror.com/uview-plus/-/uview-plus-3.2.22.tgz",
"integrity": "sha512-ouhq0CCGP/ElR7eCCu0rBFNPTGW/EctcrxKIerjj1DOkEIY9BwKBbdI0VTSSkMFnr6RFejSQLBw/aKkqd6Q+7g==",
"dependencies": {
"clipboard": "^2.0.11",
"dayjs": "^1.11.3"
},
"engines": {
"HBuilderX": "^3.1.0"
}
},
"node_modules/v8-to-istanbul": { "node_modules/v8-to-istanbul": {
"version": "8.1.1", "version": "8.1.1",
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz",
......
...@@ -55,9 +55,12 @@ ...@@ -55,9 +55,12 @@
"@dcloudio/uni-mp-xhs": "3.0.0-4010520240507001", "@dcloudio/uni-mp-xhs": "3.0.0-4010520240507001",
"@dcloudio/uni-quickapp-webview": "3.0.0-4010520240507001", "@dcloudio/uni-quickapp-webview": "3.0.0-4010520240507001",
"@dcloudio/uni-ui": "^1.5.5", "@dcloudio/uni-ui": "^1.5.5",
"clipboard": "^2.0.11",
"dayjs": "^1.11.11",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"pina": "^0.20.2204228", "pina": "^0.20.2204228",
"pinia-plugin-persistedstate": "^3.2.1", "pinia-plugin-persistedstate": "^3.2.1",
"uview-plus": "^3.2.22",
"vue": "^3.4.21", "vue": "^3.4.21",
"vue-i18n": "^9.1.9" "vue-i18n": "^9.1.9"
}, },
......
...@@ -18,7 +18,9 @@ export default { ...@@ -18,7 +18,9 @@ export default {
} }
</script> </script>
<style> <style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import 'uview-plus/index.scss';
/*每个页面公共css */ /*每个页面公共css */
page { page {
font-size: 28rpx; font-size: 28rpx;
......
import { http } from '@/utils/http'
export const getAircraftNumbersApi = (data, config) => {
return http({
method: 'POST',
url: '/resource/flight/getAircraftNumbers',
data,
config
})
}
export const hobby = [ export const opinionType = [
{ { label: 'N/A', value: 0 },
label: '学习', { label: '不同意', value: 1 },
value: 1 { label: '同意', value: 2 }
}, ]
{
label: '乒乓球', export const appealInfo = [
value: 2 { label: '无', value: 0 },
}, { label: '申诉跟踪', value: 1 },
{ { label: '申诉关闭', value: 2 }
label: '羽毛球', ]
value: 3
}
]
\ No newline at end of file
import * as dictData from './dictData'
import { cloneDeep } from 'lodash'
export function useDict(dictkey, opt) {
if (!dictkey && !opt?.data) {
return []
}
let currentDictList = cloneDeep((opt?.data ? opt.data : (dictData)[dictkey] || []))
if (opt?.filter) {
currentDictList = currentDictList.filter((item) => {
return opt.filter && opt.filter(item)
})
}
return currentDictList
}
export function useGetDictByLabel(dictkey, label, option) {
const enterSplit = option?.enterSplit || ','
const outputSplit = option?.enterSplit || ';'
const labelArr = label.split(enterSplit)
const values = []
useDict(dictkey, { filter: option?.filter, data: option?.data }).forEach((item) => {
if (
labelArr.some((label) => {
return label == item['label']
})
) {
values.push(item['value'])
}
})
return values.join(outputSplit)
}
export function useGetDictByValue(dictkey, value = '', option) {
const enterSplit = option?.enterSplit || ','
const outputSplit = option?.enterSplit || ';'
const valueArr = String(value).split(enterSplit)
const labels = []
useDict(dictkey, { filter: option?.filter, data: option?.data }).forEach((item) => {
if (
valueArr.some((value) => {
return value == String(item['value'])
})
) {
labels.push(item['label'])
}
})
return labels.join(outputSplit)
}
export function useGetDictByProp(dictkey, value = '', prop, option) {
const enterSplit = option?.enterSplit || ','
const outputSplit = option?.enterSplit || ';'
const valueArr = String(value).split(enterSplit)
const labels = []
useDict(dictkey, { filter: option?.filter, data: option?.data }).forEach((item) => {
if (
valueArr.some((value) => {
return value == String(item['value'])
})
) {
labels.push(item[prop])
}
})
return labels.join(outputSplit)
}
import { createSSRApp } from 'vue' import { createSSRApp } from 'vue'
import App from './App.vue' import App from './App.vue'
import pinia from './store' import pinia from './store'
import uviewPlus from 'uview-plus'
import * as message from '@/utils/message' import * as message from '@/utils/message'
import * as tool from '@/utils/tool' import * as tool from '@/utils/tool'
// 引入字体 // 引入字体
...@@ -10,9 +11,10 @@ uni.$message = message ...@@ -10,9 +11,10 @@ uni.$message = message
//工具方法 //工具方法
uni.$tool = tool uni.$tool = tool
export function createApp() { export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App)
app.use(pinia) app.use(pinia)
return { app.use(uviewPlus)
app return {
} app
}
} }
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ],
"versionCode":1001
}, },
/* ios打包配置 */ /* ios打包配置 */
"ios" : {}, "ios" : {},
......
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
"autoscan": true, "autoscan": true,
"custom": { "custom": {
// uni-ui 规则如下配置 // uni-ui 规则如下配置
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue" "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue",
"^u--(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^up-(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue"
} }
}, },
"pages": [ "pages": [
......
<template>
<view class="card-details-item">
<view class="label">{{ label }}</view>
<text>
<slot>-</slot>
</text>
</view>
</template>
<script setup>
const ps = defineProps({
label: {
type: String,
default: ''
}
})
</script>
<style lang="scss" scoped>
.card-details-item {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
}
</style>
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<view class="card"> <view class="card">
<view class="card-title"> <view class="card-title">
<view class="left"> <view class="left">
<global-icon :icon="type == 'appeal' ? 'email' : 'message'" color="#1D2129"></global-icon> <global-icon :icon="titleIcon" color="#1D2129"></global-icon>
<text>{{ getIitle }}</text> <text>{{ title }}</text>
</view> </view>
<view class="right" v-if="edit"> <view class="right" v-if="edit">
<global-button type="text" @tap="handleAdd">添加</global-button> <global-button type="text" @tap="handleAdd">添加</global-button>
...@@ -11,36 +11,29 @@ ...@@ -11,36 +11,29 @@
</view> </view>
<view class="card-content"> <view class="card-content">
<template v-if="type == 'appeal'"> <template v-if="type == 'appeal'">
<view class="card-content-row"> <slot></slot>
<view>申诉跟踪</view>
</view>
<view class="card-content-image">
<image src="/static/image/panel/page-bg.png" />
</view>
</template> </template>
<template v-else> <template v-else>
<view class="card-content-row" v-for="item in getData" :key="item.label"> <slot></slot>
<view>{{ item.label }}</view>
<text>-</text>
</view>
<view class="card-content-desc">
<view class="label">
<global-icon icon="idcard" color="#1D2129"></global-icon>
<text>-</text>
</view>
<view class="label">
<global-icon icon="calendar" color="#1D2129"></global-icon>
<text>-</text>
</view>
</view>
</template> </template>
</view> </view>
<slot name="footer" v-if="showfooter">
<view class="card-footer">
<view class="label">
<global-icon icon="idcard" color="#1D2129"></global-icon>
<text>{{ showData(idcard, '-') }}</text>
</view>
<view class="label">
<global-icon icon="calendar" color="#1D2129"></global-icon>
<text>{{ showData(calendar) ? timeStampFormat(calendar) : '-' }}</text>
</view>
</view>
</slot>
</view> </view>
</template> </template>
<script setup> <script setup>
import { computed } from 'vue' import { showData, timeStampFormat } from '@/utils/tool'
const es = defineEmits(['handleAdd']) const es = defineEmits(['handleAdd'])
const ps = defineProps({ const ps = defineProps({
// company,quality,appeal // company,quality,appeal
...@@ -48,6 +41,10 @@ const ps = defineProps({ ...@@ -48,6 +41,10 @@ const ps = defineProps({
type: String, type: String,
default: 'company' default: 'company'
}, },
title: {
type: String,
default: ''
},
titleIcon: { titleIcon: {
type: String, type: String,
default: 'message' default: 'message'
...@@ -55,55 +52,20 @@ const ps = defineProps({ ...@@ -55,55 +52,20 @@ const ps = defineProps({
edit: { edit: {
type: Boolean, type: Boolean,
default: false default: false
},
showfooter: {
type: Boolean,
default: false
},
idcard: {
type: String,
default: '-'
},
calendar: {
type: [String, Number],
default: '-'
} }
}) })
const getData = computed(() => {
if (ps.type == 'company') {
return [
{
label: '公司值班经理',
value: ''
},
{
label: '公司值班经理意见',
value: ''
},
{
label: '公司值班经理意见描述',
value: ''
}
]
}
if (ps.type == 'quality') {
return [
{
label: '品质中心经理',
value: ''
},
{
label: '品质中心经理意见',
value: ''
},
{
label: '品质中心经理意见描述',
value: ''
}
]
}
return {}
})
const getIitle = computed(() => {
if (ps.type == 'company') {
return '公司值班信息'
}
if (ps.type == 'quality') {
return '品质中心信息'
}
if (ps.type == 'appeal') {
return '申诉状态'
}
return ''
})
const handleAdd = () => { const handleAdd = () => {
es('handleAdd') es('handleAdd')
} }
...@@ -131,27 +93,15 @@ const handleAdd = () => { ...@@ -131,27 +93,15 @@ const handleAdd = () => {
} }
&-content { &-content {
padding-top: 16rpx; padding-top: 16rpx;
&-row { }
display: flex; &-footer {
justify-content: space-between; display: flex;
align-items: center; align-items: center;
margin-bottom: 16rpx; justify-content: flex-end;
}
&-desc,
.label { .label {
display: flex; margin-left: 16rpx;
align-items: center; text {
justify-content: flex-end;
.label {
margin-left: 16rpx; margin-left: 16rpx;
text {
margin-left: 16rpx;
}
}
}
&-image {
image {
width: 100%;
} }
} }
} }
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
} }
} }
&-body { &-body {
border-top: 2rpx solid #F4F4F4; border-top: 2rpx solid #f4f4f4;
border-bottom: 2rpx solid #F4F4F4; border-bottom: 2rpx solid #f4f4f4;
padding: 16rpx 0; padding: 16rpx 0;
&-top { &-top {
display: flex; display: flex;
...@@ -46,47 +46,50 @@ ...@@ -46,47 +46,50 @@
} }
} }
.right { .right {
text{ text {
margin-left: 24rpx; margin-left: 24rpx;
} }
} }
} }
&-bottom{ &-bottom {
margin-top: 16rpx; margin-top: 16rpx;
font-size: 30rpx; font-size: 30rpx;
line-height: 42rpx; line-height: 42rpx;
} }
} }
&-footer{ &-footer {
padding-top: 16rpx; padding-top: 16rpx;
&-top{ &-top {
color: #1D2129; color: #1d2129;
display: flex; display: flex;
align-items: center; align-items: center;
text{ text {
margin-left: 16rpx; margin-left: 16rpx;
} }
} }
&-center{ &-center {
line-height: 40rpx; line-height: 40rpx;
padding: 16rpx 0; padding: 16rpx 0;
} }
&-bottom{ &-bottom {
color: #1D2129; color: #1d2129;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
.person-info{ .person-info {
display: flex; display: flex;
align-items: center; align-items: center;
text{ text {
margin-left: 16rpx; margin-left: 16rpx;
} }
&:first-child{ &:first-child {
margin-right: 32rpx; margin-right: 32rpx;
} }
} }
} }
} }
} }
.appeal-status {
color: #1d2129;
margin-bottom: 16rpx;
}
} }
<template> <template>
<global-page :showNavbar="false"> <global-page :showNavbar="false">
<template #top> <template #top>
<global-navbar :title="showData(details.appraisee)"> <global-navbar :title="showData(details?.appraisee, '暂无标题~')">
<template #left> <template #left>
<uni-icons type="left" size="16" @tap="goBack"></uni-icons> <uni-icons type="left" size="16" @tap="goBack"></uni-icons>
</template> </template>
...@@ -24,22 +24,22 @@ ...@@ -24,22 +24,22 @@
<global-icon class="left-icon" icon="Vector" size="24" color="#DD4012"></global-icon> <global-icon class="left-icon" icon="Vector" size="24" color="#DD4012"></global-icon>
<view class="txt">{{ details.ac }} {{ details.acType }}</view> <view class="txt">{{ details.ac }} {{ details.acType }}</view>
</view> </view>
<view class="right"><uni-dateformat :date="details.eventTime" format="yyyy-MM-dd"></uni-dateformat></view> <view class="right">{{ timeStampFormat(details.eventTime, { format: 'YYYY-MM-DD' }) }}</view>
</view> </view>
</view> </view>
<view class="details-body"> <view class="details-body">
<view class="details-body-top"> <view class="details-body-top">
<view class="left"> <view class="left">
<global-icon icon="mind-mapping"></global-icon> <global-icon icon="mind-mapping"></global-icon>
<text>来源编号:{{ details.dmUid }}</text> <text>来源编号:{{ showData(details.acOwn, '暂无~') }}</text>
</view> </view>
<view class="right"> <view class="right">
{{ details.department }} {{ showData(details.department) }}
<text>{{ details.appraisee }}</text> <text>{{ showData(details.appraisee) }}</text>
</view> </view>
</view> </view>
<view class="details-body-bottom"> <view class="details-body-bottom">
{{ details.eventMsg || '暂无内容~' }} {{ showData(details.eventMsg, '暂无内容~') }}
</view> </view>
</view> </view>
<view class="details-footer"> <view class="details-footer">
...@@ -60,9 +60,27 @@ ...@@ -60,9 +60,27 @@
</view> </view>
</view> </view>
</view> </view>
<card-details type="company"></card-details> <card-details type="company" title="公司值班信息" showfooter :idcard="details.dmName" :calendar="details.optionSaveTime">
<card-details type="quality"></card-details> <card-details-item label="公司值班经理">{{ showData(details.dmName, '-') }}</card-details-item>
<card-details type="appeal"></card-details> <card-details-item label="公司值班经理意见">
{{ showData(details.opinionType) ? useGetDictByValue('opinionType', details.opinionType) : '-' }}
</card-details-item>
<card-details-item label="公司值班经理意见描述">{{ showData(details.dmMsg, '-') }}</card-details-item>
</card-details>
<card-details type="quality" title="品质中心信息" showfooter :idcard="details.qmName" :calendar="details.qualitySaveTime">
<card-details-item label="品质中心经理">{{ showData(details.qmName, '-') }}</card-details-item>
<card-details-item label="品质中心经理意见">
{{ showData(details.qualityOpinionType) ? useGetDictByValue('opinionType', details.qualityOpinionType) : '-' }}
</card-details-item>
<card-details-item label="品质中心经理意见描述">{{ showData(details.qmMsg, '-') }}</card-details-item>
</card-details>
<card-details type="appeal" title="申诉状态" titleIcon="email">
<template v-if="showData(details.appealInfo)">
<view class="appeal-status">{{ useGetDictByValue('appealInfo', details.appealInfo) }}</view>
<image :src="item.fileUrl" v-for="item in file" :key="item.id" />
</template>
<global-empty v-else></global-empty>
</card-details>
</view> </view>
</global-page> </global-page>
</template> </template>
...@@ -70,46 +88,18 @@ ...@@ -70,46 +88,18 @@
<script setup> <script setup>
import { onLoad } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import CardDetails from './components/card-details.vue' import CardDetails from './components/card-details.vue'
import CardDetailsItem from './components/card-details-item.vue'
import { ref } from 'vue' import { ref } from 'vue'
import { showData } from '@/utils/tool' import { showData, timeStampFormat } from '@/utils/tool'
import { useGetDictByValue } from '@/components/global-picker/useDict'
const details = ref({ const details = ref()
id: '1771004152946348034', const file = ref([])
eventSource: '测试',
department: '西北基地',
appraisee: '执管MCC',
ac: 'B1012',
acOwn: 'DRJ',
acType: 'A32',
eventTime: 1711036800000,
eventMsg: '测试',
eventType: 1,
examineType: '信息管理',
examineBasis: '测试',
score: 1.0,
onDutyUser: '测试',
dmUid: '10653',
opinionType: 0,
optionSaveTime: -1,
optionSaveUid: '-1',
appealInfo: -1,
qmUid: '-1',
qualityOpinionType: -1,
qualitySaveTime: -1,
qualitySaveUid: '-1',
dmName: '唐恒山',
qmName: null,
dmSaveName: null,
qmSaveName: null,
status: 1,
dmMsg: '',
qmMsg: '',
file: '[]',
emailSendTime: 0
})
onLoad(() => { onLoad(() => {
uni.$once('appraisalRecordDetials', (data) => { uni.$once('appraisalRecordDetials', (data) => {
console.log(data) details.value = data
file.value = JSON.parse(details.value.file)
console.log(file.value)
}) })
}) })
//跳转 //跳转
......
import { defineStore } from 'pinia'
const useBaseStore = defineStore('base', {
state: () => {
return {}
},
getters: {},
actions: {
},
// 配置持久化
persist: false
})
export default useBaseStore
...@@ -12,14 +12,16 @@ ...@@ -12,14 +12,16 @@
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/ */
@import 'uview-plus/theme.scss';
/* 颜色变量 */ /* 颜色变量 */
/* 行为相关颜色 */ /* 行为相关颜色 */
$uni-color-primary: #165DFF; $uni-color-primary: #165dff;
$uni-color-success: #00B42A; $uni-color-success: #00b42a;
$uni-color-warning: #FF7D00; $uni-color-warning: #ff7d00;
$uni-color-error: #F53F3F; $uni-color-error: #f53f3f;
/* 文字基本颜色 */ /* 文字基本颜色 */
$uni-text-color: #333; // 基本色 $uni-text-color: #333; // 基本色
$uni-text-color-inverse: #fff; // 反色 $uni-text-color-inverse: #fff; // 反色
...@@ -73,4 +75,4 @@ $uni-font-size-title: 20px; ...@@ -73,4 +75,4 @@ $uni-font-size-title: 20px;
$uni-color-subtitle: #555; // 二级标题颜色 $uni-color-subtitle: #555; // 二级标题颜色
$uni-font-size-subtitle: 18px; $uni-font-size-subtitle: 18px;
$uni-color-paragraph: #3f536e; // 文章段落颜色 $uni-color-paragraph: #3f536e; // 文章段落颜色
$uni-font-size-paragraph: 15px; $uni-font-size-paragraph: 15px;
\ No newline at end of file
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn' // 导入本地化语言
dayjs.locale('zh-cn') // 使用本地化语言
export default dayjs
// utils/tool.js // utils/tool.js
export const showData = (data) => { import Day from './dayjs'
/**
* 数据展示
* null => ''
*/
export const showData = (data, result = '') => {
if (typeof data === 'undefined' || data === null) { if (typeof data === 'undefined' || data === null) {
return '' return result
} }
if (typeof data === 'string' && data.trim() === '') { if (typeof data === 'string' && data.trim() === '') {
return '' return result
} }
if (data.trim() === '-1' || data.trim() === -1) { if (data === '-1' || data === -1) {
return '' return result
} }
if (Array.isArray(data) && data.length === 0) { if (Array.isArray(data) && data.length === 0) {
return '' return result
} }
if (typeof data === 'object' && Object.keys(data).length === 0) { if (typeof data === 'object' && Object.keys(data).length === 0) {
return '' return result
} }
return data return data
} }
/**
* 时间戳格式化
* 1715072168340 => 2024-05-07 16:56:08
*/
export const timeStampFormat = (timeStamp, opt) => {
if (!timeStamp) {
return ''
}
timeStamp = parseInt(String(timeStamp))
const format = opt?.format || 'YYYY-MM-DD HH:mm:ss'
return Day(timeStamp).format(format)
}
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