Commit fef7fcc8 authored by liuyang's avatar liuyang

参数管理功能完成

parent 20e7aaa7
...@@ -50,15 +50,15 @@ ...@@ -50,15 +50,15 @@
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
if (this.dataForm.id) { if (this.dataForm.id) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/sys/config/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/api/sys/config/info/${this.dataForm.id}`),
method: 'get', method: 'get',
params: this.$http.adornParams() params: this.$http.adornParams()
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 200) {
this.dataForm.paramKey = data.config.paramKey this.dataForm.paramKey = data.paramKey
this.dataForm.paramValue = data.config.paramValue this.dataForm.paramValue = data.paramValue
this.dataForm.remark = data.config.remark this.dataForm.remark = data.remark
}
}) })
} }
}) })
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/sys/config/${!this.dataForm.id ? 'save' : 'update'}`), url: this.$http.adornUrl(`/api/sys/config/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': this.dataForm.id || undefined, 'id': this.dataForm.id || undefined,
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
'remark': this.dataForm.remark 'remark': this.dataForm.remark
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 200) { if (!data) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
......
...@@ -101,21 +101,18 @@ ...@@ -101,21 +101,18 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/sys/config/list'), url: this.$http.adornUrl('/api/sys/config/list'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'pageIndex': this.pageIndex,
'limit': this.pageSize, 'pageSize': this.pageSize,
'paramKey': this.dataForm.paramKey 'paramKey': this.dataForm.paramKey
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 200) {
this.dataList = data.page.list this.dataList = data.result
this.totalCount= data.page.totalCount this.totalCount= data.total
} else {
this.dataList = []
this.totalCount= 0
}
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
...@@ -152,11 +149,11 @@ ...@@ -152,11 +149,11 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/sys/config/delete'), url: this.$http.adornUrl('/api/sys/config/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 === 200) { if (!data) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
...@@ -166,7 +163,7 @@ ...@@ -166,7 +163,7 @@
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.message)
} }
}) })
}).catch(() => {}) }).catch(() => {})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment