Skip to content

Commit 4cecf86

Browse files
feat: template center
1 parent c362b4e commit 4cecf86

File tree

15 files changed

+169
-113
lines changed

15 files changed

+169
-113
lines changed

ui/src/components/app-icon/icons/knowledge.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,25 @@ export default {
208208
])
209209
},
210210
},
211+
'app-template-center': {
212+
iconReader: () => {
213+
return h('i', [
214+
h(
215+
'svg',
216+
{
217+
style: { height: '100%', width: '100%' },
218+
viewBox: '0 0 1024 1024',
219+
version: '1.1',
220+
xmlns: 'http://www.w3.org/2000/svg',
221+
},
222+
[
223+
h('path', {
224+
d: 'M213.333333 128h469.333334v107.52a21.333333 21.333333 0 0 0 21.333333 21.333333H810.666667V896H213.333333V128z m515.626667-85.333333H170.666667a42.666667 42.666667 0 0 0-42.666667 42.666666v853.333334a42.666667 42.666667 0 0 0 42.666667 42.666666h682.666666a42.666667 42.666667 0 0 0 42.666667-42.666666V209.749333a42.666667 42.666667 0 0 0-12.501333-30.208l-124.330667-124.373333A42.666667 42.666667 0 0 0 729.002667 42.666667zM320 341.333333a21.333333 21.333333 0 0 0-21.333333 21.333334v42.666666a21.333333 21.333333 0 0 0 21.333333 21.333334h384a21.333333 21.333333 0 0 0 21.333333-21.333334v-42.666666a21.333333 21.333333 0 0 0-21.333333-21.333334h-384z m149.333333 192a21.333333 21.333333 0 0 1 21.333334-21.333333h213.333333a21.333333 21.333333 0 0 1 21.333333 21.333333v213.333334a21.333333 21.333333 0 0 1-21.333333 21.333333h-213.333333a21.333333 21.333333 0 0 1-21.333334-21.333333v-213.333334zM320 512a21.333333 21.333333 0 0 0-21.333333 21.333333v213.333334a21.333333 21.333333 0 0 0 21.333333 21.333333h42.666667a21.333333 21.333333 0 0 0 21.333333-21.333333v-213.333334a21.333333 21.333333 0 0 0-21.333333-21.333333h-42.666667z',
225+
fill: 'currentColor',
226+
}),
227+
],
228+
),
229+
])
230+
},
231+
},
211232
}

ui/src/components/app-icon/index.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,48 @@ export const iconMap: any = {
251251
])
252252
},
253253
},
254+
'app-download': {
255+
iconReader: () => {
256+
return h('i', [
257+
h(
258+
'svg',
259+
{
260+
style: { height: '100%', width: '100%' },
261+
viewBox: '0 0 16 16',
262+
version: '1.1',
263+
xmlns: 'http://www.w3.org/2000/svg',
264+
},
265+
[
266+
h('path', {
267+
d: 'M14 12.3333V14C14 14.3681 13.7015 14.6666 13.3333 14.6666H2.66667C2.29848 14.6666 2 14.3681 2 14V12.3333C2 12.1492 2.14924 12 2.33333 12H3C3.18409 12 3.33333 12.1492 3.33333 12.3333V13.3333H12.6667V12.3333C12.6667 12.1492 12.8159 12 13 12H13.6667C13.8508 12 14 12.1492 14 12.3333ZM8.66667 9.3571L10.6736 7.35013C10.8038 7.21995 11.0149 7.21995 11.1451 7.35013L11.6165 7.82153C11.7466 7.9517 11.7466 8.16276 11.6165 8.29293L8.31663 11.5928C8.25154 11.6579 8.16623 11.6904 8.08092 11.6904C7.99562 11.6904 7.91031 11.6579 7.84522 11.5928L4.54539 8.29293C4.41521 8.16276 4.41521 7.9517 4.54539 7.82153L5.01679 7.35013C5.14697 7.21995 5.35802 7.21995 5.4882 7.35013L7.33334 9.19526V1.99996C7.33334 1.81586 7.48257 1.66663 7.66667 1.66663H8.33334C8.51743 1.66663 8.66667 1.81586 8.66667 1.99996V9.3571Z',
268+
fill: 'currentColor',
269+
}),
270+
],
271+
),
272+
])
273+
},
274+
},
275+
'app-upload': {
276+
iconReader: () => {
277+
return h('i', [
278+
h(
279+
'svg',
280+
{
281+
style: { height: '100%', width: '100%' },
282+
viewBox: '0 0 1024 1024',
283+
version: '1.1',
284+
xmlns: 'http://www.w3.org/2000/svg',
285+
},
286+
[
287+
h('path', {
288+
d: 'M896 789.333333V896a42.666667 42.666667 0 0 1-42.666667 42.666667H170.666667a42.666667 42.666667 0 0 1-42.666667-42.666667v-106.666667a21.333333 21.333333 0 0 1 21.333333-21.333333h42.666667a21.333333 21.333333 0 0 1 21.333333 21.333333V853.333333h597.333334v-64a21.333333 21.333333 0 0 1 21.333333-21.333333h42.666667a21.333333 21.333333 0 0 1 21.333333 21.333333z m-341.333333-512l128.426666 128.426667a21.333333 21.333333 0 0 0 30.208 0l30.165334-30.165333a21.333333 21.333333 0 0 0 0-30.165334l-211.2-211.2a21.248 21.248 0 0 0-30.165334 0l-211.2 211.2a21.333333 21.333333 0 0 0 0 30.165334l30.165334 30.165333a21.333333 21.333333 0 0 0 30.165333 0L469.333333 287.701333v460.501334a21.333333 21.333333 0 0 0 21.333334 21.333333h42.666666a21.333333 21.333333 0 0 0 21.333334-21.333333V277.333333z',
289+
fill: 'currentColor',
290+
}),
291+
],
292+
),
293+
])
294+
},
295+
},
254296
'app-404': {
255297
iconReader: () => {
256298
return h('i', [

ui/src/locales/lang/en-US/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,5 @@ export default {
141141
prev: 'Previous',
142142
next: 'Next',
143143
},
144+
use: 'Use',
144145
}

ui/src/locales/lang/en-US/workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default {
2525
debug: 'Run',
2626
exit: 'Exit',
2727
exitSave: 'Save & Exit',
28+
templateCenter: 'Template Center',
2829
},
2930
tip: {
3031
noData: 'No related results found',

ui/src/locales/lang/zh-CN/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,5 @@ export default {
141141
prev: '上一步',
142142
next: '下一步',
143143
},
144+
use: '使用',
144145
}

ui/src/locales/lang/zh-CN/workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default {
2424
copyParam: '复制参数',
2525
exit: '直接退出',
2626
exitSave: '保存并退出',
27+
templateCenter: '模板中心',
2728
},
2829
tip: {
2930
noData: '没有找到相关结果',

ui/src/locales/lang/zh-Hant/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,5 @@ export default {
140140
prev: '上一步',
141141
next: '下一步',
142142
},
143+
use: '使用',
143144
}

ui/src/locales/lang/zh-Hant/workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default {
2424
copyParam: '複製參數',
2525
exit: '直接退出',
2626
exitSave: '保存並退出',
27+
templateCenter: '模板中心',
2728
},
2829
tip: {
2930
noData: '沒有找到相關結果',

ui/src/views/document/index.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,7 @@
524524
@click.stop="downloadDocument(row)"
525525
v-if="permissionPrecise.doc_download(id)"
526526
>
527-
<el-icon class="color-secondary">
528-
<Download />
529-
</el-icon>
527+
<AppIcon iconName="app-download" class="color-secondary" />
530528
{{ $t('views.document.setting.download') }}
531529
</el-dropdown-item>
532530
<el-upload
@@ -539,9 +537,7 @@
539537
:on-change="(file: any, fileList: any) => replaceDocument(file, row)"
540538
>
541539
<el-dropdown-item>
542-
<el-icon class="color-secondary">
543-
<Upload />
544-
</el-icon>
540+
<AppIcon iconName="app-upload" class="color-secondary" />
545541
{{ $t('views.document.setting.replace') }}
546542
</el-dropdown-item>
547543
</el-upload>

ui/src/views/knowledge-workflow/index.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
v-if="permissionPrecise.create()"
3232
@click="openTemplateStoreDialog()"
3333
>
34-
{{ $t('模版中心') }}
34+
<AppIcon iconName="app-template-center" class="mr-4" />
35+
{{ $t('workflow.setting.templateCenter') }}
3536
</el-button>
3637
<el-button @click="showPopover = !showPopover">
3738
<AppIcon iconName="app-add-outlined" class="mr-4" />
@@ -169,7 +170,12 @@
169170
v-click-outside="clickoutsideHistory"
170171
@refreshVersion="refreshVersion"
171172
/>
172-
<TemplateStoreDialog ref="templateStoreDialogRef" :api-type="apiType" source="work_flow" @refresh="getDetail"/>
173+
<TemplateStoreDialog
174+
ref="templateStoreDialogRef"
175+
:api-type="apiType"
176+
source="work_flow"
177+
@refresh="getDetail"
178+
/>
173179
</div>
174180
</template>
175181
<script setup lang="ts">
@@ -183,7 +189,6 @@ import PublishHistory from '@/views/knowledge-workflow/component/PublishHistory.
183189
import { isAppIcon, resetUrl } from '@/utils/common'
184190
import { MsgSuccess, MsgError, MsgConfirm } from '@/utils/message'
185191
import { datetimeFormat } from '@/utils/time'
186-
import { mapToUrlParams } from '@/utils/application'
187192
import useStore from '@/stores'
188193
import { KnowledgeWorkFlowInstance } from '@/workflow/common/validate'
189194
import { hasPermission } from '@/utils/permission'
@@ -195,7 +200,7 @@ import permissionMap from '@/permission'
195200
import { WorkflowMode } from '@/enums/application'
196201
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
197202
import { knowledgeBaseNode } from '@/workflow/common/data'
198-
import TemplateStoreDialog from "@/views/knowledge/template-store/TemplateStoreDialog.vue";
203+
import TemplateStoreDialog from '@/views/knowledge/template-store/TemplateStoreDialog.vue'
199204
provide('getResourceDetail', () => detail)
200205
provide('workflowMode', WorkflowMode.Knowledge)
201206
provide('loopWorkflowMode', WorkflowMode.KnowledgeLoop)
@@ -664,7 +669,6 @@ function openTemplateStoreDialog() {
664669
templateStoreDialogRef.value?.open(folderId)
665670
}
666671
667-
668672
/**
669673
* 定时保存
670674
*/

0 commit comments

Comments
 (0)