fix:修复部分bug

This commit is contained in:
xcool
2022-10-13 00:02:03 +08:00
parent 02fb202180
commit 9cbdf53675
10 changed files with 172 additions and 72 deletions

View File

@@ -8,4 +8,4 @@ VUE_APP_DELiVERY_BASEURL='https://javaxq.test.automark.cc/'
VUE_APP_MESSAGE_CENTER ='http://gtech-gateway.dcin-test.digitalyili.com/apigtech/message-send-center/';
VUE_APP_SOCKETURL = 'wss://ylst-api-uat.dctest.digitalyili.com/survey_sync'
VUE_APP_JSONPURL = 'https://iam-uat.dctest.digitalyili.com/idp/restful/getIDPToken'
VUE_APP_JSONPURL = 'https://iam-uat.dctest.digitalyili.com/idp/restful/getIDPToken'

View File

@@ -41,12 +41,14 @@
v-for="(child, childIndex) in item.children"
:key="childIndex"
>
<div
<div class="menu-bar-item-parent">
<div
class="menu-bar-item-main"
:style="{
background: child.check ? 'rgba(112, 185, 54, 0.1)' : '#ffffff',
color: child.check ? '#70b936' : '#000000',
height: '51px',
height: '32px',
margin: '10px 0',
borderRadius: '0',
}"
@click="childCheck(child, i)"
@@ -57,6 +59,7 @@
<div class="menu-bar-item-main-text">{{ child[property] }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -189,7 +192,9 @@ function menusStatusToFalsefather(menus) {
font-size: 13px;
z-index: 99999;
&-item {
position: relative;
width: 220px;
z-index: 99;
background: rgba(245, 245, 245, 0.6);
&-child {
background-color: #ffffff;
@@ -275,4 +280,24 @@ function menusStatusToFalsefather(menus) {
position: relative;
z-index: 99;
}
.menu-bar-item-child{
height: 50px;
display: block;
position: relative;
top: 0;
left: 0;
/* background: #ffffff; */
z-index: 999;
}
.menu-bar-item-parent{
height: 50px;
position: absolute;
z-index: 999;
left: 0;
top: 0;
background: #ffffff;
opacity: 1;
z-index: 100;
height: 50px;
}
</style>

View File

@@ -97,35 +97,34 @@
rowKey="option_index">
<template v-for="(col,index) in c2"
:key="index"
#[col.key]="{ text}">
#[col.key]="data">
<div v-if="col.dataIndex === 'sort'">
<div v-if="text.value=='1'"
<div v-if="data.text.value=='1'"
style="color:rgb(175,52,52)">
{{ text.value }}</div>
<div v-if="text.value=='2'"
{{ data.text.value }}</div>
<div v-if="data.text.value=='2'"
style="color:rgb(223,160,124)">
{{ text.value }}</div>
<div v-if="text.value=='3'"
{{ data.text.value }}</div>
<div v-if="data.text.value=='3'"
style="color:rgb(238,215,144)">
{{ text.value }}</div>
<div v-if="text.value!='3'&&text.value!='2'&&text.value!='1'">
{{ text.value }}</div>
{{ data.text.value }}</div>
<div v-if="data.text.value!='3'&&data.text.value!='2'&&data.text.value!='1'">
{{ data.text.value }}</div>
</div>
<div v-else-if="col.dataIndex === 'option_title'">
<div class="mxd-lc-detail-table-row"
v-if="text.type == 0 || text.type == 1"
v-html="text.value"></div>
<img v-if="text.type == 2"
:src="text.value"
<div class="mxd-lc-detail-table-row"
v-if="data.text.type == 0 || data.text.type == 1"
v-html="data.text.value" :style="data.index <3 ? 'color:#47c4f5' : ''"></div>
<img v-if="data.text.type == 2"
:src="data.text.value"
style="width: 40px; height: 40px" />
</div>
<div v-else>
<div v-if="text.value >= 0"
style="color: #52c19a">{{ text.value }}</div>
<div v-if="data.text.value >= 0"
style="color: #52c19a">{{ data.text.value == 0? '0': data.text.value}}</div>
<div v-else
style="color: #923139">{{ text.value }}</div>
style="color: #923139">{{ data.text.value == 0? '0': data.text.value }}</div>
</div>
</template>
</a-table>
@@ -140,36 +139,38 @@
:pagination="false"
rowKey="option_index"
:scroll="{ y: 500, x:800 }">
<template v-for="(col,index) in c1"
:key="index"
#[col.dataIndex]="{ text }">
#[col.dataIndex]=" data ">
<div v-if="col.dataIndex === 'sort'">
<div v-if="text.value=='1'"
<div v-if="data.text.value=='1'"
style="color:rgb(175,52,52)">
{{ text.value }}</div>
<div v-if="text.value=='2'"
{{ data.text.value }}</div>
<div v-if="data.text.value=='2'"
style="color:rgb(223,160,124)">
{{ text.value }}</div>
<div v-if="text.value=='3'"
{{ data.text.value }}</div>
<div v-if="data.text.value=='3'"
style="color:rgb(238,215,144)">
{{ text.value }}</div>
<div v-if="text.value!='3'&&text.value!='2'&&text.value!='1'">
{{ text.value }}</div>
{{ data.text.value }}</div>
<div v-if="data.text.value!='3'&&data.text.value!='2'&&data.text.value!='1'">
{{ data.text.value }}</div>
</div>
<div v-else-if="col.dataIndex === 'option_title'">
<div class="mxd-lc-detail-table-row"
v-if="text.type == 0 || text.type == 1"
v-html="text.value"></div>
<img v-if="text.type == 2"
:src="text.value"
v-if="data.text.type == 0 || data.text.type == 1"
v-html="data.text.value" :style="data.index <3 ? 'color:#47c4f5' : ''"></div>
<img v-if="data.text.type == 2"
:src="data.text.value"
style="width: 40px; height: 40px" />
</div>
<div v-else>
<div v-if="text.value >= 0"
style="color: #52c19a">{{ text.value }}</div>
<div v-else>
<div v-if="data.text.value >= 0"
style="color: #52c19a">{{ data.text.value == 0? '0': data.text.value}}</div>
<div v-else
style="color: #923139">{{ text.value }}</div>
style="color: #923139">{{ data.text.value == 0? '0': data.text.value }}</div>
</div>
</template>
</a-table>
@@ -290,7 +291,7 @@ async function download (type) {
}
watch(() => props.info, (info) => {
const data = JSON.parse(JSON.stringify(info.raw_data.data))
const data = JSON.parse(JSON.stringify(info.zero_data.data))
if (!info) return
fitChartData.value = info.fit_chart
if (typeof info.fit === 'string') {
@@ -307,12 +308,12 @@ watch(() => props.info, (info) => {
barData.value = barChartData;
const _c1 = [].concat(info.raw_data.columns)
c1.value = []
c1.value = _c1.map((item) => {
c1.value = _c1.map((item,index) => {
if (item?.children) {
item.children.map((e) => { e.dataIndex = e.key; childrenlist.push(e.key) })
item.children.map((e,index) => { e.dataIndex = e.key;e.index =index; childrenlist.push(e.key) })
}
if (item?.children) {
item.children.map((e) => { e.dataIndex = e.key; childrenlist.push(e.key) })
item.children.map((e,index) => { e.dataIndex = e.key;e.index =index;childrenlist.push(e.key) })
} else {
item.slots = { customRender: item.key }
item.dataIndex = item.key
@@ -347,9 +348,9 @@ watch(() => props.info, (info) => {
c2.value = []
// 带children的key存进去
c2.value = _c2.map(item => {
c2.value = _c2.map((item) => {
if (item?.children) {
item.children.map((e) => { e.dataIndex = e.key; childrenlist2.push(e.key) })
item.children.map((e) => { e.dataIndex = e.key;childrenlist2.push(e.key) })
} else {
item.slots = { customRender: item.key }
item.dataIndex = item.key

View File

@@ -7,17 +7,31 @@
</div>
<a-button class="daochubtn"
type="primary"
v-if="info && info.raw_data.columns.length >0"
@click="handleExportXlsx(responseData.columns, responseData.data)">
导出分析结果
</a-button>
</div>
<div>
<a-spin tip="Loading..." v-if="loading">
<a-alert
message="努力加载中..."
></a-alert>
</a-spin>
<div v-else-if=" !info || info.raw_data.columns.length <=0" class="empty-data">
<img class="empty-img"
:src="require('@/assets/img/publish/no-data.png')"
alt="" />
<div class="empty-text">由于样本量较小 暂无分析数据</div>
</div>
<a-tabs v-model:activeKey="activeKey"
@change="changeTab">
<a-tab-pane v-for="item in tabList"
:key="item.key"
:tab="item.title">
<div class="component-container">
<div v-if="!info"
<div v-if="!info || info.raw_data.columns.length <=0"
class="empty-data">
<img class="empty-img"
:src="require('@/assets/img/mxd/mxd_empty_data.png')"
@@ -36,6 +50,7 @@
</div>
</a-tab-pane>
</a-tabs>
</div>
</div>
</template>
@@ -76,6 +91,7 @@ const responseData = ref({});
const activeKey = ref("");
const tabList = ref([]);
const data = ref({});
const loading =ref(true);
const info = ref({
fit: "",
fit_chart: [],
@@ -188,7 +204,9 @@ function handleExportXlsx (columns, data) {
}
const getData = () => {
loading.value =true;
getAnalyseDetail(props.sn, props.id).then((res) => {
loading.value =false;
responseData.value = res.data;
const columns = res.data.columns;
const _data = res.data.data;
@@ -291,7 +309,7 @@ watchEffect(() => {
}
.empty-text {
color: #4f90ff;
color: $yili-default-color;;
}
}
.daochubtn {

View File

@@ -68,7 +68,7 @@
<div
class="edit-inner"
v-if="editableData[record.id]"
@mouseleave="handleSave(record.id)"
@blur="handleSave(record.id)"
>
<div class="inner-input">
<a-input
@@ -86,7 +86,7 @@
<div
v-else
style="text-align: center"
@click.stop="handleEdit(record.status, record.id)"
@click.stop="handleEdit(record.status, record.id,editableData)"
>
{{ record.title }}
</div>
@@ -115,8 +115,9 @@
<template #status_str="{ text, record }">
<div
:class="{
pending: record.status === 0,
ing: record.status === 1 || record.status === 2,
loading: record.status === 1,
conduct: record.status === 2 ,
error:record.status === 4,
success: record.status === 3,
}"
>
@@ -257,7 +258,6 @@ const columns = [
key: "finished_at",
slots: { customRender: "finished_at" },
sorter: true,
defaultSortOrder: "descend",
align: "center",
},
{
@@ -271,20 +271,18 @@ const columns = [
const editableData = ref({});
function handleInput(e, id) {
const splitValue = e.target.value.replace(/_/g, "");
if (splitValue) {
const splitValue = e.target.value;
editableData.value[id].title = splitValue;
} else {
editableData.value[id].title = cloneDeep(
tableSource.value.filter((item) => item.id === id)[0].title
);
}
}
function handleLeave(record) {
console.log("record", record);
}
function handleEdit(status, key) {
function handleEdit(status, key,) {
editableData.value={};
if (status === 3) {
//已完成
editableData.value[key] = cloneDeep(
@@ -301,6 +299,16 @@ function handleSave(key) {
delete editableData.value[key];
return;
}
if(!(title && title.replaceAll(" ","") && title.length <20)){
editableData.value[key] = cloneDeep(
tableSource.value.filter((item) => item.id === key)[0]
);
delete editableData.value[key];
message.error("标题格式有误");
return;
}
updateTitle(
sn,
editableData.value[key].id,
@@ -354,8 +362,7 @@ const handleAnalyse = async () => {
analysis_search_params.value.page = 1;
await runResult(data);
await runTableList(sn, { ...analysis_search_params.value });
analysis_type.value = "";
questionIndex.value = "";
questionIndex.value =null;
};
// 分页修改页码
@@ -541,6 +548,50 @@ onMounted(() => {
margin-right: 8px;
}
}
.error{
color: #FF3939 ;
display: flex;
align-items: center;
justify-content: center;
.dot {
background: #FF3939 ;
width: 6px;
height: 6px;
display: block;
border-radius: 50%;
margin-right: 8px;
}
}
.conduct{
color: #32B0F6 ;
display: flex;
align-items: center;
justify-content: center;
.dot {
background: #32B0F6 ;
width: 6px;
height: 6px;
display: block;
border-radius: 50%;
margin-right: 8px;
}
}
.loading{
color: #8C8C8C ;
display: flex;
align-items: center;
justify-content: center;
.dot {
background: #8C8C8C ;
width: 6px;
height: 6px;
display: block;
border-radius: 50%;
margin-right: 8px;
}
}
.edit-inner {
display: flex;
align-items: center;

View File

@@ -19,7 +19,7 @@
<a-input-number
block
:min="3"
:max="infoConfig.options?.[0]?.length"
:max="(infoConfig.options?.[0]?.length || 4 )-1"
class="input-number BPTO-footer-title"
v-model:value="infoConfig.config.concept"
@change="conceptInput(infoConfig.config.concept)"
@@ -74,6 +74,7 @@
</span>
<div class="right-btn ml-8">
<span>
{{infoConfig.options[0].length }}{{ infoConfig.config.concept}}
<a-button
type="primary"
@click="create"

View File

@@ -376,7 +376,7 @@ export function newQuesType (type, param) {
const initMaxdiff = () => {
result.options = [[]];
for (let index1 = 1; index1 <= 3; index1++) {
for (let index1 = 1; index1 <= 4; index1++) {
const maxdiff_option_config2 = new Option();
maxdiff_option_config2.option_index = index1;
maxdiff_option_config2.option = `<p>选项${index1}</p>`;
@@ -385,7 +385,7 @@ export function newQuesType (type, param) {
};
result.options[0].push(maxdiff_option_config2);
}
result.last_option_index = 2;
result.last_option_index = 4;
}
const init3D = () => {
result.last_option_index = 0;

View File

@@ -139,7 +139,7 @@
<a-radio :value="false" :disabled="true" />
</div>
</template>
<div class="delete" v-if="optionList.length > 3">
<div class="delete" v-if="optionList.length > 4">
<div @click="onRemove(item)">
<a>删除</a>
</div>
@@ -308,7 +308,7 @@ export default {
emitInfo(true);
};
/** 添加选项 */
/** 添加选项 */
const addOptionHandle = () => {
const newOption = new Option();
copyInfo.value.last_option_index++;
@@ -319,9 +319,11 @@ export default {
};
optionList.value.push(newOption);
copyInfo.value.options[0] = optionList.value;
copyInfo.value.config.task = Number.parseInt(
(optionList.value.length * 3) / copyInfo.value.config.concept
);
emitInfo(true);
};
const onUpLoadChange = (value) => {
console.log("onUpLoadChange", value);
value.forEach((element) => {
@@ -601,7 +603,7 @@ export default {
copyInfo.value.config["first_text"] = props.info.config["first_text"];
copyInfo.value.config["second_text"] = props.info.config["second_text"];
columns.value = getAnswerStyle(config.value.answer_style);
message.error("标题不能相");
message.error("标题不能相");
return;
}
emitInfo(isupdateV);

View File

@@ -165,6 +165,7 @@ import { useRoute } from "vue-router";
import ModelSuccess from "../../components/config/ModelSuccess.vue";
import ModelError from "../../components/config/ModelError.vue";
import { message, Modal } from "ant-design-vue";
import moment from "moment";
//import Tooltip from "../Tooltip.vue";
export default {
props: {
@@ -316,7 +317,7 @@ export default {
{
type: 6,
},
"生成设计模板.xlsx"
"MXD生成设计模板.xlsx"
);
};
@@ -400,7 +401,7 @@ export default {
url: copyConfig.value.config.file_url,
// sn: route.query.sn,
// question_index: copyConfig.value.question_index
});
},`MXD生产设计_${ moment().format("YYYYMMDDHHmmss")}.xlsx`);
// infoConfig.value.config.file_name = data.data.config.file_name;
// infoConfig.value.config.file_url = data.data.config.file_url;

View File

@@ -186,7 +186,7 @@ export function cbc_shelves_import(params) {
/* Maxdiff导出设计*/
const mxd_export = async (params) => {
const mxd_export = async (params,name) => {
const url = params.url;
// await request({
// url: `/console/surveys/${params.sn}/questions/${params.question_index}/mxd_export`,
@@ -203,7 +203,8 @@ const mxd_export = async (params) => {
withCredentials: false,
responseType: 'arraybuffer'
})
fileDownload(data, "", 'application/vnd.ms-excel');
fileDownload(data, name, 'application/vnd.ms-excel');
}