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