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,3 +1,11 @@
<!--
* @Descripttion:
* @version:
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-02-07 16:19:50
-->
<!DOCTYPE html>
<html>
<head>
@ -31,7 +39,7 @@
<!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script>
window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.8';
</script>
<% } %>
<!-- 集成测试环境 -->

View File

@ -27,11 +27,13 @@
:disabled="isDetail" />
<el-radio v-if="getType(n, c) === 'radio'" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" :disabled="isDetail" />
<el-checkbox v-if="getType(n, c) === 'check'" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" :disabled="isDetail" />
<!-- 全部selcet下拉框可输入搜索 filterable-->
<el-select
v-if="getType(n, c) === 'select'"
:placeholder="getPlaceholder(n, c)"
v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"
clearable
filterable
:disabled="isDetail || configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].isDisabled"
@change="emitSelectChange(configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name, $event)">

View File

@ -4,20 +4,21 @@
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-02-03 14:30:23
* @LastEditTime: 2023-02-08 17:16:47
-->
<template>
<!-- 数字代表多级表头最小列宽 -->
<!-- :width="opt.width || null" -->
<!-- :width="flexColumnWidth(opt.prop || null)" -->
<!-- header-align="center" align="center" -->
<el-table-column
:label="opt.label ? opt.label : opt.name"
:prop="opt.prop || null"
:width="flexColumnWidth(opt.prop || null)"
:min-width="opt.minWidth || null"
:fixed="opt.fixed || null"
:show-overflow-tooltip="opt.showOverflowTooltip || false"
filter-placement="top"
:align="opt.align || null"
:align="opt.align || 'center'"
v-bind="opt.more"
>
<template v-if="opt.prop" slot-scope="scope">

View File

@ -55,6 +55,7 @@
"
v-bind="head.more"></el-table-column>
<!-- 普通的表头 -->
<!-- :align="head.align || null" 表头居中 -->
<el-table-column
v-else
:key="idx + 'else'"
@ -66,7 +67,7 @@
:show-overflow-tooltip="head.showOverflowTooltip || true"
:tooltip-effect="head.tooltipEffect || 'light'"
filter-placement="top"
:align="head.align || null"
:align="head.align || 'center'"
v-bind="head.more">
<!-- 子组件 编辑/删除 -->
<template v-if="head.prop" slot-scope="scope">
@ -77,7 +78,7 @@
<!-- 多级表头 -->
<template v-if="!head.prop && head.children">
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead" />
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead" fixed/>
</template>
</el-table-column>
</template>

View File

@ -25,16 +25,18 @@ t.routes['厂务'] = 'Factory Affair'
t.routes['设备'] = 'Equipment'
t.routes['字典管理'] = 'Dict Management'
t.routes['PLC信息'] = 'PLC'
t.routes['设备与PLC关联配置'] = 'Relations between plc & equipments'
t.routes['近24小时设备生产数据'] = 'Realtime Equipment Data(24h)'
t.routes['近24小时产线生产数据'] = 'Realtime Productline Data(24h)'
t.routes['近24小时质量检查数据'] = 'Realtime Quality Inspection Data(24h)'
// Relations between
t.routes['设备与PLC关联配置'] = 'PLC & Equipments'
t.routes['近24小时设备生产数据'] = 'Equipment Data'
t.routes['近24小时产线生产数据'] = 'Productline Data'
t.routes['近24小时质量检查数据'] = 'Quality Inspection Data'
t.routes['报表总览'] = 'Report Overview'
t.routes['报表分类'] = 'Report Types'
t.routes['报表详情'] = 'Report Detail'
t.routes['报表设计'] = 'Report Design'
t.routes['报表预览'] = 'Report Preview'
t.routes['质量检测基础数据'] = 'Quality Inspection Basic Data'
// Quality
t.routes['质量检测基础数据'] = 'Inspection Basic Data'
t.routes['当前检测数据'] = 'Current Inspection Data'
t.routes['检测统计数据'] = 'Statistics Data'
t.routes['质量检查信息记录'] = 'Quality Inspection Records'
@ -46,10 +48,10 @@ t.routes['参数管理'] = 'Params Management'
t.routes['定时任务'] = 'Timed Tasks'
t.routes['文件上传'] = 'File Upload'
t.routes['登录日志'] = 'Login Records'
t.routes['操作日志'] = 'Oprations Records'
t.routes['设备效率分析'] = 'Equipment Efficiency Analysis'
t.routes['设备异常分析'] = 'Equipment Exceptions Analysis'
t.routes['设备状态时序图'] = 'Equipment Status Timesequence'
t.routes['操作日志'] = 'Operations Records'
t.routes['设备效率分析'] = 'EQU Efficiency Analysis'
t.routes['设备异常分析'] = 'EQU Exceptions Analysis'
t.routes['设备状态时序图'] = 'EQU Status Timesequence'
// 三级
t.routes['工厂'] = 'Factory'
@ -103,12 +105,12 @@ t.updatorName = 'Updator\'s name'
t.updateTime = 'Update Time'
t.version = 'Version'
t.search = 'Search'
t.countPerPage = '每页数' // ?
t.currentPage = '当前页' // ?
t.fetchList = '获取数据列表' // ?
t.multi = '多选' // ?
t.do = '进行' // ?
t.submit = '表单提交' // ?
t.countPerPage = 'Per Page' // ?
t.currentPage = 'Current Page' // ?
t.fetchList = 'Fetch Data List' // ?
t.multi = 'Multiple Selection' // ?
t.do = 'Proceed' // ?
t.submit = 'Submit' // ?
t.desc = 'Description'
t.disable = 'Disable'
t.equipment = 'Equipment'
@ -117,7 +119,7 @@ t.cannotempty = 'can\'t be empty'
t.parameter = 'Parameters'
t.enable = 'Enable'
t.index = 'Index'
t.relation = '关联'
t.relation = 'Relation'
t.fetchInfo = 'Fetch Info'
t.name = 'Name'
t.code = 'Code'
@ -187,6 +189,10 @@ t.refdate = 'By date'
t.hour = 'Hour(s)'
t.yes = 'yes'
t.no = 'no'
t.LoginRecords = ' Login Records'
t.operationsRecords = ' Operations Records'
t.allIcons= 'All Icons'
t.err= 'Error'
t.errors = {}
t.errors.nosection = 'There is no sections on this product line.'
@ -413,10 +419,11 @@ t.validate = {}
t.validate.required = 'This is required.'
t.validate.format = '{attr} has a wrong format.'
t.validate.keyValueWarning = 'The value must be an integer between 0 and 100!'
t.validate.requiredRole = 'Choose at least one role'
t.upload = {}
t.upload.title = 'Upload Assets'
t.upload.text = '将文件拖到此处,或<em>点击上传</em>'
t.upload.text = 'Drag the file here, or <em> click Upload </em>'
t.upload.tip = 'Only support files with format: {format}'
t.upload.button = 'upload'
@ -484,60 +491,60 @@ t.schedule.times = 'Time Cost (ms)'
t.schedule.createDate = 'Executed Tune' // ?
t.oss = {}
t.oss.config = '云存储配置'
t.oss.upload = '上传文件'
t.oss.url = 'URL地址'
t.oss.config = 'Cloud storage configuration'
t.oss.upload = 'upload'
t.oss.url = 'url'
t.oss.createDate = 'Create Time'
t.oss.type = '类型'
t.oss.type1 = '七牛'
t.oss.type2 = '阿里云'
t.oss.type3 = '腾讯云'
t.oss.qiniuDomain = '域名'
t.oss.qiniuDomainTips = '七牛绑定的域名'
t.oss.qiniuPrefix = '路径前缀'
t.oss.qiniuPrefixTips = '不设置默认为空'
t.oss.type = 'type'
t.oss.type1 = 'Qiniu'
t.oss.type2 = 'Aliyun'
t.oss.type3 = 'Tencent Cloud'
t.oss.qiniuDomain = 'Domain name'
t.oss.qiniuDomainTips = 'Bound domain name'
t.oss.qiniuPrefix = 'Prefix'
t.oss.qiniuPrefixTips = 'If no, the default value is null'
t.oss.qiniuAccessKey = 'AccessKey'
t.oss.qiniuAccessKeyTips = '七牛AccessKey'
t.oss.qiniuAccessKeyTips = 'Qiniu AccessKey'
t.oss.qiniuSecretKey = 'SecretKey'
t.oss.qiniuSecretKeyTips = '七牛SecretKey'
t.oss.qiniuBucketName = '空间名'
t.oss.qiniuBucketNameTips = '七牛存储空间名'
t.oss.aliyunDomain = '域名'
t.oss.aliyunDomainTips = '阿里云绑定的域名,如http://cdn.renren.io'
t.oss.aliyunPrefix = '路径前缀'
t.oss.aliyunPrefixTips = '不设置默认为空'
t.oss.qiniuSecretKeyTips = 'Qiniu SecretKey'
t.oss.qiniuBucketName = 'BucketName'
t.oss.qiniuBucketNameTips = 'Qiniu BucketName'
t.oss.aliyunDomain = 'Domain'
t.oss.aliyunDomainTips = 'Domain name bound to Ali Cloud, such ashttp://cdn.renren.io'
t.oss.aliyunPrefix = 'Prefix'
t.oss.aliyunPrefixTips = 'If no, the default value is null'
t.oss.aliyunEndPoint = 'EndPoint'
t.oss.aliyunEndPointTips = '阿里云EndPoint'
t.oss.aliyunEndPointTips = 'Aliyun EndPoint'
t.oss.aliyunAccessKeyId = 'AccessKeyId'
t.oss.aliyunAccessKeyIdTips = '阿里云AccessKeyId'
t.oss.aliyunAccessKeyIdTips = 'Aliyun AccessKeyId'
t.oss.aliyunAccessKeySecret = 'AccessKeySecret'
t.oss.aliyunAccessKeySecretTips = '阿里云AccessKeySecret'
t.oss.aliyunAccessKeySecretTips = 'Aliyun AccessKeySecret'
t.oss.aliyunBucketName = 'BucketName'
t.oss.aliyunBucketNameTips = '阿里云BucketName'
t.oss.qcloudDomain = '域名'
t.oss.qcloudDomainTips = '腾讯云绑定的域名'
t.oss.qcloudPrefix = '路径前缀'
t.oss.qcloudPrefixTips = '不设置默认为空'
t.oss.aliyunBucketNameTips = 'Aliyun BucketName'
t.oss.qcloudDomain = 'Domain'
t.oss.qcloudDomainTips = 'Tencent Cloud Domains'
t.oss.qcloudPrefix = 'Prefix'
t.oss.qcloudPrefixTips = 'If no, the default value is null'
t.oss.qcloudAppId = 'AppId'
t.oss.qcloudAppIdTips = '腾讯云AppId'
t.oss.qcloudAppIdTips = 'Tencent Cloud AppId'
t.oss.qcloudSecretId = 'SecretId'
t.oss.qcloudSecretIdTips = '腾讯云SecretId'
t.oss.qcloudSecretIdTips = 'Tencent Cloud SecretId'
t.oss.qcloudSecretKey = 'SecretKey'
t.oss.qcloudSecretKeyTips = '腾讯云SecretKey'
t.oss.qcloudSecretKeyTips = 'Tencent Cloud SecretKey'
t.oss.qcloudBucketName = 'BucketName'
t.oss.qcloudBucketNameTips = '腾讯云BucketName'
t.oss.qcloudRegion = '所属地区'
t.oss.qcloudRegionTips = '请选择'
t.oss.qcloudRegionBeijing1 = '北京一区(华北)'
t.oss.qcloudRegionBeijing = '北京'
t.oss.qcloudRegionShanghai = '上海(华东)'
t.oss.qcloudRegionGuangzhou = '广州(华南)'
t.oss.qcloudRegionChengdu = '成都(西南)'
t.oss.qcloudRegionChongqing = '重庆'
t.oss.qcloudRegionSingapore = '新加坡'
t.oss.qcloudRegionHongkong = '香港'
t.oss.qcloudRegionToronto = '多伦多'
t.oss.qcloudRegionFrankfurt = '法兰克福'
t.oss.qcloudBucketNameTips = 'Tencent Cloud BucketName'
t.oss.qcloudRegion = 'Region'
t.oss.qcloudRegionTips = 'Select'
t.oss.qcloudRegionBeijing1 = 'Beijing District 1 (North China)'
t.oss.qcloudRegionBeijing = 'Beijing'
t.oss.qcloudRegionShanghai = 'Shanghai (East China)'
t.oss.qcloudRegionGuangzhou = 'Guangzhou (South China)'
t.oss.qcloudRegionChengdu = 'Chengdu (Southwest)'
t.oss.qcloudRegionChongqing = 'Chongqing'
t.oss.qcloudRegionSingapore = 'Singapore'
t.oss.qcloudRegionHongkong = 'Hong Kong'
t.oss.qcloudRegionToronto = 'Toronto'
t.oss.qcloudRegionFrankfurt = 'Frankfurt'
t.dept = {}
t.dept.name = 'Department Name'
@ -557,7 +564,7 @@ t.dict.remark = 'Remark'
t.dict.createDate = 'Create Time'
t.logError = {}
t.logError.requestUri = 'Request URI'
t.logError.requestUri = 'Request URL'
t.logError.requestMethod = 'Request Method'
t.logError.requestParams = 'Request Parameters'
t.logError.ip = 'IP'
@ -584,7 +591,7 @@ t.logOperation.status0 = 'Failed'
t.logOperation.status1 = 'Success'
t.logOperation.creatorName = 'User Name'
t.logOperation.operation = 'User Operations'
t.logOperation.requestUri = 'Request URI'
t.logOperation.requestUri = 'Request URL'
t.logOperation.requestMethod = 'Request Method'
t.logOperation.requestParams = 'Request Parameters'
t.logOperation.requestTime = 'Request Duration'
@ -593,21 +600,22 @@ t.logOperation.userAgent = 'User-Agent'
t.logOperation.createDate = 'Create Time'
t.menu = {}
t.menu.name = 'Name'
t.menu.name = 'Chinese Name'
t.menu.nameEn = 'Name'
t.menu.icon = 'Icons'
t.menu.type = 'Type'
t.menu.type0 = 'Menu'
t.menu.type1 = 'Button'
t.menu.sort = 'Sort'
t.menu.url = 'Route'
t.menu.permissions = '授权标识'
t.menu.permissionsTips = '多个用逗号分隔,如:sys:menu:save,sys:menu:update'
t.menu.parentName = '上级菜单'
t.menu.permissions = 'Authorization Identifier'
t.menu.permissionsTips = 'Multiple are separated by commas, such as:sys:menu:save,sys:menu:update'
t.menu.parentName = 'Superior menu'
t.menu.parentNameDefault = 'First tier menu'
t.menu.resource = '授权资源'
t.menu.resourceUrl = '资源URL'
t.menu.resource = 'Authorized Resource'
t.menu.resourceUrl = 'Resource URL'
t.menu.resourceMethod = 'Request methods'
t.menu.resourceAddItem = '添加一项'
t.menu.resourceAddItem = 'Add Item'
t.params = {}
t.params.name = 'Parameter Name'
@ -616,7 +624,7 @@ t.params.paramCode = 'Parameter Code'
t.params.paramValue = 'Parameter Value'
t.params.paramStdValue = 'Standard Parameter Code'
t.params.plctitle = 'PLC Collection Parameters'
t.params.plcid = 'PLC连接表ID'
t.params.plcid = 'PLC ID'
t.params.remark = 'Remark'
t.role = {}
@ -647,5 +655,6 @@ t.user.validate = {}
t.user.validate.confirmPassword = 'The two passwords are different. Please check again.'
t.user.select = 'Select an user'
t.user.selecterror = 'Pick up a record'
t.user.userTable = ' User Table'
export default t

View File

@ -187,6 +187,10 @@ t.refdate = '按日期'
t.hour = '小时'
t.yes = '是'
t.no = '否'
t.LoginRecords = ' 登录日志'
t.operationsRecords = ' 操作日志'
t.allIcons= '所有图标'
t.err= '错误'
t.errors = {}
@ -413,6 +417,8 @@ t.validate = {}
t.validate.required = '必填项不能为空'
t.validate.format = '{attr}格式错误'
t.validate.keyValueWarning = '该数值必须是100以内的正整数'
t.validate.requiredRole = '至少选择一个角色'
t.upload = {}
t.upload.title = '上传资料'
@ -557,7 +563,7 @@ t.dict.remark = '备注'
t.dict.createDate = '创建时间'
t.logError = {}
t.logError.requestUri = '请求URI'
t.logError.requestUri = '请求URL'
t.logError.requestMethod = '请求方式'
t.logError.requestParams = '请求参数'
t.logError.ip = '操作IP'
@ -584,7 +590,7 @@ t.logOperation.status0 = '失败'
t.logOperation.status1 = '成功'
t.logOperation.creatorName = '用户名'
t.logOperation.operation = '用户操作'
t.logOperation.requestUri = '请求URI'
t.logOperation.requestUri = '请求URL'
t.logOperation.requestMethod = '请求方式'
t.logOperation.requestParams = '请求参数'
t.logOperation.requestTime = '请求时长'
@ -593,7 +599,8 @@ t.logOperation.userAgent = 'User-Agent'
t.logOperation.createDate = '创建时间'
t.menu = {}
t.menu.name = '名称'
t.menu.name = '中文名'
t.menu.nameEn = '英文名'
t.menu.icon = '图标'
t.menu.type = '类型'
t.menu.type0 = '菜单'
@ -647,6 +654,7 @@ t.user.validate = {}
t.user.validate.confirmPassword = '确认密码与密码输入不一致'
t.user.select = '选择用户'
t.user.selecterror = '请选择一条记录'
t.user.userTable = ' 用户表'
export default t

View File

@ -1,7 +1,7 @@
<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 :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>
@ -9,7 +9,7 @@
<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-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>
@ -30,13 +30,7 @@
<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 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>
@ -104,7 +98,7 @@ export default {
handleDestroyDialog() {
setTimeout(() => {
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200);
}, /** after dialog animated */ 200)
},
//
pauseHandle(id) {
@ -115,12 +109,15 @@ export default {
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.pause') }), this.$t('prompt.title'), {
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 }) => {
})
.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)
}
@ -132,8 +129,10 @@ export default {
this.getDataList()
}
})
}).catch(() => {})
}).catch(() => {})
})
.catch(() => {})
})
.catch(() => {})
},
//
resumeHandle(id) {
@ -144,12 +143,15 @@ export default {
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.resume') }), this.$t('prompt.title'), {
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 }) => {
})
.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)
}
@ -161,8 +163,10 @@ export default {
this.getDataList()
}
})
}).catch(() => {})
}).catch(() => {})
})
.catch(() => {})
})
.catch(() => {})
},
//
runHandle(id) {
@ -173,12 +177,15 @@ export default {
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.run') }), this.$t('prompt.title'), {
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 }) => {
})
.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)
}
@ -190,8 +197,10 @@ export default {
this.getDataList()
}
})
}).catch(() => {})
}).catch(() => {})
})
.catch(() => {})
})
.catch(() => {})
},
//
logHandle() {
@ -199,6 +208,17 @@ export default {
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)
}
}
}

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,30 +75,34 @@ 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 = [
for (let i = 0; i < this.dataLength; i++) {
this.tableConfigs[i] = [
{
type: 'index',
name: i18n.t('index')
@ -111,9 +116,12 @@ export default {
// })
...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) => {
@ -125,4 +133,5 @@ export default {
}
}
}
}
</script>

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

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' }]
}
}
@ -99,7 +119,7 @@ export default {
handleDestroyDialog() {
setTimeout(() => {
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200);
}, /** 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
if (this.$i18n.locale == 'zh-CN') {
this.dataForm.parentName = data.name
}
if (this.$i18n.locale == 'en') {
this.dataForm.parentNameEn = data.nameEn
}
this.menuListVisible = false
},
// ,
@ -164,10 +190,11 @@ export default {
//
dataFormSubmitHandle: debounce(
function () {
this.$refs['dataForm'].validate(valid => {
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' }]
}
}
},
@ -116,7 +122,7 @@ export default {
handleDestroyDialog() {
setTimeout(() => {
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200);
}, /** 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
}
@ -170,7 +176,7 @@ export default {
//
dataFormSubmitHandle: debounce(
function () {
this.$refs['dataForm'].validate(valid => {
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: {