|
@@ -219,24 +219,20 @@ const onSubmit = () => {
|
|
|
params.themeId = props.transfer.themeId
|
|
|
params.indexId = props.transfer.indexId
|
|
|
sysThemeIndexAdd(params).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- ElMessage.success('新增成功!')
|
|
|
- emit('update:show', false)
|
|
|
- emit('refresh')
|
|
|
- } else {
|
|
|
- ElMessage.error(res.msg)
|
|
|
- }
|
|
|
+ ElMessage.success('新增成功!')
|
|
|
+ emit('update:show', false)
|
|
|
+ emit('refresh')
|
|
|
+ state.loading = false
|
|
|
+ }).catch(() => {
|
|
|
state.loading = false
|
|
|
})
|
|
|
} else if (props.transfer.mode === 'edit') {
|
|
|
sysThemeIndexUpdate(params).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- ElMessage.success('编辑成功!')
|
|
|
- emit('update:show', false)
|
|
|
- emit('refresh')
|
|
|
- } else {
|
|
|
- ElMessage.error(res.msg)
|
|
|
- }
|
|
|
+ ElMessage.success('编辑成功!')
|
|
|
+ emit('update:show', false)
|
|
|
+ emit('refresh')
|
|
|
+ state.loading = false
|
|
|
+ }).catch(() => {
|
|
|
state.loading = false
|
|
|
})
|
|
|
}
|
|
@@ -252,14 +248,10 @@ const onSubmit = () => {
|
|
|
const initDetail = () => {
|
|
|
state.loading = true
|
|
|
sysThemeIndexFindById(props.transfer.id).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- state.form = res.data
|
|
|
- state.conditionTable.data = state.form.indexCondition ? JSON.parse(state.form.indexCondition) : []
|
|
|
- state.sortTable.data = state.form.indexOrder ? JSON.parse(state.form.indexOrder) : []
|
|
|
- initText(state.form.indexId)
|
|
|
- } else {
|
|
|
- ElMessage.error(res.msg)
|
|
|
- }
|
|
|
+ state.form = res.data
|
|
|
+ state.conditionTable.data = state.form.indexCondition ? JSON.parse(state.form.indexCondition) : []
|
|
|
+ state.sortTable.data = state.form.indexOrder ? JSON.parse(state.form.indexOrder) : []
|
|
|
+ initText(state.form.indexId)
|
|
|
state.loading = false
|
|
|
})
|
|
|
}
|
|
@@ -267,11 +259,7 @@ const initText = (id) => {
|
|
|
sysIndexFieldList(proxy.$util.formatGetParam({
|
|
|
indexId: id
|
|
|
})).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- state.textOptions = res.data
|
|
|
- } else {
|
|
|
- ElMessage.error(res.msg)
|
|
|
- }
|
|
|
+ state.textOptions = res.data
|
|
|
state.loading = false
|
|
|
})
|
|
|
}
|