修改 dialog 默认全屏
This commit is contained in:
parent
693b8a60e9
commit
457c955a19
|
|
@ -8,7 +8,7 @@ const slots = useSlots()
|
|||
const props = defineProps({
|
||||
modelValue: propTypes.bool.def(false),
|
||||
title: propTypes.string.def('Dialog'),
|
||||
fullscreen: propTypes.bool.def(true),
|
||||
fullscreen: propTypes.bool.def(false),
|
||||
width: propTypes.oneOfType([String, Number]).def('40%'),
|
||||
scroll: propTypes.bool.def(false), // 是否开启滚动条。如果是的话,按照 maxHeight 设置最大高度
|
||||
maxHeight: propTypes.oneOfType([String, Number]).def('400px')
|
||||
|
|
@ -78,7 +78,6 @@ const dialogStyle = computed(() => {
|
|||
class="absolute right-15px top-[50%] h-54px flex translate-y-[-50%] items-center justify-between"
|
||||
>
|
||||
<Icon
|
||||
v-if="fullscreen"
|
||||
class="is-hover mr-10px cursor-pointer"
|
||||
:icon="isFullscreen ? 'radix-icons:exit-full-screen' : 'radix-icons:enter-full-screen'"
|
||||
color="var(--el-color-info)"
|
||||
|
|
|
|||
|
|
@ -259,7 +259,6 @@ export default defineComponent({
|
|||
|
||||
if(this.cellInfo.style.shape.href){
|
||||
convertImageToBase64(this.cellInfo.style.shape.href).then((res)=>{
|
||||
console.log("convertImageToBase64",this.cellInfo.style.shape.href,res)
|
||||
// @ts-ignore
|
||||
this.hrefBase64 = res
|
||||
// this.cellInfo.style.shape.hrefBase64 = res
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<div>
|
||||
<DraftDesign ref="draftDesignRef" @save="submitForm"/>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="8" :xs="24">
|
||||
<el-form-item label="编码" prop="code">
|
||||
|
|
@ -26,8 +23,12 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div>
|
||||
<DraftDesign ref="draftDesignRef" @save="submitForm"/>
|
||||
</div>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="6" :xs="24">
|
||||
<el-col :span="6" :xs="24" v-if="false">
|
||||
<el-form-item label="语言标识" prop="locale">
|
||||
<el-select v-model="formData.locale" placeholder="请选择语言标识">
|
||||
<el-option
|
||||
|
|
@ -64,6 +65,7 @@
|
|||
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { DraftDesignDataApi, DraftDesignDataVO } from '@/api/oms/draftdesigndata'
|
||||
import DraftDesign from "@/components/DraftDesign/index.vue";
|
||||
import router from "@/router";
|
||||
|
||||
/** 稿件模板数据 表单 */
|
||||
defineOptions({ name: 'DraftDesignDataForm' })
|
||||
|
|
@ -158,9 +160,17 @@ const submitForm = async (detailsData) => {
|
|||
data.details = JSON.stringify(detailsData)
|
||||
console.log("data",data)
|
||||
if (formType.value === 'create') {
|
||||
await DraftDesignDataApi.createDraftDesignData(data)
|
||||
const resId = await DraftDesignDataApi.createDraftDesignData(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
resetForm()
|
||||
if(copyData.value){
|
||||
console.log("resId",resId)
|
||||
await router.push({path: '/base/oms/draftdesigndata/detials',query: {
|
||||
id: resId
|
||||
}})
|
||||
}else {
|
||||
resetForm()
|
||||
}
|
||||
|
||||
} else {
|
||||
await DraftDesignDataApi.updateDraftDesignData(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
clearable
|
||||
placeholder="请输入名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="value">
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="formData.type">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.OMS_PRODUCT_CARE_ITEM_TYPE)"
|
||||
|
|
@ -255,44 +255,48 @@ defineExpose({open}) // 提供 open 方法,用于打开弹窗
|
|||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
const submitForm = () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as ProductCareItemVO
|
||||
let countInfo = {};
|
||||
for (let i = 0; i < that.langList.length; i++) {
|
||||
const l = that.langList[i].locale
|
||||
if (!l) {
|
||||
message.error(`第${i + 1}行语言不能为空`)
|
||||
return;
|
||||
formRef.value.validate().then(async ()=>{
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as ProductCareItemVO
|
||||
let countInfo = {};
|
||||
for (let i = 0; i < that.langList.length; i++) {
|
||||
const l = that.langList[i].locale
|
||||
if (!l) {
|
||||
message.error(`第${i + 1}行语言不能为空`)
|
||||
return;
|
||||
}
|
||||
if (!that.langList[i].value) {
|
||||
message.error(`第${i + 1}行翻译内容不能为空`)
|
||||
return;
|
||||
}
|
||||
if (countInfo[l]) {
|
||||
message.error(`${l} 翻译内容重复`)
|
||||
return;
|
||||
}
|
||||
countInfo[l] = 1;
|
||||
}
|
||||
if (!that.langList[i].value) {
|
||||
message.error(`第${i + 1}行翻译内容不能为空`)
|
||||
return;
|
||||
data.langMapping = JSON.stringify(that.langList)
|
||||
if (formType.value === 'create') {
|
||||
await ProductCareItemApi.createProductCareItem(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await ProductCareItemApi.updateProductCareItem(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
if (countInfo[l]) {
|
||||
message.error(`${l} 翻译内容重复`)
|
||||
return;
|
||||
}
|
||||
countInfo[l] = 1;
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
data.langMapping = JSON.stringify(that.langList)
|
||||
if (formType.value === 'create') {
|
||||
await ProductCareItemApi.createProductCareItem(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await ProductCareItemApi.updateProductCareItem(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}).catch(()=>{
|
||||
message.error('请填写必填项')
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue