* fix: 修改导入图标

* fix: 修改导入图标
This commit is contained in:
qiaochuLei 2023-11-21 10:52:05 +08:00 committed by GitHub
parent f61630df8f
commit c3195997a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 56 deletions

View File

@ -60,7 +60,7 @@ const formItemContext = Form.useInjectFormItemContext()
const props = defineProps({
value: {
type: Array,
default: () => [{}]
default: () => []
}
})

View File

@ -46,11 +46,12 @@
placeholder="请输入字符串长度" :precision="0" :controls="false" :maxlength="64" :disabled="disabled" />
</j-form-item>
<j-form-item v-if="form.configuration.type == 'Bool'" label="位偏移量bit" :name="['configuration', 'bits']" :rules="{
required: true,
message: '请输入0~7之间的正整数',
trigger: 'blur',
}">
<j-form-item v-if="form.configuration.type == 'Bool'" label="位偏移量bit" :name="['configuration', 'bits']"
:rules="{
required: true,
message: '请输入0~7之间的正整数',
trigger: 'blur',
}">
<j-input-number type="number" style="width: 100%" addon-after="" v-model:value="form.configuration.bits"
placeholder="请输入位偏移量" :precision="0" :min="0" :max="7" :controls="false" :maxlength="2" />
</j-form-item>
@ -116,6 +117,9 @@
<j-checkbox value="changedOnly">只推送变化的数据</j-checkbox>
</j-checkbox-group>
</j-form-item>
<j-form-item label="说明" name="description">
<j-textarea placeholder="请输入说明" v-model:value="form.description" :maxlength="200" :rows="3" showCount />
</j-form-item>
</j-form>
<j-modal title="采集频率" :visible="intervalRef.visible" @cancel="handleCancelInterval" @ok="handleInterval">
<j-form ref="formRef2" name="virtual-form" layout="vertical" :model="intervalRef">
@ -127,6 +131,7 @@
</j-form-item>
</j-form>
</j-modal>
<template #footer>
<j-button key="back" @click="handleCancel">取消</j-button>
<PermissionButton key="submit" type="primary" :loading="loading" @click="handleOk" style="margin-left: 8px"
@ -189,7 +194,7 @@ const form = ref<any>({
type: undefined,
interval: 3000,
areaNumber: undefined,
bytes:undefined,
bytes: undefined,
terms: []
},
accessModes: [],
@ -268,19 +273,19 @@ const handleCancelInterval = () => {
const handleOk = async () => {
const res:any = await formRef.value?.validate();
const res: any = await formRef.value?.validate();
const params = {
...res,
configuration:{
configuration: {
...res.configuration,
bytes:res.configuration.bytes || form.value.configuration.bytes
bytes: res.configuration.bytes || form.value.configuration.bytes
},
inheritBreaker: true,
pointKey: props.data.pointKey || randomString(9),
provider:props.data.provider,
collectorId:props.data.collectorId,
accessModes:res?.accessModes.filter((item:any)=>item)
provider: props.data.provider,
collectorId: props.data.collectorId,
accessModes: res?.accessModes.filter((item: any) => item)
}
loading.value = true;
const response = !props.data.id
@ -296,13 +301,15 @@ const handleCancel = () => {
const Area = (_: any, value: any): Promise<any> =>
new Promise(async (resolve, reject) => {
console.log('value',value)
if(value.length === 0){
if (!value) {
return resolve('')
}else if(value.length === 1){
}
if (value?.length === 0) {
return resolve('')
} else if (value?.length === 1) {
return value[0].value && value[0].termType ? resolve('') : reject('请配置点位死区');
}else{
if(value[0].column === 'currentValue'){
} else {
if (value?.[0].column === 'currentValue') {
// value.forEach((item:any) => {
// if(item.termType && item.value){
// return resolve('')
@ -310,52 +317,54 @@ const Area = (_: any, value: any): Promise<any> =>
// return reject('')
// }
// });
const pass = value.every((item:any)=>item.termType && item.value)
return pass ? resolve(''):reject('请配置点位死区')
}else{
value.forEach((item:any) => {
if(item.column ===`this['currentValue'] - this['lastValue']*init/100`){
const pass = value.every((item: any) => item.termType && item.value)
return pass ? resolve('') : reject('请配置点位死区')
} else {
value.forEach((item: any) => {
if (item.column === `this['currentValue'] - this['lastValue']*init/100`) {
return reject('请配置点位死区')
}else{
} else {
return resolve('')
}
});
}
}
});
onMounted(() => {
form.value.features = props.data.features?.map((item:any)=>item.value)
form.value.features = props.data.features?.map((item: any) => item.value)
form.value.configuration.bytes = props.data.configuration?.bytes
if(props.data.accessModes?.length!==0){
form.value.accessModes = props.data.accessModes?.map((item:any)=>item.value)
if (props.data.accessModes?.length !== 0) {
form.value.accessModes = props.data.accessModes?.map((item: any) => item.value)
}
console.log(props.data.configuration, 123)
})
watch(
() => dataTypesList.value,
(val: any[]) => {
if (val) {
const result: any = dataTypesList.value.find(
(item: any) => item.id == form.value.configuration.type,
);
if(result) {
// console.log('result',result)
disabled.value = (result && result.length !== 0);
}
}
},
() => dataTypesList.value,
(val: any[]) => {
if (val) {
const result: any = dataTypesList.value.find(
(item: any) => item.id == form.value.configuration.type,
);
if (result) {
// console.log('result',result)
disabled.value = (result && result.length !== 0);
}
}
},
);
watch(
() => form.value.configuration.type,
(val) => {
if (val !== 'Bool') {
form.value.configuration.bits = 0;
}
},
{ deep: true },
() => form.value.configuration.type,
(val) => {
if (val !== 'Bool') {
form.value.configuration.bits = 0;
}
},
{ deep: true },
);
</script>

View File

@ -18,16 +18,16 @@
</div>
</div>
<div class="importing-status" v-if="importStatus == 'importing'">
<loading-outlined />
<AIcon type="LoadingOutlined" />
正在导入
</div>
<div class="column" v-if="importStatus != 'wait'">
<p>
<check-outlined style="color: #00a4ff" />导入成功 总数量
<AIcon style="color: #00a4ff" type="CheckOutlined"/>导入成功 总数量
{{ successNumber }}
</p>
<span v-if="failNumber">
<close-outlined style="color: #e50012" />导入失败 总数量
<AIcon style="color: #e50012" type="CloseOutlined"/>导入失败 总数量
{{ failNumber }}
</span>
</div>
@ -44,12 +44,6 @@
</template>
<script lang="ts" setup>
import {
ArrowLeftOutlined,
CheckOutlined,
CloseOutlined,
LoadingOutlined,
} from '@ant-design/icons-vue';
import { FILE_UPLOAD } from '@/api/comm';
import { TOKEN_KEY, BASE_API_PATH } from '@/utils/variable';
import { LocalStore, onlyMessage } from '@/utils/comm';