| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="总成序列号" prop="sfcCode"> |
| | | <el-form-item label-width="120" label="总成序列号" prop="sfcCode"> |
| | | <el-input |
| | | v-model="queryParams.sfcCode" |
| | | placeholder="请输入总成序列号" |
| | |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="工位编码" prop="locationCode"> |
| | | <el-form-item label-width="120" label="采集时间" prop="timeQuery"> |
| | | <el-date-picker |
| | | v-model="queryParams.timeQuery" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item style="float: right"> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| | | <el-button icon="el-icon-setting" size="mini" @click="toggleAdvancedSearch">高级查询</el-button> |
| | | </el-form-item> |
| | | <transition name="fade"> |
| | | <div v-if="advancedSearchVisible" class="advanced-search"> |
| | | <el-form-item label="工位编码" prop="locationCode"> |
| | | <el-input |
| | | v-model="queryParams.locationCode" |
| | | placeholder="请输入工位编码" |
| | |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="参数名称" prop="paramName"> |
| | | <el-input |
| | | v-model="queryParams.paramName" |
| | | placeholder="请输入参数名称" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | <el-form-item label="参数名称" prop="paramName"> |
| | | <el-input |
| | | v-model="queryParams.paramName" |
| | | placeholder="请输入参数名称" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <!-- 可以继续添加其他高级查询条件 --> |
| | | <el-row> |
| | | <el-col :span="24" style="text-align: right;"> |
| | | <el-button type="primary" icon="el-icon-close" size="mini" @click="toggleAdvancedSearch">关闭</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </transition> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['da:paramCollection:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['da:paramCollection:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['da:paramCollection:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="primary"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-plus"--> |
| | | <!-- size="mini"--> |
| | | <!-- @click="handleAdd"--> |
| | | <!-- v-hasPermi="['da:paramCollection:add']"--> |
| | | <!-- >新增</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="success"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-edit"--> |
| | | <!-- size="mini"--> |
| | | <!-- :disabled="single"--> |
| | | <!-- @click="handleUpdate"--> |
| | | <!-- v-hasPermi="['da:paramCollection:edit']"--> |
| | | <!-- >修改</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="danger"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-delete"--> |
| | | <!-- size="mini"--> |
| | | <!-- :disabled="multiple"--> |
| | | <!-- @click="handleDelete"--> |
| | | <!-- v-hasPermi="['da:paramCollection:remove']"--> |
| | | <!-- >删除</el-button>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="paramCollectionList" @selection-change="handleSelectionChange"> |
| | | <el-table v-loading="loading" border :data="paramCollectionList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="主键id" align="center" prop="id" /> |
| | | <!-- <el-table-column label="主键id" align="center" prop="id" />--> |
| | | <el-table-column label="总成序列号" align="center" prop="sfcCode" /> |
| | | <el-table-column label="工位编码" align="center" prop="locationCode" /> |
| | | <el-table-column label="参数编码" align="center" prop="paramCode" /> |
| | | <el-table-column label="参数名称" align="center" prop="paramName" /> |
| | | <el-table-column label="参数值" align="center" prop="paramValue" /> |
| | | <el-table-column label="采集时间" align="center" prop="collectTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.collectTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['da:paramCollection:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['da:paramCollection:remove']" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | |
| | | |
| | | <!-- 添加或修改参数采集对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="95px"> |
| | | <el-form-item label="总成序列号" prop="sfcCode"> |
| | | <el-input v-model="form.sfcCode" placeholder="请输入总成序列号" /> |
| | | </el-form-item> |
| | |
| | | name: "ParamCollection", |
| | | data() { |
| | | return { |
| | | value1: "", |
| | | advancedSearchVisible: false, |
| | | // 遮罩层 |
| | | loading: true, |
| | | // 选中数组 |
| | |
| | | locationCode: null, |
| | | paramCode: null, |
| | | paramName: null, |
| | | timeQuery: [] |
| | | }, |
| | | // 表单参数 |
| | | form: {}, |
| | | // 表单校验 |
| | | rules: { |
| | | sfcCode: [ |
| | | { required: true, message: "总成序列号不能为空", trigger: "blur" } |
| | | { required: true, message: "总成序列号不能为空", trigger: "blur" }, |
| | | { pattern: /^[a-zA-Z0-9]*$/, message: "总成序列号不能包含中文字符", trigger: "blur" } |
| | | ], |
| | | locationCode: [ |
| | | { required: true, message: "工位编码不能为空", trigger: "blur" } |
| | | { required: true, message: "工位编码不能为空", trigger: "blur" }, |
| | | { pattern: /^[a-zA-Z0-9]*$/, message: "总成序列号不能包含中文字符", trigger: "blur" } |
| | | ], |
| | | paramCode: [ |
| | | { required: true, message: "参数编码不能为空", trigger: "blur" } |
| | | { required: true, message: "参数编码不能为空", trigger: "blur" }, |
| | | { pattern: /^[a-zA-Z0-9]*$/, message: "总成序列号不能包含中文字符", trigger: "blur" } |
| | | ], |
| | | paramValue: [ |
| | | { required: true, message: "参数值不能为空", trigger: "blur" } |
| | | { required: true, message: "参数值不能为空", trigger: "blur" }, |
| | | { pattern: /^[a-zA-Z0-9]*$/, message: "总成序列号不能包含中文字符", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | toggleAdvancedSearch() { |
| | | this.advancedSearchVisible = !this.advancedSearchVisible; |
| | | }, |
| | | /** 查询参数采集列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | this.advancedSearchVisible = false |
| | | }, |
| | | /** 重置按钮操作 */ |
| | | resetQuery() { |
| | | this.clearQueryParams() |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | clearQueryParams(){ |
| | | this.queryParams.paramName = null |
| | | this.queryParams.locationCode = null |
| | | this.queryParams.paramCode = null |
| | | }, |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped>.fade-enter-active, .fade-leave-active { |
| | | transition: opacity 0.3s; |
| | | } |
| | | .fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ { |
| | | opacity: 0; |
| | | } |
| | | |
| | | .advanced-search { |
| | | position: absolute; |
| | | background: #FFFFFF; /* 设置为与页面背景色相同或相近的颜色 */ |
| | | border-left: 1px solid #dcdfe6; |
| | | border-right: 1px solid #dcdfe6; |
| | | border-bottom: 1px solid #dcdfe6; |
| | | /*border: none;*/ |
| | | box-shadow: none; /* 移除阴影 */ |
| | | padding: 10px; |
| | | z-index: 1000; /* 确保浮动在其他元素之上 */ |
| | | top: 70px; /* 调整顶部位置,使其与页面其他元素更协调 */ |
| | | left: 20px; /* 调整左侧位置 */ |
| | | width: 97%; /* 调整宽度 */ |
| | | /*max-width: 1296px; !* 最大宽度 *!*/ |
| | | /*max-width: 1296px; !* 最大宽度 *!*/ |
| | | margin: 0 auto; /* 居中对齐 */ |
| | | } |
| | | </style> |