专家添加题目自动填充

main
王家东 4 months ago
parent bc7f0ca24b
commit 428889aeca
  1. 12
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java
  2. 8
      jeecgboot-vue3-master/src/views/topic/Topic.api.ts
  3. 31
      jeecgboot-vue3-master/src/views/topic/components/TopicForm.vue

@ -273,6 +273,18 @@ public class TopicController extends JeecgController<Topic, ITopicService> {
}
return Result.OK();
}
//用于查询根据id获取的年度比赛项目
@GetMapping(value = "/getdate")
public Result<String> getdate(@RequestParam(name="annualCompid",required=true) String annualCompid) {
QueryWrapper<AnnualCompPoint> queryWrapper= new QueryWrapper<>();
queryWrapper.eq("id",annualCompid);
AnnualCompPoint annualCompPoint =annualCompPointService.getOne(queryWrapper);
return Result.OK(annualCompPoint.getObjName());
}
/**
* 添加
*

@ -17,6 +17,7 @@ enum Api {
importExcel = '/topic/topic/importExcel',
exportXls = '/topic/topic/exportXls',
addScoreSta = '/scoresta/scoreSta/addScoreSta',
getdate = '/topic/topic/getdate',
}
export const addScoreSta = (params, isUpdate) => {
@ -46,6 +47,13 @@ export const list3 = (params) => defHttp.get({url: Api.list3, params});
export const list5 = (params) => defHttp.get({url: Api.list5, params});
export const Update = (params) => defHttp.post({url: Api.edit, params});
export const select = (params) => defHttp.post({url: Api.select, params});
/*export const getdate = (params) => defHttp.get({url: Api.getdate, params});*/
export const getdate = (params) =>
defHttp.get({
url: Api.getdate,
params
});
/**
*

@ -56,8 +56,14 @@ import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
import JPopup from '/@/components/Form/src/jeecg/components/JPopup.vue';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate,select } from '../Topic.api';
import { saveOrUpdate,select,getdate } from '../Topic.api';
import { Form } from 'ant-design-vue';
import {useRoute} from "vue-router";
import {demoArticleListApi} from "/@/api/demo/mainHome";
const $Route = useRoute()
//
const props = defineProps({
formDisabled: { type: Boolean, default: false },
@ -101,12 +107,32 @@ const disabled = computed(()=>{
}
return props.formDisabled;
});
function routrtodate() {
const annualCompid = $Route.query.annualCompid;
formData.annualCompid = annualCompid;
console.log( formData.annualCompid,annualCompid,'111')
};
routrtodate();
let compName = ''
function getData() {
return new Promise((resovle,rej) => {
const annualCompid = $Route.query.annualCompid;
getdate({ annualCompid:annualCompid }).then(res => {
console.log(res,'2222')
compName = res
resovle(res)
})
})
};
// getData();
/**
* 新增
*/
function add() {
async function add() {
const res = await getData()
setFieldsValue({annualCompid:formData.annualCompid,annualCompid_dictText:res})
edit({});
}
function change(record){
@ -166,6 +192,7 @@ async function submitForm() {
* popup组件值改变事件
*/
function setFieldsValue(map) {
console.log(map)
Object.keys(map).map((key) => {
formData[key] = map[key];
});

Loading…
Cancel
Save