This commit is contained in:
Fanzink
2023-02-08 18:13:08 +08:00
parent bbe5e63075
commit 28303e4c5f
37 changed files with 580 additions and 345 deletions

View File

@@ -1,78 +1,72 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-job__schedule">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="currentChangeHandle(1)" class="blueTip" size="small">
<el-form-item>
{{ $t('schedule.beanName') }}
</el-form-item>
<el-form-item>
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanName')" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button class="buttonColor" @click="currentChangeHandle(1)">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:pause')" type="danger" @click="pauseHandle()">{{ $t('schedule.pauseBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:resume')" type="danger" @click="resumeHandle()">{{ $t('schedule.resumeBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:run')" type="danger" @click="runHandle()">{{ $t('schedule.runBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:log')" type="success" @click="logHandle()">{{ $t('schedule.log') }}</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="beanName" :label="$t('schedule.beanName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="params" :label="$t('schedule.params')" header-align="center" align="center"></el-table-column>
<el-table-column prop="cronExpression" :label="$t('schedule.cronExpression')" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('schedule.remark')" header-align="center" align="center"></el-table-column>
<el-table-column prop="status" :label="$t('schedule.status')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 1" size="small">{{ $t('schedule.status1') }}</el-tag>
<el-tag v-else size="small" type="danger">{{ $t('schedule.status0') }}</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:schedule:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:schedule:pause')" type="text" size="small" @click="pauseHandle(scope.row.id)">{{ $t('schedule.pause') }}</el-button>
<el-button v-if="$hasPermission('sys:schedule:resume')" type="text" size="small" @click="resumeHandle(scope.row.id)">{{ $t('schedule.resume') }}</el-button>
<el-button v-if="$hasPermission('sys:schedule:run')" type="text" size="small" @click="runHandle(scope.row.id)">{{ $t('schedule.run') }}</el-button>
<el-button v-if="$hasPermission('sys:schedule:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<!-- 弹窗, 日志列表 -->
<log v-if="logVisible" ref="log"></log>
</div>
</el-card>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-job__schedule">
<el-form :inline="true" :model="dataForm" ref="form" @keyup.enter.native="currentChangeHandle(dataForm.beanName)" class="blueTip" size="small">
<el-form-item>
{{ $t('schedule.beanName') }}
</el-form-item>
<el-form-item>
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanName')" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button class="buttonColor" @click="currentChangeHandle(dataForm.beanName)">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:pause')" type="danger" @click="pauseHandle()">{{ $t('schedule.pauseBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:resume')" type="danger" @click="resumeHandle()">{{ $t('schedule.resumeBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:run')" type="danger" @click="runHandle()">{{ $t('schedule.runBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:schedule:log')" type="success" @click="logHandle()">{{ $t('schedule.log') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle" style="width: 100%">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="beanName" :label="$t('schedule.beanName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="params" :label="$t('schedule.params')" header-align="center" align="center"></el-table-column>
<el-table-column prop="cronExpression" :label="$t('schedule.cronExpression')" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('schedule.remark')" header-align="center" align="center"></el-table-column>
<el-table-column prop="status" :label="$t('schedule.status')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 1" size="small">{{ $t('schedule.status1') }}</el-tag>
<el-tag v-else size="small" type="danger">{{ $t('schedule.status0') }}</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:schedule:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:schedule:pause')" type="text" size="small" @click="pauseHandle(scope.row.id)">{{ $t('schedule.pause') }}</el-button>
<el-button v-if="$hasPermission('sys:schedule:resume')" type="text" size="small" @click="resumeHandle(scope.row.id)">{{ $t('schedule.resume') }}</el-button>
<el-button v-if="$hasPermission('sys:schedule:run')" type="text" size="small" @click="runHandle(scope.row.id)">{{ $t('schedule.run') }}</el-button>
<el-button v-if="$hasPermission('sys:schedule:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<!-- 弹窗, 日志列表 -->
<log v-if="logVisible" ref="log"></log>
</div>
</el-card>
</template>
<script>
@@ -80,127 +74,153 @@ import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './schedule-add-or-update'
import Log from './schedule-log'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/schedule/page',
getDataListIsPage: true,
deleteURL: '/sys/schedule',
deleteIsBatch: true
},
dataForm: {
beanName: ''
},
logVisible: false
}
},
components: {
AddOrUpdate,
Log
},
methods: {
mixins: [mixinViewModule],
data() {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/schedule/page',
getDataListIsPage: true,
deleteURL: '/sys/schedule',
deleteIsBatch: true
},
dataForm: {
beanName: ''
},
logVisible: false
}
},
components: {
AddOrUpdate,
Log
},
methods: {
// destroy dialog
handleDestroyDialog() {
setTimeout(() => {
this.addOrUpdateVisible= false
}, /** after dialog animated */ 200);
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200)
},
// 暂停
pauseHandle (id) {
if (!id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.pause') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http.put(this.$http.adornUrl('/sys/schedule/pause'), id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getDataList()
}
})
}).catch(() => {})
}).catch(() => {})
},
// 恢复
resumeHandle (id) {
if (!id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.resume') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http.put(this.$http.adornUrl('/sys/schedule/resume'), id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getDataList()
}
})
}).catch(() => {})
}).catch(() => {})
},
// 执行
runHandle (id) {
if (!id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.run') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http.put(this.$http.adornUrl('/sys/schedule/run'), id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getDataList()
}
})
}).catch(() => {})
}).catch(() => {})
},
// 日志列表
logHandle () {
this.logVisible = true
this.$nextTick(() => {
this.$refs.log.init()
})
}
}
// 暂停
pauseHandle(id) {
if (!id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { handle: this.$t('schedule.pause') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
})
.then(() => {
this.$http
.put(this.$http.adornUrl('/sys/schedule/pause'), id ? [id] : this.dataListSelections.map((item) => item.id))
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getDataList()
}
})
})
.catch(() => {})
})
.catch(() => {})
},
// 恢复
resumeHandle(id) {
if (!id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { handle: this.$t('schedule.resume') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
})
.then(() => {
this.$http
.put(this.$http.adornUrl('/sys/schedule/resume'), id ? [id] : this.dataListSelections.map((item) => item.id))
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getDataList()
}
})
})
.catch(() => {})
})
.catch(() => {})
},
// 执行
runHandle(id) {
if (!id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { handle: this.$t('schedule.run') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
})
.then(() => {
this.$http
.put(this.$http.adornUrl('/sys/schedule/run'), id ? [id] : this.dataListSelections.map((item) => item.id))
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getDataList()
}
})
})
.catch(() => {})
})
.catch(() => {})
},
// 日志列表
logHandle() {
this.logVisible = true
this.$nextTick(() => {
this.$refs.log.init()
})
},
// 当前页
currentChangeHandle(val) {
console.log('val', val)
this.$nextTick(() => {
this.dataForm.beanName = val
})
this.getDataList()
// this.$refs['form'].resetFields()
this.dataForm.beanName = ''
console.log('this.dataForm', this.dataForm)
}
}
}
</script>

View File

@@ -66,6 +66,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{

View File

@@ -58,6 +58,7 @@ import TableTextComponent from '@/components/base-table/components/detailCompone
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'equipmentName', name: i18n.t('realtime.eqName') },

View File

@@ -89,6 +89,7 @@ import moment from 'moment'
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{

View File

@@ -52,6 +52,7 @@ import moment from 'moment'
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
// { prop: 'time', name: '时间', filter: timeFilter },

View File

@@ -57,6 +57,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -76,6 +76,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -21,8 +21,8 @@
</el-form>
<!-- <base-table :page="pageIndex" :size="pageSize" :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" @operate-event="handleOperations" @refreshDataList="getDataList" /> -->
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" />
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" />
<base-table v-for="i in (0,dataLength)" :key="i.name" :data="dataList[i]" :table-head-configs="tableConfigs[i]" :max-height="calcMaxHeight(8)" />
<!-- <base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" /> -->
</div>
</template>
@@ -42,6 +42,7 @@ export default {
equipmentName: null,
equipmentCode: null,
tableConfigs: [],
dataLength: null,
dataList: [],
dataListLoading: false,
dataListSelections: []
@@ -74,46 +75,53 @@ export default {
url: this.$http.adornUrl(`/monitoring/equipmentValueMonitor/runLog/${this.$route.params.id}`),
method: 'get'
}).then(({ data: res }) => {
console.log('res', res)
// console.log('res', res)
this.equipmentName = res.data[0].data[0].equName
this.equipmentCode = res.data[0].data[0].equCode
this.dataLength = res.data.length
for (let i = 0; i < this.dataLength; i++) {
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[0].nameData &&
res.data[0].nameData.length > 0 &&
res.data[0].data &&
res.data[0].data.length > 0
res.data[i].nameData &&
res.data[i].nameData.length > 0 &&
res.data[i].data &&
res.data[i].data.length > 0
) {
// console.log(this.equipmentName)
this.setTableProps(res.data[0].nameData)
this.setTableData(res.data[0].data)
this.setTableProps(res.data[i].nameData)
this.setTableData(res.data[i].data)
} else {
this.dataList = []
this.dataList[i] = []
}
this.dataListLoading = false
}
})
},
setTableProps(nameData) {
this.tableConfigs = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
for (let i = 0; i < this.dataLength; i++) {
this.tableConfigs[i] = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
console.log(this.tableConfigs[i]);
}
},
setTableData(data) {
this.dataList = data.map((item) => {
for (let i = 0; i < this.dataLength; i++) {
this.dataList[i] = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach((param) => {
@@ -122,6 +130,7 @@ export default {
}
return rowItem
})
}
}
}
}

View File

@@ -57,6 +57,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -38,6 +38,7 @@ import TableOperateComponent from '@/components/base-table/components/operationC
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -56,6 +56,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -54,6 +54,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -65,6 +65,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{

View File

@@ -47,6 +47,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -71,6 +71,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
@@ -111,7 +112,7 @@ const addOrUpdateConfigs = {
// placeholder: i18n.t('hints.checktime')
// },
{ name: 'productionId', required: true, label: i18n.t('pl.title'), type: 'select', options: [] },
{ name: 'sectionId', required: true, label: i18n.t('ws.title'), type: 'select', options: [] , isDisabled: true },
{ name: 'sectionId', required: true, label: i18n.t('ws.title'), type: 'select', options: [], isDisabled: true },
{
name: 'source',
label: i18n.t('source'),
@@ -183,7 +184,6 @@ export default {
this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true)
}
await this.getWorkSections(id)
}
if (name === 'sectionId') {
// 如果选择了产线,就依据此更新工单的选项
@@ -198,9 +198,11 @@ export default {
url: this.$http.adornUrl('/monitoring/qualityInspectionDet/page'),
method: 'get',
params: this.$http.adornParams({
page: this.pageIndex,
limit: this.pageSize,
key: this.dataForm.key
// page: this.pageIndex,
// limit: this.pageSize,
// key: this.dataForm.key
page: 1,
limit: 9999999
})
}).then(({ data: res }) => {
console.log('insdet:', res)

View File

@@ -57,6 +57,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -2,14 +2,14 @@
* @Author: lb
* @Date: 2022-06-22 14:00:17
* @LastEditors: fzq
* @LastEditTime: 2023-02-02 17:19:10
* @LastEditTime: 2023-02-08 16:50:05
* @Description: 设备生产实时数据
-->
<template>
<div>
<div class="app-container">
<small-title :size="'md'">{{ $t('realtime.eq') }}</small-title>
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" :span-method="spanMethod" />
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" :span-method="spanMethod" align= "center"/>
</div>
</div>
</template>

View File

@@ -2,7 +2,7 @@
* @Author: lb
* @Date: 2022-06-22 14:00:17
* @LastEditors: fzq
* @LastEditTime: 2023-02-02 17:17:45
* @LastEditTime: 2023-02-07 16:23:23
* @Description: 产线生产实时数据
-->
<template>
@@ -38,12 +38,19 @@ export default {
},
mounted() {
console.log('this.$route', this.$route)
this.clearData()
this.fetchList().then(({ data: res }) => {
// console.log('fetchlist:', res)
this.testData = res
this.handleData()
})
// this.fetchList().then(({ data: res }) => {
// // console.log('fetchlist:', res)
// this.testData = res
// this.handleData()
// if (res.code === 200 || this.$route.fullPath !== '/monitoring-realtimeProductLine') {
// // 获取数据显示成功后关闭loading
// loading.close()
// } else {
// this.$message.error(this.$t('err'))
// }
// })
this.intervalId = setInterval(() => {
this.$message({
@@ -66,6 +73,12 @@ export default {
methods: {
fetchList() {
// let loading = this.$loading({
// lock: true, //lock的修改符--默认是false
// text: this.$t('loading'), //显示在加载图标下方的加载文案
// background: 'rgba(0,0,0,0.8)', //遮罩层颜色
// spinner: 'el-icon-loading' //自定义加载图标类名
// })
return this.$http({
url: this.$http.adornUrl('/monitoring/productionMonitoring/lineProductionRealTimeData'),
method: 'post'
@@ -97,7 +110,7 @@ export default {
expandDataStepOne() {
// 扩展服务器返回的数据第一阶段
// console.log('create new one')
this.tableData = this.testData.data.map(item => {
this.tableData = this.testData.data.map((item) => {
const newItem = {
lineName: item.lineName,
orderName: item.orderName,
@@ -105,14 +118,14 @@ export default {
}
if (item.det) {
item.det.forEach(obj => {
item.det.forEach((obj) => {
// Step2: 设置动态props
if (!this.dynamicPropSet) {
this.tableProps.push({
label: moment(obj.recordTime).format('YYYY-MM-DD HH')+ moment(obj.recordTime).add(1,'hours').format('-HH')+i18n.t('hourTime'),
label: moment(obj.recordTime).format('YYYY-MM-DD HH') + moment(obj.recordTime).add(1, 'hours').format('-HH') + i18n.t('hourTime'),
children: [
{ prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') },
{ prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') },
{ prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') }
// { prop: obj.recordTime + '-passArea', label: i18n.t('realtime.goodrate') },
// { prop: obj.recordTime + '-scrapNum', label: i18n.t('realtime.num') },
// { prop: obj.recordTime + '-scrapRate', label: i18n.t('realtime.rate') }

View File

@@ -2,7 +2,8 @@
<div>
<div class="app-container">
<small-title :size="'md'">{{ $t('realtime.inspect') }}</small-title>
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" />
<!-- fixed -->
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []"/>
</div>
</div>
</template>

View File

@@ -48,6 +48,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -58,6 +58,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -83,6 +83,7 @@ import { calcMaxHeight } from '@/utils'
const tableProps = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ name: i18n.t('eq.name'), prop: 'equipmentName' },

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="130px">
<el-form-item prop="dictName" :label="$t('dict.dictName')">
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input>
</el-form-item>

View File

@@ -24,7 +24,7 @@
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button @click="showIcons()">所有图标</el-button>
<el-button @click="showIcons()">{{ $t('allIcons') }}</el-button>
</el-form-item>
</el-form>
<!-- border

View File

@@ -4,7 +4,7 @@
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-01-13 08:59:37
* @LastEditTime: 2023-02-08 16:18:20
-->
<template>
<el-card shadow="never" class="aui-card--fill">
@@ -81,6 +81,35 @@ export default {
status: ''
}
}
},
methods: {
exportHandle() {
// 导出登录日志
this.$http({
url: this.$http.adornUrl(`/sys/log/login/export${this.dataForm.creatorName,this.dataForm.status}`),
method: 'get',
responseType: "blob"
}).then((response) => {
let fileName = ''
const contentDisposition = response.headers['content-disposition']
if (contentDisposition) {
// fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9).replace('.xls',this.$t('LoginRecords')) +'.xls'
fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9)
}
fileName = decodeURIComponent(fileName)
const blob = new Blob([response.data])
const reader = new FileReader()
reader.readAsDataURL(blob)
reader.onload = (e) => {
const a = document.createElement('a')
a.download = fileName
a.href = e.target.result
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
})
}
}
}
</script>

View File

@@ -4,7 +4,7 @@
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-01-13 09:01:16
* @LastEditTime: 2023-02-08 16:19:16
-->
<template>
<el-card shadow="never" class="aui-card--fill">
@@ -81,6 +81,35 @@ export default {
status: ''
}
}
},
methods: {
exportHandle() {
// 导出操作日志
this.$http({
url: this.$http.adornUrl(`/sys/log/operation/export`),
method: 'get',
responseType: "blob"
}).then((response) => {
let fileName = ''
const contentDisposition = response.headers['content-disposition']
if (contentDisposition) {
// fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9).replace('.xls',this.$t('operationsRecords')) +'.xls'
fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9)
}
fileName = decodeURIComponent(fileName)
const blob = new Blob([response.data])
const reader = new FileReader()
reader.readAsDataURL(blob)
reader.onload = (e) => {
const a = document.createElement('a')
a.download = fileName
a.href = e.target.result
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
})
}
}
}
</script>

View File

@@ -7,12 +7,16 @@
<el-radio :label="1">{{ $t('menu.type1') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="nameEn" :label="$t('menu.nameEn')">
<el-input v-model="dataForm.nameEn" :placeholder="$t('menu.nameEn')"></el-input>
</el-form-item>
<el-form-item prop="name" :label="$t('menu.name')">
<el-input v-model="dataForm.name" :placeholder="$t('menu.name')"></el-input>
</el-form-item>
<el-form-item prop="parentName" :label="$t('menu.parentName')" class="menu-list">
<el-form-item prop="parentNameEn" :label="$t('menu.parentName')" class="menu-list">
<el-popover v-model="menuListVisible" ref="menuListPopover" placement="bottom-start" trigger="click">
<el-tree
v-if="$i18n.locale == 'zh-CN'"
:data="menuList"
:props="{ label: 'name', children: 'children' }"
node-key="id"
@@ -20,11 +24,24 @@
:highlight-current="true"
:expand-on-click-node="false"
accordion
@current-change="menuListTreeCurrentChangeHandle"
>
@current-change="menuListTreeCurrentChangeHandle">
</el-tree>
<el-tree
v-if="$i18n.locale == 'en'"
:data="menuList"
:props="{ label: 'nameEn', children: 'children' }"
node-key="id"
ref="menuListTree"
:highlight-current="true"
:expand-on-click-node="false"
accordion
@current-change="menuListTreeCurrentChangeHandle">
</el-tree>
</el-popover>
<el-input v-model="dataForm.parentName" v-popover:menuListPopover :readonly="true" :placeholder="$t('menu.parentName')">
<el-input v-if="$i18n.locale == 'zh-CN'" v-model="dataForm.parentName" v-popover:menuListPopover :readonly="true" :placeholder="$t('menu.parentName')">
<i v-if="dataForm.pid !== '0'" slot="suffix" @click.stop="deptListTreeSetDefaultHandle()" class="el-icon-circle-close el-input__icon"></i>
</el-input>
<el-input v-if="$i18n.locale == 'en'" v-model="dataForm.parentNameEn" v-popover:menuListPopover :readonly="true" :placeholder="$t('menu.parentName')">
<i v-if="dataForm.pid !== '0'" slot="suffix" @click.stop="deptListTreeSetDefaultHandle()" class="el-icon-circle-close el-input__icon"></i>
</el-input>
</el-form-item>
@@ -72,8 +89,10 @@ export default {
id: '',
type: 0,
name: '',
nameEn: '',
pid: '0',
parentName: '',
parentNameEn: '',
url: '',
permissions: '',
sort: 0,
@@ -85,6 +104,7 @@ export default {
dataRule() {
return {
name: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
nameEn: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
parentName: [{ required: true, message: this.$t('validate.required'), trigger: 'change' }]
}
}
@@ -98,8 +118,8 @@ export default {
// destroy dialog
handleDestroyDialog() {
setTimeout(() => {
this.addOrUpdateVisible= false
}, /** after dialog animated */ 200);
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200)
},
init() {
this.visible = true
@@ -138,6 +158,7 @@ export default {
...this.dataForm,
...res.data
}
// console.log('/sys/menu/', this.dataForm)
if (this.dataForm.pid === '0') {
return this.deptListTreeSetDefaultHandle()
}
@@ -153,7 +174,12 @@ export default {
// 上级菜单树, 选中
menuListTreeCurrentChangeHandle(data) {
this.dataForm.pid = data.id
this.dataForm.parentName = data.name
if (this.$i18n.locale == 'zh-CN') {
this.dataForm.parentName = data.name
}
if (this.$i18n.locale == 'en') {
this.dataForm.parentNameEn = data.nameEn
}
this.menuListVisible = false
},
// 图标, 选中
@@ -163,11 +189,12 @@ export default {
},
// 表单提交
dataFormSubmitHandle: debounce(
function() {
this.$refs['dataForm'].validate(valid => {
function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
console.log('this.dataForm', this.dataForm)
this.$http[!this.dataForm.id ? 'post' : 'put'](this.$http.adornUrl('/sys/menu'), this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {

View File

@@ -4,7 +4,7 @@
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-01-13 09:06:03
* @LastEditTime: 2023-02-08 10:06:36
-->
<template>
<el-card shadow="never" class="aui-card--fill">
@@ -15,7 +15,8 @@
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;">
<el-table-column prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column>
<el-table-column v-if="$i18n.locale == 'zh-CN'" prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column>
<el-table-column v-if="$i18n.locale == 'en'" prop="nameEn" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column>
<el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center">
<template slot-scope="scope">
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg>
@@ -58,6 +59,10 @@ export default {
},
components: {
AddOrUpdate
},
created(){
// console.log('mixinViewModuleOptions',this.mixinViewModuleOptions);
// console.log('this.$i18n.locale',this.$i18n.locale);
}
}
</script>

View File

@@ -10,7 +10,8 @@
<el-row>
<el-col :span="12">
<el-form-item size="mini" :label="$t('role.menuList')">
<el-tree :data="menuList" :props="{ label: 'name', children: 'children' }" node-key="id" ref="menuListTree" accordion show-checkbox> </el-tree>
<!-- 这里改了nameEn -->
<el-tree :data="menuList" :props="{ label: 'nameEn', children: 'children' }" node-key="id" ref="menuListTree" accordion show-checkbox> </el-tree>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -80,6 +81,7 @@ export default {
return this.$message.error(res.msg)
}
this.menuList = res.data
console.log('this.menuList',this.menuList);
})
.catch(() => {})
},

View File

@@ -17,7 +17,12 @@
<el-input v-model="dataForm.realName" :placeholder="$t('user.realName')"></el-input>
</el-form-item>
<el-form-item prop="gender" :label="$t('user.gender')">
<ren-radio-group v-model="dataForm.gender" dict-type="gender"></ren-radio-group>
<!-- <ren-radio-group v-model="dataForm.gender" dict-type="gender"></ren-radio-group> -->
<el-radio-group v-model="dataForm.gender">
<el-radio :label="0">{{ $t('user.gender0') }}</el-radio>
<el-radio :label="1">{{ $t('user.gender1') }}</el-radio>
<el-radio :label="2">{{ $t('user.gender2') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="email" :label="$t('user.email')">
<el-input v-model="dataForm.email" :placeholder="$t('user.email')"></el-input>
@@ -66,7 +71,8 @@ export default {
mobile: '',
roleIdList: [],
status: 1
}
},
radio: '1'
}
},
computed: {
@@ -107,7 +113,7 @@ export default {
email: [{ validator: validateEmail, trigger: 'blur' }],
// 解除手机号输入限制
// mobile: [{ validator: validateMobile, trigger: 'blur' }],
roleIdList: [{ required: true, message: '至少选择一个角色', trigger: 'change' }]
roleIdList: [{ required: true, message: this.$t('validate.requiredRole'), trigger: 'change' }]
}
}
},
@@ -115,8 +121,8 @@ export default {
// destroy dialog
handleDestroyDialog() {
setTimeout(() => {
this.addOrUpdateVisible= false
}, /** after dialog animated */ 200);
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200)
},
init() {
this.visible = true
@@ -158,7 +164,7 @@ export default {
}
// 角色配置, 区分是否为默认角色
for (var i = 0; i < res.data.roleIdList.length; i++) {
if (this.roleList.filter(item => item.id === res.data.roleIdList[i])[0]) {
if (this.roleList.filter((item) => item.id === res.data.roleIdList[i])[0]) {
this.dataForm.roleIdList.push(res.data.roleIdList[i])
continue
}
@@ -169,8 +175,8 @@ export default {
},
// 表单提交
dataFormSubmitHandle: debounce(
function() {
this.$refs['dataForm'].validate(valid => {
function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}

View File

@@ -4,7 +4,7 @@
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-02-02 15:36:55
* @LastEditTime: 2023-02-07 15:29:45
-->
<template>
<el-card shadow="never" class="aui-card--fill">
@@ -20,13 +20,16 @@
{{ $t('user.gender') }}
</el-form-item>
<el-form-item>
<ren-select v-model="dataForm.gender" dict-type="gender" :placeholder="$t('user.gender')"></ren-select>
<!-- <ren-select v-model="dataForm.gender" dict-type="gender" :placeholder="$t('user.gender')"></ren-select> -->
<el-select v-model="dataForm.gender" :placeholder="$t('user.gender')" clearable>
<el-option v-for="item in genderOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
</el-form-item>
<el-form-item>
{{ $t('dept.title') }}
</el-form-item>
<el-form-item>
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true"></ren-dept-tree>
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true" clearable></ren-dept-tree>
</el-form-item>
<el-form-item>
<el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button>
@@ -41,7 +44,7 @@
<el-button v-if="$hasPermission('sys:user:export')" type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle" style="width: 100%;">
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle" style="width: 100%">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptName" :label="$t('user.deptName')" header-align="center" align="center"></el-table-column>
@@ -73,8 +76,7 @@
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"
>
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
@@ -100,7 +102,52 @@ export default {
username: '',
deptId: '',
gender: ''
}
},
genderOptions: [
{
value: 0,
label: this.$t('user.gender0')
},
{
value: 1,
label: this.$t('user.gender1')
},
{
value: 2,
label: this.$t('user.gender2')
}
]
}
},
methods: {
exportHandle() {
// 导出用户
// exportEquipments({
// ...this.listQuery,
// fileName: `user-${this.listQuery.current}-${this.listQuery.size}`
// }).then((response) => {
this.$http({
url: this.$http.adornUrl(`/sys/user/export${this.dataForm.username}`),
method: 'get',
responseType: 'arraybuffer'
}).then((response) => {
let fileName = ''
const contentDisposition = response.headers['content-disposition']
if (contentDisposition) {
fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9).replace('.xls', this.$t('user.userTable')) + '.xls'
}
const blob = new Blob([response.data])
const reader = new FileReader()
reader.readAsDataURL(blob)
reader.onload = (e) => {
const a = document.createElement('a')
a.download = fileName
a.href = e.target.result
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
})
}
},
components: {