说明:1、英语单词模块根据id查询原先抽屉个修改公用一个查询,现已抽离开
This commit is contained in:
parent
72f17b5dd7
commit
460f7c242f
|
|
@ -17,6 +17,14 @@ export function getWord(id) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getWordRPC(id) {
|
||||||
|
return request({
|
||||||
|
url: '/english/word/rpc/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 新增英语单词
|
// 新增英语单词
|
||||||
export function addWord(data) {
|
export function addWord(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 修改英语单词对话框 -->
|
<!-- 修改英语单词对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body >
|
||||||
<el-form ref="formEdit" :model="form" :rules="rulesEdit" label-width="80px">
|
<el-form ref="formEdit" :model="form" :rules="rulesEdit" label-width="80px">
|
||||||
<el-form-item label="英语单词" prop="englishWord">
|
<el-form-item label="英语单词" prop="englishWord">
|
||||||
<el-input v-model="form.englishWord" placeholder="请输入英语单词"/>
|
<el-input v-model="form.englishWord" placeholder="请输入英语单词"/>
|
||||||
|
|
@ -189,7 +189,7 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer" v-loading="loadingEdit">
|
||||||
<el-button type="primary" @click="submitFormEdit">确 定</el-button>
|
<el-button type="primary" @click="submitFormEdit">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -258,7 +258,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listWord, getWord, delWord, addWord, updateWord} from "@/api/business/english/word";
|
import {listWord, getWord, delWord, addWord, updateWord,getWordRPC} from "@/api/business/english/word";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Word",
|
name: "Word",
|
||||||
|
|
@ -271,6 +271,7 @@ export default {
|
||||||
drawer: false,
|
drawer: false,
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
|
loadingEdit: false,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
// 非单个禁用
|
// 非单个禁用
|
||||||
|
|
@ -343,7 +344,7 @@ export default {
|
||||||
//根据id查询放入抽屉
|
//根据id查询放入抽屉
|
||||||
findById(id) {
|
findById(id) {
|
||||||
this.loadingC = true;
|
this.loadingC = true;
|
||||||
getWord(id).then(res => {
|
getWordRPC(id).then(res => {
|
||||||
this.form = res.data
|
this.form = res.data
|
||||||
this.loadingC = false
|
this.loadingC = false
|
||||||
})
|
})
|
||||||
|
|
@ -435,8 +436,10 @@ export default {
|
||||||
this.$refs["formEdit"].validate(valid => {
|
this.$refs["formEdit"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
|
this.loadingEdit= true
|
||||||
updateWord(this.form).then(response => {
|
updateWord(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.loadingEdit= false
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,25 @@ public class EnglishWordController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取英语单词详细信息RPC
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("english:word:query")
|
||||||
|
@GetMapping(value = "/rpc/{id}")
|
||||||
|
public AjaxResult getInfoRPC(@PathVariable("id") Long id) {
|
||||||
|
return AjaxResult.success(englishWordService.selectEnglishWordToRPC(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取英语单词详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("english:word:query")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
|
return AjaxResult.success(englishWordService.selectById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//------------------------代码自动生成-----------------------------------
|
//------------------------代码自动生成-----------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -68,14 +87,7 @@ public class EnglishWordController extends BaseController {
|
||||||
util.exportExcel(response, list, "英语单词数据");
|
util.exportExcel(response, list, "英语单词数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取英语单词详细信息
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("english:word:query")
|
|
||||||
@GetMapping(value = "/{id}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
||||||
return AjaxResult.success(englishWordService.selectEnglishWordById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增英语单词
|
* 新增英语单词
|
||||||
|
|
|
||||||
|
|
@ -18,15 +18,18 @@ public interface IEnglishWordService {
|
||||||
*/
|
*/
|
||||||
List<EnglishWord> getEnglishWordByCollect();
|
List<EnglishWord> getEnglishWordByCollect();
|
||||||
|
|
||||||
|
|
||||||
//------------------------代码自动生成-----------------------------------
|
|
||||||
/**
|
/**
|
||||||
* 查询英语单词
|
* 查询英语单词
|
||||||
*
|
*
|
||||||
* @param id 英语单词主键
|
* @param id 英语单词主键
|
||||||
* @return 英语单词
|
* @return 英语单词
|
||||||
*/
|
*/
|
||||||
public EnglishWord selectEnglishWordById(Long id);
|
public EnglishWord selectEnglishWordToRPC(Long id);
|
||||||
|
|
||||||
|
EnglishWord selectById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
//------------------------代码自动生成-----------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询英语单词列表
|
* 查询英语单词列表
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ public class EnglishWordServiceImpl implements IEnglishWordService {
|
||||||
* @return 英语单词
|
* @return 英语单词
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public EnglishWord selectEnglishWordById(Long id) {
|
public EnglishWord selectEnglishWordToRPC(Long id) {
|
||||||
EnglishWord englishWord = englishWordMapper.selectById(id);
|
EnglishWord englishWord = englishWordMapper.selectById(id);
|
||||||
Optional.ofNullable(englishWord).orElseThrow(() -> new BusinessException("数据丢失了~~~~"));
|
Optional.ofNullable(englishWord).orElseThrow(() -> new BusinessException("数据丢失了~~~~"));
|
||||||
//每次调用查看次数+1
|
//每次调用查看次数+1
|
||||||
|
|
@ -81,6 +81,11 @@ public class EnglishWordServiceImpl implements IEnglishWordService {
|
||||||
return englishWord;
|
return englishWord;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnglishWord selectById(Long id) {
|
||||||
|
return englishWordMapper.selectEnglishWordById(id);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增英语单词
|
* 新增英语单词
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue