2c8abf69 by lxs

分类分级任务联调

1 parent 87a21d47
......@@ -472,6 +472,13 @@ export const getTaskFieldCount = (data) => request({
params: data
})
// 分类分级任务执行数据库信息查询
export const getDbFieldList = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task-exec-result/confirm-query-db-list`,
method: 'get',
params: data
})
// 分类分级任务执行字段查询
export const execTaskFieldList = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task-exec-result/confirm-field-list-query`,
......@@ -489,7 +496,7 @@ export const execTaskSheetList = (data) => request({
export const execTaskConfirm = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task-exec-result/confirm-task`,
method: 'post',
data
params: data
})
// 分类分级任务执行字段确认
......@@ -536,7 +543,7 @@ export const filterVal = (val, type) => {
} else if(type == 'confirmStatus'){
switch (val) {
case 'N':
status = '草稿中';
status = '待确认';
break;
case 'Y':
status = '已确认';
......@@ -557,6 +564,18 @@ export const filterVal = (val, type) => {
status = '待确认';
break;
}
} else if(type == 'changeStatus'){
switch (val) {
case 'N':
status = '待确认';
break;
case 'Y':
status = '已确认';
break;
default:
status = '--';
break;
}
}
return status;
}
......
......@@ -498,6 +498,11 @@ const scheduleChange = (val, rowValue) => {
const treeSelectNodeChange = (node, item, nodeObj) => {
emits("treeSelectNodeChange", node, item, nodeObj);
}
const getCascaderCheckedData = () => {
const dialogForm = dialogFormRef.value[0] || dialogFormRef.value;
return dialogForm.getCascaderCheckedData();
}
const setTreeChecked = (checkedKeys, leafOnly: boolean = false) => {
nextTick(() => {
const formTree = formTreeRef.value[0] || formTreeRef.value;
......@@ -533,7 +538,8 @@ defineExpose({
formTreeRef,
setTableRowSelected,
setTreeChecked,
getDialogConRef
getDialogConRef,
getCascaderCheckedData
});
</script>
......
......@@ -101,7 +101,7 @@ onMounted(() => {
<template v-if="item.type == 'select'">
<el-select :class="{ 'is-multiple': item.multiple }" v-model="formInline[item.field]"
:placeholder="item.placeholder" :clearable="item.clearable" :filterable="item.filterable"
@change="(val) => selectChange(val, item)">
:disabled="item.disabled ?? false" @change="(val) => selectChange(val, item)">
<el-option v-for="opt in item.options" :label="item.props?.label ? opt[item.props.label] : opt.label"
:value="item.props?.value ? opt[item.props.value] : opt.value" />
</el-select>
......
......@@ -64,7 +64,9 @@ const tableInfo = ref({
{
label: "结果状态", field: "confirmStatus", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
return filterVal(scope.row.confirmStatus, 'confirmStatus');
}
}, tagType: (scope) => {
return scope.row.confirmStatus=='Y'?'success':'warning';
},
},
],
data: [],
......@@ -157,6 +159,7 @@ const toPath = (type) => {
query: {
guid: currTableData.value.guid,
name: currTableData.value.taskName,
detail: JSON.stringify(currTableData.value),
type
},
});
......
......@@ -11,8 +11,17 @@ import { Search, Warning } from "@element-plus/icons-vue";
import { setItemsDisabled, tagMethod, tagType, changeNum, } from "@/utils/common";
import useDataAssetStore from "@/store/modules/dataAsset";
import TableTools from '@/components/Tools/table_tools.vue';
import { getCgTaskDetail, getTaskExeTreeList, getTaskFieldCount, execTaskFieldList, execTaskSheetList, execTaskConfirm, execFieldConfirm, filterVal, } from "@/api/modules/dataInventory";
import { ro } from "element-plus/es/locale";
import {
getTaskExeTreeList,
getTaskFieldCount,
execTaskFieldList,
execTaskSheetList,
execTaskConfirm,
execFieldConfirm,
filterVal,
getGradeList,
getDbFieldList
} from "@/api/modules/dataInventory";
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
......@@ -20,20 +29,20 @@ const route = useRoute();
const userStore = useUserStore();
const userData = JSON.parse(userStore.userData);
const assetStore = useDataAssetStore();
const detailData = JSON.parse(route.query.detail);
const classifyData = ref([
{ classifyName: '未分类', guid: 'unclassified' },
])
const gradeList = ref([]);
const treeData = ref([
{
classifyName: "全部",
guid: "all",
children: [
{ classifyName: '未分类', guid: 'unclassified' },
{ classifyName: '未分类', guid: 'unclassified' }
],
},
]);
const currTreeNode = ref({})
const currTreeNode = ref({ classifyName: "全部", guid: "all" })
const treeInfoRef = ref();
const treeInfo: any = ref({
id: "data-pickup-tree",
filter: true,
......@@ -49,7 +58,7 @@ const treeInfo: any = ref({
data: [],
});
const taskDetail = ref({})
const taskDetail: any = ref({})
const fieldCounts = ref({})
const tabsInfo = ref({
activeName: 'field',
......@@ -64,30 +73,29 @@ const sheetItemList = ref([
{
type: "select",
label: "",
placeholder: '变更类型',
field: 'isCgChange',
default: '',
options: [
{ label: '已确认', value: 'Y' },
{ label: '待确认', value: 'N' },
],
clearable: true,
},
{
type: "input",
label: "",
placeholder: '数据库名',
field: 'databaseName',
field: 'databaseGuid',
default: '',
options: [],
props: {
label: 'name',
value: 'dbGuid'
},
clearable: true,
},
{
type: "input",
type: "select",
label: "",
placeholder: '表中文/英文名',
field: 'tableName',
field: 'tableGuid',
default: '',
options: [],
props: {
label: 'name',
value: 'dbGuid'
},
clearable: true,
disabled: true
},
]);
const fieldParams = ref({});
......@@ -96,7 +104,7 @@ const fieldItemList = ref([
type: "select",
label: "",
placeholder: '变更类型',
field: 'isCgChange',
field: 'changeStatus',
default: '',
options: [
{ label: '已确认', value: 'Y' },
......@@ -105,20 +113,45 @@ const fieldItemList = ref([
clearable: true,
},
{
type: "input",
type: "select",
label: "",
placeholder: '字段中文/英文名',
field: 'fieldName',
placeholder: '数据库名',
field: 'databaseGuid',
default: '',
options: [],
props: {
label: 'name',
value: 'dbGuid'
},
clearable: true,
},
{
type: "input",
type: "select",
label: "",
placeholder: '表中文/英文名',
field: 'tableName',
field: 'tableGuid',
default: '',
options: [],
props: {
label: 'name',
value: 'dbGuid'
},
clearable: true,
disabled: true
},
{
type: "select",
label: "",
placeholder: '字段中文/英文名',
field: 'fieldGuid',
default: '',
options: [],
props: {
label: 'name',
value: 'dbGuid'
},
clearable: true,
disabled: true
},
{
type: "cascader",
......@@ -127,9 +160,9 @@ const fieldItemList = ref([
field: 'classifyName',
default: [],
options: [],
showAllLevels: true,
showAllLevels: false,
props: {
checkStrictly: false,
checkStrictly: true,
expandTrigger: "hover",
label: "classifyName",
value: "guid",
......@@ -141,7 +174,7 @@ const fieldItemList = ref([
type: "select",
label: "",
placeholder: '分级',
field: 'dataSourceGuid',
field: 'gradeDetailGuid',
default: '',
options: [],
props: {
......@@ -150,14 +183,6 @@ const fieldItemList = ref([
},
clearable: true,
},
{
type: "input",
label: "",
placeholder: '数据库名',
field: 'databaseName',
default: '',
clearable: true,
},
]);
const checked1 = ref(false);
......@@ -204,20 +229,22 @@ const sheetTableInfo = ref({
show: false
},
});
const selectRowData = ref([]);
const fieldTableInfo = ref({
id: "metadata-table",
fields: [
{ label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
{
label: "分类分级变更状态", field: "isCgChange", width: 140, align: 'center', type: "tag", getName: (scope) => {
return filterVal(scope.row.isCgChange, 'isCgChange');
}
label: "确认状态", field: "changeStatus", width: 140, align: 'center', type: "tag", getName: (scope) => {
return filterVal(scope.row.changeStatus, 'changeStatus');
}, tagType: (scope) => {
return scope.row.changeStatus == 'Y' ? 'success' : 'warning';
},
},
{ label: "字段名", field: "fieldName", width: 120 },
{ label: "字段中文名", field: "fieldChName", width: 200 },
{
label: "分类", field: "classifyGuids", width: 280,
label: "分类", field: "classifyDetailGuid", width: 280,
type: "cascader",
options: [],
showAllLevels: false,
......@@ -230,11 +257,26 @@ const fieldTableInfo = ref({
filterable: true,
clearable: true,
getName: (scope) => {
const classifyNames = scope.row.classifyNames || [];
return classifyNames.join('/');
if (scope.row['STATE'] === 'Running') {
const classifyNames = scope.row.classifyDetailGuidRoutes || [];
return classifyNames;
} else {
const classifyNames = scope.row.classifyDetailNameRoutes || [];
return classifyNames.length ? classifyNames.join('/') : '--';
}
}
},
{ label: "分级", field: "gradeDetailName", width: 120, type: 'select' },
{
label: "分级", field: "gradeDetailName", width: 120, type: 'select', options: [], props: { label: 'gradeName', value: 'guid' },
// getName: (scope) => {
// if (scope.row['STATE'] === 'Running') {
// const classifyNames = scope.row.gradeGuid || '';
// return classifyNames;
// } else {
// return scope.row.gradeDetailName || '--';
// }
// }
},
{ label: "标签", field: "label", width: 96 },
{ label: "规则", field: "ruleDetail", width: 200 },
{ label: "表英文名", field: "tableName", width: 200 },
......@@ -274,21 +316,22 @@ const formItems = ref([
filterable: true,
clearable: true,
required: true,
block: true,
},
{
label: '分级',
type: 'select',
placeholder: '请选择',
field: 'gradeName',
field: 'gradeGuid',
default: '',
block: true,
options: [],
props: {
value: 'guid',
label: 'daName'
label: 'gradeName'
},
clearable: true,
required: true
required: true,
block: true,
},
]);
......@@ -296,11 +339,12 @@ const formRules = ref({
classifyName: [
{ required: true, trigger: 'change', message: "请选择分类" }
],
gradeName: [
gradeGuid: [
{ required: true, trigger: 'change', message: "请选择分级" }
],
});
const dialogRef = ref();
const dialogInfo: any = ref({
visible: false,
size: 480,
......@@ -329,34 +373,38 @@ const dialogInfo: any = ref({
},
})
// 获取任务详情
const getTaskDetail = (data) => {
getCgTaskDetail(data).then((res: any) => {
// 获取字段统计
const getFieldCount = () => {
getTaskFieldCount({ execGuid: taskDetail.value.execGuid }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data || {};
taskDetail.value = data;
getFieldCount({ execGuid: data.execGuid })
getFieldTree({ execGuid: data.execGuid })
getSheetTableData();
getFieldTableData();
fieldCounts.value = data;
} else {
ElMessage.error(res.msg);
}
})
}
// 获取字段统计
const getFieldCount = (data) => {
getTaskFieldCount(data).then((res: any) => {
// 获取分级数据
const getGradeData = () => {
getGradeList({ classifyGradeGuid: taskDetail.value.gradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data || {};
fieldCounts.value = data;
let data = res.data.records || [];
data.map(d => d.gradeName = d.dataGrade + '级');
gradeList.value = JSON.parse(JSON.stringify(data));
formItems.value[1].options = JSON.parse(JSON.stringify(data));
fieldItemList.value[5].options = JSON.parse(JSON.stringify(data));
fieldTableInfo.value.fields[5].options = JSON.parse(JSON.stringify(data));
} else {
ElMessage.error(res.msg);
}
})
}
// 获取字段统计
const getFieldTree = (data) => {
const getFieldTree = () => {
treeInfo.value.loading = true;
getTaskExeTreeList(data).then((res: any) => {
getTaskExeTreeList({ execGuid: taskDetail.value.execGuid }).then((res: any) => {
treeInfo.value.loading = false;
if (res.code == proxy.$passCode) {
const data = res.data || [];
......@@ -364,23 +412,57 @@ const getFieldTree = (data) => {
treeData.value[0].children.push(...data);
treeInfo.value.data = treeData.value;
treeInfo.value.expandedKey = ['all'];
classifyData.value.splice(1);
classifyData.value.push(...data);
fieldItemList.value[3].options = JSON.parse(JSON.stringify(classifyData.value));
fieldTableInfo.value.fields[4].options = JSON.parse(JSON.stringify(classifyData.value));
treeInfoRef.value.setCurrentKey('all');
formItems.value[0].options = JSON.parse(JSON.stringify(data));
fieldItemList.value[4].options = JSON.parse(JSON.stringify(data));
fieldTableInfo.value.fields[4].options = JSON.parse(JSON.stringify(data));
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
treeInfo.value.loading = false;
})
}
// 获取库、表、字段信息
const getSheetFieldList = (params, tId) => {
getDbFieldList({ execGuid: taskDetail.value.execGuid, ...params }).then(res => {
if (res.code == proxy.$passCode) {
const data = res.data || [];
if (params.type == 1) {
sheetItemList.value[0].options = JSON.parse(JSON.stringify(data));
fieldItemList.value[1].options = JSON.parse(JSON.stringify(data));
} else if (params.type == 2) {
if (tabsInfo.value.activeName == 'sheet') {
sheetItemList.value[1].options = JSON.parse(JSON.stringify(data));
} else {
fieldItemList.value[2].options = JSON.parse(JSON.stringify(data));
if(tId){
fieldItemList.value[2].default = tId;
}
}
} else {
fieldItemList.value[3].options = JSON.parse(JSON.stringify(data));
}
} else {
ElMessage.error(res.msg);
}
})
}
const tabChange = (val) => {
tabsInfo.value.activeName = val;
}
const nodeClick = (data) => {
currTreeNode.value = data;
getFieldTableData();
if (data.guid == 'all') {
getFieldTableData({ isClassify: '' })
} else if (data.guid == 'unclassified') {
getFieldTableData({ isClassify: 'N' })
} else {
getFieldTableData({ isClassify: 'Y' });
}
}
// 获取库表数据
......@@ -388,7 +470,6 @@ const getSheetTableData = () => {
sheetTableInfo.value.loading = true;
execTaskSheetList(
Object.assign({}, { ...sheetParams.value }, {
// changeStatus: checked2.value ? 'N' : 'Y',
execGuid: taskDetail.value.execGuid,
pageIndex: sheetTableInfo.value.page.curr,
pageSize: sheetTableInfo.value.page.limit,
......@@ -400,6 +481,8 @@ const getSheetTableData = () => {
sheetTableInfo.value.page.curr = res.data.pageIndex;
sheetTableInfo.value.page.limit = res.data.pageSize;
sheetTableInfo.value.page.rows = res.data.totalRows;
} else {
ElMessage.error(res.msg);
}
})
.catch((res) => {
......@@ -408,18 +491,18 @@ const getSheetTableData = () => {
};
// 获取字段表格数据
const getFieldTableData = () => {
const getFieldTableData = (param = {}) => {
fieldTableInfo.value.loading = true;
execTaskFieldList(
Object.assign({}, { ...sheetParams.value }, {
isClassify: checked1.value ? 'Y' : 'N',
changeStatus: '',
execGuid: taskDetail.value.execGuid,
pageIndex: fieldTableInfo.value.page.curr,
pageSize: fieldTableInfo.value.page.limit,
classifyDetailGuid: currTreeNode.value.guid == 'all' || currTreeNode.value.guid == 'unclassified' ? '' : currTreeNode.value.guid,
})
).then((res: any) => {
let params: any = {
...fieldParams.value,
...param,
execGuid: taskDetail.value.execGuid,
pageIndex: fieldTableInfo.value.page.curr,
pageSize: fieldTableInfo.value.page.limit,
}
params.classifyDetail = params.classifyName && params.classifyName.length ? params.classifyName.at(-1) : '';
delete params.classifyName
execTaskFieldList(params).then((res: any) => {
fieldTableInfo.value.loading = false;
if (res.code == proxy.$passCode) {
let data = res.data.records || [];
......@@ -428,6 +511,8 @@ const getFieldTableData = () => {
fieldTableInfo.value.page.curr = res.data.pageIndex;
fieldTableInfo.value.page.limit = res.data.pageSize;
fieldTableInfo.value.page.rows = res.data.totalRows;
} else {
ElMessage.error(res.msg);
}
})
.catch((res) => {
......@@ -439,6 +524,14 @@ const tableCellClassName = (scope) => {
return (scope.column.label == '分类' || scope.column.label == '分级') && scope.row['STATE'] === 'Running' ? 'edit_cell' : ''
}
const rowSelectable = (row, index) => {
return row.selectable ?? true;
};
const tableSelectionChange = (val) => {
selectRowData.value = val;
};
const getCascaderCheckedData = () => {
const formCascader = cascaderRef.value[0] || cascaderRef.value;
const data = formCascader.getCheckedNodes();
......@@ -451,17 +544,20 @@ const tableBtnClick = (scope, btn) => {
currTableData.value = row;
if (type == 'tab') {
tabsInfo.value.activeName = 'field';
fieldItemList.value[2].default = row.tableName;
getFieldTableData({ databaseGuid: row.databaseGuid, tableGuid: row.tableGuid });
fieldItemList.value[1].default = row.databaseGuid;
fieldItemList.value[2].disabled = false;
getSheetFieldList({ type: 2, databaseGuid: row.databaseGuid }, row.tableGuid);
} else if (type == "edit") {
row.STATE = 'Running';
} else if (type == 'save') {
const cascaderData = getCascaderCheckedData();
row.classifyNames = cascaderData.length ? cascaderData.pathLabels : [];
row.classifyGuids = cascaderData.length ? cascaderData.pathValues : [];
row.classifyDetailGuid = cascaderData.length ? cascaderData.value : '';
row.classifyDetailName = cascaderData.length ? cascaderData.label : '';
row.classifyDetailNameRoutes = cascaderData.length ? cascaderData[0].pathLabels : [];
row.classifyDetailGuidRoutes = cascaderData.length ? cascaderData[0].pathValues : [];
row.classifyDetailGuid = cascaderData.length ? cascaderData[0].value : '';
row.classifyDetailName = cascaderData.length ? cascaderData[0].label : '';
row.STATE = '';
if (cascaderData.length && row.gradeDetailGuid) {
if (cascaderData.length && row.gradeDetailName) {
const params = [
{
guid: row.guid,
......@@ -493,14 +589,19 @@ const btnClick = async (btn, bType = null) => {
if (type == 'path') {
router.push({
name: "classifyGradeCatalogue",
// query: { guid: taskDetail.value.damGuid },
});
} else if (type == 'batch') {
if (selectRowData.value.length == 0) {
ElMessage.warning('请选择需要操作的数据');
return
}
dialogInfo.value.visible = true;
} else if (type == 'cancel') {
router.push({
name: "taskConfig",
});
} else if (type == 'confirm') {
saveTask();
}
};
......@@ -510,18 +611,22 @@ const saveFields = (params, isBatch = false) => {
if (res.code == proxy.$passCode) {
ElMessage.success('保存成功');
isBatch && getFieldTableData();
} else {
ElMessage.error(res.msg);
}
})
}
// 任务确认
const saveTask = (params) => {
execTaskConfirm(params).then((res: any) => {
const saveTask = () => {
execTaskConfirm({ execGuid: taskDetail.value.execGuid }).then((res: any) => {
if (res.code == proxy.$passCode) {
ElMessage.success('保存成功');
router.push({
name: "taskConfig",
});
} else {
ElMessage.error(res.msg);
}
})
}
......@@ -543,35 +648,69 @@ const searchField = (val: any, clear: boolean = false) => {
getFieldTableData();
};
const cascaderChange = (val) => {
// dictionaryGuid.value = val ? val.at(-1) : ''
const checkboxChange = (val) => {
getFieldTableData({ isClassify: val ? 'N' : 'Y' });
}
const selectChange = (val) => {
// standardSetGuid.value = val
const selectChange = (val, item, scope = null) => {
if (scope) {
let row = scope.row;
row.gradeGuid = val || '';
row.gradeDetailName = val ? item.options.find(i => i.guid == val)?.gradeName : '';
} else {
if (tabsInfo.value.activeName == 'sheet') {
if (!val) {
sheetItemList.value[1].default = '';
sheetItemList.value[1].disabled = true;
} else {
sheetItemList.value[1].disabled = false;
}
} else {
if (item.field == "databaseGuid") {
if (!val) {
fieldItemList.value[2].default = '';
fieldItemList.value[3].default = '';
fieldItemList.value[2].disabled = true;
fieldItemList.value[3].disabled = true;
} else {
fieldItemList.value[2].disabled = false;
}
} else {
if (!val) {
fieldItemList.value[3].default = '';
fieldItemList.value[3].disabled = true;
} else {
fieldItemList.value[3].disabled = false;
}
}
}
if (val) {
const params = {
type: item.field == "databaseGuid" ? 2 : 3,
dbGuid: val || ''
}
getSheetFieldList(params)
}
}
}
const dialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
// let daInfo = assetListData.value.find(a => a.guid == info.registerGuid);
// savePromise.value = saveQuality({
// tenantGuid: userData.tenantGuid,
// registerGuid: info.registerGuid,
// daName: daInfo.daName,
// registerTime: daInfo.registerTime,
// issuingEntityGuid: daInfo.exchangeGuid,
// qualityEvaluationFile: info.qualityEvaluationFile?.map(f => f.url) || []
// }).then((res: any) => {
// savePromise.value = null;
// if (res?.code == proxy.$passCode) {
// ElMessage.success('质量评价发起成功');
// dialogInfo.value.visible = false;
// page.value.curr = 1;
// getTableData();
// } else {
// ElMessage.error(res.msg);
// }
// })
let params: any = []
const cascaderData = dialogRef.value.getCascaderCheckedData();
const gradeName = gradeList.value.find(i => i.guid == info.gradeGuid)?.gradeName;
selectRowData.value.map((item: any) => {
const param = {
guid: item.guid,
classifyDetailGuid: cascaderData[0].value,
classifyDetailName: cascaderData[0].label,
gradeDetailGuid: info.gradeGuid,
gradeDetailName: gradeName,
}
params.push(param)
})
saveFields(params, true);
dialogInfo.value.visible = false;
} else if (btn.value == 'cancel') {
dialogInfo.value.visible = false;
}
......@@ -582,7 +721,13 @@ onActivated(() => {
})
onBeforeMount(() => {
getTaskDetail({ guid: route.query.guid })
taskDetail.value = detailData;
getFieldCount()
getSheetFieldList({ type: 1 });
getFieldTree()
getSheetTableData();
getFieldTableData();
getGradeData();
})
</script>
......@@ -595,7 +740,9 @@ onBeforeMount(() => {
<div class="panel_title">
<div class="title_wrap">
<span class="title_text">{{ taskDetail.taskName }}</span>
<el-tag type="warning">{{ filterVal(taskDetail.confirmStatus, 'confirmStatus') }}</el-tag>
<el-tag :type="taskDetail.confirmStatus == 'Y' ? 'success' : 'warning'">{{
filterVal(taskDetail.confirmStatus,
'confirmStatus') }}</el-tag>
</div>
</div>
<div class="title_desc">
......@@ -645,7 +792,8 @@ onBeforeMount(() => {
<Tabs class="panel_tabs" :tabs-info="tabsInfo" @tab-change="tabChange" />
<div class="panel" v-show="tabsInfo.activeName == 'sheet'">
<div class="table_tool_wrap">
<TableTools :searchItems="sheetItemList" :searchId="'sheet-search'" :init="false" @search="searchSheet" />
<TableTools :searchItems="sheetItemList" :searchId="'sheet-search'" :init="false"
@selectChange="selectChange" @search="searchSheet" />
</div>
<div class="table_panel_wrap">
<Table :tableInfo="sheetTableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
......@@ -653,12 +801,12 @@ onBeforeMount(() => {
</div>
<div class="panel flex" v-show="tabsInfo.activeName == 'field'">
<div class="box_left">
<Tree :treeInfo="treeInfo" @nodeClick="nodeClick" />
<Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" />
</div>
<div class="box_right">
<div class="table_tool_wrap">
<TableTools :searchItems="fieldItemList" :searchId="'field-search'" :init="false"
@search="searchField" />
@selectChange="selectChange" @search="searchField" />
<div class="tools_btns">
<div class="btns">
<el-button type="primary" plain @click="btnClick({ value: 'batch' })">批量变量分类分级</el-button>
......@@ -666,7 +814,7 @@ onBeforeMount(() => {
<el-button plain @click="btnClick({ value: 'export' })">导出</el-button>
</div>
<div class="checkboxs">
<el-checkbox v-model="checked1">仅看未分级分类</el-checkbox>
<el-checkbox v-model="checked1" @change="(val) => checkboxChange(val)">仅看未分级分类</el-checkbox>
<!-- <el-checkbox v-model="checked2">仅看变更</el-checkbox> -->
</div>
</div>
......@@ -675,19 +823,32 @@ onBeforeMount(() => {
<div class="table_panel" v-loading="fieldTableInfo.loading">
<el-table ref="costTableRef" :data="fieldTableInfo.data" border :height="'100%'"
style="width: 100%; display: inline-block" :style="{ 'max-height': 'calc(100% - 44px)' }"
:cell-class-name="tableCellClassName">
:cell-class-name="tableCellClassName" @selection-change="tableSelectionChange">
<el-table-column type="selection" align="center" :width="32" :selectable="rowSelectable"
fixed="left" />
<el-table-column v-for="(item, i) in fieldTableInfo.fields" :label="item.label" :width="item.width"
:min-width="item.minWidth" :fixed="item.fixed" :align="item.align"
:sortable="item.sortable ?? false" :prop="item.field" :class-name="item.columClass"
show-overflow-tooltip>
<template #default="scope">
<el-tag v-if="item.type == 'tag'"
<span v-if="item.type == 'index'">
{{
fieldTableInfo.page.curr !== undefined
? (fieldTableInfo.page.curr - 1) * fieldTableInfo.page.limit + scope.$index + 1
: scope.$index + 1
}}
</span>
<el-tag v-else-if="item.type == 'tag'"
:type="item.tagType ? item.tagType(scope) : tagType(scope.row, item.field)">{{
item.getName ? item.getName(scope) : tagMethod(scope.row, item.field)
}}</el-tag>
<el-select v-else-if="item.type == 'select' && scope.row['STATE'] === 'Running'"
v-model="scope.row[item.field]" :placeholder="item.placeholder"
:disabled="item.disabled ?? false" :clearable="item.clearable ?? true" size="small" />
:disabled="item.disabled ?? false" :clearable="item.clearable ?? true" size="small"
@change="(val) => selectChange(val, item, scope)">
<el-option v-for="opt in item.options" :key="opt.value"
:label="opt[item.props?.label ?? 'label']" :value="opt[item.props?.value ?? 'value']" />
</el-select>
<el-cascader v-else-if="item.type == 'cascader' && scope.row['STATE'] === 'Running'"
ref="cascaderRef" v-model="scope.row[item.field]" :options="item.options" :props="item.props"
:show-all-levels="item.showAllLevels ?? true" :disabled="item.disabled ?? false"
......@@ -722,8 +883,7 @@ onBeforeMount(() => {
</div>
</div>
</div>
<Dialog :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" @cascaderChange="cascaderChange"
@selectChange="selectChange" />
<Dialog ref="dialogRef" :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" />
</div>
</template>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!