ljlong_2630 8 months ago
parent
commit
a994b7ec08
  1. 4
      src/components/Descriptions/src/Descriptions.vue
  2. 1
      src/components/UploadFile/src/UploadImg.vue
  3. 11
      src/views/eam/device/problemSolving/index.vue
  4. 11
      src/views/eam/item/replaceItemDes/index.vue
  5. 17
      src/views/eam/item/replaceItemDes/replaceItemDes.data.ts

4
src/components/Descriptions/src/Descriptions.vue

@ -15,7 +15,7 @@ const mobile = computed(() => appStore.getMobile)
const attrs = useAttrs()
const slots = useSlots()
const height = ref('200px')
const height = ref('83px')
const isShow = ref(false)
@ -73,7 +73,7 @@ const toggleClick = () => {
}
const showAll = () =>{
if(isShow.value){
height.value ='200px'
height.value ='83px'
}else{
height.value ='auto'
}

1
src/components/UploadFile/src/UploadImg.vue

@ -84,6 +84,7 @@ const props = defineProps({
width: propTypes.string.def('150px'), // ==> 150px
borderradius: propTypes.string.def('8px') // ==> 8px
})
debugger
const { t } = useI18n() //
const message = useMessage() //
// id

11
src/views/eam/device/problemSolving/index.vue

@ -176,17 +176,6 @@ const openForm = (type: string, row?: any) => {
// form
const formsSuccess = async (formType, data) => {
var isHave = ProblemSolving.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'
})
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return
}
}
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
data.filePathList = []
for (let i = 0; i < data.filePathListView.length; i++) {
data.filePathList.push(data.filePathListView[i].url)

11
src/views/eam/item/replaceItemDes/index.vue

@ -124,13 +124,20 @@
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
if (row&&row.filePathList && row.filePathList.length > 0) {
row.filePathListView = row.filePathList.map((item) => {
return {
name: item,
url: item
}
})
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType, data) => {
if (data.expireTime == 0) data.expireTime = null;
data.filePathList = data.filePathList.map(item=>item.url)
data.filePathList = data.filePathListView.map(item=>item.url)
if (formType === 'create') {
await ReplaceItemDesApi.createReplaceItemDes(data)
message.success(t('common.createSuccess'))

17
src/views/eam/item/replaceItemDes/replaceItemDes.data.ts

@ -7,7 +7,7 @@ import * as ItemApi from '@/api/eam/basic/item'
// 表单校验
export const ReplaceItemDesRules = reactive({
number: [required],
filePathList: [required],
filePathListView: [required],
})
export const ReplaceItemDes = useCrudSchemas(reactive<CrudSchema[]>([
@ -34,16 +34,31 @@ export const ReplaceItemDes = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '文件',
field: 'filePathListView',
sort: 'custom',
isTable: false,
table: {
},
form: {
component: 'UploadFile',
componentProps: {
}
}
},
{
label: '文件',
field: 'filePathList',
sort: 'custom',
isTable: false,
isForm: false,
table: {
},
form: {
component: 'UploadFile',
componentProps: {
}
}
},

Loading…
Cancel
Save