Skip to content

Commit 83b4a97

Browse files
committed
refactor🎨: 修改字典status为int
1 parent c103947 commit 83b4a97

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/views/admin/dict/data.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export default {
252252
dictLabel: undefined,
253253
dictValue: undefined,
254254
dictSort: 0,
255-
status: '0',
255+
status: '2',
256256
remark: undefined
257257
}
258258
this.resetForm('form')
@@ -288,6 +288,7 @@ export default {
288288
const dictCode = row.dictCode || this.ids
289289
getData(dictCode).then(response => {
290290
this.form = response.data
291+
this.form.status = String(this.form.status)
291292
this.open = true
292293
this.title = '修改字典数据'
293294
this.isEdit = true
@@ -297,6 +298,7 @@ export default {
297298
submitForm: function() {
298299
this.$refs['form'].validate(valid => {
299300
if (valid) {
301+
this.form.status = parseInt(this.form.status)
300302
if (this.form.dictCode !== undefined) {
301303
updateData(this.form).then(response => {
302304
if (response.code === 200) {

src/views/admin/dict/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export default {
246246
id: undefined,
247247
dictName: undefined,
248248
dictType: undefined,
249-
status: '0',
249+
status: '2',
250250
remark: undefined
251251
}
252252
this.resetForm('form')
@@ -281,6 +281,7 @@ export default {
281281
const dictId = row.id || this.ids
282282
getType(dictId).then(response => {
283283
this.form = response.data
284+
this.form.status = String(this.form.status)
284285
this.open = true
285286
this.title = '修改字典类型'
286287
this.isEdit = true
@@ -290,6 +291,7 @@ export default {
290291
submitForm: function() {
291292
this.$refs['form'].validate(valid => {
292293
if (valid) {
294+
this.form.status = parseInt(this.form.status)
293295
if (this.form.id !== undefined) {
294296
updateType(this.form).then(response => {
295297
if (response.code === 200) {

0 commit comments

Comments
 (0)