|
@@ -73,31 +73,35 @@
|
|
|
<el-avatar :src="scope.row.avatar" size="small"></el-avatar>
|
|
|
</template>
|
|
|
|
|
|
- <template #statusSlot="scope">
|
|
|
- <status-indicator v-if="scope.row.status === 1" pulse type="success"></status-indicator>
|
|
|
- <status-indicator v-else pulse type="danger"></status-indicator>
|
|
|
+ <template #statusSlot="{ row }">
|
|
|
+ <status-indicator pulse :type="row.status === 1 ? 'success' : 'danger'"></status-indicator>
|
|
|
</template>
|
|
|
|
|
|
- <template #actionSlot="scope">
|
|
|
- <el-tooltip content="设计" placement="bottom" effect="light">
|
|
|
- <el-icon class="ibt0" @click="designTemplateEv(scope.row)">
|
|
|
- <Money />
|
|
|
- </el-icon>
|
|
|
- </el-tooltip>
|
|
|
- <el-divider direction="vertical"></el-divider>
|
|
|
- <el-tooltip content="编辑" placement="bottom" effect="light">
|
|
|
- <el-icon class="ibt0" @click="tableTemplateEdit(scope.row)">
|
|
|
- <Edit />
|
|
|
- </el-icon>
|
|
|
- </el-tooltip>
|
|
|
- <el-divider direction="vertical"></el-divider>
|
|
|
- <el-popconfirm title="确定删除吗?" @confirm="deleteTemplateItem([scope.row.id])">
|
|
|
- <template #reference>
|
|
|
- <el-icon class="ibt0">
|
|
|
- <Delete />
|
|
|
- </el-icon>
|
|
|
+ <template #actionSlot="{ row }">
|
|
|
+ <div style="display: flex; align-items: center; justify-content: flex-end">
|
|
|
+ <!--设计表单才有-->
|
|
|
+ <template v-if="row.type === 0">
|
|
|
+ <el-tooltip content="设计" placement="bottom" effect="light">
|
|
|
+ <el-icon class="ibt0" @click="designTemplateEv(row)">
|
|
|
+ <Money />
|
|
|
+ </el-icon>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-divider direction="vertical"></el-divider>
|
|
|
</template>
|
|
|
- </el-popconfirm>
|
|
|
+ <el-tooltip content="编辑" placement="bottom" effect="light">
|
|
|
+ <el-icon class="ibt0" @click="tableTemplateEdit(row)">
|
|
|
+ <Edit />
|
|
|
+ </el-icon>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-divider direction="vertical"></el-divider>
|
|
|
+ <el-popconfirm title="确定删除吗?" @confirm="deleteTemplateItem([row.id])">
|
|
|
+ <template #reference>
|
|
|
+ <el-icon class="ibt0">
|
|
|
+ <Delete />
|
|
|
+ </el-icon>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</LeTable>
|
|
|
</div>
|
|
@@ -134,9 +138,10 @@ import formtemplate from '@/api/flow/formtemplate'
|
|
|
import { computed, nextTick, ref, watch } from 'vue'
|
|
|
import { ElMessage, ElTree, ElMessageBox } from 'element-plus'
|
|
|
import { useTablePage } from '@/hooks/useTablePage'
|
|
|
-import { Plus, Delete, Edit } from '@element-plus/icons-vue'
|
|
|
+// import { Plus, Delete, Edit } from '@element-plus/icons-vue'
|
|
|
import StatusIndicator from '@/components/StatusIndicator/index.vue'
|
|
|
import DesignForm from './designForm.vue'
|
|
|
+import { statusOptions, templateForms, typeOptions, typeOptions_config } from './data.tsx'
|
|
|
|
|
|
const visible = ref(false) // 弹窗显示隐藏
|
|
|
const visibleTemplate = ref(false) // 弹窗显示隐藏
|
|
@@ -209,51 +214,10 @@ const showGroupLoading = ref(false)
|
|
|
const groupFilterText = ref('')
|
|
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
|
|
|
|
|
-// 新增编辑表单模板
|
|
|
-const formTemplateDialog = [
|
|
|
- {
|
|
|
- prop: 'formCategoryId',
|
|
|
- label: '所属表单分类',
|
|
|
- itemType: 'select',
|
|
|
- filterable: true,
|
|
|
- options: [],
|
|
|
- rules: [{ required: true, message: '请选择所属表单分类', trigger: 'blur' }]
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'name',
|
|
|
- label: '模板名称',
|
|
|
- itemType: 'input',
|
|
|
- rules: [{ required: true, message: '请输入模板名称', trigger: 'blur' }]
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'code',
|
|
|
- label: '模板编码',
|
|
|
- itemType: 'input',
|
|
|
- rules: [{ required: true, message: '请输入模板编码', trigger: 'blur' }]
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'status',
|
|
|
- label: '状态',
|
|
|
- itemType: 'switch',
|
|
|
- activeText: '正常',
|
|
|
- inactiveText: '禁用'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'sort',
|
|
|
- label: '排序',
|
|
|
- itemType: 'inputNumber',
|
|
|
- rules: [{ required: true, message: '请输入排序', trigger: 'blur' }]
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'remark',
|
|
|
- label: '备注',
|
|
|
- itemType: 'input'
|
|
|
- }
|
|
|
-]
|
|
|
// 新增的表单模板 和 编辑的表单模板
|
|
|
const formTemplateOptions = computed(() => {
|
|
|
return {
|
|
|
- forms: formTemplateDialog,
|
|
|
+ forms: templateForms,
|
|
|
labelWidth: 120,
|
|
|
span: 30,
|
|
|
showResetBtn: true,
|
|
@@ -313,21 +277,19 @@ const forms = ref([
|
|
|
itemType: 'input',
|
|
|
placeholder: '请输入名称'
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: 'type',
|
|
|
+ label: '类型:',
|
|
|
+ itemType: 'select',
|
|
|
+ placeholder: '请选择类型',
|
|
|
+ options: typeOptions
|
|
|
+ },
|
|
|
{
|
|
|
prop: 'status',
|
|
|
label: '状态:',
|
|
|
itemType: 'select',
|
|
|
placeholder: '请选择状态',
|
|
|
- options: [
|
|
|
- {
|
|
|
- label: '禁用',
|
|
|
- value: 0
|
|
|
- },
|
|
|
- {
|
|
|
- label: '正常',
|
|
|
- value: 1
|
|
|
- }
|
|
|
- ]
|
|
|
+ options: statusOptions
|
|
|
}
|
|
|
])
|
|
|
// table列表数据请求
|
|
@@ -358,6 +320,14 @@ const columns = [
|
|
|
label: '编码',
|
|
|
minWidth: 150
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: 'type',
|
|
|
+ label: '类型',
|
|
|
+ minWidth: 100,
|
|
|
+ formatter: (row, column, cellValue) => {
|
|
|
+ return typeOptions_config[cellValue] || '-'
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
prop: 'status',
|
|
|
label: '状态',
|
|
@@ -499,7 +469,10 @@ const addHandler = mode => {
|
|
|
visible.value = true
|
|
|
current_mode.value = mode
|
|
|
} else {
|
|
|
- activeDataTemplate.value = {}
|
|
|
+ activeDataTemplate.value = {
|
|
|
+ // 设计表单
|
|
|
+ type: 0
|
|
|
+ }
|
|
|
visibleTemplate.value = true
|
|
|
}
|
|
|
}
|