隐藏仪器与解绑仪器

master
382696293@qq.com 2 years ago
parent dfc896f341
commit f7ba814037

@ -60,7 +60,7 @@ public interface WxInstrumentMapper {
* @param ids
* @return
*/
public int deleteWxInstrumentByIds(Long[] ids);
public int deleteWxInstrumentByIds(Long id);
}

@ -233,10 +233,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from wx_instrument where id = #{id}
</delete>
<delete id="deleteWxInstrumentByIds" parameterType="String">
UPDATE wx_instrument SET status = 1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
<delete id="deleteWxInstrumentByIds" parameterType="Long">
UPDATE wx_instrument SET status = IF(status = 1, 0, 1) where id = #{id}
</delete>
</mapper>

@ -120,8 +120,8 @@ public class WxInstrumentController extends BaseController {
*/
@RequiresPermissions("system:instrument:remove")
@Log(title = "仪器列", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(wxInstrumentService.deleteWxInstrumentByIds(ids));
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id) {
return toAjax(wxInstrumentService.deleteWxInstrumentByIds(id));
}
}

@ -58,7 +58,7 @@ public interface IWxInstrumentService {
* @param ids
* @return
*/
public int deleteWxInstrumentByIds(Long[] ids);
public int deleteWxInstrumentByIds(Long id);
/**
*

@ -80,8 +80,8 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
* @return
*/
@Override
public int deleteWxInstrumentByIds(Long[] ids) {
return wxInstrumentMapper.deleteWxInstrumentByIds(ids);
public int deleteWxInstrumentByIds(Long id) {
return wxInstrumentMapper.deleteWxInstrumentByIds(id);
}
/**

@ -128,8 +128,18 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:instrument:remove']"
v-if="scope.row.status == 0"
>隐藏
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:instrument:remove']"
v-if="scope.row.status == 1"
>解除隐藏
</el-button>
</template>
</el-table-column>
</el-table>
@ -772,7 +782,7 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
const ids = row.id;
this.$modal.confirm('是否确认隐藏仪器列编号为"' + ids + '"的数据项?').then(function () {
return delInstrument(ids);
}).then(() => {

Loading…
Cancel
Save