专家添加题目自动填充

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(); 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', importExcel = '/topic/topic/importExcel',
exportXls = '/topic/topic/exportXls', exportXls = '/topic/topic/exportXls',
addScoreSta = '/scoresta/scoreSta/addScoreSta', addScoreSta = '/scoresta/scoreSta/addScoreSta',
getdate = '/topic/topic/getdate',
} }
export const addScoreSta = (params, isUpdate) => { 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 list5 = (params) => defHttp.get({url: Api.list5, params});
export const Update = (params) => defHttp.post({url: Api.edit, params}); export const Update = (params) => defHttp.post({url: Api.edit, params});
export const select = (params) => defHttp.post({url: Api.select, 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 JPopup from '/@/components/Form/src/jeecg/components/JPopup.vue';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue'; import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import { getValueType } from '/@/utils'; import { getValueType } from '/@/utils';
import { saveOrUpdate,select } from '../Topic.api'; import { saveOrUpdate,select,getdate } from '../Topic.api';
import { Form } from 'ant-design-vue'; import { Form } from 'ant-design-vue';
import {useRoute} from "vue-router";
import {demoArticleListApi} from "/@/api/demo/mainHome";
const $Route = useRoute()
//
const props = defineProps({ const props = defineProps({
formDisabled: { type: Boolean, default: false }, formDisabled: { type: Boolean, default: false },
@ -101,12 +107,32 @@ const disabled = computed(()=>{
} }
return props.formDisabled; 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({}); edit({});
} }
function change(record){ function change(record){
@ -166,6 +192,7 @@ async function submitForm() {
* popup组件值改变事件 * popup组件值改变事件
*/ */
function setFieldsValue(map) { function setFieldsValue(map) {
console.log(map)
Object.keys(map).map((key) => { Object.keys(map).map((key) => {
formData[key] = map[key]; formData[key] = map[key];
}); });

Loading…
Cancel
Save