fast(硬件数据库):添加服务地址字段
This commit is contained in:
parent
d5a316e925
commit
9eed55cf66
|
@ -1,17 +1,17 @@
|
|||
<template>
|
||||
<div class="app-container page-iot-library">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
v-show="showSearch"
|
||||
ref="queryForm"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
:model="queryParams"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="芯片ID" prop="uId">
|
||||
<el-input
|
||||
v-model="queryParams.uId"
|
||||
placeholder="请输入芯片ID"
|
||||
clearable
|
||||
placeholder="请输入芯片ID"
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
|
@ -19,8 +19,8 @@
|
|||
<el-form-item label="批次编码" prop="batchCode">
|
||||
<el-input
|
||||
v-model="queryParams.batchCode"
|
||||
placeholder="请输入流水号"
|
||||
clearable
|
||||
placeholder="请输入流水号"
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
|
@ -28,17 +28,17 @@
|
|||
<el-form-item label="硬件条码" prop="devId">
|
||||
<el-input
|
||||
v-model="queryParams.devId"
|
||||
placeholder="请输入硬件条码"
|
||||
clearable
|
||||
placeholder="请输入硬件条码"
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
|
@ -51,12 +51,12 @@
|
|||
<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="['iot:library:add']"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
|
@ -86,32 +86,32 @@
|
|||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['iot:library:export']"
|
||||
icon="el-icon-download"
|
||||
plain
|
||||
size="mini"
|
||||
type="warning"
|
||||
@click="handleExport"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExportCSV"
|
||||
v-hasPermi="['iot:library:export']"
|
||||
icon="el-icon-download"
|
||||
plain
|
||||
size="mini"
|
||||
type="warning"
|
||||
@click="handleExportCSV"
|
||||
>导出CSV</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-upload"
|
||||
plain
|
||||
size="mini"
|
||||
type="info"
|
||||
@click="handleImport"
|
||||
>导入</el-button
|
||||
>
|
||||
|
@ -130,43 +130,44 @@
|
|||
>
|
||||
<!-- <el-table-column type="selection" width="50" align="center" /> -->
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
align="center"
|
||||
:index="indexFormatter"
|
||||
align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
<el-table-column label="芯片ID" align="left" prop="uId" />
|
||||
<el-table-column label="批次编码" align="left" prop="batchCode" />
|
||||
<el-table-column label="硬件条码" align="left" prop="devId" />
|
||||
<el-table-column align="left" label="芯片ID" prop="uId" />
|
||||
<el-table-column align="left" label="批次编码" prop="batchCode" />
|
||||
<el-table-column align="left" label="硬件条码" prop="devId" />
|
||||
<el-table-column :formatter="dataServerFormat" align="center" label="服务地址" prop="dataServer" />
|
||||
<el-table-column
|
||||
label=" 创建时间"
|
||||
align="center"
|
||||
label=" 创建时间"
|
||||
prop="createTime"
|
||||
sortable="custom"
|
||||
width="150px"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="200"
|
||||
class-name="small-padding fixed-width"
|
||||
label="操作"
|
||||
width="200"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-hasPermi="['iot:library:edit']"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['iot:library:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPermi="['iot:library:remove']"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['iot:library:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
|
@ -175,9 +176,9 @@
|
|||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
@ -186,30 +187,45 @@
|
|||
<dialog-template :title="title" :visible="open" @close="open = false">
|
||||
<el-form
|
||||
ref="form"
|
||||
slot="dialog-center"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
slot="dialog-center"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="芯片ID" prop="uId">
|
||||
<el-input v-model="form.uId" :disabled="form.hardwareId || form.hardwareId === 0" placeholder="请输入芯片ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批次" prop="batchId" v-if="!(form.hardwareId || form.hardwareId === 0)">
|
||||
<el-form-item v-if="!(form.hardwareId || form.hardwareId === 0)" label="批次" prop="batchId">
|
||||
<el-input
|
||||
v-model="batchNumber"
|
||||
placeholder="点击选择批次"
|
||||
@focus="openTableSelectDialog()"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="硬件条码" prop="devId" v-if="form.hardwareId || form.hardwareId === 0">
|
||||
<el-form-item v-if="form.hardwareId || form.hardwareId === 0" label="硬件条码" prop="devId">
|
||||
<el-input
|
||||
v-model="form.devId"
|
||||
placeholder="请输入硬件吗"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务地址" prop="dataServer">
|
||||
<el-select
|
||||
v-model="form.dataServer"
|
||||
clearable
|
||||
placeholder="请选择服务地址"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dataServerList"
|
||||
:key="item.dictValue"
|
||||
:label="item.dictLabel"
|
||||
:value="item.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="dialog-footer">
|
||||
<el-button type="primary" size="mini" @click="submitForm"
|
||||
<el-button size="mini" type="primary" @click="submitForm"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button size="mini" @click="cancel">取 消</el-button>
|
||||
|
@ -217,26 +233,26 @@
|
|||
</dialog-template>
|
||||
|
||||
<dialog-template
|
||||
title="选择"
|
||||
:visible="selectTableShow"
|
||||
width="75%"
|
||||
top="10vh"
|
||||
class="select-table-dialog"
|
||||
@close="selectTableShow = false"
|
||||
:close-on-click-modal="false"
|
||||
:visible="selectTableShow"
|
||||
class="select-table-dialog"
|
||||
title="选择"
|
||||
top="10vh"
|
||||
width="75%"
|
||||
@close="selectTableShow = false"
|
||||
>
|
||||
<select-table-wrap
|
||||
slot="dialog-center"
|
||||
v-if="selectTableShow"
|
||||
:tableOption="tableSelectOption.tableOpt"
|
||||
slot="dialog-center"
|
||||
:otherOption="tableSelectOption.otherOption"
|
||||
:queryOption="tableSelectOption.queryOpt"
|
||||
:tableList="tableSelectOption.tableList"
|
||||
:tableOption="tableSelectOption.tableOpt"
|
||||
@parentGetList="childGetList($event)"
|
||||
:otherOption="tableSelectOption.otherOption"
|
||||
@returnEvent="returnEvent($event)"
|
||||
/>
|
||||
|
||||
<div class="dialog-footer" slot="dialog-footer">
|
||||
<div slot="dialog-footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" @click="resuleClick"
|
||||
>确 定</el-button
|
||||
>
|
||||
|
@ -272,15 +288,15 @@
|
|||
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
:data="form"
|
||||
:disabled="upload.isUploading"
|
||||
:headers="upload.headers"
|
||||
:limit="1"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
accept=".xlsx, .xls"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
|
@ -288,20 +304,20 @@
|
|||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
<div slot="tip" class="el-upload__tip">
|
||||
<!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的硬件数据 -->
|
||||
<el-link type="info" style="font-size: 12px" @click="importTemplate"
|
||||
<el-link style="font-size: 12px" type="info" @click="importTemplate"
|
||||
>下载模板</el-link
|
||||
>
|
||||
</div>
|
||||
<div class="el-upload__tip" style="color: red" slot="tip">
|
||||
<div slot="tip" class="el-upload__tip" style="color: red">
|
||||
提示:仅允许导入“xls”或“xlsx”格式文件!
|
||||
</div>
|
||||
</el-upload>
|
||||
</template>
|
||||
|
||||
|
||||
<div slot="dialog-footer" class="dialog-footer">
|
||||
<el-button type="primary" size="mini" @click="submitFileForm"
|
||||
<el-button size="mini" type="primary" @click="submitFileForm"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button size="mini" @click="upload.open = false">取 消</el-button>
|
||||
|
@ -368,6 +384,8 @@ export default {
|
|||
total: 0,
|
||||
// 硬件数据库表格数据
|
||||
libraryList: [],
|
||||
//服务列表
|
||||
dataServerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
|
@ -403,11 +421,11 @@ export default {
|
|||
{ required: true, message: '硬件条码不能为空', trigger: "change,blur"},
|
||||
{
|
||||
type: "string",
|
||||
pattern: /^[1-9][0-9]{15}$/,
|
||||
message: "格式不正确:[0-9] 16字符",
|
||||
pattern: /^[1-9][0-9]{15,19}$/,
|
||||
message: "格式不正确:[0-9] 16到20字符",
|
||||
trigger: "blur",
|
||||
},
|
||||
]
|
||||
],
|
||||
},
|
||||
selectResult: {},
|
||||
tableSelectOption: {},
|
||||
|
@ -417,9 +435,16 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
this.getDicts("data_server").then((response) => {
|
||||
this.dataServerList = response.data;
|
||||
});
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 菜单状态字典翻译
|
||||
dataServerFormat(row, column) {
|
||||
return this.selectDictLabel(this.dataServerList, row.dataServer);
|
||||
},
|
||||
sortChange(column) {
|
||||
const sort = {
|
||||
isAsc: column.order === "descending" ? "desc" : "asc",
|
||||
|
@ -588,6 +613,7 @@ export default {
|
|||
},
|
||||
// 点击或者双击数据回调
|
||||
returnEvent(data) {
|
||||
console.log("data---",data)
|
||||
this.selectResult = {};
|
||||
if (data.type === "dblclick") {
|
||||
if (data.otherOption.tableType === "batch") {
|
||||
|
@ -631,6 +657,7 @@ export default {
|
|||
hardwareId: null,
|
||||
uId: null,
|
||||
batchId: null,
|
||||
dataServer: null,
|
||||
};
|
||||
this.batchNumber = "";
|
||||
this.resetForm("form");
|
||||
|
@ -672,7 +699,7 @@ export default {
|
|||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.hardwareId != null) {
|
||||
updateLibrary({'hardwareId': this.form.hardwareId, 'devId': this.form.devId}).then((response) => {
|
||||
updateLibrary({'hardwareId': this.form.hardwareId, 'devId': this.form.devId,'dataServer':this.form.dataServer}).then((response) => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
|
|
Loading…
Reference in New Issue