|
@@ -0,0 +1,327 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-row style="height: 800px">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-card
|
|
|
+ header="项目基本信息"
|
|
|
+ style="height: 100%"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-text
|
|
|
+ size="large"
|
|
|
+ :line-clamp="1"
|
|
|
+ >
|
|
|
+ <b>项目名称:</b>{{ information.name }}
|
|
|
+ </el-text>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="mt-10">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-text
|
|
|
+ size="large"
|
|
|
+ :line-clamp="1"
|
|
|
+ >
|
|
|
+ <b>项目负责人:</b>{{ information.principal }}
|
|
|
+ </el-text>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="mt-10">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-text
|
|
|
+ size="large"
|
|
|
+ :line-clamp="1"
|
|
|
+ >
|
|
|
+ <b>相关客户:</b>{{ information.customer }}
|
|
|
+ </el-text>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="mt-10">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-text
|
|
|
+ size="large"
|
|
|
+ :line-clamp="1"
|
|
|
+ >
|
|
|
+ <b>紧急程度:</b>{{ information.level === 1 ? '正常' : information.level === 2 ? '重要' : '紧急' }}
|
|
|
+ </el-text>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="mt-10">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-text
|
|
|
+ size="large"
|
|
|
+ :line-clamp="1"
|
|
|
+ >
|
|
|
+ <b>项目金额:</b>{{ information.price }}元
|
|
|
+ </el-text>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="mt-10">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-text
|
|
|
+ size="large"
|
|
|
+ >
|
|
|
+ <b>立项时间:</b>{{ information.CreatedAt }}
|
|
|
+ </el-text>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="mt-10">
|
|
|
+ <el-col :span="3">
|
|
|
+ <el-text
|
|
|
+ size="large"
|
|
|
+ >
|
|
|
+ <b>项目说明:</b>
|
|
|
+ </el-text>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-text
|
|
|
+ size="large"
|
|
|
+ :line-clamp="4"
|
|
|
+ >
|
|
|
+ {{ information.illustrate }}
|
|
|
+ </el-text>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col
|
|
|
+ :span="13"
|
|
|
+ class="ml-5"
|
|
|
+ >
|
|
|
+ <el-card
|
|
|
+ header="项目文件列表"
|
|
|
+ style="height: 100%"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-input
|
|
|
+ v-model="fileCondition.name"
|
|
|
+ placeholder="请输入文件名称"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col
|
|
|
+ :span="4"
|
|
|
+ :offset="1"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ clearable
|
|
|
+ v-model="fileType"
|
|
|
+ @change="changeFileType"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in fileTypeList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col
|
|
|
+ :span="3"
|
|
|
+ :offset="1"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :icon="Search"
|
|
|
+ @click="queryFile"
|
|
|
+ >查询</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col
|
|
|
+ :span="3"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :icon="RefreshLeft"
|
|
|
+ >
|
|
|
+ 重置
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col
|
|
|
+ :span="3"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :icon="Upload"
|
|
|
+ >
|
|
|
+ 上传
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col
|
|
|
+ :span="3"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :icon="Download"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="margin-top: 20px">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-table
|
|
|
+ :data="fileList"
|
|
|
+ row-class-name="row-class"
|
|
|
+ border
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ prop="ID"
|
|
|
+ align="center"
|
|
|
+ label="ID"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="文件名称"
|
|
|
+ align="center"
|
|
|
+ width="350"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="项目操作"
|
|
|
+ align="center"
|
|
|
+ fixed="right"
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ :icon="Download"
|
|
|
+ @click="projectEdit(scope.$index, scope.row)"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ :icon="Delete"
|
|
|
+ @click="projectDelete(scope.$index, scope.row)"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { getProjectMessage } from '@/api/project'
|
|
|
+import { onMounted, reactive, ref } from 'vue'
|
|
|
+import { getAllUsers } from '@/api/user'
|
|
|
+import { Download, Upload, Delete, Search, RefreshLeft } from '@element-plus/icons-vue'
|
|
|
+
|
|
|
+defineOptions({
|
|
|
+ name: 'Test'
|
|
|
+})
|
|
|
+const fileCondition = reactive({
|
|
|
+ code: '',
|
|
|
+ name: '',
|
|
|
+ genre: 0,
|
|
|
+ pageInfo: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 9
|
|
|
+ }
|
|
|
+})
|
|
|
+const information = reactive({})
|
|
|
+// 项目用户列表
|
|
|
+const userList = reactive([])
|
|
|
+// 项目文件列表
|
|
|
+const fileList = reactive([])
|
|
|
+// 项目文件类型列表
|
|
|
+const fileTypeList = [
|
|
|
+ { label: '立项文件', value: 1 },
|
|
|
+ { label: '施工文件', value: 2 }
|
|
|
+]
|
|
|
+// 项目文件类型
|
|
|
+const fileType = ref('')
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ projectMessage('LCZM202407161229')
|
|
|
+ getAllUsers().then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ userList.push(...res.data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+})
|
|
|
+const projectMessage = (code) => {
|
|
|
+ getProjectMessage(code).then(res => {
|
|
|
+ console.log(res.data)
|
|
|
+ if (res.code === 0) {
|
|
|
+ const data = res.data
|
|
|
+ data.CreatedAt = formatDate(data.CreatedAt)
|
|
|
+ data.UpdatedAt = formatDate(data.UpdatedAt)
|
|
|
+ Object.keys(data).forEach(key => {
|
|
|
+ if (key === 'files') {
|
|
|
+ // data[key].CreatedAt = formatDate(data[key].CreatedAt)
|
|
|
+ // data[key].UpdatedAt = formatDate(data[key].UpdatedAt)
|
|
|
+ fileList.push(...data[key])
|
|
|
+ console.log(fileList)
|
|
|
+ }
|
|
|
+ information[key] = data[key]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const changeFileType = (value) => {
|
|
|
+ console.log(value)
|
|
|
+ fileTypeList.forEach(item => {
|
|
|
+ if (item.value === value) {
|
|
|
+ fileType.value = item.label
|
|
|
+ }
|
|
|
+ })
|
|
|
+ fileCondition.genre = value
|
|
|
+}
|
|
|
+// 查询文件
|
|
|
+const queryFile = () => {}
|
|
|
+// 选择负责人
|
|
|
+// const headSelect = (value) => {
|
|
|
+// information.principal = value
|
|
|
+// }
|
|
|
+// 日期格式化
|
|
|
+const formatDate = (dateString, locale = 'en-US', timezone = 'Asia/Shanghai') => {
|
|
|
+ // 使用 Date 构造函数解析日期字符串
|
|
|
+ const date = new Date(dateString)
|
|
|
+
|
|
|
+ // 检查日期是否有效
|
|
|
+ if (isNaN(date.getTime())) {
|
|
|
+ throw new Error('Invalid date string')
|
|
|
+ }
|
|
|
+
|
|
|
+ // 使用 Date 对象的年份、月份和日期来构建新的日期字符串
|
|
|
+ // 注意:JavaScript 中的月份是从 0 开始的,所以我们需要加 1
|
|
|
+
|
|
|
+ return `${date.getFullYear()}-${('0' + (date.getMonth() + 1)).slice(-2)}-${('0' + date.getDate()).slice(-2)}`
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+@mixin basic {
|
|
|
+ width: 50%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.basicInformation {
|
|
|
+ height: 50px;
|
|
|
+ background-color: #f8fafd;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .basicTitle {
|
|
|
+ @include basic;
|
|
|
+ padding-left: 40px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .basicEdit {
|
|
|
+ @include basic;
|
|
|
+ justify-content: end;
|
|
|
+ padding-right: 40px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|