cc 2023-12-26 04:00:50 +00:00
parent 16fd1f9fab
commit b524d7b078
1 changed files with 22 additions and 2 deletions

View File

@ -81,10 +81,30 @@ export default {
const saveFormData = () => {
ruleFormRef.value.validate(async (valid) => {
if (valid) {
const req_databuf = rule_info.encode(state.addForm).finish();
const req_databuf = rule_info.encode({
label:state.addForm.title,
info:state.addForm.description
}).finish();
//
const req_data = req_databuf.slice(0, req_databuf.length);
const res = props.type === 'I' ? await infoApi.addRules(req_data) : await infoApi.editRule(req_data);
const req_databuf1 = post.encode({
cmd: 1,
data: req_data,
}).finish();
//
const req_data1 = req_databuf1.slice(0, req_databuf1.length);
const req_databuf2 = post.encode({
cmd: 5,
data: req_data,
}).finish();
//
const req_data2 = req_databuf2.slice(0, req_databuf2.length);
const res = props.type === 'I' ? await infoApi.postJsonRequest(req_data1) : await infoApi.postJsonRequest(req_data2);
console.log(555, res)
const ret = response.decode(new Uint8Array(res));
if (ret.code == 0) {