d8c0a524 by xukangle

Merge branch 'develop' into dev_20241202_xukangle

2 parents 3dc89fb7 f9834367
......@@ -646,7 +646,7 @@ onMounted(() => {
</span>
</template>
<span class="operate_btn active">
<el-dropdown trigger="hover" :show-timeout="50" >
<el-dropdown trigger="hover" :show-timeout="50" >
<span class="text_btn">...</span>
<template #dropdown>
......
......@@ -288,8 +288,8 @@ const getMsgCnt = () => {
}
onMounted(() => {
getMsgCnt();
createServerConnect();
//getMsgCnt();
//createServerConnect();
});
</script>
......
......@@ -24,6 +24,27 @@ const routes: RouteRecordRaw[] = [
},
},
{
path: 'task-edit',
name: 'taskEdit',
component: () => import('@/views/data_inventory/taskEdit.vue'),
meta: {
title: '编辑-',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true,
editPage: true,
activeMenu: '/data-inventory/classify-grade-manage/template-config'
},
beforeEnter: (to, from) => {
if (to.query.name) {
to.meta.title = `编辑-${to.query.name}`;
} else {
to.meta.title = '分类分级任务-新增';
}
}
},
{
path: 'template-config',
name: 'templateConfig',
component: () => import('@/views/data_inventory/templateConfig.vue'),
......
......@@ -31,6 +31,7 @@ service.interceptors.request.use(
* 为每一次请求生成一个cancleToken
*/
const source = axios.CancelToken.source();
config.headers.tenant = '6646dcad76c411eea911fa163e419da9'; //会员guid先写死
config.cancelToken = source.token;
if (config.method === "postfile") {
config.method = "post";
......
<route lang="yaml">
name: taskConfig //分类分级任务
</route>
<script lang="ts" setup name="taskConfig">
import { ref ,onMounted} from "vue";
import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import useUserStore from "@/store/modules/user";
import { ElMessage, ElMessageBox } from "element-plus";
import useDataAssetStore from "@/store/modules/dataAsset";
import { getListingList, listingDelete, listingUpdateStatus, filterVal, getParamsDataList } from "@/api/modules/dataProduct";
import { TableColumnWidth } from '@/utils/enum';
import Table from "@/components/Table/index.vue";
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const userStore = useUserStore();
const userData = JSON.parse(userStore.userData);
const assetStore = useDataAssetStore();
const page = ref({
limit: 50,
curr: 1,
sizes: [
{ label: "10", value: 10 },
{ label: "50", value: 50 },
{ label: "100", value: 100 },
{ label: "150", value: 150 },
{ label: "200", value: 200 },
],
});
const searchItemValue: any = ref({});
const currTableData: any = ref({});
const tableInfo = ref({
id: "mapping-table",
fields: [
{ label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
{ label: "任务名称", field: "damCode", width: 96 },
{ label: "目录名称", field: "damName", width: 120 },
{ label: "分类分级模板", field: "damTypeName", width: 200 },
{ label: "元数据", field: "damTypeName", width: 200 },
// {
// label: "是否公共数据", field: "isPublicData", width: 120, getName: (scope) => {
// return scope.row.isPublicData == 'Y' ? '是' : '否';
// }
// },
{
label: "执行状态", field: "approveState", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
return filterVal(scope.row.approveState, 'approveState');
}
},
{ label: "任务修改人", field: "damName", width: 120 },
{ label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
{ label: "确认次数", field: "damName", width: 96, align: 'right' },
{ label: "结果确认人", field: "damName", width: 120 },
{ label: "确认时间", field: "updateTime", width: TableColumnWidth.DATETIME },
{
label: "结果状态", field: "approveState", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
return filterVal(scope.row.approveState, 'approveState');
}
},
],
loading: false,
data: [],
page: {
type: "normal",
rows: 0,
...page.value,
},
actionInfo: {
label: "操作",
type: "btn",
width: 200,
btns: (scope) => {
let row = scope.row, btnArr: any = [];
if (row.approveState == 'Y') {
if (row.listingStatus == 'Y') {
btnArr.splice(0, 0, { label: "详情", value: "detail" });
} else {
btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
}
} else {
if (row.approveState == 'A') {
btnArr.splice(0, 0, { label: "详情", value: "detail" });
} else {
btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
}
}
return btnArr;
},
},
});
const getTableData = () => {
tableInfo.value.loading = true;
getListingList(
Object.assign({}, searchItemValue.value, {
pageIndex: page.value.curr,
pageSize: page.value.limit,
})
).then((res: any) => {
tableInfo.value.loading = false;
tableInfo.value.data = res.data.records || [];
tableInfo.value.page.curr = res.data.pageIndex;
tableInfo.value.page.limit = res.data.pageSize;
tableInfo.value.page.rows = res.data.totalRows;
})
.catch((res) => {
tableInfo.value.loading = false;
});
};
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
currTableData.value = row;
if (type == "detail" || type === "edit") {
toPath(type);
} else if (type === "delete") {
open("此操作将永久删除,是否继续?", "warning");
}
};
const toPath = (type) => {
if (type == 'add') {
router.push({
name: "taskEdit",
query: {
type
},
});
} else {
router.push({
name: "taskEdit",
query: {
guid: currTableData.value.guid,
name: currTableData.value.damName,
type
},
});
}
}
const tablePageChange = (info) => {
page.value.curr = Number(info.curr);
page.value.limit = Number(info.limit);
tableInfo.value.page.limit = page.value.limit;
tableInfo.value.page.curr = page.value.curr;
getTableData();
};
const open = (msg, type, isBatch = false) => {
ElMessageBox.confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: type,
}).then(() => {
const guids = [currTableData.value.guid];
listingDelete(guids).then((res: any) => {
if (res.code == proxy.$passCode) {
getFirstPageData();
ElMessage({
type: "success",
message: "删除成功",
});
} else {
ElMessage({
type: "error",
message: res.msg,
});
}
}).catch((res) => {
tableInfo.value.loading = false;
});
});
};
const getFirstPageData = () => {
page.value.curr = 1
tableInfo.value.page.curr = 1;
getTableData();
}
onActivated(() => {
if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
getFirstPageData();
assetStore.set(false);
}
})
onBeforeMount(() => {
})
</script>
<template>
<div>分类分级任务</div>
<div class="container_wrap" v-if="tableInfo.data.length">
<div class="table_tool_wrap">
<div class="table_title">分类分级任务</div>
</div>
<div class="table_panel_wrap">
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
</div>
</div>
<div class="container_wrap" v-else>
<div class="card-noData">
<img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
<p>暂无分类分级任务,<span class="text_btn" @click="toPath('add')">去新建</span></p>
</div>
</div>
</template>
<style lang="scss" scoped>
<style scoped lang="scss">
.table_tool_wrap {
width: 100%;
height: 40px !important;
padding: 0 8px;
.table_title {
height: 40px;
line-height: 40px;
font-weight: 600;
font-size: 16px;
color: #212121;
}
}
.table_panel_wrap {
width: 100%;
height: calc(100% - 40px);
padding: 0px 8px 0;
}
</style>
\ No newline at end of file
.card-noData {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
</style>
......
......@@ -332,6 +332,33 @@ const transformRulesInfo = (info: any) => {
})]
}));
}
} else if (info.ruleCode == 'norm_check') {
let subjectTables = toSubjectTables.value;
for (const ds in info.ruleFields) {
let fields = info.ruleFields[ds];
let tableInfo = subjectTables.find(t => t.enName === ds);
modelRules.push(Object.assign({}, {
modelGroupGuid: modelGroupGuid.value,
name: tableInfo.chName,
subjectName: tableInfo.enName,
subjectGuid: tableInfo.guid,
dataSourceGuid: tableInfo.dataSourceGuid,
databaseName: tableInfo.dataServerName,
modelRuleConfList: [Object.assign({}, info, {
ruleField: fields.map(f => {
return {
guid: f.guid,
enName: f.enName,
chName: f.chName,
dataType: f.dataType,
checkRule: f.checkRule,
configValue: f.configValue
}
}),
ruleFields: ''
})]
}));
}
} else if (info.ruleCode == 'ref_integrality') {
let subjectTables = toSubjectTables.value;
info.ruleFields.forEach(row => {
......
......@@ -140,6 +140,25 @@ const transformRulesInfo = (info: any) => {
}),
ruleFields: ''
});
} else if (info.ruleCode == 'norm_check') {
let subjectName = detailInfo.value.subjectName;
let fields = info.ruleFields[subjectName];
return Object.assign({}, info, {
guid: ruleGuid,
qualityModelGuid: detailInfo.value.qualityModelGuid,
ruleCode: detailInfo.value.ruleCode,
ruleField: fields.map(f => {
return {
guid: f.guid,
enName: f.enName,
chName: f.chName,
dataType: f.dataType,
checkRule: f.checkRule,
configValue: f.configValue
}
}),
ruleFields: ''
});
} else if (info.ruleCode == 'ref_integrality') {
return Object.assign({}, info, {
guid: ruleGuid,
......
......@@ -135,6 +135,24 @@ const transformRulesInfo = (info) => {
}),
ruleFields: ''
});
} else if (info.ruleCode == 'norm_check') {
let subjectName = modelDetailInfo.value.subjectName;
let fields = info.ruleFields[subjectName];
return Object.assign({}, info, {
qualityModelGuid: modelGuid,
ruleCode: info.ruleCode,
ruleField: fields.map(f => {
return {
guid: f.guid,
enName: f.enName,
chName: f.chName,
dataType: f.dataType,
checkRule: f.checkRule,
configValue: f.configValue
}
}),
ruleFields: ''
});
} else if (info.ruleCode == 'ref_integrality') {
return Object.assign({}, info, {
qualityModelGuid: modelGuid,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!