Compare commits
2 Commits
fde6e9168b
...
b02907630e
| Author | SHA1 | Date |
|---|---|---|
|
|
b02907630e | |
|
|
86f1a42ac3 |
|
|
@ -73,6 +73,6 @@ export default class Config extends PublicConfigClass implements CreateComponent
|
||||||
public attr = { ...chartInitConfig, w: 400, h: 527, zIndex: 1 }
|
public attr = { ...chartInitConfig, w: 400, h: 527, zIndex: 1 }
|
||||||
public chartConfig = cloneDeep(TaskBannerConfig)
|
public chartConfig = cloneDeep(TaskBannerConfig)
|
||||||
public option = cloneDeep(option)
|
public option = cloneDeep(option)
|
||||||
public request = { ...requestSqlConfig, requestSQLContent: { sql: 'select * from ' }, }
|
public request = { ...requestSqlConfig, requestSQLContent: { sql: 'select * from fm_fireclueinfo where "Id" = #{Id}' }, }
|
||||||
public filter = "return res.result;"
|
public filter = "return res.result;"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,6 @@ export default class Config extends PublicConfigClass implements CreateComponent
|
||||||
public attr = { ...chartInitConfig, w: 484, h: 40, zIndex: 1 }
|
public attr = { ...chartInitConfig, w: 484, h: 40, zIndex: 1 }
|
||||||
public chartConfig = cloneDeep(TaskRadioConfig)
|
public chartConfig = cloneDeep(TaskRadioConfig)
|
||||||
public option = cloneDeep(option)
|
public option = cloneDeep(option)
|
||||||
public request = { ...requestSqlConfig, requestSQLContent: { sql: 'select * from ' }, }
|
public request = { ...requestSqlConfig, requestSQLContent: { sql: 'select * from fm_fireclueinfo where "Id" = #{Id}' }, }
|
||||||
public filter = "return res.result;"
|
public filter = "return res.result;"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PropType, toRefs } from 'vue'
|
import { PropType, toRefs, onMounted } from 'vue'
|
||||||
import { CreateComponentType } from '@/packages/index.d'
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
import { useChartDataFetch } from '@/hooks';
|
import { useChartDataFetch } from '@/hooks';
|
||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
|
||||||
|
import { EventBus } from '@/utils/eventBus';
|
||||||
|
import { replaceSqlParams } from '@/utils/sqlHandler';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
chartConfig: {
|
chartConfig: {
|
||||||
|
|
@ -29,9 +31,19 @@ const {
|
||||||
dataset
|
dataset
|
||||||
} = toRefs(props.chartConfig.option)
|
} = toRefs(props.chartConfig.option)
|
||||||
// 数据callback处理(预览时触发)
|
// 数据callback处理(预览时触发)
|
||||||
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
|
||||||
props.chartConfig.option.dataValue = JSON.stringify(resData);
|
onMounted(()=>{
|
||||||
});
|
const sql = props.chartConfig.request?.requestSQLContent?.sql;
|
||||||
|
// 组件通信 获取列表中的信息
|
||||||
|
EventBus.on(props.chartConfig.id+'dataupdate', (data) => {
|
||||||
|
props.chartConfig.request.requestSQLContent.sql = replaceSqlParams(sql,{Id:data.id})
|
||||||
|
// 数据callback处理(预览时触发)
|
||||||
|
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any) => {
|
||||||
|
props.chartConfig.option.dataset.dataValue = resData;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,6 @@ export default class Config extends PublicConfigClass implements CreateComponent
|
||||||
public attr = { ...chartInitConfig, w: 437, h: 93, zIndex: 1 }
|
public attr = { ...chartInitConfig, w: 437, h: 93, zIndex: 1 }
|
||||||
public chartConfig = cloneDeep(TaskTextAreaConfig)
|
public chartConfig = cloneDeep(TaskTextAreaConfig)
|
||||||
public option = cloneDeep(option)
|
public option = cloneDeep(option)
|
||||||
public request = { ...requestSqlConfig, requestSQLContent: { sql: 'select * from ' }, }
|
public request = { ...requestSqlConfig, requestSQLContent: { sql: 'select * from fm_fireclueinfo where "Id" = #{Id}' }, }
|
||||||
public filter = "return res.result;"
|
public filter = "return res.result;"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PropType, toRefs } from 'vue'
|
import { PropType, toRefs, onMounted } from 'vue'
|
||||||
import { CreateComponentType } from '@/packages/index.d'
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
import { useChartDataFetch } from '@/hooks';
|
import { useChartDataFetch } from '@/hooks';
|
||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
|
||||||
|
import { EventBus } from '@/utils/eventBus';
|
||||||
|
import { replaceSqlParams } from '@/utils/sqlHandler';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
chartConfig: {
|
chartConfig: {
|
||||||
|
|
@ -33,10 +35,17 @@ const {
|
||||||
dataset
|
dataset
|
||||||
} = toRefs(props.chartConfig.option)
|
} = toRefs(props.chartConfig.option)
|
||||||
|
|
||||||
// 数据callback处理(预览时触发)
|
onMounted(()=>{
|
||||||
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
const sql = props.chartConfig.request?.requestSQLContent?.sql;
|
||||||
props.chartConfig.option.dataset = resData;
|
// 组件通信 获取列表中的信息
|
||||||
});
|
EventBus.on(props.chartConfig.id+'dataupdate', (data) => {
|
||||||
|
props.chartConfig.request.requestSQLContent.sql = replaceSqlParams(sql,{Id:data.id})
|
||||||
|
// 数据callback处理(预览时触发)
|
||||||
|
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any) => {
|
||||||
|
props.chartConfig.option.dataset.dataset = resData;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue