|
|
|
|
@ -2,6 +2,57 @@
|
|
|
|
|
<div>
|
|
|
|
|
<el-dialog :visible.sync="dialogVisible">
|
|
|
|
|
<template>
|
|
|
|
|
<div class="select">
|
|
|
|
|
<Select
|
|
|
|
|
v-model="select.filter[0].key"
|
|
|
|
|
style="width: 100px"
|
|
|
|
|
placeholder="搜索条目"
|
|
|
|
|
>
|
|
|
|
|
<Option v-for="item in fields" :key="item.id" :value="item.field">{{
|
|
|
|
|
item.name
|
|
|
|
|
}}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
<Select
|
|
|
|
|
v-model="select.filter[0].op"
|
|
|
|
|
style="width: 100px; margin-left: 10px"
|
|
|
|
|
placeholder="搜索条件"
|
|
|
|
|
>
|
|
|
|
|
<Option v-for="item in op" :key="item.value" :value="item.value">{{
|
|
|
|
|
item.label
|
|
|
|
|
}}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
<template v-if="select.filter[0].op !== 'range'">
|
|
|
|
|
<Input
|
|
|
|
|
clearable
|
|
|
|
|
v-model="select.filter[0].value"
|
|
|
|
|
style="width: 150px; margin-left: 10px"
|
|
|
|
|
placeholder="请填写关键词"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<Input
|
|
|
|
|
:value="select.filter[0].value.split(',')[0]"
|
|
|
|
|
style="width: 150px; margin-left: 10px"
|
|
|
|
|
placeholder="范围开始关键词"
|
|
|
|
|
@input="(e) => inputStartHandler(e, select.filter[0])"
|
|
|
|
|
/>
|
|
|
|
|
<span style="margin-left: 10px; display: flex; align-items: center"
|
|
|
|
|
>至</span
|
|
|
|
|
>
|
|
|
|
|
<Input
|
|
|
|
|
:value="select.filter[0].value.split(',')[1]"
|
|
|
|
|
style="width: 150px; margin-left: 10px"
|
|
|
|
|
placeholder="范围结束关键词"
|
|
|
|
|
@input="(e) => inputEndHandler(e, select.filter[0])"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<Button
|
|
|
|
|
style="margin-left: 10px"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="$refs['table'].getTableData(true)"
|
|
|
|
|
>查询</Button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<xy-table
|
|
|
|
|
:is-first-req="false"
|
|
|
|
|
ref="table"
|
|
|
|
|
@ -31,6 +82,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { op } from '@/const/op'
|
|
|
|
|
import { index } from "@/api/system/baseForm";
|
|
|
|
|
import { index as customFormIndex, show } from "@/api/system/customForm";
|
|
|
|
|
export default {
|
|
|
|
|
@ -45,12 +97,21 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
op,
|
|
|
|
|
tempRow: {},
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
select: {
|
|
|
|
|
table_name: "",
|
|
|
|
|
table_id: "",
|
|
|
|
|
filter: [
|
|
|
|
|
{
|
|
|
|
|
key: '',
|
|
|
|
|
op: '',
|
|
|
|
|
value: ''
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
fields: [],
|
|
|
|
|
columns: [],
|
|
|
|
|
originalRowIds: [],
|
|
|
|
|
};
|
|
|
|
|
@ -64,6 +125,16 @@ export default {
|
|
|
|
|
this.dialogVisible = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//target要为内存地址引用类型
|
|
|
|
|
inputStartHandler(e, target) {
|
|
|
|
|
let temp = target?.value.split(",")[1];
|
|
|
|
|
target.value = `${e},${temp ? temp : ""}`;
|
|
|
|
|
},
|
|
|
|
|
inputEndHandler(e, target) {
|
|
|
|
|
let temp = target?.value.split(",")[0];
|
|
|
|
|
target.value = `${temp ? temp : ""},${e}`;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getDataTableName() {
|
|
|
|
|
if (this.linkType === "hasMany" || this.linkType === "newHasMany") {
|
|
|
|
|
const tables = (
|
|
|
|
|
@ -110,6 +181,7 @@ export default {
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.fields = res.fields;
|
|
|
|
|
this.columns = res.fields
|
|
|
|
|
?.filter((i) => i.list_show)
|
|
|
|
|
.map((i) => {
|
|
|
|
|
@ -168,16 +240,21 @@ export default {
|
|
|
|
|
rowPick({ row }) {
|
|
|
|
|
this.tempRow = row;
|
|
|
|
|
},
|
|
|
|
|
selectBk (selections, row) {
|
|
|
|
|
if (!selections.find(i => i.id === row.id)) {
|
|
|
|
|
this.originalRowIds.splice(this.originalRowIds.indexOf(row.id),1)
|
|
|
|
|
selectBk(selections, row) {
|
|
|
|
|
if (!selections.find((i) => i.id === row.id)) {
|
|
|
|
|
this.originalRowIds.splice(this.originalRowIds.indexOf(row.id), 1);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
confirm() {
|
|
|
|
|
this.linkType === "hasMany" || this.linkType === "newHasMany"
|
|
|
|
|
? this.$emit("confirm", {
|
|
|
|
|
field: this.field,
|
|
|
|
|
value: Array.from(new Set([...this.$refs["table"].getSelection()?.map(i => i.id),...this.originalRowIds])),
|
|
|
|
|
value: Array.from(
|
|
|
|
|
new Set([
|
|
|
|
|
...this.$refs["table"].getSelection()?.map((i) => i.id),
|
|
|
|
|
...this.originalRowIds,
|
|
|
|
|
])
|
|
|
|
|
),
|
|
|
|
|
})
|
|
|
|
|
: this.$emit("confirm", {
|
|
|
|
|
field: this.field,
|
|
|
|
|
@ -195,19 +272,22 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
dialogVisible(newVal) {
|
|
|
|
|
if (newVal) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.tempRow = {};
|
|
|
|
|
this.$refs['table'].clearSelection();
|
|
|
|
|
this.$refs["table"].clearSelection();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
originalRows (newVal) {
|
|
|
|
|
this.originalRowIds = newVal.map(i => i[this.field])
|
|
|
|
|
originalRows(newVal) {
|
|
|
|
|
this.originalRowIds = newVal.map((i) => i[this.field]);
|
|
|
|
|
|
|
|
|
|
this.selectRows();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"></style>
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.select {
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|