Browse Source

feat: 工单管理添加待客户确认操作按钮

master
AaronWu 2 weeks ago
parent
commit
36c207a6ae
  1. 4
      .env.development
  2. 2
      src/api/issue/model.d.ts
  3. 1
      src/assets/icons/customer.svg
  4. 2
      src/utils/request.ts
  5. 14
      src/views/client/knowledgeBase/index.vue
  6. 37
      src/views/question/issue/columns.tsx
  7. 11
      src/views/question/issue/data.ts
  8. 52
      src/views/question/issue/formSchemas.tsx
  9. 20
      src/views/question/issue/index.vue
  10. 7
      src/views/system/dictionary/columns.tsx

4
.env.development

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

2
src/api/issue/model.d.ts

@ -27,6 +27,7 @@ declare namespace API {
tags?: string[] | string; // 标签
solution?: string; // 解决方案
zentaoNos?: string; // 关联的禅道工单号
resolutionTime?: string; // 解决时间
};
type CreateIssueParams = {
@ -53,6 +54,7 @@ declare namespace API {
tags?: string[] | string; // 标签
solution?: string; // 解决方案
zentaoNos?: string; // 关联的禅道工单号
resolutionTime?: string; // 解决时间
};
type DeleteIssueParams = {

1
src/assets/icons/customer.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1747964622939" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2617" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.695238 680.984381l51.321905 52.126476-198.948572 195.949714-120.58819-118.979047 51.370667-52.077714 69.241904 68.36419 147.602286-145.383619zM667.062857 610.255238l90.989714 106.154667L718.677333 755.809524l-73.142857-73.142857-121.904762 121.904762 121.904762 121.904761H219.428571a73.142857 73.142857 0 0 1-55.539809-120.734476l167.545905-195.486476A315.489524 315.489524 0 0 0 499.248762 658.285714a315.489524 315.489524 0 0 0 167.838476-48.030476zM499.248762 97.52381c134.656 0 243.809524 109.153524 243.809524 243.809523s-109.153524 243.809524-243.809524 243.809524-243.809524-109.153524-243.809524-243.809524 109.153524-243.809524 243.809524-243.809523z" p-id="2618" fill="#3b82f6"></path></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

2
src/utils/request.ts

@ -29,7 +29,7 @@ const baseMockUrl = import.meta.env.VITE_MOCK_API;
const service = axios.create({
baseURL: baseApiUrl,
timeout: 6000,
timeout: 10000,
});
service.interceptors.request.use(

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

@ -178,6 +178,20 @@
watch(selectedKeys, async (newVal) => {
console.log('newVal: ', newVal);
if (!newVal.length) return;
loading.value = true;
try {
const res = await findOneById({ id: selectedKeys.value[0] });
curRowDetail.value = res;
const count = await addReadCount({ id: selectedKeys.value[0] });
console.log('count: ', count);
if (count) {
curRowDetail.value.readCount = count;
}
} catch (error) {
console.error(error);
} finally {
loading.value = false;
}
});
//

37
src/views/question/issue/columns.tsx

@ -94,14 +94,15 @@ export const baseColumns: TableColumnItem[] = [
const { zentaoNos } = record;
// 自定义渲染成a标签,点击跳转到指定链接
return (
zentaoNos && // 如果zentaoNos存在才渲染
<a
href={`http://43.137.2.78:8084/zentao/bug-view-${zentaoNos}.html`}
target="_blank"
rel="noopener noreferrer"
>
{zentaoNos}
</a>
zentaoNos && ( // 如果zentaoNos存在才渲染
<a
href={`http://43.137.2.78:8084/zentao/bug-view-${zentaoNos}.html`}
target="_blank"
rel="noopener noreferrer"
>
{zentaoNos}
</a>
)
);
},
},
@ -168,7 +169,25 @@ export const baseColumns: TableColumnItem[] = [
required: false,
},
},
//resolutionTime
{
title: '计划解决时间',
align: 'center',
dataIndex: 'resolutionTime',
width: 200,
hideInSearch: true,
formItemProps: {
defaultValue: '',
required: false,
component: 'RangePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
},
colProps: {
span: 6,
},
},
},
{
title: '创建时间',
align: 'center',

11
src/views/question/issue/data.ts

@ -24,15 +24,20 @@ export const stateTypeList: any = [
value: 3,
color: '#108ee9',
},
// 待客户确认
{
label: '已解决',
label: '待客户确认',
value: 4,
color: '#2db7f5',
},
{
label: '已解决',
value: 5,
color: '#87d068',
},
{
label: '关闭',
value: 5,
// 灰色
value: 6,
color: '#d9d9d9',
},
];

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

@ -41,6 +41,7 @@ export const getEditFormSchema: (
colProps: {
span: 8,
},
vIf: () => !isClient && isDetail,
rules: [{ required: true, type: 'string' }],
},
{
@ -272,7 +273,38 @@ export const getEditFormSchema: (
console.log('file: ', file);
// 限制允许上传的文件类型
const allowedTypes = ['xlsx', 'xls', 'doc', 'docx', 'pdf', 'jpg', 'jpeg', 'png'];
// 添加视频和压缩包
const allowedTypes = [
// 文档
'xlsx',
'xls',
'doc',
'docx',
// 图片
'pdf',
'jpg',
'jpeg',
'png',
// 视频
'mp4',
'avi',
'mov',
'wmv',
'mkv',
'flv',
'webm',
// 压缩包
'zip',
'rar',
'7z',
'tar',
'gz',
'bz2',
'tgz',
'tbz2',
// 其他
'htm',
];
// 检查文件类型
const fileType = getFileExtension(file.name) || 'unknown';
@ -314,7 +346,10 @@ export const getEditFormSchema: (
] as any;
};
export const getFlowFormSchema: (row?: Partial<TableListItem>) => FormSchema[] = (record = {}) => {
export const getFlowFormSchema: (row?: Partial<TableListItem>, state?: any) => FormSchema[] = (
record = {},
state,
) => {
return [
{
field: 'zentaoNos',
@ -326,6 +361,19 @@ export const getFlowFormSchema: (row?: Partial<TableListItem>) => FormSchema[] =
vIf: () => record.state === 0,
// rules: [{ required: true, type: 'string' }],
},
{
label: '问题属性',
field: 'arrtibute',
component: 'Select',
componentProps: {
options: questionTypeList,
},
colProps: {
span: 24,
},
vIf: () => state === 5,
rules: [{ required: true, type: 'string' }],
},
{
field: 'remark',
component: 'InputTextArea',

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

@ -344,15 +344,27 @@
changeState(record, 3);
},
},
// 4
{
icon: 'customer',
size: '17',
title: '待客户确认',
label: '待客户确认',
ifShow: stateText === '测试中',
onClick: (e) => {
e.stopPropagation();
changeState(record, 4);
},
},
{
icon: 'end',
size: '15',
title: '结束',
label: '结束',
ifShow: stateText === '测试中',
ifShow: stateText === '待客户确认',
onClick: (e) => {
e.stopPropagation();
changeState(record, 4);
changeState(record, 5);
},
},
{
@ -374,7 +386,7 @@
ifShow: stateText !== '关闭',
onClick: (e) => {
e.stopPropagation();
changeState(record, 5);
changeState(record, 6);
},
},
{
@ -496,7 +508,7 @@
},
formProps: {
labelWidth: 100,
schemas: getFlowFormSchema(record) as any,
schemas: getFlowFormSchema(record, state) as any,
autoSubmitOnEnter: true,
},
});

7
src/views/system/dictionary/columns.tsx

@ -39,9 +39,13 @@ export const baseColumns: TableColumnItem[] = [
resizable: true,
formItemProps: {
component: 'Select',
defaultValue: 1,
defaultValue: '',
componentProps: {
options: [
{
label: '全部',
value: '',
},
{
label: '启用',
value: 1,
@ -54,6 +58,7 @@ export const baseColumns: TableColumnItem[] = [
},
},
customRender: ({ record }) => {
delete record.pendingStatus;
const onChange = (checked: boolean) => {
console.log('checked: ', checked);
record.pendingStatus = true;

Loading…
Cancel
Save