Commit 1b4cfc4e3e383d3c435aa4ae3fce88f0f3917a40

Authored by ly525
1 parent 6dad8c07

refactor(db-table-column-rename): update table works column mode to page_mode; !…

…#zh: 重命名 works 表的 mode 列为 page_mode
back-end/h5-api/api/work/documentation/1.0.0/work.json
@@ -1003,8 +1003,9 @@ @@ -1003,8 +1003,9 @@
1003 "is_template": { 1003 "is_template": {
1004 "type": "boolean" 1004 "type": "boolean"
1005 }, 1005 },
1006 - "mode": { 1006 + "page_mode": {
1007 "type": "string", 1007 "type": "string",
  1008 + "default": "h5_swipper",
1008 "enum": [ 1009 "enum": [
1009 "h5_swipper", 1010 "h5_swipper",
1010 "h5_long_page", 1011 "h5_long_page",
@@ -1037,8 +1038,9 @@ @@ -1037,8 +1038,9 @@
1037 "is_template": { 1038 "is_template": {
1038 "type": "boolean" 1039 "type": "boolean"
1039 }, 1040 },
1040 - "mode": { 1041 + "page_mode": {
1041 "type": "string", 1042 "type": "string",
  1043 + "default": "h5_swipper",
1042 "enum": [ 1044 "enum": [
1043 "h5_swipper", 1045 "h5_swipper",
1044 "h5_long_page", 1046 "h5_long_page",
back-end/h5-api/api/work/models/Work.settings.json
@@ -32,13 +32,14 @@ @@ -32,13 +32,14 @@
32 "is_template": { 32 "is_template": {
33 "type": "boolean" 33 "type": "boolean"
34 }, 34 },
35 - "mode": { 35 + "page_mode": {
36 "type": "enumeration", 36 "type": "enumeration",
37 "enum": [ 37 "enum": [
38 "h5_swipper", 38 "h5_swipper",
39 "h5_long_page", 39 "h5_long_page",
40 "h5_form" 40 "h5_form"
41 - ] 41 + ],
  42 + "default": "h5_swipper"
42 }, 43 },
43 "height": { 44 "height": {
44 "type": "integer", 45 "type": "integer",
back-end/h5-api/api/workform/documentation/1.0.0/workform.json
@@ -551,7 +551,7 @@ @@ -551,7 +551,7 @@
551 "is_template": { 551 "is_template": {
552 "type": "boolean" 552 "type": "boolean"
553 }, 553 },
554 - "mode": { 554 + "page_mode": {
555 "type": "string" 555 "type": "string"
556 }, 556 },
557 "height": { 557 "height": {
front-end/h5/src/components/core/editor/edit-panel/props/global-work.vue
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <template> 11 <template>
12 <a-form :layout="formLayout"> 12 <a-form :layout="formLayout">
13 <a-form-item label="H5类型"> 13 <a-form-item label="H5类型">
14 - <a-radio-group v-model="pageMode" @change="handleModeChange" size="small"> 14 + <a-radio-group v-model="pageMode" size="small">
15 <a-radio-button v-for="(value, key) in PAGE_MODE" :key="key" :value="value"> 15 <a-radio-button v-for="(value, key) in PAGE_MODE" :key="key" :value="value">
16 {{PAGE_MODE_LABEL[key]}} 16 {{PAGE_MODE_LABEL[key]}}
17 </a-radio-button> 17 </a-radio-button>
@@ -39,10 +39,10 @@ export default { @@ -39,10 +39,10 @@ export default {
39 // https://vuex.vuejs.org/zh/guide/forms.html#%E5%8F%8C%E5%90%91%E7%BB%91%E5%AE%9A%E7%9A%84%E8%AE%A1%E7%AE%97%E5%B1%9E%E6%80%A7 39 // https://vuex.vuejs.org/zh/guide/forms.html#%E5%8F%8C%E5%90%91%E7%BB%91%E5%AE%9A%E7%9A%84%E8%AE%A1%E7%AE%97%E5%B1%9E%E6%80%A7
40 pageMode: { 40 pageMode: {
41 get () { 41 get () {
42 - return this.work.mode 42 + return this.work.page_mode || PAGE_MODE.SWIPPER_PAGE
43 }, 43 },
44 - set (model) {  
45 - this.updateWork({ mode }) 44 + set (page_mode) {
  45 + this.updateWork({ page_mode })
46 } 46 }
47 } 47 }
48 }, 48 },
@@ -50,9 +50,6 @@ export default { @@ -50,9 +50,6 @@ export default {
50 ...mapActions('editor', [ 50 ...mapActions('editor', [
51 'updateWork' 51 'updateWork'
52 ]), 52 ]),
53 - handleModeChange (e) {  
54 - this.updateWork({ mode: e.target.value })  
55 - }  
56 } 53 }
57 } 54 }
58 </script> 55 </script>
front-end/h5/src/components/core/models/work.js
@@ -33,7 +33,7 @@ class Work { @@ -33,7 +33,7 @@ class Work {
33 this.is_publish = !!work.is_publish 33 this.is_publish = !!work.is_publish
34 this.is_template = false 34 this.is_template = false
35 this.height = work.height || 568 35 this.height = work.height || 568
36 - this.mode = work.mode || PAGE_MODE.SWIPPER_PAGE 36 + this.page_mode = work.page_mode || PAGE_MODE.SWIPPER_PAGE
37 } 37 }
38 } 38 }
39 39
front-end/h5/src/engine-entry.js
@@ -33,7 +33,7 @@ const Engine = { @@ -33,7 +33,7 @@ const Engine = {
33 }, 33 },
34 data () { 34 data () {
35 return { 35 return {
36 - isLongPage: window.__work.mode === PAGE_MODE.LONG_PAGE 36 + isLongPage: window.__work.page_mode === PAGE_MODE.LONG_PAGE
37 } 37 }
38 }, 38 },
39 methods: { 39 methods: {