Compare commits

..

No commits in common. "a4e2b8c0a2ab71cc1733aaae077208c0888c2f35" and "b524d7b078d6564bd4668a8eca83aa50c1db212f" have entirely different histories.

3 changed files with 23 additions and 27 deletions

View File

@ -135,7 +135,7 @@ const infoApi = {
return getRequest('/rule', params); return getRequest('/rule', params);
}, },
// //
postRules(params) { addRules(params) {
return postJsonRequest('/rule', params) return postJsonRequest('/rule', params)
}, },
}; };

View File

@ -11,17 +11,17 @@
:rules="rules" :rules="rules"
ref="ruleFormRef" ref="ruleFormRef"
> >
<el-form-item label="规则标题:" prop="lable"> <el-form-item label="规则标题:" prop="title">
<el-input <el-input
v-model="addForm.lable" v-model="addForm.title"
placeholder="请输入规则标题" placeholder="请输入规则标题"
clearable clearable
:disabled="type === 'I' ? false: true" :disabled="type === 'I' ? false: true"
/> />
</el-form-item> </el-form-item>
<el-form-item label="规则描述:" prop="info"> <el-form-item label="规则描述:" prop="description">
<el-input <el-input
v-model="addForm.info" v-model="addForm.description"
placeholder="请输入规则描述" placeholder="请输入规则描述"
clearable clearable
/> />
@ -47,14 +47,14 @@ export default {
const ruleFormRef = ref(null); const ruleFormRef = ref(null);
const state = reactive({ const state = reactive({
addForm: { addForm: {
lable: '', title: '',
info: '' description: ''
}, },
rules: { rules: {
lable: [ title: [
{ required: true, message: "请输入规则标题", trigger: "blur" } { required: true, message: "请输入规则标题", trigger: "blur" }
], ],
info: [ description: [
{ required: true, message: "请输入规则描述", trigger: "blur" } { required: true, message: "请输入规则描述", trigger: "blur" }
] ]
}, },
@ -107,7 +107,6 @@ export default {
const res = props.type === 'I' ? await infoApi.postJsonRequest(req_data1) : await infoApi.postJsonRequest(req_data2); 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));
console.log(555, ret)
if (ret.code == 0) { if (ret.code == 0) {
// //
console.log(new TextDecoder().decode(ret.data)); console.log(new TextDecoder().decode(ret.data));

View File

@ -12,18 +12,18 @@
stripe stripe
:header-cell-style="{ background: '#F6F7FC' }" :header-cell-style="{ background: '#F6F7FC' }"
> >
<el-table-column type="index" label="序号" width="100" align="center" /> <el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column <el-table-column
prop="lable" prop="title"
label="标题" label="标题"
width="300" width="200"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <el-table-column
prop="info" prop="description"
label="描述" label="描述"
width="500" width="200"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
/> />
@ -37,7 +37,6 @@
</el-button> </el-button>
<el-switch <el-switch
v-model="scope.row.enable" v-model="scope.row.enable"
class="l10-r10"
inline-prompt inline-prompt
active-text="启用" active-text="启用"
inactive-text="停用" inactive-text="停用"
@ -81,8 +80,8 @@ export default {
const state = reactive({ const state = reactive({
tableData: [], tableData: [],
formData: { formData: {
lable: '', title: '',
info: '' description: ''
}, },
dialogVisible: false, dialogVisible: false,
type: 'I' type: 'I'
@ -98,7 +97,7 @@ export default {
if (ret.code == 0) { if (ret.code == 0) {
// //
state.tableData = rule.decode(ret.data).rule; // state.tableData = rule.decode(ret.data);
console.log(rule.decode(ret.data)); console.log(rule.decode(ret.data));
/** /**
* 组长看这里 * 组长看这里
@ -136,7 +135,7 @@ export default {
// //
const req_data1 = req_databuf1.slice(0, req_databuf1.length); const req_data1 = req_databuf1.slice(0, req_databuf1.length);
const res = await infoApi.postRules(req_data1); const res = await infoApi.postJsonRequest(req_data1);
const ret = response.decode(new Uint8Array(res)); const ret = response.decode(new Uint8Array(res));
if (ret.code == 0) { if (ret.code == 0) {
ElMessage.success(res.msg || "请求成功"); ElMessage.success(res.msg || "请求成功");
@ -153,8 +152,8 @@ export default {
const addData = () => { const addData = () => {
// //
state.formData = { state.formData = {
lable: '', title: '',
info: '' description: ''
} }
state.type = 'I'; state.type = 'I';
state.dialogVisible = true; state.dialogVisible = true;
@ -180,7 +179,9 @@ export default {
}).finish(); }).finish();
// //
const req_data2 = req_databuf2.slice(0, req_databuf2.length); const req_data2 = req_databuf2.slice(0, req_databuf2.length);
const res = item.enable==='启动' ? await infoApi.postRules(req_data2) : await infoApi.postRules(req_data1);
const res = item.enable==='启动' ? await infoApi.postJsonRequest(req_data2) : await infoApi.postJsonRequest(req_data1);
const ret = response.decode(new Uint8Array(res)); const ret = response.decode(new Uint8Array(res));
if (ret.code == 0) { if (ret.code == 0) {
ElMessage.success(res.msg || "更新成功"); ElMessage.success(res.msg || "更新成功");
@ -203,7 +204,6 @@ export default {
delData, delData,
getTableData, getTableData,
addData, addData,
changeStatus,
dialogSuccess, dialogSuccess,
dialogClose dialogClose
}; };
@ -219,7 +219,4 @@ export default {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
.l10-r10 {
margin: 0 10px;
}
</style> </style>