master
xy 3 years ago
parent 37187d5a58
commit bce11bdcce

@ -241,6 +241,7 @@ export default {
.then((res) => {
this.listData = this.getByStrkey(res.data, this.resProp);
this.totalData = res.data.total;
this.$emit('loaded')
setTimeout(() => {
this.loading = false;
@ -260,6 +261,7 @@ export default {
.then((res) => {
this.listData = this.getByStrkey(res, this.resProp);
this.totalData = res.total;
this.$emit('loaded')
setTimeout(() => {
this.loading = false;
@ -367,7 +369,7 @@ export default {
this.$refs.table.toggleRowExpansion(row, expanded);
},
setCurrentRow(row) {
this.$refs.table.toggleRowExpansion(row);
this.$refs.table.setCurrentRow(row);
},
clearSort() {
this.$refs.table.clearSort();
@ -384,6 +386,9 @@ export default {
getSelection(){
return this.$refs.table?.store?.states?.selection ?? []
},
getListData () {
return this.listData
},
//table
delete(row, type) {
@ -443,6 +448,7 @@ export default {
expandChange(row, expanded) {
this.$emit("expand-change", row, expanded);
},
deleteClick(row) {
this.$emit("delete", row);
if (this.destroyAction) {
@ -926,6 +932,7 @@ export default {
.xy-table__page {
display: flex;
justify-content: right;
align-items: center;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
background: rgba(140, 140, 140, 0.6);

@ -1,12 +1,12 @@
import { domMap } from '@/const/inputType'
import { addPropsMap } from '@/const/addProps'
import { domMap } from "@/const/inputType";
import { addPropsMap } from "@/const/addProps";
export class CreateDialog {
replaces
self
$createElement
options
constructor (self, replaces = [], options) {
replaces;
self;
$createElement;
options;
constructor(self, replaces = [], options) {
/*
replace = [
{
@ -16,24 +16,24 @@ export class CreateDialog {
}
]
*/
this.self = self
this.$createElement = self.$createElement
this.replaces = replaces
this.options = options
this.self = self;
this.$createElement = self.$createElement;
this.replaces = replaces;
this.options = options;
}
getEventType (info) {
getEventType(info) {
if (info === "checkbox") {
return "change";
}
return "input";
}
fileRemoveHandler(file, field) {
let that = this.self
let that = this.self;
that.file[field] = that.file[field].filter((item) => item !== file);
that.file = Object.assign({}, that.file);
}
extraProps (info) {
let that = this.self
extraProps(info) {
let that = this.self;
let props = {};
if (info.edit_input === "file" || info.edit_input === "files") {
props.fileList = that.file[info.field];
@ -66,24 +66,24 @@ export class CreateDialog {
return props;
}
optionsRender(h, info) {
let that = this.self
let that = this.self;
if (info.edit_input === "checkbox" || info.edit_input === "radio") {
return info._params && info._params instanceof Array
? info._params.map((i) =>
h("el-option", {
props: {
label:
i.name ||
i.mingcheng ||
i.label ||
i.key ||
i.value ||
i.id ||
i.no,
value: i.id || i.value,
},
})
)
h("el-option", {
props: {
label:
i.name ||
i.mingcheng ||
i.label ||
i.key ||
i.value ||
i.id ||
i.no,
value: i.id || i.value,
},
})
)
: [];
}
if (info.edit_input === "file" || info.edit_input === "files") {
@ -128,16 +128,22 @@ export class CreateDialog {
];
}
}
render () {
let that = this.self
const h = this.$createElement
render() {
let that = this.self;
const h = this.$createElement;
return h(
"el-dialog",
{
class: "dialog",
ref: "dialog",
props: {
top: "8vh",
title: "新增",
title: that.title
? that.title
: that.type === "add"
? "新增"
: "编辑",
visible: that.dialogVisible,
width: this.options?.width ? this.options.width : "800px",
},
@ -177,154 +183,151 @@ export class CreateDialog {
(this.options?.formInfo ? this.options.formInfo : that.formInfo)
.filter((i) => i.form_show)
.forEach((i, index) => {
let replace = this.replaces.find(j => j.key === i.field)
if (replace && replace.render) {
dom.push(replace.render)
} else {
dom.push(
h(
"el-form-item",
{
ref: `elFormItem${i.field}`,
style: {
width: "100%",
},
props: {
label: i.name,
prop: i.field,
required:
i.validation instanceof Array
? !!i.validation.find((i) => i === "required")
: false,
},
let replace = this.replaces.find((j) => j.key === i.field);
dom.push(
h(
"el-form-item",
{
ref: `elFormItem${i.field}`,
style: {
width: "100%",
},
that.$scopedSlots[i.field]
? that.$scopedSlots[i.field]({
fieldInfo: i,
form: that.form,
file: that.file,
})
: [
h(
domMap.get(i.edit_input),
{
ref: `elEdit_${i.field}`,
style: {
width: "100%",
},
props: {
...addPropsMap.get(i.edit_input),
...this.extraProps(i),
placeholder: i.help,
value: that.form[i.field],
},
attrs: {
placeholder: i.help || `请填写${i.name}`,
},
on: {
[this.getEventType(i.edit_input)]: (
e
) => {
if (i.field) {
that.form[i.field] = e;
that.form = Object.assign(
{},
that.form
);
}
},
props: {
label: i.name,
prop: i.field,
required:
i.validation instanceof Array
? !!i.validation.find((i) => i === "required")
: false,
},
},
replace && replace.render
? [replace.render]
: [
h(
domMap.get(i.edit_input),
{
ref: `elEdit_${i.field}`,
style: {
width: "100%",
},
props: {
...addPropsMap.get(i.edit_input),
...this.extraProps(i),
placeholder: i.help,
value: that.form[i.field],
readonly: that.type === "show",
//disabled: that.type === 'show',
},
attrs: {
placeholder: i.help || `请填写${i.name}`,
},
on: {
[this.getEventType(i.edit_input)]: (
e
) => {
if (i.field) {
that.form[i.field] = e;
that.form = Object.assign(
{},
that.form
);
}
},
scopedSlots:
i.edit_input === "file" ||
i.edit_input === "files"
? {
file: (scope) => {
let { file } = scope;
return [
h("div", {}, [
h("i", {
},
scopedSlots:
i.edit_input === "file" ||
i.edit_input === "files"
? {
file: (scope) => {
let { file } = scope;
return [
h("div", {}, [
h("i", {
class: {
"el-icon-circle-check":
file.status ===
"success",
"el-icon-loading":
file.status ===
"uploading",
},
style: {
color:
file.status ===
"success"
? "green"
: "",
},
}),
h(
"a",
{
attrs: {
href: file.url,
download: file.name,
},
class: {
"el-icon-circle-check":
"uploaded-a":
file.status ===
"success",
"el-icon-loading":
file.status ===
"uploading",
},
style: {
color:
file.status ===
"success"
? "green"
: "",
},
}),
h(
"a",
{
attrs: {
href: file.url,
download: file.name,
},
class: {
"uploaded-a":
file.status ===
"success",
},
style: {
padding: "0 4px",
},
padding: "0 4px",
},
file.name
),
]),
h("i", {
class: "el-icon-close",
on: {
["click"]: () =>
this.fileRemoveHandler(
file,
i.field
),
},
}),
];
},
}
: "",
},
this.optionsRender(h, i)
),
]
)
);
}
file.name
),
]),
h("i", {
class: "el-icon-close",
on: {
["click"]: () =>
this.fileRemoveHandler(
file,
i.field
),
},
}),
];
},
}
: "",
},
this.optionsRender(h, i)
),
]
)
);
});
this.replaces.forEach(replace => {
let info = that.formInfo.find(i => i.field === replace.key)
this.replaces.forEach((replace) => {
let info = that.formInfo.find((i) => i.field === replace.key);
if (!info) {
if (replace.label) {
dom.push(h(
"el-form-item",
{
ref: `elFormItem${replace.key}`,
style: {
width: "100%",
},
props: {
label: replace.label,
prop: replace.key,
dom.push(
h(
"el-form-item",
{
ref: `elFormItem${replace.key}`,
style: {
width: "100%",
...replace.rowStyle,
},
props: {
label: replace.label,
prop: replace.key,
},
},
},
[replace.render]
))
[replace.render]
)
);
} else {
dom.push(replace.render)
dom.push(replace.render);
}
}
})
});
return dom;
})()
),
@ -335,7 +338,7 @@ export class CreateDialog {
"el-button",
{
props: {
size: "mini"
size: "mini",
},
on: {
click: () => (that.dialogVisible = false),
@ -349,7 +352,7 @@ export class CreateDialog {
props: {
type: "warning",
plain: true,
size: 'mini'
size: "mini",
},
on: {
click: () => that.init(),
@ -362,7 +365,7 @@ export class CreateDialog {
{
props: {
type: "primary",
size: 'mini'
size: "mini",
},
on: {
click: that.submit,

@ -16,17 +16,17 @@ export default {
},
{
key: 'houseArea',
label: '房产日期',
label: '日期',
render: h('span', this.row.dengjishijian)
},
{
key: 'tudixingzhi',
label: '土地性质',
render: h('span','')
render: h('span', this.row.shiyongquanleixing)
},
{
key: 'tudiyongtu',
label: '土地/房产用途',
label: '用途',
render: h('span', this.row.yongtu)
}
],{
@ -36,6 +36,7 @@ export default {
},
data() {
return {
columns: 1,
row: {},
formInfo: [],
id: "",
@ -68,7 +69,7 @@ export default {
this.dialogVisible = false;
},
setType(type = "add") {
let types = ["add", "editor"];
let types = ["add", "editor", "show"];
if (types.includes(type)) {
this.type = type;
} else {
@ -84,7 +85,7 @@ export default {
},
async getDetail() {
const res = await show({ id: this.id, table_name: this.tableName });
const res = await show({ id: this.row.id_his_evolutions_house_id_relation?.id || this.row.id_his_evolutions_land_id_relation?.id, table_name: 'his_evolutions' });
this.$integrateData(this.form, res);
this.formInfo.forEach((i) => {
@ -115,10 +116,42 @@ export default {
},
submit() {
console.log(this.form)
if (/\/house/g.test(this.$route.path)) {
this.form['house_id'] = this.row.id
}
if (/\/land/g.test(this.$route.path)) {
this.form['land_id'] = this.row.id
}
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
}
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
}
save(Object.assign(this.form, { table_name: 'his_evolutions' })).then(res => {
this.$Message.success({
content: `${this.type === "add" ? "新增" : "编辑"}成功`,
});
this.$emit("refresh");
this.hidden();
})
},
},
computed: {},
computed: {
title () {
if (this.type === 'add') return '新增'
if (this.type === 'editor') return '编辑'
if (this.type === 'show') return '查看'
}
},
watch: {
formInfo: {
handler: function (newVal) {
@ -152,16 +185,17 @@ export default {
}
});
document.documentElement.style.setProperty(
"--column-num",
newVal.length > 11 ? '2' : '1'
);
this.columns = newVal.length > 11 ? '2' : '1'
},
//immediate: true,
},
dialogVisible(val) {
if (val) {
if (this.type === "editor") {
document.documentElement.style.setProperty(
"--column-num",
this.columns
);
if (this.type === "editor" || this.type === "show") {
this.$nextTick(() => this.getDetail());
}
} else {

@ -19,6 +19,7 @@ export default {
},
data() {
return {
columns: 1,
id: "",
type: "add",
dialogVisible: false,
@ -253,15 +254,16 @@ export default {
}
});
document.documentElement.style.setProperty(
"--column-num",
newVal.length > 11 ? '2' : '1'
);
this.columns = newVal.length > 11 ? '2' : '1'
},
//immediate: true,
},
dialogVisible(val) {
if (val) {
document.documentElement.style.setProperty(
"--column-num",
this.columns
);
if (this.type === "editor") {
this.$nextTick(() => this.getDetail());
}

@ -1,6 +1,6 @@
<script>
import { save, show, index, destroy } from "@/api/system/baseForm";
import { CreateDialog } from "@/utils/createDialog"
import { CreateDialog } from "@/utils/createDialog";
import { deepCopy } from "@/utils";
export default {
props: {
@ -11,23 +11,117 @@ export default {
tableName: String,
},
render(h) {
let dialog = new CreateDialog(this,[
let dialog = new CreateDialog(this, [
{
key: 'id_historical_evolutions_land_id_relation',
label: '历史沿革材料',
render: h('el-button',{
key: "fangchanzhuangtai",
label: "房产状态",
render: h("el-input", {
props: {
type: 'primary',
size: 'small',
icon: 'el-icon-plus'
}
}, '新增')
}
])
return dialog.render()
readonly: true,
size: "small",
value: this.originalForm["id_house_properties_land_id_relation"]
? "房地权属合一"
: "房地权属分离",
},
}),
},
{
key: "house_relation",
label: "关联房产",
rowStyle: {
"grid-column": "span 2",
},
render: h("xy-table", {
ref: "houseTable",
props: {
action: index,
auths: [],
reqOpt: {
table_name: "houses",
},
tableItem: [
{
label: "名称",
prop: "name",
minWidth: 160,
fixed: "left",
},
{
label: "区域",
prop: "area",
width: 80,
formatter: (data, row, value) => {
let map = new Map([
[1, "宜兴市"],
[2, "惠山区"],
[3, "新吴区"],
[4, "梁溪区"],
[5, "江阴市"],
[6, "滨湖区"],
[7, "锡山区"],
]);
return map.get(value);
},
},
{
label: "登记面积(m²)",
prop: "dengjimianji",
width: 120,
},
{
label: "实际面积(m²)",
prop: "shijimianji",
width: 120,
},
{
label: "入账时间",
prop: "ruzhangshijian",
width: 160,
},
{
label: "账面原值",
prop: "zhangmianyuanzhi",
width: 160,
},
],
},
on: {
["loaded"]: (_) => {
this.setCurrentRow();
},
["row-click"]: ({ row }) => {
if (row.land_id && row.land_id !== this.id) {
this.$message({
type: "warning",
message: "当前房产已有绑定土地",
});
return;
}
this.form["ruzhangshijian"] = row.ruzhangshijian;
this.form["zhangmianyuanzhi"] = row.zhangmianyuanzhi;
this.pickHouseRow = deepCopy(row);
delete this.pickHouseRow.id_his_evolutions_house_id_relation;
let copyRow = deepCopy(row);
delete copyRow.id;
copyRow.land_id = this.id;
this.form["id_house_properties_land_id_relation"] = [
Object.assign(
this.originalForm?.id_house_properties_land_id_relation
? this.originalForm.id_house_properties_land_id_relation
: {},
copyRow
),
];
},
},
}),
},
]);
return dialog.render();
},
data() {
return {
columns: 1,
id: "",
type: "add",
dialogVisible: false,
@ -35,6 +129,8 @@ export default {
originalForm: {},
rules: {},
file: {},
pickHouseRow: null,
};
},
methods: {
@ -78,21 +174,21 @@ export default {
if (i && (i.edit_input === "file" || i.edit_input === "files")) {
res[i._relations.link_with_name]
? (this.file[i.field] =
res[i._relations.link_with_name] instanceof Array
? res[i._relations.link_with_name].map((i) => {
return {
name: i?.name,
url: i?.url,
response: i,
};
})
: [
{
name: res[i._relations.link_with_name]?.name,
url: res[i._relations.link_with_name]?.url,
response: res[i._relations.link_with_name],
},
])
res[i._relations.link_with_name] instanceof Array
? res[i._relations.link_with_name].map((i) => {
return {
name: i?.name,
url: i?.url,
response: i,
};
})
: [
{
name: res[i._relations.link_with_name]?.name,
url: res[i._relations.link_with_name]?.url,
response: res[i._relations.link_with_name],
},
])
: (this.file[i.field] = []);
}
@ -146,7 +242,7 @@ export default {
if (info.edit_input === "files") {
copyForm[info._relations.link_with_name] = this.file[
info.field
]?.map((i) => {
]?.map((i) => {
let copyRelation = i?.response ? deepCopy(i?.response) : "";
delete copyRelation.id;
return {
@ -157,15 +253,15 @@ export default {
} else {
copyForm[info._relations.link_with_name] = copyForm[
info.field
]?.map((i) => {
]?.map((i) => {
let copyRelation = info._params.find(
(param) => param[info._relations?.foreign_key] === i
)
? deepCopy(
info._params.find(
(param) => param[info._relations?.foreign_key] === i
info._params.find(
(param) => param[info._relations?.foreign_key] === i
)
)
)
: "";
delete copyRelation.id;
return {
@ -214,6 +310,16 @@ export default {
delete copyForm[info._relations?.link_with_name];
}
});
if (this.pickHouseRow && typeof this.pickHouseRow === "object") {
promiseAll.push(
save(
Object.assign(this.pickHouseRow, {
table_name: "houses",
land_id: this.id,
})
)
);
}
promiseAll.push(
save(Object.assign(copyForm, { table_name: this.tableName }))
);
@ -227,6 +333,16 @@ export default {
}
});
},
setCurrentRow() {
this.$nextTick(() => {
this.$refs["houseTable"].setCurrentRow(
this.$refs["houseTable"]
.getListData()
.find((row) => row.land_id === this.id)
);
});
},
},
computed: {},
watch: {
@ -262,15 +378,16 @@ export default {
}
});
document.documentElement.style.setProperty(
"--column-num",
newVal.length > 11 ? '2' : '1'
);
this.columns = newVal.length > 11 ? "2" : "1";
},
//immediate: true,
},
dialogVisible(val) {
if (val) {
document.documentElement.style.setProperty(
"--column-num",
this.columns
);
if (this.type === "editor") {
this.$nextTick(() => this.getDetail());
}
@ -279,6 +396,7 @@ export default {
this.type = "";
this.init();
this.$refs["elForm"].clearValidate();
this.$refs["houseTable"].setCurrentRow();
delete this.form.id;
for (let key in this.file) {
this.file[key] = [];

@ -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();

@ -265,12 +265,12 @@
}
"
>
<template #assetsHistory="{row}">
<template #assetsHistory="{ row }">
<Button
size="small"
type="primary"
@click="$refs['assetsHistoryList'].setId(row.id),$refs['assetsHistoryList'].show()"
>历史</Button
@click="toHistory(row)"
>历史沿革</Button
>
</template>
@ -291,6 +291,7 @@
@refresh="$refs['xyTable'].getTableData()"
>
</add>
<addHistory ref="addHistory"></addHistory>
<!-- <drawer-->
<!-- :table-name="customForm.tableName"-->
<!-- :form-info="form"-->
@ -322,6 +323,7 @@ import { listdept } from "@/api/system/department"
import add from "./component/addLand.vue";
import LxHeader from "@/components/LxHeader/index.vue";
import headerContent from "@/components/LxHeader/XyContent.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";
@ -329,6 +331,7 @@ import headerContent from "@/components/LxHeader/XyContent.vue";
export default {
name: 'tableList',
components: {
addHistory,
LxHeader,
add,
headerContent,
@ -581,18 +584,47 @@ export default {
}
let alignLeft = ['dikuaimingcheng','chengjiandanwei','jianshedanwei','wuyedanwei']
this.table.push(
Object.assign(
{
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",
@ -600,6 +632,15 @@ export default {
label: "序号",
});
},
toHistory (row) {
if (row.id_his_evolutions_land_id_relation?.id) {
this.$refs['addHistory'].setType('editor')
this.$refs['addHistory'].setId(row.id_his_evolutions_land_id_relation?.id)
}
this.$refs['addHistory'].setRow(row);
this.$refs['addHistory'].show();
}
},
computed: {

@ -611,12 +611,10 @@ export default {
};
</script>
<style>
<style scoped lang="scss">
:root {
--column-num: 2;
}
</style>
<style scoped lang="scss">
.uploaded-a {
color: red;
text-decoration: none;

Loading…
Cancel
Save