Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

sorting-to-recordlist #581

Merged
merged 1 commit into from
Sep 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions client/src/components/SchemaView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -304,21 +304,36 @@ export default {
'schemasubformview': (resolve) => { require(['./SchemaSubFormView'], resolve) }
},
methods: {
searchData (query) {
searchData (query, sort) {
console.log('query', query, sort)
this.dataLoading = true

// New Custom Dynamic FLowz Data call
let heads = {
ftablename: this.currentFlowzId
}
dflowzdata.get(null, {
if (query === null) {
query = {
text: '',
filter: ''
}
}
let params = {
$skip: this.skip,
$limit: this.limit,
'_currentStatus': true,
'_state': this.$route.params.stateid,
// 'id[$search]': '^' + query.text
'$search': query.text
}, heads)
}
if (sort !== undefined) {
if (sort.order === 'asc') {
params['$sort[' + sort.key + ']'] = 1
} else if (sort.order === 'desc') {
params['$sort[' + sort.key + ']'] = -1
}
}
dflowzdata.get(null, params, heads)
.then(res => {
this.isFlowzLoaded = true
this.dataTotal = res.data.total
Expand Down Expand Up @@ -379,7 +394,8 @@ export default {
// })
},
sortData (object) {
// console.log('object')
// console.log('object', object, query)
this.searchData(null, object)
},
emailService (item) {
this.isEmailDone = true
Expand Down
20 changes: 15 additions & 5 deletions client/src/masterLayout/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ export default {
},
beforeDestroy () {
// alert('beforeDestroy')
// console.log(socket, socket.disconnected)
// console.log(socket)
for (let item of socket.subs) {
item.destroy()
}
},
methods: {
getByOrder (array) {
Expand Down Expand Up @@ -195,7 +198,7 @@ export default {
})
if (socket._callbacks['$' + m.id.replace(/-/g, '_') + '_created'] === undefined) {
socket.on(m.id.replace(/-/g, '_') + '_created', (data) => {
console.log('===created==', data)
// console.log('===created==', data)
if (data._currentStatus) {
let finx = _.findIndex(this.flowzList, {id: m.id})
if (finx !== -1) {
Expand All @@ -207,7 +210,7 @@ export default {
}
if (socket._callbacks['$' + m.id.replace(/-/g, '_') + '_patched'] === undefined) {
socket.on(m.id.replace(/-/g, '_') + '_patched', (data) => {
console.log('===patched==', data)
// console.log('===patched==', data)
let finx = _.findIndex(this.flowzList, {id: m.id})
if (finx !== -1 && !data._currentStatus && data._next === null) {
if (this.flowzList[finx].processList[data._state].count > 0) {
Expand All @@ -221,7 +224,7 @@ export default {
}
if (socket._callbacks['$' + m.id.replace(/-/g, '_') + '_removed'] === undefined) {
socket.on(m.id.replace(/-/g, '_') + '_removed', (data) => {
console.log('===removed==', data)
// console.log('===removed==', data)
if (data._currentStatus) {
let finx = _.findIndex(this.flowzList, {id: m.id})
if (finx !== -1) {
Expand Down Expand Up @@ -447,8 +450,15 @@ export default {
},
mounted () {
// this.activeFlow(this.$store.state.activeFlow)
// console.log('this.$feathers', this.$feathers)
for (let item of socket.subs) {
item.destroy()
}
this.init()
// console.log('socket', socket)
// console.log('this.$feathers', this.$feathers)
// this.$feathers.on('5a6e2e8b_cfeb_4060_b420_6ca95184b884_created', (data) => {
// console.log('this.$feathers', data)
// })
},
feathers: {
'flowz': {
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/user/SchemaList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
id: this.flowzData.schema,
item: params.row,
formName: params.row.name,
currentState: params.row._currentStatus,
currentState: params.row._state,
flowzData: this.flowzData,
formData: params.row
}
Expand Down
2 changes: 1 addition & 1 deletion service/src/services/dflowzdata/dflowzdata.hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function beforeCreate (hook) {
return hook.app.service('flowz').get(tName).then(res => {
hook.data._currentStatus = true
if (res.processList[hook.data._state].type === 'endevent') {
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
hook.data._currentStatus = false
}
hook.data._createdAt = new Date().toISOString()
Expand Down