From f51f425a1519de14d26177121b4003043b704f65 Mon Sep 17 00:00:00 2001 From: wanghaohao Date: Mon, 8 Dec 2025 17:37:40 +0800 Subject: [PATCH] add custom column config --- .../src/views/scriptLibrary/versionScript.vue | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/automation/web/src/views/scriptLibrary/versionScript.vue b/automation/web/src/views/scriptLibrary/versionScript.vue index 3d1d10e4..079afd5e 100644 --- a/automation/web/src/views/scriptLibrary/versionScript.vue +++ b/automation/web/src/views/scriptLibrary/versionScript.vue @@ -81,6 +81,12 @@ :showSelect="showSelect" > + + + + @@ -137,26 +158,71 @@ import { ref,defineAsyncComponent, onMounted } from 'vue'; import { ElMessage } from 'element-plus'; import { useRouter, useRoute } from 'vue-router' import { scriptVersion,scriptVersionPublish,scriptVersionDel } from '@/api/scriptLibrary'; +const CustomColumn = defineAsyncComponent(() => import('@/components/customColumn/index.vue')); const KyTable = defineAsyncComponent(() => import('@/components/KyTable/index.vue')); const router = useRouter(); const route = useRoute(); const dialogVisible = ref(false); +const dialogTitle = ref('自定义列'); +const dialogWidth = ref('50%'); const rwType = ref('custom_list'); +const colData = ref([]); +const rawData = ref([]); const tableRef = ref(null); const showSelect = ref(true); // 定义是否显示选择框 // 脚本详情信息 const scriptInfo:any = route.query const scriptInfo_tag = JSON.parse(scriptInfo.tag) console.log('[ scriptInfo ] >', scriptInfo,scriptInfo_tag) + +const handleCustomColumn = (row: any) => { + // console.log('[ 自定义列 ] >', '自定义列'); + getCustomColumnFun() + rwType.value = 'custom_list'; + dialogVisible.value = true; + dialogTitle.value = '自定义列'; +}; +const getCustomColumnFun = async( ) => { + + colData.value = [ + { name: 'action', label: '脚本名称1111' }, + { name: 'ip', label: '脚本语言' }, + { name: 'originalSystem', label: '场景标签' }, + { name: 'targetSystem', label: '被引用' }, + { name: 'targetSystem', label: '线上版本' }, + { name: 'targetSystem', label: '更新人' }, + { name: 'targetSystem', label: '更新时间' }, + ] + + + + // const userId = getUserId() + // if (userId) { + // const res = await getCustomColumn(userId) + // if (res.data.data && res.data.data.length == rawData.value.length && res.data.data[res.data.data.length - 1].name == 'groupName') { + // colData.value = res.data.data; + // } else { + // colData.value = rawData; + // } + // } else { + // colData.value = rawData; + // } +} // 确保在组件挂载时获取脚本详情 onMounted(() => { }); + + const handleCloseDialog = () => { dialogVisible.value = false; rwType.value = ''; }; +const handleCustomColumnOk = (val: any) => { + console.log(val); + handleCloseDialog(); +} const addScript = () => { router.push('/script_library/addScript') } -- Gitee