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,17 +46,17 @@
: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>
</template> </template>
<script> <script>
import AddOrUpdate from './product-add-or-update' import AddOrUpdate from './product-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
@ -188,22 +73,22 @@
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
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) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
@ -215,30 +100,32 @@
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
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 ? '删除' : '批量删除'}]操作?`, '提示', {
@ -250,7 +137,7 @@
url: this.$http.adornUrl('/monitoring/product/delete'), url: this.$http.adornUrl('/monitoring/product/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
@ -267,5 +154,5 @@
}) })
} }
} }
} }
</script> </script>

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

@ -48,7 +48,7 @@
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import { isEmail, isMobile } from '@/utils/validate' import { isEmail, isMobile } from '@/utils/validate'
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
roleList: [], roleList: [],
@ -70,7 +70,7 @@ export default {
} }
}, },
computed: { computed: {
dataRule () { dataRule() {
var validatePassword = (rule, value, callback) => { var validatePassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) { if (!this.dataForm.id && !/\S/.test(value)) {
return callback(new Error(this.$t('validate.required'))) return callback(new Error(this.$t('validate.required')))
@ -88,51 +88,35 @@ 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' }
]
} }
} }
}, },
methods: { methods: {
init () { init() {
this.visible = true this.visible = true
this.dataForm.deptId = '' this.dataForm.deptId = ''
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()
} }
@ -140,17 +124,22 @@ 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>