|
@@ -12,7 +12,7 @@ import {IndexCreator} from "./components/IndexCreator";
|
|
|
import {IndexDetail} from "./components/IndexDetail";
|
|
|
import {DEFINE_TYPE, FORM_TYPE, SEN_COLOR_LEVEL, SENSITIVE, STATUS_COLOR_LEVEL} from "./constants";
|
|
|
import {IndexFilterForm} from "./components/IndexFilterForm";
|
|
|
-import {AUTH_TYPE, STATUS_TYPE, TYPE_ENUM} from "../../constants";
|
|
|
+import {AUTH_TYPE, PUBLISH_TYPE, STATUS_TYPE, TYPE_ENUM} from "../../constants";
|
|
|
import {ACTION_TYPES} from "../../components/WorkFlow/constants";
|
|
|
import {AuthorizationPanel} from "./components/AuthorizationPanel";
|
|
|
import {VolumeAuthPanel} from "./components/VolumeAuthPanel";
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
} from "../MainPage/slice/thunks";
|
|
|
import useI18NPrefix from "../../hooks/useI18NPrefix";
|
|
|
|
|
|
-// TODO 模型的SQL预览
|
|
|
+// TODO 模型的SQL预览、复合指标工具栏、数据集基本信息修改
|
|
|
|
|
|
export const IndexDefine = () => {
|
|
|
const t = useI18NPrefix('global');
|
|
@@ -189,7 +189,6 @@ export const IndexDefine = () => {
|
|
|
|
|
|
/** 筛选表单提交 */
|
|
|
const onFilterFormFinish = useCallback((filter)=>{
|
|
|
- console.log(filter)
|
|
|
dispatch(getIndexByConditions({
|
|
|
params:{
|
|
|
domainIds: [commonRef.current.treeSelect.id],
|
|
@@ -400,6 +399,17 @@ export const IndexDefine = () => {
|
|
|
setOpenDetail(false)
|
|
|
},[]);
|
|
|
|
|
|
+ /** 查询指标 */
|
|
|
+ const getMetrics = (domainIds)=>{
|
|
|
+ dispatch(getIndexByConditions({
|
|
|
+ params:{
|
|
|
+ domainIds:[domainIds],
|
|
|
+ current:1,
|
|
|
+ pageSize:999
|
|
|
+ },
|
|
|
+ }))
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/** 卡片Extra选项回调 */
|
|
|
const onExtraSelect =(event,item)=>{
|
|
@@ -479,17 +489,32 @@ export const IndexDefine = () => {
|
|
|
params:{
|
|
|
ids:[id],
|
|
|
type:"DELETE",
|
|
|
- // bizNames:[],
|
|
|
- // modelIds:[],
|
|
|
- // classifications:[],
|
|
|
- // sensitiveLevel:0,
|
|
|
- // status:0,
|
|
|
},
|
|
|
- resolve(data){
|
|
|
+ resolve(){
|
|
|
+ getMetrics(commonRef.current.treeSelect.id)
|
|
|
message.success(t("validation.success"));
|
|
|
}
|
|
|
}))
|
|
|
}
|
|
|
+
|
|
|
+ // 发布指标
|
|
|
+ if (event.key==="publish"){
|
|
|
+ dispatch(batchPublish({
|
|
|
+ params:{
|
|
|
+ ids:[id],
|
|
|
+ status:1,
|
|
|
+ type:"ADD",
|
|
|
+ },
|
|
|
+ resolve(data){
|
|
|
+ if (data){
|
|
|
+ getMetrics(commonRef.current.treeSelect.id)
|
|
|
+ message.success(t("validation.success"));
|
|
|
+ }else {
|
|
|
+ message.error(t("validation.failed"))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** 指标列表 */
|
|
@@ -501,7 +526,7 @@ export const IndexDefine = () => {
|
|
|
extra:[
|
|
|
<ActionIcon
|
|
|
key={2}
|
|
|
- items={ACTION_TYPES.CHECK}
|
|
|
+ items={ACTION_TYPES.CHECK.filter(opt=>item.isPublish?opt.key!=="publish":opt.key!=="disPublish")}
|
|
|
onSelect={(event)=>onExtraSelect(event,item)}
|
|
|
>
|
|
|
<Button type="link" ><MoreOutlined rotate={90} style={{fontSize:25}}/></Button>
|
|
@@ -518,6 +543,7 @@ export const IndexDefine = () => {
|
|
|
<Descriptions.Item label={t("formItem.director")}>{item.createdBy}</Descriptions.Item>
|
|
|
<Descriptions.Item label={t("formItem.creator")}>{item.createdBy}</Descriptions.Item>
|
|
|
<Descriptions.Item label={t("formItem.createDate")}>{moment(item.createdAt).format('YYYY-MM-DD hh:mm:ss')}</Descriptions.Item>
|
|
|
+ <Descriptions.Item label={t("formItem.isPublish")} contentStyle={{color:STATUS_COLOR_LEVEL[item.isPublish]}} children={PUBLISH_TYPE[item.isPublish]}/>
|
|
|
</Descriptions>
|
|
|
)
|
|
|
})),[indexLib])
|
|
@@ -546,7 +572,7 @@ export const IndexDefine = () => {
|
|
|
const onAuthConfigChange=useCallback((e)=>{},[])
|
|
|
/** 批量发布按钮回调*/
|
|
|
const onVolumePublish = useCallback(()=>{
|
|
|
- const {indexChosen} = commonRef.current
|
|
|
+ const {indexChosen,treeSelect} = commonRef.current
|
|
|
const params = {
|
|
|
ids:indexChosen.map(item=>item.id),
|
|
|
status:1,
|
|
@@ -556,6 +582,7 @@ export const IndexDefine = () => {
|
|
|
params,
|
|
|
resolve(data){
|
|
|
if (data){
|
|
|
+ getMetrics(treeSelect.id)
|
|
|
message.success(t("validation.success"));
|
|
|
}else {
|
|
|
message.error(t("validation.failed"))
|
|
@@ -671,9 +698,9 @@ export const IndexDefine = () => {
|
|
|
bordered
|
|
|
headerBordered
|
|
|
colSpan="20%"
|
|
|
- title={t("title.dataset")}
|
|
|
+ title={t("title.domain")}
|
|
|
style={{height:'85vh'}}
|
|
|
- extra={<ExtraLink onClick={handelDomainFormOpen}>+{t("button.domainCreate")}</ExtraLink>}
|
|
|
+ // extra={<ExtraLink onClick={handelDomainFormOpen}>+{t("button.domainCreate")}</ExtraLink>}
|
|
|
>
|
|
|
<TreeMenu
|
|
|
onRightClick={onRightClick}
|