vue2-client 1.20.21 → 1.20.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,36 @@
1
+ import { describe, it, expect } from '@jest/globals'
2
+ import { parseMarkdownConfig } from '@vue2-client/base-client/components/his/XList/markdownConfig'
3
+
4
+ describe('parseMarkdownConfig', () => {
5
+ it('parseMarkdownConfig parses fenced json block correctly', () => {
6
+ const md = `
7
+ 标题说明
8
+
9
+ \`\`\`json
10
+ {
11
+ "listMode": "card",
12
+ "data": [1, 2, 3]
13
+ }
14
+ \`\`\`
15
+ `
16
+ const cfg = parseMarkdownConfig(md)
17
+ expect(cfg).toBeTruthy()
18
+ expect(cfg.listMode).toBe('card')
19
+ expect(cfg.data).toEqual([1, 2, 3])
20
+ })
21
+
22
+ it('parseMarkdownConfig parses pure json text when no fenced block', () => {
23
+ const md = '{"listMode":"card","data":[{"a":1}]}'
24
+ const cfg = parseMarkdownConfig(md)
25
+ expect(cfg.listMode).toBe('card')
26
+ expect(cfg.data).toEqual([{ a: 1 }])
27
+ })
28
+
29
+ it('parseMarkdownConfig throws friendly error when json invalid', () => {
30
+ const md = '```json { invalid json } ```'
31
+ expect(() => parseMarkdownConfig(md)).toThrow(
32
+ 'JSON 解析失败,请检查 Markdown 文档中的 JSON 格式是否正确'
33
+ )
34
+ })
35
+ })
36
+
package/vue.config.js CHANGED
@@ -147,11 +147,24 @@ module.exports = {
147
147
  },
148
148
  configureWebpack: config => {
149
149
  config.devtool = 'inline-source-map'
150
- // 忽略.md文件
150
+ // .md 文件:默认忽略(避免把大量 docs 打进包),但允许特定目录以 raw string 方式引入
151
151
  config.module.rules.push({
152
152
  test: /\.md$/,
153
153
  exclude: /node_modules/,
154
- use: 'ignore-loader'
154
+ oneOf: [
155
+ // XMarkdownViewer demo 需要从本地 .md 读取内容做展示
156
+ {
157
+ include: [
158
+ path.resolve(__dirname, './src/base-client/components/common/XMarkdownViewer'),
159
+ // XMarkdownSectionExtractor demo 同样需要从本地 .md 读取内容做抽取演示
160
+ path.resolve(__dirname, './src/base-client/components/common/XMarkdownSectionExtractor')
161
+ ],
162
+ use: 'raw-loader'
163
+ },
164
+ {
165
+ use: 'ignore-loader'
166
+ }
167
+ ]
155
168
  })
156
169
  config.context = path.resolve(__dirname, './')
157
170
  config.resolve = {
@@ -1,127 +0,0 @@
1
- <template>
2
- <a-card :bordered="false">
3
- <a-tabs default-active-key="1" @change="changeTab">
4
- <a-tab-pane key="1" tab="待办">
5
- <x-form-table
6
- title="站点工单(待办)"
7
- ref="xFormTable"
8
- queryParamsName="teleProcessCRUD"
9
- :fixed-query-form="{
10
- wo_f_department_id: currUser.depids,
11
- }"
12
- serviceName="af-telephone"
13
- @toDeal="toDetail"
14
- @updateInfo="updateInfo"
15
- @transfer="transfer"
16
- @toFinish="toFinish"
17
- >
18
- </x-form-table>
19
- </a-tab-pane>
20
- <a-tab-pane key="2" tab="已办">
21
- <x-form-table
22
- title="站点工单(已办)"
23
- ref="xFormTableDone"
24
- queryParamsName="teleProcessDoneCRUD"
25
- :fixed-query-form="{
26
- wo_f_department_id: currUser.depids,
27
- }"
28
- serviceName="af-telephone"
29
- @action="toView"
30
- @reminder="toReminder"
31
- >
32
- </x-form-table>
33
- </a-tab-pane>
34
- </a-tabs>
35
- <WorkflowDetail
36
- ref="workFlow"
37
- @preClick="preClick"
38
- @success="success"
39
- @nextClick="nextClick"
40
- @x-form-item-emit-func="handleFormItemEvent"
41
- >
42
- </WorkflowDetail>
43
- </a-card>
44
- </template>
45
-
46
- <script>
47
- import WorkflowDetail from '@vue2-client/pages/WorkflowDetail/WorkflowDetail.vue'
48
- import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
49
- import { mapState } from 'vuex'
50
- import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
51
-
52
- export default {
53
- name: 'Telephone',
54
- components: {
55
- XFormTable,
56
- WorkflowDetail,
57
- XAddNativeForm
58
- },
59
- // 透传给子组件的方法(目前XFormTable接了)
60
- provide () {
61
- return {
62
- generalFunction: {}
63
- }
64
- },
65
- data () {
66
- return {
67
- // 当前工单id
68
- currentWorkOrderId: '',
69
- // 提交加载动画
70
- confirmLoading: false,
71
- chargeVisible: false,
72
- // 环节人员信息
73
- chargePerson: {},
74
- chargePersonOptions: [],
75
- transferData: {
76
- optionsValue: '',
77
- remark: ''
78
- },
79
- record: {},
80
- define: {},
81
- // 是否展示催单结案弹窗
82
- showReminder: false,
83
- // 弹窗类型 催单/ 结案
84
- modelType: ''
85
- }
86
- },
87
- computed: {
88
- ...mapState('account', { currUser: 'user' }),
89
- },
90
- methods: {
91
- changeTab (key) {
92
- console.log('切换tab', key)
93
- if (key === '1') {
94
- this.$refs.xFormTable.refreshTable(true)
95
- } else if (key === '2') {
96
- this.$refs.xFormTableDone.refreshTable(true)
97
- }
98
- },
99
- success () {
100
- console.log('完工')
101
- },
102
- toDetail (record) {
103
- // 修改第一步的工单
104
- if (record.ws_f_step_id === 1 && record.w_f_state === 0) {
105
- console.log('进入工单详情')
106
- if (record.w_f_workflow_define_name === '报修单处理流程') {
107
- this.$refs.dealOrUpdate.dealOrUpdate(record, '处理工单')
108
- } else if (record.w_f_workflow_define_name === '投诉单处理流程') {
109
- this.$refs.dealComplaint.dealComplaintOrder(record)
110
- } else if (record.w_f_workflow_define_name === '咨询单处理流程') {
111
- this.$refs.dealConsultation.dealConsultationOrder(record)
112
- } else {
113
- this.$message.warn('未知流程类型')
114
- }
115
- } else {
116
- // 记录流程节点名称
117
- this.currentWorkOrderId = record.wo_id
118
- // 进入流程详情
119
- this.$refs.workFlow.init({
120
- workflowId: record.wo_f_workflow_id,
121
- stepId: record.ws_f_step_id
122
- })
123
- }
124
- },
125
- }
126
- }
127
- </script>