mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-15 04:02:47 +00:00
0.0.8
This commit is contained in:
parent
c0d930bae5
commit
d7f6da403f
@ -350,7 +350,7 @@ class ModelGenerator extends BaseGenerator
|
||||
|
||||
$waitReplace = [
|
||||
$config['name'],
|
||||
$config['model'],
|
||||
'\\'. $config['model'],
|
||||
$config['foreign_key'],
|
||||
$config['local_key'],
|
||||
];
|
||||
|
||||
@ -488,6 +488,9 @@ class WebEditGenerator extends BaseGenerator
|
||||
continue;
|
||||
}
|
||||
$content.= 'let '.$column['column_name'].'List = ref([])'.PHP_EOL.'const '.$column['column_name'].'DictList = async () => {'.PHP_EOL.$column['column_name'].'List.value = await (await useDictionary(' ."'".$column['dict_type']."'".')).data.dictionary'.PHP_EOL.'}'.PHP_EOL. $column['column_name'].'DictList();'.PHP_EOL;
|
||||
if ($column['view_type'] == 'radio' || $column['view_type'] == 'select') {
|
||||
$content .= 'watch(() => '.$column['column_name'].'List.value, () => { formData.'.$column['column_name'].' = '.$column['column_name'].'List.value[0].value })'.PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($content))
|
||||
|
||||
@ -110,6 +110,9 @@ class WebEditPageGenerator extends BaseGenerator
|
||||
continue;
|
||||
}
|
||||
$content.= 'let '.$column['column_name'].'List = ref([])'.PHP_EOL.'const '.$column['column_name'].'DictList = async () => {'.PHP_EOL.$column['column_name'].'List.value = await (await useDictionary(' ."'".$column['dict_type']."'".')).data.dictionary'.PHP_EOL.'}'.PHP_EOL. $column['column_name'].'DictList();'.PHP_EOL;
|
||||
if ($column['view_type'] == 'radio' || $column['view_type'] == 'select') {
|
||||
$content .= 'watch(() => '.$column['column_name'].'List.value, () => { formData.'.$column['column_name'].' = '.$column['column_name'].'List.value[0].value })'.PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($content))
|
||||
@ -199,7 +202,7 @@ class WebEditPageGenerator extends BaseGenerator
|
||||
$vmItemValue = 'item.value';
|
||||
$intFieldValue = ['tinyint', 'smallint', 'mediumint', 'int', 'integer', 'bigint'];
|
||||
if (in_array($column['column_type'], $intFieldValue)) {
|
||||
$vmItemValue = 'parseInt(item.value)';
|
||||
$vmItemValue = 'item.value';
|
||||
}
|
||||
$old[] = '{ITEM_VALUE}';
|
||||
$new[] = $vmItemValue;
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { ref, reactive, computed, watch } from 'vue'
|
||||
import { useDictionary } from '@/app/api/dict'
|
||||
import { t } from '@/lang'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { ref, reactive, computed, watch } from 'vue'
|
||||
import { t } from '@/lang'
|
||||
import { useDictionary } from '@/app/api/dict'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
@ -36,6 +36,7 @@ const loading = ref(false)
|
||||
const pageName = route.meta.title
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user