系统参数
This commit is contained in:
@@ -99,3 +99,29 @@ export const sysRoleMenu = (roleId, menus) => post('api/sysRole/menu', {
|
|||||||
// 1.6 查询菜单树
|
// 1.6 查询菜单树
|
||||||
export const menuQuery = (roleId, menus) => post('api/sysRole/menuQuery', {
|
export const menuQuery = (roleId, menus) => post('api/sysRole/menuQuery', {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 系统参数
|
||||||
|
// 1.1 参数列表
|
||||||
|
export const paramQuery = (page, size) => post('api/param/query', {
|
||||||
|
page: page,
|
||||||
|
size: size
|
||||||
|
})
|
||||||
|
// 1.2 添加参数
|
||||||
|
export const paramAdd = (code, name, value, remark) => post('api/param/add', {
|
||||||
|
code: code,
|
||||||
|
name: name,
|
||||||
|
value: value,
|
||||||
|
remark: remark
|
||||||
|
})
|
||||||
|
// 1.3 修改参数
|
||||||
|
export const paramEdit = (id, code, name, value, remark) => post('api/param/edit', {
|
||||||
|
id: id,
|
||||||
|
code: code,
|
||||||
|
name: name,
|
||||||
|
value: value,
|
||||||
|
remark: remark
|
||||||
|
})
|
||||||
|
// 1.4 删除参数
|
||||||
|
export const paramDelete = (paramsIds) => post('api/param/delete', {
|
||||||
|
paramsIds: paramsIds
|
||||||
|
})
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ export default {
|
|||||||
this.remark = e.remark
|
this.remark = e.remark
|
||||||
if (this.rolename === '') {
|
if (this.rolename === '') {
|
||||||
this.unclick = true
|
this.unclick = true
|
||||||
|
} else {
|
||||||
|
this.unclick = false
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case '3':
|
case '3':
|
||||||
|
|||||||
@@ -17,14 +17,14 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr v-for="(e, i) in datalist" :key="i">
|
<tr v-for="(e, i) in datalist" :key="i">
|
||||||
<td>{{i+1}}</td>
|
<td>{{i+1}}</td>
|
||||||
<td>platform</td>
|
<td>{{ e.code }}</td>
|
||||||
<td>平台名称</td>
|
<td>{{ e.name }}</td>
|
||||||
<td>智能搬运车系统</td>
|
<td>{{ e.value }}</td>
|
||||||
<td></td>
|
<td>{{ e.remark }}</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<button class="button button--primary grid_button" @click="showDialog('2')">修改</button>
|
<button class="button button--primary grid_button" @click="showDialog('2', e)">修改</button>
|
||||||
<button class="button button--primary grid_button" @click="showDialog('3')">删除</button>
|
<button class="button button--primary grid_button" @click="showDialog('3', e)">删除</button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -34,6 +34,7 @@
|
|||||||
ref="child"
|
ref="child"
|
||||||
:title="title"
|
:title="title"
|
||||||
:type="type"
|
:type="type"
|
||||||
|
:unclick="unclick"
|
||||||
@toSure="toSureDialog"
|
@toSure="toSureDialog"
|
||||||
>
|
>
|
||||||
<div v-if="type === '1' || type === '2'" class="form_wraper">
|
<div v-if="type === '1' || type === '2'" class="form_wraper">
|
||||||
@@ -55,7 +56,7 @@
|
|||||||
<div class="form_item">
|
<div class="form_item">
|
||||||
<div class="form_item__label"><i>*</i>数值</div>
|
<div class="form_item__label"><i>*</i>数值</div>
|
||||||
<div class="form_item__content">
|
<div class="form_item__content">
|
||||||
<input type="text" class="form_item__input" v-model="number">
|
<input type="text" class="form_item__input" v-model="value">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -75,20 +76,22 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import jxDialog from '@components/dialog.vue'
|
import jxDialog from '@components/dialog.vue'
|
||||||
|
import { paramQuery, paramAdd, paramEdit, paramDelete } from '@config/getData2.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
jxDialog
|
jxDialog
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
datalist: [{name: ''}, {name: 'a'}, {name: 'a'}, {name: 'a'}, {name: 'a'}, {name: 'a'}, {name: 'a'}],
|
datalist: [],
|
||||||
active: false,
|
active: false,
|
||||||
type: '',
|
type: '',
|
||||||
title: '',
|
title: '',
|
||||||
code: '',
|
code: '',
|
||||||
name: '',
|
name: '',
|
||||||
number: '',
|
value: '',
|
||||||
remark: ''
|
remark: '',
|
||||||
|
unclick: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -106,26 +109,150 @@ export default {
|
|||||||
default:
|
default:
|
||||||
this.title = ''
|
this.title = ''
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
code (val) {
|
||||||
|
if ((this.type === '1' || this.type === '2') && (val === '' || this.name === '' || this.value === '')) {
|
||||||
|
this.unclick = true
|
||||||
|
} else {
|
||||||
|
this.unclick = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
name (val) {
|
||||||
|
if ((this.type === '1' || this.type === '2') && (val === '' || this.code === '' || this.value === '')) {
|
||||||
|
this.unclick = true
|
||||||
|
} else {
|
||||||
|
this.unclick = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
value (val) {
|
||||||
|
if ((this.type === '1' || this.type === '2') && (val === '' || this.code === '' || this.name === '')) {
|
||||||
|
this.unclick = true
|
||||||
|
} else {
|
||||||
|
this.unclick = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created () {
|
||||||
|
this._paramQuery()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showDialog (type) {
|
async _paramQuery () {
|
||||||
|
let res = await paramQuery('0', '100')
|
||||||
|
this.datalist = [...res]
|
||||||
|
},
|
||||||
|
showDialog (type, e) {
|
||||||
this.type = type
|
this.type = type
|
||||||
this.$refs.child.active = true
|
this.$refs.child.active = true
|
||||||
|
switch (type) {
|
||||||
|
case '1':
|
||||||
|
this.code = ''
|
||||||
|
this.name = ''
|
||||||
|
this.value = ''
|
||||||
|
this.unclick = true
|
||||||
|
break
|
||||||
|
case '2':
|
||||||
|
this.code = e.code
|
||||||
|
this.name = e.name
|
||||||
|
this.value = e.value
|
||||||
|
if (!this.code || !this.name || !this.value) {
|
||||||
|
this.unclick = true
|
||||||
|
} else {
|
||||||
|
this.unclick = false
|
||||||
|
}
|
||||||
|
this.pkObj = e
|
||||||
|
break
|
||||||
|
case '3':
|
||||||
|
this.unclick = false
|
||||||
|
this.pkObj = e
|
||||||
|
break
|
||||||
|
}
|
||||||
},
|
},
|
||||||
toSureDialog (type) {
|
toSureDialog (type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case '1':
|
case '1':
|
||||||
console.log(type)
|
this._paramAdd()
|
||||||
break
|
break
|
||||||
case '2':
|
case '2':
|
||||||
console.log(type)
|
this._paramEdit()
|
||||||
break
|
break
|
||||||
case '3':
|
case '3':
|
||||||
console.log(type)
|
this._paramDelete()
|
||||||
break
|
break
|
||||||
default:
|
}
|
||||||
console.log(type)
|
},
|
||||||
|
async _paramAdd () {
|
||||||
|
this.$refs.child.disabled = true
|
||||||
|
if (!this.code) {
|
||||||
|
this.toast('编码不能为空')
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.name) {
|
||||||
|
this.toast('名字不能为空')
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.value) {
|
||||||
|
this.toast('数值不能为空')
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
let res = await paramAdd(this.code, this.name, this.value, this.remark)
|
||||||
|
if (res.code === '1') {
|
||||||
|
this._usersQuery()
|
||||||
|
}
|
||||||
|
this.toast(res.desc)
|
||||||
|
this.$refs.child.active = false
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
} catch (e) {
|
||||||
|
this.$refs.child.active = false
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async _paramEdit () {
|
||||||
|
this.$refs.child.disabled = true
|
||||||
|
if (!this.code) {
|
||||||
|
this.toast('编码不能为空')
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.name) {
|
||||||
|
this.toast('名字不能为空')
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.value) {
|
||||||
|
this.toast('数值不能为空')
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
let res = await paramEdit(this.pkObj.id, this.code, this.name, this.value, this.remark)
|
||||||
|
if (res.code === '1') {
|
||||||
|
this._usersQuery()
|
||||||
|
}
|
||||||
|
this.toast(res.desc)
|
||||||
|
this.$refs.child.active = false
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
} catch (e) {
|
||||||
|
this.$refs.child.active = false
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async _paramDelete () {
|
||||||
|
this.$refs.child.disabled = true
|
||||||
|
try {
|
||||||
|
let res = await paramDelete([this.pkObj.id])
|
||||||
|
if (res.code === '1') {
|
||||||
|
this._usersQuery()
|
||||||
|
}
|
||||||
|
this.toast(res.desc)
|
||||||
|
this.$refs.child.active = false
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
} catch (e) {
|
||||||
|
this.$refs.child.active = false
|
||||||
|
this.$refs.child.disabled = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,6 +204,8 @@ export default {
|
|||||||
})
|
})
|
||||||
if (this.username === '') {
|
if (this.username === '') {
|
||||||
this.unclick = true
|
this.unclick = true
|
||||||
|
} else {
|
||||||
|
this.unclick = false
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case '3':
|
case '3':
|
||||||
|
|||||||
Reference in New Issue
Block a user