| | |
| | | "Component": true, |
| | | "ComponentPublicInstance": true, |
| | | "ComputedRef": true, |
| | | "DirectiveBinding": true, |
| | | "EffectScope": true, |
| | | "ExtractDefaultPropTypes": true, |
| | | "ExtractPropTypes": true, |
| | | "ExtractPublicPropTypes": true, |
| | | "InjectionKey": true, |
| | | "MaybeRef": true, |
| | | "MaybeRefOrGetter": true, |
| | | "PropType": true, |
| | | "Ref": true, |
| | | "VNode": true, |
| | |
| | | "onUnload": true, |
| | | "onUnmounted": true, |
| | | "onUpdated": true, |
| | | "onWatcherCleanup": true, |
| | | "provide": true, |
| | | "reactive": true, |
| | | "readonly": true, |
| | |
| | | "useAttrs": true, |
| | | "useCssModule": true, |
| | | "useCssVars": true, |
| | | "useId": true, |
| | | "useModel": true, |
| | | "useRequest": true, |
| | | "useSlots": true, |
| | | "useTemplateRef": true, |
| | | "useUpload": true, |
| | | "useUpload2": true, |
| | | "watch": true, |
| | | "watchEffect": true, |
| | | "watchPostEffect": true, |
| | | "watchSyncEffect": true, |
| | | "DirectiveBinding": true, |
| | | "MaybeRef": true, |
| | | "MaybeRefOrGetter": true, |
| | | "onWatcherCleanup": true, |
| | | "useId": true, |
| | | "useModel": true, |
| | | "useTemplateRef": true |
| | | "watchSyncEffect": true |
| | | } |
| | | } |
| | |
| | | VITE_APP_PUBLIC_BASE=/ |
| | | |
| | | VITE_SERVER_BASEURL = 'http://192.168.12.33:8080' |
| | | VITE_UPLOAD_BASEURL = 'https://ukw0y1.laf.run/upload' |
| | | VITE_UPLOAD_BASEURL = 'http://192.168.12.33:8080/resource/oss/upload' |
| | | |
| | | # æäºåå¦å¯è½éè¦å¨å¾®ä¿¡å°ç¨åºé颿 ¹æ® developãtrialãrelease åå«è®¾ç½®ä¸ä¼ å°åï¼åè代ç å¦ä¸ã |
| | | # ä¸é¢çåéå¦ææ²¡æè®¾ç½®ï¼ä¼é»è®¤ä½¿ç¨ VITE_SERVER_BASEURL or VITE_UPLOAD_BASEURL |
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/equ/equ-list", |
| | | "type": "page", |
| | | "layout": "default", |
| | | "style": { |
| | | "navigationBarTitleText": "设å¤å表" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/equ/index", |
| | | "type": "page", |
| | | "layout": "tabbar", |
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/inspect/insp-add", |
| | | "type": "page", |
| | | "layout": "default", |
| | | "style": { |
| | | "navigationBarTitleText": "设å¤ç¹æ£" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/inspect/insp-record", |
| | | "type": "page", |
| | | "style": { |
| | | "navigationBarTitleText": "ç¹æ£è®°å½", |
| | | "navigationStyle": "custom", |
| | | "navigationBarBackgroundColor": "#4D80F0" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/inspect/insp-st", |
| | | "type": "page", |
| | | "layout": "default", |
| | | "style": { |
| | | "navigationBarTitleText": "ç¹æ£æ±æ»" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/login/index", |
| | | "type": "page", |
| | | "layout": "default", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'default', |
| | | style: { |
| | | navigationBarTitleText: '设å¤å表', |
| | | }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> |
| | | <template #top> |
| | | <wd-drop-menu> |
| | | <wd-drop-menu-item v-model="equTypeId" :options="typeList" @change="handleEquType" /> |
| | | <wd-drop-menu-item v-model="status" :options="statusList" @change="handleEquStatu" /> |
| | | </wd-drop-menu> |
| | | </template> |
| | | |
| | | <view class="bg-base"> |
| | | <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id"> |
| | | <template #title> |
| | | <view class="flex justify-between items-baseline"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <text class="ml-1 text-xs">{{ item.assetNo }}</text> |
| | | </view> |
| | | |
| | | <view> |
| | | <text class="icon-color-base">详æ
</text> |
| | | <wd-icon name="arrow-right" custom-class="icon-color-base"></wd-icon> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[80rpx]" @click.stop="itemClick(item)"> |
| | | <image class="slot-img text-center" src="/static/images/camera.png" /> |
| | | <view> |
| | | <view class="text-color-base"> |
| | | {{ item.equName }} |
| | | <text class="text-color-gray ml-2 text-mini">{{ item.modelNo }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-1"> |
| | | {{ item.location }} | {{ item.madeIn }} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </wd-card> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { onMounted, getCurrentInstance, ref } from 'vue' |
| | | |
| | | import { getEquList } from '@/service/equ' |
| | | |
| | | // 设å¤ç±»å |
| | | const equTypeId = ref<number>(0) |
| | | // 设å¤ç¶æ |
| | | const status = ref<number>(0) |
| | | |
| | | const isSelectEqu = ref(false) |
| | | |
| | | const typeList = ref<Record<string, any>[]>([{ label: 'ææè®¾å¤', value: 0 }]) |
| | | const statusList = ref<Record<string, any>[]>([{ label: 'ææç¶æ', value: 0 }]) |
| | | function handleEquType({ value }) { |
| | | console.log(value) |
| | | } |
| | | function handleEquStatu({ value }) { |
| | | console.log(value) |
| | | } |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | // è¿éçpageNoåpageSizeä¼èªå¨è®¡ç®å¥½ï¼ç´æ¥ä¼ ç»æå¡å¨å³å¯ |
| | | // è¿éç请æ±åªæ¯æ¼ç¤ºï¼è¯·æ¿æ¢æèªå·±ç项ç®çç½ç»è¯·æ±ï¼å¹¶å¨ç½ç»è¯·æ±åè°ä¸éè¿paging.value.complete(请æ±åæ¥çæ°ç»)å°è¯·æ±ç»æä¼ ç»z-paging |
| | | getEquList({ pageNum, pageSize }) |
| | | .then((res: any) => { |
| | | // 请å¿å¨ç½ç»è¯·æ±åè°ä¸ç»dataListèµå¼ï¼ï¼åªéè¦è°ç¨completeå°±å¯ä»¥äº |
| | | console.log(res) |
| | | paging.value.complete(res.rows) |
| | | }) |
| | | .catch((res) => { |
| | | // å¦æè¯·æ±å¤±è´¥åpaging.value.complete(false)ï¼ä¼èªå¨å±ç¤ºéè¯¯é¡µé¢ |
| | | // 注æï¼æ¯æ¬¡é½éè¦å¨catchä¸åè¿å¥è¯å¾éº»ç¦ï¼z-pagingæä¾äºæ¹æ¡å¯ä»¥å
¨å±ç»ä¸å¤ç |
| | | // å¨åºå±çç½ç»è¯·æ±æåºå¼å¸¸æ¶ï¼åuni.$emit('z-paging-error-emit');å³å¯ |
| | | paging.value.complete(false) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * è®¾å¤æ¡ç®ç¹å»äºä»¶ |
| | | * @param item |
| | | */ |
| | | function itemClick(item: any) { |
| | | if (isSelectEqu.value) { |
| | | emitSelectEqu(item) |
| | | uni.navigateBack() |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éæ©è®¾å¤åè° |
| | | * @param equ |
| | | */ |
| | | function emitSelectEqu(equ: any) { |
| | | eventChannel.value.emit('selectEqu', { |
| | | data: equ, |
| | | }) |
| | | } |
| | | |
| | | |
| | | const eventChannel = ref<any>() |
| | | onMounted(() => { |
| | | const instance: any = getCurrentInstance().proxy |
| | | const event = instance.getOpenerEventChannel() |
| | | eventChannel.value = event |
| | | event.on('handleSelectEqu', function (data) { |
| | | isSelectEqu.value = true |
| | | console.log('handleSelectEqu', data) |
| | | }) |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .menu-title-box { |
| | | height: 30rpx; |
| | | line-height: 30rpx; |
| | | } |
| | | |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | margin-right: 24rpx; |
| | | } |
| | | .text-mini { |
| | | font-size: 22rpx; |
| | | } |
| | | |
| | | .menu-indicator { |
| | | width: 6rpx; |
| | | height: 22rpx; |
| | | border-radius: 10rpx; |
| | | background-color: $uni-color-primary; |
| | | } |
| | | :deep(.wd-card__footer) { |
| | | padding: 10rpx !important; |
| | | } |
| | | </style> |
| | |
| | | <template #title> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-xs">æ°æ®æ»è§</view> |
| | | <view class="ml-1 text-xs">设å¤ç®¡ç</view> |
| | | </view> |
| | | </template> |
| | | <wd-grid :column="4"> |
| | | <wd-grid-item use-slot class="flex justify-center items-center"> |
| | | <image class="slot-img text-center" src="/static/menu/menu2.png" /> |
| | | <text>12</text> |
| | | </wd-grid-item> |
| | | <wd-grid-item use-slot class="flex justify-center items-center"> |
| | | <image class="slot-img text-center" src="/static/menu/menu2.png" /> |
| | | <text>12</text> |
| | | </wd-grid-item> |
| | | <wd-grid-item use-slot class="flex justify-center items-center"> |
| | | <image class="slot-img text-center" src="/static/menu/menu2.png" /> |
| | | <text>12</text> |
| | | </wd-grid-item> |
| | | <wd-grid-item use-slot is-dot class="flex justify-center items-center"> |
| | | <image class="slot-img text-center" src="/static/menu/menu2.png" /> |
| | | <text>12</text> |
| | | </wd-grid-item> |
| | | <wd-grid-item use-slot class="flex justify-center items-center"> |
| | | <image class="slot-img text-center" src="/static/menu/menu2.png" /> |
| | | <text>12</text> |
| | | </wd-grid-item> |
| | | <wd-grid-item use-slot class="flex justify-center items-center"> |
| | | <image class="slot-img text-center" src="/static/menu/menu2.png" /> |
| | | <text>12</text> |
| | | <wd-grid-item |
| | | use-slot |
| | | class="flex justify-center items-center" |
| | | v-for="(item, index) in equMenu" |
| | | @click.stop="goItemPage(item.path)" |
| | | > |
| | | <image class="slot-img text-center" :src="item.icon" /> |
| | | <text>{{ item.name }}</text> |
| | | </wd-grid-item> |
| | | </wd-grid> |
| | | </wd-card> |
| | |
| | | <template #title> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-xs">æ°æ®æ»è§</view> |
| | | <view class="ml-1 text-xs">设å¤ç¹æ£</view> |
| | | </view> |
| | | </template> |
| | | <wd-grid :column="4"> |
| | | <wd-grid-item |
| | | use-slot |
| | | class="flex justify-center items-center" |
| | | v-for="(item, index) in menuList" |
| | | v-for="(item, index) in inspectMenu" |
| | | :key="item.id" |
| | | @click.stop="goItemPage(item.path)" |
| | | > |
| | | <image class="slot-img text-center" :src="item.url" /> |
| | | <image class="slot-img text-center" :src="item.icon" /> |
| | | <text>{{ item.name }}</text> |
| | | </wd-grid-item> |
| | | </wd-grid> |
| | |
| | | console.error(menuList) |
| | | } |
| | | |
| | | const goItemPage = (path: string) => { |
| | | const url = `/${path}` |
| | | uni.navigateTo({ |
| | | url, |
| | | }) |
| | | } |
| | | |
| | | onLoad(() => { |
| | | // getAllMenus() |
| | | }) |
| | | |
| | | const menuList = reactive([ |
| | | const equMenu = reactive([ |
| | | { |
| | | id: 1, |
| | | name: 'æµè¯', |
| | | url: '/static/menu/menu1.png', |
| | | name: '设å¤ç®¡ç', |
| | | icon: '/static/menu/menu1.png', |
| | | path: 'pages/equ/equ-list', |
| | | } |
| | | ]) |
| | | |
| | | const inspectMenu = reactive([ |
| | | /* { |
| | | id: 0, |
| | | name: '设å¤ç¹æ£', |
| | | icon: '/static/menu/menu0.png', |
| | | path: 'pages/inspect/insp-add', |
| | | }, */ |
| | | { |
| | | id: 1, |
| | | name: 'ç¹æ£æ¦è§', |
| | | icon: '/static/menu/menu1.png', |
| | | path: 'pages/inspect/insp-st', |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: 'æµè¯', |
| | | url: '/static/menu/menu1.png', |
| | | name: 'ç¹æ£æ±æ»', |
| | | icon: '/static/menu/menu2.png', |
| | | path: 'pages/inspect/insp-st', |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: 'ç¹æ£è®°å½', |
| | | icon: '/static/menu/menu3.png', |
| | | path: 'pages/inspect/insp-record', |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: 'ç¹æ£è®¡å', |
| | | icon: '/static/menu/menu4.png', |
| | | path: 'pages/inspect/insp-add', |
| | | }, |
| | | ]) |
| | | |
| | | function handleUserInfo() { |
| | | getAllMenus() |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | border-radius: 8rpx; |
| | | margin-left: 4rpx; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'default', |
| | | style: { |
| | | navigationBarTitleText: '设å¤ç¹æ£', |
| | | }, |
| | | } |
| | | </route> |
| | | |
| | | <template> |
| | | <view class="bg-base"> |
| | | <wd-form ref="form" :model="model" :rules="rules"> |
| | | <wd-cell-group custom-class="group" title="设å¤ä¿¡æ¯" border> |
| | | <wd-input |
| | | @click.stop="handleSelectEqu" |
| | | label="设å¤åç§°" |
| | | label-width="200rpx" |
| | | prop="equId" |
| | | readonly |
| | | required |
| | | suffix-icon="arrow-right" |
| | | clearable |
| | | v-model="model.equId" |
| | | placeholder="è¯·éæ©è®¾å¤" |
| | | @clicksuffixicon="handleSelectEqu" |
| | | /> |
| | | <!-- <wd-picker |
| | | label="设å¤åç§°" |
| | | placeholder="请é设å¤" |
| | | label-width="200rpx" |
| | | prop="equId" |
| | | v-model="model.equId" |
| | | :columns="equList" |
| | | />--> |
| | | </wd-cell-group> |
| | | |
| | | <wd-cell-group custom-class="mt-2" title="ç¹æ£ä¿¡æ¯" border> |
| | | <wd-picker |
| | | label="ç¹æ£é¡¹" |
| | | placeholder="请éç¹æ£é¡¹" |
| | | label-width="200rpx" |
| | | prop="equId" |
| | | v-model="model.inspName" |
| | | :columns="equList" |
| | | /> |
| | | |
| | | <wd-input |
| | | label="ç¹æ£ç¼å·" |
| | | placeholder="请çæç¹æ£ç¼å·" |
| | | label-width="200rpx" |
| | | v-model="model.inspCode" |
| | | prop="inspCode" |
| | | > |
| | | <template #suffix> |
| | | <wd-button size="small" @click.stop="handleInspCode">çæ</wd-button> |
| | | </template> |
| | | </wd-input> |
| | | |
| | | <wd-textarea |
| | | label="ç¹æ£æè¿°" |
| | | label-width="200rpx" |
| | | type="textarea" |
| | | v-model="model.inspDesc" |
| | | auto-height |
| | | :maxlength="200" |
| | | show-word-limit |
| | | placeholder="请è¾å
¥ç¹æ£æè¿°" |
| | | clearable |
| | | prop="inspDesc" |
| | | /> |
| | | <wd-cell title="ç¹æ£å¾ç" title-width="200rpx" prop="fileList"> |
| | | <wd-upload |
| | | :auto-upload="false" |
| | | :file-list="model.fileList" |
| | | :action="VITE_UPLOAD_BASEURL" |
| | | @change="handleFileChange" |
| | | ></wd-upload> |
| | | </wd-cell> |
| | | |
| | | <wd-calendar |
| | | label="è®¡åæ¥æ" |
| | | label-width="200rpx" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | prop="planTime" |
| | | v-model="model.planTime" |
| | | /> |
| | | <wd-datetime-picker |
| | | label="ç¹æ£æ¶é´" |
| | | label-width="200rpx" |
| | | placeholder="è¯·éæ©æ¶é´" |
| | | prop="inspTime" |
| | | v-model="model.inspTime" |
| | | /> |
| | | </wd-cell-group> |
| | | |
| | | <view class="footer"> |
| | | <wd-button type="primary" size="large" @click="handleSubmit" block>æäº¤</wd-button> |
| | | </view> |
| | | </wd-form> |
| | | </view> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { reactive, ref } from 'vue' |
| | | import { FormRules } from 'wot-design-uni/components/wd-form/types' |
| | | import { getEnvBaseUploadUrl } from '@/utils' |
| | | |
| | | const VITE_UPLOAD_BASEURL = `${getEnvBaseUploadUrl()}` |
| | | |
| | | const form = ref() |
| | | const model = reactive<{ |
| | | equId: string |
| | | inspName: string |
| | | inspCode: string |
| | | inspDesc: string |
| | | planTime: null | number |
| | | inspTime: number | string |
| | | fileList: [] |
| | | }>({ |
| | | equId: '', |
| | | inspName: '', |
| | | inspCode: '', |
| | | inspDesc: '', |
| | | planTime: null, |
| | | inspTime: '', |
| | | fileList: [], |
| | | }) |
| | | const rules: FormRules = { |
| | | equId: [ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©è®¾å¤', |
| | | }, |
| | | ], |
| | | inspName: [ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©ç¹æ£é¡¹', |
| | | }, |
| | | ], |
| | | inspCode: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥ç¹æ£ç¼ç ', |
| | | }, |
| | | ], |
| | | inspDesc: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥ç¹æ£æè¿°', |
| | | }, |
| | | ], |
| | | fileList: [ |
| | | { |
| | | required: false, |
| | | message: '', |
| | | }, |
| | | ], |
| | | } |
| | | |
| | | const equList = ref<any[]>([ |
| | | { |
| | | value: '1', |
| | | label: '1#å¹²ç¥æº', |
| | | }, |
| | | { |
| | | value: '2', |
| | | label: '1#å¹²ç¥æº', |
| | | }, |
| | | ]) |
| | | |
| | | /** |
| | | * éæ©è®¾å¤ |
| | | */ |
| | | function handleSelectEqu() { |
| | | uni.navigateTo({ |
| | | url: '/pages/equ/equ-list', |
| | | events: { |
| | | // 为æå®äºä»¶æ·»å ä¸ä¸ªçå¬å¨ï¼è·å被æå¼é¡µé¢ä¼ éå°å½å页é¢çæ°æ® |
| | | selectEqu: function (data) { |
| | | console.log(data) |
| | | }, |
| | | }, |
| | | success: function (res) { |
| | | // éè¿eventChannelå被æå¼é¡µé¢ä¼ éæ°æ® |
| | | res.eventChannel.emit('handleSelectEqu', { data: 'ç¹æ£é¡µé¢éæ©è®¾å¤' }) |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * çæç¹æ£ç¼å· |
| | | */ |
| | | function handleInspCode() { |
| | | console.error('çæç¹æ£ç¼ç ') |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ ç¹æ£å¾ç |
| | | * @param fileList |
| | | */ |
| | | function handleFileChange({ fileList }) { |
| | | model.fileList = fileList |
| | | } |
| | | |
| | | function handleSubmit() { |
| | | form.value |
| | | .validate() |
| | | .then(({ valid, errors }) => { |
| | | console.log(valid) |
| | | console.log(errors) |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error, 'error') |
| | | }) |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .footer { |
| | | background: white; |
| | | padding: 60rpx 42rpx; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5"> |
| | | { |
| | | style: { |
| | | navigationBarTitleText: 'ç¹æ£è®°å½', |
| | | navigationStyle: 'custom', |
| | | navigationBarBackgroundColor: '#4D80F0', |
| | | }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> |
| | | <template #top> |
| | | <wd-navbar |
| | | title="ç¹æ£è®°å½" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | right-text="æäº¤" |
| | | @click-right="handleClickRight" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | ></wd-navbar> |
| | | |
| | | <wd-card type="rectangle"> |
| | | <template #title> |
| | | <view class="flex justify-between"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-sm align-center">{{ inspSt.equName }}</view> |
| | | <view class="text-color-gray ml-2 text-mini">{{ inspSt.assetNo }}</view> |
| | | </view> |
| | | |
| | | <view class="flex items-center"> |
| | | <text class="text-color-gray text-mini">{{ inspSt.planTimeStr }}</text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[100rpx]" items-center> |
| | | <image class="slot-img text-center" src="/static/images/camera.png" /> |
| | | <view class="flex-1"> |
| | | <view class="text-color-gray text-xs mt-1 flex"> |
| | | <text class="mr-3">ç¹æ£æ»æ°: {{ dataCount }}</text> |
| | | | |
| | | <text class="mx-3">å·²ç¹æ£: {{ checkCount }}</text> |
| | | | |
| | | <text class="ml-3">æªç¹æ£: {{ dataCount - checkCount }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text class="mr-3">æ£å¸¸: {{ normalNum }}</text> |
| | | | |
| | | <text class="mx-3">å¼å¸¸: {{ abNormalNum }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text>ç¶æï¼</text> |
| | | <template v-if="dataCount > 0 && dataCount === checkCount"> |
| | | <wd-icon class="icon-color-success" name="check-outline" size="40rpx"></wd-icon> |
| | | <text class="ml-1">已宿</text> |
| | | </template> |
| | | <template v-else> |
| | | <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon> |
| | | <text class="ml-1">è¿è¡ä¸</text> |
| | | </template> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </wd-card> |
| | | </template> |
| | | |
| | | <view class="bg-base"> |
| | | <view class="w-full h-[24rpx]"></view> |
| | | <wd-cell> |
| | | <template #title> |
| | | <text class="text-color-gray">ç¹æ£é¡¹</text> |
| | | </template> |
| | | <wd-button size="small" type="text" @click.stop="toggleCollapse"> |
| | | {{ isAllExpanded ? 'å
¨é¨æå ' : 'å
¨é¨å±å¼' }} |
| | | </wd-button> |
| | | </wd-cell> |
| | | <wd-collapse v-model="collSelects" title="ç¹æ£é¡¹" ref="collapseRef"> |
| | | <wd-collapse-item :name="item.id" v-for="(item, index) in dataList"> |
| | | <template #title="{ expanded, disabled, isFirst }"> |
| | | <view class="flex justify-between"> |
| | | <view class="flex justify-center items-center"> |
| | | <text class="text-sm">{{ item.inspName }}</text> |
| | | </view> |
| | | |
| | | <view class="flex items-center"> |
| | | <wd-radio-group |
| | | v-model="item.inspResult" |
| | | inline |
| | | shape="dot" |
| | | @change="inspResultClick(item)" |
| | | > |
| | | <wd-radio value="1">æ£å¸¸</wd-radio> |
| | | <wd-radio value="2">å¼å¸¸</wd-radio> |
| | | </wd-radio-group> |
| | | <wd-icon |
| | | v-if="expanded" |
| | | name="arrow-up" |
| | | size="30rpx" |
| | | class="icon-color-gray" |
| | | ></wd-icon> |
| | | <wd-icon v-else name="arrow-down" size="30rpx" class="icon-color-gray"></wd-icon> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="text-color-gray text-xs flex justify-between"> |
| | | <text class="mr-3">ç¹æ£äºº: {{ item.inspUserName }}</text> |
| | | <text class="mx-3">ç¹æ£æ¶é´: {{ item.inspTime }}</text> |
| | | </view> |
| | | </wd-collapse-item> |
| | | </wd-collapse> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store' |
| | | import { getInspStRecordList, updateInspRecord, updateInspRecordBatch } from '@/service/inspect' |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import type { CollapseInstance } from 'wot-design-uni/components/wd-collapse/types' |
| | | const message = useMessage() |
| | | const toast = useToast() |
| | | |
| | | const collapseRef = ref<CollapseInstance>() |
| | | const isAllExpanded = ref(false) |
| | | |
| | | // å®ä¹æ¥å£ |
| | | interface QueryParams { |
| | | pageNum: number |
| | | pageSize: number |
| | | inspCode: string |
| | | status?: string |
| | | } |
| | | |
| | | interface InspSt { |
| | | inspCode: string |
| | | equName: string |
| | | assetNo: string |
| | | planTimeStr?: string |
| | | } |
| | | |
| | | const dataChange = ref(false) |
| | | |
| | | const userStore = useUserStore() |
| | | |
| | | const collSelects = ref<string[]>([]) |
| | | |
| | | // ç¹æ£æ±æ»æ°æ®(ä¸ä¸ªé¡µé¢ä¼ å¼) |
| | | const inspSt = reactive<InspSt>({ |
| | | inspCode: '', |
| | | equName: '', |
| | | assetNo: '', |
| | | planTimeStr: '', |
| | | }) |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | // è¿éçpageNoåpageSizeä¼èªå¨è®¡ç®å¥½ï¼ç´æ¥ä¼ ç»æå¡å¨å³å¯ |
| | | // è¿éç请æ±åªæ¯æ¼ç¤ºï¼è¯·æ¿æ¢æèªå·±ç项ç®çç½ç»è¯·æ±ï¼å¹¶å¨ç½ç»è¯·æ±åè°ä¸éè¿paging.value.complete(请æ±åæ¥çæ°ç»)å°è¯·æ±ç»æä¼ ç»z-paging |
| | | const params: QueryParams = { |
| | | pageNum, |
| | | pageSize, |
| | | inspCode: inspSt.inspCode, |
| | | } |
| | | |
| | | getInspStRecordList(params) |
| | | .then((res: any) => { |
| | | // 请å¿å¨ç½ç»è¯·æ±åè°ä¸ç»dataListèµå¼ï¼ï¼åªéè¦è°ç¨completeå°±å¯ä»¥äº |
| | | paging.value.complete(res.rows) |
| | | }) |
| | | .catch((res) => { |
| | | // å¦æè¯·æ±å¤±è´¥åpaging.value.complete(false)ï¼ä¼èªå¨å±ç¤ºéè¯¯é¡µé¢ |
| | | // 注æï¼æ¯æ¬¡é½éè¦å¨catchä¸åè¿å¥è¯å¾éº»ç¦ï¼z-pagingæä¾äºæ¹æ¡å¯ä»¥å
¨å±ç»ä¸å¤ç |
| | | // å¨åºå±çç½ç»è¯·æ±æåºå¼å¸¸æ¶ï¼åuni.$emit('z-paging-error-emit');å³å¯ |
| | | paging.value.complete(false) |
| | | }) |
| | | } |
| | | |
| | | function inspResultClick(item: any) { |
| | | // userStore?.userInfo?.realName |
| | | } |
| | | |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | function handleClickRight() { |
| | | handleConfirm() |
| | | } |
| | | |
| | | const toggleCollapse = () => { |
| | | isAllExpanded.value = !isAllExpanded.value |
| | | collapseRef.value.toggleAll(isAllExpanded.value) |
| | | } |
| | | |
| | | function handleConfirm() { |
| | | if (!dataChange.value) { |
| | | message.alert('请æä½åæäº¤!') |
| | | return false |
| | | } |
| | | message |
| | | .confirm({ |
| | | msg: 'ç¡®å®æäº¤ï¼', |
| | | title: 'æç¤º', |
| | | beforeConfirm: ({ resolve }) => { |
| | | updateData(resolve) |
| | | }, |
| | | }) |
| | | .then(() => {}) |
| | | .catch((error) => { |
| | | console.log(error) |
| | | }) |
| | | } |
| | | |
| | | function updateData(resolve: any) { |
| | | const params = { |
| | | inspRecordList: dataList.value, |
| | | } |
| | | updateInspRecordBatch(params) |
| | | .then((res: any) => { |
| | | paging.value.reload() |
| | | resolve(true) |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * ç¹æ£è®°å½æ¡ç®ç¹å»äºä»¶ |
| | | * @param item |
| | | */ |
| | | function itemClick(item: any) {} |
| | | |
| | | watch( |
| | | () => [...dataList.value], // ä½¿ç¨æ©å±è¿ç®ç¬¦åå»ºæ°æ°ç»ä»¥è§¦åçå¬ |
| | | (newVal, oldVal) => { |
| | | if (oldVal.length > 0) { |
| | | dataChange.value = true |
| | | } |
| | | }, |
| | | { deep: true }, |
| | | ) |
| | | onLoad((options) => { |
| | | inspSt.inspCode = options.inspCode |
| | | inspSt.equName = options.equName |
| | | inspSt.assetNo = options.assetNo |
| | | inspSt.planTimeStr = options.planTimeStr |
| | | }) |
| | | |
| | | const dataCount = computed(() => dataList.value.length) |
| | | const checkCount = computed(() => dataList.value.filter((item) => item.status === '1').length) |
| | | const normalNum = computed(() => dataList.value.filter((item) => item.inspResult === '1').length) |
| | | const abNormalNum = computed(() => dataList.value.filter((item) => item.inspResult === '2').length) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .menu-title-box { |
| | | height: 30rpx; |
| | | line-height: 30rpx; |
| | | } |
| | | |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | margin-right: 24rpx; |
| | | } |
| | | .text-mini { |
| | | font-size: 22rpx; |
| | | } |
| | | |
| | | .menu-indicator { |
| | | width: 6rpx; |
| | | height: 22rpx; |
| | | border-radius: 10rpx; |
| | | background-color: $uni-color-primary; |
| | | } |
| | | :deep(.wd-card__footer) { |
| | | padding: 10rpx !important; |
| | | } |
| | | |
| | | .col-title-box { |
| | | } |
| | | .bg-primary { |
| | | background: $uni-color-primary; |
| | | } |
| | | :deep(.wd-navbar__text) { |
| | | font-size: 26rpx; |
| | | color: white; |
| | | } |
| | | :deep(.wd-icon-arrow-left:before), |
| | | :deep(.wd-navbar__title) { |
| | | color: white; |
| | | font-weight: 0; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'default', |
| | | style: { |
| | | navigationBarTitleText: 'ç¹æ£æ±æ»', |
| | | }, |
| | | } |
| | | </route> |
| | | |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> |
| | | <template #top> |
| | | <wd-drop-menu> |
| | | <wd-drop-menu-item v-model="viewMode" :options="viewModeList" @change="handleViewMode" /> |
| | | <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" /> |
| | | </wd-drop-menu> |
| | | <wd-divider></wd-divider> |
| | | </template> |
| | | <view class="bg-base"> |
| | | <view class="w-full h-[24rpx]"></view> |
| | | <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id"> |
| | | <template #title> |
| | | <view class="flex justify-between"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-sm align-center">{{ item.equName }}</view> |
| | | <view class="text-color-gray ml-2 text-mini">{{ item.assetNo }}</view> |
| | | </view> |
| | | |
| | | <view class="flex items-center"> |
| | | <text class="text-color-gray text-mini">{{ item.planTimeStr }}</text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[100rpx]" items-center> |
| | | <image class="slot-img text-center" src="/static/images/camera.png" /> |
| | | <view class="flex-1"> |
| | | <view class="text-color-gray text-xs mt-1 flex"> |
| | | <text class="mr-3">ç¹æ£æ»æ°: {{ item.recordCount }}</text> |
| | | | |
| | | <text class="mx-3">å·²ç¹æ£: {{ item.checkCount }}</text> |
| | | | |
| | | <text class="ml-3">æªç¹æ£: {{ item.unCheckCount }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text class="mr-3">æ£å¸¸: {{ item.normalNum }}</text> |
| | | | |
| | | <text class="mx-3">å¼å¸¸: {{ item.abNormalNum }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text>ç¶æï¼</text> |
| | | <template v-if="item.recordCount === item.checkCount"> |
| | | <wd-icon class="icon-color-success" name="check-outline" size="40rpx"></wd-icon> |
| | | <text class="ml-1">已宿</text> |
| | | </template> |
| | | <template v-else> |
| | | <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon> |
| | | <text class="ml-1">è¿è¡ä¸</text> |
| | | </template> |
| | | </view> |
| | | </view> |
| | | <wd-button size="small" icon="edit-outline" @click.stop="itemClick(item)">æç»</wd-button> |
| | | </view> |
| | | </wd-card> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { getInspStList } from '@/service/inspect' |
| | | |
| | | const viewMode = ref<string>('Day') |
| | | const equName = ref<string>('ææè®¾å¤') |
| | | |
| | | const viewModeList = ref<Record<string, any>[]>([ |
| | | { label: 'æ¥è§å¾', value: 'Day' }, |
| | | { label: 'æè§å¾', value: 'Month' }, |
| | | ]) |
| | | const equList = ref<Record<string, any>[]>([{ label: 'ææè®¾å¤', value: 'ææè®¾å¤' }]) |
| | | function handleViewMode({ value }) { |
| | | console.log(value) |
| | | } |
| | | function handleEquName({ value }) { |
| | | console.log(value) |
| | | } |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | // è¿éçpageNoåpageSizeä¼èªå¨è®¡ç®å¥½ï¼ç´æ¥ä¼ ç»æå¡å¨å³å¯ |
| | | // è¿éç请æ±åªæ¯æ¼ç¤ºï¼è¯·æ¿æ¢æèªå·±ç项ç®çç½ç»è¯·æ±ï¼å¹¶å¨ç½ç»è¯·æ±åè°ä¸éè¿paging.value.complete(请æ±åæ¥çæ°ç»)å°è¯·æ±ç»æä¼ ç»z-paging |
| | | getInspStList({ pageNum, pageSize }) |
| | | .then((res: any) => { |
| | | // 请å¿å¨ç½ç»è¯·æ±åè°ä¸ç»dataListèµå¼ï¼ï¼åªéè¦è°ç¨completeå°±å¯ä»¥äº |
| | | console.log(res) |
| | | paging.value.complete(res.rows) |
| | | }) |
| | | .catch((res) => { |
| | | // å¦æè¯·æ±å¤±è´¥åpaging.value.complete(false)ï¼ä¼èªå¨å±ç¤ºéè¯¯é¡µé¢ |
| | | // 注æï¼æ¯æ¬¡é½éè¦å¨catchä¸åè¿å¥è¯å¾éº»ç¦ï¼z-pagingæä¾äºæ¹æ¡å¯ä»¥å
¨å±ç»ä¸å¤ç |
| | | // å¨åºå±çç½ç»è¯·æ±æåºå¼å¸¸æ¶ï¼åuni.$emit('z-paging-error-emit');å³å¯ |
| | | paging.value.complete(false) |
| | | }) |
| | | } |
| | | |
| | | function itemClick(item) { |
| | | const inspCode = `${item.equId}_${item.planTime}_${viewMode.value}` |
| | | uni.navigateTo({ |
| | | url: `/pages/inspect/insp-record?inspCode=${inspCode}&equName=${item.equName}&assetNo=${item.assetNo}&planTimeStr=${item.planTimeStr}`, |
| | | }) |
| | | } |
| | | |
| | | onLoad(() => { |
| | | queryList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .menu-title-box { |
| | | } |
| | | |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | margin-right: 24rpx; |
| | | } |
| | | .statu-img { |
| | | width: 60rpx; |
| | | height: 40rpx; |
| | | } |
| | | .text-mini { |
| | | font-size: 22rpx; |
| | | } |
| | | |
| | | .menu-indicator { |
| | | width: 6rpx; |
| | | height: 26rpx; |
| | | border-radius: 10rpx; |
| | | background-color: $uni-color-primary; |
| | | } |
| | | :deep(.wd-card__footer) { |
| | | padding: 10rpx !important; |
| | | } |
| | | :deep(.wd-card__title-content) { |
| | | padding: 24rpx 0 !important; |
| | | } |
| | | </style> |
| | |
| | | /> |
| | | </wd-cell-group> |
| | | <view class="footer"> |
| | | <view class="w-full text-end"> |
| | | <wd-checkbox v-model="rember" shape="square" @change="handleChange"> |
| | | è®°ä½å¯ç |
| | | <view> |
| | | <wd-checkbox v-model="rember" @change="handleChange"> |
| | | <text class="rember-text">è®°ä½å¯ç </text> |
| | | </wd-checkbox> |
| | | </view> |
| | | <wd-button class="mt-6" type="primary" size="large" @click="handleSubmit" block> |
| | | æäº¤ |
| | | </wd-button> |
| | | |
| | | <view class="copyright-info"> |
| | | <text> |
| | | 䏿µ·å
°å®ä¼ æç§æè¡ä»½æéå
¬å¸ |
| | | </text> |
| | | |
| | | </view> |
| | | </view> |
| | | </wd-form> |
| | | </template> |
| | |
| | | |
| | | <style scoped lang="scss"> |
| | | .footer { |
| | | padding: 12px; |
| | | padding: 24rpx; |
| | | } |
| | | .rember-text { |
| | | font-size: 24rpx; |
| | | color: $uni-text-color-grey; |
| | | } |
| | | |
| | | .copyright-info { |
| | | position: absolute; |
| | | bottom: 20rpx; |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | color: $uni-text-color-disable; |
| | | font-size: 24rpx; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface EquVO { |
| | | /** |
| | | * |
| | | */ |
| | | equId: number | string; |
| | | |
| | | /** |
| | | * èµäº§ç¼å· |
| | | */ |
| | | assetNo: string; |
| | | /** |
| | | * 设å¤ç¼ç |
| | | */ |
| | | equCode: string; |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | |
| | | */ |
| | | equName: string; |
| | | /** |
| | | * 设å¤ç±»å |
| | | |
| | | */ |
| | | equTypeName: string; |
| | | |
| | | /** |
| | | * åå· |
| | | */ |
| | | modelNo: string; |
| | | |
| | | /** |
| | | * å¶é å |
| | | */ |
| | | madeIn: string; |
| | | |
| | | /** |
| | | * é¢åº¦åç |
| | | */ |
| | | ratedPower: number; |
| | | |
| | | /** |
| | | * éçä¿¡æ¯ |
| | | */ |
| | | plateInfo: string; |
| | | |
| | | /** |
| | | * éè´æ¥æ |
| | | */ |
| | | purchaseDate: string; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | status: string; |
| | | |
| | | /** |
| | | * æå¨åºæ |
| | | */ |
| | | location: string; |
| | | |
| | | /** |
| | | * 使ç¨é¨é¨ï¼å
³èidï¼ |
| | | */ |
| | | deptUsed: number; |
| | | /** |
| | | * 使ç¨é¨é¨åç§° |
| | | */ |
| | | deptName: number; |
| | | |
| | | /** |
| | | * 责任人(å
³èid) |
| | | */ |
| | | respPerson: number; |
| | | /** |
| | | * 责任人 |
| | | */ |
| | | respPersonName: string; |
| | | |
| | | /** |
| | | * èç³»çµè¯ |
| | | */ |
| | | contactPhone: string; |
| | | |
| | | /** |
| | | * æ£å¼ä½¿ç¨æ¥æ |
| | | */ |
| | | deployDate: string; |
| | | |
| | | /** |
| | | * å¼å§è¯ç¨æ¥æ |
| | | */ |
| | | trialDate: string; |
| | | |
| | | /** |
| | | * 计åéªæ¶æ¥æ |
| | | */ |
| | | planAcceptDate: string; |
| | | |
| | | /** |
| | | * å®é
éªæ¶æ¥æ |
| | | */ |
| | | actualAcceptDate: string; |
| | | |
| | | /** |
| | | * 导å
¥ç¶æï¼åå
¸ï¼ |
| | | */ |
| | | importStatus: number; |
| | | |
| | | /** |
| | | * çç¹æ å¿ |
| | | */ |
| | | inventoryFlag: number; |
| | | |
| | | /** |
| | | * 䏿¬¡çç¹æ¥æ |
| | | */ |
| | | inventoryDate: string; |
| | | |
| | | /** |
| | | * 使ç¨å¹´é |
| | | */ |
| | | serviceLife: number; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { http } from '@/utils/http' |
| | | import type { EquVO } from './equ.d' |
| | | |
| | | /** |
| | | * 设å¤å表 |
| | | */ |
| | | export const getEquList = (params: any) => { |
| | | return http.get<EquVO[]>('/eims/equ/list', params) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * ç¹æ£æ±æ» |
| | | */ |
| | | export interface InspectStVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | title: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | equId: number | string; |
| | | status: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | planTime: string; |
| | | |
| | | /** |
| | | * ä¿å
»äºº |
| | | */ |
| | | maintUser: number; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | verifyUser: number; |
| | | verifyTime: string; |
| | | |
| | | /** |
| | | * ç¹è®°äºé¡¹ |
| | | */ |
| | | specialNote: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç¹æ£è®°å½ |
| | | */ |
| | | export interface InspectRecordVO { |
| | | /** |
| | | * id |
| | | */ |
| | | id: string | number; |
| | | |
| | | /** |
| | | * 设å¤di |
| | | */ |
| | | equId: string | number; |
| | | /** |
| | | * 设å¤åç§° |
| | | |
| | | */ |
| | | equName: string; |
| | | /** |
| | | * èµäº§ç¼å· |
| | | |
| | | */ |
| | | assteNo: string; |
| | | |
| | | /** |
| | | * ç¹æ£åç§° |
| | | */ |
| | | inspName: string; |
| | | |
| | | /** |
| | | * ç¹æ£æè¿° |
| | | */ |
| | | inspDesc: string; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | status: string; |
| | | |
| | | /** |
| | | * ç¹æ£ç¼ç |
| | | */ |
| | | inspCode: string; |
| | | |
| | | /** |
| | | * å¼è®°å½æ¹å¼ï¼åå
¸ï¼ |
| | | */ |
| | | recordMode: string; |
| | | |
| | | /** |
| | | * åèå¼ |
| | | */ |
| | | referenceValue: string; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | upperLimit: string; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | lowLimit: string; |
| | | |
| | | /** |
| | | * æ£æ¥å¼ |
| | | */ |
| | | checkValue: string; |
| | | |
| | | /** |
| | | * ç¹æ£ç»æï¼åå
¸ï¼ |
| | | */ |
| | | inspResult: string; |
| | | |
| | | /** |
| | | * ç¹æ£æ¶é´ |
| | | */ |
| | | inspTime: string; |
| | | |
| | | /** |
| | | * 计åç¹æ£æ¥æ |
| | | */ |
| | | planTime: string; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | verifyUser: number; |
| | | |
| | | /** |
| | | * 计åid |
| | | */ |
| | | planId: string | number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { http } from '@/utils/http' |
| | | import type { InspectStVO, InspectRecordVO } from './inspect.d' |
| | | |
| | | /** |
| | | * ç¹æ£æ±æ»å表 |
| | | */ |
| | | export const getInspStList = (params: any) => { |
| | | params.viewMode = 'Day' |
| | | return http.get<InspectStVO[]>('/eims/inspectSt/list', params) |
| | | } |
| | | |
| | | /** |
| | | * ç¹æ£æ±æ»å表ä¸ç¹æ£è®°å½å表 |
| | | */ |
| | | export const getInspStRecordList = (params: any) => { |
| | | return http.get<InspectRecordVO[]>('/eims/inspRecord/stList', params) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ç¹æ£è®°å½ |
| | | * @param data |
| | | */ |
| | | export const updateInspRecord = (data: any) => { |
| | | return http.post<void>('/eims/inspRecord', data) |
| | | } |
| | | |
| | | export const updateInspRecordBatch = (data: any) => { |
| | | return http.put<void>('/eims/inspRecord/editBatch', data) |
| | | } |
| | |
| | | .icon-color-base { |
| | | color: $uni-color-primary; |
| | | } |
| | | .icon-color-gray { |
| | | color: $uni-text-color-grey; |
| | | } |
| | | .icon-color-success { |
| | | color: $uni-color-success; |
| | | } |
| | | |
| | | .bg-base { |
| | | background: $uni-bg-color-grey; |
| | | } |
| | | |
| | | .bg-primary { |
| | | background: $uni-color-primary; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | const useCssVars: typeof import('vue')['useCssVars'] |
| | | const useId: typeof import('vue')['useId'] |
| | | const useModel: typeof import('vue')['useModel'] |
| | | const useNavbarWeixin: (typeof import('../hooks/useNavbarWeixin'))['default'] |
| | | const useRequest: typeof import('../hooks/useRequest')['default'] |
| | | const useSlots: typeof import('vue')['useSlots'] |
| | | const useTemplateRef: typeof import('vue')['useTemplateRef'] |
| | | const useUpload: typeof import('../hooks/useUpload')['default'] |
| | | const useUpload2: typeof import('../hooks/useUpload2')['default'] |
| | | const watch: typeof import('vue')['watch'] |
| | | const watchEffect: typeof import('vue')['watchEffect'] |
| | | const watchPostEffect: typeof import('vue')['watchPostEffect'] |
| | |
| | | |
| | | interface NavigateToOptions { |
| | | url: "/pages/home/index" | |
| | | "/pages/equ/equ-list" | |
| | | "/pages/equ/index" | |
| | | "/pages/inspect/insp-add" | |
| | | "/pages/inspect/insp-record" | |
| | | "/pages/inspect/insp-st" | |
| | | "/pages/login/index" | |
| | | "/pages/my/index" | |
| | | "/pages/spare/index"; |
| | |
| | | import { useUserStore, useAccessStore } from '@/store' |
| | | |
| | | export const http = <T>(options: CustomRequestOptions) => { |
| | | uni.showLoading({ |
| | | title: 'å è½½ä¸', |
| | | }) |
| | | // 1. è¿å Promise 对象 |
| | | return new Promise<IResData<T>>((resolve, reject) => { |
| | | uni.request({ |
| | |
| | | // #endif |
| | | // ååºæå |
| | | success(res) { |
| | | uni.hideLoading() |
| | | // ç¶æç 2xxï¼åè axios ç设计 |
| | | if (res.statusCode >= 200 && res.statusCode < 300) { |
| | | // 2.1 æåæ ¸å¿æ°æ® res.data |
| | | if ((res.data as IResData<T>).code === 200) { |
| | | resolve(((res.data as IResData<T>).data || res.data) as IResData<T>) |
| | | } else if ((res.data as IResData<T>).code === 401) { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: 'ç»å½è¶
æ¶ï¼è¯·éæ°ç»å½ï¼', |
| | | }) |
| | | // 401é误 -> æ¸
çç¨æ·ä¿¡æ¯ï¼è·³è½¬å°ç»å½é¡µ |
| | | useAccessStore().clearAccessInfo() |
| | | useUserStore().clearUserInfo() |
| | | const loginRoute = '/pages/login/index' |
| | | // éæ°ç»å½åè¿åé¡µé¢ |
| | | const url = '/pages/home/index' |
| | | const redirectRoute = `${loginRoute}?redirect=${encodeURIComponent(url)}` |
| | | uni.navigateTo({ url: redirectRoute }) |
| | | reject(res) |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | |
| | | title: 'ç½ç»éè¯¯ï¼æ¢ä¸ªç½ç»è¯è¯', |
| | | }) |
| | | reject(err) |
| | | uni.hideLoading() |
| | | }, |
| | | }) |
| | | }) |
| | |
| | | }) |
| | | } |
| | | |
| | | export const httpPut = <T>( |
| | | url: string, |
| | | data?: Record<string, any>, |
| | | query?: Record<string, any>, |
| | | ) => { |
| | | return http<T>({ |
| | | url, |
| | | query, |
| | | data, |
| | | method: 'PUT', |
| | | }) |
| | | } |
| | | |
| | | http.get = httpGet |
| | | http.post = httpPost |
| | | http.put = httpPut |