| | |
| | | <div class="analysis-top"> |
| | | <div class="title-top">查询条件</div> |
| | | <div class="value"> |
| | | <el-form ref="form" :model="form" label-width="120px"> |
| | | <el-form ref="form" :model="queryParams" label-width="120px"> |
| | | <el-form-item label="选择指标名称"> |
| | | <el-select |
| | | remote |
| | | :remote-method="remoteMethod" |
| | | default-first-option |
| | | v-model="value" |
| | | v-model="targetvalue" |
| | | @change="Labelstatistics" |
| | | filterable |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | v-for="item in targetList" |
| | | :key="item.id" |
| | | :label="item.targetname" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | </div> |
| | | <div class="formindex"> |
| | | <el-table |
| | | v-loading="loading" |
| | | v-loading="loading" |
| | | :data="tableData" |
| | | :span-method="objectSpanMethod" |
| | | border |
| | |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column prop="targetname" label="指标名称"> </el-table-column> |
| | | <el-table-column prop="targetShowCount" label="指标出现次数"> </el-table-column> |
| | | <el-table-column prop="targetShowCount" label="指标出现次数"> |
| | | </el-table-column> |
| | | <el-table-column prop="matchedtext" label="单项名称"> </el-table-column> |
| | | <el-table-column prop="count" label="单项选中次数"> </el-table-column> |
| | | <el-table-column prop="percentage" label="占比"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ (Number(scope.row.percentage)*100).toFixed(2) }}%</span> </template> |
| | | <span>{{ (Number(scope.row.percentage) * 100).toFixed(2) }}%</span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | |
| | | name: "indexanalysis", |
| | | data() { |
| | | return { |
| | | options: [ |
| | | targetList: [ |
| | | { |
| | | value: "选项1", |
| | | label: "发热有无", |
| | |
| | | proportion: "0", |
| | | }, |
| | | ], |
| | | targetvalue: "", |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 66, |
| | | scriptType: "1", |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | this.loading = true; |
| | | gettargetInfo(this.queryParams).then((res) => { |
| | | this.targetList = res.rows; |
| | | this.Labelstatistics(res.rows[0].id) |
| | | this.Labelstatistics(res.rows[0].id); |
| | | }); |
| | | }, |
| | | Labelstatistics(id){ |
| | | Labelstatistics(id) { |
| | | console.log(id, "id"); |
| | | |
| | | Labelstatistics(id).then((res) => { |
| | | this.tableData = res.data; |
| | | if (res.data.length > 0) { |
| | | this.tableData = res.data; |
| | | } else { |
| | | gettargetInfo({ id: id }).then((res) => { |
| | | console.log(res, "替换展示值"); |
| | | this.tableData = []; |
| | | res.rows[0].targetoptionList.forEach((item) => { |
| | | this.tableData.push({ |
| | | targetname: res.rows[0].targetname, |
| | | targetShowCount:0, |
| | | count:0, |
| | | percentage:0, |
| | | matchedtext:item.targetvalue, |
| | | }); |
| | | }); |
| | | }); |
| | | } |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | |
| | | const illnessqueryParams = { |
| | | pageNum: 1, |
| | | pageSize: 66, |
| | | tagname: value, |
| | | targetname: value, |
| | | scriptType: "1", |
| | | }; |
| | | setTimeout(() => { |
| | | gettargetInfo(this.illnessqueryParams).then((res) => { |
| | | this.targetList = res.rows; |
| | | }); |
| | | gettargetInfo(illnessqueryParams).then((res) => { |
| | | this.targetList = res.rows; |
| | | }); |
| | | }, 200); |
| | | }, |
| | | objectSpanMethod({ row, column, rowIndex, columnIndex }) { |
| | |
| | | return prev; |
| | | } |
| | | }, 0); |
| | | sums[index] = `${total*100}%`; // 直接添加百分号 |
| | | sums[index] = `${total * 100}%`; // 直接添加百分号 |
| | | } else if (column.property === "targetShowCount") { |
| | | sums[index] = data[0].targetShowCount + " 次"; // 为次数相关列添加单位 |
| | | } else { |