master
xy 2 years ago
parent d90bfed299
commit 855df48e57

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

@ -4,7 +4,7 @@
<div>
<div ref="lxHeader">
<LxHeader
:icon="$route.meta.icon || 'md-apps'"
icon="md-apps"
:text="$route.meta.title"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
>
@ -22,7 +22,7 @@
v-for="item in form"
:key="item.id"
:value="item.field"
>{{ item.name }}</Option
>{{ item.name }}</Option
>
</Select>
<Select
@ -34,7 +34,7 @@
v-for="item in op"
:key="item.value"
:value="item.value"
>{{ item.label }}</Option
>{{ item.label }}</Option
>
</Select>
<template
@ -64,7 +64,7 @@
v-for="item in getColumnParams(select.filter[0].key)"
:key="item.id"
: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
}}</Option
>
@ -83,7 +83,7 @@
display: flex;
align-items: center;
"
></span
></span
>
<Input
:value="select.filter[0].value.split(',')[1]"
@ -96,7 +96,7 @@
style="margin-left: 10px"
type="primary"
@click="$refs['xyTable'].getTableData(true)"
>查询</Button
>查询</Button
>
<xy-selectors
@ -121,7 +121,7 @@
v-for="item in form"
:key="item.id"
:value="item.field"
>{{ item.name }}</Option
>{{ item.name }}</Option
>
</Select>
<Select
@ -133,7 +133,7 @@
v-for="item in op"
:key="item.value"
:value="item.value"
>{{ item.label }}</Option
>{{ item.label }}</Option
>
</Select>
<template
@ -161,7 +161,7 @@
v-for="item in getColumnParams(item.key)"
:key="item.id"
: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
}}</Option
>
@ -215,19 +215,19 @@
@click="
$refs['dialog'].setType('add'), $refs['dialog'].show()
"
>新增</Button
>新增</Button
>
</template>
<template #import>
<Button type="primary" @click="$refs['imports'].show()"
>导入</Button
>导入</Button
>
</template>
<template #export>
<Button
type="primary"
@click="exportExcel(new Date().getTime().toString())"
>导出</Button
>导出</Button
>
</template>
</header-content>
@ -411,6 +411,16 @@ export default {
['admins',[]]
])
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 (
!fields ||
!relation ||
@ -419,7 +429,8 @@ export default {
) {
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);
if (i.select_item && typeof i.select_item === 'object') {
let keys = Object.keys(i.select_item)
@ -468,7 +479,7 @@ export default {
return (
<span>
{ paramMap.get(row[i.field].toString()) }
{ paramMap.get(row[i.field]?.toString()) }
</span>
)
}

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

Loading…
Cancel
Save