172 lines
5.2 KiB
HTML
172 lines
5.2 KiB
HTML
{% extends 'template/jhTemplateV4.html'%}
|
|
|
|
{% block vueTemplate %}
|
|
<script type="text/html" id="app-template">
|
|
<div>
|
|
<v-app mobile-breakpoint="sm">
|
|
<jh-menu />
|
|
<v-main class="mt-15">
|
|
<!-- 头部内容 >>>>>>>>>>>>> -->
|
|
<div class="jh-page-second-bar px-8">
|
|
<v-row class="align-center">
|
|
<v-col cols="12" xs="12" sm="12" md="4" xl="3">
|
|
<div class="py-4 text-body-1 font-weight-bold">发起申请
|
|
<!-- 帮助页按钮 -->
|
|
<span role="button" class="success--text font-weight-regular jh-font-size-13 ml-2" @click="isHelpPageDrawerShown = true">
|
|
<v-icon size="13" class="success--text">mdi-help-circle-outline</v-icon>帮助
|
|
</span>
|
|
</div>
|
|
</v-col>
|
|
</v-row>
|
|
</div>
|
|
<!-- <<<<<<<<<<<<< 头部内容 -->
|
|
|
|
<div class="jh-page-body-container px-8">
|
|
<!-- 页面内容 >>>>>>>>>>>>> -->
|
|
<v-card class="rounded-lg pa-8">
|
|
<!-- {{tableData}} -->
|
|
<v-row v-for="(key, index) in Object.keys(tableData)" :key="index">
|
|
<v-col cols="12" sm="12" md="12" xl="12">
|
|
<span class="font-weight-bold">{{key}}</span>
|
|
</v-col>
|
|
<v-card v-for="(templateItem, templateIndex) in tableData[key]" class="template-box" outlined @click="doUiAction('startCreateTask', templateItem)">
|
|
<div class="d-flex align-center">
|
|
<v-img
|
|
class="mr-2 block"
|
|
max-height="30"
|
|
max-width="30"
|
|
:src="`/<$ ctx.app.config.appId $>/public${templateItem['taskTemplateIcon']}`"
|
|
></v-img>
|
|
<div class="omit">{{templateItem['workflowName']}}</div>
|
|
</div>
|
|
</v-card>
|
|
</v-row>
|
|
</v-card>
|
|
<create-task-drawer ref="createTaskDrawer"></create-task-drawer>
|
|
|
|
<!-- <<<<<<<<<<<<< 页面内容 -->
|
|
</div>
|
|
|
|
<!-- 帮助页抽屉 >>>>>>>>>>>>> -->
|
|
<v-navigation-drawer v-model="isHelpPageDrawerShown" v-click-outside="drawerClickOutside" fixed temporary right width="80%"
|
|
class="elevation-24">
|
|
<iframe style="border: 0" :src="`/${appInfo.appId}/pageDoc#taskHistory.md`" width="100%" height="100%"></iframe>
|
|
|
|
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
|
|
@click="isHelpPageDrawerShown = false">
|
|
<v-icon>mdi-close</v-icon>
|
|
</v-btn>
|
|
</v-navigation-drawer>
|
|
<!-- <<<<<<<<<<<<< 帮助页抽屉 -->
|
|
</v-main>
|
|
</v-app>
|
|
|
|
<jh-toast />
|
|
<jh-mask />
|
|
<jh-confirm-dialog />
|
|
</div>
|
|
</script>
|
|
|
|
<div id="app"></div>
|
|
|
|
{% endblock %}
|
|
{% block vueScript %}
|
|
|
|
{% include 'component/createTaskDrawer.html' %}
|
|
|
|
<script type="module">
|
|
new Vue({
|
|
el: '#app',
|
|
template: '#app-template',
|
|
vuetify: new Vuetify(),
|
|
data: () => ({
|
|
isHelpPageDrawerShown: false,
|
|
isTableLoading: true,
|
|
tableData:[]
|
|
}),
|
|
computed: {
|
|
isMobile() {
|
|
return window.innerWidth < 600;
|
|
},
|
|
},
|
|
watch: {},
|
|
created() {
|
|
},
|
|
mounted() {
|
|
this.doUiAction('getTableData');
|
|
},
|
|
methods: {
|
|
async doUiAction(uiActionId, uiActionData) {
|
|
switch (uiActionId) {
|
|
case 'getTableData':
|
|
await this.getTableData();
|
|
break;
|
|
case 'startCreateTask':
|
|
await this.openCreateTaskDrawer(uiActionData);
|
|
break;
|
|
default:
|
|
console.error('[doUiAction] uiActionId not find', { uiActionId });
|
|
break;
|
|
}
|
|
},
|
|
|
|
async getTableData() {
|
|
this.isTableLoading = true;
|
|
const result = await window.jianghuAxios({
|
|
data: {
|
|
appData: {
|
|
pageId: 'taskApply',
|
|
actionId: 'selectItemList',
|
|
actionData: {},
|
|
orderBy: [{ column: 'id', order: 'asc' }]
|
|
}
|
|
}
|
|
});
|
|
|
|
const rows = result.data.appData.resultData.rows;
|
|
var tempTable = rows.map(template => {
|
|
const { workflowId, workflowName, workflowInfo, workflowForm, workflowConfig } = template
|
|
var info = JSON.parse(workflowInfo)
|
|
return {
|
|
workflowId, workflowName,
|
|
taskTemplateIcon: info.taskTemplateIcon,
|
|
taskTemplateGroup: info.taskTemplateGroup || '未命名',
|
|
workflowForm: JSON.parse(workflowForm),
|
|
workflowConfig: JSON.parse(workflowConfig),
|
|
}
|
|
});
|
|
|
|
let groupByTaskTemplateGroup = _.groupBy(tempTable,'taskTemplateGroup');
|
|
this.tableData = groupByTaskTemplateGroup
|
|
|
|
this.isTableLoading = false;
|
|
},
|
|
|
|
async openCreateTaskDrawer(workflow) {
|
|
this.$refs.createTaskDrawer.doUiAction('open', workflow);
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
</script>
|
|
|
|
<style scoped>
|
|
.omit{
|
|
display: -webkit-box;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-line-clamp: 2;
|
|
overflow: hidden;
|
|
}
|
|
.template-box{
|
|
width: 180px;
|
|
height: 60px;
|
|
padding: 10px 15px;
|
|
margin-right: 20px;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
</style>
|
|
{% endblock %}
|