当前位置:网站首页>Jeecg 官方组件的使用笔记(更新中...)
Jeecg 官方组件的使用笔记(更新中...)
2022-06-28 13:19:00 【键.】
1.watch
watch(
() => detailData.value,
(v) => {
setFieldsValue(v);
}
);
2.拿组件变量和传值
import {
toRefs } from 'vue';
const props = defineProps<{
detailData: {
type: DemandOrderDetailInfo;
default: {
};
};
}>();
const {
detailData } = toRefs(props);
//子传父
const emit = defineEmits(['postInfo']);
emit('postInfo', data);
<PostInfo @postInfo="getPostInfo" />
const getPostInfo = (data) => {
console.log(data);
};
3.表格BasicColumn
import moment from'moment'
export function getBasicColumns(): BasicColumn[] {
return [
{
title: '候选人',
dataIndex: 'cddtName',
key: 'cddtName',
width: 80,
},
{
title: '级别',
dataIndex: 'custJobLevl',
key: 'custJobLevl',
width: 60,
customRender: ({
text }) => {
//字典值
return render.renderDict(text, 'job_level');
},
},
{
title: '面试时间',
dataIndex: 'intviewTime',
key: 'intviewTime',
width: 100,
customRender: ({
text }) => {
//格式化时间
return moment(text).format('YYYY-MM-DD');
}
}
{
//插槽
title: '操作',
slots: {
customRender: 'action',
},
width: 60,
},
]
}
//1.基础用法 data接收的是数组
<BasicTable :can-resize="false" title="初试信息" :bordered="true" :columns="test" :data-source="testIntviewVoList" :showIndexColumn="false" :pagination="false" />
4.表单schema
export const getAdvanceSchema = (): FormSchema[] => {
return [
{
//普通表单
field: 'jobNum',
label: '需求人数',
component: 'Input',
colProps: {
span: 8,
},
},
{
//获取数据字典的下拉表单
field: 'priority',
label: '优先级',
component: 'JDictSelectTag',
componentProps: {
dictCode: 'order_priority',
onChange: (e, selected) => {
//获取选中的字典值
console.log(e);
console.log(selected);
},
},
colProps: {
span: 8,
},
},
{
//格式化时间格式
label: '初试日期',
component: 'DatePicker',
field: 'intviewTime',
componentProps: {
valueFormat: 'YYYY-MM-DD',
},
colProps: {
span: 6,
},
labelWidth: 120,
}
{
//通过ifShow或show来控制表单显示
label: '测试!',
component: 'Input',
field: 'cddtName2',
colProps: {
span: 30,
},
labelWidth: 80,
ifShow: ({
values }) => {
return values.custIntviewName == 'cdd';
},
},
{
label: '复试面试官',
component: 'Input',
field: 'custIntviewName',
colProps: {
span: 30,
},
labelWidth: 80,
},
{
//在表单内嵌入***元
label: '期望薪资',
component: 'JInput',
field: 'expectSalary',
componentProps: {
placeholder: '请输入期望薪资(元)',
type: 'number',
suffix: '元',
},
colProps: {
span: 5,
},
labelWidth: 120,
},
{
//使用ApiSelect,{label:'boss直聘',value:'10001'}形式
label: '简历渠道',
component: 'ApiSelect',
componentProps: {
api: getQueryResumeChnlCfg,
labelField: 'chnlName',
optionFilterProp: 'chnlName',
resultField: 'list',
valueField: 'id',
showSearch: true,
showChooseOption: false,
},
field: 'chnlName',
labelWidth: 120,
colProps: {
span: 5,
},
required: true,
},
]
import BnRequest from '/@/bn/BnRequest';
interface ResumeChnlCfg {
chnlName?: string;
id?: string;
}
//简历渠道请求地址
export const getQueryResumeChnlCfg = async (): Promise<{
list: Array<ResumeChnlCfg> }> => {
const data = await BnRequest.get<ResumeChnlCfg[]>('/resumeChnlCfg/queryResumeChnlCfg', {
});
if (data) {
console.log(data);
return {
list: data };
}
return {
list: [] };
};
5.描述schema
import {
DescItem } from '/@/components/Description/index';
import {
h } from 'vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import {
render } from '/@/utils/common/renderUtils';
export const detailSchema: DescItem[] = [
{
field: 'custName',
label: '客户名称',
},
{
field: 'id',
label: '需求编号',
},
{
field: 'projName',
label: '项目名称',
},
{
field: 'custProjName',
label: '客户项目名称',
},
{
label: '级别',
field: 'jobLevl',
render: (curVal) => {
//使用数据字典的值
return render.renderDict(curVal, 'job_level');
},
},
{
field: 'projDscr',
label: '项目简介',
},
{
field: 'custProjCscr',
label: '客户项目简介',
render: () => {
//配置选择插槽
return h(JDictSelectTag, {
dictCode: 'demand_source_type' });
},
},
{
field: 'reqBeginTimeStr',
label: '接受需求日期',
render: (curVal) => {
//格式化时间
return moment(curVal).format('YYYY-MM-DD');
},
},
];
//1.基础用法 data接收的是对象
<Description title="约面信息" :bordered="true" :schema="appoint" :data="recruitAppointVo" />
6.路由传参
import {
useRouter,useRoute } from 'vue-router';
const {
replace } = useRouter();
//1.函数传参
const gotoAudit = (id) => {
replace({
name: 'order-delivery-order-audit', params: {
orderId: id } });
};
//2.标签传参
<a-button type="link" @click="replace({ name: 'recruit-talent-pool-detail', params: { id: record.id } })" />
//3.接收传参
let id= useRoute().params.id as string;
7.消息提示
import {
useMessage } from '/@/hooks/web/useMessage';
const {
createMessage } = useMessage();
createMessage.success('拒绝成功!');
边栏推荐
- 华泰证券开户怎么开 怎么办理开户最安全
- BUUCTF:[WUSTCTF2020]朴实无华
- Forecast and Analysis on market scale and development trend of China's operation and maintenance security products in 2022
- Tencent tangdaosheng: facing the new world of digital and real integration, developers are the most important "architects"
- Complete backpack beginner chapter "suggestions collection"
- Oracle cloud infrastructure extends distributed cloud services to provide organizations with greater flexibility and controllability
- Fh511+tp4333 form an outdoor mobile power lighting camping lamp scheme.
- RK3399平台开发系列讲解(使用篇)Pinctrl子系统的介绍 - 视频介绍
- 移动Web实训DAY-2
- 同花顺上怎么进行开户啊, 安全吗
猜你喜欢

中国数据库技术大会(DTCC)特邀科蓝SUNDB数据库专家精彩分享

真香啊!最全的 Pycharm 常用快捷键大全!

投资98万美元的Saas项目失败了

Vscode如何设置自动保存代码

中二青年付杰的逆袭故事:从二本生到 ICLR 杰出论文奖,我用了20年

Mobile web training day-1

(原创)【MAUI】一步一步实现“悬浮操作按钮”(FAB,Floating Action Button)

Tencent has confirmed that QQ has stolen numbers on a large scale, iphone14 has no chance of type-C, and 5g, the fourth largest operator, has officially released numbers. Today, more big news is here

一文抄 10 篇!韩国发表的顶级会议论文被曝抄袭,第一作者是“原罪”?

Recognize the startup function and find the user entry
随机推荐
完全背包 初学篇「建议收藏」
Centos6.5 php+mysql MySQL library not found
Solution to directory access of thinkphp6 multi-level controller
China Database Technology Conference (DTCC) specially invited experts from Kelan sundb database to share
Copy 10 for one article! The top conference papers published in South Korea were exposed to be plagiarized, and the first author was "original sin"?
Customize MySQL connection pool
为什么越来越多的用户放弃 Swagger,选择Apifox
You must configure either the server or JDBC driver (via the ‘serverTimezone‘ configuration property
PHP根据年月获取月初月末时间
Electronic components distribution 1billion Club [easy to understand]
New product experience: Alibaba cloud's new generation of local SSD instance I4 open beta
You must configure either the server or JDBC driver (via the ‘serverTimezone‘ configuration property
Fh511+tp4333 form an outdoor mobile power lighting camping lamp scheme.
STM32F1与STM32CubeIDE编程实例-矩阵键盘驱动
After failing in the college entrance examination, he entered Harbin Institute of technology, but stayed in the university after graduation to be an "Explorer". Ding Xiao: scientific research is accum
G1垃圾收集器中重要的配置参数及其默认值
scratch旅行相册 电子学会图形化编程scratch等级考试一级真题和答案解析2022年6月
Centos7——安装mysql5.7
Oceanwide micro fh511 single chip microcomputer IC scheme small household appliances LED lighting MCU screen printing fh511
PHP obtains the beginning and end time of the month according to the month and year