mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-25 00:54:21 +08:00
[improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API (#327)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab. [improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions. [improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager. * [improvement][semantic-fe] Add time granularity setting in the data source configuration. * [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility * [improvement][semantic-fe] Modification of data source creation prompt wording" * [improvement][semantic-fe] metric market experience optimization * [improvement][semantic-fe] enhance the analysis of metric trends * [improvement][semantic-fe] optimize the presentation of metric trend permissions * [improvement][semantic-fe] add metric trend download functionality * [improvement][semantic-fe] fix the dimension initialization issue in metric correlation * [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source. * [improvement][semantic-fe] Optimizing pagination logic and some CSS styles * [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum" * [improvement][semantic-fe] Fixing the default value setting for the indicator list * [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models * [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API
This commit is contained in:
@@ -147,121 +147,103 @@ const MetricTrendSection: React.FC<Props> = ({ nodeData }) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{ marginBottom: 5, display: 'grid', gap: 10 }}>
|
||||
{/* <StandardFormRow key="showType" title="维度下钻" block>
|
||||
<FormItem name="showType" valuePropName="checked">
|
||||
<Select
|
||||
style={{ minWidth: 150 }}
|
||||
options={relationDimensionOptions}
|
||||
showSearch
|
||||
filterOption={(input, option) =>
|
||||
((option?.label ?? '') as string).toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
mode="multiple"
|
||||
placeholder="请选择下钻维度"
|
||||
onChange={(value) => {
|
||||
const params = { ...queryParams, dimensionGroup: value || [] };
|
||||
setQueryParams(params);
|
||||
getMetricTrendData({ ...params });
|
||||
}}
|
||||
/>
|
||||
</FormItem>
|
||||
</StandardFormRow> */}
|
||||
{/* <Row>
|
||||
<Col flex="1 1 200px">
|
||||
<Space>
|
||||
<span>维度下钻: </span>
|
||||
<Select
|
||||
style={{ minWidth: 150 }}
|
||||
options={relationDimensionOptions}
|
||||
showSearch
|
||||
filterOption={(input, option) =>
|
||||
((option?.label ?? '') as string).toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
mode="multiple"
|
||||
placeholder="请选择下钻维度"
|
||||
onChange={(value) => {
|
||||
const params = { ...queryParams, dimensionGroup: value || [] };
|
||||
setQueryParams(params);
|
||||
getMetricTrendData({ ...params });
|
||||
}}
|
||||
/>
|
||||
</Space>
|
||||
</Col>
|
||||
</Row>
|
||||
<div style={{ marginBottom: 25 }}>
|
||||
<Row>
|
||||
<Col flex="1 1 200px">
|
||||
<Space>
|
||||
<span>维度筛选: </span>
|
||||
<MetricTrendDimensionFilter
|
||||
modelId={nodeData.modelId}
|
||||
dimensionOptions={relationDimensionOptions}
|
||||
onFiltersChange={() => {}}
|
||||
/>
|
||||
</Space>
|
||||
</Col>
|
||||
</Row> */}
|
||||
<Row>
|
||||
<Col flex="1 1 200px">
|
||||
<MDatePicker
|
||||
initialValues={{
|
||||
dateSettingType: 'DYNAMIC',
|
||||
dynamicParams: {
|
||||
number: 7,
|
||||
periodType: 'DAYS',
|
||||
includesCurrentPeriod: true,
|
||||
shortCutId: 'last7Days',
|
||||
dateRangeType: 'DAY',
|
||||
dynamicAdvancedConfigType: 'last',
|
||||
dateRangeStringDesc: '最近7天',
|
||||
dateSettingType: DateSettingType.DYNAMIC,
|
||||
},
|
||||
staticParams: {},
|
||||
<Form
|
||||
layout="inline"
|
||||
// form={form}
|
||||
colon={false}
|
||||
onValuesChange={(value, values) => {
|
||||
if (value.key) {
|
||||
return;
|
||||
}
|
||||
// handleValuesChange(value, values);
|
||||
}}
|
||||
onDateRangeChange={(value, config) => {
|
||||
const [startDate, endDate] = value;
|
||||
const { dateSettingType, dynamicParams, staticParams } = config;
|
||||
let dateField = dateFieldMap[DateRangeType.DAY];
|
||||
if (DateSettingType.DYNAMIC === dateSettingType) {
|
||||
dateField = dateFieldMap[dynamicParams.dateRangeType];
|
||||
}
|
||||
if (DateSettingType.STATIC === dateSettingType) {
|
||||
dateField = dateFieldMap[staticParams.dateRangeType];
|
||||
}
|
||||
setPeriodDate({ startDate, endDate, dateField });
|
||||
}}
|
||||
disabledAdvanceSetting={true}
|
||||
/>
|
||||
{/* <Select
|
||||
style={{ minWidth: 150 }}
|
||||
options={relationDimensionOptions}
|
||||
showSearch
|
||||
filterOption={(input, option) =>
|
||||
((option?.label ?? '') as string).toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
mode="multiple"
|
||||
placeholder="请选择下钻维度"
|
||||
onChange={(value) => {
|
||||
const params = { ...queryParams, dimensionGroup: value || [] };
|
||||
setQueryParams(params);
|
||||
getMetricTrendData({ ...params });
|
||||
}}
|
||||
/>
|
||||
<Select
|
||||
style={{ minWidth: 150 }}
|
||||
options={relationDimensionOptions}
|
||||
showSearch
|
||||
filterOption={(input, option) =>
|
||||
((option?.label ?? '') as string).toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
mode="multiple"
|
||||
placeholder="请选择筛选维度"
|
||||
onChange={(value) => {
|
||||
const params = { ...queryParams, dimensionFilters: value || [] };
|
||||
setQueryParams(params);
|
||||
getMetricTrendData({ ...params });
|
||||
}}
|
||||
/> */}
|
||||
>
|
||||
{/* <StandardFormRow key="dimensionSelected" title="维度下钻:">
|
||||
<FormItem name="dimensionSelected">
|
||||
<Select
|
||||
style={{ minWidth: 150, maxWidth: 200 }}
|
||||
options={relationDimensionOptions}
|
||||
showSearch
|
||||
filterOption={(input, option) =>
|
||||
((option?.label ?? '') as string).toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
mode="multiple"
|
||||
placeholder="请选择下钻维度"
|
||||
onChange={(value) => {
|
||||
const params = { ...queryParams, dimensionGroup: value || [] };
|
||||
setQueryParams(params);
|
||||
getMetricTrendData({ ...params });
|
||||
}}
|
||||
/>
|
||||
</FormItem>
|
||||
</StandardFormRow>
|
||||
<StandardFormRow key="dimensionFilter" title="维度筛选:">
|
||||
<FormItem name="dimensionFilter">
|
||||
<MetricTrendDimensionFilter
|
||||
modelId={nodeData.modelId}
|
||||
dimensionOptions={relationDimensionOptions}
|
||||
onChange={(filterParams) => {
|
||||
const {
|
||||
dimensionBizName: bizName,
|
||||
dimensionValue: value,
|
||||
operator,
|
||||
} = filterParams;
|
||||
if (bizName && value && operator) {
|
||||
const params = {
|
||||
...queryParams,
|
||||
dimensionFilters: [
|
||||
{
|
||||
bizName: 'user_name',
|
||||
value: ['williamhliu', 'leooonli'],
|
||||
operator: 'in',
|
||||
},
|
||||
],
|
||||
};
|
||||
setQueryParams(params);
|
||||
getMetricTrendData({ ...params });
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</FormItem>
|
||||
</StandardFormRow> */}
|
||||
<StandardFormRow key="metricDate" title="日期区间:">
|
||||
<FormItem name="metricDate">
|
||||
<MDatePicker
|
||||
initialValues={{
|
||||
dateSettingType: 'DYNAMIC',
|
||||
dynamicParams: {
|
||||
number: 7,
|
||||
periodType: 'DAYS',
|
||||
includesCurrentPeriod: true,
|
||||
shortCutId: 'last7Days',
|
||||
dateRangeType: 'DAY',
|
||||
dynamicAdvancedConfigType: 'last',
|
||||
dateRangeStringDesc: '最近7天',
|
||||
dateSettingType: DateSettingType.DYNAMIC,
|
||||
},
|
||||
staticParams: {},
|
||||
}}
|
||||
showCurrentDataRangeString={false}
|
||||
onDateRangeChange={(value, config) => {
|
||||
const [startDate, endDate] = value;
|
||||
const { dateSettingType, dynamicParams, staticParams } = config;
|
||||
let dateField = dateFieldMap[DateRangeType.DAY];
|
||||
if (DateSettingType.DYNAMIC === dateSettingType) {
|
||||
dateField = dateFieldMap[dynamicParams.dateRangeType];
|
||||
}
|
||||
if (DateSettingType.STATIC === dateSettingType) {
|
||||
dateField = dateFieldMap[staticParams.dateRangeType];
|
||||
}
|
||||
setPeriodDate({ startDate, endDate, dateField });
|
||||
}}
|
||||
disabledAdvanceSetting={true}
|
||||
/>
|
||||
</FormItem>
|
||||
</StandardFormRow>
|
||||
</Form>
|
||||
</Col>
|
||||
<Col flex="0 1">
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user