当前位置:网站首页>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 .
边栏推荐
- C51 single chip microcomputer, an entry-level tutorial for lighting up small lights
- Network review
- 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
- 12. Tencent cloud IOT device side learning -- NTP function and Implementation
- Feign request return value inverse sequence localdatetime exception record
- How to build a website after successfully registering a domain name? Can I build a website without registering a domain name?
- How does the company domain name come from? What kind of domain name is a good domain name
- Net domain name? Net domain name?
- Differences between JSON objects and JSON strings
- How to buy a domain name? How to do a good job in website construction?
猜你喜欢
随机推荐
Precautions for selecting high frequency signal generator
Collateral damage from DDoS and hacktivism
The company is worried about customer frustration and brand damage caused by DDoS Attacks
Tencent (host security) was listed in the market guide for cloud workload protection platform released by Gartner
Cloud studio 2.0: the beginning of cloud
Solution to the 39th weekly game of acwing
Tensorflow daily essay (I)
Is the prospect of cloud computing in the security industry worth being optimistic about?
How do individuals register domain names? What are the precautions for individual domain name registration?
Why do the new generation of highly concurrent programming languages like go and rust hate shared memory?
Project deployment for learning 3D visualization from scratch
One line of keyboard
How to check the school domain name? Are all school domain names unified?
How to apply for a primary domain name? Is primary domain name good or secondary domain name good?
Technology is a double-edged sword, which needs to be well kept
How to register a Chinese domain name? Is it necessary to register a Chinese domain name?
Tencent security monthly report - Tencent security has been selected into several authoritative research reports, a data security special committee has been established, and zero trust specifications
System of test development - create test virtual machine on demand
Network review
Detailed explanation of IPv6 theory and concept



