Browse Source

设备管理及首页CSS

master
z_yu 3 years ago
parent
commit
5018cd6b6d
  1. 17
      src/api/storeManage/deviceManage/device.js
  2. 106
      src/views/dashboard/PanelGroup.vue
  3. 10
      src/views/home.vue
  4. 2
      src/views/storeManage/deviceManage/module/bindParams.vue
  5. 39
      src/views/storeManage/deviceManage/module/deviceDetail.vue

17
src/api/storeManage/deviceManage/device.js

@ -16,13 +16,10 @@ export function add(data) {
})
}
export function del(ids) {
const data = {
id: ids[0]
}
export function del(data) {
return request({
url: 'api/desecabinet/delete',
method: 'post',
url: '/api/device/delete',
method: 'delete',
data
})
}
@ -43,6 +40,14 @@ export function getDeviceType() {
})
}
export function getDeviceById(params) {
return request({
url: 'api/device/state',
method: 'get',
params
})
}
function getUrl(data, optTYpe) {
let url = 'api/desecabinet/'
if (data.deviceTypeId.name === '密集架') {

106
src/views/dashboard/PanelGroup.vue

@ -1,9 +1,9 @@
<template>
<el-row :gutter="40" class="panel-group">
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('newVisitis')">
<el-row :gutter="20" class="panel-group" type="flex" justify="space-between">
<el-col class="card-panel-col">
<div class="card-panel danganzongliang" @click="handleSetLineChartData('newVisitis')">
<div class="card-panel-icon-wrapper icon-people">
<svg-icon icon-class="peoples" class-name="card-panel-icon" />
<svg-icon icon-class="danganzongliang" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
@ -13,10 +13,10 @@
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('messages')">
<el-col class="card-panel-col">
<div class="card-panel danganhezongliang" @click="handleSetLineChartData('messages')">
<div class="card-panel-icon-wrapper icon-message">
<svg-icon icon-class="message" class-name="card-panel-icon" />
<svg-icon icon-class="danganhezongliang" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
@ -26,10 +26,10 @@
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('purchases')">
<el-col class="card-panel-col">
<div class="card-panel quanbushebei" @click="handleSetLineChartData('purchases')">
<div class="card-panel-icon-wrapper icon-money">
<svg-icon icon-class="money" class-name="card-panel-icon" />
<svg-icon icon-class="quanbushebei" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
@ -39,10 +39,23 @@
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('shoppings')">
<el-col class="card-panel-col">
<div class="card-panel zaixianshebei" @click="handleSetLineChartData('shoppings')">
<div class="card-panel-icon-wrapper icon-shopping">
<svg-icon icon-class="shopping" class-name="card-panel-icon" />
<svg-icon icon-class="zaixianshebei" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
Shoppings
</div>
<count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num" />
</div>
</div>
</el-col>
<el-col class="card-panel-col">
<div class="card-panel lixianshebei" @click="handleSetLineChartData('shoppings')">
<div class="card-panel-icon-wrapper icon-shopping">
<svg-icon icon-class="lixianshebei" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
@ -72,50 +85,53 @@ export default {
<style lang="scss" scoped>
.panel-group {
margin-top: 18px;
.card-panel-col {
margin-bottom: 32px;
}
.card-panel {
height: 108px;
cursor: pointer;
height: 100px;
// height: 108px;
// cursor: pointer;
font-size: 12px;
position: relative;
overflow: hidden;
color: #666;
background: #fff;
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
border-color: rgba(0, 0, 0, .05);
&:hover {
.card-panel-icon-wrapper {
color: #fff;
}
.icon-people {
background: #40c9c6;
}
.icon-message {
background: #36a3f7;
}
.icon-money {
background: #f4516c;
}
.icon-shopping {
background: #34bfa3
}
}
.icon-people {
color: #40c9c6;
// background: #fff;
background: linear-gradient(180deg, rgba(51,159,210,0.5000) 0%, rgba(56,158,225,0) 100%);
border-top: 2px #21AAE1 solid;
opacity: 0.86;
// box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
// border-color: rgba(0, 0, 0, .05);
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
// }
// .icon-people {
// background: #40c9c6;
// }
// .icon-message {
// background: #36a3f7;
// }
// .icon-money {
// background: #f4516c;
// }
// .icon-shopping {
// background: #34bfa3
// }
// }
.icon-danganzongliang {
color: #21AAE1;
}
.icon-message {
.icon-danganhezongliang {
color: #36a3f7;
}

10
src/views/home.vue

@ -1,7 +1,7 @@
<template>
<div class="dashboard-container">
<div class="dashboard-editor-container">
<github-corner class="github-corner" />
<!-- <github-corner class="github-corner" /> -->
<panel-group @handleSetLineChartData="handleSetLineChartData" />
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<line-chart :chart-data="lineChartData" />
@ -28,7 +28,7 @@
</template>
<script>
import GithubCorner from '@/components/GithubCorner'
// import GithubCorner from '@/components/GithubCorner'
import PanelGroup from './dashboard/PanelGroup'
import LineChart from './dashboard/LineChart'
import RadarChart from '@/components/Echarts/RadarChart'
@ -57,7 +57,7 @@ const lineChartData = {
export default {
name: 'Dashboard',
components: {
GithubCorner,
// GithubCorner,
PanelGroup,
LineChart,
RadarChart,
@ -79,8 +79,8 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard-editor-container {
padding: 32px;
background-color: rgb(240, 242, 245);
padding: 20px;
background-color: #031435;
position: relative;
.github-corner {

2
src/views/storeManage/deviceManage/module/bindParams.vue

@ -68,7 +68,7 @@ export default {
add() {
this.$refs.form.validate((valid) => {
if (valid) {
this.form.deviceInfoId = { id: this.deviceInfoId }
this.form.deviceInfoId = this.deviceInfoId
this.form.sequence = this.params.reduce((prev, cur) => { return { sequence: Math.max(prev.sequence, cur.sequence) } }, { sequence: 0 }).sequence + 1
crudMethod.add(this.form).then((res) => {
this.loading = true

39
src/views/storeManage/deviceManage/module/deviceDetail.vue

@ -187,8 +187,18 @@
<span v-else></span>
</template>
</el-table-column>
<el-table-column align="center" prop="dicExplain" label="绑定设备" width="100" />
<el-table-column align="center" prop="dicExplain" label="绑定参数" />
<el-table-column align="center" label="绑定设备" width="100">
<template slot-scope="scope">
<span v-if="scope.row.deviceSpecParamId && scope.row.deviceSpecParamId.macAddress !== null"> 已绑定 </span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column align="center" label="绑定参数" width="100">
<template slot-scope="scope">
<span v-if="scope.row.deviceSpecParamId && scope.row.deviceSpecParamId.paramId !== null"> 已绑定 </span>
<span v-else></span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
@ -220,7 +230,8 @@ export default {
reset: false,
download: false,
group: false
}
},
sort: ['sequence,asc']
})
]
},
@ -372,17 +383,24 @@ export default {
// this.needRefreshTree = true
// },
// null
// async
[CRUD.HOOK.beforeToEdit](crud, form) {
// if (form.deviceTypeId.name === '' || form.deviceTypeId.name === '') {
if (form.isLinkage === null) {
form.isLinkage = { stateType: 1, lend: false, borrow: false, inBound: false, outBound: false }
}
if (form.isCallback === null) {
form.isCallback = { stateType: 2, lend: false, borrow: false, inBound: false, outBound: false }
}
// if (form.isLinkage === null) {
// form.isLinkage = { stateType: 1, lend: false, borrow: false, inBound: false, outBound: false }
// }
// if (form.isCallback === null) {
// form.isCallback = { stateType: 2, lend: false, borrow: false, inBound: false, outBound: false }
// }
// }
// await
form.supplier = form.supplierId.id
this.selectedDeviceType = form.deviceTypeId.name
// crud.status.edit = CRUD.STATUS.PREPARED
// crud.getDataStatus(crud.getDataId(data)).edit = CRUD.STATUS.PREPARED
// callVmHook(crud, CRUD.HOOK.afterToEdit, crud.form)
// callVmHook(crud, CRUD.HOOK.afterToCU, crud.form)
return false
},
[CRUD.HOOK.beforeSubmit]() {
this.crud.form.storeroomId = this.storeroomId
@ -417,7 +435,8 @@ export default {
handleConfirm() {
this.deleteVisible = false
this.crud.delAllLoading = true
this.crud.doDelete(this.deleteData)
const data = this.deleteData.map(item => { return item.id })
this.crud.doDelete(data)
},
handleClose(done) {
this.deleteData = {}

Loading…
Cancel
Save