main
parent
16fd1f9fab
commit
b524d7b078
|
@ -81,10 +81,30 @@ export default {
|
||||||
const saveFormData = () => {
|
const saveFormData = () => {
|
||||||
ruleFormRef.value.validate(async (valid) => {
|
ruleFormRef.value.validate(async (valid) => {
|
||||||
if (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 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)
|
console.log(555, res)
|
||||||
const ret = response.decode(new Uint8Array(res));
|
const ret = response.decode(new Uint8Array(res));
|
||||||
if (ret.code == 0) {
|
if (ret.code == 0) {
|
||||||
|
|
Loading…
Reference in New Issue