更新基础分析bug

This commit is contained in:
王博冉
2022-10-14 10:49:12 +08:00
parent 2fdb171432
commit e5e65087e0
10 changed files with 16 additions and 18 deletions

View File

@@ -858,7 +858,7 @@ const delGroup =index=>{
// 拼装answer // 拼装answer
const getAnswer = ()=>{ const getAnswer = ()=>{
const newAnswerList = toRaw(answerList.value) const newAnswerList = toRaw(answerList.value)
const newAnswerGroupListVal = JSON.parse(JSON.stringify(answerGroupList.value)) const newAnswerGroupListVal = toRaw(answerGroupList.value)
console.log('newAnswerList',newAnswerList); console.log('newAnswerList',newAnswerList);
console.log('newAnswerGroupListVal',newAnswerGroupListVal); console.log('newAnswerGroupListVal',newAnswerGroupListVal);
// 单项拼装 // 单项拼装

View File

@@ -99,7 +99,6 @@ const props = defineProps({
default: "", default: "",
}, },
}); });
const isValid = computed(() => props.data.count > 0); const isValid = computed(() => props.data.count > 0);
const questionIndex = computed(() => props.data.question_index); const questionIndex = computed(() => props.data.question_index);
const chartTypeOptions = ref([]); const chartTypeOptions = ref([]);

View File

@@ -104,7 +104,7 @@ export default defineComponent({
if (empty_option) { if (empty_option) {
data = clearData(data); data = clearData(data);
} }
const config = useChartOption(data, type, data_label, other); const config = useChartOption(data, type, data_label, other, props.data.max);
option.value = config; option.value = config;
} }

View File

@@ -103,7 +103,7 @@ function renderChart(source) {
data = clearData(source); data = clearData(source);
} }
if (data.length === 0) return; if (data.length === 0) return;
const config = useChartOption(data, type, data_label, other); const config = useChartOption(data, type, data_label, other, props.data.max);
option.value = config; option.value = config;
} }
@@ -114,7 +114,7 @@ function handleUpdateAction(params) {
if (empty_option) { if (empty_option) {
data = clearData(data); data = clearData(data);
} }
const config = useChartOption(data, type, data_label, other); const config = useChartOption(data, type, data_label, other, props.data.max);
option.value = config; option.value = config;
} }

View File

@@ -105,7 +105,7 @@ function renderChart(source) {
data = clearData(source); data = clearData(source);
} }
if (data.length === 0) return; if (data.length === 0) return;
const config = useChartOption(data, type, data_label, other); const config = useChartOption(data, type, data_label, other, props.data.max);
option.value = config; option.value = config;
} }
@@ -116,7 +116,7 @@ function handleUpdateAction(params) {
if (empty_option) { if (empty_option) {
data = clearData(data); data = clearData(data);
} }
const config = useChartOption(data, type, data_label); const config = useChartOption(data, type, data_label, null, props.data.max);
option.value = config; option.value = config;
} }

View File

@@ -97,7 +97,7 @@ function renderChart(source) {
data = clearData(source); data = clearData(source);
} }
if (data.length === 0) return; if (data.length === 0) return;
const config = useChartOption(data, type, data_label); const config = useChartOption(data, type, data_label, null, props.data.max);
option.value = config; option.value = config;
} }
@@ -108,7 +108,7 @@ function handleUpdateAction(params) {
if (empty_option) { if (empty_option) {
data = clearData(data); data = clearData(data);
} }
const config = useChartOption(data, type, data_label); const config = useChartOption(data, type, data_label, null, props.data.max);
option.value = config; option.value = config;
} }

View File

@@ -37,7 +37,7 @@
<script setup> <script setup>
import { getSingleDiagramInfo } from "@api/data-analyse"; import { getSingleDiagramInfo } from "@api/data-analyse";
import { defineComponent, ref, watch, inject } from "vue"; import { defineComponent, ref, watch, inject, computed } from "vue";
import pieChart from "@/components/chart/PieChart"; import pieChart from "@/components/chart/PieChart";
import ChartAction from "@/views/DataAnalyse/diagram/components/ChartAction"; import ChartAction from "@/views/DataAnalyse/diagram/components/ChartAction";
import CascaderSelect from "./CascaderSelect.vue"; import CascaderSelect from "./CascaderSelect.vue";
@@ -96,7 +96,6 @@ const other =
// value: 4 // value: 4
// }, // },
} }
function renderChart(source) { function renderChart(source) {
let data = source; let data = source;
let data_label = chart_params.value.data_label; let data_label = chart_params.value.data_label;
@@ -106,7 +105,7 @@ function renderChart(source) {
data = clearData(source); data = clearData(source);
} }
if (data.length === 0) return; if (data.length === 0) return;
const config = useChartOption(data, type, data_label,other ); const config = useChartOption(data, type, data_label, other, props.data.max );
option.value = config; option.value = config;
} }
@@ -117,7 +116,7 @@ function handleUpdateAction(params) {
if (empty_option) { if (empty_option) {
data = clearData(data); data = clearData(data);
} }
const config = useChartOption(data, type, data_label, other); const config = useChartOption(data, type, data_label, other, props.data.max);
option.value = config; option.value = config;
} }

View File

@@ -84,7 +84,6 @@ function getData(optionIndex) {
tableSource.value = data.option; tableSource.value = data.option;
tableInstance.value.data = data.option tableInstance.value.data = data.option
source.value = data.option source.value = data.option
renderChart(data.option); renderChart(data.option);
}); });
} }
@@ -106,7 +105,7 @@ function renderChart(source) {
data = clearData(source); data = clearData(source);
} }
if (data.length === 0) return; if (data.length === 0) return;
const config = useChartOption(data, type, data_label,other ); const config = useChartOption(data, type, data_label, other, props.data.max);
option.value = config; option.value = config;
} }
@@ -117,7 +116,7 @@ function handleUpdateAction(params) {
if (empty_option) { if (empty_option) {
data = clearData(data); data = clearData(data);
} }
const config = useChartOption(data, type, data_label, other); const config = useChartOption(data, type, data_label, other, props.data.max);
option.value = config; option.value = config;
} }

View File

@@ -1,6 +1,6 @@
import { cloneDeep } from "lodash"; import { cloneDeep } from "lodash";
export default function useChartOption(source, type, enableLabel = true, other = null) { export default function useChartOption(source, type, enableLabel = true, other = null, max) {
let defaultOption = { let defaultOption = {
legend: { legend: {
type: "scroll", type: "scroll",
@@ -275,7 +275,7 @@ export default function useChartOption(source, type, enableLabel = true, other =
const indicator = legendData.map(name => { const indicator = legendData.map(name => {
return { return {
name, name,
max: 12 max
} }
}) })
const seriesData = sourceData.map(item =>item.number) const seriesData = sourceData.map(item =>item.number)

View File

@@ -136,6 +136,7 @@ function getPermissionInfo() {
// 搜索 // 搜索
const tableSearchInfo = ref({}); const tableSearchInfo = ref({});
function onSearch(payload) { function onSearch(payload) {
payload.type = 0
tableSearchInfo.value = payload; tableSearchInfo.value = payload;
diagramList.value = [] diagramList.value = []
current_page.value = 1 current_page.value = 1