Browse Source

refactor🎨: 修改字典status为int

zhangwenjian 4 years ago
parent
commit
83b4a97788
2 changed files with 6 additions and 2 deletions
  1. 3 1
      src/views/admin/dict/data.vue
  2. 3 1
      src/views/admin/dict/index.vue

+ 3 - 1
src/views/admin/dict/data.vue

@@ -252,7 +252,7 @@ export default {
         dictLabel: undefined,
         dictValue: undefined,
         dictSort: 0,
-        status: '0',
+        status: '2',
         remark: undefined
       }
       this.resetForm('form')
@@ -288,6 +288,7 @@ export default {
       const dictCode = row.dictCode || this.ids
       getData(dictCode).then(response => {
         this.form = response.data
+        this.form.status = String(this.form.status)
         this.open = true
         this.title = '修改字典数据'
         this.isEdit = true
@@ -297,6 +298,7 @@ export default {
     submitForm: function() {
       this.$refs['form'].validate(valid => {
         if (valid) {
+          this.form.status = parseInt(this.form.status)
           if (this.form.dictCode !== undefined) {
             updateData(this.form).then(response => {
               if (response.code === 200) {

+ 3 - 1
src/views/admin/dict/index.vue

@@ -246,7 +246,7 @@ export default {
         id: undefined,
         dictName: undefined,
         dictType: undefined,
-        status: '0',
+        status: '2',
         remark: undefined
       }
       this.resetForm('form')
@@ -281,6 +281,7 @@ export default {
       const dictId = row.id || this.ids
       getType(dictId).then(response => {
         this.form = response.data
+        this.form.status = String(this.form.status)
         this.open = true
         this.title = '修改字典类型'
         this.isEdit = true
@@ -290,6 +291,7 @@ export default {
     submitForm: function() {
       this.$refs['form'].validate(valid => {
         if (valid) {
+          this.form.status = parseInt(this.form.status)
           if (this.form.id !== undefined) {
             updateType(this.form).then(response => {
               if (response.code === 200) {