You are viewing a plain text version of this content. The canonical link for it is here.
Posted to submarine-dev@hadoop.apache.org by "Xun Liu (Jira)" <ji...@apache.org> on 2019/08/30 16:00:00 UTC
[jira] [Created] (SUBMARINE-158) [WEB] Dict Select Component
Xun Liu created SUBMARINE-158:
---------------------------------
Summary: [WEB] Dict Select Component
Key: SUBMARINE-158
URL: https://issues.apache.org/jira/browse/SUBMARINE-158
Project: Hadoop Submarine
Issue Type: Sub-task
Reporter: Xun Liu
Assignee: Xun Liu
h1. DictSelectTag Component introduction
* Get data from the sys_dict table, dictCode format description: Dictionary code
<dict-select-tag v-model="queryParam.sex" placeholder="Please select sex" dictCode="sex"/>
v-decorator Function:
<dict-select-tag v-decorator="['sex', {}]" :triggerChange="true" placeholder="Please select sex" dictCode="sex"/>
h1. DictSelectUtil.js List dictionary function
* Step 1: Introducing a dependency method
import {initDictOptions, filterDictText} from '@/components/dict/DictSelectUtil' * Step 2: Execute dictionary configuration method in the created() initialization method
// Initialize dictionary configuration
this.initDictConfig(); * Step 3: Implement the initDictConfig method, load the dictionary required by the list (multiple dictionary items on the list, execute the initDictOptions method multiple times)
initDictConfig() {
// Initialize dictionary - gender
initDictOptions('sex').then((res) => {
if (res.success) {
this.sexDictOptions = res.result;
}
});
}, * Step 4: Implement the customRender method of the field
customRender: (text, record, index) => {
// Dictionary value replaces general method
return filterDictText(this.sexDictOptions, text);
}
--
This message was sent by Atlassian Jira
(v8.3.2#803003)