Commit 714f5989 authored by levante's avatar levante

123

parent 8e2ccf1c
...@@ -245,19 +245,24 @@ export default { ...@@ -245,19 +245,24 @@ export default {
GET_BUSINESS_LIST: '/api/ifttt-center/business/system/query', GET_BUSINESS_LIST: '/api/ifttt-center/business/system/query',
POST_ADD_BUSINESS_RECORD: '/api/ifttt-center/business/system', POST_ADD_BUSINESS_RECORD: '/api/ifttt-center/business/system',
DELETE_BUSINESS_RECORD: '/api/ifttt-center/business/system/delete/{id}', DELETE_BUSINESS_RECORD: '/api/ifttt-center/business/system/delete/{id}',
PUT_BUSINESS_RECORD: '/api/ifttt-center/business/system/update/{id}',
// trigger // trigger
GET_TRIGGER_LIST: '/api/ifttt-center/trigger/query', GET_TRIGGER_LIST: '/api/ifttt-center/trigger/query',
POST_ADD_TRIGGER_RECORD: '/api/ifttt-center/trigger', POST_ADD_TRIGGER_RECORD: '/api/ifttt-center/trigger',
DELETE_TRIGGER_RECORD: '/api/ifttt-center/trigger/delete/{id}', DELETE_TRIGGER_RECORD: '/api/ifttt-center/trigger/delete/{id}',
PUT_TRIGGER_RECORD: '/api/ifttt-center/trigger/update/{id}',
// action // action
GET_ACTION_LIST: '/api/ifttt-center/action/query', GET_ACTION_LIST: '/api/ifttt-center/action/query',
POST_ADD_ACTION_RECORD: '/api/ifttt-center/action', POST_ADD_ACTION_RECORD: '/api/ifttt-center/action',
DELETE_ACTION_RECORD: '/api/ifttt-center/action/delete/{id}', DELETE_ACTION_RECORD: '/api/ifttt-center/action/delete/{id}',
PUT_ACTION_RECORD: '/api/ifttt-center/action/update/{id}',
// rules // rules
GET_RULES_LIST: '/api/ifttt-center/iftttrule/query', GET_RULES_LIST: '/api/ifttt-center/iftttrule/query',
POST_ADD_RULE_RECORD: '/api/ifttt-center/iftttrule', POST_ADD_RULE_RECORD: '/api/ifttt-center/iftttrule',
DELETE_RULE_RECORD: '/api/ifttt-center/iftttrule/delete/{id}' DELETE_RULE_RECORD: '/api/ifttt-center/iftttrule/delete/{id}',
PUT_RULE_RECORD: '/api/ifttt-center/iftttrule/update/{id}',
GET_RULES_BY_TRIGGER_CODE: '/api/ifttt-center/iftttrule/trigger/code/{code}'
} }
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
}" }"
> >
<span slot="operation" slot-scope="text, record"> <span slot="operation" slot-scope="text, record">
<span class="actionBtn" @click="onEdit(record)">编辑</span> <span class="actionBtn" @click="onEdit(record.id)">编辑</span>
<span class="actionBtn" @click="onDelete(record.id)">删除</span> <span class="actionBtn" @click="onDelete(record.id)">删除</span>
</span> </span>
<span slot="no" slot-scope="text, record, index"> <span slot="no" slot-scope="text, record, index">
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
v-model="isShow" v-model="isShow"
width="900px" width="900px"
style="padding: 20px" style="padding: 20px"
centered
destroyOnClose
@cancel="cancelModal()"
> >
<template slot="footer"> <template slot="footer">
<a-button key="back" @click="isShow = !isShow"> <a-button key="back" @click="isShow = !isShow">
...@@ -228,6 +231,7 @@ export default { ...@@ -228,6 +231,7 @@ export default {
}, },
], ],
businessOptionsList: [], businessOptionsList: [],
editId: null
} }
}, },
mounted() { mounted() {
...@@ -235,6 +239,25 @@ export default { ...@@ -235,6 +239,25 @@ export default {
this.getBusinessOptions() this.getBusinessOptions()
}, },
methods: { methods: {
onEdit(id) {
this.rowLoop = [{
name: '',
key: '',
randomNum: Math.random()
}]
this.isShow = !this.isShow
let record = this.list.find(item => item.id == id)
console.log(record)
if(!!record) {
this.editId = id
for (let i = 0; i < Object.keys(record).length; i++) {
this.form.getFieldDecorator(Object.keys(record)[i], {initialValue: Object.values(record)[i]})
}
}
},
confirmJson(rule, value, callback) { confirmJson(rule, value, callback) {
if (!value || value == undefined) { if (!value || value == undefined) {
callback('不能为空!') callback('不能为空!')
...@@ -321,6 +344,10 @@ export default { ...@@ -321,6 +344,10 @@ export default {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
}, },
onCreate() { onCreate() {
this.rowLoop = [{
name: '',
key: ''
}]
this.current = 0 this.current = 0
this.form.resetFields() this.form.resetFields()
this.isShow = !this.isShow this.isShow = !this.isShow
...@@ -333,22 +360,44 @@ export default { ...@@ -333,22 +360,44 @@ export default {
handleNextStep() { handleNextStep() {
this.current += 1 this.current += 1
}, },
cancelModal() {
this.form.resetFields()
this.current = 0
this.isShow = !this.isShow
},
handleRegisterOk() { handleRegisterOk() {
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
let formContent = this.form.getFieldsValue() let formContent = this.form.getFieldsValue()
this.$ajax.post({
url: this.$api.POST_ADD_ACTION_RECORD, if(!!this.editId) {
params: formContent this.$ajax.put({
}).then(res => { url: this.$api.PUT_ACTION_RECORD.replace('{id}', this.editId),
if(res.code == '200') { params: formContent
this.$message.success('新增成功!') }).then(res => {
this.isShow = !this.isShow if(res.code == '200') {
this.form.resetFields() this.$message.success('修改成功!')
this.getList() this.cancelModal()
} this.form.resetFields()
}) this.getList()
}
})
} else {
this.$ajax.post({
url: this.$api.POST_ADD_ACTION_RECORD,
params: formContent
}).then(res => {
if(res.code == '200') {
this.$message.success('新增成功!')
this.cancelModal()
this.form.resetFields()
this.getList()
}
})
}
this.editId = null
} else { } else {
this.$message.info('请填写表单所有项目!') this.$message.info('请填写表单所有项目!')
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
}" }"
> >
<span slot="operation" slot-scope="text, record"> <span slot="operation" slot-scope="text, record">
<span class="actionBtn" @click="onEdit(record)">编辑</span> <span class="actionBtn" @click="onEdit(record.id)">编辑</span>
<span class="actionBtn" @click="onDelete(record.id)">删除</span> <span class="actionBtn" @click="onDelete(record.id)">删除</span>
</span> </span>
<span slot="no" slot-scope="text, record, index"> <span slot="no" slot-scope="text, record, index">
...@@ -35,11 +35,14 @@ ...@@ -35,11 +35,14 @@
v-model="isShow" v-model="isShow"
width="900px" width="900px"
style="padding: 20px" style="padding: 20px"
centered
@cancel='cancelModal()'
destroyOnClose
> >
<a-steps :current="current" style="margin-bottom: 20px"> <a-steps :current="current" style="margin-bottom: 20px">
<a-step v-for="item in steps" :key="item.title" :title="item.title" /> <a-step v-for="item in steps" :key="item.title" :title="item.title" />
</a-steps> </a-steps>
<div class="steps-content"> <div class="steps-content" style="height: 300px; overflow-y: scroll">
<!-- {{ steps[current].content }} --> <!-- {{ steps[current].content }} -->
<a-form :form="form"> <a-form :form="form">
<div v-show="current == 0"> <div v-show="current == 0">
...@@ -276,7 +279,8 @@ export default { ...@@ -276,7 +279,8 @@ export default {
second: '', second: '',
third: '' third: ''
}], }],
businessOptionsList: [] businessOptionsList: [],
editId: null,
} }
}, },
mounted() { mounted() {
...@@ -284,6 +288,46 @@ export default { ...@@ -284,6 +288,46 @@ export default {
this.getBusinessOptions() this.getBusinessOptions()
}, },
methods: { methods: {
cancelModal() {
this.form.resetFields()
this.current = 0
this.isShow = !this.isShow
},
onEdit(id) {
this.rowLoop = [{
name: '',
key: '',
randomNum: Math.random()
}]
this.isShow = !this.isShow
let record = this.list.find(item => item.id == id)
console.log(record)
if(!!record) {
this.editId = id
console.log(Object.keys(record))
for (let i = 0; i < Object.keys(record).length; i++) {
if(Object.keys(record)[i] !== 'args') {
this.form.getFieldDecorator(Object.keys(record)[i], {initialValue: Object.values(record)[i]})
} else {
for (let j = 0; j < Object.values(record)[i].length; j++) {
console.log(Object.values(record)[i][j])
if(j !== 0) {
this.addRow()
}
this.form.getFieldDecorator('key' + j, {initialValue: Object.values(record)[i][j].key})
this.form.getFieldDecorator('type' + j, {initialValue: Object.values(record)[i][j].type})
this.form.getFieldDecorator('name' + j, {initialValue: Object.values(record)[i][j].name})
}
}
}
}
// this.form.setFieldsValue(record)
},
initPagination() { initPagination() {
this.pagination.pageNo = 1 this.pagination.pageNo = 1
this.pagination.current = 1 this.pagination.current = 1
...@@ -350,6 +394,10 @@ export default { ...@@ -350,6 +394,10 @@ export default {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
}, },
onCreate() { onCreate() {
this.rowLoop = [{
name: '',
key: ''
}]
this.current = 0 this.current = 0
this.form.resetFields() this.form.resetFields()
this.isShow = !this.isShow this.isShow = !this.isShow
...@@ -390,23 +438,37 @@ export default { ...@@ -390,23 +438,37 @@ export default {
args: paramsJson args: paramsJson
} }
this.$ajax.post({ if(!!this.editId) {
url: this.$api.POST_ADD_TRIGGER_RECORD, this.$ajax.put({
params: finalParse url: this.$api.PUT_TRIGGER_RECORD.replace('{id}', this.editId),
}).then(res => { params: finalParse
if(res.code == '200') { }).then(res => {
this.$message.success('新增成功!') if(res.code == '200') {
this.isShow = !this.isShow this.$message.success('修改成功!')
this.form.resetFields() this.cancelModal()
this.getList() this.form.resetFields()
} this.getList()
}) }
})
} else {
this.$ajax.post({
url: this.$api.POST_ADD_TRIGGER_RECORD,
params: finalParse
}).then(res => {
if(res.code == '200') {
this.$message.success('新增成功!')
this.cancelModal()
this.form.resetFields()
this.getList()
}
})
}
this.editId = null
} else { } else {
this.$message.info('请填写表单所有项目!') this.$message.info('请填写表单所有项目!')
} }
}) })
console.log(finalParse)
}, },
addRow() { addRow() {
this.rowLoop.push({ this.rowLoop.push({
......
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
{{index+1}} {{index+1}}
</span> </span>
</a-table> </a-table>
<a-modal title="系统注册" v-model="isShow" width='900px' style="padding: 20px"> <a-modal title="系统注册" v-model="isShow" width='900px' style="padding: 20px;" destroyOnClose :centered='true' @cancel='cancelModal'>
<a-steps :current="current" style="margin-bottom: 20px"> <a-steps :current="current" style="margin-bottom: 20px">
<a-step v-for="item in steps" :key="item.title" :title="item.title" /> <a-step v-for="item in steps" :key="item.title" :title="item.title" />
</a-steps> </a-steps>
<div class="steps-content"> <div class="steps-content" style="height: 300px; overflow-y: scroll">
<!-- {{ steps[current].content }} --> <!-- {{ steps[current].content }} -->
<a-form :form='form'> <a-form :form='form'>
<div v-show="current == 0"> <div v-show="current == 0">
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
</a-form-item> </a-form-item>
<a-row> <a-row>
{{rowLoop}}
<a-col :span='5' style="text-align: right; color: black">授权参数:</a-col> <a-col :span='5' style="text-align: right; color: black">授权参数:</a-col>
<a-col :span='19'> <a-col :span='19'>
<a-row v-for="(item, index) in rowLoop" :key="index"> <a-row v-for="(item, index) in rowLoop" :key="index">
...@@ -79,7 +80,7 @@ ...@@ -79,7 +80,7 @@
</a-col> </a-col>
<a-col :span='1' :offset='1'> <a-col :span='1' :offset='1'>
<a-button icon='minus' @click="deleteRow(index)" /> <a-button icon='minus' v-if="index !== 0" @click="deleteRow(item.randomNum)" />
</a-col> </a-col>
</a-row> </a-row>
</a-col> </a-col>
...@@ -109,7 +110,7 @@ ...@@ -109,7 +110,7 @@
</a-form> </a-form>
</div> </div>
<template slot="footer"> <template slot="footer">
<a-button key="back" @click="isShow = !isShow"> <a-button key="back" @click="cancelModal()">
取消 取消
</a-button> </a-button>
<a-button v-if="current >= 1" type="primary" @click="handlePrevStep()"> <a-button v-if="current >= 1" type="primary" @click="handlePrevStep()">
...@@ -134,7 +135,8 @@ export default { ...@@ -134,7 +135,8 @@ export default {
return { return {
rowLoop: [{ rowLoop: [{
name: '', name: '',
key: '' key: '',
randomNum: Math.random()
}], }],
form: this.$form.createForm(this), form: this.$form.createForm(this),
current: 0, current: 0,
...@@ -151,13 +153,7 @@ export default { ...@@ -151,13 +153,7 @@ export default {
], ],
isShow: false, isShow: false,
selectedRowKeys: [], selectedRowKeys: [],
list: [ list: [],
{
xtbm: 'wuyeapp',
xtmc: '物业APP',
xtdz: 'http://www.962121.net'
}
],
columns: [ columns: [
{ {
title: '#', title: '#',
...@@ -207,16 +203,49 @@ export default { ...@@ -207,16 +203,49 @@ export default {
}, },
formStoreList: [], formStoreList: [],
businessOptionsList: [], businessOptionsList: [],
editId: null
} }
}, },
mounted() { mounted() {
this.getList() this.getList()
}, },
methods: { methods: {
cancelModal() {
console.log(123)
this.form.resetFields()
this.current = 0
this.isShow = !this.isShow
},
onEdit(id) { onEdit(id) {
this.rowLoop = [{
name: '',
key: '',
randomNum: Math.random()
}]
this.isShow = !this.isShow this.isShow = !this.isShow
console.log(id)
let record = this.list.find(item => item.id == id) let record = this.list.find(item => item.id == id)
this.form.setFieldsValue(record)
if(!!record) {
this.editId = id
for (let i = 0; i < Object.keys(record).length; i++) {
if(Object.keys(record)[i] !== 'data') {
this.form.getFieldDecorator(Object.keys(record)[i], {initialValue: Object.values(record)[i]})
} else {
for (let j = 0; j < Object.values(record)[i].length; j++) {
console.log(Object.values(record)[i][j])
if(j !== 0) {
this.addRow()
}
this.form.getFieldDecorator('key' + j, {initialValue: Object.values(record)[i][j].key})
this.form.getFieldDecorator('value' + j, {initialValue: Object.values(record)[i][j].value})
}
}
}
}
// this.form.setFieldsValue(record)
}, },
initPagination() { initPagination() {
this.pagination.pageNo = 1 this.pagination.pageNo = 1
...@@ -246,10 +275,15 @@ export default { ...@@ -246,10 +275,15 @@ export default {
addRow() { addRow() {
this.rowLoop.push({ this.rowLoop.push({
name: '', name: '',
key: '' key: '',
randomNum: Math.random()
}) })
}, },
deleteRow() {}, deleteRow(randomNum) {
// this.rowLoop.splice(index, 1)
this.rowLoop = this.rowLoop.filter(i => i.randomNum !== randomNum)
console.log(this.rowLoop)
},
getList() { getList() {
this.$ajax.post({ this.$ajax.post({
url: this.$api.GET_BUSINESS_LIST, url: this.$api.GET_BUSINESS_LIST,
...@@ -272,6 +306,10 @@ export default { ...@@ -272,6 +306,10 @@ export default {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
}, },
onRegister() { onRegister() {
this.rowLoop = [{
name: '',
key: ''
}]
this.current = 0 this.current = 0
this.form.resetFields() this.form.resetFields()
this.isShow = !this.isShow this.isShow = !this.isShow
...@@ -283,8 +321,6 @@ export default { ...@@ -283,8 +321,6 @@ export default {
}, },
handleNextStep() { handleNextStep() {
this.current += 1 this.current += 1
let record = this.list.find(item => item.id == id)
this.form.setFieldsValue(record)
}, },
handleRegisterOk() { handleRegisterOk() {
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
...@@ -315,17 +351,33 @@ export default { ...@@ -315,17 +351,33 @@ export default {
authTokenTimeKey: this.form.getFieldValue('authTokenTimeKey') authTokenTimeKey: this.form.getFieldValue('authTokenTimeKey')
} }
this.$ajax.post({ if(!!this.editId) {
url: this.$api.POST_ADD_BUSINESS_RECORD, this.$ajax.put({
params: finalParse url: this.$api.PUT_BUSINESS_RECORD.replace('{id}', this.editId),
}).then(res => { params: finalParse
if(res.code == '200') { }).then(res => {
this.$message.success('新增成功!') if(res.code == '200') {
this.isShow = !this.isShow this.$message.success('修改成功!')
this.form.resetFields() this.cancelModal()
this.getList() this.form.resetFields()
} this.getList()
}) }
})
} else {
this.$ajax.post({
url: this.$api.POST_ADD_BUSINESS_RECORD,
params: finalParse
}).then(res => {
if(res.code == '200') {
this.$message.success('新增成功!')
this.cancelModal()
this.form.resetFields()
this.getList()
}
})
}
this.editId = null
} else { } else {
this.$message.info('请填写表单所有项目!') this.$message.info('请填写表单所有项目!')
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</div> </div>
<a-table class="elevator-table portalTable" :dataSource="list" :columns="columns" size="small" :pagination="pagination" rowKey="id" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"> <a-table class="elevator-table portalTable" :dataSource="list" :columns="columns" size="small" :pagination="pagination" rowKey="id" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
<span slot="operation" slot-scope="text, record"> <span slot="operation" slot-scope="text, record">
<span class="actionBtn" @click="onEdit(record)">编辑</span> <span class="actionBtn" @click="onEdit(record.id)">编辑</span>
<span class="actionBtn" @click="onDelete(record.id)">删除</span> <span class="actionBtn" @click="onDelete(record.id)">删除</span>
</span> </span>
<span slot="no" slot-scope="text, record, index"> <span slot="no" slot-scope="text, record, index">
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<a-tag v-for="(item, index) in record.rules" :key="index">{{`{` + record.rules[index].key + `: `+ record.rules[index].value + `}`}}</a-tag> <a-tag v-for="(item, index) in record.rules" :key="index">{{`{` + record.rules[index].key + `: `+ record.rules[index].value + `}`}}</a-tag>
</span> </span>
</a-table> </a-table>
<a-modal title="新建规则" v-model="isShow" width='900px' style="padding: 20px"> <a-modal title="新建规则" v-model="isShow" width='900px' style="padding: 20px" centered>
<a-form :form='form'> <a-form :form='form'>
<a-form-item label="触发服务" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"> <a-form-item label="触发服务" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-select placeholder="请选择触发服务" v-decorator="['trigger', {validateTrigger:'blur', rules: [{required: true, message: '请选择此项!'}]}]"> <a-select placeholder="请选择触发服务" v-decorator="['trigger', {validateTrigger:'blur', rules: [{required: true, message: '请选择此项!'}]}]">
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="规则字段定义" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"> <a-form-item label="规则字段定义key&value" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-textarea <a-textarea
v-decorator="[ v-decorator="[
'rules', 'rules',
...@@ -172,9 +172,37 @@ export default { ...@@ -172,9 +172,37 @@ export default {
this.getActionServiceOption() this.getActionServiceOption()
}, },
methods: { methods: {
onEdit(id) {
this.isShow = !this.isShow
let record = this.list.find(item => item.id == id)
console.log(record)
if(!!record) {
this.editId = id
for (let i = 0; i < Object.keys(record).length; i++) {
if(Object.keys(record)[i] == 'trigger') {
this.form.getFieldDecorator('trigger', {'initialValue': Object.values(record)[i].id})
}
if(Object.keys(record)[i] == 'action') {
this.form.getFieldDecorator('action', {'initialValue': Object.values(record)[i].id})
}
if(Object.keys(record)[i] == 'rules') {
this.form.getFieldDecorator('rules', {'initialValue': JSON.stringify(Object.values(record)[i]).split('[').split(']')})
}
}
}
},
getTriggerServiceOption() { getTriggerServiceOption() {
this.$ajax.post({ this.$ajax.post({
url: this.$api.GET_TRIGGER_LIST, url: this.$api.GET_TRIGGER_LIST,
params: {
'page': 1,
'size': 10000
}
}).then(res => { }).then(res => {
if(res.code == '200') { if(res.code == '200') {
let result = this.$com.confirm(res, 'data.content', []) let result = this.$com.confirm(res, 'data.content', [])
...@@ -187,6 +215,10 @@ export default { ...@@ -187,6 +215,10 @@ export default {
getActionServiceOption() { getActionServiceOption() {
this.$ajax.post({ this.$ajax.post({
url: this.$api.GET_ACTION_LIST, url: this.$api.GET_ACTION_LIST,
params: {
'page': 1,
'size': 10000
}
}).then(res => { }).then(res => {
if(res.code == '200') { if(res.code == '200') {
let result = this.$com.confirm(res, 'data.content', []) let result = this.$com.confirm(res, 'data.content', [])
...@@ -196,6 +228,10 @@ export default { ...@@ -196,6 +228,10 @@ export default {
} }
}) })
}, },
initPagination() {
this.pagination.pageNo = 1
this.pagination.current = 1
},
confirmJson(rule, value, callback) { confirmJson(rule, value, callback) {
if (!value || value == undefined) { if (!value || value == undefined) {
callback('不能为空!') callback('不能为空!')
...@@ -213,13 +249,25 @@ export default { ...@@ -213,13 +249,25 @@ export default {
} }
}, },
onDelete(id) { onDelete(id) {
this.$ajax.delete({
url: this.$api.DELETE_RULE_RECORD.replace('{id}', id) const that = this
}).then(res => { this.$modal.confirm({
if(res.code == '200') { title: '提示',
this.$message.success('删除成功!') content: '确定删除该条记录吗?',
this.getList() okText: '确认',
} okType: 'danger',
cancelText: '取消',
onOk() {
that.$ajax.delete({
url: that.$api.DELETE_RULE_RECORD.replace('{id}', id)
}).then(res => {
if(res.code == '200') {
that.$message.success('删除成功!')
that.initPagination()
that.getList()
}
})
},
}) })
}, },
addRow() { addRow() {
...@@ -231,15 +279,20 @@ export default { ...@@ -231,15 +279,20 @@ export default {
deleteRow() {}, deleteRow() {},
getList() { getList() {
this.$ajax.post({ this.$ajax.post({
url: this.$api.GET_RULES_LIST url: this.$api.GET_RULES_LIST,
params: {
page: this.pagination.pageNo,
size: 10
}
}).then(res => { }).then(res => {
this.list = this.$com.confirm(res, 'data.content', []) this.list = this.$com.confirm(res, 'data.content', [])
this.pagination.total = this.$com.confirm(res, 'data.totalElements', 0)
}) })
}, },
pageChange(val) { pageChange(val) {
this.pagination.pageNo = val this.pagination.pageNo = val
this.pagination.current = val this.pagination.current = val
// this.getCompanyList() this.getList()
}, },
onSelectChange(selectedRowKeys) { onSelectChange(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
...@@ -261,11 +314,19 @@ export default { ...@@ -261,11 +314,19 @@ export default {
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
let formContent = this.form.getFieldsValue() const formContent = this.form.getFieldsValue()
const trigger = this.triggerOptions.find(item => item.id == formContent.trigger)
const action = this.actionOptions.find(item => item.id == formContent.action)
this.$ajax.post({ this.$ajax.post({
url: this.$api.POST_ADD_RULE_RECORD, url: this.$api.POST_ADD_RULE_RECORD,
params: formContent params: {
rules: [JSON.parse(this.form.getFieldValue('rules'))],
trigger,
action
}
}).then(res => { }).then(res => {
if(res.code == '200') { if(res.code == '200') {
this.$message.success('新增成功!') this.$message.success('新增成功!')
......
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