ソースを参照

流程功能 国际化

kagg886 1 ヶ月 前
コミット
ca4830d139

+ 10 - 3
src/i18n/index.ts

@@ -46,6 +46,10 @@ import pagesDateCenterZhcn from './pages/dateCenter/zh-cn';
 import pagesDateCenterEn from './pages/dateCenter/en';
 import pagesDateCenterZhtw from './pages/dateCenter/zh-tw';
 
+import pagesFlowFormZhcn from './pages/flow/flowForm/zh-cn';
+import pagesFlowFormEn from './pages/flow/flowForm/en';
+import pagesFlowFormZhtw from './pages/flow/flowForm/zh-tw';
+
 // 定义语言国际化内容
 /**
  * 说明:
@@ -64,7 +68,8 @@ const messages = {
 			iotCard: pagesIotcardZhcn,
 			projects: pagesProjectsZhcn,
 			property: pagesPropertyZhcn,
-			dateCenter: pagesDateCenterZhcn
+			dateCenter: pagesDateCenterZhcn,
+			flowForm: pagesFlowFormZhcn
 		}
 	},
 	[enLocale.name]: {
@@ -78,7 +83,8 @@ const messages = {
 			iotCard: pagesIotcardEn,
 			projects: pagesProjectsEn,
 			property: pagesPropertyEn,
-			dateCenter: pagesDateCenterEn
+			dateCenter: pagesDateCenterEn,
+			flowForm: pagesFlowFormEn
 		},	
 	},
 	[zhtwLocale.name]: {
@@ -92,7 +98,8 @@ const messages = {
 			iotCard: pagesIotcardZhtw,
 			projects: pagesProjectsZhtw,
 			property: pagesPropertyZhtw,
-			dateCenter: pagesDateCenterZhtw
+			dateCenter: pagesDateCenterZhtw,
+			flowForm: pagesFlowFormZhtw
 		},
 	},
 };

+ 10 - 1
src/i18n/lang/en.ts

@@ -189,7 +189,7 @@ export default {
 			weatherMonitoring: "Weather Monitoring",
 			realTimeMonitoring: "Real-time Monitoring",
 			weatherHistory: "Weather History",
-		},	
+		},
 		iotmanager: {
 			title: "IoT Management",
 			dashboard: "IoT Overview",
@@ -362,6 +362,15 @@ export default {
 		policyManagement: {
 			title: "Policy",
 			policyControl: "Policy Control",
+		},
+		flow: {
+			title: 'Process Management',
+			workbench: 'Workbench',
+			flowFormList: 'Process Form List',
+			flowModelList: 'Process Model List',
+			approvalBusinessTest: 'Approval Business Test',
+			formCenter: 'Form Center',
+			processMonitoring: 'Process Monitoring',
 		}
 	}
 };

+ 9 - 0
src/i18n/lang/zh-cn.ts

@@ -355,6 +355,15 @@ export default {
 		policyManagement: {
 			title: "策略管理",
 			policyControl: "策略控制",
+		},
+		flow: {
+			title: '流程管理',
+			workbench: '工作台',
+			flowFormList: '流程表单列表',
+			flowModelList: '流程模型列表',
+			approvalBusinessTest: '审批业务测试',
+			formCenter: '表单中心',
+			processMonitoring: '流程监控',
 		}
 	}
 };

+ 10 - 1
src/i18n/lang/zh-tw.ts

@@ -197,7 +197,7 @@ export default {
 			weatherMonitoring: "天氣監測",
 			realTimeMonitoring: "實時監測",
 			weatherHistory: "天氣歷史",
-		},	
+		},
 		iotmanager: {
 			title: "物聯管理",
 			dashboard: "物聯概覽",
@@ -362,6 +362,15 @@ export default {
 		policyManagement: {
 			title: "政策管理",
 			policyControl: "政策控制",
+		},
+		flow: {
+			title: '流程管理',
+			workbench: '工作台',
+			flowFormList: '流程表單列表',
+			flowModelList: '流程模型列表',
+			approvalBusinessTest: '審批業務測試',
+			formCenter: '表單中心',
+			processMonitoring: '流程監控',
 		}
 	}
 };

+ 57 - 0
src/i18n/pages/flow/flowForm/en.ts

@@ -0,0 +1,57 @@
+export default {
+	// 表单字段标签
+	formName: 'Form Name',
+	status: 'Status',
+	createTime: 'Create Time',
+	primaryKey: 'Primary Key',
+	deploymentStatus: 'Deployment Status',
+	remark: 'Remark',
+	creator: 'Creator',
+	operation: 'Operation',
+
+	// 占位符
+	enterFormName: 'Please enter form name',
+	selectStatus: 'Please select status',
+	selectCreateTime: 'Select create time',
+
+	// 按钮文本
+	search: 'Search',
+	reset: 'Reset',
+	expandSearch: 'Expand Search',
+	collapseSearch: 'Collapse Search',
+	add: 'Add',
+	edit: 'Edit',
+	delete: 'Delete',
+	import: 'Import',
+	export: 'Export',
+	detail: 'Detail',
+	deployForm: 'Deploy Form',
+
+	// 状态文本
+	deployed: 'Deployed',
+	notDeployed: 'Not Deployed',
+
+	// 确认对话框
+	confirmDeploy: 'Are you sure you want to deploy the form? Deployment will overwrite existing data, please confirm if you have backed up.',
+	confirmDeleteSelected: 'Are you sure you want to delete the selected data?',
+	confirmDeleteSingle: 'This operation will permanently delete the data, do you want to continue?',
+	pleaseSelectDeleteData: 'Please select the data to delete.',
+
+	// 提示文本
+	tip: 'Tip',
+	confirm: 'Confirm',
+	cancel: 'Cancel',
+
+	// 成功消息
+	deploySuccess: 'Deploy successful',
+	deleteSuccess: 'Delete successful',
+	importSuccess: 'Import successful',
+
+	// 错误消息
+	importFailed: 'Import failed: {count} data import failed.',
+	viewFailedData: 'View failed data',
+
+	// 文件名
+	failedFileName: 'failed.json',
+	exportFileName: 'export.json'
+}

+ 57 - 0
src/i18n/pages/flow/flowForm/zh-cn.ts

@@ -0,0 +1,57 @@
+export default {
+	// 表单字段标签
+	formName: '表单名',
+	status: '状态',
+	createTime: '创建时间',
+	primaryKey: '主键',
+	deploymentStatus: '部署情况',
+	remark: '备注',
+	creator: '创建人',
+	operation: '操作',
+
+	// 占位符
+	enterFormName: '请输入表单名',
+	selectStatus: '请选择状态',
+	selectCreateTime: '选择创建时间',
+
+	// 按钮文本
+	search: '搜索',
+	reset: '重置',
+	expandSearch: '展开搜索',
+	collapseSearch: '收起搜索',
+	add: '新增',
+	edit: '修改',
+	delete: '删除',
+	import: '导入',
+	export: '导出',
+	detail: '详情',
+	deployForm: '部署表单',
+
+	// 状态文本
+	deployed: '已部署',
+	notDeployed: '未部署',
+
+	// 确认对话框
+	confirmDeploy: '您确定要部署表单?部署将覆盖原有数据,请确认是否已备份。',
+	confirmDeleteSelected: '你确定要删除所选数据?',
+	confirmDeleteSingle: '此操作将永久删除数据,是否继续?',
+	pleaseSelectDeleteData: '请选择要删除的数据。',
+
+	// 提示文本
+	tip: '提示',
+	confirm: '确认',
+	cancel: '取消',
+
+	// 成功消息
+	deploySuccess: '部署成功',
+	deleteSuccess: '删除成功',
+	importSuccess: '导入成功',
+
+	// 错误消息
+	importFailed: '导入失败: 有 {count} 个数据导入失败。',
+	viewFailedData: '查看失败的数据',
+
+	// 文件名
+	failedFileName: 'failed.json',
+	exportFileName: 'export.json'
+}

+ 57 - 0
src/i18n/pages/flow/flowForm/zh-tw.ts

@@ -0,0 +1,57 @@
+export default {
+	// 表單欄位標籤
+	formName: '表單名',
+	status: '狀態',
+	createTime: '創建時間',
+	primaryKey: '主鍵',
+	deploymentStatus: '部署情況',
+	remark: '備註',
+	creator: '創建人',
+	operation: '操作',
+
+	// 佔位符
+	enterFormName: '請輸入表單名',
+	selectStatus: '請選擇狀態',
+	selectCreateTime: '選擇創建時間',
+
+	// 按鈕文字
+	search: '搜尋',
+	reset: '重置',
+	expandSearch: '展開搜尋',
+	collapseSearch: '收起搜尋',
+	add: '新增',
+	edit: '修改',
+	delete: '刪除',
+	import: '匯入',
+	export: '匯出',
+	detail: '詳情',
+	deployForm: '部署表單',
+
+	// 狀態文字
+	deployed: '已部署',
+	notDeployed: '未部署',
+
+	// 確認對話框
+	confirmDeploy: '您確定要部署表單?部署將覆蓋原有數據,請確認是否已備份。',
+	confirmDeleteSelected: '你確定要刪除所選數據?',
+	confirmDeleteSingle: '此操作將永久刪除數據,是否繼續?',
+	pleaseSelectDeleteData: '請選擇要刪除的數據。',
+
+	// 提示文字
+	tip: '提示',
+	confirm: '確認',
+	cancel: '取消',
+
+	// 成功訊息
+	deploySuccess: '部署成功',
+	deleteSuccess: '刪除成功',
+	importSuccess: '匯入成功',
+
+	// 錯誤訊息
+	importFailed: '匯入失敗: 有 {count} 個數據匯入失敗。',
+	viewFailedData: '查看失敗的數據',
+
+	// 檔案名
+	failedFileName: 'failed.json',
+	exportFileName: 'export.json'
+}

+ 50 - 47
src/views/flow/flowForm/list/index.vue

@@ -5,13 +5,13 @@
 				<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="100px">
 					<el-row>
 						<el-col :span="8" class="colBlock">
-							<el-form-item label="表单名" prop="name">
-								<el-input v-model="tableData.param.name" placeholder="请输入表单名" clearable @keyup.enter.native="flowFormList" />
+							<el-form-item :label="t('message.flowForm.formName')" prop="name">
+								<el-input v-model="tableData.param.name" :placeholder="t('message.flowForm.enterFormName')" clearable @keyup.enter.native="flowFormList" />
 							</el-form-item>
 						</el-col>
 						<el-col :span="8" class="colBlock">
-							<el-form-item label="状态" prop="status">
-								<el-select v-model="tableData.param.status" placeholder="请选择状态" clearable style="width: 160px">
+							<el-form-item :label="t('message.flowForm.status')" prop="status">
+								<el-select v-model="tableData.param.status" :placeholder="t('message.flowForm.selectStatus')" clearable style="width: 160px">
 									<el-option v-for="dict in flow_form_status" :key="dict.value" :label="dict.label" :value="dict.value" />
 								</el-select>
 							</el-form-item>
@@ -19,10 +19,10 @@
 						<el-col :span="8" :class="!showAll ? 'colBlock' : 'colNone'">
 							<el-form-item>
 								<el-button type="primary" @click="flowFormList"
-									><el-icon><ele-Search /></el-icon>搜索</el-button
+									><el-icon><ele-Search /></el-icon>{{ t('message.flowForm.search') }}</el-button
 								>
 								<el-button @click="resetQuery(queryRef)"
-									><el-icon><ele-Refresh /></el-icon>重置</el-button
+									><el-icon><ele-Refresh /></el-icon>{{ t('message.flowForm.reset') }}</el-button
 								>
 								<el-button type="primary" link @click="toggleSearch">
 									{{ word }}
@@ -32,7 +32,7 @@
 							</el-form-item>
 						</el-col>
 						<el-col :span="8" :class="showAll ? 'colBlock' : 'colNone'">
-							<el-form-item label="创建时间" prop="createdAt">
+							<el-form-item :label="t('message.flowForm.createTime')" prop="createdAt">
 								<el-date-picker
 									clearable
 									style="width: 200px"
@@ -40,17 +40,17 @@
 									format="YYYY-MM-DD HH:mm:ss"
 									value-format="YYYY-MM-DD HH:mm:ss"
 									type="datetime"
-									placeholder="选择创建时间"
+									:placeholder="t('message.flowForm.selectCreateTime')"
 								></el-date-picker>
 							</el-form-item>
 						</el-col>
 						<el-col :span="8" :class="showAll ? 'colBlock' : 'colNone'">
 							<el-form-item>
 								<el-button type="primary" @click="flowFormList"
-									><el-icon><ele-Search /></el-icon>搜索</el-button
+									><el-icon><ele-Search /></el-icon>{{ t('message.flowForm.search') }}</el-button
 								>
 								<el-button @click="resetQuery(queryRef)"
-									><el-icon><ele-Refresh /></el-icon>重置</el-button
+									><el-icon><ele-Refresh /></el-icon>{{ t('message.flowForm.reset') }}</el-button
 								>
 								<el-button type="primary" link @click="toggleSearch">
 									{{ word }}
@@ -64,57 +64,57 @@
 				<el-row :gutter="10" class="mb8">
 					<el-col :span="1.5">
 						<el-button type="primary" @click="handleAdd" v-auth="'api/v1/flow/flowForm/add'"
-							><el-icon><ele-Plus /></el-icon>新增</el-button
+							><el-icon><ele-Plus /></el-icon>{{ t('message.flowForm.add') }}</el-button
 						>
 					</el-col>
 					<el-col :span="1.5">
 						<el-button type="success" :disabled="single" @click="handleUpdate(null)" v-auth="'api/v1/flow/flowForm/edit'"
-							><el-icon><ele-Edit /></el-icon>修改</el-button
+							><el-icon><ele-Edit /></el-icon>{{ t('message.flowForm.edit') }}</el-button
 						>
 					</el-col>
 					<el-col :span="1.5">
 						<el-button type="danger" :disabled="multiple" @click="handleDelete(null)" v-auth="'api/v1/flow/flowForm/delete'"
-							><el-icon><ele-Delete /></el-icon>删除</el-button
+							><el-icon><ele-Delete /></el-icon>{{ t('message.flowForm.delete') }}</el-button
 						>
 					</el-col>
 					<el-col :span="1.5">
 						<el-button type="info" @click="handleImport"
-							><el-icon><ele-Upload /></el-icon>导入</el-button
+							><el-icon><ele-Upload /></el-icon>{{ t('message.flowForm.import') }}</el-button
 						>
 					</el-col>
 					<el-col :span="1.5">
 						<el-button type="primary" :disabled="multiple" @click="handleExport"
-							><el-icon><ele-Download /></el-icon>导出</el-button
+							><el-icon><ele-Download /></el-icon>{{ t('message.flowForm.export') }}</el-button
 						>
 					</el-col>
 				</el-row>
 			</div>
 			<el-table v-loading="loading" :data="tableData.data" @selection-change="handleSelectionChange">
 				<el-table-column type="selection" width="55" align="center" />
-				<el-table-column label="主键" align="center" prop="id" min-width="150px" />
-				<el-table-column label="表单名" align="center" prop="name" min-width="150px" />
-				<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" min-width="150px" />
-				<el-table-column label="部署情况" align="center" prop="status" :formatter="isPubFormat" min-width="150px" />
-				<el-table-column label="备注" align="center" prop="remark" min-width="150px" />
-				<el-table-column label="创建时间" align="center" prop="createdAt" min-width="150px">
+				<el-table-column :label="t('message.flowForm.primaryKey')" align="center" prop="id" min-width="150px" />
+				<el-table-column :label="t('message.flowForm.formName')" align="center" prop="name" min-width="150px" />
+				<el-table-column :label="t('message.flowForm.status')" align="center" prop="status" :formatter="statusFormat" min-width="150px" />
+				<el-table-column :label="t('message.flowForm.deploymentStatus')" align="center" prop="status" :formatter="isPubFormat" min-width="150px" />
+				<el-table-column :label="t('message.flowForm.remark')" align="center" prop="remark" min-width="150px" />
+				<el-table-column :label="t('message.flowForm.createTime')" align="center" prop="createdAt" min-width="150px">
 					<template #default="scope">
 						<span>{{ proxy.parseTime(scope.row.createdAt, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
 					</template>
 				</el-table-column>
-				<el-table-column label="创建人" align="center" prop="createdBy" min-width="150px" />
-				<el-table-column label="操作" align="center" class-name="small-padding" min-width="200px" fixed="right">
+				<el-table-column :label="t('message.flowForm.creator')" align="center" prop="createdBy" min-width="150px" />
+				<el-table-column :label="t('message.flowForm.operation')" align="center" class-name="small-padding" min-width="200px" fixed="right">
 					<template #default="scope">
 						<el-button type="primary" link @click="handleView(scope.row)" v-auth="'api/v1/flow/flowForm/get'"
-							><el-icon><ele-View /></el-icon>详情</el-button
+							><el-icon><ele-View /></el-icon>{{ t('message.flowForm.detail') }}</el-button
 						>
 						<el-button type="primary" link @click="handleUpdate(scope.row)" v-auth="'api/v1/flow/flowForm/edit'"
-							><el-icon><ele-EditPen /></el-icon>修改</el-button
+							><el-icon><ele-EditPen /></el-icon>{{ t('message.flowForm.edit') }}</el-button
 						>
 						<el-button type="primary" link @click="handleGen(scope.row)" v-auth="'api/v1/flow/flowForm/gen'"
-							><el-icon><ele-Position /></el-icon>部署表单</el-button
+							><el-icon><ele-Position /></el-icon>{{ t('message.flowForm.deployForm') }}</el-button
 						>
 						<el-button type="primary" link @click="handleDelete(scope.row)" v-auth="'api/v1/flow/flowForm/delete'"
-							><el-icon><ele-DeleteFilled /></el-icon>删除</el-button
+							><el-icon><ele-DeleteFilled /></el-icon>{{ t('message.flowForm.delete') }}</el-button
 						>
 					</template>
 				</el-table-column>
@@ -133,6 +133,7 @@
 <script lang="ts">
 import { computed, defineComponent, getCurrentInstance, onMounted, reactive, ref, toRaw, toRefs, watch } from 'vue'
 import { ElMessage, ElMessageBox, FormInstance } from 'element-plus'
+import { useI18n } from 'vue-i18n'
 import { addFlowForm, delFlowForm, genFlowForm, getFlowForm, listFlowForm } from '/@/api/flow/flowForm'
 import {
 	FlowFormInfoData,
@@ -152,6 +153,7 @@ export default defineComponent({
 	setup() {
 		const router = useRouter()
 		const { proxy } = <any>getCurrentInstance()
+		const { t } = useI18n()
 		const loading = ref(false)
 		const queryRef = ref()
 		const editRef = ref()
@@ -165,9 +167,9 @@ export default defineComponent({
 		const word = computed(() => {
 			if (showAll.value === false) {
 				//对文字进行处理
-				return '展开搜索'
+				return t('message.flowForm.expandSearch')
 			} else {
-				return '收起搜索'
+				return t('message.flowForm.collapseSearch')
 			}
 		})
 		// 字典选项数据
@@ -224,7 +226,7 @@ export default defineComponent({
 			return proxy.selectDictLabel(flow_form_status.value, row.status)
 		}
 		const isPubFormat = (row: FlowFormTableColumns) => {
-			return row.isPub ? '已部署' : '未部署'
+			return row.isPub ? t('message.flowForm.deployed') : t('message.flowForm.notDeployed')
 		}
 		// 多选框选中数据
 		const handleSelectionChange = (selection: Array<FlowFormInfoData>) => {
@@ -244,40 +246,40 @@ export default defineComponent({
 			router.push('/flow/flowForm/formDesign?id=' + row.id)
 		}
 		const handleGen = (row: FlowFormTableColumns) => {
-			ElMessageBox.confirm('您确定要部署表单?部署将覆盖原有数据,请确认是否已备份。', '提示', {
-				confirmButtonText: '确认',
-				cancelButtonText: '取消',
+			ElMessageBox.confirm(t('message.flowForm.confirmDeploy'), t('message.flowForm.tip'), {
+				confirmButtonText: t('message.flowForm.confirm'),
+				cancelButtonText: t('message.flowForm.cancel'),
 				type: 'warning',
 			})
 				.then(() => {
 					genFlowForm(row.id).then(() => {
-						ElMessage.success('部署成功')
+						ElMessage.success(t('message.flowForm.deploySuccess'))
 						flowFormList()
 					})
 				})
 				.catch()
 		}
 		const handleDelete = (row: FlowFormTableColumns) => {
-			let msg = '你确定要删除所选数据?'
+			let msg = t('message.flowForm.confirmDeleteSelected')
 			let id: number[] = []
 			if (row) {
-				msg = `此操作将永久删除数据,是否继续?`
+				msg = t('message.flowForm.confirmDeleteSingle')
 				id = [row.id]
 			} else {
 				id = state.ids
 			}
 			if (id.length === 0) {
-				ElMessage.error('请选择要删除的数据。')
+				ElMessage.error(t('message.flowForm.pleaseSelectDeleteData'))
 				return
 			}
-			ElMessageBox.confirm(msg, '提示', {
-				confirmButtonText: '确认',
-				cancelButtonText: '取消',
+			ElMessageBox.confirm(msg, t('message.flowForm.tip'), {
+				confirmButtonText: t('message.flowForm.confirm'),
+				cancelButtonText: t('message.flowForm.cancel'),
 				type: 'warning',
 			})
 				.then(() => {
 					delFlowForm(id).then(() => {
-						ElMessage.success('删除成功')
+						ElMessage.success(t('message.flowForm.deleteSuccess'))
 						flowFormList()
 					})
 				})
@@ -330,20 +332,20 @@ export default defineComponent({
 
 			const failed = result.filter((it) => !it)
 			if (failed.length == 0) {
-				ElMessage.success('导入成功')
+				ElMessage.success(t('message.flowForm.importSuccess'))
 				flowFormList()
 				reset()
 				return
 			}
 
-			const showErrorDialog = await ElMessageBox.alert(`导入失败: 有 ${failed.length} 个数据导入失败。`, '提示', {
-				confirmButtonText: '查看失败的数据',
-				cancelButtonText: '确认',
+			const showErrorDialog = await ElMessageBox.alert(t('message.flowForm.importFailed', { count: failed.length }), t('message.flowForm.tip'), {
+				confirmButtonText: t('message.flowForm.viewFailedData'),
+				cancelButtonText: t('message.flowForm.confirm'),
 				type: 'warning',
 			})
 
 			if (showErrorDialog) {
-				download(JSON.stringify(failed.map((it) => it.result)), 'failed.json')
+				download(JSON.stringify(failed.map((it) => it.result)), t('message.flowForm.failedFileName'))
 			}
 
 			reset()
@@ -363,10 +365,11 @@ export default defineComponent({
 						}
 					})
 				),
-				'export.json'
+				t('message.flowForm.exportFileName')
 			)
 		}
 		return {
+			t,
 			proxy,
 			editRef,
 			detailRef,