Skip to content

Commit

Permalink
feat(equipmentCloud): 通道管理
Browse files Browse the repository at this point in the history
通道分页查询优化
  • Loading branch information
h7ml committed Jul 7, 2022
1 parent a26b5fd commit 73ff586
Show file tree
Hide file tree
Showing 13 changed files with 181 additions and 70 deletions.
4 changes: 1 addition & 3 deletions src/dgiot/components/DgiotRoleTree/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@
}
const { results: permission = [] } = await Permission()
const chart = await getDlinkJson('ChartType')
const info = await postCookie(
store.getters['user/token']
)
const info = await postCookie(store.getters['user/token'])
console.log(info)
this.setPermission(permission)
const protocol = await getProtocol()
Expand Down
2 changes: 1 addition & 1 deletion src/views/CloudFunction/engine/channel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,6 @@
keys: 'count(*)',
where: {},
}
this.paginationKey = moment(new Date()).valueOf() + ''
this.channelformsearch.name
? (params.where.name = {
$regex: this.channelformsearch.name,
Expand Down Expand Up @@ -1382,6 +1381,7 @@
this.length = val
// this.total = 0
this.Get_Re_Channel(1)
this.paginationKey = moment(new Date()).valueOf() + ''
},
channelCurrentChange(val) {
// this.total = 0
Expand Down
2 changes: 1 addition & 1 deletion src/views/CloudOT/maintenance/components/Step1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
<el-form-item
:label="$translateTitle('Maintenance.project') + ': '"
:label="$translateTitle('equipment.Products') + ': '"
>
<!-- <el-input v-model="detail._product" readonly disabled />-->
<span>{{ form.info.productname }}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/views/CloudOT/maintenance/components/Step2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
<el-form-item
:label="$translateTitle('Maintenance.project') + ': '"
:label="$translateTitle('equipment.Products') + ': '"
>
<!-- <el-input v-model="detail._product" readonly disabled />-->
<span>{{ form.info.productname }}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/views/CloudOT/maintenance/components/Step3.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
<el-form-item
:label="$translateTitle('Maintenance.project') + ': '"
:label="$translateTitle('equipment.Products') + ': '"
>
<!-- <el-input v-model="detail._product" readonly disabled />-->
<span>{{ form.info.productname }}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/views/CloudOT/maintenance/components/Step4.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
<el-form-item
:label="$translateTitle('Maintenance.project') + ': '"
:label="$translateTitle('equipment.Products') + ': '"
>
<!-- <el-input v-model="detail._product" readonly disabled />-->
<span>{{ form.info.productname }}</span>
Expand Down
8 changes: 4 additions & 4 deletions src/views/CloudOT/maintenance/createTicket.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
size="medium "
>
<el-form-item
:label="$translateTitle('Maintenance.project')"
:label="$translateTitle('equipment.Products')"
prop="product"
>
<el-select
Expand Down Expand Up @@ -179,11 +179,11 @@
:placeholder="$translateTitle('Maintenance.Ticket number')"
/>
</el-form-item>
<el-form-item :label="$translateTitle('Maintenance.projects')">
<el-form-item :label="$translateTitle('equipment.Products')">
<el-select
v-model="queryForm.product"
clearable
:placeholder="$translateTitle('Maintenance.project')"
:placeholder="$translateTitle('equipment.Products')"
>
<el-option
v-for="(item, index) in _Product"
Expand Down Expand Up @@ -355,7 +355,7 @@

<el-table-column
align="center"
:label="$translateTitle('Maintenance.project')"
:label="$translateTitle('equipment.Products')"
show-overflow-tooltip
sortable
>
Expand Down
14 changes: 7 additions & 7 deletions src/views/CloudOT/maintenance/dispatchTicket.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
size="medium "
>
<el-form-item
:label="$translateTitle('Maintenance.project')"
:label="$translateTitle('equipment.Products')"
prop="product"
>
<el-select
Expand Down Expand Up @@ -176,11 +176,11 @@
:placeholder="$translateTitle('Maintenance.Ticket number')"
/>
</el-form-item>
<el-form-item :label="$translateTitle('Maintenance.projects')">
<el-form-item :label="$translateTitle('equipment.Products')">
<el-select
v-model="queryForm.product"
clearable
:placeholder="$translateTitle('Maintenance.project')"
:placeholder="$translateTitle('equipment.Products')"
>
<el-option
v-for="(item, index) in Product"
Expand Down Expand Up @@ -361,7 +361,7 @@

<el-table-column
align="center"
:label="$translateTitle('Maintenance.project')"
:label="$translateTitle('equipment.Products')"
show-overflow-tooltip
sortable
>
Expand Down Expand Up @@ -905,9 +905,9 @@
status: 0,
},
}
this.Assigned % 2 == 0
? (params.where['info.receiveuseid'] = this.objectid)
: ''
// this.Assigned % 2 == 0
// ? (params.where['info.receiveuseid'] = this.objectid)
// : ''
this.queryForm.number
? (params.where.number = { $regex: this.queryForm.number })
: ''
Expand Down
25 changes: 21 additions & 4 deletions src/views/CloudOT/maintenance/evaluationTicket.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
size="medium "
>
<el-form-item
:label="$translateTitle('Maintenance.project')"
:label="$translateTitle('equipment.Products')"
prop="product"
>
<el-select
Expand Down Expand Up @@ -154,11 +154,11 @@
:placeholder="$translateTitle('Maintenance.Ticket number')"
/>
</el-form-item>
<el-form-item :label="$translateTitle('Maintenance.projects')">
<el-form-item :label="$translateTitle('equipment.Products')">
<el-select
v-model="queryForm.product"
clearable
:placeholder="$translateTitle('Maintenance.project')"
:placeholder="$translateTitle('equipment.Products')"
>
<el-option
v-for="(item, index) in _Product"
Expand All @@ -184,6 +184,20 @@
<!-- placeholder="请输入账号"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item :label="$translateTitle('Maintenance.status')">
<el-select
v-model="queryForm.status"
clearable
:placeholder="$translateTitle('Maintenance.Ticket status')"
>
<el-option
v-for="item in status"
:key="item.key"
:label="$translateTitle(item.text)"
:value="item.key"
/>
</el-select>
</el-form-item>
<el-form-item :label="$translateTitle('Maintenance.times')">
<el-date-picker
v-model="queryForm.searchDate"
Expand Down Expand Up @@ -277,7 +291,7 @@

<el-table-column
align="center"
:label="$translateTitle('Maintenance.project')"
:label="$translateTitle('equipment.Products')"
show-overflow-tooltip
sortable
>
Expand Down Expand Up @@ -801,6 +815,9 @@
this.queryForm.type
? (params.where.type = { $regex: this.queryForm.type })
: ''
_.isNumber(this.queryForm.status)
? (params.where.status = this.queryForm.status)
: ''
if (this.queryForm.searchDate?.length) {
params.where['createdAt'] = {
$gt: {
Expand Down
70 changes: 59 additions & 11 deletions src/views/CloudOT/maintenance/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
:placeholder="$translateTitle('Maintenance.Ticket number')"
/>
</el-form-item>
<el-form-item :label="$translateTitle('Maintenance.project')">
<el-form-item :label="$translateTitle('equipment.Products')">
<el-select
v-model="queryForm.product"
:placeholder="$translateTitle('Maintenance.project')"
:placeholder="$translateTitle('equipment.Products')"
>
<el-option
v-for="(item, index) in _Product"
Expand Down Expand Up @@ -86,6 +86,20 @@
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item :label="$translateTitle('Maintenance.status')">
<el-select
v-model="queryForm.status"
clearable
:placeholder="$translateTitle('Maintenance.Ticket status')"
>
<el-option
v-for="item in status"
:key="item.key"
:label="$translateTitle(item.text)"
:value="item.key"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
icon="el-icon-search"
Expand Down Expand Up @@ -149,7 +163,7 @@

<el-table-column
align="center"
:label="$translateTitle('Maintenance.project')"
:label="$translateTitle('equipment.Products')"
show-overflow-tooltip
sortable
>
Expand Down Expand Up @@ -220,13 +234,23 @@
<dgiot-empty />
</template>
</el-table>
<DgiotPagination
v-show="total"
<div class="elpagination">
<el-pagination
:current-page.sync="queryForm.skip"
layout="total, sizes, prev, pager, next, jumper"
:page-size.sync="queryForm.limit"
:page-sizes="[5, 10, 20, 30, 50]"
:total="total"
@current-change="fetchData"
@size-change="fetchData"
/>
</div>
<!-- <dgiot-pagination
:limit.sync="queryForm.pageSize"
:page.sync="queryForm.pageNo"
:total="total"
@pagination="fetchData"
/>
/> -->
</div>
</template>

Expand All @@ -249,9 +273,28 @@
ishard: true,
isfooter: false,
step: 1,
length: 20,
detail: {},
deviceFlag: false,
AllDevice: [],
status: [
{
key: 0,
text: 'Maintenance.To be assigned',
},
{
key: 1,
text: 'Maintenance.Assigned',
},
{
key: 2,
text: 'Maintenance.Processed',
},
{
key: 3,
text: 'Maintenance.Statement',
},
],
height: this.$baseTableHeight(0),
dialogFormVisible: false,
types: ['故障维修'],
Expand Down Expand Up @@ -397,17 +440,18 @@
// this.fetchData()
// },
async fetchData(args = {}) {
dgiotlog.log(this.queryForm.toString(), 'queryForm', args)
if (!args.limit) {
args = this.queryForm
}
dgiotlog.log(this.queryForm, 'queryForm', args)
// dgiotlog.log(this.queryForm, 'queryForm', args)
this.listLoading = false
const loading = this.$baseColorfullLoading()
let params = {
limit: args.limit,
order: args.order,
skip: args.skip,
keys: 'objectId',
limit: this.queryForm.limit,
order: this.queryForm.order,
skip: (this.queryForm.skip - 1) * this.queryForm.limit,
count: 'objectId',
where: {},
}
this.queryForm.number
Expand All @@ -421,6 +465,10 @@
this.queryForm.type
? (params.where.type = { $regex: this.queryForm.type })
: ''
console.log('this.queryForm.status', this.queryForm.status)
this.queryForm.status.length
? (params.where.status = this.queryForm.status)
: ''
if (this.queryForm.searchDate?.length) {
params.where['createdAt'] = {
$gt: {
Expand Down
Loading

0 comments on commit 73ff586

Please sign in to comment.