|
@@ -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,
|