Browse Source

fix: bug fix commit

master
AaronWu 1 month ago
parent
commit
5a38d92edf
  1. 4
      .env.development
  2. 1
      src/locales/lang/en-US/routes/question.ts
  3. 1
      src/locales/lang/zh-CN/routes/question.ts
  4. 11
      src/router/staticModules/question.ts
  5. 11
      src/views/client/knowledgeBase/index.vue
  6. 85
      src/views/question/issue/formSchemas.tsx
  7. 6
      src/views/question/issue/index.vue
  8. 43
      src/views/question/knowledge/detail.vue
  9. 2
      src/views/question/knowledge/index.vue

4
.env.development

@ -9,8 +9,8 @@
# 只在开发模式中被载入 # 只在开发模式中被载入
# 网站前缀 # 网站前缀
VITE_BASE_API_URL = http://192.168.2.217:8089/server/
# VITE_BASE_API_URL = http://43.137.2.78:8085/server/
# VITE_BASE_API_URL = http://192.168.2.217:8089/server/
VITE_BASE_API_URL = http://43.137.2.78:8085/server/
# base api # base api
VITE_BASE_API = '/server/' VITE_BASE_API = '/server/'

1
src/locales/lang/en-US/routes/question.ts

@ -11,4 +11,5 @@ export default {
issue: 'Issue', issue: 'Issue',
issueDetail: 'Issue Detail', issueDetail: 'Issue Detail',
knowledge: 'Knowledge Base', knowledge: 'Knowledge Base',
knowledgeDetail: 'Knowledge Base Detail',
}; };

1
src/locales/lang/zh-CN/routes/question.ts

@ -11,4 +11,5 @@ export default {
issue: '工单管理', issue: '工单管理',
issueDetail: '工单详情', issueDetail: '工单详情',
knowledge: '知识库', knowledge: '知识库',
knowledgeDetail: '知识库详情',
}; };

11
src/router/staticModules/question.ts

@ -48,6 +48,17 @@ const routes: Array<RouteRecordRaw> = [
component: () => component: () =>
import(/* webpackChunkName: "question-knowledge" */ '@/views/question/knowledge/index.vue'), import(/* webpackChunkName: "question-knowledge" */ '@/views/question/knowledge/index.vue'),
}, },
{
path: 'knowledgeDetail',
name: `${moduleName}-knowledgeDetail`,
meta: {
title: t('routes.question.knowledgeDetail'),
icon: 'icon-icon_shiyongwendang',
hideInMenu: true,
},
component: () =>
import(/* webpackChunkName: "question-knowledge" */ '@/views/question/knowledge/detail.vue'),
},
], ],
}, },
]; ];

11
src/views/client/knowledgeBase/index.vue

@ -41,9 +41,9 @@
<div class="header-main"> <div class="header-main">
<h1 class="title">{{ curRowDetail.title }}</h1> <h1 class="title">{{ curRowDetail.title }}</h1>
<div class="meta-info"> <div class="meta-info">
<span class="date">更新时间2024-01-09</span>
<span class="date">更新时间{{ curRowDetail.createTime }}</span>
<span class="divider">|</span> <span class="divider">|</span>
<span class="views">阅读123</span>
<span class="views" v-if="isAdmin === 1">阅读123</span>
</div> </div>
</div> </div>
<div class="tags"> <div class="tags">
@ -85,6 +85,11 @@
} from '@ant-design/icons-vue'; } from '@ant-design/icons-vue';
import { fetchKnowledgeBaseList, findOneById } from '@/api/knowledgeBase'; import { fetchKnowledgeBaseList, findOneById } from '@/api/knowledgeBase';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const isAdmin = userStore.userInfo.isAdmin;
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
@ -99,10 +104,12 @@
title: string; title: string;
tags: string; tags: string;
solution: string; solution: string;
createTime: string;
}>({ }>({
title: '', title: '',
tags: '', tags: '',
solution: '', solution: '',
createTime: '',
}); });
const goBack = () => { const goBack = () => {

85
src/views/question/issue/formSchemas.tsx

@ -62,6 +62,47 @@ export const getEditFormSchema: (
}, },
rules: [{ required: true, type: 'array' }], rules: [{ required: true, type: 'array' }],
}, },
{
field: 'contacts',
component: 'Input',
label: '联系人',
colProps: {
span: 8,
},
rules: [{ required: true, type: 'string' }],
},
{
field: 'contactsMobile',
component: 'Input',
label: '手机号',
colProps: {
span: 8,
},
rules: [
{
required: true,
message: '请输入正确格式的电话号码',
pattern:
/^(1(3[0-9]|4[01456879]|5[0-3,5-9]|6[2567]|7[0-8]|8[0-9]|9[0-3,5-9])\d{8})$|^0\d{2,3}-?\d{7,8}$/,
},
],
},
{
field: 'contactsEmail',
component: 'Input',
label: '邮箱',
colProps: {
span: 8,
},
rules: [
{
required: true,
message: '请输入正确格式的邮箱',
pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
},
],
},
{ {
field: 'customer', field: 'customer',
@ -138,47 +179,6 @@ export const getEditFormSchema: (
}, },
}, },
{
field: 'contacts',
component: 'Input',
label: '联系人',
colProps: {
span: 8,
},
rules: [{ required: true, type: 'string' }],
},
{
field: 'contactsEmail',
component: 'Input',
label: '邮箱',
colProps: {
span: 8,
},
rules: [
{
required: true,
message: '请输入正确格式的邮箱',
pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
},
],
},
{
field: 'contactsMobile',
component: 'Input',
label: '手机号',
colProps: {
span: 8,
},
rules: [
{
required: true,
message: '请输入正确格式的电话号码',
pattern:
/^(1(3[0-9]|4[01456879]|5[0-3,5-9]|6[2567]|7[0-8]|8[0-9]|9[0-3,5-9])\d{8})$|^0\d{2,3}-?\d{7,8}$/,
},
],
},
{ {
field: 'agent', field: 'agent',
component: 'Input', component: 'Input',
@ -195,7 +195,6 @@ export const getEditFormSchema: (
colProps: { colProps: {
span: 6, span: 6,
}, },
}, },
{ {
field: 'zentaoNos', field: 'zentaoNos',
@ -244,7 +243,7 @@ export const getEditFormSchema: (
rows: 4, rows: 4,
placeholder: '请输入问题描述', placeholder: '请输入问题描述',
showCount: true, showCount: true,
maxlength: 150,
maxlength: 200,
}, },
label: '问题描述', label: '问题描述',
colProps: { colProps: {

6
src/views/question/issue/index.vue

@ -57,6 +57,7 @@
:mask-closable="false" :mask-closable="false"
:destroyOnClose="true" :destroyOnClose="true"
:getContainer="() => issueContainerRef" :getContainer="() => issueContainerRef"
:forceRender="true"
> >
<SchemaForm> <SchemaForm>
<template #solution="{ formModel, field }"> <template #solution="{ formModel, field }">
@ -531,6 +532,8 @@
// quillEditor.value?.setContents(res?.solution); // quillEditor.value?.setContents(res?.solution);
// formRef?.setFieldsValue(res); // formRef?.setFieldsValue(res);
nextTick(() => {
openModal(async () => {
if (res?.productId) { if (res?.productId) {
const { data } = await fetchVersionPageList({ const { data } = await fetchVersionPageList({
productId: res?.productId, productId: res?.productId,
@ -551,9 +554,6 @@
}); });
} }
} }
nextTick(() => {
openModal(() => {
formRef?.setFieldsValue(res); formRef?.setFieldsValue(res);
quillEditor.value?.setContents(res?.solution); quillEditor.value?.setContents(res?.solution);
}); });

43
src/views/question/knowledge/detail.vue

@ -11,37 +11,6 @@
<template> <template>
<div class="bg-[#fff] p-5"> <div class="bg-[#fff] p-5">
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<div class="my-3">
<a-steps :current="current" size="small">
<a-step title="初始化">
<template #icon>
<SvgIcon :size="22" name="init" />
</template>
</a-step>
<a-step title="退回">
<template #icon>
<SvgIcon :size="24" name="back" />
</template>
</a-step>
<a-step title="开发">
<template #icon>
<SvgIcon :size="24" name="dev" />
</template>
</a-step>
<a-step title="测试">
<template #icon>
<SvgIcon :size="24" name="test" />
</template>
</a-step>
<a-step title="结束">
<template #icon>
<SvgIcon :size="24" name="end" />
</template>
</a-step>
</a-steps>
</div>
<a-tabs default-active-key="1"> <a-tabs default-active-key="1">
<a-tab-pane key="1" tab="基础信息"> <a-tab-pane key="1" tab="基础信息">
<SchemaForm> <SchemaForm>
@ -58,16 +27,6 @@
</template> </template>
</SchemaForm> </SchemaForm>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="处理历史">
<a-steps progress-dot :current="historyList.length - 1" direction="vertical">
<a-step
v-for="(item, index) in historyList"
:key="index"
:title="item.title"
:description="item.remark"
/>
</a-steps>
</a-tab-pane>
</a-tabs> </a-tabs>
</a-spin> </a-spin>
</div> </div>
@ -80,7 +39,7 @@
import { getEditFormSchema } from './formSchemas'; import { getEditFormSchema } from './formSchemas';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import { findOneById } from '@/api/issue';
import { findOneById } from '@/api/knowledgeBase';
import { SvgIcon } from '@/components/basic/svg-icon'; import { SvgIcon } from '@/components/basic/svg-icon';
import { stateTypeList } from './data'; import { stateTypeList } from './data';
const route = useRoute(); const route = useRoute();

2
src/views/question/knowledge/index.vue

@ -333,7 +333,7 @@
const handleView = (record: TableListItem) => { const handleView = (record: TableListItem) => {
router.push({ router.push({
path: '/question/issueDetail',
path: '/question/knowledgeDetail',
query: { query: {
id: record.id, id: record.id,
}, },

Loading…
Cancel
Save