add selectComponent & search form styles

这个提交包含在:
lb 2023-01-30 14:12:45 +08:00
父节点 f80cc652ad
当前提交 ff77ab8546
共有 6 个文件被更改,包括 55 次插入10 次删除

查看文件

@ -10,13 +10,14 @@
:prop="opt.prop ?? '' + index"
:rules="opt.bind?.rules ? opt.bind.rules : undefined"
>
<el-input v-if="opt.input" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable />
<el-select v-if="opt.select" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable>
<el-input v-if="opt.input" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
<el-select v-if="opt.select" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small">
<el-option v-for="item in opt.select" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-date-picker v-if="opt.timerange" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable />
<el-date-picker v-if="opt.timerange" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
<el-upload
v-if="opt.upload"
size="small"
:key="'upload_' + Math.random().toString()"
class="inline-block pl-3"
action="https://jsonplaceholder.typicode.com/posts/"
@ -26,7 +27,9 @@
<el-button
v-if="opt.button && (!opt.button.permission || $hasPermission(opt.button.permission))"
:key="'button' + Math.random().toString()"
size="small"
:type="opt.button.type"
v-bind="opt.bind"
@click="handleBtnClick(opt.button.name)"
>{{ opt.button.name }}</el-button
>
@ -37,7 +40,7 @@
<script>
export default {
name: "",
name: "BaseSearchForm",
props: {
headConfig: {
type: Object,
@ -65,7 +68,7 @@ export default {
console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig)));
this.headConfig.fields.forEach((field, index) => {
// field.prop
// field.prop
if (!field.prop) return;
if (!this.dataForm[field.prop]) {

查看文件

@ -0,0 +1,30 @@
// import i18n from '@/i18n'
export default {
name: 'SelectComponent',
props: {
injectData: {
type: Object,
default: () => ({})
}
},
data() {
return {
// TODO: i18n
defaultText: '查看详情'
}
},
methods: {
emitClick() {
// console.log('inject data:' ,this.injectData)
this.$emit('emit-data', {
type: this.injectData.head?.actionName || 'select-change-action',
data: this.injectData.head?.emitFullData ? this.injectData : this.injectData.id
})
}
},
render: function (h) {
// console.log('button content:', this.injectData)
return h('span', null, [h('el-button', { props: { type: 'text' }, style: { paddingLeft: 0 }, on: { click: this.emitClick } }, this.injectData.head?.buttonContent || this.defaultText)])
}
}

查看文件

@ -42,9 +42,12 @@ export default function () {
},
{
button: {
type: 'plain',
type: 'primary',
name: '新增',
permission: ''
},
bind: {
plain: true,
}
}
]

查看文件

@ -40,9 +40,12 @@ export default function () {
},
{
button: {
type: 'plain',
type: 'primary',
name: '新增',
permission: 'pms:materialType:save'
},
bind: {
plain: true,
}
}
]

查看文件

@ -39,10 +39,13 @@ export default function () {
},
{
button: {
type: "plain",
type: "primary",
name: "新增",
permission: "pms:productionLine:save",
permission: "pms:productionLine:save"
},
bind: {
plain: true,
}
},
];

查看文件

@ -37,9 +37,12 @@ export default function () {
},
{
button: {
type: 'plain',
type: 'primary',
name: '新增',
permission: 'pms:workSequence:save'
},
bind: {
plain: true,
}
}
]