Display row number in af:table

本文将指导您如何在使用Oracle ADF的RichTable组件时,为表格添加一行号列,包括操作步骤和所需属性的解释。

Environment (JDeveloper 11.1.1.5.0, ADF Faces)

In this post, I will explain how to add an extra leading column to display the row’s number. This example assumed that we have oracle.adf.RichTable in our page and we need to add extra column to hold the row’s number for each row. The steps to do this are:

  1. From the structure window, right click on your first column and choose Insert before af:columncolumn from the menu.
  2. Still in the structure window, right click the newly created column and choose Insert inside af:column Output Text from the menu.
  3. The oracle.adf.RichTable component has an attribute called varStatus.  The VarStatus provides contextual information about the state of the component to EL expressions. For components that iterate, varStatus also provides loop counter information. The common properties on varStatus include:
    • “model” – returns the CollectionModel for this component.
    • “index” – returns the zero based row index. we will use this property later.
  4. Still in the structure window, click on the table, and from the property inspector expand the column group and check the name of the EL variable used to reference the varStatus information(default value is vs) as shown below.

    Table's varStatus attribute

  5. Still in the structure window, click on the output text which was created on step 2, and from the property inspector set the value attribute to #{vs.index+1}.
  6. Your column source should be like this:
    <af:column id=”c5″>
    <af:outputText value=”#{vs.index+1}” id=”ot1″/>
    </af:column>
  7. Run your page, and you will see the row number for each row.
这是前端<template> <div class="historyData_page" style="display: flex; margin-bottom: 0px; width: 100%"> <div style="width: 100%"> <div class="content"> <label><strong>工序号</strong></label> <el-select placeholder="请选择工序号" v-model="processColumnParams.process_no" clearable style="width: 250px"> <el-option v-for="item in this.$store.state.commonProcessList" :key="item.process_no" :label="item.process_no + item.details" :value="item.process_no"> </el-option> </el-select> <label><strong>主条形码</strong></label> <el-input placeholder="请输入主条形码" v-model="selectParams.bar_no" clearable style="width: 300px"> </el-input> <label><strong>结果</strong></label> <el-select placeholder="请选择查询结果" v-model="selectParams.ok_flag" clearable style="width: 150px"> <el-option v-for="item in $t('histortData.flag_options')" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> <label><strong>选择时间范围</strong></label> <el-date-picker type="datetime" placeholder="选择开始时间" v-model="selectParams.startTime" default-time="12:00:00"> </el-date-picker> <el-date-picker type="datetime" placeholder="选择结束时间" v-model="selectParams.endTime" default-time="12:00:00"> </el-date-picker> <el-button style="margin: 0 0 0 10px" type="primary" icon="el-icon-search" @click="SearchTable">搜索</el-button> <el-button style="margin: 0 10px 0 10px" type="primary" icon="el-icon-refresh" @click="resetInput">重置</el-button> </div> <div style="margin: 5px 0 10px 10px"> <el-button type="primary" plain icon="el-icon-plus" @click="dialogFormVisible = true">{{ "新增" }} </el-button> <el-button type="danger" plain icon="el-icon-delete">{{ "删除" }} </el-button> <el-button type="warning" plain icon="el-icon-download" @click="handleDownload">{{ "导出" }} </el-button> </div> <div class="tab_Data"> <el-table :data="tableData.slice((currentPage - 1) * PageSize, currentPage * PageSize)" style="width: 100%" height="1115" border :cell-style="cellStyle" :header-cell-style="{ background: '#f5f7fa', color: '#000000', }" v-loading="loading" ref="tableRef" @selection-change="selectionLineChangeHandle" > <af-table-column type="selection"></af-table-column> <template v-for="(item, index) in processTableColumnName"> <af-table-column v-if="item.type == 'bar'" :key="index" :label="item.label" :prop="item.name" fixed> </af-table-column> <af-table-column v-else-if="item.type == 'img'" :key="index" :label="item.label" :prop="item.name"> <template slot-scope="scope"> <el-button type="text" @click="SearchProcessFile(scope.row.bar_no, processColumnParams.process_no, item.label, scope.row.do_time)"> {{ item.label }} </el-button> </template> </af-table-column> <af-table-column v-else-if="item.type == 'csv'" :key="index" :label="item.label" :prop="item.name"> <template slot-scope="scope"> <el-button type="text" @click="SearchCsvFile(scope.row.bar_no, processColumnParams.process_no, item.label, scope.row.do_time)"> {{ item.label }} </el-button> </template> </af-table-column> <af-table-column v-else :key="index" :prop="item.name" :label="item.label"> </af-table-column> </template> </el-table> <div class="tabListPage"> <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="pageSizes" :page-size="PageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalCount"> </el-pagination> </div> </div> </div> <!-- 照片弹框 --> <el-dialog :visible.sync="imageDialogVisible" width="40%"> <div> <span class="demonstration">{{ ProcessFile.name }}</span ><br /> <span class="demonstration">{{ ProcessFile.bar_no }}</span ><br /> <span class="demonstration">{{ image.picPath }}</span> </div> <div> <el-image :src="image.path" :preview-src-list="srcList"></el-image> </div> </el-dialog> <!-- csv弹框 --> <el-dialog :visible.sync="csvDialogVisible" width="60%"> <!-- <div> <el-button type="primary" icon="el-icon-download" @click="csvDownload">{{ 111 }}</el-button> </div> --> <div> <span class="demonstration">{{ csvFile.bar_no }}</span> </div> <div class="main" ref="chartDom" style="widows: 1200px; height: 400px"></div> </el-dialog> </div> </template> <script> import api from "@/api"; import { saveJsonToExcel } from "@/utils/xlsx"; export default { data() { return { processColumnParams: { process_no: "", eqpt_status: "1", }, routerValue: {}, selectParams: { process_no: "", bar_no: "", ok_flag: "All", startTime: "", endTime: "", }, image: { name: "", path: "", picPath: "", }, imageDialogVisible: false, csvDialogVisible: false, searchedImage: false, ProcessFile: { bar_no: "", process_no: "", name: "", lang: "zh", do_time: "" }, plcadress: "", interactionvalue: "", tableData: [], totalCount: 1, currentPage: 1, PageSize: 15, pageSizes: [5, 15, 30, 40], dialogFormVisible: false, modifyDialogFormVisible: false, formDialog: { Process_no: "", Details: "", }, labelPosition: "left", selectedRows: [], processTableColumnName: [], srcList: [], loading: true, // 查询csv文件参数 csvFile: { bar_no: "", process_no: "", name: "", lang: "", do_time: "" }, //曲线数据 csvChart: [], }; }, computed: { change() { this.selectParams = this.$route.params.value == null ? this.selectParams : this.$route.params.value; } }, watch: { change(val) { console.log(val) } }, created() { console.log(this.$route.params.value); console.log(this.selectParams); this.selectParams = this.$store.state.historyData; this.processColumnParams.process_no = this.selectParams.process_no; console.log("this.selectParams"); this.SearchTable(); }, methods: { setinfor() { //console.log(this.selectParams); this.$store.dispatch("historyData", this.selectParams); }, SearchTable() { // console.log(this.selectParams); this.loading = true; this.selectParams.process_no = this.processColumnParams.process_no; console.log(this.selectParams.process_no); if (this.processColumnParams.process_no == "") { this.$message.warning("请先选择要查询的工序号!"); } else if (this.processColumnParams.startTime == "") { this.$message.warning("请先选择要查询的起始时间!"); } else if (this.processColumnParams.endTime == "") { this.$message.warning("请先选择要查询的截止时间!"); } else { this.processTableColumnName = []; for (let index = 0; index < this.$t("histortData.processFixedTableColumnName").length; index++) { const element = this.$t("histortData.processFixedTableColumnName")[index]; this.processTableColumnName.push(element); } api.getProcessTableColumnName("/ProcessTableColumnName", this.processColumnParams).then((data) => { for (let index = 0; index < data.data.length; index++) { const element = data.data[index]; this.processTableColumnName.push(element); } console.log(data.data); }); api.getProcessProperties("/ProcessProperties", this.selectParams).then((data) => { console.log(data.data); this.loading = false; this.totalCount = data.data.length; this.tableData = data.data; console.log(data.data); this.setinfor(); //数据存储 }); } }, //获取工序图片 产品码、工序、图片名 SearchProcessFile(val, val2, val3, val4) { console.log(val, val2, val3, val4); this.ProcessFile.bar_no = val; this.ProcessFile.process_no = val2; this.ProcessFile.name = val3; this.ProcessFile.do_time = val4; this.ProcessFile.lang = "zh"; // 显示指定产品的指定图片 api.getProcessFileSingle("/ProcessFileSingle", this.ProcessFile).then((data) => { // 清空image数据 this.image = []; // 清空 this.srcList = []; this.imageDialogVisible = true; if (data.data[0].path == "") { this.searchedImage = false; } else { this.image = data.data[0]; for (let index = 0; index < data.data.length; index++) { const element = data.data[index].path; this.srcList.push(element); } this.searchedImage = true; } }); }, //获取csv SearchCsvFile(val, val2, val3, val4) { this.csvFile.bar_no = val; this.csvFile.process_no = val2; this.csvFile.name = val3; this.csvFile.do_time = val4; this.csvFile.lang = "zh"; // 获取最新图片 //this.csvColumnName = this.$t("PointInspectionResult.VibrationCsvColumnName"); api.getReadCurves("/ReadCurves", this.csvFile).then((data) => { //this.csvChart = data.data; this.csvDialogVisible = true; console.log(this.csvFile); console.log(data.data); this.initChart(data.data); }); }, initChart(data) { this.$nextTick(() => { this.csvChart = data; var chartDom = this.$refs.chartDom; // 检查 DOM 元素是否存在 if (!chartDom) { console.error("chartDom is not found"); return; } // 检查 DOM 元素的宽度和高度 console.log("chartDom width:", chartDom.offsetWidth, "height:", chartDom.offsetHeight); var myChart = this.$echarts.init(chartDom); var xAxis = []; var yAxis = []; this.csvChart.forEach((el) => { xAxis.push(el.x_Absolute); yAxis.push(el.y); }); yAxis = data.map((el) => parseFloat(el.y)); console.log("xAxis:", xAxis); console.log("yAxis:", yAxis); var option = { tooltip: { trigger: "axis", formatter: (params) => { const xValue = params[0].axisValue; const yValue = params[0].data; return `${xValue}:${yValue}`; }, axisPointer: { type: "cross", label: { backgroundColor: "#6a7985", }, }, }, xAxis: { type: "category", data: xAxis, name: "单位(s)", axisLabel: { show: true, showMaxLabel: true, showMinLabel: true, }, }, yAxis: { type: "value", name: "单位(N)", //max: 2, }, series: [ { data: yAxis, type: "line", }, ], }; myChart.setOption(option); }); }, selectionLineChangeHandle(val) { // console.log(this.selectedRows); this.selectedRows = val; }, resetInput() { (this.fieldname = ""), (this.plcadress = ""), (this.interactionvalue = ""); }, modifyData(val) { this.modifyDialogFormVisible = true; }, cellStyle({ row, column, rowIndex, columnIndex }) { // NG字样红色显示 // for (let index = 0; index < this.$t("ShowResult.tableColumnName").length; index++) { // const element = this.$t("ShowResult.tableColumnName")[index].name; // if (row[element] == "NG" && column.property == element) { // return "color:red"; // } // } // 数据超限红色显示 // for (let i = 0; i < this.ParamatesLimit.length; i++) { // const element = this.ParamatesLimit[i].name; // if ((Number(this.ParamatesLimit[i].up_limit) < Number(row[element]) || Number(row[element]) < Number(this.ParamatesLimit[i].down_limit)) && column.property == element) { // return "color:red"; // } // } for (let index = 0; index < this.processTableColumnName.length; index++) { const element = this.processTableColumnName[index].name; if (row[element] == "NG" && column.property == element) { return "color:red"; } } }, // 导出数据 handleDownload() { var tabHandle = []; //导出表头 for (let index = 0; index < this.processTableColumnName.length; index++) { const element = this.processTableColumnName[index]; if (element.type != "img" && element.type != "csv") { tabHandle.push(element.label); } } saveJsonToExcel(this.tableData, tabHandle, "OP" + this.processColumnParams.process_no + ".xlsx"); }, // 每页显示的条数 handleSizeChange(val) { // 改变每页显示的条数 this.PageSize = val; // 注意:在改变每页显示的条数时,要将页码显示到第一页 this.currentPage = 1; }, // 显示第几页 handleCurrentChange(val) { // 改变默认的页数 this.currentPage = val; }, }, updated() { // tableRef是表格的ref属性值 if (this.$refs.tableRef && this.$refs.tableRef.doLayout) { this.$refs.tableRef.doLayout(); } }, }; </script> <style scoped lang="less"> .el-menu { width: 200px; } .tab_Data { // width: 100%; /* margin-top: 30px; margin-left: 10px; margin-right: 10px; */ } .content { // justify-content: flex-start; // display: flex; } </style> 这是后端using SanHuaMesApiServer.Models; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.VisualBasic.FileIO; using System.Data; using System.Globalization; using System.Text; using SanHuaMesApiServer.Helps; namespace SanHuaMesApiServer.Controllers { [Route("api/[controller]")] [ApiController] public class ProcessCheckColumnNameController : ControllerBase { [HttpGet] public async Task<IEnumerable<ProcessTableColumnName>> Get([FromQuery] string process_no,string inspection_type,string eqpt_status,string? file_type) { return await Task.Factory.StartNew(() => { StringBuilder sb = new StringBuilder(); sb.Append($"select field_name,field_name_cn from SHProcessInspectionPropertyParse where process_no = '{process_no}' and inspection_type = '{inspection_type}' ORDER BY field_name "); DataSet data = SqlHelper.GetTable(CommandType.Text, sb.ToString(), null); StringBuilder sbImag = new StringBuilder(); sbImag.Append($"select name,name_en from GTProcessFileConfig where process_no = '{process_no}' and eqpt_status = '{eqpt_status}' and file_type = '{file_type}'"); DataSet dataImag = SqlHelper.GetTable(CommandType.Text, sbImag.ToString(), null); List<ProcessTableColumnName> temp = new List<ProcessTableColumnName>(); foreach (DataRow row in dataImag.Tables[0].Rows) { temp.Add(new ProcessTableColumnName() { Name = row[1].ToString(), Label = row[0].ToString(), Type = file_type, }); ; ; } foreach (DataRow row in data.Tables[0].Rows) { temp.Add(new ProcessTableColumnName() { Name = row[0].ToString(), Label = row[1].ToString(), Type = "", }); ; ; } return temp.AsEnumerable(); }); } } [Route("api/[controller]")] [ApiController] public class ProcessCheckColumnNameEnController : ControllerBase { [HttpGet] public async Task<IEnumerable<ProcessTableColumnName>> Get([FromQuery] string process_no, string inspection_type, string eqpt_status, string? file_type) { return await Task.Factory.StartNew(() => { StringBuilder sb = new StringBuilder(); sb.Append($"select field_name,field_name_en from SHProcessInspectionPropertyParse where process_no = '{process_no}' and inspection_type = '{inspection_type}' "); DataSet data = SqlHelper.GetTable(CommandType.Text, sb.ToString(), null); StringBuilder sbImag = new StringBuilder(); sbImag.Append($"select name,name_en,file_type from GTProcessFileConfig where process_no = '{process_no}' and eqpt_status = '{eqpt_status}' and file_type = '{file_type}'"); DataSet dataImag = SqlHelper.GetTable(CommandType.Text, sbImag.ToString(), null); List<ProcessTableColumnName> temp = new List<ProcessTableColumnName>(); foreach (DataRow row in dataImag.Tables[0].Rows) { temp.Add(new ProcessTableColumnName() { Name = row[1].ToString(), Label = row[1].ToString(), Type = row[2].ToString(), }); ; ; } foreach (DataRow row in data.Tables[0].Rows) { temp.Add(new ProcessTableColumnName() { Name = row[0].ToString(), Label = row[1].ToString(), Type = "", }); ; ; } return temp.AsEnumerable(); }); } } }报错这个index.js:116 GET https://127.0.0.1:7053/api/ProcessProperties?process_no=20&bar_no=&ok_flag= 400 (Bad Request) settle.js:19 Uncaught (in promise) AxiosError {message: 'Request failed with status code 400', name: 'AxiosError', code: 'ERR_BAD_REQUEST', config: {…}, request: XMLHttpRequest, …} code : "ERR_BAD_REQUEST" config : {transitional: {…}, adapter: Array(3), transformRequest: Array(1), transformResponse: Array(1), timeout: 10000, …} message : "Request failed with status code 400" name : "AxiosError" request : XMLHttpRequest {onreadystatechange: null, readyState: 4, timeout: 10000, withCredentials: false, upload: XMLHttpRequestUpload, …} response : {data: {…}, status: 400, statusText: '', headers: AxiosHeaders, config: {…}, …} status : 400 stack : "AxiosError: Request failed with status code 400\n at settle (webpack-internal:///./node_modules/axios/lib/core/settle.js:24:12)\n at XMLHttpRequest.onloadend (webpack-internal:///./node_modules/axios/lib/adapters/xhr.js:63:66)\n at Axios.request (webpack-internal:///./node_modules/axios/lib/core/Axios.js:54:41)" [[Prototype]] : Error XMLHttpRequest.send getProcessProperties @ index.js:116 SearchTable @ historyData.vue:197
05-30
<template> <!-- 表格容器,根据 dialogTable 的值动态添加 'dialog-table' 类名 --> <div :class="{'dialog-table': dialogTable}" class="table-box"> <!-- Element UI 表格组件 --> <!-- ref: 为表格组件添加引用,方便后续操作 --> <!-- border: 是否显示表格边框 --> <!-- data: 表格展示的数据 --> <!-- header-cell-style: 设置表格表头的背景颜色 --> <!-- height: 设置表格的高度 --> <!-- highlight-current-row: 是否高亮当前选中行 --> <!-- row-class-name: 自定义行的类名 --> <!-- row-style: 设置行的样式,此处设置行高为 24px --> <!-- stripe: 是否显示斑马纹 --> <!-- style: 设置表格的宽度和边框颜色 --> <!-- @selection-change: 当表格的选中项发生变化时触发的事件 --> <div class="table-container"> <el-table ref="table" v-loading="loading" :border="border" :data="tableData" :header-cell-style="{ background: headerBgColor }" :height="tableHeight" :highlight-current-row="highlightCurrentRow" :row-class-name="rowClassName" :row-style="{ height: '24px' }" :stripe="stripe" :style="{ width: '100%', borderColor: tableBorderColor }" @selection-change="handleSelectionChange" @row-dblclick="handleRowClick" @row-click="handleRowClickSelect" > <!-- 多选列 --> <!-- v-if: 当 multipleSelection 为 true 时显示多选列 --> <!-- selectable: 当开启单选模式时,使用 checkSelectable 方法判断行是否可选 --> <!-- type: 列的类型,设置为 'selection' 表示多选列 --> <!-- width: 列的宽度 --> <el-table-column v-if="multipleSelection" :selectable="singleSelect ? checkSelectable : undefined" type="selection" width="40" ></el-table-column> <!-- 序号列 --> <!-- v-if: 当 showIndex 为 true 时显示序号列 --> <!-- align: 列内容的对齐方式,设置为居中对齐 --> <!-- label: 列的表头名称 --> <!-- width: 列的宽度 --> <el-table-column v-if="showIndex" align="center" label="序号" width="60" > <!-- 序号列的内容模板 --> <!-- 计算并显示当前行的序号,考虑分页因素 --> <template #default="scope"> {{ (currentPage - 1) * pageSize + scope.$index + 1 }} </template> </el-table-column> <!-- 动态列 --> <!-- v-for: 遍历 columns 数组,动态生成列 --> <!-- key: 为每个列设置唯一的 key 值 --> <!-- formatter: 列的格式化函数 --> <!-- label: 列的表头名称 --> <!-- min-width: 列的最小宽度 --> <!-- prop: 列对应的数据字段 --> <!-- width: 列的宽度 --> <!-- show-overflow-tooltip: 是否在内容溢出时显示 tooltip --> <el-table-column v-for="column in columns" :key="column.prop" :formatter="column.formatter" :label="column.label" :min-width="column.minWidth || '80'" :prop="column.prop" :width="column.width" v-if="!isColumnHidden(column)" :show-overflow-tooltip="true" :fixed="column.fixed" > <!-- 动态列的内容模板 --> <template #default="scope"> <!-- Element UI 提示框组件 --> <!-- disabled: 是否禁用提示框 --> <!-- effect: 提示框的样式效果 --> <!-- placement: 提示框的位置 --> <el-tooltip :disabled="!isTextOverflow(scope.row[column.prop], column.className)" :effect="effect" style="max-width: 600px" :placement="placement" > <!-- 提示框的内容模板 --> <template #content> <div style="max-width: 600px; word-break: break-all">{{ scope.row[column.prop] }}</div> </template> <!-- 显示单元格内容的容器 --> <!-- class: 根据 column.preview 的值动态添加 'text-ellipsis' 类名 --> <!-- style: 设置文本颜色和鼠标指针样式 --> <!-- @click: 单元格点击事件 --> <div :class="{'text-ellipsis': typeof column.preview === 'function' ? column.preview(scope.row) : column.preview}" :style="{ color: getTextColor(scope.row, column), cursor: (typeof column.clickable === 'function' ? column.clickable(scope.row) : column.clickable) ? 'pointer' : 'default' // 新增样式 }" class="preview-text" @click="handleCellClick(column, scope.row)" > <!-- 显示单元格内容 --> <!-- v-html: 根据 column.formatter 的值动态显示内容 --> <div :class="column.className" v-html="column.formatter ? column.formatter(scope.row, column, scope.row[column.prop]) : scope.row[column.prop]" v-if="!column.isInlineViewing"></div> <!-- 内联查看图标 --> <!-- v-if: 当 column.isInlineViewing 为 true 时显示图标 --> <div v-if="column.isInlineViewing"> <el-button type="text" @click="handleAction(column.icon, scope.row)"> <!-- 操作按钮的内容 --> <div class="action-item"> <!-- 操作按钮的图标 --> <svg-icon :icon-class="column.icon"/> <!-- 操作按钮的文本 --> <div class="action-text" v-html="column.formatter ? column.formatter(scope.row, column, scope.row[column.prop]) : scope.row[column.prop]"></div> <!-- <span class="action-text">{{ scope.row[column.prop] }}</span>--> </div> </el-button> </div> <!-- 新增预览图标 --> <!-- v-if: 根据 column.preview 的值判断是否显示图标 --> <svg-icon v-if="typeof column.preview === 'function' ? column.preview(scope.row) : column.preview" class="preview-icon" icon-class="primary" /> </div> </el-tooltip> </template> </el-table-column> <!-- 操作列 --> <!-- v-if: 当 showActionColumn 为 true 时显示操作列 --> <!-- label: 操作列的表头名称 --> <!-- width: 操作列的宽度 :width="actionColumnWidth"--> <!-- fixed: 操作列固定在右侧 --> <el-table-column v-if="showActionColumn" :label="operation" :min-width="calculateActionColumnWidth()" fixed="right" > <!-- 操作列的内容模板 --> <template #default="scope"> <!-- 操作按钮容器 --> <div class="operation"> <!-- 遍历操作按钮数组,动态生成按钮 --> <!-- v-for: 遍历操作按钮数组 --> <!-- key: 为每个按钮设置唯一的 key 值 --> <!-- size: 按钮的大小 --> <!-- type: 按钮的类型 --> <!-- @click: 按钮点击事件 --> <el-button v-for="button in (scope.row.actionButtons || actionButtons)" :key="button.name" size="small" type="text" :loading="typeof button.loading === 'function' ? button.loading(scope.row) : button.loading" v-if="!button.hasPermission || $auth.hasPermi(button.hasPermission)" :disabled="button.disabled ? (typeof button.disabled === 'function' ? button.disabled(scope.row) : button.disabled) : false" @click.stop="handleAction(button.name, scope.row)" > <!-- 操作按钮的内容 --> <span class="action-item"> <!-- 操作按钮的图标 --> <svg-icon :icon-class="button.icon || button.name" class="action-icon" :class="{'disabled-text': button.disabled? (typeof button.disabled === 'function' ? button.disabled(scope.row) : button.disabled) : false}" /> <!-- 操作按钮的文本 --> <span class="action-text" :class="{'disabled-text': button.disabled? (typeof button.disabled === 'function' ? button.disabled(scope.row) : button.disabled) : false}">{{ button.label }}</span> </span> </el-button> </div> </template> </el-table-column> </el-table> </div> <!-- 分页组件容器 --> <div class="pagination-wrapper" v-if="paginationFlag"> <!-- Element UI 分页组件 --> <!-- background: 是否显示分页按钮的背景 --> <!-- current-page: 当前页码 --> <!-- layout: 分页组件的布局 --> <!-- page-size: 每页显示的记录数 --> <!-- page-sizes: 每页显示记录数的可选值 --> <!-- total: 总记录数 --> <!-- @size-change: 每页显示记录数变化时触发的事件 --> <!-- @current-change: 当前页码变化时触发的事件 --> <el-pagination :background="background" :current-page="currentPage" :layout="layout" :page-size="pageSize" :page-sizes="pageSizes" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> </div> </div> </template> <script> /** * ElementTableWrapper 组件 * 封装了 Element UI 的表格组件,提供了多选、序号、动态列、操作列和分页等功能 */ export default { name: 'ElementTableWrapper', props: { // 表格数据 tableData: { type: Array, default: () => [] }, // 列配置 columns: { type: Array, default: () => [] }, // 列配置 operation: { type: String, default: '操作' }, // 是否开启多选功能 multipleSelection: { type: Boolean, default: false }, // 是否显示操作列 showActionColumn: { type: Boolean, default: true }, // 是否显示边框 border: { type: Boolean, default: true }, // 是否显示斑马纹 stripe: { type: Boolean, default: false }, // 是否高亮当前行 highlightCurrentRow: { type: Boolean, default: false }, // 是否高亮当前行 dialogTable: { type: Boolean, default: false }, // 是否显示分页功能 paginationFlag: { type: Boolean, default: true }, // 行样式类名回调函数 rowClassName: { type: Function, default: () => '' }, // 操作按钮配置 actionButtons: { type: Array, default: () => [ {name: 'add', label: '新增', icon: 'add'}, {name: 'edit', label: '编辑', icon: 'edit'}, {name: 'delete', label: '删除', icon: 'delete'} ] }, // 表格头背景颜色 headerBgColor: { type: String, default: '#F9FAFB' }, // 表格边框颜色 tableBorderColor: { type: String, default: 'rgb(234, 236, 240)' }, // 新增单选控制props singleSelect: { // 启用单选模式 type: Boolean, default: false }, // 默认选中首行 defaultSelect: { type: Boolean, default: false }, // 新增分页相关props currentPage: { type: Number, default: 1 }, // 每页显示的记录数 pageSize: { type: Number, default: 10 }, // 总记录数 total: { type: Number, default: 0 }, // 每页显示记录数的可选值 pageSizes: { type: Array, default: () => [10, 20, 50, 100] }, // 分页组件的布局 layout: { type: String, default: 'total, sizes, prev, pager, next, jumper' }, // 是否显示分页按钮的背景 background: { type: Boolean, default: true }, // 表格高度 tableHeight: { type: [String, Number], default: '100%' // 默认100%高度 }, // 是否显示序号列 showIndex: { type: Boolean, default: true }, // 是否启用行点击事件 rowClickEnable: { type: Boolean, default: false }, // 行点击事件处理器 rowClickHandler: { type: Function, default: null }, // 提示框的样式效果 effect: { type: String, default: 'dark' }, // 提示框的位置 placement: { type: String, default: 'top' }, enableRowClickSelect: { type: Boolean, default: false }, // 新增 loading 属性 loading: { type: Boolean, default: false } }, data() { return { currentSelection: null, // 当前选中行 crossPageSelection: [], // 跨页选择的数据 } }, watch: { /** * 监听表格数据变化 * 当表格数据变化且 defaultSelect 为 true 时,默认选中第一行 * @param {Array} newVal - 新的表格数据 */ tableData(newVal) { if (this.defaultSelect && newVal.length > 0) { this.$nextTick(() => { // 切换第一行的选中状态为选中 this.$refs.table.toggleRowSelection(newVal[0], true) }) } }, }, mounted() { this.$emit('rendered'); // 触发 rendered 事件 }, methods: { /** * 处理操作按钮点击事件 * 触发与按钮名称对应的自定义事件,并传递当前行数据 * @param {string} actionName - 操作按钮的名称 * @param {Object} row - 当前行的数据 */ handleAction(actionName, row) { this.$emit(actionName, row); }, // 处理行点击事件 handleRowClick(row) { if (this.rowClickEnable) { // 触发自定义行点击事件 this.$emit('row-click', row); // 如果有自定义处理函数则执行 if (this.rowClickHandler) { this.rowClickHandler(row); } } }, /** * 获取文本颜色 * 根据列的文本颜色规则,判断是否需要修改文本颜色 * @param {Object} row - 当前行的数据 * @param {Object} column - 当前列的配置 * @returns {string} - 文本颜色 */ getTextColor(row, column) { // 将参数名从prop改为column if (column.textColorRule) { const {condition, color} = column.textColorRule; if (condition(row)) { // 新增:如果 color 是函数则调用并传入当前行数据,否则直接使用字符串 return typeof color === 'function' ? color(row) : color; } } return 'rgb(38, 38, 38)'; }, /** * 处理单元格点击事件 * 当单元格可点击时,触发 'cell-click' 自定义事件 * @param {Object} column - 当前列的配置 * @param {Object} row - 当前行的数据 */ handleCellClick(column, row) { if (typeof column.clickable === 'function' ? column.clickable(row) : column.clickable) { this.$emit('cell-click', { column, row, prop: column.prop }) } }, /** * 判断文本是否溢出 * 通过比较元素的滚动宽度和客户端宽度来判断文本是否溢出 * @param {string} text - 文本内容 * @param className * @returns {boolean} - 文本是否溢出 */ isTextOverflow(text, className) { if (!text || !className) return false; // 创建测量容器 const container = document.createElement('div'); container.className = className; container.style.cssText = ` position: absolute; visibility: hidden; white-space: nowrap; font-size: 14px; padding: 0 8px; max-width: 100%; `; // 创建文本测量元素 const textSpan = document.createElement('div'); textSpan.textContent = text; // 测量逻辑 document.body.appendChild(container); container.appendChild(textSpan); const containerWidth = container.offsetWidth; const textWidth = textSpan.offsetWidth; document.body.removeChild(container); // 双重判断:文本超过容器宽度且在表格最大宽度范围内 return textWidth > containerWidth; }, /** * 处理每页显示记录数变化事件 * 触发 'update:pageSize' 和 'pagination-change' 自定义事件 * @param {number} val - 新的每页显示记录数 */ handleSizeChange(val) { this.$emit('update:pageSize', val); this.$emit('pagination-change', { page: this.currentPage, size: val }); // 新增:滚动到表格顶部 this.$nextTick(() => { const tableWrapper = this.$refs.table.$el.querySelector('.el-table__body-wrapper'); if (tableWrapper) { tableWrapper.scrollTop = 0; } }); }, // 暴露给父组件的方法 toggleRowSelection(row, selected) { this.$refs.table.toggleRowSelection(row, selected) }, /** * 处理表格选中项变化事件 * 当开启单选模式时,确保只选中一行 * @param {Array} selection - 当前选中的行数据数组 */ handleSelectionChange(selection) { if (this.singleSelect) { if (selection.length > 1) { const last = selection[selection.length - 1] // 清空所有选中项 this.$refs.table.clearSelection() // 切换最后一项的选中状态为选中 this.$refs.table.toggleRowSelection(last) this.currentSelection = last } else { this.currentSelection = selection[0] || null } } // 触发 'selection-change' 自定义事件,传递跨页选择的数据 this.$emit('selection-change', selection) }, /** * 计算操作列的宽度 * 根据操作按钮的数量和每个按钮的大致宽度计算操作列的宽度 * @returns {number} - 操作列的宽度 */ calculateActionColumnWidth() { const getButtonWidth = (text) => { if (text.length >= 4) return 80; else if (text.length >= 2) return 60; return 40; }; // 权限判断方法(与模板中的v-if逻辑保持一致) const hasPermission = (button) => { return !button.hasPermission || this.$auth.hasPermi(button.hasPermission); }; const maxButtonCountRow = this.tableData.reduce((prev, current) => { // 过滤无权限按钮后比较 const prevValid = (prev.actionButtons || this.actionButtons).filter(hasPermission); const currentValid = (current.actionButtons || this.actionButtons).filter(hasPermission); return prevValid.length > currentValid.length ? prev : current; }, {}); // 过滤有效按钮 const validButtons = (maxButtonCountRow.actionButtons || this.actionButtons).filter(hasPermission); return validButtons.reduce((sum, button) => { return sum + getButtonWidth(button.label); }, 0); // 增加安全边距 }, /** * 检查行是否可选 * 当开启单选模式时,判断行是否可以被选中 * @param {Object} row - 当前行的数据 * @param {number} index - 当前行的索引(未使用) * @returns {boolean} - 行是否可选 */ checkSelectable(row, index) { return !this.currentSelection || row === this.currentSelection }, /** * 处理当前页码变化事件 * 触发 'update:currentPage' 和 'pagination-change' 自定义事件 * @param {number} val - 新的当前页码 */ handleCurrentChange(val) { this.$emit('update:currentPage', val); this.$emit('pagination-change', { page: val, size: this.pageSize }); // 新增:滚动到表格顶部 this.$nextTick(() => { const tableWrapper = this.$refs.table.$el.querySelector('.el-table__body-wrapper'); if (tableWrapper) { tableWrapper.scrollTop = 0; } }); }, // 新增列隐藏判断方法 isColumnHidden(column) { if (typeof column.hidden === 'function') { return column.hidden(this.$parent) // 传入父组件上下文 } return !!column.hidden }, /** * 处理行点击选中事件 * 当 enableRowClickSelect 为 true 时,选中点击的行 * @param {Object} row - 当前点击行的数据 */ handleRowClickSelect(row) { if (this.enableRowClickSelect) { if (this.singleSelect) { // 单选模式,清空其他选中项,选中当前行 this.$refs.table.clearSelection(); this.$refs.table.toggleRowSelection(row, true); } else { // 多选模式,切换当前行的选中状态 this.$refs.table.toggleRowSelection(row); } this.$emit('selection-change', this.$refs.table.selection); } } } }; </script> <style lang="scss" scoped> .table-box { display: flex; flex-direction: column; flex: 1; overflow: hidden; } .table-container { flex: 1; overflow: auto; ::v-deep .el-table { .el-table__body-wrapper { overflow: auto; height: calc(100% - 44px) !important; } } } /** * 对话框中的表格样式 * 设置表格高度为 100% */ .dialog-table { height: 100%; } /** * 分页组件容器样式 * 绝对定位到底部右侧,宽度为表格宽度减去 33px,文本右对齐 */ .pagination-wrapper { position: relative; text-align: right; margin-bottom: 10px; margin-top: 15px; } /** * 表格容器样式 * 确保表格容器有相对定位,设置最小高度 */ div:first-child { position: relative; min-height: 30px; /* 可根据需要调整最小高度 */ } /** * 分页按钮样式 * 设置分页按钮的边框、圆角、内边距和鼠标悬停样式 */ ::v-deep .el-pagination.is-background { .btn-prev, .btn-next { border: 1px solid #DCDFE6; border-radius: 4px; padding: 0 8px; margin: 0 5px; &:hover { color: #409EFF; border-color: #409EFF; } } } /** * 表格基础样式 * 设置表格字体大小,处理文本换行和溢出情况,设置预览图标样式 */ ::v-deep .el-table { font-size: 14px; /** * 允许换行的列样式 * 允许文本换行,调整行高 */ .wrap-text-column { white-space: normal !important; /* 允许换行 */ word-break: break-all; /* 允许单词内换行 */ line-height: 1.5; /* 调整行高 */ } /** * 鼠标悬停在表格行上时的样式 * 显示预览图标 */ tr:hover { .preview-icon { display: inline-block !important; } } .cell-content { .content-wrapper { .el-icon-loading { display: inline-block !important; position: absolute; right: 8px; top: 25%; color: #1D9C9D; } } } /** * 非换行列的样式 * 文本不换行,溢出部分显示省略号 */ :not(.wrap-text-column) { .cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } } /** * 文本省略样式 * 文本不换行,溢出部分显示省略号,为图标留出空间 */ .text-ellipsis { position: relative; padding-right: 24px; // 为图标留出空间 display: inline-block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /** * 预览图标样式 * 默认隐藏,鼠标悬停在表格行上时显示 */ .preview-icon { display: none; position: absolute; right: 8px; top: 25%; cursor: pointer; color: #1D9C9D; } /** * 预览文本样式 * 文本不换行,溢出部分显示省略号,垂直居中 */ .preview-text { display: inline-block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; line-height: 2; /** * 标签列样式 * 允许标签换行,设置标签样式 */ .tags-column { white-space: normal !important; line-height: 1.5; /** * 标签项样式 * 设置标签的边框、圆角、颜色和背景颜色 */ .tag-item { display: inline-block; padding: 2px 8px; margin: 2px; border: 1px solid rgba(255, 105, 41, 0.5); border-radius: 4px; color: #FF6929; background-color: transparent; font-size: 12px; word-break: keep-all; /* 防止单个标签换行 */ } } } /** * 表格表头和单元格样式 * 调整内边距,设置文本不换行,不隐藏溢出内容,不显示省略号 */ th, td { padding: 2px 0; .cell { white-space: nowrap; overflow: visible; text-overflow: ellipsis; line-height: 1; } } td.el-table__cell div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } } /** * 操作项样式 * 设置操作按钮和操作项的布局为水平居中对齐 */ .operation, .action-item { display: flex; white-space: nowrap; /* 防止操作按钮换行 */ align-items: center; } /** * 文本省略样式 * 文本不换行,溢出部分显示省略号 */ .text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .action-item { cursor: pointer; margin-right: 8px; &:last-child { margin-right: 0; } .action-text { margin-left: 4px; font-size: 12px; color: rgb(31, 198, 234); } .action-icon { width: 1em; height: 1em; color: #1FC6EA; transition: color 0.2s; &:hover { color: #1FC6EA; } } .disabled-text { color: #999; } } ::v-deep .el-button--text { padding: 2px 0; } .action-item { display: inline-flex; align-items: center; cursor: pointer; margin-right: 8px; &:last-child { margin-right: 0; } } .action-text { margin-left: 4px; font-size: 12px; color: #606266; } .action-icon { width: 1em; height: 1em; cursor: pointer; color: #606266; transition: color 0.2s; } .action-icon:hover { color: #1FC6EA; } /* 添加表格字体大小设置 */ ::v-deep .el-table { font-size: 14px; /* 可调整字体大小 */ } ::v-deep .el-table th, ::v-deep .el-table td { padding: 10px 0; /* 调整单元格内边距 */ } /* 表格内容单行显示 */ ::v-deep .el-table .cell { white-space: nowrap; /* 不换行 */ overflow: visible; /* 不隐藏溢出内容 */ text-overflow: ellipsis; /* 不显示省略号 */ line-height: 1; /* 行高 */ } </style> 数据内容{ "total": 77251, "rows": [ { "id": "3109226059753587717", "stationId": "10042", "stationName": "盘城变", "voltageLevel": "220kV", "voltageLevelCode": "33", "bayId": "10006395", "bayName": "2号主变", "areaId": "206", "areaName": "220北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "2号主变110kV侧中性点成套装置", "equipNo": "10MZ0108517959259", "equipModel": "SR-JXB-110", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户外式", "useEnvironmentCode": "2", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "江苏省如高高压电器有限公司", "startTime": "2022-09-30", "manufactureDate": "2021-05-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587718", "stationId": "10089", "stationName": "万寿变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "10004149", "bayName": "1号主变", "areaId": "213", "areaName": "城北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "1号主变中性点成套装置", "equipNo": "10MZ0108518228845", "equipModel": "CG-IXB-110/1600", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户外式", "useEnvironmentCode": "2", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "湖南长高高压开关有限公司", "startTime": "2023-01-01", "manufactureDate": "2021-11-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587719", "stationId": "64386cb90e3c11ee90179e25b59ef9e0", "stationName": "绿洲变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "64d4ac720e3c11ee90179e25b59ef9e0", "bayName": "1号主变", "areaId": "210", "areaName": "城南", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "1号主变中性点成套装置", "equipNo": "10MZ0108519189286", "equipModel": "XK-ZJB-110", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "西安西电高压开关有限责任公司", "startTime": "2023-06-26", "manufactureDate": "2023-05-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587720", "stationId": "64386cb90e3c11ee90179e25b59ef9e0", "stationName": "绿洲变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "64d4ac7c0e3c11ee90179e25b59ef9e0", "bayName": "2号主变", "areaId": "210", "areaName": "城南", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "2号主变中性点成套装置", "equipNo": "10MZ0108519190392", "equipModel": "XK-ZJB-110", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "西安西电高压开关有限责任公司", "startTime": "2023-06-26", "manufactureDate": "2023-05-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587721", "stationId": "10000002", "stationName": "徐庄变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "128246796", "bayName": "2号主变", "areaId": "213", "areaName": "城北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "2号主变中性点成套装置", "equipNo": "10MZ0108519046377", "equipModel": "GW13-72.5(W)", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "江苏如皋高压电器有限公司", "startTime": "2011-03-11", "manufactureDate": "2011-01-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587722", "stationId": "10000002", "stationName": "徐庄变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "10014690", "bayName": "1号主变", "areaId": "213", "areaName": "城北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "1号主变中性点成套装置", "equipNo": "10MZ0108519046388", "equipModel": "GW13-72.5(W)", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "江苏如皋高压电器有限公司", "startTime": "2011-03-11", "manufactureDate": "2011-01-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587723", "stationId": "a13ce0756f8a06deed5382a7950153a13cbdc630ab", "stationName": "诚实变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "c2b10909-afe1-47fa-af68-c268247d1a7d", "bayName": "2号主变", "areaId": "213", "areaName": "城北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "2号主变中性点成套装置", "equipNo": "10MZ0108521242648", "equipModel": "GW13-126W/1600", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "常州思源东芝变压器有限公司", "startTime": "2024-09-06", "manufactureDate": "2024-01-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587724", "stationId": "19b7e87c-70b3-4736-9126-066604cfe72f", "stationName": "小村变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "d22b61f9-4a32-4da2-b2d8-c10a447d1f51", "bayName": "2号主变", "areaId": "210", "areaName": "城南", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "2号主变中性点成套装置", "equipNo": "10MZ0108521256500", "equipModel": "ZJKK-320-15", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "江苏如高高压电器有限公司", "startTime": "2024-09-23", "manufactureDate": "2024-02-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587725", "stationId": "19b7e87c-70b3-4736-9126-066604cfe72f", "stationName": "小村变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "6acbf7ba-0563-4500-92af-07f80a9f0137", "bayName": "1号主变", "areaId": "210", "areaName": "城南", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "1号主变中性点成套装置", "equipNo": "10MZ0108521256499", "equipModel": "ZJKK-320-15", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "江苏如高高压电器有限公司", "startTime": "2024-09-23", "manufactureDate": "2024-02-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587726", "stationId": "10055", "stationName": "珠江路变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "4fcb2a97-9e97-4382-ad72-76fa14a0a900", "bayName": "3号主变", "areaId": "213", "areaName": "城北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "3号主变中性点成套装置", "equipNo": "10MZ0108521889218", "equipModel": "SR-JXB-110", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "3号主变中性点成套装置", "useEnvironment": "户外式", "useEnvironmentCode": "2", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "KH250066", "produceOrgId": "", "produceOrg": "江苏如高高压电气有限公司", "startTime": "2025-04-01", "manufactureDate": "2025-03-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587727", "stationId": "10054", "stationName": "云南路变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "10001660", "bayName": "1号主变", "areaId": "213", "areaName": "城北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "1号主变中性点成套装置", "equipNo": "10MZ0108521404169", "equipModel": "XK-ZJB-110", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "2801240138", "produceOrgId": "", "produceOrg": "西安西电高压开关有限责任公司", "startTime": "2024-10-23", "manufactureDate": "2024-08-30", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587728", "stationId": "0f1da7c8-e937-47a9-ae19-485c64ed19bd", "stationName": "骆家变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "09cf5ce2-3384-4b4c-920d-d782477a447f", "bayName": "2号主变", "areaId": "213", "areaName": "城北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "2号主变中性点成套装置", "equipNo": "10MZ0108521505000", "equipModel": "SR-JXB-110", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "江苏省如皋高压电器有限公司", "startTime": "2024-12-20", "manufactureDate": "2023-10-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587729", "stationId": "0f1da7c8-e937-47a9-ae19-485c64ed19bd", "stationName": "骆家变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "6ab30fc2-7c0f-4c53-8ee1-0e5b5745ec71", "bayName": "1号主变", "areaId": "213", "areaName": "城北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "1号主变中性点成套装置", "equipNo": "10MZ0108521504999", "equipModel": "SR-JXB-110", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "江苏省如皋高压电器有限公司", "startTime": "2024-12-20", "manufactureDate": "2023-10-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587730", "stationId": "10054", "stationName": "云南路变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "10001661", "bayName": "2号主变", "areaId": "213", "areaName": "城北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "2号主变中性点成套装置", "equipNo": "10MZ0108521500656", "equipModel": "XK-ZJB-110", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "60613", "produceOrgId": "", "produceOrg": "西安西电高压开关有限公司", "startTime": "2024-12-19", "manufactureDate": "2006-06-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587731", "stationId": "10100", "stationName": "上新河变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "10005161", "bayName": "2号主变", "areaId": "210", "areaName": "城南", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "2号主变中性点成套装置", "equipNo": "10MZ0108522469177", "equipModel": "SR-JXB-110", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户外式", "useEnvironmentCode": "2", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "KH250036828", "produceOrgId": "", "produceOrg": "江苏如高高压电器有限公司", "startTime": "2025-05-07", "manufactureDate": "2025-03-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587732", "stationId": "10055", "stationName": "珠江路变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "8bbba0e3-8214-4833-80c2-4fbb37cedd47", "bayName": "2号主变", "areaId": "213", "areaName": "城北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "2号主变中性点成套装置", "equipNo": "10MZ0108522399716", "equipModel": "SR-JXB-110", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "KH250064", "produceOrgId": "", "produceOrg": "江苏如高高压电器有限公司", "startTime": "2025-05-06", "manufactureDate": "2025-03-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109226059753587733", "stationId": "a13ce0756f8a06deed5382a7950153a13cbdc630ab", "stationName": "诚实变", "voltageLevel": "110kV", "voltageLevelCode": "32", "bayId": "9b15d344-3e5b-41f1-88fb-86f94ec6f5c3", "bayName": "1号主变", "areaId": "213", "areaName": "城北", "equipLevel": "32", "equipLevelName": "110kV", "equipName": "1号主变中性点成套装置", "equipNo": "10MZ0108522479005", "equipModel": "GW13-126W/1600", "equipTypeId": 141, "equipTypeName": "主变中性点成套装置", "transRunNo": "", "useEnvironment": "户内式", "useEnvironmentCode": "1", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": null, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "", "produceOrgId": "", "produceOrg": "江苏华鹏变压器有限公司", "startTime": "2025-05-12", "manufactureDate": "2025-02-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": "O", "phaseCode": "4", "psrStateName": "在运", "psrState": "20" }, { "id": "3109222058689561600", "stationId": "154178358", "stationName": "滨南变", "voltageLevel": "220kV", "voltageLevelCode": "33", "bayId": null, "bayName": null, "areaId": "203", "areaName": "220南", "equipLevel": "22", "equipLevelName": "10kV", "equipName": "1号主变102B4接地刀闸", "equipNo": "10MZ0108517740354", "equipModel": null, "equipTypeId": 138, "equipTypeName": "低压隔离开关", "transRunNo": "102B4", "useEnvironment": "", "useEnvironmentCode": "", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": 4000.0, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "C2113022", "produceOrgId": "", "produceOrg": "江苏如高高压电器有限公司", "startTime": "2022-06-30", "manufactureDate": "2022-07-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": null, "phaseCode": null, "psrStateName": "在运", "psrState": "20" }, { "id": "3109222058689561601", "stationId": "154178358", "stationName": "滨南变", "voltageLevel": "220kV", "voltageLevelCode": "33", "bayId": null, "bayName": null, "areaId": "203", "areaName": "220南", "equipLevel": "22", "equipLevelName": "10kV", "equipName": "1号主变102B5接地刀闸", "equipNo": "10MZ0108517740480", "equipModel": null, "equipTypeId": 138, "equipTypeName": "低压隔离开关", "transRunNo": "102B5", "useEnvironment": "", "useEnvironmentCode": "", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": 4000.0, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "C2113021", "produceOrgId": "", "produceOrg": "江苏如高高压电器有限公司", "startTime": "2022-06-30", "manufactureDate": "2022-07-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": null, "phaseCode": null, "psrStateName": "在运", "psrState": "20" }, { "id": "3109222058689561602", "stationId": "154178358", "stationName": "滨南变", "voltageLevel": "220kV", "voltageLevelCode": "33", "bayId": null, "bayName": null, "areaId": "203", "areaName": "220南", "equipLevel": "22", "equipLevelName": "10kV", "equipName": "2号主变102A4接地刀闸", "equipNo": "10MZ0108517740549", "equipModel": null, "equipTypeId": 138, "equipTypeName": "低压隔离开关", "transRunNo": "102A4", "useEnvironment": "", "useEnvironmentCode": "", "structType": "", "structTypeCode": "", "insulationMedium": "", "insulationMediumCode": "", "ratedCurrent": 4000.0, "ratedBreakCurrent": null, "ratedCapacity": null, "breakerStructType": "", "breakerStructTypeCode": "", "ownNo": "C2113023", "produceOrgId": "", "produceOrg": "江苏如高高压电器有限公司", "startTime": "2022-06-30", "manufactureDate": "2022-07-01", "lastUpdateTime": "", "nextUpdateTime": "", "cycle": "6", "cycleUnit": "1", "dispatchRecord": "", "regulatePressureMode": null, "regulatePressureModeCode": null, "equipmentType": null, "equipmentTypeCode": null, "phase": null, "phaseCode": null, "psrStateName": "在运", "psrState": "20" } ], "code": 200, "msg": "查询成功" } 在this.tableData = res.rows.map(row => { const deviceType = row.equipTypeName; const deviceColumns = this.configMap[deviceType] || []; const newRow = {...row}; // 遍历所有列,若不在设备类型对应列中,则添加斜线 this.columns.forEach(col => { const prop = col.prop; if (!deviceColumns.includes(col.label)) { newRow[prop] = '/'; } }); return newRow; });为什么渲染的时候需要2s左右
07-26
根据下面的页面代码,需要编写这个js点击事件,点击明细表中每行的name为extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e5946689e29d2)的输入框,能跳转到对应这个输入框的value里面的链接地址,页面代码如下:<tr> <td row="2" column="0,1,2,3" class="td_normal_title" colspan="4" style="width: auto;" width="undefined"> <script> $(function() { var tb = document.getElementById('TABLE_DL_fd_3e59465a09231a'); tb.setAttribute('tbdraggable', 'true'); }); </script> <script> Com_IncludeFile('doclist.js'); </script> <script id="doclist_js" src="/resource/js/doclist.js?s_cache=1754870647847"></script> <script id="doclistdnd_js" src="/resource/js/doclistdnd.js?s_cache=1754870647847"></script> <script> DocList_Info.push('TABLE_DL_fd_3e59465a09231a'); </script> <script> Com_IncludeFile('detailsTableFreeze.css', Com_Parameter.ContextPath + 'sys/xform/designer/resource/css/', 'css', true); </script> <link rel="stylesheet" href="/sys/xform/designer/resource/css/detailsTableFreeze.css?s_cache=1754870647847"> <script> Com_IncludeFile('detailsTableFreeze.js', Com_Parameter.ContextPath + 'sys/xform/designer/resource/js/', 'js', true); </script> <script id="detailsTableFreeze_js" src="/sys/xform/designer/resource/js/detailsTableFreeze.js?s_cache=1754870647847"></script> <script> Com_AddEventListener(window, 'load', function() { setTimeout(function() { for (var i = 0; i < 1; i++) { DocList_AddRow(document.getElementById('TABLE_DL_fd_3e59465a09231a')) }; tableFreezeStarter('TABLE_DL_fd_3e59465a09231a', false, undefined, false, true, 'add'); }, 500); }); </script> <table label="明细表1" id="TABLE_DL_fd_3e59465a09231a" align="center" class="tb_normal" tablename="fd_3e5946528a2834" style="width: 100%;" data-multihead="false" width="100%" showindex="true" showrow="1" showstatisticrow="undefined" showcopyopt="undefined" dataentrymode="multipleRow" required="undefined" performance="undefined" excelexport="undefined" excelimport="undefined" defaultfreezetitle="undefined" defaultfreezecol="undefined" layout2col="undefined" fd_type="detailsTable" tbdraggable="true"> <tbody> <tr class="tr_normal_title" type="titleRow" style="height: 33px;" invalidrow="true"> <td row="1" column="0" align="center" coltype="selectCol" style="width: 15px;"></td> <td row="0" column="1" align="center" class="td_normal_title" coltype="noTitle" style="width: 25px; white-space: nowrap;">序号</td> <td row="0" column="2" align="center" class="td_normal_title"> <label class="xform_label" line="normal" fd_type="textLabel" style="display: inline-block; width: auto; word-break: break-all; overflow-wrap: break-word;;word-break:break-all;;word-wrap:break-word;">文本1</label> </td> <td row="0" column="3" align="center" class="td_normal_title"> <label class="xform_label" line="normal" style="display: inline-block; width: auto; word-break: break-all; overflow-wrap: break-word;;word-break:break-all;;word-wrap:break-word;" fd_type="textLabel">文本3</label> </td> <td row="0" column="4" align="center" class="td_normal_title"></td> <td row="0" column="5" align="center" class="td_normal_title" coltype="blankTitleCol" style="width:48px;"></td> </tr> <tr class="" trdraggable="true" style="cursor: move; user-select: none;"> <td class="" align="center" valign=""><input type="checkbox" name="DocList_Selected" onclick="DocList_SelectRow(this);"></td> <td class="" align="center" valign="">1</td> <td class="" align="center" valign=""> <div class="xform_inputText" canshow="true" fd_type="inputText" style="display: inline-block; width: 147px; word-break: break-all; overflow-wrap: break-word;"> <xformflag flagid="fd_3e59465a09231a.0.fd_3e59465b4a38ce" id="_xform_extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e59465b4a38ce)" property="extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e59465b4a38ce)" flagtype="xform_text" _xform_type="text"><input name="extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e59465b4a38ce)" subject="文本1" title="文本1" onblur="__xformDispatch(this.value, this);" class="inputsgl xform_inputText" value="" type="text" style="display: inline-block; width: 147px; word-break: break-all; overflow-wrap: break-word;width:120px;"> </xformflag> </div> <input name="extendDataFormInfo.value(fd_3e59465a09231a.0.fdId)" value="" type="hidden"> </td> <td class="" align="center" valign=""> <div style="display: inline-block; width: 202px;width: 210px;" class="xform_formula_load"> <xformflag flagid="fd_3e59465a09231a.0.fd_3e5946689e29d2" id="_xform_extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e5946689e29d2)" property="extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e5946689e29d2)" flagtype="formula_calculation" _xform_type="formulaCalculation"> <script> Com_IncludeFile('formula_calculation_script.js', '../sys/xform/designer/formula_calculation/'); </script> <script id="formula_calculation_script_js" src="/resource/../sys/xform/designer/formula_calculation/formula_calculation_script.js?s_cache=1754870647847"> </script> <input name="extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e5946689e29d2)" value="http://192.1.1.92:8080/webroot/decision/view/duchamp?viewlet=crm_project%252F%25E7%2589%25A9%25E6%2596%2599%25E4%25BE%259B%25E9%259C%2580%25E6%259F%25A5%25E8%25AF%25A2%25E9%25A1%25B5%25E9%259D%25A2.fvs&ref_t=design&ref_c=1e33972c-8151-43ff-81bb-d263b846af18&page_number=1&p_material=123" type="hidden" loadtype="autoLoad,manualLoad"><input name="extendDataFormInfo.value(fd_3e59465a09231a.0.fd_3e5946689e29d2_text)" subject="文本3" title="文本3" formula_calculation="true" isrow="true" returntype="text" loadtype="autoLoad,manualLoad" controlsid="fd_3e59465a09231a.fd_3e59465b4a38ce" fdid="fd_3e59465a09231a.0.fd_3e5946689e29d2" right="" readonly="readOnly" class="inputsgl xform_formula_load" value="" type="text" style="display: inline-block; width: 202px;width: 200px;"> </xformflag> </div> </td> <td class="" align="center" valign=""> <label class="xform_linkLabel" fd_type="linkLabel" style="display: inline-block; "><a target="_blank" href="www.baidu.com" style="color: rgb(66, 133, 244); font-weight: normal; font-style: normal; text-decoration: none;" parent_style="display: inline-block; width: 58px;" parent_class="xform_linkLabel">超链接1 </a></label> </td> <td class="" align="center" valign=""> <nobr><span style="cursor:pointer" class="optStyle opt_copy_style" title="复制行" onmousedown="DocList_CopyRow();"></span>  <span style="cursor:pointer" class="optStyle opt_del_style" title="删除行" onmousedown="DocList_DeleteRow_ClearLast();XFom_RestValidationElements();"></span>   </nobr> </td> </tr> <tr type="statisticRow" invalidrow="true"> <td row="1" column="0" align="center" coltype="selectCol" style="width: 15px;"></td> <td row="2" column="1" align="center" coltype="noFoot" style="width: 25px;"> </td> <td row="2" column="2" align="center"> </td> <td row="2" column="3" align="center"> </td> <td row="2" column="4" align="center"> </td> <td row="2" column="5" align="center" coltype="emptyCell" style="width: 48px;"> </td> </tr> <tr type="optRow" class="tr_normal_opt" invalidrow="true"> <td row="3" column="0" align="center" coltype="optCol" colspan="6" style=""> <div class="tr_normal_opt_content" style="min-width:580px;;"> <div class="tr_normal_opt_l"><label class="opt_ck_style" style="position:relative;top:3px;"><input type="checkbox" name="DocList_SelectAll" onclick="DocList_SelectAllRow(this);"><span style="margin-left: 6px;">全选<span></span></span></label><span style="margin-left:15px;" onclick="DocList_BatchDeleteRow();XFom_RestValidationElements();"><span class="optStyle opt_batchDel_style" style="margin-left:0px; " title="删除行"></span><span style="position:relative;top:3px;cursor: pointer;margin-left: 6px;">删除行</span></span> </div> <div class="tr_normal_opt_c"><span onclick="DocList_AddRow();XFom_RestValidationElements();"><span class="optStyle opt_add_style" title="添加行"></span><span style="position:relative;top:3px;cursor: pointer;margin-left: 6px;">添加行</span></span><span style="margin-left:15px;" onclick="DocList_MoveRowBySelect(-1);"><span class="optStyle opt_up_style" title="上移"></span><span style="position:relative;top:3px;cursor: pointer;margin-left: 6px;">上移</span></span><span style="margin-left:15px;" onclick="DocList_MoveRowBySelect(1);"><span class="optStyle opt_down_style" title="下移"></span><span style="position:relative;top:3px;cursor: pointer;margin-left: 6px;">下移</span></span> </div> <div class="tr_normal_opt_r"> </div> </div> </td> </tr> </tbody> </table> </td> </tr>
08-13
标题SpringBoot智能在线预约挂号系统研究AI更换标题第1章引言介绍智能在线预约挂号系统的研究背景、意义、国内外研究现状及论文创新点。1.1研究背景与意义阐述智能在线预约挂号系统对提升医疗服务效率的重要性。1.2国内外研究现状分析国内外智能在线预约挂号系统的研究与应用情况。1.3研究方法及创新点概述本文采用的技术路线、研究方法及主要创新点。第2章相关理论总结智能在线预约挂号系统相关理论,包括系统架构、开发技术等。2.1系统架构设计理论介绍系统架构设计的基本原则和常用方法。2.2SpringBoot开发框架理论阐述SpringBoot框架的特点、优势及其在系统开发中的应用。2.3数据库设计与管理理论介绍数据库设计原则、数据模型及数据库管理系统。2.4网络安全与数据保护理论讨论网络安全威胁、数据保护技术及其在系统中的应用。第3章SpringBoot智能在线预约挂号系统设计详细介绍系统的设计方案,包括功能模块划分、数据库设计等。3.1系统功能模块设计划分系统功能模块,如用户管理、挂号管理、医生排班等。3.2数据库设计与实现设计数据库表结构,确定字段类型、主键及外键关系。3.3用户界面设计设计用户友好的界面,提升用户体验。3.4系统安全设计阐述系统安全策略,包括用户认证、数据加密等。第4章系统实现与测试介绍系统的实现过程,包括编码、测试及优化等。4.1系统编码实现采用SpringBoot框架进行系统编码实现。4.2系统测试方法介绍系统测试的方法、步骤及测试用例设计。4.3系统性能测试与分析对系统进行性能测试,分析测试结果并提出优化建议。4.4系统优化与改进根据测试结果对系统进行优化和改进,提升系统性能。第5章研究结果呈现系统实现后的效果,包括功能实现、性能提升等。5.1系统功能实现效果展示系统各功能模块的实现效果,如挂号成功界面等。5.2系统性能提升效果对比优化前后的系统性能
在金融行业中,对信用风险的判断是核心环节之一,其结果对机构的信贷政策和风险控制策略有直接影响。本文将围绕如何借助机器学习方法,尤其是Sklearn工具包,建立用于判断信用状况的预测系统。文中将涵盖逻辑回归、支持向量机等常见方法,并通过实际操作流程进行说明。 一、机器学习基本概念 机器学习属于人工智能的子领域,其基本理念是通过数据自动学习规律,而非依赖人工设定规则。在信贷分析中,该技术可用于挖掘历史数据中的潜在规律,进而对未来的信用表现进行预测。 二、Sklearn工具包概述 Sklearn(Scikit-learn)是Python语言中广泛使用的机器学习模块,提供多种数据处理和建模功能。它简化了数据清洗、特征提取、模型构建、验证与优化等流程,是数据科学项目中的常用工具。 三、逻辑回归模型 逻辑回归是一种常用于分类任务的线性模型,特别适用于二类问题。在信用评估中,该模型可用于判断借款人是否可能违约。其通过逻辑函数将输出映射为0到1之间的概率值,从而表示违约的可能性。 四、支持向量机模型 支持向量机是一种用于监督学习的算法,适用于数据维度高、样本量小的情况。在信用分析中,该方法能够通过寻找最佳分割面,区分违约与非违约客户。通过选用不同核函数,可应对复杂的非线性关系,提升预测精度。 五、数据预处理步骤 在建模前,需对原始数据进行清理与转换,包括处理缺失值、识别异常点、标准化数值、筛选有效特征等。对于信用评分,常见的输入变量包括收入水平、负债比例、信用历史记录、职业稳定性等。预处理有助于减少噪声干扰,增强模型的适应性。 六、模型构建与验证 借助Sklearn,可以将数据集划分为训练集和测试集,并通过交叉验证调整参数以提升模型性能。常用评估指标包括准确率、召回率、F1值以及AUC-ROC曲线。在处理不平衡数据时,更应关注模型的召回率与特异性。 七、集成学习方法 为提升模型预测能力,可采用集成策略,如结合多个模型的预测结果。这有助于降低单一模型的偏差与方差,增强整体预测的稳定性与准确性。 综上,基于机器学习的信用评估系统可通过Sklearn中的多种算法,结合合理的数据处理与模型优化,实现对借款人信用状况的精准判断。在实际应用中,需持续调整模型以适应市场变化,保障预测结果的长期有效性。 资源来源于网络分享,仅用于学习交流使用,请勿用于商业,如有侵权请联系我删除!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值