feat(PageContent): ✨ 支持input属性修改
This commit is contained in:
@@ -160,6 +160,17 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 生成输入框组件 -->
|
||||||
|
<template v-else-if="col.templet === 'input'">
|
||||||
|
<template v-if="col.prop">
|
||||||
|
<el-input
|
||||||
|
v-model="scope.row[col.prop]"
|
||||||
|
:type="col.inputType ?? 'text'"
|
||||||
|
:disabled="!hasAuth(`${contentConfig.pageName}:modify`)"
|
||||||
|
@blur="handleModify(col.prop, scope.row[col.prop], scope.row)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
<!-- 格式化为价格 -->
|
<!-- 格式化为价格 -->
|
||||||
<template v-else-if="col.templet === 'price'">
|
<template v-else-if="col.templet === 'price'">
|
||||||
<template v-if="col.prop">
|
<template v-if="col.prop">
|
||||||
@@ -332,6 +343,7 @@ export interface IContentConfig<T = any> {
|
|||||||
| "list"
|
| "list"
|
||||||
| "url"
|
| "url"
|
||||||
| "switch"
|
| "switch"
|
||||||
|
| "input"
|
||||||
| "price"
|
| "price"
|
||||||
| "percent"
|
| "percent"
|
||||||
| "icon"
|
| "icon"
|
||||||
@@ -345,6 +357,7 @@ export interface IContentConfig<T = any> {
|
|||||||
inactiveValue?: boolean | string | number;
|
inactiveValue?: boolean | string | number;
|
||||||
activeText?: string;
|
activeText?: string;
|
||||||
inactiveText?: string;
|
inactiveText?: string;
|
||||||
|
inputType?: string;
|
||||||
priceFormat?: string;
|
priceFormat?: string;
|
||||||
dateFormat?: string;
|
dateFormat?: string;
|
||||||
operat?: Array<
|
operat?: Array<
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ const contentConfig: IContentConfig = {
|
|||||||
gender: 1,
|
gender: 1,
|
||||||
status: 1,
|
status: 1,
|
||||||
status2: 1,
|
status2: 1,
|
||||||
|
sort: 99,
|
||||||
createTime: 1715647982437,
|
createTime: 1715647982437,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -36,13 +37,14 @@ const contentConfig: IContentConfig = {
|
|||||||
gender: 0,
|
gender: 0,
|
||||||
status: 0,
|
status: 0,
|
||||||
status2: 0,
|
status2: 0,
|
||||||
|
sort: 0,
|
||||||
createTime: 1715648977426,
|
createTime: 1715648977426,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
modifyAction(data) {
|
modifyAction(data) {
|
||||||
// console.log("modifyAction:", data);
|
console.log("modifyAction:", data);
|
||||||
return Promise.resolve(null);
|
return Promise.resolve(null);
|
||||||
},
|
},
|
||||||
cols: [
|
cols: [
|
||||||
@@ -89,6 +91,13 @@ const contentConfig: IContentConfig = {
|
|||||||
activeText: "启用",
|
activeText: "启用",
|
||||||
inactiveText: "禁用",
|
inactiveText: "禁用",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "排序",
|
||||||
|
align: "center",
|
||||||
|
prop: "sort",
|
||||||
|
templet: "input",
|
||||||
|
inputType: "number",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: "创建时间",
|
label: "创建时间",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|||||||
Reference in New Issue
Block a user