From 42419e90c48eed03a6536130037ad9af74571d6d Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期二, 21 十一月 2023 15:27:10 +0800 Subject: [PATCH] 提交信息 --- package.json | 3 + src/components/SFtable/index.vue | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 1 deletions(-) diff --git a/package.json b/package.json index 455af61..973bf1a 100644 --- a/package.json +++ b/package.json @@ -38,9 +38,9 @@ "dependencies": { "@antv/x6": "^1.18.3", "@antv/x6-vue-shape": "^1.2.3", - "@vue/composition-api": "^1.0.0-rc.6", "@riophae/vue-treeselect": "0.4.0", "@vue/babel-plugin-jsx": "^1.1.5", + "@vue/composition-api": "^1.0.0-rc.6", "axios": "0.24.0", "clipboard": "2.0.8", "codemirror": "^5.65.13", @@ -52,6 +52,7 @@ "file-saver": "^2.0.5", "fuse.js": "6.4.3", "highlight.js": "9.18.5", + "insert-css": "^2.0.0", "jquery": "^3.7.0", "js-beautify": "1.13.0", "js-cookie": "3.0.1", diff --git a/src/components/SFtable/index.vue b/src/components/SFtable/index.vue new file mode 100644 index 0000000..4740111 --- /dev/null +++ b/src/components/SFtable/index.vue @@ -0,0 +1,99 @@ +<template> + <el-table + :data="currentList" + style="width: 1158px" + :header-cell-style="{ + background: '#f3f6fb', + color: '#666', + height: '42px', + 'font-weight': 400, + }" + :highlight-current-row="true" + empty-text="鏆傛棤鏁版嵁" + > + <el-table-column type="index" :index="indexMethod" label="搴忓彿" width="80"> + </el-table-column> + <el-table-column + v-for="(item, index) in tableLabel" + :key="index" + :prop="item.prop" + :width="item.width" + :label="item.label" + :formatter="formatData" + > + </el-table-column> + <el-table-column label="鎿嶄綔" width="100"> + <template slot-scope="scope"> + <el-button type="text" @click.native="$emit('details', scope.row)" + >鏌ョ湅璇︽儏</el-button + > + </template> + </el-table-column> + </el-table> + </template> + + <script> + import dayjs from "dayjs"; + export default { + data() { + return {}; + }, + props: { + currentList: { + type: Array, + required: true, + }, + tableLabel: { + type: Array, + default: () => [], + }, + currentIndex: { + type: Number, + required: true, + }, + }, + created() {}, + + methods: { + indexMethod(index) { + return parseInt(this.currentIndex) - 9 + index; + }, + // 鏁版嵁杩囨护 + formatData(row, column, cellValue) { + if (column.property === "createType") { + if (cellValue === 1) { + return "鑷姩"; + } + return "鎵嬪姩"; + } + if (column.property === "createTime") { + return dayjs(cellValue).format("YYYY.MM.DD HH:mm:ss"); + } + return cellValue; + }, + }, + }; + </script> + + <style lang="scss"> + .el-table td, + .el-table th.is-leaf { + border-bottom: unset; + } + .el-table td, + .el-table th { + padding: 5px 0; + } + .el-table thead { + font-weight: 400; + color: #666; + } + .dialog-footer { + width: 100%; + padding: 10px 20px 20px; + text-align: center !important; + -webkit-box-sizing: border-box; + box-sizing: border-box; + } + </style> + \ No newline at end of file -- Gitblit v1.9.3