Skip to content

Commit

Permalink
feat(cloudOperations): 工单巡检动态数据
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnwinterLiu committed Sep 22, 2022
1 parent 6ad884b commit 071750b
Show file tree
Hide file tree
Showing 12 changed files with 133 additions and 262 deletions.
Binary file added public/assets/images/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/api/System/filemanagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function getproductTree(params) {
// return query_object('MetaData', params)
}

// $)AT-=S?Z
//
export function list_dir(path) {
return request({
url: 'list_dir',
Expand Down
2 changes: 1 addition & 1 deletion src/dgiot/components/DgiotLogo/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class="title"
:class="{ 'hidden-xs-only': theme.layout === 'horizontal' }"
>
{{ name }}
<!-- {{ name }}-->
</span>
</router-link>
</div>
Expand Down
40 changes: 11 additions & 29 deletions src/dgiot/components/DgiotRoleTree/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
this.setCurrentDepartment(data)
const { access_token: sessionToken, expires_in } =
await departmentToken(data.name)
console.log(`部门:${data.name}\ntoken为${sessionToken}`)
// console.log(`部门:${data.name}\ntoken为${sessionToken}`)
// Cookies.set('departmentToken', access_token, {
// expires: new Date(new Date().getTime() + expires_in),
// })
Expand All @@ -284,25 +284,16 @@
// this._setToken(access_token)
const { name } = this.$route
await this.reloadRouter(name, this.$route)
console.groupCollapsed(
'%ctree handleNodeClick',
'color:#009a61; font-size: 28px; font-weight: 300'
)
dgiotlog
.getDgiotlog('src/dgiot/components/DgiotRoleTree/index.vue')
.info('DgiotRoleTree ->', data, checked)
console.groupEnd()
if (!this.firstChild)
this.$baseNotify(
this.$translateTitle('message.Department has been switched to') +
data.depname,
this.$translateTitle('message.Tips'),
'success',
'',
5000
)
// if (!this.firstChild)
// this.$baseNotify(
// this.$translateTitle('message.Department has been switched to') +
// data.depname,
// this.$translateTitle('message.Tips'),
// 'success',
// '',
// 5000
// )
} catch (error) {
dgiotlog.log(error)
this.$baseMessage(
this.$translateTitle('alert.Data request error') + `${error}`,
'error',
Expand All @@ -311,16 +302,7 @@
}
this.firstChild = false
},
handleCheckClick(data, checked) {
console.groupCollapsed(
'%ctree handleCheckClick',
'color:#009a61; font-size: 28px; font-weight: 300'
)
dgiotlog.log(data, checked, 'handleCheckClick')
dgiotlog.log(data)
dgiotlog.log(checked)
console.groupEnd()
},
handleCheckClick(data, checked) {},
filterNode(value, data) {
if (!value) return true
return data.label.includes(value)
Expand Down
1 change: 1 addition & 0 deletions src/i18n/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ export default {
'Processing records': '处理记录',
'Work order information': '工单信息',
'work process': '工作流程',
'inspection data': '巡检检查表',
'end time': '结束时间',
'start time': '开始时间',
'Ticket number': '工单编号',
Expand Down
15 changes: 4 additions & 11 deletions src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,11 @@ async function queryAllMsg(commit, dispatch, data, type) {
: hour < 18
? Vue.prototype.$translateTitle('route.下午好')
: Vue.prototype.$translateTitle('route.晚上好')
Vue.prototype.$baseNotify(title, `${thisTime}!`)
console.groupCollapsed(
'%c login promise.all log',
'color:#009a61; font-size: 28px; font-weight: 300'
)
console.info('login promise.all log ->')
console.log(promiseRes)
console.groupEnd()
// Vue.prototype.$baseNotify(title, `${thisTime}!`)
Cookies.set('handleRoute', 'true', { expires: 60 * 1000 * 30 })

if (type == 'jwt') {
// Cookies.set('jwtInfo', state, { expires: 1 })
console.log('jwt info', state)
window.addEventListener('message', function (e) {
const companyName = {
value: state.extendFields.companyName,
Expand All @@ -118,8 +110,9 @@ async function queryAllMsg(commit, dispatch, data, type) {
type: 'cookie',
time: moment().format('YYYY:MM:DD HH:mm:ss'),
}
e.source.postMessage(companyName, e.origin)
e.source.postMessage(userId, e.origin)
// console.log('fds = ', companyName, e.origin)
// e.source.postMessage(companyName, e.origin)
// e.source.postMessage(userId, e.origin)
})
// this.$router.push(this.handleRoute())
}
Expand Down
101 changes: 83 additions & 18 deletions src/views/CloudOT/maintenance/ChangeStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
<el-col :span="8">
<div class="grid-content bg-purple">
{{ $translateTitle('Maintenance.Ticket number') }} :
{{ detail.number }}
{{ form.number }}
</div>
</el-col>
<el-col :span="6">
<div class="grid-content bg-purple-light">
{{ $translateTitle('Maintenance.Ticket type') }} : {{ detail.type }}
{{ $translateTitle('Maintenance.Ticket type') }} : {{ form.type }}
</div>
</el-col>
<el-col :span="10">
<div class="grid-content bg-purple">
{{ $translateTitle('cloudTest.Creation time') }} :
{{ $moment(detail.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
{{ $moment(form.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
</div>
</el-col>
</el-row>
Expand Down Expand Up @@ -172,15 +172,13 @@
list-type="picture-card"
>
<i slot="default" class="el-icon-plus"></i>
<div v-for="(item, index) in form.info.photo" :key="index">
<img
alt=""
class="el-upload-list__item-thumbnail"
:src="item.url"
/>
</div>
</el-upload>
<el-carousel v-else height="200px" :interval="2000" type="card">
<el-carousel
v-if="form.info.photo"
height="200px"
:interval="2000"
type="card"
>
<el-carousel-item
v-for="(item, index) in form.info.photo"
:key="index"
Expand Down Expand Up @@ -223,9 +221,42 @@
</el-form>
</el-tab-pane>
<el-tab-pane
:label="$translateTitle('Maintenance.work process')"
v-if="form.type == 'Ѳ¼ì'"
:label="$translateTitle('Maintenance.inspection data')"
name="second"
style="height: 90%; overflow-x: hidden; overflow-y: auto"
>
<div class="card_content">
<div
v-for="(item, key) in form.info.dynamicdata"
:key="key + 'd'"
class="card_content_item"
>
<div class="card_name">
<div>
{{ item.name }}
</div>
<div style="color: #e8b300">
{{ item.unit }}
</div>
</div>
<div class="card_value">
<input
v-model="item.number"
class="card_number"
:placeholder="item.name"
type="text"
/>
<!-- disabled -->
</div>
<div class="card_time"></div>
</div>
</div>
</el-tab-pane>
<el-tab-pane
:label="$translateTitle('Maintenance.work process')"
name="third"
style="height: 90%; overflow-x: hidden; overflow-y: auto"
>
<el-card shadow="hover">
<template #header>
Expand All @@ -240,7 +271,7 @@
</template>
<el-timeline :reverse="reverse">
<el-timeline-item
v-for="item in detail.info.timeline"
v-for="item in form.info.timeline"
:key="item.timestamp"
placement="top"
:timestamp="item.timestamp"
Expand Down Expand Up @@ -342,16 +373,13 @@
}
UploadImg(params)
.then((res) => {
console.log(res)
if (res.data.url) {
this.form.info.photo.push(res.data.url)
console.log('???????', res.data.url, this.form.photo)
} else {
console.log('no up url ', res)
}
})
.catch((e) => {
console.log('???', e)
})
.catch((e) => {})
},
},
}
Expand All @@ -362,4 +390,41 @@
margin: 20px 0;
}
}
/* Êý¾Ý¿¨Æ¬Áбí */
.card_content {
display: flex;
flex-wrap: wrap;
}
.card_content_item {
width: 22%;
margin: 1%;
background-color: #fff;
box-shadow: 1px 1px 1px 1px #ccc;
}
.card_name {
display: flex;
justify-content: space-between;
padding: 0.5em 0.4em;
}
.card_value {
padding-left: 20%;
padding-top: 0.5em;
padding-bottom: 0.5em;
}
.card_number {
color: #1e49c5;
width: 80%;
border: 0;
}
.card_time {
height: 0.5em;
width: 100%;
}
input {
outline: none;
}
</style>
3 changes: 2 additions & 1 deletion src/views/CloudOT/maintenance/createTicket.vue
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@
device: '',
type: '',
info: {
photo: [],
startdata: '',
completiondata: '',
},
Expand Down Expand Up @@ -700,7 +701,7 @@
.then((res) => {
if (res.data.url) {
this.form.info.photo.push(res.data.url)
console.log('上传成功的回调', res.data.url, this.form.photo)
// console.log('上传成功的回调', res.data.url, this.form.info.photo)
} else {
console.log('no up url ', res)
}
Expand Down
16 changes: 2 additions & 14 deletions src/views/CloudOT/maintenance/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,12 @@
align="center"
:label="$translateTitle('Maintenance.Ticket number')"
prop="number"
show-overflow-tooltip
sortable
width="120"
/>
<el-table-column
align="center"
:label="$translateTitle('equipment.Products')"
show-overflow-tooltip
sortable
>
<template #default="{ row }">
{{ row.info && row.info.productname ? row.info.productname : '' }}
Expand All @@ -137,7 +134,6 @@
align="center"
:label="$translateTitle('Maintenance.Equipment name')"
show-overflow-tooltip
sortable
>
<template #default="{ row }">
{{ row.info && row.info.devicename ? row.info.devicename : '' }}
Expand All @@ -146,8 +142,6 @@
<el-table-column
align="center"
:label="$translateTitle('Maintenance.executor')"
show-overflow-tooltip
sortable
>
<template #default="{ row }">
{{ row.info && row.info.executorname ? row.info.executorname : '' }}
Expand All @@ -157,14 +151,12 @@
align="center"
:label="$translateTitle('Maintenance.Ticket type')"
prop="type"
show-overflow-tooltip
sortable
width="100"
/>
<el-table-column
align="center"
:label="$translateTitle('Maintenance.Ticket status')"
show-overflow-tooltip
sortable
width="100"
>
<template #default="{ row }">
{{ getStatus(row.status, row) }}
Expand All @@ -173,7 +165,6 @@
<el-table-column
align="center"
:label="$translateTitle('Maintenance.planstartdata')"
show-overflow-tooltip
sortable
>
<template #default="{ row }">
Expand All @@ -183,7 +174,6 @@
<el-table-column
align="center"
:label="$translateTitle('Maintenance.planenddata')"
show-overflow-tooltip
sortable
>
<template #default="{ row }">
Expand All @@ -193,8 +183,6 @@
<el-table-column
align="center"
:label="$translateTitle('Maintenance.Initiator')"
show-overflow-tooltip
sortable
>
<template #default="{ row }">
{{ row.info && row.info.createdname ? row.info.createdname : '' }}
Expand Down
Loading

1 comment on commit 071750b

@vercel
Copy link

@vercel vercel bot commented on 071750b Sep 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dgiot-dashboard – ./

dgiot-dashboard-dgiot.vercel.app
dgiot-dashboard.vercel.app
dgiot-dashboard-git-master-dgiot.vercel.app

Please sign in to comment.