Skip to content

Commit

Permalink
fix: view
Browse files Browse the repository at this point in the history
  • Loading branch information
xuxiaobo1010 committed Mar 31, 2023
1 parent 962d1c0 commit ceed150
Show file tree
Hide file tree
Showing 12 changed files with 1,112 additions and 40 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dgiot/dgiot-dashboard",
"version": "4.7.7",
"version": "4.7.9",
"author": "xxb",
"license": "MPL-2.0",
"private": false,
Expand Down
14 changes: 14 additions & 0 deletions src/api/View/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ export async function getTrack(id) {
method: 'get',
})
}
export async function getAmisView(ObjectId, params) {
return request({
url: `/amis/View/${ObjectId}`,
method: 'get',
params,
})
}
export async function getEditView(ObjectId, params) {
return request({
url: `/classes/View/${ObjectId}`,
method: 'get',
params,
})
}

export function getTopo(params) {
return request({
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ export default {
exportpro: '导出产品',
topoview: '组态大屏',
importpro: '导入产品',
productinterval: '物模型缓存延时(秒/s)',
productinterval: '物模型延时(秒/s)',
},
scripttips: {
Pleaseinputproduct: '请输入产品',
Expand Down
2 changes: 1 addition & 1 deletion src/views/CloudFunction/amis/editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</template>

<script>
import { putView, getView } from '@/api/View'
import { putView, getView, getEditView } from '@/api/View'
export default {
name: 'Editor',
data() {
Expand Down
70 changes: 68 additions & 2 deletions src/views/CloudFunction/lowcode/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,25 @@
width="140"
>
<template #default="{ row, $index }">
<Select v-model="row.flag" @on-change="switchflag(row)">
<el-select
v-model="row.flag"
allow-create
default-first-option
filterable
placeholder="请选择"
size="mini"
style="width: 95%"
@change="switchflag(row)"
>
<el-option
v-for="item in flags"
:key="item.value"
:label="item.label"
size="mini"
:value="item.value"
/>
</el-select>
<!-- <Select v-model="row.flag" allow-create @on-change="switchflag(row)">
<Option
v-for="item in flags"
:key="item.value"
Expand All @@ -278,7 +296,7 @@
>
{{ item.label }}
</Option>
</Select>
</Select> -->
</template>
</el-table-column>
<el-table-column
Expand All @@ -301,6 +319,23 @@
</Select>
</template>
</el-table-column>
<el-table-column
v-if="type != 'menu' && type != 'role'"
align="center"
:label="$translateTitle('task.data')"
show-overflow-tooltip
width="120"
>
<template #default="{ row }">
<el-button
v-show="type != 'menu' && type != 'role'"
type="info"
@click="handleToViewTemplate(row)"
>
查看
</el-button>
</template>
</el-table-column>
<el-table-column
align="center"
:label="$translateTitle('node.operation')"
Expand Down Expand Up @@ -336,6 +371,13 @@
>
{{ setRowState(selectRow, row) }}
</el-button>
<el-button
v-show="type != 'menu' && type != 'role'"
type="default"
@click="handleToViewGit(row)"
>
日志
</el-button>
<el-button type="primary" @click="handleLowCode(row)">
{{ $translateTitle('application.preview') }}
</el-button>
Expand Down Expand Up @@ -857,6 +899,30 @@
this.$refs['edit'].dialogFormVisible = true
this.$refs['edit'].showEdit(this.queryForm)
},
//查看文本替换模板
handleToViewTemplate(row) {
localStorage.setItem('parse_viewid', row.objectId)
this.$router.push({
path: '/viewtemplate',
query: {
viewid: row.objectId,
viewtemplate: true,
// productid: row.key || 'none',
},
})
},
// 查看视图日志
handleToViewGit(row) {
localStorage.setItem('parse_viewid', row.objectId)
this.$router.push({
path: '/viewgit',
query: {
viewid: row.objectId,
viewgit: true,
// productid: row.key || 'none',
},
})
},
async handleEdit(row) {
localStorage.setItem('parse_objectid', row.key)
const loading = this.$baseLoading(1)
Expand Down
68 changes: 51 additions & 17 deletions src/views/CloudOT/maintenance/createTicket.vue
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,31 @@
<dgiot-empty />
</template>
</el-table>
<dgiot-Pagination
<el-pagination
background
:current-page="queryForm.pageNo"
layout="total, sizes, prev, pager, next, jumper"
:page-size="queryForm.limit"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
<!-- <el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage4"
:page-sizes="[5, 10, 20, 50]"
:page-size="100"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination> -->
<!-- <dgiot-Pagination
v-show="total > 0"
:limit.sync="queryForm.pageSize"
:page.sync="queryForm.pageNo"
:total="total"
@pagination="fetchData"
/>
/> -->
</div>
</template>

Expand All @@ -440,14 +458,14 @@
import { roletree, getRoleuser, queryRoledepartment } from '@/api/Role'
import { userTree } from '@/api/User'
import { Roletree } from '@/api/Menu'
export default {
name: 'CreateTicket',
components: {
ChangeStep,
},
data() {
return {
ACL: {},
tickettype: [
{
label: '巡检',
Expand Down Expand Up @@ -586,7 +604,7 @@
pageNo: 1,
pageSize: 20,
searchDate: [],
limt: 10,
limit: 10,
skip: 0,
order: '-createdAt',
keys: 'count(*)',
Expand Down Expand Up @@ -629,6 +647,17 @@
this.fetchData()
},
methods: {
handleCurrentChange(e) {
console.log(e)
this.queryForm.pageNo = e
this.fetchData()
},
handleSizeChange(e) {
console.log(e)
this.queryForm.limit = e
this.queryForm.pageNo = 1
this.fetchData()
},
handleChangeExecutor(value) {
this.form.info.executor = value[value.length - 1]
this.form.info.executorname = value[value.length - 1].label
Expand Down Expand Up @@ -720,19 +749,22 @@
})
},
async createdTicket(from) {
const setAcl = {}
let setAcl = this.ACL
// setAcl[from.info.principal] = {
// read: true,
// write: true,
// }
setAcl[from.info.executorid] = {
read: true,
write: true,
}
setAcl[this.objectid] = {
read: true,
write: true,
}
// if (from.info.executorid) {
// setAcl[from.info.executorid] = {
// read: true,
// write: true,
// }
// }
// setAcl[this.objectid] = {
// read: true,
// write: true,
// }
const params = {
number: moment(new Date()).unix() + '',
type: from.type,
Expand Down Expand Up @@ -897,12 +929,12 @@
this.listLoading = false
const loading = this.$baseColorfullLoading()
let params = {
limit: args.limit,
order: args.order,
skip: args.skip,
limit: this.queryForm.limit,
order: this.queryForm.order,
skip: (this.queryForm.pageNo - 1) * this.queryForm.limit,
count: 'objectId',
where: {
'info.created': this.objectid,
// 'info.created': this.objectid,
},
}
if (String(this.queryForm.status + '').length > 0) {
Expand Down Expand Up @@ -965,9 +997,11 @@
this.Device = results
},
deviceChange(e) {
// console.log(e)
this.Device.map((p) => {
if (p.objectId == e) {
console.log('device', p)
this.ACL = p.ACL
this.form.info.devicename = p.name
this.form.info.executorname = p.maintenance_personnel.nick
this.form.info.executorid = p.maintenance_personnel.userid
Expand Down
39 changes: 31 additions & 8 deletions src/views/CloudOT/maintenance/myticket.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<el-select
v-model="queryForm.product"
clearable
filterable
:placeholder="$translateTitle('equipment.Products')"
>
<el-option
Expand All @@ -75,6 +76,7 @@
v-model="queryForm.type"
clearable
:placeholder="$translateTitle('Maintenance.Ticket type')"
style="width: 100%"
>
<el-option
v-for="(item, index) in tickettype"
Expand Down Expand Up @@ -155,7 +157,7 @@
</el-table-column>
<el-table-column
align="center"
:label="$translateTitle('Maintenance.executor')"
:label="$translateTitle('Maintenance.maintenance_personnel')"
>
<template #default="{ row }">
{{ row.info && row.info.executorname ? row.info.executorname : '' }}
Expand Down Expand Up @@ -259,13 +261,23 @@
<dgiot-empty />
</template>
</el-table>
<dgiot-Pagination
<el-pagination
background
:current-page="queryForm.pageNo"
layout="total, sizes, prev, pager, next, jumper"
:page-size="queryForm.limit"
:page-sizes="[5, 10, 20, 50, 100]"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
<!-- <dgiot-Pagination
v-show="total > 0"
:limit.sync="queryForm.pageSize"
:page.sync="queryForm.pageNo"
:total="total"
@pagination="fetchData"
/>
/> -->
</div>
</template>

Expand Down Expand Up @@ -413,7 +425,7 @@
pageNo: 1,
pageSize: 20,
searchDate: [],
limt: 10,
limit: 10,
skip: 0,
order: '-createdAt',
keys: 'count(*)',
Expand Down Expand Up @@ -447,6 +459,17 @@
this.fetchData()
},
methods: {
handleCurrentChange(e) {
console.log(e)
this.queryForm.pageNo = e
this.fetchData()
},
handleSizeChange(e) {
console.log(e)
this.queryForm.limit = e
this.queryForm.pageNo = 1
this.fetchData()
},
getistimeout(row) {
let oldtime = new Date(row.info.completiondata).getTime()
if (new Date() > oldtime && row.status != 2) {
Expand Down Expand Up @@ -538,12 +561,12 @@
this.listLoading = false
const loading = this.$baseColorfullLoading()
let params = {
limit: args.limit,
order: args.order,
skip: args.skip,
limit: this.queryForm.limit,
order: this.queryForm.order,
skip: (this.queryForm.pageNo - 1) * this.queryForm.limit,
count: 'objectId',
where: {
user: this.objectid,
// user: this.objectid,
status: {
$lt: 3,
},
Expand Down
Loading

0 comments on commit ceed150

Please sign in to comment.