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

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) { default List<GatewayCardParamsDO> selectList(String cardId) {
return selectList(new LambdaQueryWrapperX<GatewayCardParamsDO>() return selectList(new LambdaQueryWrapperX<GatewayCardParamsDO>()
.eqIfPresent(GatewayCardParamsDO::getCardId, cardId) .eqIfPresent(GatewayCardParamsDO::getCardId, cardId)
.orderByAsc(GatewayCardParamsDO::getCreateTime) .orderByAsc(GatewayCardParamsDO::getChannelName)
); );
} }
} }

View File

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

View File

@ -101,6 +101,8 @@
:data="list" :data="list"
:stripe="true" :stripe="true"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
:row-key="rowKey"
:expand-row-keys="expandRowKeys"
@expand-change="tableExpandChange" @expand-change="tableExpandChange"
> >
<el-table-column <el-table-column
@ -169,6 +171,13 @@
@click="openCardForm(scope.row.cardId,scope.row)" @click="openCardForm(scope.row.cardId,scope.row)"
v-hasPermi="['imt:gateway-info:create']" v-hasPermi="['imt:gateway-info:create']"
>采集卡信息修改</el-button> >采集卡信息修改</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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -366,6 +375,7 @@ export default {
], ],
cardLoading: false, cardLoading: false,
expandGateway: {}, expandGateway: {},
expandRowKeys: [],
}; };
}, },
created() { created() {
@ -374,14 +384,21 @@ export default {
methods: { methods: {
tableExpandChange(row, e) { tableExpandChange(row, e) {
if (e.length != 0) { if (e.length != 0) {
console.log("展开数据:", row); // console.log("", row);
console.log("展开数据e", e); // console.log("e", e);
if (e.length == 2) {
e.shift();
}
this.expandGateway = row; this.expandGateway = row;
this.cardLoading = true; this.cardLoading = true;
// //
this.getCardList(row.gatewayId); this.getCardList(row.gatewayId);
this.expandRowKeys = e.map((item) => item.gatewayId);
} }
}, },
rowKey(row) {
return row.gatewayId;
},
async getCardList(id) { async getCardList(id) {
try { try {
this.cardQueryParams.gatewayId = id; this.cardQueryParams.gatewayId = id;
@ -398,6 +415,17 @@ export default {
openCardForm(id, row) { openCardForm(id, row) {
this.$refs["cardFormRef"].open(id, row, this.expandGateway); 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() { async getList() {
try { try {