This commit is contained in:
lb 2022-08-04 16:20:07 +08:00
parent affea8af59
commit ffad1a2643
26 changed files with 368 additions and 488 deletions

View File

@ -178,7 +178,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenfile/list'), url: this.$http.adornUrl('/monitoring/equipmenfile/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -160,7 +160,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmengroup/list'), url: this.$http.adornUrl('/monitoring/equipmengroup/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -154,7 +154,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenattr/list'), url: this.$http.adornUrl('/monitoring/equipmenattr/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -160,7 +160,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenalarmlog/list'), url: this.$http.adornUrl('/monitoring/equipmenalarmlog/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -190,7 +190,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmengroupalarm/list'), url: this.$http.adornUrl('/monitoring/equipmengroupalarm/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -208,7 +208,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenplc/list'), url: this.$http.adornUrl('/monitoring/equipmenplc/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -154,7 +154,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenplcconnect/list'), url: this.$http.adornUrl('/monitoring/equipmenplcconnect/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -238,7 +238,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenplcparam/list'), url: this.$http.adornUrl('/monitoring/equipmenplcparam/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -184,7 +184,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenquantity/list'), url: this.$http.adornUrl('/monitoring/equipmenquantity/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -178,7 +178,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenstatuslog/list'), url: this.$http.adornUrl('/monitoring/equipmenstatuslog/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -172,7 +172,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmentype/list'), url: this.$http.adornUrl('/monitoring/equipmentype/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -178,7 +178,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmentypefile/list'), url: this.$http.adornUrl('/monitoring/equipmentypefile/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -178,7 +178,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/producarrt/list'), url: this.$http.adornUrl('/monitoring/producarrt/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -10,144 +10,29 @@
<el-button v-if="$hasPermission('monitoring:product:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:product:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="ID"></el-table-column>
v-loading="dataListLoading" <el-table-column prop="code" header-align="center" align="center" label="编码"></el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="name" header-align="center" align="center" label="名称"></el-table-column>
style="width: 100%;"> <el-table-column prop="description" header-align="center" align="center" label="描述"></el-table-column>
<el-table-column <el-table-column prop="externalCode" header-align="center" align="center" label="外部编码,用于对照外部系统的编码"></el-table-column>
type="selection" <el-table-column prop="specifications" header-align="center" align="center" label="规格"></el-table-column>
header-align="center" <el-table-column prop="unitDictValue" header-align="center" align="center" label="单位value对应到数据字典label_value"></el-table-column>
align="center" <el-table-column prop="area" header-align="center" align="center" label="一单位的面积(平方米)"></el-table-column>
width="50"> <el-table-column prop="processTime" header-align="center" align="center" label="加工一单位产品需要的时间"></el-table-column>
</el-table-column> <el-table-column prop="typeDictValue" header-align="center" align="center" label="产品类型value对应到数据字典label_value"></el-table-column>
<el-table-column <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"></el-table-column>
prop="id" <el-table-column prop="remark" header-align="center" align="center" label="备注"></el-table-column>
header-align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"></el-table-column>
align="center" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"></el-table-column>
label="ID"> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"></el-table-column>
</el-table-column> <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"></el-table-column>
<el-table-column <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"></el-table-column>
prop="code" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"></el-table-column>
header-align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"></el-table-column>
align="center" <el-table-column prop="version" header-align="center" align="center" label="版本号"></el-table-column>
label="编码"> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="名称">
</el-table-column>
<el-table-column
prop="description"
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="externalCode"
header-align="center"
align="center"
label="外部编码,用于对照外部系统的编码">
</el-table-column>
<el-table-column
prop="specifications"
header-align="center"
align="center"
label="规格">
</el-table-column>
<el-table-column
prop="unitDictValue"
header-align="center"
align="center"
label="单位value对应到数据字典label_value">
</el-table-column>
<el-table-column
prop="area"
header-align="center"
align="center"
label="一单位的面积(平方米)">
</el-table-column>
<el-table-column
prop="processTime"
header-align="center"
align="center"
label="加工一单位产品需要的时间">
</el-table-column>
<el-table-column
prop="typeDictValue"
header-align="center"
align="center"
label="产品类型value对应到数据字典label_value">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
@ -161,8 +46,8 @@
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pageSize" :page-size="pageSize"
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper"
</el-pagination> ></el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
@ -196,12 +81,12 @@
getDataList() { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/product/list'), url: this.$http.adornUrl('/monitoring/product/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
@ -238,7 +123,9 @@
}, },
// //
deleteHandle(id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
? [id]
: this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {

View File

@ -184,7 +184,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/productionline/list'), url: this.$http.adornUrl('/monitoring/productionline/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -124,7 +124,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/productionlinerecsch/list'), url: this.$http.adornUrl('/monitoring/productionlinerecsch/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -154,7 +154,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/qualityinspectiondet/list'), url: this.$http.adornUrl('/monitoring/qualityinspectiondet/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -184,7 +184,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/qualityinspectionrecord/list'), url: this.$http.adornUrl('/monitoring/qualityinspectionrecord/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -148,7 +148,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/qualityinspectiontype/list'), url: this.$http.adornUrl('/monitoring/qualityinspectiontype/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -184,7 +184,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/reporsheet/list'), url: this.$http.adornUrl('/monitoring/reporsheet/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -166,7 +166,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/reporsheecategory/list'), url: this.$http.adornUrl('/monitoring/reporsheecategory/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -160,7 +160,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/sysfile/list'), url: this.$http.adornUrl('/monitoring/sysfile/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -148,7 +148,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/sysfiletype/list'), url: this.$http.adornUrl('/monitoring/sysfiletype/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -178,7 +178,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/workshopsection/list'), url: this.$http.adornUrl('/monitoring/workshopsection/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -154,7 +154,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/workshopsectionequipment/list'), url: this.$http.adornUrl('/monitoring/workshopsectionequipment/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,

View File

@ -88,38 +88,24 @@ export default {
} }
var validateEmail = (rule, value, callback) => { var validateEmail = (rule, value, callback) => {
if (value && !isEmail(value)) { if (value && !isEmail(value)) {
return callback(new Error(this.$t('validate.format', { 'attr': this.$t('user.email') }))) return callback(new Error(this.$t('validate.format', { attr: this.$t('user.email') })))
} }
callback() callback()
} }
var validateMobile = (rule, value, callback) => { var validateMobile = (rule, value, callback) => {
if (value && !isMobile(value)) { if (value && !isMobile(value)) {
return callback(new Error(this.$t('validate.format', { 'attr': this.$t('user.mobile') }))) return callback(new Error(this.$t('validate.format', { attr: this.$t('user.mobile') })))
} }
callback() callback()
} }
return { return {
username: [ username: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } deptName: [{ required: true, message: this.$t('validate.required'), trigger: 'change' }],
], password: [{ validator: validatePassword, trigger: 'blur' }],
deptName: [ confirmPassword: [{ validator: validateConfirmPassword, trigger: 'blur' }],
{ required: true, message: this.$t('validate.required'), trigger: 'change' } realName: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
], email: [{ validator: validateEmail, trigger: 'blur' }],
password: [ mobile: [{ validator: validateMobile, trigger: 'blur' }]
{ validator: validatePassword, trigger: 'blur' }
],
confirmPassword: [
{ validator: validateConfirmPassword, trigger: 'blur' }
],
realName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
email: [
{ validator: validateEmail, trigger: 'blur' }
],
mobile: [
{ validator: validateMobile, trigger: 'blur' }
]
} }
} }
}, },
@ -130,9 +116,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.roleIdListDefault = [] this.roleIdListDefault = []
Promise.all([ Promise.all([this.getRoleList()]).then(() => {
this.getRoleList()
]).then(() => {
if (this.dataForm.id) { if (this.dataForm.id) {
this.getInfo() this.getInfo()
} }
@ -141,16 +125,21 @@ export default {
}, },
// //
getRoleList() { getRoleList() {
return this.$http.get(this.$http.adornUrl('/sys/role/list')).then(({ data: res }) => { return this.$http
.get(this.$http.adornUrl('/sys/role/list'))
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.roleList = res.data this.roleList = res.data
}).catch(() => {}) })
.catch(() => {})
}, },
// //
getInfo() { getInfo() {
this.$http.get(this.$http.adornUrl(`/sys/user/${this.dataForm.id}`)).then(({ data: res }) => { this.$http
.get(this.$http.adornUrl(`/sys/user/${this.dataForm.id}`))
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -167,21 +156,21 @@ export default {
} }
this.roleIdListDefault.push(res.data.roleIdList[i]) this.roleIdListDefault.push(res.data.roleIdList[i])
} }
}).catch(() => {}) })
.catch(() => {})
}, },
// //
dataFormSubmitHandle: debounce(function () { dataFormSubmitHandle: debounce(
this.$refs['dataForm'].validate((valid) => { function() {
this.$refs['dataForm'].validate(valid => {
if (!valid) { if (!valid) {
return false return false
} }
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/user', { this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/user', {
...this.dataForm, ...this.dataForm,
roleIdList: [ roleIdList: [...this.dataForm.roleIdList, ...this.roleIdListDefault]
...this.dataForm.roleIdList, })
...this.roleIdListDefault .then(({ data: res }) => {
]
}).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -194,9 +183,13 @@ export default {
this.$emit('refreshDataList') this.$emit('refreshDataList')
} }
}) })
}).catch(() => {})
}) })
}, 1000, { 'leading': true, 'trailing': false }) .catch(() => {})
})
},
1000,
{ leading: true, trailing: false }
)
} }
} }
</script> </script>