当前位置:网站首页>Notes on the use of official jeecg components (under update...)
Notes on the use of official jeecg components (under update...)
2022-06-28 13:26:00 【Key】
1.watch
watch(
() => detailData.value,
(v) => {
setFieldsValue(v);
}
);
2. Take component variables and transfer values
import {
toRefs } from 'vue';
const props = defineProps<{
detailData: {
type: DemandOrderDetailInfo;
default: {
};
};
}>();
const {
detailData } = toRefs(props);
// Son father
const emit = defineEmits(['postInfo']);
emit('postInfo', data);
<PostInfo @postInfo="getPostInfo" />
const getPostInfo = (data) => {
console.log(data);
};
3. form BasicColumn
import moment from'moment'
export function getBasicColumns(): BasicColumn[] {
return [
{
title: ' The candidate ',
dataIndex: 'cddtName',
key: 'cddtName',
width: 80,
},
{
title: ' Level ',
dataIndex: 'custJobLevl',
key: 'custJobLevl',
width: 60,
customRender: ({
text }) => {
// The dictionary is worth
return render.renderDict(text, 'job_level');
},
},
{
title: ' The interview time ',
dataIndex: 'intviewTime',
key: 'intviewTime',
width: 100,
customRender: ({
text }) => {
// Format time
return moment(text).format('YYYY-MM-DD');
}
}
{
// slot
title: ' operation ',
slots: {
customRender: 'action',
},
width: 60,
},
]
}
//1. Basic usage data Received is an array
<BasicTable :can-resize="false" title=" Preliminary information " :bordered="true" :columns="test" :data-source="testIntviewVoList" :showIndexColumn="false" :pagination="false" />
4. Forms schema
export const getAdvanceSchema = (): FormSchema[] => {
return [
{
// Normal form
field: 'jobNum',
label: ' The number of people needed ',
component: 'Input',
colProps: {
span: 8,
},
},
{
// Get the drop-down form of the data dictionary
field: 'priority',
label: ' priority ',
component: 'JDictSelectTag',
componentProps: {
dictCode: 'order_priority',
onChange: (e, selected) => {
// Get the selected dictionary value
console.log(e);
console.log(selected);
},
},
colProps: {
span: 8,
},
},
{
// Format time format
label: ' Date of initial test ',
component: 'DatePicker',
field: 'intviewTime',
componentProps: {
valueFormat: 'YYYY-MM-DD',
},
colProps: {
span: 6,
},
labelWidth: 120,
}
{
// adopt ifShow or show To control the form display
label: ' test !',
component: 'Input',
field: 'cddtName2',
colProps: {
span: 30,
},
labelWidth: 80,
ifShow: ({
values }) => {
return values.custIntviewName == 'cdd';
},
},
{
label: ' Second interview interviewer ',
component: 'Input',
field: 'custIntviewName',
colProps: {
span: 30,
},
labelWidth: 80,
},
{
// Embed... In the form *** element
label: ' Salary Expectation ',
component: 'JInput',
field: 'expectSalary',
componentProps: {
placeholder: ' Please enter the expected salary ( element )',
type: 'number',
suffix: ' element ',
},
colProps: {
span: 5,
},
labelWidth: 120,
},
{
// Use ApiSelect,{label:'boss Direct employment ',value:'10001'} form
label: ' Resume channel ',
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;
}
// Resume channel request address
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. describe 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: ' Customer name ',
},
{
field: 'id',
label: ' Demand number ',
},
{
field: 'projName',
label: ' Project name ',
},
{
field: 'custProjName',
label: ' Customer project name ',
},
{
label: ' Level ',
field: 'jobLevl',
render: (curVal) => {
// Use data dictionary values
return render.renderDict(curVal, 'job_level');
},
},
{
field: 'projDscr',
label: ' Project brief introduction ',
},
{
field: 'custProjCscr',
label: ' Customer project profile ',
render: () => {
// Configure the selected slot
return h(JDictSelectTag, {
dictCode: 'demand_source_type' });
},
},
{
field: 'reqBeginTimeStr',
label: ' Date of acceptance of requirements ',
render: (curVal) => {
// Format time
return moment(curVal).format('YYYY-MM-DD');
},
},
];
//1. Basic usage data Object received
<Description title=" Approximate surface information " :bordered="true" :schema="appoint" :data="recruitAppointVo" />
6. Route parameters
import {
useRouter,useRoute } from 'vue-router';
const {
replace } = useRouter();
//1. Function arguments
const gotoAudit = (id) => {
replace({
name: 'order-delivery-order-audit', params: {
orderId: id } });
};
//2. Tag reference
<a-button type="link" @click="replace({ name: 'recruit-talent-pool-detail', params: { id: record.id } })" />
//3. Receive and transmit parameters
let id= useRoute().params.id as string;
7. Message tip
import {
useMessage } from '/@/hooks/web/useMessage';
const {
createMessage } = useMessage();
createMessage.success(' Refuse success !');
边栏推荐
- PHP crawls web pages for specific information
- You must configure either the server or JDBC driver (via the ‘serverTimezone‘ configuration property
- 移动Web实训DAY-2
- Successful cases of rights protection of open source projects: successful rights protection of SPuG open source operation and maintenance platform
- pytorch主要模块
- pytorch模型
- redis和mysql数据不一致问题如何解决?
- pytorch基础
- 中国数据库技术大会(DTCC)特邀科蓝SUNDB数据库专家精彩分享
- Mobile web training -flex layout test question 1
猜你喜欢

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

China Database Technology Conference (DTCC) specially invited experts from Kelan sundb database to share

pytorch基础

Hubble数据库x某股份制商业银行:冠字号码管理系统升级,让每一张人民币都有 “身份证”

新品体验:阿里云新一代本地SSD实例i4开放公测

从pdb源码到frame帧对象

中国广电5G套餐来了,比三大运营商低,却没预期那么低

嵌入式开发:估算电池寿命的7个技巧

公司领导说,个人代码超10个Bug就开除,是什么体验?

Pytorch model
随机推荐
The press conference of Tencent cloud Database & CSDN engineer's ability lightweight certification is coming
Class structure in C language - dot
Mobile web training day-2
List set to array
完全背包 初学篇「建议收藏」
Mysql database literacy, do you really know what a database is
Jerry's wif interferes with Bluetooth [chapter]
pytorch基础
哈希竞猜游戏系统开发技术成熟案例及源码
China Database Technology Conference (DTCC) specially invited experts from Kelan sundb database to share
How to open an account on the flush? Is it safe
华泰证券开户怎么开 怎么办理开户最安全
PHP抓取网页获取特定信息
求职简历的书写技巧
StackOverflow 2022数据库年度调查
Mature case and source code of hash quiz game system development technology
Centos7 - installing mysql5.7
Arduino-ESP32闪存文件插件程序搭建和上传
专业英语历年题
Forecast and Analysis on market scale and development trend of China's operation and maintenance security products in 2022