|
@@ -32,28 +32,44 @@
|
|
|
</el-table>
|
|
|
<!-- 分页 -->
|
|
|
<div class="pagination-container">
|
|
|
- <el-pagination background layout="prev, pager, next" :current-page="pagination.currentPage"
|
|
|
- :page-size="pagination.pageSize" :total="pagination.total" @current-change="onPageChange"></el-pagination>
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :current-page="pagination.currentPage"
|
|
|
+ :page-size="pagination.pageSize"
|
|
|
+ :total="pagination.total"
|
|
|
+ @current-change="onPageChange"
|
|
|
+ ></el-pagination>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="18" style="padding-left: 20px">
|
|
|
<div>六统一接入方式为库表接入工具,必填此表</div>
|
|
|
<!-- 右侧表格 -->
|
|
|
- <div style="
|
|
|
+ <div
|
|
|
+ style="
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
justify-content: end;
|
|
|
align-items: center;
|
|
|
- ">
|
|
|
-
|
|
|
+ "
|
|
|
+ >
|
|
|
<el-button type="primary" @click="addClick">新增</el-button>
|
|
|
<!-- <el-button type="primary" @click="deleteSelected">删除</el-button> -->
|
|
|
<el-button type="primary">上传</el-button>
|
|
|
<el-button type="primary">模版下载</el-button>
|
|
|
</div>
|
|
|
- <el-table ref="rightTable" :data="rightTableData" border style="width: 100%" :expand-row-keys="expandedRows"
|
|
|
- row-key="id" @expand-change="onExpandChange" :show-header="false" max-height="800"
|
|
|
- @selection-change="handleSelectionChange">
|
|
|
+ <el-table
|
|
|
+ ref="rightTable"
|
|
|
+ :data="rightTableData"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ :expand-row-keys="expandedRows"
|
|
|
+ row-key="id"
|
|
|
+ @expand-change="onExpandChange"
|
|
|
+ :show-header="false"
|
|
|
+ max-height="800"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
<!-- 勾选框列 -->
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
<!-- 序号列 -->
|
|
@@ -64,8 +80,11 @@
|
|
|
<template slot-scope="scope">
|
|
|
<div style="display: flex; align-items: center">
|
|
|
<div>表中文名</div>
|
|
|
- <el-input style="width: 260px; margin-left: 20px" v-model="scope.row.tableName"
|
|
|
- placeholder="请输入内容"></el-input>
|
|
|
+ <el-input
|
|
|
+ style="width: 260px; margin-left: 20px"
|
|
|
+ v-model="scope.row.tableName"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -73,8 +92,11 @@
|
|
|
<template slot-scope="scope">
|
|
|
<div style="display: flex; align-items: center">
|
|
|
<span>表英文名</span>
|
|
|
- <el-input style="width: 260px; margin-left: 20px" v-model="scope.row.tableEnglishName"
|
|
|
- placeholder="请输入内容"></el-input>
|
|
|
+ <el-input
|
|
|
+ style="width: 260px; margin-left: 20px"
|
|
|
+ v-model="scope.row.tableEnglishName"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -82,8 +104,11 @@
|
|
|
<template slot-scope="scope">
|
|
|
<div style="display: flex; align-items: center">
|
|
|
<span>表描述</span>
|
|
|
- <el-input style="width: 260px; margin-left: 20px" v-model="scope.row.tableDetail"
|
|
|
- placeholder="请输入内容"></el-input>
|
|
|
+ <el-input
|
|
|
+ style="width: 260px; margin-left: 20px"
|
|
|
+ v-model="scope.row.tableDetail"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -92,9 +117,12 @@
|
|
|
<el-table-column type="expand">
|
|
|
<template slot-scope="props">
|
|
|
<div class="expanded-content">
|
|
|
- <el-table ref="rightExpandTable" :data="props.row.tabDatasourceMsgs" border style="width: 100%">
|
|
|
-
|
|
|
-
|
|
|
+ <el-table
|
|
|
+ ref="rightExpandTable"
|
|
|
+ :data="props.row.tabDatasourceMsgs"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
<!-- 序号列 -->
|
|
|
<el-table-column label="序号" type="index" width="50"></el-table-column>
|
|
|
|
|
@@ -147,18 +175,24 @@
|
|
|
<el-table-column prop="isRequired" label="是否必填">
|
|
|
<template slot-scope="scope">
|
|
|
<el-select v-model="scope.row.isRequired" placeholder="请选择">
|
|
|
- <el-option v-for="item in whetherOptions" :key="item.value" :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
+ <el-option
|
|
|
+ v-for="item in whetherOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="isSecrecy" label="信息项是否为敏感数据">
|
|
|
<template slot-scope="scope">
|
|
|
<el-select v-model="scope.row.isSecrecy" placeholder="请选择">
|
|
|
- <el-option v-for="item in whetherOptions" :key="item.value" :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
+ <el-option
|
|
|
+ v-for="item in whetherOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -169,13 +203,22 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column fixed="right" label="操作" width="100">
|
|
|
<template :slot-scope="{ row ,$index}">
|
|
|
-
|
|
|
- <el-button type="text" size="small" @click="deleteTableRow(props.row, $index)">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="deleteTableRow(props.row, $index)"
|
|
|
+ >删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <el-button type="primary" plain class="mt-4" style="width: 100%" icon="el-icon-plus"
|
|
|
- @click="addTableRow(props.row)"></el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ class="mt-4"
|
|
|
+ style="width: 100%"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ @click="addTableRow(props.row)"
|
|
|
+ ></el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -186,12 +229,45 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
name: "",
|
|
|
- data () {
|
|
|
+ props: {
|
|
|
+ thirdStep: {
|
|
|
+ type: Array,
|
|
|
+ default: []
|
|
|
+ }
|
|
|
+ // rowObj: {
|
|
|
+ // type: Object,
|
|
|
+ // default: {}
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ thirdStep: {
|
|
|
+ handler(newVal) {
|
|
|
+ console.log(newVal, "newVal==thirdStep");
|
|
|
+ this.rightTableData = newVal;
|
|
|
+ this.leftTableData = this.rightTableData;
|
|
|
+ this.pagination.total = this.leftTableData.length;
|
|
|
+ console.log(rightTableData, "rightTableData==thirdStep");
|
|
|
+ },
|
|
|
+ deep: true, // 深入监听
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ // rowObj: {
|
|
|
+ // handler(newVal) {
|
|
|
+ // this.itemView = newVal;
|
|
|
+ // },
|
|
|
+ // deep: true, // 深入监听
|
|
|
+ // immediate: true
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
return {
|
|
|
+ // dialogTitle: "",
|
|
|
+ // isDisabled: false,
|
|
|
+ // itemView: {},
|
|
|
pagination: {
|
|
|
currentPage: 1,
|
|
|
pageSize: 10,
|
|
|
- total: 0,
|
|
|
+ total: 0
|
|
|
},
|
|
|
// 表格选中的数据
|
|
|
selectedRows: [],
|
|
@@ -201,37 +277,43 @@ export default {
|
|
|
expandedRows: [],
|
|
|
whetherOptions: [
|
|
|
{ label: "是", value: 1 },
|
|
|
- { label: "不是", value: 0 },
|
|
|
- ],
|
|
|
+ { label: "不是", value: 0 }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
// 计算当前页要显示的数据
|
|
|
- currentLeftTableData () {
|
|
|
- const start = (this.pagination.currentPage - 1) * this.pagination.pageSize;
|
|
|
+ currentLeftTableData() {
|
|
|
+ const start =
|
|
|
+ (this.pagination.currentPage - 1) * this.pagination.pageSize;
|
|
|
const end = start + this.pagination.pageSize;
|
|
|
return this.leftTableData.slice(start, end);
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
- onExpandChange () { },
|
|
|
- onSearch () { },
|
|
|
- onReset () { },
|
|
|
- onEyeClick (row) {
|
|
|
+ // getView(id) {
|
|
|
+ // getThirdStepTabAccessReadyById(id).then(res => {
|
|
|
+ // if (+res.code === 200) {
|
|
|
+ // console.log(res, "res99==");
|
|
|
+ // this.secondStep = res.data;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+
|
|
|
+ // },
|
|
|
+ onExpandChange() {},
|
|
|
+ onSearch() {},
|
|
|
+ onReset() {},
|
|
|
+ onEyeClick(row) {
|
|
|
// // 检查右侧表格是否已存在相同项
|
|
|
// const existing = this.rightTableData.find(item => item.tableName === row.tableName && item.tableEnglishName === row.tableEnglishName);
|
|
|
// 获取右侧表格对应的数据并展开
|
|
|
if (!this.expandedRows.includes()) {
|
|
|
// this.expandedRows.push(row.tableName); // 将左侧表格对应的行名称加入展开行
|
|
|
this.expandedRows = [row.id]; // 将左侧表格对应的行名称加入展开行
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
// 点击“删除”按钮时,删除左侧表格的项
|
|
|
- onDeleteClick (row) {
|
|
|
+ onDeleteClick(row) {
|
|
|
const index = this.leftTableData.findIndex(item => item.id === row.id);
|
|
|
if (index > -1) {
|
|
|
this.leftTableData.splice(index, 1);
|
|
@@ -240,103 +322,117 @@ export default {
|
|
|
this.onDeleteRightClick(row);
|
|
|
},
|
|
|
// 在右侧表格删除时,删除对应的数据
|
|
|
- onDeleteRightClick (row) {
|
|
|
- const index = this.rightTableData.findIndex(item => item.id === row.id );
|
|
|
+ onDeleteRightClick(row) {
|
|
|
+ const index = this.rightTableData.findIndex(item => item.id === row.id);
|
|
|
if (index > -1) {
|
|
|
this.rightTableData.splice(index, 1);
|
|
|
}
|
|
|
},
|
|
|
- onPageChange (page) {
|
|
|
- this.pagination.currentPage = page
|
|
|
- },
|
|
|
- addClick () {
|
|
|
+ onPageChange(page) {
|
|
|
+ this.pagination.currentPage = page;
|
|
|
+ },
|
|
|
+ addClick() {
|
|
|
const newItem = {
|
|
|
- id: Date.now(), // 使用当前时间戳作为唯一 ID
|
|
|
+ id: Date.now(), // 使用当前时间戳作为唯一 ID
|
|
|
tableName: "",
|
|
|
tableEnglishName: "",
|
|
|
tableDetail: "",
|
|
|
tabDatasourceMsgs: [
|
|
|
{
|
|
|
id: Date.now(), // 使用时间戳作为唯一 ID
|
|
|
- code: '',
|
|
|
- name:'',
|
|
|
- nameEnglish: '',
|
|
|
- definition: '',
|
|
|
- dataType: '',
|
|
|
- dataLenght: '',
|
|
|
- dataPrecision: '',
|
|
|
- numberOfDigits: '',
|
|
|
- defaultValue: '',
|
|
|
- isRequired: '',
|
|
|
- isSecrecy: '',
|
|
|
- status: '',
|
|
|
+ code: "",
|
|
|
+ name: "",
|
|
|
+ nameEnglish: "",
|
|
|
+ definition: "",
|
|
|
+ dataType: "",
|
|
|
+ dataLenght: "",
|
|
|
+ dataPrecision: "",
|
|
|
+ numberOfDigits: "",
|
|
|
+ defaultValue: "",
|
|
|
+ isRequired: "",
|
|
|
+ isSecrecy: "",
|
|
|
+ status: ""
|
|
|
}
|
|
|
- ],
|
|
|
-
|
|
|
+ ]
|
|
|
};
|
|
|
- this.rightTableData.push({ ...newItem })
|
|
|
- this.leftTableData = this.rightTableData
|
|
|
- this.pagination.total = this.leftTableData.length
|
|
|
+ this.rightTableData.push({ ...newItem });
|
|
|
+ this.leftTableData = this.rightTableData;
|
|
|
+ this.pagination.total = this.leftTableData.length;
|
|
|
// console.log(this.leftTableData.length,'this.leftTableData.lenght')
|
|
|
// this.pagination.total = this.leftTableData.length
|
|
|
},
|
|
|
// 处理选择框勾选变化
|
|
|
- handleSelectionChange (val) {
|
|
|
+ handleSelectionChange(val) {
|
|
|
this.selectedRows = val; // 将勾选的行保存到 selectedRows 中
|
|
|
},
|
|
|
// 删除选中的行
|
|
|
- deleteSelected () {
|
|
|
+ deleteSelected() {
|
|
|
if (this.selectedRows.length === 0) {
|
|
|
- this.$message.warning('请先选择要删除的项');
|
|
|
+ this.$message.warning("请先选择要删除的项");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- this.$confirm('确定删除选中的数据吗?', '警告', {
|
|
|
- type: 'warning',
|
|
|
- }).then(() => {
|
|
|
- // 获取选中项的 id
|
|
|
- const selectedIds = this.selectedRows.map(row => row.id);
|
|
|
+ this.$confirm("确定删除选中的数据吗?", "警告", {
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // 获取选中项的 id
|
|
|
+ const selectedIds = this.selectedRows.map(row => row.id);
|
|
|
|
|
|
- // 删除右侧表格中选中的行
|
|
|
- this.rightTableData = this.rightTableData.filter(row => !selectedIds.includes(row.id));
|
|
|
+ // 删除右侧表格中选中的行
|
|
|
+ this.rightTableData = this.rightTableData.filter(
|
|
|
+ row => !selectedIds.includes(row.id)
|
|
|
+ );
|
|
|
|
|
|
- // 删除左侧表格中对应的行
|
|
|
- this.leftTableData = this.leftTableData.filter(row => !selectedIds.includes(row.id));
|
|
|
+ // 删除左侧表格中对应的行
|
|
|
+ this.leftTableData = this.leftTableData.filter(
|
|
|
+ row => !selectedIds.includes(row.id)
|
|
|
+ );
|
|
|
|
|
|
- // 清空选中行
|
|
|
- this.selectedRows = [];
|
|
|
+ // 清空选中行
|
|
|
+ this.selectedRows = [];
|
|
|
|
|
|
- this.$message.success('删除成功');
|
|
|
- }).catch(() => { });
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
// 添加一个新项到展开的表格中
|
|
|
- addTableRow (row) {
|
|
|
+ addTableRow(row) {
|
|
|
// 新增一项
|
|
|
const newItem = {
|
|
|
id: Date.now(), // 使用时间戳作为唯一 ID
|
|
|
- code: '',
|
|
|
- name: '',
|
|
|
- nameEnglish: '',
|
|
|
- definition: '',
|
|
|
- dataType: '',
|
|
|
- dataLenght: '',
|
|
|
- dataPrecision: '',
|
|
|
- numberOfDigits: '',
|
|
|
- defaultValue: '',
|
|
|
- isRequired: '',
|
|
|
- isSecrecy: '',
|
|
|
- status: '',
|
|
|
+ code: "",
|
|
|
+ name: "",
|
|
|
+ nameEnglish: "",
|
|
|
+ definition: "",
|
|
|
+ dataType: "",
|
|
|
+ dataLenght: "",
|
|
|
+ dataPrecision: "",
|
|
|
+ numberOfDigits: "",
|
|
|
+ defaultValue: "",
|
|
|
+ isRequired: "",
|
|
|
+ isSecrecy: "",
|
|
|
+ status: ""
|
|
|
};
|
|
|
row.tabDatasourceMsgs.push(newItem);
|
|
|
},
|
|
|
// 删除当前行
|
|
|
- deleteTableRow (row, index) {
|
|
|
+ deleteTableRow(row, index) {
|
|
|
row.tabDatasourceMsgs.splice(index, 1);
|
|
|
}
|
|
|
},
|
|
|
- created () { },
|
|
|
- mounted () { },
|
|
|
+ created() {},
|
|
|
+ mounted() {
|
|
|
+ // if (this.dialogTitle === "查看") {
|
|
|
+ // this.isDisabled = true;
|
|
|
+ // } else {
|
|
|
+ // this.isDisabled = false;
|
|
|
+ // }
|
|
|
+ // if (this.dialogTitle !== "新增") {
|
|
|
+ // this.getView(this.itemView.id);
|
|
|
+ // }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped></style>
|