master
xy 2 years ago
parent d90bfed299
commit 855df48e57

@ -149,7 +149,7 @@ export default {
}, },
btnWidth: { btnWidth: {
type: Number, type: Number,
default: 140, default: 200,
}, },
// //

@ -0,0 +1,30 @@
<template>
<div>
<el-page-header
:content="$route.meta.title"
style="
padding: 1em;
font-size: 1em;
background: #fff;
margin: 1.67em 0;
box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
border-radius: 5px;
"
@back="$router.back()"
>
</el-page-header>
</div>
</template>
<script>
export default {
data() {
return {}
},
methods: {},
computed: {}
}
</script>
<style scoped lang="scss">
</style>

@ -13,15 +13,15 @@ export default {
}, },
render(h) { render(h) {
return h( return h(
"el-dialog", "Modal",
{ {
props: { props: {
title: "新增", title: "新增",
visible: this.dialogVisible, value: this.dialogVisible,
width: "600px", width: 80,
}, },
on: { on: {
"update:visible": (val) => { "on-visible-change": (val) => {
this.dialogVisible = val; this.dialogVisible = val;
}, },
}, },
@ -30,6 +30,7 @@ export default {
h( h(
"el-form", "el-form",
{ {
class: "form-body",
ref: "elForm", ref: "elForm",
props: { props: {
model: this.form, model: this.form,
@ -46,6 +47,7 @@ export default {
h( h(
"el-form-item", "el-form-item",
{ {
class: "form-body__item",
ref: `elFormItem${i.field}`, ref: `elFormItem${i.field}`,
style: { style: {
width: "100%", width: "100%",
@ -154,6 +156,9 @@ export default {
h( h(
"el-button", "el-button",
{ {
props: {
size: "mini"
},
on: { on: {
click: () => (this.dialogVisible = false), click: () => (this.dialogVisible = false),
}, },
@ -166,6 +171,7 @@ export default {
props: { props: {
type: "warning", type: "warning",
plain: true, plain: true,
size: 'mini'
}, },
on: { on: {
click: () => this.init(), click: () => this.init(),
@ -178,6 +184,7 @@ export default {
{ {
props: { props: {
type: "primary", type: "primary",
size: 'mini'
}, },
on: { on: {
click: this.submit, click: this.submit,
@ -429,6 +436,8 @@ export default {
} }
} }
}); });
document.documentElement.style.setProperty('--column-num', Math.floor(newVal.length / 8).toString())
}, },
//immediate: true, //immediate: true,
}, },
@ -450,7 +459,13 @@ export default {
}; };
</script> </script>
<style>
:root {
--column-num: 2;
}
</style>
<style scoped lang="scss"> <style scoped lang="scss">
.uploaded-a { .uploaded-a {
color: red; color: red;
text-decoration: none; text-decoration: none;
@ -461,4 +476,10 @@ export default {
color: red; color: red;
text-decoration: underline; text-decoration: underline;
} }
.form-body {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(var(--column-num), 1fr);
}
</style> </style>

@ -4,7 +4,7 @@
<div> <div>
<div ref="lxHeader"> <div ref="lxHeader">
<LxHeader <LxHeader
:icon="$route.meta.icon || 'md-apps'" icon="md-apps"
:text="$route.meta.title" :text="$route.meta.title"
style="margin-bottom: 10px; border: 0px; margin-top: 15px" style="margin-bottom: 10px; border: 0px; margin-top: 15px"
> >
@ -22,7 +22,7 @@
v-for="item in form" v-for="item in form"
:key="item.id" :key="item.id"
:value="item.field" :value="item.field"
>{{ item.name }}</Option >{{ item.name }}</Option
> >
</Select> </Select>
<Select <Select
@ -34,7 +34,7 @@
v-for="item in op" v-for="item in op"
:key="item.value" :key="item.value"
:value="item.value" :value="item.value"
>{{ item.label }}</Option >{{ item.label }}</Option
> >
</Select> </Select>
<template <template
@ -64,7 +64,7 @@
v-for="item in getColumnParams(select.filter[0].key)" v-for="item in getColumnParams(select.filter[0].key)"
:key="item.id" :key="item.id"
:value="getColumnField(select.filter[0].key)._relations ? item[getColumnField(select.filter[0].key)._relations.foreign_key] : item.value" :value="getColumnField(select.filter[0].key)._relations ? item[getColumnField(select.filter[0].key)._relations.foreign_key] : item.value"
>{{ >{{
item.key || item.value || item.name || item.no || item.mingcheng || item.id item.key || item.value || item.name || item.no || item.mingcheng || item.id
}}</Option }}</Option
> >
@ -83,7 +83,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
" "
></span ></span
> >
<Input <Input
:value="select.filter[0].value.split(',')[1]" :value="select.filter[0].value.split(',')[1]"
@ -96,7 +96,7 @@
style="margin-left: 10px" style="margin-left: 10px"
type="primary" type="primary"
@click="$refs['xyTable'].getTableData(true)" @click="$refs['xyTable'].getTableData(true)"
>查询</Button >查询</Button
> >
<xy-selectors <xy-selectors
@ -121,7 +121,7 @@
v-for="item in form" v-for="item in form"
:key="item.id" :key="item.id"
:value="item.field" :value="item.field"
>{{ item.name }}</Option >{{ item.name }}</Option
> >
</Select> </Select>
<Select <Select
@ -133,7 +133,7 @@
v-for="item in op" v-for="item in op"
:key="item.value" :key="item.value"
:value="item.value" :value="item.value"
>{{ item.label }}</Option >{{ item.label }}</Option
> >
</Select> </Select>
<template <template
@ -161,7 +161,7 @@
v-for="item in getColumnParams(item.key)" v-for="item in getColumnParams(item.key)"
:key="item.id" :key="item.id"
:value="getColumnField(item.key)._relations ? item[getColumnField(item.key)._relations.foreign_key] : item.value" :value="getColumnField(item.key)._relations ? item[getColumnField(item.key)._relations.foreign_key] : item.value"
>{{ >{{
item.key || item.value || item.name || item.no || item.mingcheng || item.id item.key || item.value || item.name || item.no || item.mingcheng || item.id
}}</Option }}</Option
> >
@ -215,19 +215,19 @@
@click=" @click="
$refs['dialog'].setType('add'), $refs['dialog'].show() $refs['dialog'].setType('add'), $refs['dialog'].show()
" "
>新增</Button >新增</Button
> >
</template> </template>
<template #import> <template #import>
<Button type="primary" @click="$refs['imports'].show()" <Button type="primary" @click="$refs['imports'].show()"
>导入</Button >导入</Button
> >
</template> </template>
<template #export> <template #export>
<Button <Button
type="primary" type="primary"
@click="exportExcel(new Date().getTime().toString())" @click="exportExcel(new Date().getTime().toString())"
>导出</Button >导出</Button
> >
</template> </template>
</header-content> </header-content>
@ -411,6 +411,16 @@ export default {
['admins',[]] ['admins',[]]
]) ])
let { fields, relation } = res; let { fields, relation } = res;
let fieldRes = (await fieldIndex(
{
page: 1,
page_size: 999,
custom_form_id: this.customForm.customFormId,
sort_name: "sort",
sort_type: "asc",
},
false
)).data;
if ( if (
!fields || !fields ||
!relation || !relation ||
@ -419,7 +429,8 @@ export default {
) { ) {
throw new Error("fields或relation格式错误"); throw new Error("fields或relation格式错误");
} }
fields.forEach((i, index) => { console.log(fieldRes)
fieldRes?.forEach((i, index) => {
i._relations = relation.find((j) => j.local_key === i.field); i._relations = relation.find((j) => j.local_key === i.field);
if (i.select_item && typeof i.select_item === 'object') { if (i.select_item && typeof i.select_item === 'object') {
let keys = Object.keys(i.select_item) let keys = Object.keys(i.select_item)
@ -468,7 +479,7 @@ export default {
return ( return (
<span> <span>
{ paramMap.get(row[i.field].toString()) } { paramMap.get(row[i.field]?.toString()) }
</span> </span>
) )
} }

@ -19,7 +19,7 @@
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false" <el-button type="primary" @click="dialogVisible = false"
> </el-button > </el-button
> >
</span> </span>
</template> </template>
@ -58,7 +58,7 @@ export default {
} }
}}> }}>
{ {
this.localFields.map(i => { [{field:'id',name:'id'},...this.localFields].map(i => {
return ( return (
<el-option value={ i.field } label={ i.name }></el-option> <el-option value={ i.field } label={ i.name }></el-option>
) )

Loading…
Cancel
Save