93b2de50 by lihua

策略管理接口联调

1 parent 226331d6
# 页面标题
VITE_APP_TITLE = 可信数据空间
VITE_APP_TITLE = 可信数据服务平台
# 接口域名
# VITE_API_BASEURL = https://www.zgsjzc.com/api
# VITE_API_BASEURL = https://swzl-test.csbr.cn/api
......
import request from "@/utils/request";
/** 数据交付 */
export const getPageList = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract-delivery/page-list`,
method: 'post',
data: params
})
export const deleteDeliveryContract = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract-delivery/delete`,
method: 'delete',
data: params
});
\ No newline at end of file
......@@ -154,6 +154,12 @@ export const getContractDataProduct = (tenantGuid) => request({
method: 'post'
})
/** 获取下拉数据产品列表的去重字段 */
export const getDamFieldsByProductGuid = (productGuid) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/field-by-dam-guid?productGuid=${productGuid}`,
method: 'post'
})
/** 创建合约 */
export const saveContract = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract/save`,
......
import type { RouteRecordRaw } from 'vue-router'
function Layout() {
return import('@/layouts/index.vue')
}
const routes: RouteRecordRaw[] = [
{
path: '/data-asset/data-delivery',
component: Layout,
meta: {
title: '数据交付',
icon: 'sidebar-videos',
},
children: [
{
path: '',
name: 'dataDelivery',
component: () => import('@/views/data_asset/dataDelivery.vue'),
meta: {
title: '',
sidebar: false,
breadcrumb: false,
cache: true
},
},
],
},
]
export default routes
......@@ -6,6 +6,7 @@ import DataService from './modules/dataService';
import DataSmartContract from './modules/dataSmartContract';
import DataFacilitator from './modules/dataFacilitator';
import HomeIndex from './modules/homeIndex';
import DataDelivery from './modules/dataDelivery';
import useSettingsStore from '@/store/modules/settings'
......@@ -97,6 +98,7 @@ const asyncRoutes: RouteRecordRaw[] = [
...DataSmartContract,
...DataFacilitator,
...HomeIndex,
...DataDelivery,
// ...DataAssetRegistry,
]
......
......@@ -40,7 +40,7 @@ const globalSettings: Settings.all = {
},
"home": {
"enable": false,
"title": "可信数据空间"
"title": "可信数据服务平台"
},
"breadcrumb": {
"enable": true
......
<route lang="yaml">
name: notFound
meta:
title: 可信数据空间
title: 可信数据服务平台
constant: true
layout: false
</route>
......
<script lang="ts" setup name="dataDelivery">
import TableTools from "@/components/Tools/table_tools.vue";
import { commonPageConfig } from '@/utils/enum';
import {
getPageList,
deleteDeliveryContract
} from "@/api/modules/dataDelivery";
const router = useRouter();
const route = useRoute();
const { proxy } = getCurrentInstance() as any;
/** 核验状态列表 */
const verifySatusList = ref([{
value: 1,
label: '未执行'
}, {
value: 2,
label: '已执行'
}, {
value: 3,
label: '通过'
}, {
value: 4,
label: '未通过'
}]);
const searchItemList = ref([
{
type: "input",
label: "",
field: "dataProductName",
default: "",
placeholder: "数据产品名称",
maxlength: 50,
clearable: true,
},
{
type: "input",
label: "",
field: "contractName",
default: "",
placeholder: "合约名称",
maxlength: 50,
clearable: true,
},
{
type: 'select',
label: '',
field: 'verifySatus',
default: '',
placeholder: '核验状态',
options: verifySatusList.value,
filterable: true,
clearable: true
}
]);
const tableFields = ref([
{ label: "序号", type: "index", width: 56, align: "center" },
{
label: "数据产品名称", field: "dataProductName", width: 150, type: "text_btn", columClass: 'text_btn', value: "detail", click: (scope) => {
router.push({
name: 'productListingDetail',
query: {
guid: scope.row.dataProductGuid,
type: 'detail',
name: scope.row.dataProductName,
}
});
}
},
{
label: "合约名称", field: "contractName", width: 160, type: "text_btn", columClass: 'text_btn', value: "detail1", click: (scope) => {
//履约中的合约状态
router.push({
name: 'smartContractDetail',
query: {
guid: scope.row.guid,
name: scope.row.contractName,
type: 'keepAgree',
isDetail: 'Y'
}
});
}
},
{ label: "交付方式", field: "deliveryMethod", width: 120 },
{
label: "交付状态", field: "deliveryStatus", type: "tag", width: 96, align: 'center',
getName: (scope) => {
const deliveryStatus = scope.row.deliveryStatus
switch (deliveryStatus) {
case 1:
return '未交付';
case 2:
return '已交付';
case 3:
return '交付中';
default:
return '--';
}
}, tagType: (scope) => {
const deliveryStatus = scope.row.deliveryStatus
switch (deliveryStatus) {
case 3:
return 'warning';
case 2:
return 'success';
case 1:
return 'info';
default:
return 'info';
}
}
},
{
label: "核验状态", field: "verifySatus", type: "tag", width: 96, align: 'center',
getName: (scope) => {
const verifySatus = scope.row.verifySatus
switch (verifySatus) {
case 1:
return '未执行';
case 2:
return '已执行';
case 3:
return '通过';
case 4:
return '未通过';
default:
return '--';
}
}, tagType: (scope) => {
const verifySatus = scope.row.verifySatus
switch (verifySatus) {
case 1:
return 'info';
case 3:
return 'success';
case 2:
return 'warning';
case 4:
return 'danger';
default:
return 'info';
}
}
},
{ label: "核验时间", field: "verifyTime", width: 170 },
{ label: "交付时间", field: "deliveryTime", width: 170 },
]);
const page = ref({
...commonPageConfig,
dataProductName: '',
contractName: '',
verifySatus: ''
});
const currTableData: any = ref({});
const tableInfo = ref({
id: 'contract-table',
rowKey: 'guid',
loading: false,
fields: tableFields.value,
data: [{ verifySatus: 4 }, {}],
page: {
type: "normal",
rows: 0,
...page.value,
},
actionInfo: {
label: "操作",
type: "btn",
width: 160,
btns: (scope) => {
let btns: any = [];
let row = scope.row;
let deliveryStatus = row.deliveryStatus;
if (deliveryStatus == 2) {//已交付有删除按钮
btns.push({
value: 'del', label: '删除', click: (scope) => {
proxy.$openMessageBox("此操作将永久删除, 是否继续?", () => {
deleteDeliveryContract([scope.row.guid]).then((res: any) => {
if (res?.code == proxy.$passCode) {
page.value.curr = 1;
getTableData();
proxy.$ElMessage.success('删除成功');
} else {
res?.msg && proxy.$ElMessage.error(res?.msg);
}
});
}, () => {
proxy.$ElMessage.info("已取消");
})
}
});
} else {
btns.push({
value: 'refresh', label: '刷新', click: (scope) => {
}
});
}
// 交付只有核验通过有。
let verifySatus = row.verifySatus;
if (verifySatus == 2) {
btns.push({
value: 'verify', label: '核验', click: (scope) => {
}
});
}
return btns;
}
}
});
const toSearch = (val: any, clear: boolean = false) => {
if (clear) {
searchItemList.value.map((item) => (item.default = ""));
page.value.dataProductName = '';
page.value.contractName = '';
page.value.verifySatus = "";
} else {
page.value.dataProductName = val.dataProductName;
page.value.contractName = val.contractName;
page.value.verifySatus = val.verifySatus;
}
getTableData();
};
const getTableData = () => {
tableInfo.value.loading = true
getPageList({
pageIndex: page.value.curr,
pageSize: page.value.limit,
dataProductName: page.value.dataProductName,
contractName: page.value.contractName,
verifySatus: page.value.verifySatus
}).then((res: any) => {
tableInfo.value.loading = false
if (res?.code == proxy.$passCode) {
const data = res.data || {}
// tableInfo.value.data = data.records || []
tableInfo.value.page.limit = data.pageSize
tableInfo.value.page.curr = data.pageIndex
tableInfo.value.page.rows = data.totalRows
} else {
res?.msg && proxy.$ElMessage.error(res?.msg)
}
}).catch(() => {
tableInfo.value.loading = false
})
};
const tablePageChange = (info) => {
page.value.curr = Number(info.curr);
page.value.limit = Number(info.limit);
tableInfo.value.page.curr = page.value.curr;
tableInfo.value.page.limit = page.value.limit;
getTableData();
};
onBeforeMount(() => {
toSearch({});
});
</script>
<template>
<div class="container_wrap">
<div class="table_tool_wrap">
<TableTools :searchItems="searchItemList" :searchId="'contract-search'" @search="toSearch" :init="false" />
</div>
<div class="table_panel_wrap" style="height: calc(100% - 44px);">
<Table :tableInfo="tableInfo" @tablePageChange="tablePageChange" />
</div>
</div>
</template>
<style lang="scss" scoped>
.container_wrap {
padding: 0px 16px;
}
</style>
\ No newline at end of file
......@@ -67,9 +67,24 @@
<span style="color:red;margin-left: 2px;">*</span>
</template>
<template #default="scope">
<el-input v-if="!isLook" v-model="scope.row['constraintValue']" placeholder="请输入" :maxlength="200"
@change="(val) => handleOperatorSelectChange(val, scope, 'constraintValue')" clearable></el-input>
<span v-else>{{ scope.row['constraintValue'] || '--' }}</span>
<el-input
v-if="!isLook && !((scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector' || scope.row.constraintEnName == 'limitField'))"
v-model="scope.row['constraintValue']" placeholder="请输入" :maxlength="200"
@change="(val) => handleOperatorSelectChange(val, scope, 'constraintValue')" clearable></el-input>
<!-- 限定连接器 -->
<el-select
v-else-if="!isLook && (scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector')"
v-model="scope.row['constraintConnectorValue']" :remote="true" :remote-method="remoteMethod" filterable clearable placeholder="请选择">
<el-option v-for="opt in connectorList" :key="opt['guid']" :label="opt['connectorName']"
:value="opt['guid']" />
</el-select>
<!-- 加密字段 -->
<el-select v-else-if="!isLook && scope.row.constraintEnName == 'limitField'"
v-model="scope.row['constraintValue']" filterable clearable placeholder="请选择">
<el-option v-for="opt in productFieldList" :key="opt['enName']" :label="opt['chName']"
:value="opt['guid']" />
</el-select>
<span v-else>{{ scope.row['constraintFieldValue'] || '--' }}</span>
</template>
</el-table-column>
<el-table-column v-if="!isLook" label="操作" width="140px" align="left" fixed="right" show-overflow-tooltip>
......
......@@ -13,6 +13,7 @@ import {
getContractTenantList,
saveContract,
updateContract,
getDamFieldsByProductGuid
} from "@/api/modules/dataSmartContract"
import StrategyTable from "./components/strategyTable.vue";
import { CirclePlus } from "@element-plus/icons-vue";
......@@ -239,6 +240,7 @@ const productTableInfo = ref({
{ label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
{ label: "数据产品", field: "dataProductId", width: 180, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "数据产品编码", field: "dataProductId", width: 261 },
{ label: "产品类型", field: "dataProductTypeName", width: 100 },
{ label: "所属主体名称", field: "dataProductEntityName", width: 200 },
{ label: "产品简介", field: "dataProductAbstract", width: 240 },
],
......@@ -304,6 +306,22 @@ const hanldeTableSelectChange = (val, scope, item) => {
scope.row.dataProductEntityId = productItem?.enterpriseCode;
scope.row.dataProductAbstract = productItem?.description;
scope.row.dataProductEntityName = productItem?.enterpriseName;
scope.row.dataProductGuid = productItem?.productGuid;
scope.row.dataProductType = productItem?.productType;
scope.row.dataProductTypeName = productItem?.productTypeName;
/** 选择了产品,需要重新查询去重字段 */
if (val?.productGuid) {
getDamFieldsByProductGuid(val?.productGuid).then((res: any) => {
if (res?.code == proxy.$passCode) {
productFieldList.value = res.data || [];
} else {
productFieldList.value = [];
res?.msg && proxy.$ElMessage.error(res?.msg)
}
})
} else {
productFieldList.value = [];
}
// 连接器只能选择数据提供方的产品,不需要切换了
// let nodeInfo = nodeInfoFormRef.value.formInline;
// nodeInfoFormItems.value.forEach((item, index) => {
......@@ -417,6 +435,9 @@ const constraintOptionsList: any = ref([]);
/** 策略操作行为下拉列表 */
const actionOptionsList: any = ref([]);
/** 根据选择的数据产品显示限定字段下拉列表 */
const productFieldList :any = ref([]);
const getSubmitInfo = () => {
let baseInfo = baseInfoFormRef.value.formInline;
let nodeInfo = nodeInfoFormRef.value.formInline;
......@@ -815,7 +836,7 @@ onActivated(() => {
<Form ref="nodeInfoFormRef" formId="node-info-form" :itemList="nodeInfoFormItems" :rules="nodeInfoFormRules"
@select-change="handleNodeSelectChange" col="col3" />
<StrategyTable ref="strategyTableRef" :show-title="true" :value="detailInfo.policys || []"
:operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList"
:operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" :productFieldList="productFieldList"
:constraintOptionsList="constraintOptionsList"></StrategyTable>
</ContentWrap>
</div>
......
......@@ -154,7 +154,7 @@ function testAccount(logonUser: string) {
<div>
<img :src="banner" class="banner">
<div class="banner_desc">
<h4>可信数据空间</h4>
<h4>可信数据服务平台</h4>
<span>激活数据流通体系,释放数据要素新质生产力</span>
</div>
</div>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!