|
@@ -1,6 +1,7 @@
|
|
|
<!-- 报故记录 -->
|
|
|
<template>
|
|
|
<div class="mainContentBox">
|
|
|
+ <img src="" />
|
|
|
<avue-crud
|
|
|
ref="crudRef2"
|
|
|
v-model:search="search"
|
|
@@ -8,25 +9,34 @@
|
|
|
:data="data"
|
|
|
:option="option"
|
|
|
v-model:page="page"
|
|
|
+ @row-update="updateRow"
|
|
|
>
|
|
|
- <template #menu="{row,index,type}">
|
|
|
- <el-button @click="openDialog(row)"
|
|
|
- icon="el-icon-link"
|
|
|
- text
|
|
|
- type="primary"
|
|
|
- >查看</el-button>
|
|
|
+ <template #menu="{ row, index, type }">
|
|
|
+ <el-button
|
|
|
+ @click="openDialog(row)"
|
|
|
+ icon="el-icon-link"
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ >查看</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
<template #filePath-form="scope">
|
|
|
<single-upload v-model="form.filePath" />
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
<el-dialog
|
|
|
- v-model="dialog.visible"
|
|
|
- :title="dialog.title"
|
|
|
- width="60%"
|
|
|
- @close="dialog.visible = false"
|
|
|
- ><el-image :src="url" fit="none" />
|
|
|
+ v-model="dialog.visible"
|
|
|
+ :title="dialog.title"
|
|
|
+ width="60%"
|
|
|
+ @close="dialog.visible = false"
|
|
|
+ ><el-image :src="url" fit="none" />
|
|
|
</el-dialog>
|
|
|
+ <CommonTable
|
|
|
+ ref="ctableRef"
|
|
|
+ tableTitle="人员选择"
|
|
|
+ tableType="USERS"
|
|
|
+ @selected-sure="onSelectedFinish"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
@@ -34,16 +44,20 @@ import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
|
-import {useCommonStoreHook, useDictionaryStore, useUserStoreHook} from "@/store";
|
|
|
+import {
|
|
|
+ useCommonStoreHook,
|
|
|
+ useDictionaryStore,
|
|
|
+ useUserStoreHook,
|
|
|
+} from "@/store";
|
|
|
import SingleUpload from "@/components/Upload/SingleUpload.vue";
|
|
|
-
|
|
|
+const ctableRef = ref(null);
|
|
|
// 数据字典相关
|
|
|
const { dicts } = useDictionaryStore();
|
|
|
const dialog = reactive({
|
|
|
title: "图片预览",
|
|
|
visible: false,
|
|
|
});
|
|
|
-const url = ref(null)
|
|
|
+const url = ref(null);
|
|
|
// 传入一个url,后面不带/
|
|
|
const {
|
|
|
form,
|
|
@@ -64,10 +78,10 @@ const { selectionChange, multipleDelete } = Methords; //选中和批量删除事
|
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
-const openDialog = (row) =>{
|
|
|
- dialog.visible = true
|
|
|
- url.value = import.meta.env.VITE_APP_UPLOAD_URL + row.filePath
|
|
|
-}
|
|
|
+const openDialog = (row) => {
|
|
|
+ dialog.visible = true;
|
|
|
+ url.value = import.meta.env.VITE_APP_UPLOAD_URL + row.filePath;
|
|
|
+};
|
|
|
const refreshTra = (row) => {
|
|
|
commonConfig.value.params = { seqNo: row.seqNo };
|
|
|
dataList();
|
|
@@ -75,12 +89,13 @@ const refreshTra = (row) => {
|
|
|
const userStore = useUserStoreHook();
|
|
|
defineExpose({ refreshTra });
|
|
|
onMounted(() => {
|
|
|
- if(userStore.user.userId===10000){
|
|
|
+ if (userStore.user.userId === 10000) {
|
|
|
option.value.editBtn = true;
|
|
|
-
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+const onSelectedFinish = (selectValue) => {
|
|
|
+ form.value.creator = selectValue.userName;
|
|
|
+};
|
|
|
option.value = Object.assign(option.value, {
|
|
|
selection: false,
|
|
|
border: true,
|
|
@@ -93,7 +108,7 @@ option.value = Object.assign(option.value, {
|
|
|
menu: true,
|
|
|
editBtn: false,
|
|
|
delBtn: false,
|
|
|
- viewBtn:false,
|
|
|
+ viewBtn: false,
|
|
|
header: false,
|
|
|
column: [
|
|
|
{
|
|
@@ -105,22 +120,41 @@ option.value = Object.assign(option.value, {
|
|
|
{
|
|
|
label: "上传人员",
|
|
|
prop: "creator",
|
|
|
+ span: 16,
|
|
|
search: false,
|
|
|
+ click: ({ value, column }) => {
|
|
|
+ ctableRef.value.startSelect();
|
|
|
+ },
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择上传人员",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
label: "上传时间",
|
|
|
prop: "created",
|
|
|
search: false,
|
|
|
- format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
- valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
+ span: 16,
|
|
|
+ format: "YYYY-MM-DD HH:mm:ss",
|
|
|
+ valueFormat: "YYYY-MM-DD HH:mm:ss",
|
|
|
type: "datetime",
|
|
|
},
|
|
|
{
|
|
|
- label: "图纸上传",
|
|
|
+ label: "图片上传",
|
|
|
prop: "filePath",
|
|
|
- span: 24,
|
|
|
+ span: 16,
|
|
|
slot: true,
|
|
|
hide: true,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请上传图片",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
],
|
|
|
});
|