test #47

Merged
gtz217 merged 273 commits from test into master 2023-10-17 08:53:54 +08:00
2 changed files with 237 additions and 10 deletions
Showing only changes of commit 291197a28d - Show all commits

View File

@ -0,0 +1,71 @@
<!--
filename: summaryDialog.vue
author: liubin
date: 2023-08-04 16:25:49
description:
-->
<template>
<!-- 列表 -->
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"></base-table>
<!-- @emit-fun="handleEmitFun"> -->
<!-- <method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
fixed="right"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> -->
</template>
<script>
export default {
name: 'SummaryTable',
components: {},
props: {},
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
},
tableProps: [
{
prop: 'pl',
label: '产线',
align: 'center',
},
{
prop: 'upTotal',
label: '上片总数',
align: 'center',
},
{
prop: 'downTotal',
label: '下片总数',
align: 'center',
},
{
prop: 'total',
label: '检测总数',
align: 'center',
},
{
prop: 'ratio',
label: '比例(%)',
align: 'center',
},
],
list: [{}],
};
},
computed: {},
methods: {},
};
</script>
<style scoped lang="scss"></style>

View File

@ -12,16 +12,49 @@
:formConfigs="searchBarFormConfig" :formConfigs="searchBarFormConfig"
ref="search-bar" ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" /> @headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table
v-if="mode == 'table'"
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emit-fun="handleEmitFun">
<!-- <method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
fixed="right"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> -->
</base-table>
<p v-if="mode == 'graph'">图形版</p>
<!-- todo: 数据总览用弹窗包裹的 table 实现 -->
<base-dialog
dialogTitle="数据总览"
:dialogVisible="summaryOpen"
width="50%"
@close="handleSummaryClose"
@cancel="handleSummaryClose"
@confirm="handleSummaryClose">
<summaryTable />
</base-dialog>
</div> </div>
</template> </template>
<script> <script>
import summaryTable from './components/summaryTable.vue';
export default { export default {
name: 'QualityStatistics', name: 'QualityStatistics',
components: {}, components: { summaryTable },
props: {}, props: {},
data() { data() {
return { return {
mode: 'table', // defaults to 'table'
searchBarFormConfig: [ searchBarFormConfig: [
{ {
type: 'datePicker', type: 'datePicker',
@ -70,31 +103,154 @@ export default {
color: 'text btn-graph', color: 'text btn-graph',
}, },
], ],
tableProps: [
{
width: 160,
prop: 'inspectionDetContent',
label: '检测内容',
align: 'center',
},
{
width: 128,
prop: 'line1',
label: '产线1',
align: 'center',
},
{
width: 128,
prop: 'line2',
label: '产线2',
align: 'center',
},
{
width: 128,
prop: 'line3',
label: '产线3',
align: 'center',
},
{
width: 128,
prop: 'line4',
label: '产线4',
align: 'center',
},
{
width: 128,
prop: 'line5',
label: '产线5',
align: 'center',
},
{
width: 128,
prop: 'line6',
label: '产线6',
align: 'center',
},
{
width: 128,
prop: 'line7',
label: '产线7',
align: 'center',
},
{
width: 128,
prop: 'line8',
label: '产线8',
align: 'center',
},
{
width: 128,
prop: 'typeTotal',
label: '检测类型总数',
align: 'center',
subcomponent: {
name: 'TextOnly',
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
data() {
return {
text: '各产线相加数量',
};
},
methods: {
handleEmit(payload) {
console.log('handleEmit', payload);
},
},
render(h) {
return h('el-button', { props: { type: 'text' } }, this.text);
},
},
},
{
width: 128,
prop: 'ratio',
label: '比例',
align: 'center',
subcomponent: {
name: 'TextOnly',
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
data() {
return {
text: '比例',
};
},
methods: {
handleEmit(payload) {
console.log('handleEmit', payload);
},
},
render(h) {
return h('el-button', { props: { type: 'text' } }, this.text);
},
},
},
],
//
queryParams: {
pageNo: 1,
pageSize: 10,
},
list: [],
summaryOpen: false,
}; };
}, },
computed: {}, computed: {},
methods: { methods: {
handleSummaryClose() {
this.summaryOpen = false;
},
handleSearchBarBtnClick(btn) { handleSearchBarBtnClick(btn) {
switch (btn.btnName) { switch (btn.btnName) {
case 'search': case 'search':
this.queryParams[key] = btn[key] || null; this.queryParams[key] = btn[key] || null;
// this.handleQuery(); // this.handleQuery();
break; break;
case 'summary': case 'summary':
alert('数据总览') this.summaryOpen = true;
break; break;
case 'tableVersion': case 'tableVersion':
alert('表格版') this.mode = 'table';
break; break;
case 'graphVersion': case 'graphVersion':
alert('图形版') this.mode = 'graph';
break; break;
case 'reset': case 'reset':
this.$refs['search-bar'].resetForm(); this.$refs['search-bar'].resetForm();
// this.resetQuery(); // this.resetQuery();
break; break;
} }
}, },
handleEmitFun() {},
}, },
}; };
</script> </script>