|
|
|
|
@ -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
|
|
|
|
|
@ -63,9 +63,21 @@
|
|
|
|
|
<Option
|
|
|
|
|
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
|
|
|
|
|
: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
|
|
|
|
|
>
|
|
|
|
|
</Select>
|
|
|
|
|
@ -83,7 +95,7 @@
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
"
|
|
|
|
|
>至</span
|
|
|
|
|
>至</span
|
|
|
|
|
>
|
|
|
|
|
<Input
|
|
|
|
|
:value="select.filter[0].value.split(',')[1]"
|
|
|
|
|
@ -96,7 +108,7 @@
|
|
|
|
|
style="margin-left: 10px"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="$refs['xyTable'].getTableData(true)"
|
|
|
|
|
>查询</Button
|
|
|
|
|
>查询</Button
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<xy-selectors
|
|
|
|
|
@ -121,7 +133,7 @@
|
|
|
|
|
v-for="item in form"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:value="item.field"
|
|
|
|
|
>{{ item.name }}</Option
|
|
|
|
|
>{{ item.name }}</Option
|
|
|
|
|
>
|
|
|
|
|
</Select>
|
|
|
|
|
<Select
|
|
|
|
|
@ -133,7 +145,7 @@
|
|
|
|
|
v-for="item in op"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
>{{ item.label }}</Option
|
|
|
|
|
>{{ item.label }}</Option
|
|
|
|
|
>
|
|
|
|
|
</Select>
|
|
|
|
|
<template
|
|
|
|
|
@ -160,9 +172,21 @@
|
|
|
|
|
<Option
|
|
|
|
|
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
|
|
|
|
|
: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
|
|
|
|
|
>
|
|
|
|
|
</Select>
|
|
|
|
|
@ -215,19 +239,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>
|
|
|
|
|
@ -252,9 +276,9 @@
|
|
|
|
|
$router.push({
|
|
|
|
|
path: '/assetsDetail',
|
|
|
|
|
query: {
|
|
|
|
|
id: row.id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
id: row.id,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
@editor="
|
|
|
|
|
@ -265,21 +289,21 @@
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<template #assetsHistory="{row}">
|
|
|
|
|
<template #assetsHistory="{ row }">
|
|
|
|
|
<Button
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="$refs['addHistory'].setRow(row),$refs['addHistory'].show()"
|
|
|
|
|
>历史沿革</Button
|
|
|
|
|
@click="toHistory(row)"
|
|
|
|
|
>历史沿革</Button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template #picture="{row}">
|
|
|
|
|
<template #picture="{ row }">
|
|
|
|
|
<Button
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="$refs['atlas'].setId(row.id),$refs['atlas'].show()"
|
|
|
|
|
>图集</Button
|
|
|
|
|
@click="$refs['atlas'].setId(row.id), $refs['atlas'].show()"
|
|
|
|
|
>图集</Button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
@ -313,18 +337,18 @@ import { getparameter } from "@/api/system/dictionary";
|
|
|
|
|
import { show } from "@/api/system/customForm";
|
|
|
|
|
import * as XLSX from "xlsx";
|
|
|
|
|
import { saveAs } from "file-saver";
|
|
|
|
|
import { listdept } from "@/api/system/department"
|
|
|
|
|
import { listdept } from "@/api/system/department";
|
|
|
|
|
|
|
|
|
|
import add from "./component/addHouse.vue";
|
|
|
|
|
import LxHeader from "@/components/LxHeader/index.vue";
|
|
|
|
|
import headerContent from "@/components/LxHeader/XyContent.vue";
|
|
|
|
|
import addHistory from '@/views/assets/component/addHistory.vue'
|
|
|
|
|
import addHistory from "@/views/assets/component/addHistory.vue";
|
|
|
|
|
// import drawer from "@/views/component/drawer.vue";
|
|
|
|
|
// import imports from "./imports.vue";
|
|
|
|
|
// import atlas from "@/views/assets/atlas.vue";
|
|
|
|
|
// import assetsHistoryList from '@/views/assets/assetsHistoryList.vue'
|
|
|
|
|
export default {
|
|
|
|
|
name: 'tableList',
|
|
|
|
|
name: "tableList",
|
|
|
|
|
components: {
|
|
|
|
|
LxHeader,
|
|
|
|
|
add,
|
|
|
|
|
@ -432,14 +456,17 @@ export default {
|
|
|
|
|
//字段处理
|
|
|
|
|
//初始表白名单
|
|
|
|
|
let baseTable = new Map([
|
|
|
|
|
['departments', async () => {
|
|
|
|
|
const res = await listdept()
|
|
|
|
|
return res
|
|
|
|
|
}],
|
|
|
|
|
['admins',[]]
|
|
|
|
|
])
|
|
|
|
|
[
|
|
|
|
|
"departments",
|
|
|
|
|
async () => {
|
|
|
|
|
const res = await listdept();
|
|
|
|
|
return res;
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
["admins", []],
|
|
|
|
|
]);
|
|
|
|
|
let { fields, relation } = res;
|
|
|
|
|
let fieldRes = fields.sort((a,b) => a.sort - b.sort)
|
|
|
|
|
let fieldRes = fields.sort((a, b) => a.sort - b.sort);
|
|
|
|
|
if (
|
|
|
|
|
!fields ||
|
|
|
|
|
!relation ||
|
|
|
|
|
@ -448,7 +475,7 @@ export default {
|
|
|
|
|
) {
|
|
|
|
|
throw new Error("fields或relation格式错误");
|
|
|
|
|
}
|
|
|
|
|
console.log(fieldRes)
|
|
|
|
|
console.log(fieldRes);
|
|
|
|
|
fieldRes?.forEach((i, index) => {
|
|
|
|
|
i._relations = relation.find(
|
|
|
|
|
(j) => j.link_table_name.split("_")[1] === i.field
|
|
|
|
|
@ -464,8 +491,8 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (i.edit_input === 'file' || i.edit_input === 'files') {
|
|
|
|
|
return
|
|
|
|
|
if (i.edit_input === "file" || i.edit_input === "files") {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (i._relations) {
|
|
|
|
|
if (baseTable.get(i._relations.link_table_name)) {
|
|
|
|
|
@ -477,17 +504,17 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
i._params = i._relations.parameter_id
|
|
|
|
|
? getparameter({ id: i._relations.parameter_id }, false).then(
|
|
|
|
|
(res) => {
|
|
|
|
|
i._params = res.detail;
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
(res) => {
|
|
|
|
|
i._params = res.detail;
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
: this.index({
|
|
|
|
|
table_name: i._relations.link_table_name,
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
i._params = res.data;
|
|
|
|
|
});
|
|
|
|
|
table_name: i._relations.link_table_name,
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
i._params = res.data;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -501,7 +528,7 @@ export default {
|
|
|
|
|
linkOb.customFn = (row) => {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
style={{ "max-height": "55px","overflow": "scroll" }}
|
|
|
|
|
style={{ "max-height": "55px", overflow: "scroll" }}
|
|
|
|
|
domPropsInnerHTML={row[i.field]}
|
|
|
|
|
></div>
|
|
|
|
|
);
|
|
|
|
|
@ -553,12 +580,10 @@ export default {
|
|
|
|
|
return (
|
|
|
|
|
<div style="display: flex;flex-direction: column;">
|
|
|
|
|
{row[link_with_name]?.map((o) => (
|
|
|
|
|
<a>
|
|
|
|
|
{ o?.original_name || o?.name }
|
|
|
|
|
</a>
|
|
|
|
|
<a>{o?.original_name || o?.name}</a>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
@ -578,19 +603,53 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let alignLeft = ['dikuaimingcheng','chengjiandanwei','jianshedanwei','wuyedanwei']
|
|
|
|
|
this.table.push(
|
|
|
|
|
Object.assign(
|
|
|
|
|
{
|
|
|
|
|
let alignLeft = [
|
|
|
|
|
"dikuaimingcheng",
|
|
|
|
|
"chengjiandanwei",
|
|
|
|
|
"jianshedanwei",
|
|
|
|
|
"wuyedanwei",
|
|
|
|
|
];
|
|
|
|
|
switch (i.field) {
|
|
|
|
|
case "bufuqingkuang":
|
|
|
|
|
this.table.push({
|
|
|
|
|
prop: i.field,
|
|
|
|
|
label: i.name,
|
|
|
|
|
width: i.width,
|
|
|
|
|
align: alignLeft.find(m => m === i.field) ? 'left' : 'center',
|
|
|
|
|
align: alignLeft.find((m) => m === i.field) ? "left" : "center",
|
|
|
|
|
fixed: i.is_fixed,
|
|
|
|
|
},
|
|
|
|
|
linkOb
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
customFn: (row) => {
|
|
|
|
|
return (
|
|
|
|
|
<a
|
|
|
|
|
on={{
|
|
|
|
|
["click"]: (e) => {
|
|
|
|
|
this.$refs["addHistory"].setRow(row);
|
|
|
|
|
this.$refs["addHistory"].setType("show");
|
|
|
|
|
this.$refs["addHistory"].show();
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
查看
|
|
|
|
|
</a>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
this.table.push(
|
|
|
|
|
Object.assign(
|
|
|
|
|
{
|
|
|
|
|
prop: i.field,
|
|
|
|
|
label: i.name,
|
|
|
|
|
width: i.width,
|
|
|
|
|
align: alignLeft.find((m) => m === i.field)
|
|
|
|
|
? "left"
|
|
|
|
|
: "center",
|
|
|
|
|
fixed: i.is_fixed,
|
|
|
|
|
},
|
|
|
|
|
linkOb
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.table.unshift({
|
|
|
|
|
type: "index",
|
|
|
|
|
@ -598,13 +657,24 @@ export default {
|
|
|
|
|
label: "序号",
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
toHistory (row) {
|
|
|
|
|
if (row.id_his_evolutions_house_id_relation?.id) {
|
|
|
|
|
this.$refs['addHistory'].setType('editor')
|
|
|
|
|
this.$refs['addHistory'].setId(row.id_his_evolutions_house_id_relation?.id)
|
|
|
|
|
}
|
|
|
|
|
this.$refs['addHistory'].setRow(row);
|
|
|
|
|
this.$refs['addHistory'].show();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
columnArrTest() {
|
|
|
|
|
return function (field) {
|
|
|
|
|
return this.form.find((i) => i.field === field)
|
|
|
|
|
? this.form.find((i) => i.field === field).search_input === "checkbox" || this.form.find((i) => i.field === field).search_input === "radio"
|
|
|
|
|
? this.form.find((i) => i.field === field).search_input ===
|
|
|
|
|
"checkbox" ||
|
|
|
|
|
this.form.find((i) => i.field === field).search_input === "radio"
|
|
|
|
|
: false;
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
@ -621,7 +691,7 @@ export default {
|
|
|
|
|
? this.form.find((i) => i.field === field)._params
|
|
|
|
|
: [];
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getFormDetail();
|
|
|
|
|
|