@@ -30,7 +63,7 @@
ref="tableInstance"
>
-
+
@@ -80,10 +113,17 @@ const props = defineProps({
pagination: {
type: Boolean,
default: true
+ },
+ // 是否显示列配置
+ isSettingCol: {
+ type: Boolean,
+ default: true
}
})
const tableInstance = ref()
+const buttonRef = ref()
+const popoverRef = ref()
const localData = reactive({
list: [], // 表格数据
@@ -92,7 +132,12 @@ const localData = reactive({
pageNum: 1
},
total: 0,
- loading: false
+ loading: false,
+ // 列展示设置
+ columns: [],
+ allColShow: true, // 默认全部列都展示
+ indeterminate: false,
+ checkGroup: []
})
const emits = defineEmits(['headBtnClick', 'selectionChange', 'rowClick', 'rowDblclick', 'getBaseQuery', 'cellClick'])
@@ -101,6 +146,52 @@ const handleClickBtns = (key) => {
emits('headBtnClick', key)
}
+const filterColumns = () => {
+ localData.columns = props.tableConfig.columns.map(item=>{
+ if(item.prop) {
+ return {
+ ...item
+ }
+ }
+ })
+}
+
+const changeIsShowAll = (val) => {
+ if(val) {
+ filterColumns()
+ localData.indeterminate = false
+ localData.checkGroup = props.tableConfig.columns.map(item=>item.prop)
+ } else {
+ localData.columns.length = 0
+ localData.checkGroup.length = 0
+ localData.indeterminate = false
+ }
+}
+
+const changeColShow = (val) => {
+ if(val.length == props.tableConfig.columns.length) {
+ localData.indeterminate = false
+ localData.allColShow = true
+ } else if(val.length !== props.tableConfig.columns.length && val.length != 0) {
+ localData.allColShow = false
+ localData.indeterminate = true
+ } else {
+ localData.indeterminate = false
+ localData.allColShow = false
+ }
+ const template = []
+ props.tableConfig.columns.forEach(item=>{
+ val.forEach(v=>{
+ if(item.prop == v) {
+ template.push(item)
+ }
+ })
+ })
+ localData.columns = template
+}
+
+filterColumns()
+
const getList = async () => {
const { api, params } = props.tableConfig
const queryParmas = {...localData.query, ...params}
@@ -154,13 +245,11 @@ const handleCurrentChange = (val) => {
getList()
}
-// watchEffect(()=>{
-// if(!props.tableConfig.api) {
-// localData.list = props.data
-// }else {
-// getList()
-// }
-// })
+watchEffect(()=>{
+ if(localData.allColShow) {
+ localData.checkGroup = props.tableConfig.columns.map(item=>item.prop)
+ }
+})
//刷新
const refresh = ({resetPage=false}={}) => {
resetPage ? localData.query.pageNum = 1 : null
@@ -184,5 +273,21 @@ onMounted(() => {
\ No newline at end of file
From ad3fa0e688a9eada29d3d508b01b1a075a34234e Mon Sep 17 00:00:00 2001
From: lilinyuan <1084668738@qq.com>
Date: Mon, 13 May 2024 22:25:37 +0800
Subject: [PATCH 6/9] =?UTF-8?q?feat:=20=E8=A1=A8=E6=A0=BC=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/fvcomponents/fvTable/index.vue | 143 +++++++++++++++++++++++++----
1 file changed, 124 insertions(+), 19 deletions(-)
diff --git a/src/fvcomponents/fvTable/index.vue b/src/fvcomponents/fvTable/index.vue
index 1b42ff2..c90af06 100644
--- a/src/fvcomponents/fvTable/index.vue
+++ b/src/fvcomponents/fvTable/index.vue
@@ -2,15 +2,48 @@
-
- {{ btn.name }}
-
+
+
+ {{ btn.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -30,7 +63,7 @@
ref="tableInstance"
>
-
+
@@ -80,10 +113,17 @@ const props = defineProps({
pagination: {
type: Boolean,
default: true
+ },
+ // 是否显示列配置
+ isSettingCol: {
+ type: Boolean,
+ default: true
}
})
const tableInstance = ref()
+const buttonRef = ref()
+const popoverRef = ref()
const localData = reactive({
list: [], // 表格数据
@@ -92,7 +132,12 @@ const localData = reactive({
pageNum: 1
},
total: 0,
- loading: false
+ loading: false,
+ // 列展示设置
+ columns: [],
+ allColShow: true, // 默认全部列都展示
+ indeterminate: false,
+ checkGroup: []
})
const emits = defineEmits(['headBtnClick', 'selectionChange', 'rowClick', 'rowDblclick', 'getBaseQuery', 'cellClick'])
@@ -101,6 +146,52 @@ const handleClickBtns = (key) => {
emits('headBtnClick', key)
}
+const filterColumns = () => {
+ localData.columns = props.tableConfig.columns.map(item=>{
+ if(item.prop) {
+ return {
+ ...item
+ }
+ }
+ })
+}
+
+const changeIsShowAll = (val) => {
+ if(val) {
+ filterColumns()
+ localData.indeterminate = false
+ localData.checkGroup = props.tableConfig.columns.map(item=>item.prop)
+ } else {
+ localData.columns.length = 0
+ localData.checkGroup.length = 0
+ localData.indeterminate = false
+ }
+}
+
+const changeColShow = (val) => {
+ if(val.length == props.tableConfig.columns.length) {
+ localData.indeterminate = false
+ localData.allColShow = true
+ } else if(val.length !== props.tableConfig.columns.length && val.length != 0) {
+ localData.allColShow = false
+ localData.indeterminate = true
+ } else {
+ localData.indeterminate = false
+ localData.allColShow = false
+ }
+ const template = []
+ props.tableConfig.columns.forEach(item=>{
+ val.forEach(v=>{
+ if(item.prop == v) {
+ template.push(item)
+ }
+ })
+ })
+ localData.columns = template
+}
+
+filterColumns()
+
const getList = async () => {
const { api, params } = props.tableConfig
const queryParmas = {...localData.query, ...params}
@@ -154,13 +245,11 @@ const handleCurrentChange = (val) => {
getList()
}
-// watchEffect(()=>{
-// if(!props.tableConfig.api) {
-// localData.list = props.data
-// }else {
-// getList()
-// }
-// })
+watchEffect(()=>{
+ if(localData.allColShow) {
+ localData.checkGroup = props.tableConfig.columns.map(item=>item.prop)
+ }
+})
//刷新
const refresh = ({resetPage=false}={}) => {
resetPage ? localData.query.pageNum = 1 : null
@@ -184,5 +273,21 @@ onMounted(() => {
\ No newline at end of file
From f55059eed7c06b3c30f6cd88390c50763c0dd602 Mon Sep 17 00:00:00 2001
From: odjbin <1042039504@qq.com>
Date: Mon, 13 May 2024 22:28:44 +0800
Subject: [PATCH 7/9] =?UTF-8?q?fix=20:=20=E4=BF=AE=E5=A4=8D=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/home/index.vue | 4 +-
.../projectdemand/demandcollection/add.vue | 95 +++++++++++--------
.../projectdemand/demandcollection/detail.vue | 14 ++-
3 files changed, 67 insertions(+), 46 deletions(-)
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 51d3347..f69f611 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -148,11 +148,11 @@ const tableConfig = reactive({
})
const handleView = (row) => {
console.log('row', row)
- if(row.targetState=='00'&&row.taskId){
+ if(row.targetState=='00'&&row.targetId){
router.push({
path: '/projectdemand/demanddetail',
query: {
- id: row.taskId
+ id: row.targetId
}
})
}
diff --git a/src/views/projectdemand/demandcollection/add.vue b/src/views/projectdemand/demandcollection/add.vue
index 61ca417..0e64c42 100644
--- a/src/views/projectdemand/demandcollection/add.vue
+++ b/src/views/projectdemand/demandcollection/add.vue
@@ -1,7 +1,7 @@
-
+
@@ -20,7 +20,7 @@
/>
-
+
-
+
@@ -64,7 +64,7 @@
- 提交
+ 提交
重新提交
返回
@@ -80,10 +80,13 @@ import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.v
import {ElMessage, ElMessageBox} from "element-plus";
import {useRoute, useRouter} from 'vue-router'
import {getSubCompOpt} from '@/api/user/user.js'
+import {useTagsView} from '@/stores/tagsview.js'
+const tagsViewStore = useTagsView()
const authStore = useAuthStore()
const router = useRouter()
const route = useRoute()
+const demandForm = ref()
const dateValue = ref()
const formData = ref({
requirementName: '',
@@ -92,41 +95,30 @@ const formData = ref({
deadline: '',
collectExplain: ''
})
-const showTable = ref(false)
const processDiagramViewer = ref(false)
-
const typeOption = ref([
{
label: "需求征集",
value: '需求征集'
}
])
-const companyOption = ref([
- {
- label: "测试公司1",
- value: 22
- },
- {
- label: "测试公司2",
- value: 23
- },
- {
- label: "测试公司3",
- value: 24
- }
-])
+const companyOption = ref([])
const form = ref(null)
const fileList = ref(null)
-const menuTree = ref(null)
const loading = ref(false)
const processStore = useProcessStore()
const processInstanceData = ref()
-
+const rules = reactive({
+ requirementName: [{required: true, message: '请输入名称', trigger: 'blur'}],
+ companyIds: [{required: true, message: '请选择所属公司', trigger: 'blur'}],
+ collectType: [{required: true, message: '请选择征集类型', trigger: 'blur'}],
+ deadline: [{required: true, message: '请选择截止时间', trigger: 'blur'}],
+})
const compositeParam=(item)=>{
return {
fileId: item.id,
size: item.size,
- fileName: item.fileName,
+ originalFileName: item.originalFilename,
fileType: item.fileType,
url: item.url,
processNodeTag: null,
@@ -135,6 +127,7 @@ const compositeParam=(item)=>{
}
}
const getFile = (val) => {
+ console.log('上传文件',val)
let fileObj = {}
let newFileArray = []
if (route.query.isAdd === undefined) {
@@ -172,27 +165,45 @@ const init = async () => {
})
}
-const handleSubmit = async () => {
- let params = {
+const handleSubmit = async (instance) => {
+ console.log('fileList.value',fileList.value)
+ if (!instance) return
+ instance.validate(async (valid) => {
+ if (!valid) return
+ let params = {
+ ...formData.value,
+ requirementId: 0,
+ files: fileList.value,
+ deploymentId: processInstanceData.value.deploymentId
+ }
+ let res = await addRequirement(params)
+ if (res.code === 1000) {
+ ElMessage.success(res.msg)
+ await router.push({
+ path: '/projectdemand/demandcollection'
+ })
+ tagsViewStore.delVisitedViews(router.currentRoute.value.path)
+ } else {
+ ElMessage.error(res.msg)
+ }
+ })
+}
+const handleResubmit = () => {
+ resubmit({
...formData.value,
- requirementId: 0,
files: fileList.value,
deploymentId: processInstanceData.value.deploymentId
- }
- let res
- if (route.query.isAdd === undefined) {
- res = await resubmit(params)
- } else {
- res = await addRequirement(params)
- }
- if (res.code === 1000) {
- ElMessage.success(res.msg)
- await router.push({
- path: '/projectdemand/demandcollection'
- })
- } else {
- ElMessage.error(res.msg)
- }
+ }).then(res => {
+ if (res.code === 1000) {
+ ElMessage.success(res.msg)
+ formData.value = res.data.formData
+ router.push({
+ path: '/projectdemand/demandcollection'
+ })
+ } else {
+ ElMessage.error(res.msg)
+ }
+ })
}
const getDetailInfo = async () => {
getFormInfo(route.query.id).then(res => {
@@ -210,7 +221,7 @@ const handleBack = () => {
history.back()
}
const beforeRemove = (row) => {
- ElMessageBox.confirm(`确认删除名称为${row.filename}的表格吗?`, '系统提示', {
+ ElMessageBox.confirm(`确认删除名称为${row.originalFileName}的表格吗?`, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
diff --git a/src/views/projectdemand/demandcollection/detail.vue b/src/views/projectdemand/demandcollection/detail.vue
index e83bf85..5ea2c9e 100644
--- a/src/views/projectdemand/demandcollection/detail.vue
+++ b/src/views/projectdemand/demandcollection/detail.vue
@@ -38,7 +38,7 @@
-
+
@@ -92,7 +92,9 @@ import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.v
import {useProcessStore} from '@/stores/processStore.js';
import {getInfo, agreeTask, rejectTask} from "@/api/project-demand/index.js";
import {getSubCompOpt} from '@/api/user/user.js'
-
+import {ElMessage} from "element-plus";
+import {useRouter} from "vue-router";
+const router = useRouter()
const route = useRoute()
const form = ref();
const processStore = useProcessStore()
@@ -120,6 +122,14 @@ const handleReject = () => {
}
rejectTask(approve).then(res => {
console.log(res)
+ if (res.code === 1000) {
+ ElMessage.success(res.msg)
+ router.push({
+ path: '/projectdemand/demandcollection'
+ })
+ }else {
+ ElMessage.error(res.msg)
+ }
})
}
const getCompanyOption = async () => {
From f46f95c4ad7c3815d601acd2a72945b6ba14af4a Mon Sep 17 00:00:00 2001
From: lilinyuan <1084668738@qq.com>
Date: Mon, 13 May 2024 22:29:07 +0800
Subject: [PATCH 8/9] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E8=AF=A5=E5=88=86?=
=?UTF-8?q?=E6=94=AF=E8=A1=A8=E6=A0=BC=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/fvcomponents/fvTable/index.vue | 293 -----------------------------
1 file changed, 293 deletions(-)
delete mode 100644 src/fvcomponents/fvTable/index.vue
diff --git a/src/fvcomponents/fvTable/index.vue b/src/fvcomponents/fvTable/index.vue
deleted file mode 100644
index c90af06..0000000
--- a/src/fvcomponents/fvTable/index.vue
+++ /dev/null
@@ -1,293 +0,0 @@
-
-
-
-
-
-
- {{ btn.name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
From 31a88c232f035a52ba6c2c8b75b57c453c416c8b Mon Sep 17 00:00:00 2001
From: lilinyuan <1084668738@qq.com>
Date: Mon, 13 May 2024 22:30:50 +0800
Subject: [PATCH 9/9] =?UTF-8?q?feat:=20=E9=87=8D=E6=96=B0=E4=B8=8A?=
=?UTF-8?q?=E4=BC=A0=E8=A1=A8=E6=A0=BC=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/fvcomponents/fvTable/index.vue | 293 +++++++++++++++++++++++++++++
1 file changed, 293 insertions(+)
create mode 100644 src/fvcomponents/fvTable/index.vue
diff --git a/src/fvcomponents/fvTable/index.vue b/src/fvcomponents/fvTable/index.vue
new file mode 100644
index 0000000..9c4b81c
--- /dev/null
+++ b/src/fvcomponents/fvTable/index.vue
@@ -0,0 +1,293 @@
+
+
+
+
+
+
+ {{ btn.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+