Commit 6b79c83d authored by xuke's avatar xuke

rules

parents b9a17161 44482294
......@@ -93,11 +93,11 @@ const handleSearch = () => {
};
// 重置按钮
const handleReset = () => {
formInline.keyWord = ""
config.supplyType = ["0", "1", "2", "3", "4"]
getEnergyData()
}
// const handleReset = () => {
// formInline.keyWord = ""
// config.supplyType = ["0", "1", "2", "3", "4"]
// getEnergyData()
// }
const timeFormat = (time) => {
var time = new Date(time);
......
......@@ -17,7 +17,7 @@ const dataBackup = ref([]);
const reviseWindowOpen = ref(false) // 修改按钮弹窗状态
const bindWindowOpen = ref(false) // 绑定按钮弹窗状态
const addWindowOpen = ref(false) // 新增按钮弹窗状态
const dependentSub = ref({}) // 修改和绑定弹窗数据依赖
const dependentSub = ref('') // 修改和绑定弹窗数据依赖
const tableHeaderClass = data => { // 表头样式
return 'table-header-class'
}
......@@ -194,6 +194,7 @@ function getOrganizationStructure() {
ElMessage.error('接口异常,获取数据失败.')
})
} // 获取组织结构
function resetSearch(){
isAutoSearchKey.value = ''
supplySearchKey.value = ''
......
......@@ -94,7 +94,7 @@ const rules = reactive({
{ pattern: /^(\d{1,11})(\.[0-9]{1,4})?$/, "message": "风速必须是1-11位实数", trigger: "blur" }
],
illumination: [
{ pattern: /^(\d{1,11})(\.[0-9]{1,4})?$/, "message": "光照必须是1-11位实数", trigger: "blur" }
{ pattern: /^(\d{1,2})?$/, "message": "光照必须是1-2位实数", trigger: "blur" }
],
sort: [
{ pattern: /^(\d{1,11})$/, "message": "排序必须是1-11位正整数", trigger: "blur" }
......@@ -155,7 +155,7 @@ const rules = reactive({
<el-col :span="8" class="content-col-label">光照:</el-col>
<el-col :span="16" class="content-col-value">
<el-form-item prop="illumination" style="padding: 0;margin: 0;">
<el-input :input-style="inputStyle" maxlength="11" v-model="addData.illumination"
<el-input :input-style="inputStyle" maxlength="2" v-model="addData.illumination"
style="width: 510px" />
</el-form-item>
</el-col>
......
......@@ -68,7 +68,10 @@ function onSubmit() {
updateNullFields: ''
})
})
emit('onConfirm', bindData.value)
bindData.value.isAuto = bindData.value.isAuto === '自动模式' ? true : false;
bindData.value.isFixed = bindData.value.isFixed === '固定模式' ? true : false;
bindData.value.updateNullFields = ""
emit('onConfirm', bindData.value)gi
}else {
ElMessage.error('请选择供热站')
}
......@@ -110,6 +113,7 @@ async function getTransfer(supplyId, isAvailable = true) {
function onOpen() {
bindData.value.transfers = []
loadingInstance = ElLoading.service({target: '#bind-dialog'})
selectedTransfer.value.length = 0 // 清空已选择的换热站
transferData.value.length = 0 // 清空显示的换热站
......
......@@ -23,7 +23,24 @@ const emit = defineEmits({
return true
}
})
const reviseData = ref({})
const reviseData = ref({
allowPagingId: "",
temperature: "",
wind: "",
illumination: "",
diffPercentage: "",
timeoutMin: "",
tempRegulation: "",
sort: "",
customizeName: "",
supplyName: "",
customizeId: "",
isFixed: "",
isAuto: "",
supplyId: "",
operateTime: "",
updateNullFields: ''
})
const formRef = ref()
......@@ -36,7 +53,7 @@ const rules = reactive({
{pattern: /^(\d{1,11})(\.[0-9]{1,4})?$/, "message": "风速必须是1-11位实数", trigger: "blur"}
],
illumination: [
{pattern: /^(\d{1,11})(\.[0-9]{1,4})?$/, "message": "光照必须是1-11位实数", trigger: "blur"}
{pattern: /^(\d{1,2})?$/, "message": "光照必须是1-11位实数", trigger: "blur"}
],
sort: [
{pattern: /^(\d{1,11})$/, "message": "排序必须是1-11位正整数", trigger: "blur"}
......@@ -50,12 +67,16 @@ const rules = reactive({
]
});
watchEffect(() => {
<<<<<<< HEAD
// reviseData.value = {...props.data}
props.data.transfers = []
props.data.updateNullFields = ''
reviseData.value = cloneDeep(props.data) // 深拷贝数据
console.log("props.data===>", props.data);
console.log(reviseData.value);
=======
reviseData.value = props.data // 深拷贝数据
>>>>>>> 44482294a0f0e141cfad6fc71ae5bd19c87d6aed
})
const inputStyle = {
color: 'black',
......@@ -74,18 +95,20 @@ const switchingisAuto = computed({
}
}) // 可写计算属性,手动、自动模式切换
function onOpen() {
formRef.value.resetFields()
reviseData.value.updateNullFields = ""
}
async function handleConfirm() {
if (reviseData.value.hasOwnProperty('supplyId')) {
if (reviseData.value.supplyId) {
getTransferInterface({
customizeId: reviseData.value.customizeId,
supplyId: reviseData.value.supplyId
}).then(result => {
function handleConfirm() {
reviseData.value.transfers = []
formRef.value.validate(async valid => {
if (valid) {
if (reviseData.value.supplyId !== undefined && reviseData.value.supplyId !== '') {
const result = await getTransferInterface({
customizeId: reviseData.value.customizeId,
supplyId: reviseData.value.supplyId
})
for (let item of result.data) {
if(item.selected.toLowerCase() === 'true'){
if (item.selected.toLowerCase() === 'true') {
reviseData.value.transfers.push(
{
customizeId: reviseData.value.customizeId,
......@@ -95,17 +118,27 @@ async function handleConfirm() {
)
}
}
<<<<<<< HEAD
formRef.value.validate(valid => {
if (valid) {
emit('onConfirm', reviseData.value)
}
})
})
=======
} else {
delete reviseData.value.supplyId
}
reviseData.value.isAuto = reviseData.value.isAuto === '自动模式' ? true : false;
reviseData.value.isFixed = reviseData.value.isFixed === '固定模式' ? true : false;
console.log('修改数据', reviseData.value)
emit('onConfirm', reviseData.value)
>>>>>>> 44482294a0f0e141cfad6fc71ae5bd19c87d6aed
}
}
})
}
<<<<<<< HEAD
// 重置表单
const reset = () => {
const form = unref(formRef)
......@@ -113,6 +146,9 @@ const reset = () => {
}
function onClose(){
reset()
=======
function onClose() {
>>>>>>> 44482294a0f0e141cfad6fc71ae5bd19c87d6aed
emit('onCancel')
}
......@@ -160,7 +196,7 @@ function onClose(){
<el-col :span="8" class="content-col-label">光照:</el-col>
<el-col :span="16" class="content-col-value">
<el-form-item prop="illumination" style="padding: 0;margin: 0;">
<el-input :input-style="inputStyle" maxlength="11" v-model="reviseData.illumination"
<el-input :input-style="inputStyle" maxlength="2" v-model="reviseData.illumination"
style="width: 510px"/>
</el-form-item>
</el-col>
......@@ -209,7 +245,7 @@ function onClose(){
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleConfirm">保存</el-button>
<el-button type="primary" @click="emit('onCancel')">关闭</el-button>
<el-button type="primary" @click="onClose">关闭</el-button>
</div>
</template>
</el-dialog>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment