|
|
|
@ -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>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|