修改数据来源

This commit is contained in:
guanj
2026-01-08 20:08:26 +08:00
parent e21ae50e51
commit 08afdddc51
4 changed files with 14 additions and 4 deletions

View File

@@ -222,6 +222,7 @@ const sourceChange = (e: any) => {
tableStore.table.params.deviceTypeId = e[0] || '' tableStore.table.params.deviceTypeId = e[0] || ''
tableStore.table.params.engineeringid = e[1] || '' tableStore.table.params.engineeringid = e[1] || ''
tableStore.table.params.projectId = e[2] || '' tableStore.table.params.projectId = e[2] || ''
tableStore.table.params.deviceId = e[3] || ''
} }
} }
} }

View File

@@ -9,7 +9,7 @@
@change="sourceChange" @change="sourceChange"
:options="deviceTreeOptions" :options="deviceTreeOptions"
:show-all-levels="false" :show-all-levels="false"
:props="{ checkStrictly: true, value: 'id', label: 'name' }" :props="{ checkStrictly: true, value: 'id', label: 'name' }"
clearable clearable
></el-cascader> ></el-cascader>
<!-- <el-input maxlength="32" show-word-limit v-model.trim="tableStore.table.params.searchValue" placeholder="请输入设备名称" /> --> <!-- <el-input maxlength="32" show-word-limit v-model.trim="tableStore.table.params.searchValue" placeholder="请输入设备名称" /> -->
@@ -133,6 +133,7 @@ const sourceChange = (e: any) => {
tableStore.table.params.deviceTypeId = e[0] || '' tableStore.table.params.deviceTypeId = e[0] || ''
tableStore.table.params.engineeringid = e[1] || '' tableStore.table.params.engineeringid = e[1] || ''
tableStore.table.params.projectId = e[2] || '' tableStore.table.params.projectId = e[2] || ''
tableStore.table.params.deviceId = e[3] || ''
} }
} }
} }

View File

@@ -313,6 +313,7 @@ const sourceChange = (e: any) => {
tableStore.table.params.deviceTypeId = e[0] || '' tableStore.table.params.deviceTypeId = e[0] || ''
tableStore.table.params.engineeringid = e[1] || '' tableStore.table.params.engineeringid = e[1] || ''
tableStore.table.params.projectId = e[2] || '' tableStore.table.params.projectId = e[2] || ''
tableStore.table.params.deviceId = e[3] || ''
} }
} }

View File

@@ -174,6 +174,10 @@ const open = (e: any) => {
const onSubmit = () => { const onSubmit = () => {
formRef.value.validate(async valid => { formRef.value.validate(async valid => {
if (valid) { if (valid) {
if (logoFile.url == '') {
return ElMessage.error('请上传logo')
}
configStore.value.faviconFile = configStore.value.logoFile configStore.value.faviconFile = configStore.value.logoFile
configStore.value.color = configStore.value.elementUiPrimary[0] configStore.value.color = configStore.value.elementUiPrimary[0]
let form = new FormData() let form = new FormData()
@@ -213,12 +217,18 @@ const onSubmit = () => {
addTheme(form).then(res => { addTheme(form).then(res => {
ElMessage.success('新增成功') ElMessage.success('新增成功')
Cancel() Cancel()
setTimeout(() => {
router.go(0)
}, 500)
}) })
} }
if (title.value == '修改主题') { if (title.value == '修改主题') {
updateTheme(form).then(res => { updateTheme(form).then(res => {
ElMessage.success('修改成功') ElMessage.success('修改成功')
Cancel() Cancel()
setTimeout(() => {
router.go(0)
}, 500)
}) })
} }
} }
@@ -228,9 +238,6 @@ const onSubmit = () => {
const Cancel = () => { const Cancel = () => {
// dialogVisible.value = false // dialogVisible.value = false
emit('Cancels') emit('Cancels')
setTimeout(() => {
router.go(0)
}, 500)
} }
/** /**
* 选择图片上传 * 选择图片上传