parent
7e98d34c80
commit
1299915419
7 changed files with 233 additions and 17 deletions
@ -0,0 +1,50 @@ |
||||
import request from '@/axios'; |
||||
|
||||
const prefix = '/blade-workflow/design/form/variable' |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: `${prefix}/list`, |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const getDetail = (params) => { |
||||
return request({ |
||||
url: `${prefix}/detail`, |
||||
method: 'get', |
||||
params |
||||
}) |
||||
} |
||||
|
||||
export const remove = (ids) => { |
||||
return request({ |
||||
url: `${prefix}/remove`, |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const add = (row) => { |
||||
return request({ |
||||
url: `${prefix}/submit`, |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
|
||||
export const update = (row) => { |
||||
return request({ |
||||
url: `${prefix}/update`, |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
|
||||
@ -0,0 +1,94 @@ |
||||
<template> |
||||
<div class="nf-form-variable"> |
||||
<el-button |
||||
text |
||||
icon="el-icon-clock" |
||||
title="表单历史" |
||||
style="color: black; font-size: 18px" |
||||
@click="visible = true" |
||||
></el-button> |
||||
<el-drawer v-model="visible" size="60%" append-to-body class="nf-drawer" destroy-on-close> |
||||
<template #header> |
||||
<span> 流程表单提交历史 <el-tag v-if="isDev">@nutflow1.8.1+</el-tag> </span> |
||||
</template> |
||||
<el-tabs v-model="active" class="nf-theme-custom"> |
||||
<el-tab-pane v-for="(item, index) in list" :name="index" :key="index" lazy> |
||||
<template #label> |
||||
<el-popover placement="top" width="auto" trigger="hover"> |
||||
{{ item.createUsername }} 于 {{ item.createTime }} 提交 |
||||
<template #reference>{{ item.taskName }}</template> |
||||
</el-popover> |
||||
</template> |
||||
<nf-form |
||||
v-model="item.formVariable" |
||||
:option="item.formOption" |
||||
:style="themeCustomStyle" |
||||
></nf-form> |
||||
</el-tab-pane> |
||||
</el-tabs> |
||||
</el-drawer> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getList } from '../../api/design/form-variable' |
||||
import theme from '../../mixins/theme' |
||||
export default { |
||||
name: 'nf-form-variable', |
||||
mixins: [theme], |
||||
props: { |
||||
processInsId: { |
||||
type: String, |
||||
default: '' |
||||
} |
||||
}, |
||||
computed: { |
||||
isDev() { |
||||
return process.env.NODE_ENV === "development" |
||||
} |
||||
}, |
||||
watch: { |
||||
processInsId: { |
||||
handler(val) { |
||||
this.getFormVariable(val) |
||||
}, |
||||
immediate: true |
||||
}, |
||||
}, |
||||
data() { |
||||
return { |
||||
visible: false, |
||||
active: 0, |
||||
list: [] |
||||
} |
||||
}, |
||||
methods: { |
||||
getFormVariable(processInsId) { |
||||
if (this.validatenull(processInsId)) return |
||||
|
||||
getList(1, -1, { processInsId }).then(res => { |
||||
const list = res.data.data.records |
||||
list.forEach(item => { |
||||
item.formVariable = JSON.parse(item.formVariable) |
||||
item.formOption = JSON.parse(item.formOption) |
||||
item.formOption.detail = true |
||||
}) |
||||
this.list = list |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.nf-form-variable { |
||||
.el-button.is-text { |
||||
padding: 0; |
||||
} |
||||
} |
||||
.nf-drawer { |
||||
.nf-form { |
||||
padding: 0 10px; |
||||
} |
||||
} |
||||
</style> |
||||
@ -0,0 +1,64 @@ |
||||
<template> |
||||
<el-popover popper-class="nf-theme-popover" placement="left" width="auto" trigger="click"> |
||||
<el-radio-group v-model="theme"> |
||||
<el-row :gutter="15"> |
||||
<el-col v-for="(item, index) in themeList" :key="index" :span="8"> |
||||
<el-radio :label="item.value">{{ item.label }}</el-radio> |
||||
</el-col> |
||||
</el-row> |
||||
</el-radio-group> |
||||
<template #reference> |
||||
<el-button |
||||
title="主题" |
||||
text |
||||
icon="el-icon-brush" |
||||
style="color: black; font-size: 18px" |
||||
></el-button |
||||
></template> |
||||
</el-popover> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: 'nf-theme', |
||||
props: { |
||||
modelValue: { |
||||
type: String, |
||||
default: 'default', |
||||
}, |
||||
themeList: { |
||||
type: Array, |
||||
default: () => [] |
||||
} |
||||
}, |
||||
watch: { |
||||
modelValue: { |
||||
handler(val) { |
||||
this.theme = val |
||||
}, |
||||
immediate: true |
||||
}, |
||||
theme: { |
||||
handler(val) { |
||||
this.$emit('update:modelValue', val) |
||||
} |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
theme: '' |
||||
} |
||||
}, |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.nf-theme-popover { |
||||
.el-radio { |
||||
width: 100%; |
||||
overflow: hidden; |
||||
white-space: nowrap; |
||||
text-overflow: ellipsis; |
||||
} |
||||
} |
||||
</style> |
||||
Loading…
Reference in new issue