网关网卡参数能够配置功能更新

This commit is contained in:
zhangjunwen 2024-09-23 17:03:23 +08:00
parent 8584e5eb42
commit f5c12be04d
3 changed files with 31 additions and 5 deletions

View File

@ -35,7 +35,7 @@ public interface GatewayCardParamsMapper extends BaseMapperX<GatewayCardParamsDO
default List<GatewayCardParamsDO> selectList(String cardId) {
return selectList(new LambdaQueryWrapperX<GatewayCardParamsDO>()
.eqIfPresent(GatewayCardParamsDO::getCardId, cardId)
.orderByAsc(GatewayCardParamsDO::getCreateTime)
.orderByAsc(GatewayCardParamsDO::getChannelName)
);
}
}

View File

@ -199,11 +199,9 @@ export default {
components: {},
data() {
const checkRepeatName = (rule, value, callback) => {
console.log("需要检查的字段:", value);
const repeatName = this.paramsForm.paramsList.filter(
(e) => e.channelName == value
);
console.log("结果:", repeatName);
if (repeatName.length > 1) {
callback(new Error("通道名称不允许重复"));
} else {

View File

@ -101,6 +101,8 @@
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
:row-key="rowKey"
:expand-row-keys="expandRowKeys"
@expand-change="tableExpandChange"
>
<el-table-column
@ -169,6 +171,13 @@
@click="openCardForm(scope.row.cardId,scope.row)"
v-hasPermi="['imt:gateway-info:create']"
>采集卡信息修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleCardDelete(scope.row)"
v-hasPermi="['imt:gateway-info:delete']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
@ -366,6 +375,7 @@ export default {
],
cardLoading: false,
expandGateway: {},
expandRowKeys: [],
};
},
created() {
@ -374,14 +384,21 @@ export default {
methods: {
tableExpandChange(row, e) {
if (e.length != 0) {
console.log("展开数据:", row);
console.log("展开数据e", e);
// console.log("", row);
// console.log("e", e);
if (e.length == 2) {
e.shift();
}
this.expandGateway = row;
this.cardLoading = true;
//
this.getCardList(row.gatewayId);
this.expandRowKeys = e.map((item) => item.gatewayId);
}
},
rowKey(row) {
return row.gatewayId;
},
async getCardList(id) {
try {
this.cardQueryParams.gatewayId = id;
@ -398,6 +415,17 @@ export default {
openCardForm(id, row) {
this.$refs["cardFormRef"].open(id, row, this.expandGateway);
},
async handleCardDelete(row) {
const cardId = row.cardId;
await this.$modal.confirm(
'是否确认删除机床网关信息编号为"' + cardId + '"的数据项?'
);
try {
await GatewayCardInfoApi.deleteGatewayCardInfo(cardId);
await this.getList();
this.$modal.msgSuccess("删除成功");
} catch {}
},
/** 查询列表 */
async getList() {
try {