当前位置:网站首页>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('拒绝成功!');
边栏推荐
猜你喜欢

5A synchronous rectifier chip 20V to 12v2a/5v4.5a high current 24W high power synchronous rectifier chip high current step-down IC fs2462

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

Oracle cloud infrastructure extends distributed cloud services to provide organizations with greater flexibility and controllability

STM32F1与STM32CubeIDE编程实例-矩阵键盘驱动

Manjaro easyconnecy error: libgtk-x11-2.0 so. 0: cannot open shared object file: No such file or directory

pytorch模型

Watermaker of the Flink core

Unit test ci/cd

程序员坐牢了,会被安排去写代码吗?

Why do more and more users give up swagger and choose apifox
随机推荐
PHP obtains the beginning and end time of the month according to the month and year
In the past four years, the number of users exceeded 100 million, and sun Ge led the wave field to a new high
plt.savefig()的用法以及保存路径
Complete backpack beginner chapter "suggestions collection"
The difference between align items and align content
How to open an account on the flush? Is it safe
ShareIt has outstanding strength and landed in the top 7 of the global IAP strength list
Data analysis - promoter evolution analysis
弹性盒子自动换行小Demo
Embedded development: seven techniques for estimating battery life
Stackoverflow 2022 database annual survey
How to find opportunities in a bear market?
Realization of a springboard machine
New product experience: Alibaba cloud's new generation of local SSD instance I4 open beta
如何在熊市中寻找机会?
2.01 backpack problem
Understand leveldb write operation
List集合转数组
我呕血收集融合了来自各路经典shell书籍的脚本教学,作为小白的你快点来吧
FS7022方案系列FS4059A双节两节锂电池串联充电IC和保护IC