...
 
Commits (14)
NODE_ENV = 'development'
VUE_APP_URL = 'https://zcas.wzswsj.gov.cn:8079/screening-api/'
VUE_APP_IMG = 'https://inno.sh-sict.com/gastric/'
# VUE_APP_URL = 'https://zcas.wzswsj.gov.cn:8079/screening-api/'
# VUE_APP_IMG = 'https://inno.sh-sict.com/gastric/'
NODE_ENV = 'production'
VUE_APP_URL = 'https://inno.sh-sict.com/gastric-api/'
VUE_APP_IMG = 'https://inno.sh-sict.com/wjy-mobile/'
\ No newline at end of file
VUE_APP_BASE_API = '/wrm-api/'
VUE_APP_URL = '/wrm-api/'
\ No newline at end of file
.DS_Store
node_modules
dist
/cssc-mobile
# local env files
......
......@@ -18,8 +18,8 @@
<META HTTP-EQUIV="expires" CONTENT="0">
<!-- 标签图标 -->
<!-- <link type="favicon" rel="shortcut icon" href="./static/favicon.ico" /> -->
<title>视频诊断</title>
<script src="https://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"></script>
<title>随访反馈</title>
<!-- <script src="https://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"></script> -->
<script type="text/javascript">
var _hmt = _hmt || [];
</script>
......@@ -28,5 +28,5 @@
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<script src="https://hm.baidu.com/hm.js?08c72ecbd029d05f93ebb4a14a36dccf6" async></script>
<!-- <script src="https://hm.baidu.com/hm.js?08c72ecbd029d05f93ebb4a14a36dccf6" async></script> -->
</html>
......@@ -7,29 +7,43 @@ import {
expoertExcel,
getExcel,
downloadExcel
} from "../request/http.js";
import { prototype } from "events";
const v1 = `/gastric-cancer${process.env.VUE_APP_MOD || ""}-user`;
const ewellDefectData = `/gastric-cancer${process.env.VUE_APP_MOD || ""}-data`;
const im = `/gastric-cancer${process.env.VUE_APP_MOD || ""}-im`;
} from "../request/http.js"
import { prototype } from "events"
const v1 = `/gastric-cancer${process.env.VUE_APP_MOD || ""}-user`
const ewellDefectData = `/gastric-cancer${process.env.VUE_APP_MOD || ""}-data`
const im = `/gastric-cancer${process.env.VUE_APP_MOD || ""}-im`
export const API = {
//登录
login: (data) => {
return post(`${v1}/user/login`, data);
// login: (data) => {
// return post(`${v1}/user/login`, data);
// },
getFeedback: (data) => {
return get(`/disease-data/follow-up/feedback`, data)
},
putFeedback: (data) => {
return post(`/disease-data/follow-up/feedback`, data)
},
getPeopleList: (data) => {
return post(`${ewellDefectData}/report/hospital`, data);
////////////
// 获取问卷调查
getQuestionnaireList: (data) => {
return get(`/disease-data/questionnaire/list`, data)
},
getVideoList: (data) => {
return get(
`${ewellDefectData}/app/report/video/mine?pageNum=${data.pageNum}&pageSize=${data.pageSize}&dataId=${data.dataId}`,
data
);
// 获取问卷记录
getQuestionnaireRecords: (data) => {
return get(`/disease-data/questionnaire/records`, data)
},
fileUpload: (data) => {
return post(`${ewellDefectData}/app/report/video/chunk`, data);
// 获取用户信息
getPatientInfo: (data) => {
return get(`/disease-data/patient/info`, data)
},
fileMerge: (data) => {
return post(`${ewellDefectData}/app/report/video/merge`, data);
// 提交问卷
setQuestionnaire: (data) => {
return post(`/disease-data/questionnaire`, data)
},
login: (data) => {
return get(`/cloud-auth/oauth/token?grant_type=client_credentials`, data)
}
};
}
import axios from "axios";
import router from "../../router";
import qs from "qs";
import axios from "axios"
import router from "../../router"
import qs from "qs"
// import { Message as iviewMessage, Notice as iviewNotice } from 'view-design'
import { MessageBox, Toast } from "mint-ui";
import { MessageBox, Toast } from "mint-ui"
//接口报错弹出
let CommonAlert = function (msg) {
if (msg.length > 0) {
if (msg && msg.length > 0) {
return Toast({
message: msg,
duration: 1500
});
})
}
};
}
// axios.defaults.timeout = 5000;
if (process.env.NODE_ENV == "development") {
axios.defaults.baseURL = "https://inno.sh-sict.com/gastric-api/";
axios.defaults.baseURL = "/api"
} else {
axios.defaults.baseURL = process.env.VUE_APP_URL;
axios.defaults.baseURL = process.env.VUE_APP_URL
}
window.baseURL = axios.defaults.baseURL;
window.baseURL = axios.defaults.baseURL
//http request 拦截器
axios.create({
withCredentials: true
});
})
axios.interceptors.request.use(
(config) => {
config.data = config.data;
config.headers["user-cookie"] = localStorage.getItem("vd_token");
return config;
config.data = config.data
config.headers["user-cookie"] = localStorage.getItem("vd_token")
if (config.url.includes("oauth/token")) {
config.headers["Authorization"] = `Bearer YXBwOmNsb3VkX2FwcA==`
}
return config
},
(error) => {
return Promise.reject(err);
return Promise.reject(err)
}
);
)
/**
* 跳转登录页
......@@ -42,83 +45,83 @@ axios.interceptors.request.use(
const toLogin = () => {
router.replace({
path: "/login"
});
};
})
}
//响应拦截器即异常处理
axios.interceptors.response.use(
(response) => {
if (response.data.code === 0 || response.data.code === -1) {
CommonAlert(response.data.message);
CommonAlert(response.data.message || response.data.msg)
} else if (response.data.code === -100) {
localStorage.removeItem("vd_token");
window.location.hash = "/login";
localStorage.removeItem("vd_token")
// window.location.hash = "/login";
}
return response;
return response
},
(err) => {
if (err && err.response) {
switch (err.response.status) {
case 400:
CommonAlert("错误请求");
console.log("错误请求");
break;
CommonAlert("错误请求")
console.log("错误请求")
break
case 401:
CommonAlert("未授权,请重新登录");
toLogin();
console.log("未授权,请重新登录");
break;
CommonAlert("未授权,请重新登录")
// toLogin();
console.log("未授权,请重新登录")
break
case 403:
CommonAlert("拒绝访问");
console.log("拒绝访问");
break;
CommonAlert("拒绝访问")
console.log("拒绝访问")
break
case 404:
CommonAlert("请求错误,未找到该资源");
console.log("请求错误,未找到该资源");
break;
CommonAlert("请求错误,未找到该资源")
console.log("请求错误,未找到该资源")
break
case 405:
CommonAlert("请求方法未允许");
console.log("请求方法未允许");
break;
CommonAlert("请求方法未允许")
console.log("请求方法未允许")
break
case 408:
CommonAlert("请求超时");
console.log("请求超时");
break;
CommonAlert("请求超时")
console.log("请求超时")
break
case 500:
CommonAlert("服务器端出错");
console.log("服务器端出错");
break;
CommonAlert("服务器端出错")
console.log("服务器端出错")
break
case 501:
CommonAlert("网络未实现");
console.log("网络未实现");
break;
CommonAlert("网络未实现")
console.log("网络未实现")
break
case 502:
CommonAlert("网络错误");
console.log("网络错误");
break;
CommonAlert("网络错误")
console.log("网络错误")
break
case 503:
CommonAlert("服务不可用");
console.log("服务不可用");
break;
CommonAlert("服务不可用")
console.log("服务不可用")
break
case 504:
CommonAlert("网络超时");
console.log("网络超时");
break;
CommonAlert("网络超时")
console.log("网络超时")
break
case 505:
CommonAlert("http版本不支持该请求");
console.log("http版本不支持该请求");
break;
CommonAlert("http版本不支持该请求")
console.log("http版本不支持该请求")
break
default:
CommonAlert(`连接错误${err.response.status}`);
console.log(`连接错误${err.response.status}`);
CommonAlert(`连接错误${err.response.status}`)
console.log(`连接错误${err.response.status}`)
}
} else {
CommonAlert("连接到服务器失败");
console.log("连接到服务器失败");
CommonAlert("连接到服务器失败")
console.log("连接到服务器失败")
}
return Promise.resolve(err.response);
return Promise.resolve(err.response)
}
);
)
/**
* 封装get方法
......@@ -126,17 +129,27 @@ axios.interceptors.response.use(
* @param data
* @returns {Promise}
*/
export function get(url, data = {}) {
export function get(url, params = {}) {
return new Promise((resolve, reject) => {
axios.get(url, data).then(
(response) => {
resolve(response.data);
},
(err) => {
reject(err);
}
);
});
axios
.get(url, { params })
.then(
(response) => {
resolve(response.data)
},
(err) => {
reject(err)
}
)
.catch(
(response) => {
resolve(response.data)
},
(err) => {
reject(err)
}
)
})
}
/**
......@@ -154,13 +167,21 @@ export function post(url, data = {}, params = {}) {
})
.then(
(response) => {
resolve(response.data);
resolve(response.data)
},
(err) => {
reject(err);
reject(err)
}
);
});
)
.catch(
(response) => {
resolve(response.data)
},
(err) => {
reject(err)
}
)
})
}
export function postForm(url, data = {}) {
return new Promise((resolve, reject) => {
......@@ -172,13 +193,13 @@ export function postForm(url, data = {}) {
})
.then(
(response) => {
resolve(response.data);
resolve(response.data)
},
(err) => {
reject(err);
reject(err)
}
);
});
)
})
}
//用来导出excel
......@@ -193,13 +214,13 @@ export function expoertExcel(url, data = {}) {
})
.then(
(response) => {
resolve(response.data);
resolve(response.data)
},
(err) => {
reject(err);
reject(err)
}
);
});
)
})
}
//下载excel
......@@ -215,20 +236,20 @@ export function downloadExcel(url, data = {}, title = "筛查信息导出表") {
//兼容ie
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel"
});
window.navigator.msSaveOrOpenBlob(blob, `${title}.xlsx`);
return;
})
window.navigator.msSaveOrOpenBlob(blob, `${title}.xlsx`)
return
} else {
const link = document.createElement("a");
const link = document.createElement("a")
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel"
});
link.style.display = "none";
link.href = URL.createObjectURL(blob);
link.setAttribute("download", `${title}.xlsx`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
})
link.style.display = "none"
link.href = URL.createObjectURL(blob)
link.setAttribute("download", `${title}.xlsx`)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
})
.catch((error) => {
......@@ -236,9 +257,9 @@ export function downloadExcel(url, data = {}, title = "筛查信息导出表") {
// title: '错误',
// desc: '系统数据错误',
// })
CommonAlert("系统数据错误");
console.log(error);
});
CommonAlert("系统数据错误")
console.log(error)
})
}
/**
* 封装delete请求
......@@ -251,13 +272,13 @@ export function Delete(url, data = {}) {
return new Promise((resolve, reject) => {
axios.delete(url, data).then(
(response) => {
resolve(response.data);
resolve(response.data)
},
(err) => {
reject(err);
reject(err)
}
);
});
)
})
}
/**
......@@ -271,15 +292,15 @@ export function put(url, data = {}) {
return new Promise((resolve, reject) => {
axios.put(url, data).then(
(response) => {
resolve(response.data);
resolve(response.data)
},
(err) => {
reject(err);
reject(err)
}
);
});
)
})
}
export function getUrl() {
return axios.defaults.baseURL;
return axios.defaults.baseURL
}
<template>
<div>
<van-form class="cellGroup" :readonly="disabled" ref="vanform">
<!-- <div class="cellGroup"> -->
<template v-for="(item, index) in formData">
<template v-if="!item.hidden">
<div
:key="index + '111'"
v-if="item.type === 'title'"
class="questionnaireTitle"
>
<span>{{ item.label }}</span>
</div>
<van-cell-group
v-if="item.type !== 'button'"
:key="index"
:border="border"
:class="item.isTop ? 'top' : 'seat'"
:style="{ 'border-radius': item.radius }"
>
<van-field
v-if="item.type == 'text'"
:class="{ 'vertical-field': item.title.length > 9 }"
clearable
center
v-model="form[item.prop]"
:label-width="item.labelWidth || 160"
:name="item.name"
:readonly="disabled || item.disabled"
:label="item.title"
:value="form[item.prop]"
:placeholder="
disabled ? '' : item.placeholder || `请输入${item.title}`
"
:input-align="item.inputAlign || 'right'"
:maxlength="item.maxlength"
:required="item.required"
:rules="item.rules"
:type="item.inputType || 'number'"
error-message-align="right"
:style="{
height: cellHeight,
'border-radius': item.cellBorder,
margin: item.cellMargin
}"
@input="item.input ? item.input(form[item.prop], index) : {}"
@blur="
item.blur ? item.blur(form[item.prop], index, item.prop) : {}
"
>
<template slot="extra">
{{ item.suffix }}
</template>
</van-field>
<!-- 数据展示 -->
<van-field
v-if="item.type == 'readField'"
class="vertical-field"
readonly
v-model="form[item.prop]"
:name="item.name"
:label="item.label"
:value="form[item.prop]"
:input-align="item.inputAlign || 'right'"
:rules="item.rules"
:style="{
'border-radius': item.cellBorder,
margin: item.cellMargin
}"
>
<template slot="input">
<span>{{ form[item.prop] }}</span>
<van-tag
v-show="item.tagShow == true"
plain
type="primary"
color="white"
text-color="#0079fe"
round
>{{ item.tag }}</van-tag
>
</template>
<template slot="right-icon">
<!-- <van-checkbox-group v-model="formList.checkbox"> -->
<van-checkbox
name="checkbox"
v-model="formList.checkbox"
v-show="item.checkboxShow == true"
/>
<!-- </van-checkbox-group> -->
</template>
</van-field>
<!-- 选择器 -->
<van-field
v-if="item.type == 'pickerField'"
readonly
is-link
clickable
center
:name="item.name"
:label="item.label"
:value="transPicker(pickerData[item.prop], item.columns)"
:placeholder="
item.placeholder ? item.placeholder : `请选择${item.label}`
"
input-align="right"
error-message-align="right"
@click="
() => {
if (!disabled) {
item.showPicker = true
}
}
"
:rules="item.rules"
:style="{
height: cellHeight,
'border-radius': item.cellBorder,
margin: item.cellMargin
}"
@change="pickerCellChange(item, form[item.prop])"
>
</van-field>
<van-popup v-model="item.showPicker" round position="bottom">
<van-picker
show-toolbar
:columns="item.columns"
v-model="form[item.prop]"
@cancel="item.showPicker = false"
@confirm="onConfirm($event, index, item.prop)"
ref="picker"
/>
</van-popup>
<!-- 链接跳转 -->
<van-cell
:title="item.label"
:is-link="item.isLink"
@click="item.func ? item.func(item) : {}"
:icon="item.icon"
:style="{ height: cellHeight, 'border-radius': item.cellBorder }"
border
clickable
center
v-if="item.type == 'cell'"
>
<template slot="right-icon" v-if="item.tag">
<van-tag
:type="item.tag.type"
:color="item.tag.color"
:text-color="item.tag.textColor"
>{{ item.tag.text }}</van-tag
>
</template>
<!-- <template v-if="index==0" #value>
<span>{{item.num}}人</span>
<van-tag plain type="primary" color="white" text-color="#0079fe">+{{item.new}}</van-tag>
</template>-->
</van-cell>
<!-- 时间 -->
<div v-else-if="item.type === 'date'">
<van-field
readonly
clickable
name="datetimePicker"
:value="form[item.prop]"
:label="item.label"
:label-width="item.labelWidth || 160"
:rules="item.rules"
placeholder="点击选择时间"
input-align="right"
@click="openPopup(item.prop)"
/>
</div>
<!-- 单选 -->
<van-field
class="vertical-field"
v-if="item.type == 'radio'"
:label="item.title"
:name="item.name"
:required="item.required"
:rules="item.rules"
>
<template slot="input">
<van-radio-group
v-model="form[item.prop]"
:disabled="disabled || item.disabled"
:label-width="item.labelWidth || 160"
>
<van-radio
v-for="(rItem, rIndex) in item.options"
:key="rIndex"
:name="rItem.id"
>{{ rItem.option }}
<span class="tips">{{ rItem.tips }}</span>
</van-radio>
</van-radio-group>
</template>
</van-field>
<!-- 含显隐控制单选 -->
<van-field
class="vertical-field"
v-if="item.type == 'complexRadio'"
:label="item.label"
:name="item.name"
:required="item.required"
:rules="item.rules"
>
<template slot="input">
<van-radio-group
v-model="form[item.prop]"
:disabled="disabled || item.disabled"
:label-width="item.labelWidth || 160"
@change="
valueChangedFunc(
item.children,
form[item.prop],
item.showChildrenValue
)
"
>
<van-radio
v-for="(rItem, rIndex) in item.opts"
:key="rIndex"
:name="rItem.value"
>{{ rItem.label }}
<span class="tips">{{ rItem.tips }}</span>
</van-radio>
<template
v-if="item.showChildrenValue.includes(form[item.prop])"
>
<template v-for="(child, i) in item.children">
<div
v-if="child.type === 'devider'"
:key="i + '00'"
style="color: #666666"
>
{{ child.label }}
</div>
<van-field
:key="i + '00'"
v-if="child.type === 'radio'"
class="vertical-field"
:label="child.label"
:name="child.name"
:required="child.required"
:rules="child.rules"
>
<template slot="input">
<van-radio-group
v-model="form[child.prop]"
class="init-radio"
>
<van-radio
v-for="(oItem, oIndex) in child.opts"
:key="'0' + oIndex"
:name="oItem.value"
>{{ oItem.label }}</van-radio
>
</van-radio-group>
</template>
</van-field>
<van-field
:key="'a' + i"
v-if="child.type == 'input'"
:class="{ 'vertical-field': child.label.length > 15 }"
clearable
center
v-model="form[child.prop]"
:label-width="child.labelWidth || 160"
:name="child.name"
:readonly="disabled || child.disabled"
:label="child.label"
:value="form[child.prop]"
:placeholder="
disabled
? ''
: child.placeholder || `请输入${child.label}`
"
:input-align="child.inputAlign || 'right'"
:maxlength="child.maxlength"
:required="child.required"
:rules="child.rules"
:type="child.inputType"
error-message-align="right"
:style="{
height: cellHeight,
'border-radius': child.cellBorder,
margin: child.cellMargin
}"
@input="
child.input
? child.input(form[child.prop], index)
: {}
"
@blur="
child.blur
? child.blur(form[child.prop], index, child.prop)
: {}
"
/>
</template>
</template>
</van-radio-group>
</template>
</van-field>
<!-- 复选 -->
<van-field
class="vertical-field"
v-if="item.type == 'checkbox'"
:label="item.label"
:name="item.name"
:required="item.required"
:rules="item.rules"
>
<template slot="input">
<van-checkbox-group
v-model="form[item.prop]"
:disabled="disabled || item.disabled"
:label-width="item.labelWidth || 160"
>
<van-checkbox
v-for="(cItem, cIndex) in item.opts"
@click="item.func(form[item.prop], item.opts, item.prop)"
:key="cIndex"
:name="cItem.value"
shape="square"
>{{ cItem.label }}
<span class="tips">{{ cItem.tips }}</span>
</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
<!-- 分隔 占位 -->
</van-cell-group>
<!-- 按钮 -->
<van-button
:key="index"
v-if="item.type == 'button'"
:type="item.buttonType"
:plain="item.plain"
:size="item.size"
:disabled="disabled"
:loading="btnLoading"
@click="item.func ? item.func() : onSubmit()"
:class="item.isAbsolute ? 'absolute-button' : ''"
:style="{
margin: item.buttonMargin,
background: item.buttonBackground,
color: item.buttonColor,
border: item.buttonBorder,
width: item.buttonWidth,
'font-size': item.textSize
}"
>{{ item.buttonText }}</van-button
>
</template>
</template>
<!-- </div> -->
</van-form>
<van-popup v-model="showPicker" position="bottom">
<van-datetime-picker
@confirm="handlePickerConfirm"
v-model="currentDate"
type="date"
@cancel="showPicker = false"
:min-date="minDate"
:max-date="maxDate"
/>
</van-popup>
</div>
</template>
<script>
export default {
name: "VForm",
props: {
//表单
formData: {
type: Array,
isLink: { type: String, default: "false" },
isAbsolute: { type: Boolean, default: false }, //固定按钮
// type:{ type: String, default: 'cell' },
// cornertext: String,
showPicker: { type: Boolean, default: false }
},
disabled: {
type: Boolean,
default: false
},
formEdit: Object, //数据
border: Boolean,
cellHeight: {
type: String,
default: "48px"
},
isPart: {
type: Boolean,
default: false
}, //只返回有项目的表单数据
loading: {
type: Boolean,
default: false
}
},
components: {},
data() {
return {
minDate: new Date(1910, 0, 1),
maxDate: new Date(),
currentDate: new Date(),
formList: {
type: Array,
validateText: "",
checkbox: 1 || 0
},
form: {},
pickerData: {},
showPicker: false,
prop: "",
btnLoading: false
}
},
computed: {},
methods: {
valueChangedFunc(children, value, showChildrenValue) {
console.log(children, value, showChildrenValue)
if (!showChildrenValue.includes(value)) {
// 清除值
children.forEach((e, index) => {
this.form[e.prop] = ""
})
}
},
//picker数据转化
transPicker(data, list) {
console.log("输入", data)
let value = data
if (parseFloat(Number(data)).toString() != "NaN" && list) {
const item = list.find((_) => String(_.value) == String(data))
value = item ? item.text : data
}
console.log("转化", value)
return value
},
onSubmit() {
// this.btnLoading = true
//表单验证
this.$refs.vanform
.validate()
.then(() => {
this.$emit("handleConfirm", this.form)
})
.catch(() => {
this.btnLoading = false
// this.$toast.fail("验证失败")
})
},
handlePickerConfirm(time) {
this.form[this.prop] = new Date(time).toLocaleDateString()
this.showPicker = false
},
openPopup(prop) {
if (this.disabled) return
this.prop = prop
this.showPicker = true
},
pickerCellChange(item, data) {
console.log("弹出返回值", item, data)
},
// 弹出框
onConfirm(value, index, prop) {
// console.log("pick", value, index, prop)
// this.form[index].value = value;
if (Array.isArray(value)) {
this.form[prop] = value.join("")
this.pickerData[prop] = value.join("")
} else {
this.pickerData[prop] = value.text
this.form[prop] = value.value
}
// console.log('选择变更',this.pickerData,this.form)
this.formData[index].showPicker = false
this.$emit("handlePicker", value, prop)
},
// 初始化整个表单(可在初始化时赋值)
initforms() {
const form = {}
const data = {}
this.formData.forEach((item) => {
if (!item.prop || item.hidden) return false
if (
item.type === "checkbox" ||
item.type === "cascader" ||
item.multiple
) {
form[item.prop] = []
} else {
form[item.prop] = ""
if (item.type === "pickerField") {
data[item.prop] = ""
}
}
})
if (this.formEdit) {
// this.form=form
this.form = Object.assign(form, this.formEdit) //包含非表单
} else {
this.form = Object.assign({}, form)
}
this.pickerData = Object.assign({}, data, this.formEdit)
},
// 给表单部分字段赋值(此时表单已初始化)
initFields(obj) {
for (const key in obj) {
this.form[key] = obj[key]
}
}
},
watch: {
formEdit: {
handler() {
this.initforms()
},
deep: true
},
pickerData(val) {},
loading(val) {
if (val != this.btnLoading) {
this.btnLoading = val
}
},
form(val) {
// console.log("最终", val)
}
},
created: function () {
this.initforms()
}
}
</script>
<style lang="scss" scoped>
.cellGroup {
// display: flex;
// flex-wrap: wrap;
// margin: 10px 0px;
border-radius: 5px;
overflow: hidden;
// background: white;
// display: inline;
}
.formButton {
text-align: center;
}
.top {
// border-radius: 5px 5px 0px 0px;
border-color: white !important;
overflow: hidden;
}
.seat {
border-radius: 0px 0px 5px 5px;
overflow: hidden;
// margin-bottom: 10px;
}
.absolute-button {
position: fixed;
z-index: 999;
top: 4px;
right: 20px;
padding: 0px;
font-size: 14px;
width: 40px;
}
::v-deep .van-field__label {
// width: 4.5em;
margin-right: 3px;
width: fit-content;
}
.vertical-field {
display: flex;
flex-direction: column;
::v-deep .van-field__label {
width: 100%;
}
::v-deep .van-field__value {
width: 100%;
}
.van-radio-group {
border: 1px solid #d3d3d3;
padding: 4px 8px;
border-radius: 4px;
width: 100%;
margin: 12px 0px 0px;
::v-deep {
.van-radio__label {
margin-left: 12px;
}
}
}
.van-radio {
padding: 5px;
padding: 10px 4px 10px;
}
.van-radio:not(:last-child) {
border-bottom: 1px solid #d3d3d3;
}
.van-checkbox-group {
border: 1px solid #d3d3d3;
padding: 5px;
border-radius: 5px;
width: 100%;
margin: 5px 10px 0px;
}
.van-checkbox {
padding: 5px;
border-bottom: 1px solid #d3d3d3;
}
.van-checkbox:last-child {
border: none !important;
}
::v-deep .van-checkbox__icon--square {
border-radius: 3px;
overflow: hidden;
}
}
.tips {
font-size: 12px;
font-weight: 400;
color: #3577f1;
margin-left: 5px;
}
::v-deep .van-cell {
// border-radius: 5px;
// height: 55px;
padding: 12px;
min-height: 44px;
overflow: visible;
}
// ::v-deep .van-cell__title {
// margin-left: 10px;
// }
::v-deep .van-cell::after {
padding: 12px;
border: none !important;
}
::v-deep .van-divider {
background: white;
padding: 7px;
margin: 0;
}
::v-deep .van-radio__label--disabled {
color: #323233;
}
::v-deep .van-checkbox__label--disabled {
color: #323233;
}
::v-deep .van-tag {
margin-left: 25px;
padding: 7px 20px;
}
.code-button {
background: none !important;
border: none !important;
height: 30px !important;
color: rgba(0, 121, 254, 1);
}
::v-deep {
.van-radio__icon--disabled .van-radio__icon--checked .van-icon {
background: #1e80ff !important;
}
.van-radio__icon--disabled.van-radio__icon--checked .van-icon {
background: #1e80ff !important;
}
}
.init-radio {
border: none !important;
.van-radio:not(:last-child) {
border-bottom: none !important;
}
}
.questionnaireTitle {
background: #fff;
padding: 12px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666666;
}
.van-cell {
border-bottom: 1px solid #f5f5f5;
}
::v-deep .van-button {
border-radius: 50px !important;
}
</style>
<template>
<div class="index-wrap">
<x-header :left-options="{ backText: '', showBack: false }">
松中心随访反馈
</x-header>
<v-content :has-header="true" :has-footer="false">
<div class="content-title" v-if="submitStatus != 2">
<p>尊敬的患者,为更好的为您服务,请填写以下反馈问卷。</p>
<van-radio-group v-model="selected" class="radio-list">
<van-radio
:name="item.value"
v-for="(item, index) in radioList"
:key="index"
class="radio-item"
>{{ item.label }}</van-radio
>
</van-radio-group>
<van-field
v-model="value"
type="textarea"
rows="4"
autosize
placeholder="期待您的其他反馈"
class="text-area-field"
/>
<div style="margin: 16px">
<van-button
round
block
:loading="loading"
:disabled="disabled"
type="info"
class="btn"
native-type="submit"
@click="submit"
>{{ disabled ? "已提交" : "提交" }}</van-button
>
</div>
</div>
<div class="empty" v-else>
<div class="empty-img"></div>
<div class="empty-text">该链接已过期</div>
</div>
</v-content>
<van-dialog
v-model="show"
confirm-button-color="#4C73FF"
confirm-button-text="好的"
>
<div class="dialog-body">
<p>提交成功</p>
<div class="icon">
<van-icon name="checked" />
</div>
<div class="text">您的随访反馈已提交成功</div>
</div>
</van-dialog>
</div>
</template>
<script>
export default {
data() {
return {
show: false,
value: "",
submitStatus: "",
selected: "",
loading: false,
disabled: false,
radioList: [
{ label: "愿意参与持续随访", value: "1" },
{ label: "推迟参与随访", value: "2" },
{ label: "医生告知无需继续复诊", value: "3" },
{ label: "不想继续在松中心治疗", value: "4" },
{ label: "其他", value: "5" }
]
}
},
methods: {
submit() {
if (!this.selected) {
this.$toast.fail({
type: "fail",
forbidClick: true,
message: "请选择反馈内容"
})
return
}
if (this.selected == "5" && this.value == "") {
this.$toast.fail({
type: "fail",
forbidClick: true,
message: "请输入反馈内容"
})
return
}
const data = {
patientId: this.dataId,
content:
this.selected != 5
? this.radioList[this.selected - 1].label
: this.value,
type: this.selected
}
this.$API.putFeedback(data).then((res) => {
if (res.code == 1) {
this.show = true
}
})
},
getData() {
const data = {
patientId: this.dataId
}
this.$API.getFeedback(data).then((res) => {
if (res.code == 1) {
this.submitStatus = res.object.submitStatus
if (this.submitStatus == 1) {
this.selected = res.object.data.feedbackType + ""
this.value =
this.selected == 5 ? res.object.data.feedbackContent : ""
} else {
this.selected = ""
this.value = ""
}
// localStorage.setItem("vd_token", res.result)
// this.$toast.success({
// type: "success",
// forbidClick: true,
// message: "登录成功",
// onClose: () => {
// this.$router.push("/peopleList")
// },
// duration: 1500
// })
}
})
}
},
mounted() {
console.log(this.$route)
this.dataId = this.$route.params.dataId
if (this.dataId) {
this.getData()
}
},
watch: {}
}
</script>
<style lang="scss" scoped>
.content-title {
height: 100%;
padding: 24px;
position: relative;
p {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
letter-spacing: 1px;
color: #333333;
}
.radio-list {
margin-top: 24px;
.radio-item {
margin-bottom: 16px;
}
}
}
::v-deep {
.text-area-field {
// width: 327px;
// min-height: 140px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #d2d2d2;
}
}
.btn {
height: 44px;
border-radius: 22px !important;
position: absolute;
bottom: 24px;
left: 50%;
transform: translateX(-50%);
width: 90%;
}
.empty {
width: 100%;
.empty-img {
margin: 200px auto 0px;
width: 220px;
height: 160px;
background: url("~@/assets/img/guoqi@2x.png") no-repeat 100% 100%;
background-size: cover;
}
.empty-text {
text-align: center;
font-size: 16px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666666;
}
}
.dialog-body {
text-align: center;
padding: 20px;
p {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
color: #000000;
}
.icon {
font-size: 70px;
color: #4c73ff;
}
.text {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333333;
}
}
</style>
<template>
<!-- 筛查地图 -->
<div class="index-wrap">
<x-header :left-options="{ backText: '', showBack: false }">
人员列表
</x-header>
<v-content
has-header
:has-footer="false"
>
<!-- 列表 -->
<van-list
class="list_content"
ref="scroller"
v-model="loading"
:immediate-check='false'
:finished="finished"
finished-text="没有更多了"
offset="100"
@load="loadMore"
>
<van-cell-group
inset
v-for="(item, index) in peopleList"
:key="index"
>
<van-cell
center
is-link
@click="JumpTo(item.id)"
>
<template #title>
<div class="avater">
<div
class="circle"
:style="{background:item.riskRank=='a'?'#ED4014':item.riskRank=='b'?'#FF9900':'#2DB7F5'}"
>
</div>
{{ item.name }}
</div>
</template>
<template #right-icon>
<div class="right">
<div class="plan_time">
计划随访时间 : {{ item.followUpTime }}
</div>
<div class="module">
模式 : {{ item.diseaseType | vtol }}
</div>
</div>
</template>
<template #label>
<span>
{{ item.patientInfo?item.patientInfo.sex=='a'?'':'':'--' }}
</span>
&nbsp;
<span>
{{ item.patientInfo?item.patientInfo.birthday:'--' }}
</span>
&nbsp;
<span>
{{ item.patientInfo?item.patientInfo.address:'--' }}
</span>
</template>
</van-cell>
</van-cell-group>
</van-list>
</v-content>
</div>
</template>
<script>
export default {
name: 'peopleList',
data () {
return {
pageNum: 1,
pageSize: 10,
totalCount: 0,
peopleList: [],
loading: false,
finished: false,
};
},
methods: {
JumpTo (id) {
this.$router.push(`/videoList?id=${id}`)
},
getList () {
let data = {
pageNum: this.pageNum,
pageSize: this.pageSize
}
this.finished = false;
this.$API.getPeopleList(data).then(res => {
if (res.code == -100) {
sessionStorage.setItem('getList', true)
} else {
sessionStorage.removeItem('getList')
}
this.loading = false
this.totalCount = res.object?.totalCount
this.peopleList = [...this.peopleList, ...res.object.list]
if (this.peopleList.length >= this.totalCount) {
this.finished = true
}
})
},
loadMore () {
this.pageNum++
this.getList()
},
},
activated () {
let getList = sessionStorage.getItem('getList')
if (getList) {
this.peopleList = []
this.getList()
}
const scrollTops = this.$route.meta.scrollTop;
const $content = document.querySelector('.list_content');
if (scrollTops && $content) {
this.$nextTick(() => {
var scrollTop = this.$el.querySelector('.list_content')
scrollTop.scrollTop = scrollTops - 1
})
}
},
beforeRouteLeave (to, from, next) {
const $content = document.querySelector('.list_content'); // 列表的外层容器
const scrollTop = $content ? $content.scrollTop : 0;
from.meta.scrollTop = scrollTop;
next()
},
mounted () {
// console.log('???');
this.peopleList = []
this.getList()
},
watch: {},
filters: {
vtol (v) {
if (v) {
let item = [{
label: "无症状早癌筛查流程",
value: "sj_wzz",
},
{
label: "体检人群胃癌筛查",
value: "sj_tj",
},
{
label: "院内胃癌筛查流程",
value: "sj_nj",
}].filter(e => e.value == v)
if (item.length > 0) {
return item[0].label
} else {
return '--'
}
} else {
return '--'
}
}
},
};
</script>
<style lang="scss" scoped>
.doText {
font-size: 16px;
color: #127bff;
}
.list_content {
height: 100%;
overflow: auto;
padding: 20px 0;
}
.avater {
display: flex;
align-items: center;
margin-bottom: 10px;
.circle {
width: 10px;
height: 10px;
border-radius: 50%;
margin-right: 5px;
}
}
::v-deep .van-cell-group {
height: 100px;
margin-bottom: 16px;
.van-cell {
height: 100%;
}
}
.right {
height: 100%;
padding: 9px 0 8px;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-end;
}
.plan_time,
.module {
margin-bottom: 2px;
font-size: 12px;
color: #969799;
}
</style>
<template>
<div>
<x-header :left-options="{ backText: '', showBack: false }">
调查表
</x-header>
<v-content :has-header="true" :has-footer="true">
<v-form
:form-data="forms"
:formEdit="formEdit"
:isPart="true"
@handleConfirm="submit"
ref="form"
:loading="btnLoading"
></v-form>
</v-content>
</div>
</template>
<script>
import VForm from "@/components/FormComponents"
export default {
name: "questionnaire",
components: { VForm },
data() {
return {
forms: [
{
// type: "input",
// label: "身高(厘米)",
// dot: "48",
// prop: "height",
// unit: "cm",
// isp: true,
// inputType: "number",
}
],
formEdit: {},
btnLoading: false
}
},
methods: {
// login() {
// this.$API.login().then((res) => {
// console.log(res)
// })
// },
getPatientInfo() {
// let data = 'NfQ4zQ+wWuvnPfQQgL6wHMQb5XGNtIbxXUiYHs5NmhnI7tSHpQob3FCUx59D/nPWbmKlW7pp5d00I/P9L0q9skLoGpXaf10EAwXJjyT8JFWwu5FFapdBHsjV0KLq+erWns7g70e4wYH2eTxQHpMwxj7+GOuPL5LtPR0x2RLJDyY='
// data = data.replaceAll("+", "%2B")
let params = {
// data: data
data: this.$route.query.data
}
this.$API
.getPatientInfo(params)
.then((res) => {
if (res.code == 1) {
this.baseInfo = {
...res.data
}
this.getQuestionList()
this.getQuestionnaireRecords()
}
})
.catch(() => {
this.baseInfo = {}
})
},
getQuestionList() {
this.$API.getQuestionnaireList().then((res) => {
if (res.code == 1) {
this.forms = [...res.data]
// this.forms.map((e) => {
// e.rules = [{ required: true, trigger: "blur", message: "该项必传" }]
// })
this.forms.push({
type: "button",
buttonType: "info",
size: "large",
buttonMargin: "10px",
borderRadius: "50px",
buttonWidth: "95%",
buttonText: "保存",
nativeType: "submit"
})
}
})
},
getQuestionnaireRecords() {
this.$API
.getQuestionnaireRecords({
patientId: this.baseInfo.id
})
.then((res) => {
if (res.code == 1) {
if (res.data) {
this.records = res.data.map((e) => e.records)
this.formEdit = { ...this.records[0] }
}
}
})
},
submit() {
this.btnLoading = true
let form = this.$refs.form.form
const data = {
params: form,
patientId: this.baseInfo.id
}
this.$API
.setQuestionnaire(data)
.then((res) => {
this.btnLoading = false
if (res.code == 1) {
this.$toast.success({
type: "success",
forbidClick: true,
message: "提交成功",
onClose: () => {
// this.$router.push("/peopleList")
},
duration: 1500
})
}
})
.catch((error) => {
console.log(error)
this.btnLoading = false
})
}
},
created() {
// this.login()
if (this.$route.query.data) {
this.getPatientInfo()
}
},
mounted() {},
watch: {}
}
</script>
<style lang="scss" scoped></style>
<template>
<div>
<van-loading
v-if="uploadLoading"
type="spinner"
class="loading_box"
vertical
text-color="#fff"
text-size='16'
>
上传中,请勿退出...
</van-loading>
<x-header :left-options="{backText: '',showBack:true}">
内镜视频
<div
class="uploadBtn"
slot="right"
>
<van-uploader
:after-read="afterRead"
:max-count='1'
accept='video/*'
>
<van-button type="text">上传文件</van-button>
</van-uploader>
</div>
</x-header>
<!-- 列表 -->
<v-content
has-header
:has-footer="false"
>
<van-list
:immediate-check='false'
class="list_content"
ref="scroller"
v-model="loading"
:finished="finished"
finished-text="没有更多了"
:offset="100"
@load="onLoad"
>
<van-row
type="flex"
justify="space-between"
>
<van-col
v-for="(item,index) in videoList"
:key="index"
class="col"
>
<!-- 图片 -->
<div class="img_box">
<van-image
id="video"
:src="'https://inno.sh-sict.com/gastric/gastric-resources/' + item.coverUrl"
/>
<div class="start_icon">
<van-icon
name="play-circle-o"
size="50"
color='#e6e6e6'
@click="showVideo(item.videoName)"
/>
</div>
</div>
<div
class="van-ellipsis"
style="font-size:12px;"
>
{{item.videoName}}
</div>
<div class="label van-ellipsis">
{{item.createTime}}
</div>
<div class="label van-ellipsis">
<a>诊断详情</a>
<a
style="color:#127BFF;"
@click="showPop(item)"
>点击查看</a>
</div>
</van-col>
</van-row>
</van-list>
</v-content>
<van-popup
v-model="show"
position="bottom"
round
:style="{ height: '40%' }"
>
<div class="pop_content">
<div class="item">
<div class="label">
诊断日期:
</div>
<div class="value">
{{ describe.diagnosisTime || '--' }}
</div>
</div>
<div class="item">
<div class="label">
诊断所见:
</div>
<div class="value">
{{ describe.finding || '--' }}
</div>
</div>
<div class="item">
<div class="label">
诊断结果:
</div>
<div class="value">
{{ describe.diagnosis || '--' }}
</div>
</div>
</div>
</van-popup>
</div>
</template>
<script>
// 引入
import { uploadByPieces } from '../utils/upload'
export default {
name: 'videoList',
data () {
return {
show: false,
describe: {},//诊断详情
videoList: [],
loading: false,
finished: false,
pageNum: 1,
pageSize: 10,
totalCount: 0,
uploadLoading: false
}
},
methods: {
onLoad () {
if (!this.finished) {
this.pageNum++
this.getVideoList()
}
},
getVideoList () {
let data = {
pageNum: this.pageNum,
pageSize: this.pageSize,
dataId: this.$route.query.id
}
this.$API.getVideoList(data).then(res => {
this.loading = false
if (res.code == 1) {
this.totalCount = res.object.totalCount
this.videoList = [...this.videoList, ...res.object.list]
}
if (this.videoList.length >= this.totalCount) {
this.finished = true
}
})
},
showPop (data) {
this.show = true
this.describe = data
},
showVideo (url) {
var isIphone = navigator.userAgent.indexOf('iPhone') >= 0;
// if (isIphone) {
// window.open('https://inno.sh-sict.com/gastric-api/gastric-cancer-data/file/show?videoName=' + url, '_self')
// } else {
this.$router.push(`/videoShow?src=${url}`)
// }
},
afterRead (file) {
this.uploadLoading = true
// console.log(file);
let dataId = this.$route.query.id
let randomNum = dataId + '' + Math.round(Math.random() * 10000)
uploadByPieces({
randoms: randomNum, // 随机数,这里作为给后端处理分片的标识 根据项目看情况 是否要加
file: file.file, // 视频实体
pieceSize: 10, // 分片大小
dataId: dataId,
success: data => {
console.log('分片上传视频成功', data)
// 合并
this.$API.fileMerge({
dataId: dataId,
videoName: data.videoName,
id: randomNum
}).then(res => {
this.uploadLoading = false
this.pageNum = 1
this.videoList = []
this.getVideoList()
})
},
error: e => {
console.log('分片上传视频失败', e)
this.uploadLoading = false
}
})
},
},
mounted () {
this.videoList = []
this.getVideoList()
},
activated () {
const scrollTop = this.$route.meta.scrollTop;
const $content = document.querySelector('.list_content');
if (scrollTop && $content) {
this.$nextTick(() => {
console.log(scrollTop);
document.querySelector('.list_content').scrollTop = scrollTop;
})
}
},
beforeRouteLeave (to, from, next) {
if (to.path != '/videoShow') {
from.meta.keepAlive = false
} else
if (to.path == '/videoShow') {
from.meta.keepAlive = true
const $content = document.querySelector('.list_content'); // 列表的外层容器
const scrollTop = $content ? $content.scrollTop : 0;
from.meta.scrollTop = scrollTop;
}
next()
}
}
</script>
<style lang="scss" scoped>
.content {
background: rgb(246, 246, 246);
}
.list_content {
padding: 14px 14px;
height: 100%;
overflow: auto;
.col {
width: 48%;
padding: 10px;
background: #fff;
margin-bottom: 10px;
.label {
display: flex;
justify-content: space-between;
font-size: 12px;
}
}
}
#video {
width: 100%;
height: 150px;
img {
display: block;
margin: 0;
padding: 0;
}
}
.uploadBtn {
transform: translateY(-16px) translatex(12px);
color: #fff;
}
.img_box {
position: relative;
.start_icon {
height: 150px;
position: absolute;
left: 0;
top: 0;
width: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}
}
.pop_content {
padding: 20px;
.item {
display: flex;
margin-bottom: 10px;
.label {
color: #127bff;
}
.value {
color: #444;
}
}
}
.loading_box {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
z-index: 10000;
background: rgba(0, 0, 0, 0.5);
color: #fff;
}
</style>
\ No newline at end of file
<template>
<div class="video_box">
<div class="top">
<van-icon
name="cross"
class="closeIcon"
@click="closeVideo"
/>
</div>
<div class="video">
<!-- <video
id="video"
controls
preload="auto"
loop="loop"
x5-video-player-fullscreen="true"
x5-video-orientation="portraint"
playsinline="true"
x5-video-player-type="h5"
style="object-fit:fill"
>
<source :src="src">
</video> -->
<video
ref="videoPlayer"
class="video-js"
id="videoplayer"
playsinline="true"
preload="none"
x5-video-player-type="h5"
x-webkit-airplay="true"
webkit-playsinline="true"
>
</video>
</div>
</div>
</template>
<script>
import videojs from 'video.js';
export default {
data () {
return {
player: null,
}
},
computed: {
src () {
return 'https://inno.sh-sict.com/gastric-api/gastric-cancer-data/file/show?videoName=' + this.$route.query.src
}
},
methods: {
// 实例化播放器
createVideo () {
let options = {
width: this.width,
autoplay: false,
controls: true,
sources: [
{
src: this.src,
type: "video/mp4",
},
{
src: this.src,
type: "video/ogg",
},
{
src: this.src,
type: "video/webm",
}
]
}
this.player = videojs('videoplayer', options, function onPlayerReady () {
console.log('onPlayerReady', this);
})
},
closeVideo () {
this.$router.go(-1)
}
},
mounted () {
videojs.addLanguage('zh-CN', {
"You aborted the media playback": "视频播放被终止",
"A network error caused the media download to fail part-way.": "网络错误导致视频下载中途失败。",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "视频因格式不支持或者服务器或网络的问题无法加载。请尝试使用uc浏览器或qq浏览器。",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。",
"No compatible source was found for this media.": "无法找到此视频兼容的源。",
});
this.$nextTick(() => {
setTimeout(() => {
this.createVideo()
})
})
this.$once('hook:beforeDestroy', () => {
this.player.dispose();
})
},
}
</script>
<style lang="scss" scoped>
.video_box {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
position: relative;
.top {
height: 40px;
background: #000;
text-align: right;
color: #fff;
font-size: 20px;
padding: 5px 10px 0 0;
}
.video {
flex: 1;
}
}
#videoplayer {
width: 100%;
height: 100%;
}
::v-deep .video-js .vjs-big-play-button {
font-size: 0.5rem;
width: 1.5rem;
height: 0.8rem;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
}
</style>
\ No newline at end of file
import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);
import Vue from "vue"
import Router from "vue-router"
Vue.use(Router)
//登录 注册 激活
const page = [
{
path: "/",
redirect: "/login" //调试
redirect: "/questionnaire" //调试
},
// {
// path: "/login",
// meta: { index: 1, keepAlive: false },
// name: "login",
// component: () => import("@/pages/login")
// },
{
path: "/login",
meta: { index: 1, keepAlive: false },
name: "login",
component: () => import("@/pages/login")
path: `/feedback/:dataId`,
meta: { index: 2, keepAlive: false },
name: "feedback",
component: () => import("@/pages/feedback")
},
{
path: "/peopleList",
meta: { index: 2, keepAlive: true, scrollTop: 0 },
name: "peopleList",
component: () => import("@/pages/peopleList")
},
{
path: "/videoList",
meta: { index: 3, keepAlive: true, scrollTop: 0 },
name: "videoList",
component: () => import("@/pages/videoList")
},
{
path: "/videoShow",
meta: { index: 3, keepAlive: false },
name: "videoShow",
component: () => import("@/pages/videoShow")
path: `/questionnaire`,
meta: { index: 2, keepAlive: false },
name: "questionnaire",
component: () => import("@/pages/questionnaire")
}
];
]
const router = new Router({
// scrollBehavior: () => ({
// y: 0
// }),
routes: [...page]
});
})
router.beforeEach((to, from, next) => {
if (from.meta.keepAlive) {
const $wrapper = document.querySelector(".list_content"); // 列表的外层容器 注意找到滚动的盒子
const scrollTop = $wrapper ? $wrapper.scrollTop : 0;
// console.log("scrollTop=", scrollTop);
from.meta.scrollTop = scrollTop;
}
next();
});
next()
})
// 解决编程式路由往同一地址跳转时会报错的情况
const originalPush = Router.prototype.push;
const originalReplace = Router.prototype.replace;
const originalPush = Router.prototype.push
const originalReplace = Router.prototype.replace
// push
Router.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject)
return originalPush.call(this, location, onResolve, onReject);
return originalPush.call(this, location).catch((err) => err);
};
return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch((err) => err)
}
//replace
Router.prototype.replace = function push(location, onResolve, onReject) {
if (onResolve || onReject)
return originalReplace.call(this, location, onResolve, onReject);
return originalReplace.call(this, location).catch((err) => err);
};
export default router;
return originalReplace.call(this, location, onResolve, onReject)
return originalReplace.call(this, location).catch((err) => err)
}
export default router
const path = require("path");
const path = require("path")
module.exports = {
publicPath: "",
......@@ -7,10 +7,10 @@ module.exports = {
configureWebpack: (config) => {
require("@vux/loader").merge(config, {
plugins: ["vux-ui"]
});
})
},
chainWebpack: (config) => {
config.resolve.alias.set("@", path.join(__dirname, "src"));
config.resolve.alias.set("@", path.join(__dirname, "src"))
// config.resolve.alias.set(
// "vue$",
// path.join(__dirname, "vue/dist/vue.esm.js")
......@@ -57,17 +57,22 @@ module.exports = {
}
},
devServer: {
disableHostCheck: true, //内网穿透
host: "0.0.0.0",
port: "8080",
open: true, // 自动拉起浏览器
hot: true, // 热加载
port: 8080,
https: false, // https:{type:Boolean}
open: true,
proxy: {
// change xxx-api/login => mock/login
// detail: https://cli.vuejs.org/config/#devserver-proxy
"/": {
target: "http://10.130.2.64:8201",
changeOrigin: true
"/api": {
// target: "https://ds.cixincloud.com/songjiang-api",
target: "http://192.168.0.200:11999/",
// target: 'http://localhost:8201/',
// target: 'http://192.168.3.221/8201/',
changeOrigin: true,
pathRewrite: {
"^/api": ""
}
}
}
}
};
}