Browse Source

fix: 一些修改

master
wangqi 6 months ago
parent
commit
531e746565
  1. 7
      src/api/module/eam/device/storage.ts
  2. 1
      src/pages/deviceInfo/components/BasicInfo.vue
  3. 1
      src/pages/deviceInfo/components/DeliveryInfo.vue
  4. 6
      src/pages/deviceInfo/components/MaintainInfo.vue
  5. 189
      src/pages/deviceStorage/index.vue
  6. 7
      src/pages/deviceStorage/utils.ts
  7. 64
      src/pages/system/config/index.vue

7
src/api/module/eam/device/storage.ts

@ -22,3 +22,10 @@ export const getStorageOutByDeviceId = (deviceId: number) => @@ -22,3 +22,10 @@ export const getStorageOutByDeviceId = (deviceId: number) =>
method: 'get',
params: { deviceId },
})
export const getStorageOutPage = (params: PageParam) =>
eamServer({
url: `/out-storage/page`,
method: 'get',
params,
})

1
src/pages/deviceInfo/components/BasicInfo.vue

@ -1,5 +1,4 @@ @@ -1,5 +1,4 @@
<template>
{{ info?.status }}
<div class="device-basic-info-from">
<div class="from-input">
<div class="group-box">

1
src/pages/deviceInfo/components/DeliveryInfo.vue

@ -109,6 +109,7 @@ async function loadDeviceStorageInfo() { @@ -109,6 +109,7 @@ async function loadDeviceStorageInfo() {
if (!props.deviceId) return
const res = await getStorageOutByDeviceId(props.deviceId)
if (isResError(res)) return
debugger
for (const key of Object.keys(params.value)) {
params.value[key] = res.data[key] ?? ''
}

6
src/pages/deviceInfo/components/MaintainInfo.vue

@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
<el-date-picker
v-model="scope.row[col.prop]"
type="datetime"
placeholder="Select date and time"
placeholder="请选择维修时间"
/>
</template>
<template v-else>{{
@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
<FormItemSelect
style="height: 32px"
v-model="scope.row[col.prop]"
placeholder="请选择测试模板"
placeholder="请选择维修状态"
:options="maintainStatus"
keyTag="value"
labelTag="label"
@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
>
<template #default="scope">
<template v-if="scope.row.isEdit">
<el-input v-model="scope.row[col.prop]" />
<el-input v-model="scope.row[col.prop]" :placeholder="`请输入${col.label}`"/>
</template>
<template v-else>{{ scope.row[col.prop] }}</template>
</template>

189
src/pages/deviceStorage/index.vue

@ -0,0 +1,189 @@ @@ -0,0 +1,189 @@
<template>
<div class="storage-info-wrap">
<!-- <EdfsWrap class="storage-info-from-wrap">
<div class="from">
<div class="from-input">
<div class="from-row">
<div class="label">设备序列:</div>
<el-input
v-model="queryParams.number"
placeholder="请输入设备序列号"
clearable
@keyup.enter="handleQuery"
/>
</div>
<div class="from-row">
<div class="label">设备名称:</div>
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
@keyup.enter="handleQuery"
/>
</div>
<div class="from-row">
<div class="label">注册时段:</div>
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
</div>
<div class="btn-group">
<el-button @click="addDevice"><Icon icon="ep:plus" />添加设备</el-button>
<el-button @click="handleQuery"><Icon icon="ep:search" />搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button>
</div>
</div>
</div>
</EdfsWrap> -->
<EdfsWrap title="设备信息列表" class="storage-info-table">
<EdfsTable
class="table"
v-loading="loading"
:data="list"
:highlight-current-row="true"
:page-total="total"
:current-page="queryParams.pageNo"
:page-size="queryParams.pageSize"
row-class-name="row"
@pageCurrentChange="handleJump"
>
<template v-for="(col, idx) in tableCol" :key="idx">
<el-table-column
v-if="col.prop.endsWith('Time')"
:label="col.label"
:min-width="col.minWidth"
>
<template #default="scope">
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column
v-else
:prop="col.prop"
:label="col.label"
:min-width="col.minWidth"
/>
</template>
<el-table-column label="操作" width="190" align="center">
<template #default="scope">
<EdfsButton
link
type="success"
inner-text="添加维修信息"
@click="addMaintain(scope.row)"
/>
</template>
</el-table-column>
</EdfsTable>
</EdfsWrap>
</div>
</template>
<script setup lang="ts">
import dayjs from 'dayjs'
import EdfsWrap from '@/components/dashboard/Edfs-wrap.vue'
import EdfsTable from '@/components/dashboard/Edfs-table/index.vue'
import { tableCol } from './utils'
import { isResError } from '@/hooks/useMessage'
import { getStorageOutPage } from '@/api/module/eam/device/storage'
import { useRouter } from 'vue-router'
const router = useRouter()
const loading = ref(true)
const total = ref(0)
const list = ref<any>([])
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
// number: undefined,
// deviceName: undefined,
// status: undefined,
// code: undefined,
// createTime: [],
})
const getList = async () => {
loading.value = true
const res = await getStorageOutPage(queryParams)
if (!isResError(res)) {
list.value = res.data.list
total.value = res.data.total
}
loading.value = false
}
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
function handleJump(page: number) {
queryParams.pageNo = page
getList()
}
function addMaintain(row: any) {
router.push({
path: '/device/deviceOperation',
query: { action: 'update', type: 'maintain', id: row.deviceId },
})
}
onMounted(() => {
getList()
})
</script>
<style scoped lang="scss">
.storage-info-wrap {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
row-gap: 10px;
.storage-info-from-wrap {
height: auto;
width: 100%;
.from {
display: flex;
flex-direction: column;
justify-content: space-around;
height: 100%;
width: 100%;
.from-input {
display: flex;
width: 100%;
column-gap: 20px;
row-gap: 10px;
flex-wrap: wrap;
.from-row {
min-width: 270px;
display: flex;
align-items: center;
column-gap: 4px;
.label {
white-space: nowrap;
width: 70px;
color: var(--label-text);
}
}
}
}
}
.storage-info-table {
flex: 1;
.table {
height: 100%;
}
}
}
</style>

7
src/pages/deviceStorage/utils.ts

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
export const tableCol = [
{ label: '出库设备', prop: 'deviceId', minWidth: '12%' },
{ label: '客户', prop: 'customerId', minWidth: '10%' },
{ label: '出库价格', prop: 'price', minWidth: '10%' },
// { label: '出库单名称', prop: 'name', minWidth: '10%' },
{ label: '描述', prop: 'description', minWidth: '16%' },
]

64
src/pages/system/config/index.vue

@ -0,0 +1,64 @@ @@ -0,0 +1,64 @@
<template>
<div class="config-page-wrap">
<EdfsWrap title="系统常规配置" class="base">
<div class="config-item">
<div class="description">
<div class="title">开启文件存储</div>
<div class="desc">
开启文件存储后可支持上传固件文件请在开启前部署好文件存储服务
</div>
</div>
<div class="opt">
<el-switch
v-model="isEnableFileStorage"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="开启"
inactive-text="关闭"
/>
</div>
</div>
</EdfsWrap>
<EdfsWrap title="文件存储接入配置" class="file" v-if="isEnableFileStorage"></EdfsWrap>
</div>
</template>
<script setup lang="ts">
import EdfsWrap from '@/components/dashboard/Edfs-wrap.vue'
const isEnableFileStorage = ref(false)
</script>
<style scoped lang="scss">
.config-page-wrap {
display: flex;
width: 100%;
height: 100%;
column-gap: 10px;
.config-item {
display: flex;
align-items: center;
justify-content: space-between;
.description {
display: flex;
flex-direction: column;
.title {
font-size: 16px;
font-weight: 500;
color: var(--label-text);
}
.desc {
font-size: 14px;
color: var(--text-desc);
}
}
}
.base {
height: 100%;
}
.file {
height: 100%;
}
}
</style>
Loading…
Cancel
Save