|
|
@ -32,6 +32,9 @@ |
|
|
|
<span>{{ row.code }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #upload="{ row }"> |
|
|
|
<ButtonBase v-if="row.filePathList != null && row.filePathList.length != 0" :Butttondata="butttondataView(row)" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
@ -52,7 +55,15 @@ |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="AssetsAccount.allSchemas" /> |
|
|
|
|
|
|
|
<Dialog |
|
|
|
ref="basicFormViewRef" |
|
|
|
v-model="showView" |
|
|
|
:key="viewKey" |
|
|
|
:closeOnClickModal="true" |
|
|
|
:title="viewTitle" |
|
|
|
> |
|
|
|
<el-image v-for="url in urls" :key="url" :src="url" lazy /> |
|
|
|
</Dialog> |
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/eam/fixed-assets/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
</template> |
|
|
@ -78,6 +89,10 @@ const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(AssetsAccount.allSchemas.tableColumns) |
|
|
|
|
|
|
|
const showView = ref(false) |
|
|
|
const viewTitle = ref('图片预览') |
|
|
|
const urls = ref([]) |
|
|
|
const viewKey = ref(0) |
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(() => { |
|
|
@ -145,6 +160,8 @@ const buttonTableClick = async (val, row) => { |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} else if (val == 'view') { //预览 |
|
|
|
openForm('view', row) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -152,9 +169,20 @@ const buttonTableClick = async (val, row) => { |
|
|
|
const basicFormRef = ref() |
|
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
|
|
|
|
if (type == 'view') { |
|
|
|
showView.value = true |
|
|
|
urls.value = row.filePathList |
|
|
|
viewKey.value += 1 |
|
|
|
}else if (type == 'update') { |
|
|
|
row['upload']= row.filePathList?.map((item: any) => { |
|
|
|
return {url:item} |
|
|
|
}) |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} else { |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
|
// form表单提交 |
|
|
@ -169,7 +197,12 @@ const formsSuccess = async (formType,data) => { |
|
|
|
} |
|
|
|
} |
|
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
if (data.expireTime == 0) data.expireTime = null; |
|
|
|
if (data.upload != null && data.upload != "") { |
|
|
|
data.filePathList = data?.upload?.map((item: any) => { |
|
|
|
return item.url |
|
|
|
}) |
|
|
|
} |
|
|
|
const userStore = useUserStore() // 用户信息 |
|
|
|
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.SPECIAL_DEPT_ROLE) |
|
|
|
// 查找第一个同时存在于userStore.roles和deviceMoldTypeList中的值 |
|
|
@ -232,6 +265,14 @@ const handleExport = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondataView = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.viewBtn(null), |
|
|
|
|
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
/** 导入 */ |
|
|
|
const importFormRef = ref() |
|
|
|
const handleImport = () => { |
|
|
|