当前位置:网站首页>Analysis of official template of wechat personnel recruitment management system (III)
Analysis of official template of wechat personnel recruitment management system (III)
2022-06-24 06:04:00 【Low code preacher】
Previous review
Weida has been developed PC Construction of client program , However, it is inconvenient that it is not reflected in the form of the official component library , You need to enable the template of the personnel recruitment management system to use PC End function .
In the first two sections, we built the home page and list page according to the idea of the official template , The list page only implements the function of table , In this section, we continue to build .
Buttons for processing tables
commonly PC End business , The button will have two positions , One is at the top of the table , Used to place new buttons . One is put in the operation column , Such as editing or deleting .
Select the left slot of the form template , Put three buttons inside
The title of the Modify button is business title
Then add a click event to the button , Use the navigation method of the platform method
Then add a button in the operation column slot of the table
Change the title and type of the button
Then you need to define events for the buttons , The official template is implemented in a low code way
Deleted business logic
/*
* It can be done by $page.handler.xxx Access the methods defined here
* Be careful : This method is only valid on the page to which it belongs
* if necessary async-await, Please amend it to export default async function() {}
*/
export default async function({event, data}) {
const { record, context } = data.target
const id = record._id;
app.showModal({
title: ' Are you sure you want to delete ?',
success: async (res) => {
if(res.cancel) {
return;
}
const ret = await app.dataSources.post.delete({
_id: id,
});
if (ret.code != 0) {
app.showToast({
'title': ' Delete failed '
});
return;
}
if(context.reload) {
try {
await context.reload()
} catch(e) {
console.log('error',e)
}
}
app.showToast({
'title': ' Delete successful '
});
},
fail: (res) => {
},
})
}When calling low code, you need to pass parameters , Parameter settings
$scope.id44.recordSlot
PC The calling of the mobile terminal is slightly different from that of the mobile terminal
Updated business logic
The logic of uploading personnel is to open an updated page , But you need to pass parameters to the page
$scope.id44.recordSlot.record._id
Business logic for subsequent arrangement
This also defines a low code method
/*
* It can be done by $page.handler.xxx Access the methods defined here
* Be careful : This method is only valid on the page to which it belongs
* if necessary async-await, Please amend it to export default async function() {}
*/
export default function({event, data}) {
const { context, record } = data.target;
try {
$page.dataset.state.reloadTableFunc = context.reload;
} catch(e) {
console.log('e is ', e);
}
$page.dataset.state.operObj.id = record._id;
$page.dataset.state.operObj.action = record.operation;
$page.dataset.state.isShowModal = !$page.dataset.state.isShowModal;
}The parameter is passed during the call
$scope.id44.recordSlot
Looking at the logic of the code, a window pops up , as follows
Life cycle function
Generally, this kind of slightly complicated page , Some data will be loaded in the life cycle function , Let's see what the authorities have done
export default {
onPageLoad(query) {
const customHeader = $page.dataset.state.customHeader;
try {
customHeader.map((item) => {
const header = JSON.parse(localStorage.getItem(item.key));
// console.log('header is ', header);
if (header) {
item.header = header.value;
}
return item;
});
$page.dataset.state.customHeader = customHeader;
}catch(e){
console.log('candidateManage e is ', e);
}
$page.dataset.state.header = [ ...$page.dataset.state.defaultHeader, ...$page.dataset.state.customHeader ];
// console.log('$page.dataset.state.header is ', $page.dataset.state.header);
//console.log('---------> LifeCycle onPageLoad', query)
},
onPageShow() {
//console.log('---------> LifeCycle onPageShow')
},
onPageReady() {
//console.log('---------> LifeCycle onPageReady')
},
onPageHide() {
//console.log('---------> LifeCycle onPageHide')
},
onPageUnload() {
//console.log('---------> LifeCycle onPageUnload')
},
}At present, because of the official API Not updated yet , I still don't understand what specific operation he wants to do
summary
We use three sections to disassemble two businesses , Home page and list page . General feeling PC The end is still slightly complicated , There are a lot of places to set up , In addition, there are many places in business logic that need to write code . I feel that if I want to be proficient PC The client has to supplement some of the front-end knowledge , Otherwise, it is difficult to make the business you want .
边栏推荐
- Tencent cloud won the "best customer value award for security hosting services in China" from Sullivan toubao Research Institute
- System of test development - create test virtual machine on demand
- Tensorflow daily essay (I)
- How to build a website after registering a domain name? Do you need maintenance later?
- Optimized the search function of broken websites
- ZABBIX enterprise distributed monitoring
- Script updates CLB type ingress Certificate in tke cluster
- The joint network security laboratory of runlian technology and Tencent security was officially unveiled
- Clickhouse alter table execution process
- How to resolve the domain name? How to choose a domain name?
猜你喜欢
随机推荐
How to bind the most formal domain name? What are the precautions for binding domain names?
Why migrate dig to wire
The website cannot be opened after windows installs the dongle
Ups and esxi realize automatic shutdown after power failure
[in depth sharing] Devops evolution path -- Realizing R & D digital transformation based on four vertical and four horizontal Devops system
A plate processing device of network separator which can adapt to different line port positions
Some common IPv6 problems!
Optimized the search function of broken websites
Malicious software packages are found in pypi code base. Tencent security threat intelligence has been included. Experts remind coders to be careful of supply chain attacks
What happened to the JVM locking on Tencent ECS?
NoClassDefFoundError and classnotfoundexception exceptions
What does it mean that the domain name is being walled? How to solve the problem of domain name by wall?
Netaapp data recovery process
Koa middleware implementation
A power modem that can adjust the bending range of cable
How to file a personal domain name? What are the benefits of domain name filing?
How do individuals register domain names? What are the precautions for individual domain name registration?
How do fixed assets intensive enterprises manage fixed assets effectively?
Tencent Youtu presents a number of AI technologies at the 2021 global digital economy conference
Data warehouse data processing DB basic concept analysis and understanding OLAP OLTP hatp similarities and differences MPP architecture



