Skip to content

Commit

Permalink
docs:TForm与条件查询组件中使用TSelectIcon组件
Browse files Browse the repository at this point in the history
  • Loading branch information
wocwin committed Sep 5, 2024
1 parent 1c54dfe commit 2309682
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 88 deletions.
2 changes: 1 addition & 1 deletion docs/components/TQueryCondition/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TQueryCondition/eventHandle
### 结合自己封装组件使用

::: demo
TQueryCondition/TSelectUse
TQueryCondition/comUse
:::

### 按钮操作使用
Expand Down
161 changes: 81 additions & 80 deletions docs/components/TTable/base.md

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion docs/examples/TForm/comUse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ const formOpts: any = reactive({
valDate1: null,
valDate2: null,
valDate3: null,
date: null
date: null,
icon: ""
},
fieldList: [
{
Expand Down Expand Up @@ -140,6 +141,14 @@ const formOpts: any = reactive({
isSelfCom: true,
bind: { multiple: true, optionSource: hobbyList, valueCustom: "value" }
},
{
label: "图标选择器",
value: "icon",
placeholder: "TSelectIcon图标选择",
comp: "t-select-icon",
isSelfCom: true
// bind: { multiple: true }
},
{
label: "年份",
value: "createDate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ let state = reactive({
workshopNum2: null,
workshopNum3: null,
date: null,
deptCode: null
date1: null,
deptCode: null,
icon: ""
},
table: {
data: [
Expand Down Expand Up @@ -148,6 +150,20 @@ const opts = computed(() => {
optionSource: stepList
}
},
icon: {
label: "图标选择器",
comp: "t-select-icon",
span: 2
},
date1: {
label: "t-date-picker",
comp: "t-date-picker",
span: 2,
bind: {
type: "daterange",
isPickerOptions: true
}
},
date: {
label: "装炉时间",
comp: "el-date-picker",
Expand Down Expand Up @@ -189,16 +205,26 @@ const radioChange2 = val => {
}
// 最终参数获取
const getQueryData = computed(() => {
const { userName, userName2, workshopNum, date, workshopNum2, workshopNum3, deptCode } = toRefs(
state.queryData
)
const {
userName,
userName2,
workshopNum,
date,
workshopNum2,
workshopNum3,
deptCode,
date1,
icon
} = toRefs(state.queryData)
return {
userName: userName.value,
userName2: userName2.value,
workshopNum: workshopNum.value,
workshopNum2: workshopNum2.value,
workshopNum3: workshopNum3.value,
deptCode: deptCode.value,
date1: date1.value,
icon: icon.value,
beginDate: date.value && date.value[0] ? date.value[0] : null,
endDate: date.value && date.value[1] ? date.value[1] : null
}
Expand Down
1 change: 0 additions & 1 deletion packages/form/src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
:value="compChildValue(item, value, key)"
>{{ compChildShowLabel(item, value) }}</component
>
<!-- </template> -->
</component>
</el-form-item>
</template>
Expand Down
2 changes: 1 addition & 1 deletion packages/select-icon/src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ let valueIcon = computed({
const $attrs: any = useAttrs()
const attrs = computed(() => {
const selectBind = {
"prefix-icon": Icons[props.prefixIcon],
"prefix-icon": customIcons[props.prefixIcon],
placeholder: "请选择图标",
dialogTitle: "请选择图标",
searchPlaceholder: "搜索图标",
Expand Down

0 comments on commit 2309682

Please sign in to comment.