Skip to content

Commit

Permalink
Merge branch 'master' of github.com:szuprefix/vue-django
Browse files Browse the repository at this point in the history
  • Loading branch information
szuprefix committed Oct 16, 2020
2 parents 6c1ebfc + 875e4f4 commit 4bc7c34
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/layout/ViewTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
watch: {
curTab () {
if (this.$route.path !== this.curTab) {
this.$router.push(this.resolveRoutePath(this.curTab))
this.$router.push(this.curTab)
}
},
$route (newVal, oldVal) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/rest/RelatedSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
},
toCreateModel(row){
let url = `${this.tableUrl}create/?${this.modelConfig.title_field || 'name'}=${this.tableQueries.search}`
this.$router.push(this.resolveRoutePath(url))
this.$router.push(url)
}
},
computed: {
Expand Down
4 changes: 2 additions & 2 deletions src/mixins/list_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ export default{
this.toEditModel(row, column, cell, event)
},
toEditModel (row, column, cell, event) {
const path = this.resolveRoutePath(`${row.id}`)
const path = `${row.id}`
this.$router.replace(path)
this.resolveCurrentTagLabel(path, `${row.__str__}`)
},
toCreateModel () {
let url = `/${this.model.listUrl}create?${this.model.title_field}=${this.queries.search}`
this.$router.push(this.resolveRoutePath(url))
this.$router.push(url)
this.resolveCurrentTagLabel(url, `新增${this.model.verbose_name}`)
},
onPageChanged (val) {
Expand Down
6 changes: 3 additions & 3 deletions src/mixins/model_edit_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ export default {
if (this.tab) {
this.tab.name = p
}
const path = this.resolveRoutePath(p)
this.$router.replace(path)
// const path = this.resolveRoutePath(p)
this.$router.replace(p)
//this.resolveCurrentTagLabel(path, `创建${form.modelFormTitle}`)
} else {
this.setTitle(p)
}
},
setTitle(p){
p = !!p ? p : this.resolveRoutePath(this.modelDetailUrl)
p = !!p ? p : this.modelDetailUrl

const formTitle = this.$refs.form.modelFormTitle
if (this.tab) {
Expand Down
6 changes: 3 additions & 3 deletions src/mixins/model_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default {

tableToEditModel ({row}){
// wayky edit
const path = this.resolveRoutePath(`/${this.appModelName.replace('.', '/')}/${row.id}`)
const path = `/${this.appModelName.replace('.', '/')}/${row.id}`
this.$router.push(path)
this.resolveCurrentTagLabel(path, `编辑${row.__str__}`)
},
Expand All @@ -148,15 +148,15 @@ export default {


tableToBatchCreateModel (){
this.$router.push(this.resolveRoutePath(`${this.modelListUrl}batch?${this.modelConfig.title_field}=${this.tableQueries.search}`))
this.$router.push(`${this.modelListUrl}batch?${this.modelConfig.title_field}=${this.tableQueries.search}`)
},

tableToCreateModel(){
let createUrl = `${this.modelListUrl}create`
if (!!this.modelConfig.title_field && !!this.tableQueries.search) {
createUrl = `${createUrl}?${this.modelConfig.title_field}=${this.tableQueries.search}`
}
const path = this.resolveRoutePath(createUrl)
const path = createUrl
this.$router.push(path)
this.resolveCurrentTagLabel(path, `新增${this.modelConfig.verbose_name}`)
},
Expand Down

0 comments on commit 4bc7c34

Please sign in to comment.