00803703 by lihua

授权运营时间起止改为一个日期范围选择框

1 parent 14093d2b
......@@ -418,6 +418,11 @@ onMounted(() => {
<el-date-picker v-else-if="editForm[item.field] && editForm[item.field].type == 'date'" v-model="scope.row[item.field]" :placeholder="editForm[item.field].placeholder"
:clearable="editForm[item.field].clearable" type="date"
format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
<el-date-picker v-else-if="editForm[item.field] && editForm[item.field].type == 'date-picker'" style="width: 240px;"
v-model="scope.row[item.field]" type="daterange" range-separator="至" start-placeholder="开始日期" :format="item.format ?? 'YYYY-MM-DD'"
:value-format="item.valueFormat ?? 'YYYY-MM-DD'"
end-placeholder="结束日期" :unlink-panels="item.unlink ?? false" :shortcuts="item.shortcuts ?? []"
:default-value="item.defaultDate" :disabled="item.disabled ?? false" />
<template v-else-if="editForm[item.field] && editForm[item.field].type == 'defaultValue'">
<el-date-picker v-if="scope.row[item.dataTypeName] === 'date'" v-model="scope.row[item.field]" type="date"
format="YYYY-MM-DD" value-format="YYYY-MM-DD" :placeholder="editForm[item.field].placeholder" />
......
......@@ -422,8 +422,9 @@ const authSourceTableInfo = ref({
height: '214px',
fields: [
{ label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
{ label: "授权运营时间起", field: "authOperatTimeStart", width: 140 },
{ label: "授权运营时间止", field: "authOperatTimeEnd", width: 140 },
{ label: "授权运营时间", field: "authOperatTimeStart", width: 200, getName: (scope) => {
return scope.row.authOperatTimeStart + '至' + scope.row.authOperatTimeEnd;
} },
{ label: "数据资源登记确认单编码", field: "dataRegistCode", width: 200 },
{ label: "数据资源登记名称", field: "dataRegistName", width: 160 },
],
......
......@@ -447,8 +447,7 @@ const handleProductBaseFormSelectChange = (val, row, info) => {
respParamsTableInfo.value.data = respParamsData.value;
authSourceData.value = detailValue.resourcesRSVOS?.map(d => {
return {
authOperatTimeStart: d.authOperatTimeStart,
authOperatTimeEnd: d.authOperatTimeEnd,
authOperatTimeRange: [d.authOperatTimeStart, d.authOperatTimeEnd],
dataRegistCode: d.dataRegistCode,
dataRegistName: d.dataRegistName
}
......@@ -1617,8 +1616,7 @@ const authSourceTableInfo = ref({
height: '214px',
fields: [
{ label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
{ label: "授权运营时间起", field: "authOperatTimeStart", width: 140, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "授权运营时间止", field: "authOperatTimeEnd", width: 140, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "授权运营时间", field: "authOperatTimeRange", width: 260, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "数据资源登记确认单编码", field: "dataRegistCode", width: 200, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "数据资源登记名称", field: "dataRegistName", width: 160, required: true, columClass: 'edit-colum', type: 'edit' },
],
......@@ -1641,22 +1639,30 @@ const authSourceTableInfo = ref({
placeholder: '请输入',
clearable: true,
},
authOperatTimeStart: {
authOperatTimeRange: {
label: '',
type: 'date',
field: 'authOperatTimeStart',
default: '',
placeholder: '请选择',
clearable: true,
},
authOperatTimeEnd: {
label: '',
type: 'date',
field: 'authOperatTimeEnd',
default: '',
type: 'date-picker',
field: 'authOperatTimeRange',
default: [],
placeholder: '请选择',
clearable: true,
},
// authOperatTimeStart: {
// label: '',
// type: 'date',
// field: 'authOperatTimeStart',
// default: '',
// placeholder: '请选择',
// clearable: true,
// },
// authOperatTimeEnd: {
// label: '',
// type: 'date',
// field: 'authOperatTimeEnd',
// default: '',
// placeholder: '请选择',
// clearable: true,
// },
},
STATUS: 'edit',
data: authSourceData.value,
......@@ -1687,7 +1693,7 @@ const authSourceTableInfo = ref({
/** 给表格添加一行入参定义。 */
const addAuthSources = () => {
authSourceData.value.push({ authOperatTimeStart: '', authOperatTimeEnd: '', dataRegistCode: '', dataRegistName: '' });
authSourceData.value.push({ authOperatTimeRange: [], dataRegistCode: '', dataRegistName: '' });
authSourceTableInfo.value.data = authSourceData.value;
nextTick(() => {
scrollLastRowToView(authSourceTableRef.value?.tableRef, authSourceData.value.length);
......@@ -1995,7 +2001,7 @@ onBeforeMount(async () => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
detailInfo.value = res.data || {};
// detailInfo.value.productName = detailInfo.value.damGuid ? detailInfo.value.damGuid : detailInfo.value.productName;
// detailInfo.value.productName = detailInfo.value.damGuid ? detailInfo.value.damGuid : detailInfo.value.productName;
if (detailInfo.value.damGuid) {
const opt = registerCatalogList.value.find(item => item.guid == detailInfo.value.damGuid);
productBaseInfoItems.value[0].default = opt ? opt.guid : detailInfo.value.productName;
......@@ -2049,8 +2055,9 @@ onBeforeMount(async () => {
respParamsTableInfo.value.data = respParamsData.value;
authSourceData.value = detailInfo.value.resourcesRSVOS?.map(d => {
return {
authOperatTimeStart: d.authOperatTimeStart,
authOperatTimeEnd: d.authOperatTimeEnd,
authOperatTimeRange: [d.authOperatTimeStart, d.authOperatTimeEnd],
// authOperatTimeStart: d.authOperatTimeStart,
// authOperatTimeEnd: d.authOperatTimeEnd,
dataRegistCode: d.dataRegistCode,
dataRegistName: d.dataRegistName
}
......@@ -2180,7 +2187,12 @@ const saveDraft = () => {
}, {
reqParamListRQVOS: inputParamsData.value,
respParamListRQVOS: respParamsData.value,
resourcesRQVOS: registerInfoValue.isAuthreSourceDevelop == 'Y' ? authSourceData.value : [],
resourcesRQVOS: registerInfoValue.isAuthreSourceDevelop == 'Y' ? authSourceData.value?.map(a => {
return Object.assign(a, {
authOperatTimeStart: a.authOperatTimeRange?.[0],
authOperatTimeEnd: a.authOperatTimeRange?.[1],
});
}) : [],
organizationRQVOS: registerInfoValue.isSharedData == 'Y' ? orgData.value : []
}, {
registerRQVO: {
......@@ -2300,16 +2312,16 @@ const save = () => {
return;
}
for (const d of authSourceData.value) {
if (!d.authOperatTimeStart) {
activeShareTabName.value = 'authSource';
proxy.$ElMessage.error('授权运营时间起不能为空');
return;
}
if (!d.authOperatTimeEnd) {
if (!d.authOperatTimeRange?.length) {
activeShareTabName.value = 'authSource';
proxy.$ElMessage.error('授权运营时间不能为空');
proxy.$ElMessage.error('授权运营时间不能为空');
return;
}
// if (!d.authOperatTimeEnd) {
// activeShareTabName.value = 'authSource';
// proxy.$ElMessage.error('授权运营时间止不能为空');
// return;
// }
if (!d.dataRegistCode) {
activeShareTabName.value = 'authSource';
proxy.$ElMessage.error('数据资源登记确认单编码不能为空');
......@@ -2320,11 +2332,8 @@ const save = () => {
proxy.$ElMessage.error('数据资源登记名称不能为空');
return;
}
if (d.authOperatTimeStart > d.authOperatTimeEnd) {
activeShareTabName.value = 'authSource';
proxy.$ElMessage.error('授权运营时间起不能大于授权运营时间止');
return;
}
d.authOperatTimeStart = d.authOperatTimeRange?.[0];
d.authOperatTimeEnd = d.authOperatTimeRange?.[1];
}
}
if (registerInfo.isSharedData == 'Y') {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!