mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
fix(projects): 修改强退在线设备接口
This commit is contained in:
@ -3,12 +3,13 @@ import { computed, reactive, watch } from 'vue';
|
||||
import { NTag } from 'naive-ui';
|
||||
import { fetchCreateDictData, fetchUpdateDictData } from '@/service/api/system/dict-data';
|
||||
import { useFormRules, useNaiveForm } from '@/hooks/common/form';
|
||||
import { useDict } from '@/hooks/business/dict';
|
||||
import { $t } from '@/locales';
|
||||
|
||||
defineOptions({
|
||||
name: 'DictDataOperateDrawer'
|
||||
});
|
||||
|
||||
useDict('sys_yes_no');
|
||||
interface Props {
|
||||
/** the type of operation */
|
||||
operateType: NaiveUI.TableOperateType;
|
||||
@ -63,7 +64,8 @@ function createDefaultModel(): Model {
|
||||
dictType: props.dictType,
|
||||
cssClass: '',
|
||||
listClass: null,
|
||||
remark: ''
|
||||
remark: '',
|
||||
isDefault: 'N'
|
||||
};
|
||||
}
|
||||
|
||||
@ -95,7 +97,7 @@ async function handleSubmit() {
|
||||
|
||||
// request
|
||||
if (props.operateType === 'add') {
|
||||
const { dictSort, dictLabel, dictValue, dictType, cssClass, listClass, remark } = model;
|
||||
const { dictSort, dictLabel, dictValue, dictType, cssClass, listClass, isDefault, remark } = model;
|
||||
const { error } = await fetchCreateDictData({
|
||||
dictSort,
|
||||
dictLabel,
|
||||
@ -103,13 +105,14 @@ async function handleSubmit() {
|
||||
dictType,
|
||||
cssClass,
|
||||
listClass,
|
||||
isDefault,
|
||||
remark
|
||||
});
|
||||
if (error) return;
|
||||
}
|
||||
|
||||
if (props.operateType === 'edit') {
|
||||
const { dictCode, dictSort, dictLabel, dictValue, dictType, cssClass, listClass, remark } = model;
|
||||
const { dictCode, dictSort, dictLabel, dictValue, dictType, cssClass, listClass, isDefault, remark } = model;
|
||||
const { error } = await fetchUpdateDictData({
|
||||
dictCode,
|
||||
dictSort,
|
||||
@ -118,6 +121,7 @@ async function handleSubmit() {
|
||||
dictType,
|
||||
cssClass,
|
||||
listClass,
|
||||
isDefault,
|
||||
remark
|
||||
});
|
||||
if (error) return;
|
||||
@ -179,6 +183,9 @@ function renderTagLabel(option: { label: string; value: string }) {
|
||||
<NFormItem :label="$t('page.system.dict.data.dictSort')" path="dictSort">
|
||||
<NInputNumber v-model:value="model.dictSort" :placeholder="$t('page.system.dict.form.dictSort.required')" />
|
||||
</NFormItem>
|
||||
<NFormItem :label="$t('page.system.dict.data.isDefault')" path="isDefault">
|
||||
<DictRadio v-model:value="model.isDefault" dict-code="sys_yes_no" />
|
||||
</NFormItem>
|
||||
<NFormItem :label="$t('page.system.dict.data.remark')" path="remark">
|
||||
<NInput
|
||||
v-model:value="model.remark"
|
||||
|
@ -56,7 +56,7 @@ function createDefaultModel(): Model {
|
||||
nickName: '',
|
||||
email: '',
|
||||
phonenumber: '',
|
||||
sex: '',
|
||||
sex: '0',
|
||||
password: '',
|
||||
status: '0',
|
||||
roleIds: [],
|
||||
|
Reference in New Issue
Block a user