Commit 15cb459e by 林家欣

联调常见问题列表

parent be95e227
......@@ -2,4 +2,5 @@ VUE_APP_CURRENTMODE = "development"
VUE_APP_HOST_URL = "http://81.68.189.225:9091"
VUE_APP_API_URL = "/"
VUE_APP_GDS_URL = "/gds"
VUE_APP_FAQ_URL = "http://member.gds.org.cn:8080/chinatm"
VUE_APP_LOG = true
\ No newline at end of file
......@@ -61,7 +61,7 @@ function fetch(options) {
const resData = res.data;
const code = String(resData.code)
// console.log(resData, ResponseCode.success, 'ResponseCode.success');
if (code === ResponseCode.success) {
if (ResponseCode.success.indexOf(code) !== -1) {
// console.log(resData, '响应数据的拦截2');
resolve(resData)
} else if (checkResponseCodeTokenError(code)) {
......
import {
GET,
POST
} from "../fetch.js"
const Prefix = process.env.NODE_ENV === 'development' ? '/gs1' : '';
const Prefix2 = process.env.NODE_ENV === 'development' ? '/chinatm' : '';
// 右侧表格下载功能
const businessDownLoad = (params = {}) => {
......@@ -25,9 +27,15 @@ const businessGetDetailById = (params = {}) => {
return POST(`${Prefix}/office/eanupc/api/getDetailById`, params)
}
// 常见问题
const businessGetFaqListByTypeName = (params = {}) => {
return GET(`${Prefix2}/tm/faq/third/getFaqListByTypeName`, params)
}
export default {
businessDownLoad,
businessGetTop4,
businessGetEanUpcByCondition,
businessGetDetailById,
businessGetFaqListByTypeName,
}
......@@ -38,7 +38,7 @@ export function cleanArray(actual) {
export const REQUEST_HEADER_TOKEN = "token"
export const ResponseCode = {
success: "0",
success: ['0', '200'],
tokenError: "0202",
tokenEmpty: "0203",
......@@ -68,8 +68,8 @@ export function handleResponseSuccess(res = {}) {
return {
success: true,
returnCode: res.code || ResponseCode.success,
returnMsg: res.msg,
data: res.data || res.page || null
returnMsg: res.msg || "请求成功",
data: res.data || res.page || res.member || null
}
}
......@@ -77,7 +77,7 @@ export function handleResponseError(res = {}) {
return {
success: false,
returnCode: res.code || ResponseCode.failed,
returnMsg: res.msg || "",
returnMsg: res.msg || "请求失败",
data: res.data || null
}
}
......@@ -95,7 +95,7 @@ export default {
return (
<div class={classNames.join(" ").trim()} style={items[0].style}>
{items.map((item) => {
console.log(item.isHiddenMenu, 'item.isHiddenMenu');
// console.log(item.isHiddenMenu, 'item.isHiddenMenu');
if (item.isHiddenMenu) return
return (
<div class="gs-dropdown-item">
......
......@@ -39,7 +39,11 @@
:aria-labelledby="tmp.type + '-tab'"
>
<faqTable :list="tmp.data" />
<pages />
<pages
:currPage="pageParams.currPage"
:total="pageParams.total"
@getLimit="receivePagesChild"
/>
</div>
</div>
</div>
......@@ -63,20 +67,22 @@ export default {
ico: "",
},
search: {
typeName: "",
keywords: "",
},
pageParams: {
currPage: 1,
pageSize: 10,
pageCount: 5,
total: 0,
},
list: [
{
type: "qbwt",
name: "全部问题",
link: "/Business/Guide8",
active: "qbwt",
data: [
{
name: "企业申请注册厂商识别代码是否必须到中国物品编码中心总部办理?",
type: "业务办理",
},
],
data: [],
},
{
type: "ywbl",
......@@ -95,72 +101,42 @@ export default {
name: "产品信息通报",
link: "/Business/Guide8",
active: "cpxxtb",
data: [
{
name: "企业申请注册厂商识别代码后,中国物品编码中心会发放哪些材料?",
type: "业务办理",
},
],
data: [],
},
{
type: "bmjs",
name: "编码技术",
link: "/Business/Guide8",
active: "bmjs",
data: [
{
name: "编码技术?",
type: "业务办理",
},
],
data: [],
},
{
type: "fgybz",
name: "法规与标准",
link: "/Business/Guide8",
active: "fgybz",
data: [
{
name: "法规与标准标题?",
type: "业务办理",
},
],
data: [],
},
{
type: "tmzl",
name: "条码质量",
link: "/Business/Guide8",
active: "tmzl",
data: [
{
name: "条码质量标题?",
type: "业务办理",
},
],
data: [],
},
{
type: "tmjsyy",
name: "条码技术应用",
link: "/Business/Guide8",
active: "tmjsyy",
data: [
{
name: "条码技术应用标题?",
type: "业务办理",
},
],
data: [],
},
{
type: "other",
name: "其他",
link: "/Business/Guide8",
active: "other",
data: [
{
name: "其他标题?",
type: "业务办理",
},
],
data: [],
},
],
};
......@@ -177,7 +153,46 @@ export default {
return id;
},
},
watch: {
$route: {
handler(val) {
this.init(val.query.id);
},
deep: true,
immediate: true,
},
},
methods: {
init(id) {
const current = this.list.filter((item) => item.active === id)[0];
this.search.typeName = current.name;
this.getFaqListByTypeName();
},
// 接收分页子组件传过来的值
receivePagesChild(val) {
this.pageParams.currentPage = val;
this.getFaqListByTypeName();
},
// 常见问题
async getFaqListByTypeName() {
const params = {
typeName: this.search.typeName,
pageNo: this.pageParams.currPage,
pageSize: this.pageParams.pageSize,
};
const businessGetFaqListByTypeNameRes =
await this.$api.business.businessGetFaqListByTypeName(params);
const { returnCode, data } = businessGetFaqListByTypeNameRes;
if (returnCode === 200) {
console.log(businessGetFaqListByTypeNameRes, "常见问题");
this.pageParams.total = data.totalRows;
this.list.forEach((el) => {
if (el.active === this.$route.query.id) {
el.data = data.rows;
}
});
}
},
jump(i) {
// console.log(i);
this.$router.push({
......
......@@ -38,7 +38,7 @@
:aria-labelledby="tmp.type + '-tab'"
>
<list :list="tmp.data" @toListFather="receiveListChild" />
<pages :pages="pageParams" @toPagesFather="receivePagesChild" />
<pages :currPage="pageParams.currPage" :total="pageParams.total" @getLimit="receivePagesChild"/>
</div>
</div>
</div>
......@@ -80,7 +80,7 @@ export default {
},
],
pageParams: {
currentPage: 1,
currPage: 1,
pageSize: 10,
pageCount: 5,
total: 100,
......@@ -111,7 +111,7 @@ export default {
// 条码注册/注销公告
async businessGetEanUpcByCondition() {
const params = {
page: this.pageParams.currentPage,
page: this.pageParams.currPage,
limit: this.pageParams.pageSize,
logoutFlag: this.logoutFlag,
};
......@@ -142,7 +142,7 @@ export default {
},
// 接收分页子组件传过来的值
receivePagesChild(val) {
this.pageParams.currentPage = val;
this.pageParams.currPage = val;
this.businessGetEanUpcByCondition();
},
// 接收列表子组件传过来的值
......
......@@ -5,18 +5,18 @@
<div class="col-lg-8">标题</div>
<div class="col-lg-2">类型</div>
</div>
<div class="fqtbody ">
<div class="fqtbody" v-if="list.length > 0">
<div class="row" v-for="(tmp, i) in list" :key="i">
<div class="col-lg-2">{{i+1}}</div>
<div class="col-lg-8">{{tmp.name}}</div>
<div class="col-lg-2">{{tmp.type}}</div>
<div class="col-lg-2">{{ tmp.types && tmp.types.name}}</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: ['list']
props: ['list'],
}
</script>
<style lang="scss" scoped>
......
......@@ -70,6 +70,14 @@ module.exports = {
pathRewrite: {
"^/gds": "/"
}
},
"/chinatm": {
target: 'http://member.gds.org.cn:8080/chinatm', // 原地址
changeOrigin: true,
ws: true,
pathRewrite: {
"^/chinatm": "/"
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment