Commit 8e2ccf1c authored by Yulun Yao's avatar Yulun Yao 🇨🇳

123

parent ff3f97df
......@@ -23,10 +23,10 @@ const reponseCodeHandler = (res) => {
if (code == '200') {
} else if (code == '911') {
Cookie.remove('token')
Cookie.remove('refresh_token')
// Cookie.remove('token')
// Cookie.remove('refresh_token')
router.push({name: 'login'})
// router.push({name: 'login'})
} else if (code == '900') {
router.push({ name: 'noauth' })
......
......@@ -45,7 +45,7 @@ default: // 默认环境下(开发环境)
// WBX_URL = 'https://wbx-uat.omniview.pro/pc'
// BASE_URL = '/api'
// BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
BASE_URL = 'http://www.962121.net/hmfmstest/ifttt/api/'
BASE_URL = 'http://www.962121.net/hmfmstest/ifttt'
// BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
// BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
// BASE_URL = 'http://211.136.105.193/apiv2'
......@@ -145,7 +145,7 @@ export default {
// 首页统计列表
GET_RESOURE_LIST: '/service-basicdatasync-ddd/resource/count',
// 首页统计列表
POST_LOGIN: '/uaa/oauth/token',
POST_LOGIN: '/api/uaa/oauth/token',
// 居委会列表
GET_NEI_LIST: '/service-basicdatasync-ddd/residentsCommittees',
......@@ -237,12 +237,14 @@ export default {
GET_WY_AND_YWH_LIST: '/service-customkey-ddd/datas',
GET_RESERVATION_LIST: '/service-documents/repair/reservations',
GET_IFTTT_RULES_LIST: '/api/ifttt-center/executor/logs/query',
// log
GET_LOGS_LIST: '/api/ifttt-center/executor/logs/query',
DELETE_LOG_RECORD: '/api/ifttt-center/executor/logs/delete/{id}',
// 业务系统
GET_BUSINESS_LIST: '/api/ifttt-center/business/system/query',
POST_ADD_BUSINESS_RECORD: '/api/ifttt-center/business/system',
DELETE_BUSINESS_RECORD: '/api/ifttt-center/busines/ssystem/delete/{id}',
DELETE_BUSINESS_RECORD: '/api/ifttt-center/business/system/delete/{id}',
// trigger
GET_TRIGGER_LIST: '/api/ifttt-center/trigger/query',
......
......@@ -129,7 +129,7 @@
<a-form-item label="输入参数" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-textarea
v-decorator="[
'args',
'jsonArgs',
{
validateTrigger: 'blur',
rules: [
......@@ -251,22 +251,39 @@ export default {
}
}
},
initPagination() {
this.pagination.pageNo = 1
this.pagination.current = 1
},
onDelete(id) {
this.$ajax
.delete({
url: this.$api.DELETE_ACTION_RECORD.replace('{id}', id),
})
.then((res) => {
if (res.code == '200') {
this.$message.success('删除成功!')
this.getList()
}
})
const that = this
this.$modal.confirm({
title: '提示',
content: '确定删除该条记录吗?',
okText: '确认',
okType: 'danger',
cancelText: '取消',
onOk() {
that.$ajax.delete({
url: that.$api.DELETE_ACTION_RECORD.replace('{id}', id)
}).then(res => {
if(res.code == '200') {
that.$message.success('删除成功!')
that.initPagination()
that.getList()
}
})
},
})
},
getBusinessOptions() {
this.$ajax
.post({
url: this.$api.GET_BUSINESS_LIST, // page信息需要拼接在地址栏
params: {
page: this.pagination.pageNo,
size: 10
}
})
.then((res) => {
if (res.code === '200') {
......@@ -284,14 +301,20 @@ export default {
this.$ajax
.post({
url: this.$api.GET_ACTION_LIST,
params: {
page: this.pagination.pageNo,
size: 10
}
})
.then((res) => {
this.list = this.$com.confirm(res, 'data.content', [])
this.pagination.total = this.$com.confirm(res, 'data.totalElements', 0)
})
},
pageChange(val) {
this.pagination.pageNo = val
this.pagination.current = val
this.getList()
// this.getCompanyList()
},
onSelectChange(selectedRowKeys) {
......
......@@ -284,19 +284,38 @@ export default {
this.getBusinessOptions()
},
methods: {
initPagination() {
this.pagination.pageNo = 1
this.pagination.current = 1
},
onDelete(id) {
this.$ajax.delete({
url: this.$api.DELETE_TRIGGER_RECORD.replace('{id}', id)
}).then(res => {
if(res.code == '200') {
this.$message.success('删除成功!')
this.getList()
}
let that = this
this.$modal.confirm({
title: '提示',
content: '确定删除该条记录吗?',
okText: '确认',
okType: 'danger',
cancelText: '取消',
onOk() {
that.$ajax.delete({
url: that.$api.DELETE_TRIGGER_RECORD.replace('{id}', id)
}).then(res => {
if(res.code == '200') {
that.$message.success('删除成功!')
that.initPagination()
that.getList()
}
})
},
})
},
getBusinessOptions() {
this.$ajax.post({
url: this.$api.GET_BUSINESS_LIST, // page信息需要拼接在地址栏
params: {
page: this.pagination.pageNo,
size: 10
}
}).then(res => {
if (res.code === '200') {
let result = this.$com.confirm(res, 'data.content', [])
......@@ -311,14 +330,20 @@ export default {
},
getList() {
this.$ajax.post({
url: this.$api.GET_TRIGGER_LIST
url: this.$api.GET_TRIGGER_LIST,
params: {
page: this.pagination.pageNo,
size: 10
}
}).then(res => {
this.list = this.$com.confirm(res, 'data.content', [])
this.pagination.total = this.$com.confirm(res, 'data.totalElements', 0)
})
},
pageChange(val) {
this.pagination.pageNo = val
this.pagination.current = val
this.getList()
// this.getCompanyList()
},
onSelectChange(selectedRowKeys) {
......
......@@ -17,7 +17,7 @@
</div>
<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 class="actionBtn" @click="onEdit(record)">编辑</span>
<span class="actionBtn" @click="onEdit(record.id)">编辑</span>
<span class="actionBtn" @click="onDelete(record.id)">删除</span>
</span>
<span slot="no" slot-scope="text, record, index">
......@@ -206,21 +206,41 @@ export default {
onChange: this.pageChange
},
formStoreList: [],
businessOptionsList: []
businessOptionsList: [],
}
},
mounted() {
this.getList()
},
methods: {
onEdit(id) {
this.isShow = !this.isShow
let record = this.list.find(item => item.id == id)
this.form.setFieldsValue(record)
},
initPagination() {
this.pagination.pageNo = 1
this.pagination.current = 1
},
onDelete(id) {
this.$ajax.delete({
url: this.$api.DELETE_BUSINESS_RECORD.replace('{id}', id)
}).then(res => {
if(res.code == '200') {
this.$message.success('删除成功!')
this.getList()
}
const that = this
this.$modal.confirm({
title: '提示',
content: '确定删除该条记录吗?',
okText: '确认',
okType: 'danger',
cancelText: '取消',
onOk() {
that.$ajax.delete({
url: that.$api.DELETE_BUSINESS_RECORD.replace('{id}', id)
}).then(res => {
if(res.code == '200') {
that.$message.success('删除成功!')
that.initPagination()
that.getList()
}
})
},
})
},
addRow() {
......@@ -232,14 +252,20 @@ export default {
deleteRow() {},
getList() {
this.$ajax.post({
url: this.$api.GET_BUSINESS_LIST
url: this.$api.GET_BUSINESS_LIST,
params: {
page: this.pagination.pageNo,
size: 10
}
}).then(res => {
this.list = this.$com.confirm(res, 'data.content', [])
this.pagination.total = this.$com.confirm(res, 'data.totalElements', 0)
})
},
pageChange(val) {
this.pagination.pageNo = val
this.pagination.current = val
this.getList()
// this.getCompanyList()
},
onSelectChange(selectedRowKeys) {
......@@ -257,6 +283,8 @@ export default {
},
handleNextStep() {
this.current += 1
let record = this.list.find(item => item.id == id)
this.form.setFieldsValue(record)
},
handleRegisterOk() {
this.form.validateFields((err, values) => {
......
......@@ -31,10 +31,18 @@
<span slot="time" slot-scope="text, record, index">
{{$moment(record.time).format('YYYY-MM-DD HH:MM')}}
</span>
<span slot="message" slot-scope="text, record, index">
{{!record.error?'成功': '失败'}}
</span>
<p slot="expandedRowRender" slot-scope="record" style="margin: 0; text-align: left">
<a-row>规则:{{record.rule.rules}}</a-row>
<a-row>日志:{{record.log}}</a-row>
</p>
<span slot="operation" slot-scope="text, record">
<span class="actionBtn" @click="onDelete(record.id)">删除</span>
</span>
</a-table>
</div>
</div>
......@@ -86,9 +94,21 @@ export default {
},
{
title: '执行结果',
dataIndex: 'zxjg',
dataIndex: 'message',
align: 'center',
key: 'zxjg'
key: 'message',
scopedSlots: {
customRender: 'message',
},
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
width: '120px',
scopedSlots: {
customRender: 'operation',
},
},
],
pagination: {//分页
......@@ -106,16 +126,48 @@ export default {
this.getList()
},
methods: {
initPagination() {
this.pagination.pageNo = 1
this.pagination.current = 1
},
onDelete(id) {
const that = this
this.$modal.confirm({
title: '提示',
content: '确定删除该条记录吗?',
okText: '确认',
okType: 'danger',
cancelText: '取消',
onOk() {
that.$ajax.delete({
url: that.$api.DELETE_LOG_RECORD.replace('{id}', id)
}).then(res => {
if(res.code == '200') {
that.$message.success('删除成功!')
that.initPagination()
that.getList()
}
})
},
})
},
getList() {
this.$ajax.post({
url: this.$api.GET_IFTTT_RULES_LIST
url: this.$api.GET_LOGS_LIST,
params: {
page: this.pagination.pageNo,
size: 10
}
}).then(res => {
this.list = this.$com.confirm(res, 'data.content', [])
this.pagination.total = this.$com.confirm(res, 'data.totalElements', 0)
})
},
pageChange(val) {
this.pagination.pageNo = val
this.pagination.current = val
this.getList()
// this.getCompanyList()
},
onSelectChange(selectedRowKeys) {
......
......@@ -53,7 +53,7 @@ export default {
}
},
created() {
this.getLogo()
// this.getLogo()
},
methods: {
getLogo(){
......@@ -92,8 +92,9 @@ export default {
// 当前登录的账号密码的返回值
if (!!res.access_token) {
res.token = this.$com.confirm(res, 'data.content', [])
console.log(res.access_token)
// console.log(res.token)
this.$cookie.set('token', 'bearer ' + res.access_token)
this.$cookie.set('token', res.access_token)
// this.$cookie.set('userName', res.name) // 存储当前账号的用户名
this.$router.push({
path: '/businessSystem/businessSystemList'
......
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