123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044 |
- <template>
- <div class="container1">
- <div class="databox">
- <el-scrollbar :style="{ height: Height + 'px' }">
- <div class="box">
- <div class="title">
- <!-- <div style="display: flex; align-items: center">-->
- <!-- <div class="bg"></div>-->
- <!-- 样本数据录入-->
- <!-- </div>-->
- <div class="header" v-show="!addStatus && !editStatus">
- <Search
- :searchOptions="searchForm"
- ref="searchRef"
- @data-list="getTableData"
- @reset-list="reset"
- />
- </div>
- <div class="btns">
- <el-upload
- style="float: left"
- :action="uploadUrl"
- :on-success="handleSuccess"
- :before-upload="beforeUpload"
- :limit="1"
- accept=".xlsx, .xls"
- :show-file-list="false"
- ref="uploadRef"
- >
- <el-button size="small" type="primary">文件上传</el-button>
- </el-upload>
- <el-button
- style="margin-left: 15px"
- type="primary"
- size="small"
- class="btn"
- @click="
- downloadSPCTemplate(
- '/api/v1/spc/downloadTemplate',
- '/spc/template/NP控制图数据导入模版.xlsx'
- )
- "
- >模版下载</el-button
- >
- </div>
- </div>
- <div class="info" v-if="!addStatus">
- <el-table
- :data="tableData"
- border
- :style="{
- height: maxHeight - 150 + 'px',
- width: maxWidth + 'px',
- }"
- :show-overflow-tooltip="true"
- >
- <el-table-column
- align="center"
- prop="created"
- sortable
- label="日期"
- >
- <template #default="{ row }"
- ><span>{{ formatDate(row.created) }}</span>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="fileName" label="文件名称">
- <template #default="{ row }"
- ><a
- class="blue-underline"
- :href="downloadUrl + row.filePath"
- >{{ row.fileName }}</a
- >
- </template>
- </el-table-column>
- <el-table-column align="center" width="160" prop="" label="操作">
- <template #default="{ row }">
- <el-button
- type="primary"
- size="small"
- class="btn"
- @click="compute(row.filePath)"
- style="height: 25px"
- >计算</el-button
- >
- <el-button
- type="info"
- size="small"
- class="btn"
- style="height: 25px"
- @click="deleteSubmit(row.id)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <Pagination
- :total="currentOption.total"
- :page="currentOption.page"
- :limit="currentOption.limit"
- :pageSizes="currentOption.pageSizes"
- v-model:page="currentOption.page"
- v-model:limit="currentOption.limit"
- @pagination="getTableData"
- />
- </div>
- </div>
- </el-scrollbar>
- </div>
- </div>
- </template>
- <script setup>
- import { ref } from "vue";
- import * as echarts from "echarts";
- import { useDictionaryStore } from "@/store";
- import {
- getQualityFileList,
- getData,
- addDatas,
- deleteQualityFile,
- updateData,
- getTaskCode,
- NPCompute2,
- } from "@/api/analysis";
- import Search from "@/components/Search/index.vue";
- import { uploadFileApi } from "@/api/file";
- import { useCrud } from "@/hooks/userCrud";
- const { Utils } = useCrud({
- src: "/api/v1/spc/pDownloadTemplate",
- });
- const { downloadSPCTemplate } = Utils;
- // 定义 props
- const props = defineProps({
- chart: {
- type: String, // 类型为字符串
- required: true, // 必传
- },
- });
- const formatDate = (dateString) => {
- const date = new Date(dateString);
- const year = date.getFullYear();
- const month = String(date.getMonth() + 1).padStart(2, "0"); // 月份从0开始,所以需要+1
- const day = String(date.getDate()).padStart(2, "0");
- return `${year}-${month}-${day}`;
- };
- const year = ref("0");
- const currentOption = reactive({
- total: 0,
- page: 1,
- limit: 10,
- pageSizes: [10, 20, 30, 40, 50],
- });
- const lableValue = ref("");
- const searchRef = ref(null);
- const getTaskOption = async () => {
- const { data } = await getTaskCode({
- operationCode: JSON.parse(value.value).value,
- });
- taskOption.value = data;
- };
- const getTableData = async () => {
- const { data, code, msg } = await getQualityFileList({
- ...searchRef.value.searchForm,
- pageNo: currentOption.page,
- pageSize: currentOption.limit,
- // yearStr: year.value,
- chart: props.chart,
- });
- if (code == "200") {
- tableData.value = data.records;
- showData.value = { ...data.records, list: null };
- // if (tableData.value.length > 0) {
- // setChart1();
- // setChart2();
- // }
- currentOption.total = data.totalCount;
- currentOption.page = data.pageNo;
- oldDataJSON.value = JSON.stringify(data.records);
- }
- disabled.value = false;
- };
- const searchForm = [
- {
- label: "日期",
- prop: "createds",
- type: "daterange",
- },
- {
- label: "文件名称",
- prop: "model",
- type: "input",
- },
- ];
- //编辑状态
- const editStatus = ref(false);
- const addStatus = ref(false);
- const changeEditstatus = () => {
- editStatus.value = !changeEditstatus.value;
- addStatus.value = false;
- };
- const changeaddstatus = () => {
- addStatus.value = !addStatus.value;
- editStatus.value = false;
- };
- const canceleOp = () => {
- addStatus.value = false;
- editStatus.value = false;
- reset();
- };
- const Y1value = ref([]);
- const X1array = ref([]);
- const setY1value = () => {
- Y1value.value = [];
- tableData.value.forEach((item) => {
- Y1value.value.push(item.avg);
- });
- Y1value.value.unshift("");
- Y1value.value.push("");
- chartsOption1.value.series[0].data = Y1value.value;
- };
- const setX1array = async () => {
- X1array.value = await [];
- tableData.value.forEach((item, index) => {
- X1array.value.push(index + 1);
- });
- X1array.value.unshift("");
- X1array.value.push("");
- chartsOption1.value.xAxis[0].data = X1array.value;
- };
- const { dicts } = useDictionaryStore();
- const importStatus = ref(false);
- const disabled = ref(false);
- const tableData = ref([]);
- //Form
- const ruleFormRef = ref(null);
- const addItem = {
- // abnormal: "",
- accuracy1: 0,
- accuracy2: 0,
- accuracy3: 0,
- accuracy4: 0,
- accuracy5: 0,
- analyseUser: "",
- avg: 0,
- batchNo: "",
- checkDeviceNo: "",
- checkUser: "",
- dateStr: "",
- measure: "",
- model: "",
- range: 0,
- };
- const rules = {
- qualityTaskId: [
- {
- required: true,
- trigger: "change",
- },
- ],
- dateStr: [
- {
- required: true,
- trigger: "change",
- },
- ],
- model: [
- {
- required: true,
- trigger: "change",
- },
- ],
- batchNo: [
- {
- required: true,
- trigger: "change",
- },
- ],
- accuracy1: [
- {
- required: true,
- trigger: "change",
- },
- ],
- accuracy2: [
- {
- required: true,
- trigger: "change",
- },
- ],
- accuracy3: [
- {
- required: true,
- trigger: "change",
- },
- ],
- accuracy4: [
- {
- required: true,
- trigger: "change",
- },
- ],
- accuracy5: [
- {
- required: true,
- trigger: "change",
- },
- ],
- checkUser: [
- {
- required: true,
- trigger: "change",
- },
- ],
- checkDeviceNo: [
- {
- required: true,
- trigger: "change",
- },
- ],
- // abnormal: [
- // {
- // required: true,
- // trigger: "change",
- // },
- // ],
- analyseUser: [
- {
- required: true,
- trigger: "change",
- },
- ],
- measure: [
- {
- required: false,
- trigger: "change",
- },
- ],
- };
- const resItem = {
- // abnormal: "",
- analyseUser: "",
- batchNo: "",
- checkDeviceNo: "",
- checkUser: "",
- dateStr: "",
- measure: "",
- model: "",
- };
- const addData = ref({
- // abnormal: "",
- analyseUser: "",
- batchNo: "",
- checkDeviceNo: "",
- checkUser: "",
- dateStr: "",
- measure: "",
- model: "",
- });
- const accuracysSum = ref(0);
- const taskChange = (value) => {
- taskOption.value.forEach((item) => {
- if (item.id == value) {
- addData.value.model = item.prodtModel;
- accuracysSum.value = Number(item.processCount);
- addData.value.accuracys = [];
- let array = [];
- for (let i = 0; i < accuracysSum.value; i++) {
- array.push(0);
- }
- addData.value.accuracys = array;
- }
- });
- };
- const oldDataJSON = ref("");
- const showData = ref({});
- const url = ref(import.meta.env.VITE_APP_BASE_API + "/api/v1/spc/import");
- const headers = { Authorization: `${localStorage.getItem("token")}` };
- const opOptions = ref([...dicts.spc_operation]);
- const sccOptions = ref([...dicts.spc_control_chart]);
- const setChart1Info = () => {
- // chartsOption1.value.title[0].text = `上限=${showData.value.avgMax ? showData.value.avgMax : "-"}`;
- // chartsOption1.value.title[0].text = `x̄=${showData.value.avgAvg ? showData.value.avgAvg : "-"}`;
- chartsOption1.value.series[0].markLine.data[0].yAxis = JSON.parse(
- value.value
- ).avgMax;
- chartsOption1.value.series[0].markLine.data[0].label.formatter = ` 上限=${
- JSON.parse(value.value).avgMax ? JSON.parse(value.value).avgMax : "0"
- }`;
- chartsOption1.value.series[0].markLine.data[1].yAxis = JSON.parse(value.value)
- .avgMin
- ? JSON.parse(value.value).avgMin
- : 0;
- chartsOption1.value.series[0].markLine.data[1].label.formatter = ` 下限=${JSON.parse(value.value).avgMin ? JSON.parse(value.value).avgMin : "0"}`;
- chartsOption1.value.series[0].markLine.data[2].yAxis = JSON.parse(
- value.value
- ).avgMid;
- chartsOption1.value.series[0].markLine.data[2].label.formatter = `x̄=${
- JSON.parse(value.value).avgMid
- }`;
- // chartsOption1.value.title[2].text = `下限=${showData.value.avgMin ? showData.value.avgMin : "0"}`;
- };
- const setChart2Info = () => {
- // chartsOption2.value.title[0].text = `上限=${showData.value.rangeMax ? showData.value.rangeMax : "-"}`;
- // chartsOption2.value.title[0].text = `R=${showData.value.rangeAvg ? showData.value.rangeAvg : "-"}`;
- chartsOption2.value.series[0].markLine.data[0].yAxis = JSON.parse(
- value.value
- ).rangeMax;
- chartsOption2.value.series[0].markLine.data[0].label.formatter = ` 上限=${
- JSON.parse(value.value).rangeMax ? JSON.parse(value.value).rangeMax : "0"
- }`;
- chartsOption2.value.series[0].markLine.data[1].yAxis = JSON.parse(value.value)
- .rangeMin
- ? JSON.parse(value.value).rangeMin
- : 0;
- chartsOption2.value.series[0].markLine.data[1].label.formatter = ` 下限=${
- JSON.parse(value.value).rangeMin ? JSON.parse(value.value).rangeMin : "0"
- }`;
- chartsOption2.value.series[0].markLine.data[2].yAxis = JSON.parse(
- value.value
- ).rangeMid;
- chartsOption2.value.series[0].markLine.data[2].label.formatter = `x̄=${
- JSON.parse(value.value).rangeMid
- }`;
- // chartsOption2.value.title[2].text = `下限=${showData.value.rangeMin ? showData.value.rangeMin : "0"}`;
- };
- const setChart1 = () => {
- setChart1Info();
- setY1value();
- setX1array();
- charts1.value.setOption(chartsOption1.value, true);
- };
- const setChart2 = () => {
- setChart2Info();
- setY2value();
- setX2array();
- charts2.value.setOption(chartsOption2.value, true);
- };
- //修改
- const updataItem = (row) => {
- editStatus.value = true;
- addData.value = row;
- addStatus.value = true;
- };
- //导入按钮
- const onSuccess = (res) => {
- const { code, msg, data } = res;
- if (code != "200") {
- ElMessage.error(msg);
- } else {
- tableData.value = data.list;
- showData.value = { ...data, list: null };
- setChart1();
- setChart2();
- oldDataJSON.value = JSON.stringify(data.list);
- importStatus.value = true;
- ElMessage.success(msg);
- }
- };
- const taskOption = ref([]);
- const value = ref(opOptions.value[0].remark);
- const title = ref("调阻精度");
- var value2 = ref("");
- const showLable = ref("调阻");
- const changeSelect = () => {
- setTimeout(async () => {
- getTaskOption();
- showLable.value = selectRef.value.currentPlaceholder;
- opOptions.value.forEach((item) => {
- if (item.dictLabel == showLable.value) {
- lableValue.value = item.dictValue;
- }
- });
- switch (showLable.value) {
- case "调阻":
- title.value = "调阻精度";
- break;
- case "粘片":
- title.value = "剪切强度";
- break;
- case "键合":
- title.value = "键合强度";
- break;
- default:
- title.value = "调阻精度";
- break;
- }
- await getTableData();
- chartsOption1.value.title[0].text = `${title.value}的Xbar-R控制图`;
- // tableData.value.forEach((item) => {
- // item.accuracy1 = 0;
- // item.accuracy2 = 0;
- // item.accuracy3 = 0;
- // item.accuracy4 = 0;
- // item.accuracy5 = 0;
- // item.avg = 0;
- // item.range = 0;
- // });
- // setChart1();
- // changeSelect2();
- }, 0);
- };
- // const searchData = computed(() =>
- // tableData.value.filter((item) => item.data.includes(searchValue.value))
- // );
- const selectRef = ref(null);
- //保存
- const changeEdit = async () => {
- if (disabled.value == false) {
- disabled.value = true;
- } else {
- const { data, code, msg } = await getHandleData([...tableData.value]);
- if (code == "200") {
- ElMessage.success(msg);
- tableData.value = data.list;
- showData.value = { ...data, list: null };
- setChart1();
- setChart2();
- oldDataJSON.value = JSON.stringify(data.list);
- }
- disabled.value = false;
- }
- };
- const cancelEdit = () => {
- tableData.value = JSON.parse(oldDataJSON.value);
- disabled.value = false;
- };
- const maxHeight = ref(null);
- const maxWidth = ref(null);
- const charts1 = shallowRef(null);
- const charts2 = shallowRef(null);
- const chartsOption1 = ref({
- title: [
- // {
- // text: `x̄=${showData.value.avgAvg ? showData.value.avgAvg : "-"}`,
- // right: "5%",
- // top: "42%",
- // textStyle: {
- // fontSize: 15,
- // color: "#333",
- // fontWeight: 100,
- // },
- // },
- {
- text: `${title.value}的Xbar-R控制图`,
- left: "40%",
- },
- {
- text: "样",
- left: "4%",
- top: "28%",
- },
- {
- text: "本",
- left: "4%",
- top: "35%",
- },
- {
- text: "均",
- left: "4%",
- top: "42%",
- },
- {
- text: "值",
- left: "4%",
- top: "49%",
- },
- ],
- grid: {
- right: "15%",
- },
- toolbox: {
- feature: {
- saveAsImage: {},
- },
- },
- tooltip: {
- show: true,
- },
- xAxis: [
- {
- type: "category",
- boundaryGap: false,
- data: [],
- },
- ],
- yAxis: [
- {
- type: "value",
- },
- ],
- series: [
- {
- type: "line",
- lineStyle: {
- color: "rgb(26, 122, 240)",
- },
- symbolSize: 13,
- symbol: "circle",
- itemStyle: {
- color: (params) => {
- const avg = JSON.parse(value.value);
- const paramValue = Number(params.value);
- if (
- paramValue <= Number(avg.avgMax) &&
- paramValue >= Number(avg.avgMin)
- ) {
- return "rgb(26, 122, 240)";
- } else {
- return "red";
- }
- },
- },
- markLine: {
- silent: true,
- data: [
- {
- silent: false,
- yAxis: 0,
- label: {
- position: "end",
- formatter: `上限=${JSON.parse(value.value).avgMax ? JSON.parse(value.value).avgMax : "-"}`,
- color: "#333",
- },
- lineStyle: { type: "solid", color: "#333", width: 2 },
- },
- {
- silent: false,
- yAxis: 0,
- label: {
- position: "end",
- formatter: `下限=${JSON.parse(value.value).avgMin ? JSON.parse(value.value).avgMin : "-"}`,
- color: "#333",
- },
- lineStyle: {
- type: "solid",
- color: "#333",
- width: 2,
- },
- },
- {
- yAxis: 0,
- silent: false,
- label: {
- position: "end",
- formatter: ``,
- color: "#333",
- },
- lineStyle: {
- type: "solid",
- color: "#333",
- width: 2,
- },
- },
- ],
- },
- },
- ],
- });
- const chartsOption2 = ref({
- title: [
- // {
- // text: `R=${showData.value.rangeAvg ? showData.value.rangeAvg : "-"}`,
- // right: "5%",
- // top: "42%",
- // textStyle: {
- // fontSize: 15,
- // color: "#333",
- // fontWeight: 100,
- // },
- // },
- {
- text: "样",
- left: "4%",
- top: "28%",
- },
- {
- text: "本",
- left: "4%",
- top: "35%",
- },
- {
- text: "极",
- left: "4%",
- top: "42%",
- },
- {
- text: "值",
- left: "4%",
- top: "49%",
- },
- ],
- toolbox: {
- feature: {
- saveAsImage: {},
- },
- },
- grid: {
- right: "15%",
- },
- xAxis: [
- {
- type: "category",
- boundaryGap: false,
- data: [],
- },
- ],
- yAxis: [
- {
- type: "value",
- },
- ],
- tooltip: {
- show: true,
- },
- series: [
- {
- type: "line",
- lineStyle: {
- color: "rgb(26, 122, 240)",
- },
- symbolSize: 13,
- symbol: "circle",
- itemStyle: {
- color: (params) => {
- const range = JSON.parse(value.value);
- const paramValue = Number(params.value);
- if (
- paramValue <= Number(range.rangeMax) &&
- paramValue >= Number(range.rangeMin)
- ) {
- return "rgb(26, 122, 240)";
- } else {
- return "red";
- }
- },
- },
- markLine: {
- silent: true,
- data: [
- {
- silent: false,
- yAxis: 0,
- label: {
- position: "end",
- formatter: `上限=${JSON.parse(value.value).rangeMax ? JSON.parse(value.value).rangeMax : "-"}`,
- color: "#333",
- },
- lineStyle: { type: "solid", color: "#333", width: 2 },
- },
- {
- silent: false,
- yAxis: 0,
- label: {
- position: "end",
- formatter: `下限=${JSON.parse(value.value).rangeMin ? JSON.parse(value.value).rangeMin : "-"}`,
- color: "#333",
- },
- lineStyle: { type: "solid", color: "#333", width: 2 },
- },
- {
- yAxis: 0,
- silent: false,
- label: {
- position: "end",
- formatter: ``,
- color: "#333",
- },
- lineStyle: {
- type: "solid",
- color: "#333",
- width: 2,
- },
- },
- ],
- },
- },
- ],
- });
- const Height = ref(0);
- const setHeight = () => {
- Height.value = document.querySelector(".databox").clientHeight;
- maxHeight.value = document.querySelector(".info").clientHeight;
- maxWidth.value = document.querySelector(".info").clientWidth;
- };
- const Y2value = ref([]);
- const X2array = ref([]);
- const setY2value = () => {
- Y2value.value = [];
- tableData.value.forEach((item) => {
- Y2value.value.push(item.range);
- });
- Y2value.value.unshift("");
- Y2value.value.push("");
- chartsOption2.value.series[0].data = Y2value.value;
- };
- const setX2array = () => {
- X2array.value = [];
- tableData.value.forEach((item, index) => {
- X2array.value.push(index + 1);
- });
- X2array.value.unshift("");
- X2array.value.push("");
- chartsOption2.value.xAxis[0].data = X2array.value;
- };
- //当新增或者编辑的确定操作
- const submit = () => {
- if (editStatus.value == true) {
- updateSubmit();
- } else {
- addSubmit();
- }
- };
- const addSubmit = async () => {
- await ruleFormRef.value.validate(async (valid, fields) => {
- if (valid) {
- const { data, code } = await addDatas({
- ...addData.value,
- yearStr: year.value,
- operation: lableValue.value,
- });
- if (code == "200") {
- ElMessage.success("添加成功!");
- reset();
- getTableData();
- }
- } else {
- ElMessage.error("请检查表单信息");
- }
- });
- };
- const deleteSubmit = async (id) => {
- const { data, code } = await deleteQualityFile({
- id,
- });
- if (code == "200") {
- ElMessage.success("删除成功!");
- getTableData();
- }
- };
- const emit = defineEmits(["tableData"]);
- const compute = async (filePath) => {
- const { data, code } = await NPCompute2({ filePath: filePath });
- if (code === "200") {
- emit("tableData", data);
- }
- };
- const updateSubmit = async () => {
- const { data, code } = await updateData({
- ...addData.value,
- });
- if (code == "200") {
- ElMessage.success("更新成功!");
- reset();
- getTableData();
- }
- };
- const reset = () => {
- addStatus.value = false;
- editStatus.value = false;
- addData.value = { ...resItem };
- searchRef.value.searchForm = {};
- currentOption.value = {
- total: 0,
- page: 0,
- limit: 12,
- pageSizes: [12],
- operation: value.value,
- };
- getTableData();
- };
- const setView = () => {
- setHeight();
- charts1.value = echarts.init(document.getElementById("charts"));
- charts2.value = echarts.init(document.getElementById("charts1"));
- charts1.value.setOption(chartsOption1.value, true);
- charts2.value.setOption(chartsOption2.value, true);
- };
- const downloadUrl =
- import.meta.env.VITE_APP_BASE_API + "/api/v1/spc/pDownloadExcel?filePath=";
- const uploadUrl = ref("");
- const beforeUpload = (file) => {
- const isExcel =
- file.type === "application/vnd.ms-excel" ||
- file.type ===
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
- if (!isExcel) {
- ElMessage.error("只能上传Excel文件!");
- }
- return isExcel;
- };
- const uploadRef = ref("uploadRef");
- const handleSuccess = (response) => {
- if (response.code === "200") {
- ElMessage.success("Excel导入成功!");
- uploadRef.value.clearFiles();
- getTableData();
- } else {
- ElMessage.error("Excel导入失败!");
- }
- };
- onMounted(async () => {
- getTaskOption();
- setHeight();
- year.value = new Date().getFullYear() + "";
- opOptions.value.forEach((item) => {
- if (item.dictLabel == showLable.value) {
- lableValue.value = item.dictValue;
- }
- });
- await getTableData();
- uploadUrl.value =
- import.meta.env.VITE_APP_BASE_API +
- "/api/v1/spc/pUploadExcel?chart=" +
- props.chart;
- // value2.value = "Xbar-R";
- // xbarRRefMethod();
- // nextTick(() => {
- // charts1.value = echarts.init(document.getElementById("charts"));
- // charts2.value = echarts.init(document.getElementById("charts1"));
- // charts1.value.setOption(chartsOption1.value, true);
- // charts2.value.setOption(chartsOption2.value, true);
- // });
- // window.addEventListener("resize", setView);
- });
- onBeforeUnmount(() => {
- // window.removeEventListener("resize", setView);
- });
- </script>
- <style lang="scss" scoped>
- @media print {
- #print {
- margin-left: -18%;
- }
- }
- .blue-underline {
- text-decoration: none;
- color: #008cff;
- }
- .blue-underline:hover {
- text-decoration: underline;
- color: blue;
- }
- .ellipsis-text {
- white-space: nowrap; /* 禁止换行 */
- overflow: hidden; /* 隐藏超出部分 */
- text-overflow: ellipsis; /* 显示省略号 */
- width: 100%; /* 宽度占满单元格 */
- }
- .formStyle {
- width: 400px;
- margin: 20px auto;
- }
- .container1 {
- width: 100%;
- height: 100%;
- display: flex;
- background-color: white;
- .infobox {
- width: 200px;
- .header {
- height: 120px;
- border-bottom: 2px solid #00000010;
- padding: 20px;
- }
- .body {
- padding: 20px;
- }
- }
- .databox {
- flex: 1;
- border-left: 2px solid #00000010;
- .box {
- height: 710px;
- padding: 5px 20px;
- display: flex;
- flex-direction: column;
- .illustrate {
- padding: 20px 60px;
- }
- .tableTitle {
- text-align: center;
- margin: 10px 0;
- padding-right: 40px;
- }
- .header {
- margin-top: 20px;
- //margin-left: 100px;
- display: flex;
- width: 100%;
- height: auto;
- }
- //.title {
- // height: 50px;
- // display: flex;
- // align-items: center;
- // margin-bottom: 10px;
- // justify-content: space-between;
- // .btns {
- // display: flex;
- // align-items: center;
- // .btn {
- // height: 24px;
- // font-size: 14px;
- // margin: 0 5px;
- // }
- // }
- //}
- .info {
- margin-top: 20px;
- flex: 1;
- height: 300px;
- }
- }
- }
- }
- </style>
|