up.
This commit is contained in:
parent
3da7dee576
commit
fc409477d6
@ -41,6 +41,8 @@ class ConfigController extends BaseController
|
||||
'group'=> '',
|
||||
'bind'=>''
|
||||
]);
|
||||
$data['v_bind'] = $this->request->post('vBind');
|
||||
|
||||
$user = new SysConfig();
|
||||
$user->save($data);
|
||||
|
||||
@ -49,7 +51,7 @@ class ConfigController extends BaseController
|
||||
|
||||
public function update()
|
||||
{
|
||||
$data = $this->request->post([
|
||||
$data = $this->request->put([
|
||||
'id' => 0,
|
||||
'title' => '',
|
||||
'value' => '',
|
||||
@ -59,8 +61,9 @@ class ConfigController extends BaseController
|
||||
'name' => '',
|
||||
'comments' => '',
|
||||
'group'=> '',
|
||||
'bind'=>''
|
||||
]);
|
||||
$data['v_bind'] = $this->request->put('vBind');
|
||||
|
||||
$user = SysConfig::findOrFail($data['id']);
|
||||
$user->save($data);
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ export function strToOption(type: string, option: string): any {
|
||||
case 'text':
|
||||
case 'textarea':
|
||||
case 'checkbox':
|
||||
case 'radio':
|
||||
default:
|
||||
if (option) {
|
||||
return JSON.parse(option);
|
||||
|
||||
@ -37,6 +37,15 @@
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
</template>
|
||||
<template v-else-if="props.type === 'radio'">
|
||||
<el-checkbox-group v-model="dataValue" v-bind="dataBind">
|
||||
<template v-if="dataOptions">
|
||||
<el-checkbox v-for="item in dataOptions" :label="item.label" :value="item.value" />
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
</el-form-item>
|
||||
</template>
|
||||
@ -57,7 +66,7 @@ const dataValue = ref<any>();
|
||||
const dataOptions = ref<any>()
|
||||
const dataBind = ref<any>({})
|
||||
onMounted(() => {
|
||||
dataBind.value = strToBind(props.type, props.bind);
|
||||
dataBind.value = props.vBind ? strToBind(props.type, props.vBind) : {};
|
||||
dataValue.value = strToValue(props.type, props.value);
|
||||
dataOptions.value = strToOption(props.type, props.options);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user