first commit

This commit is contained in:
2026-09-08 19:49:21 +08:00
commit ebffbab428
7320 changed files with 1477614 additions and 0 deletions
@@ -0,0 +1,439 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.box {
width: 500px;
height: 100px;
margin: 150px auto 0;
}
.inp {
width: 300px !important;
margin-right: 20px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">祝福名称:</div>
<div class="search-item-option">
<el-input placeholder="请输入祝福名称" v-model="pageForm.blessingName" clearable>
<template slot="prepend">祝福名称</template>
</el-input>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<table-tool label="祝福列表" :app="this">
<template #func>
<el-button icon="el-icon-s-promotion" type="primary" size="small"
@click="openAdd">新建祝福
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
ref="table"
:size="tableSize" class="vi-table">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop==='blessingMode'" scope="{row:{blessingMode}}">
{{blessingMode=='birthday'?'生日祝福':'其它祝福'}}
</template>
<template v-else-if="column.prop==='isSend'" scope="{row:{isSend}}">
{{isSend=='2'?'任务已完成':isSend=='1'?'进行中':'未开启'}}
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="300px">
<template scope="{row}">
<el-button type="primary" @click="openView(row)" size="mini">
查看
</el-button>
<el-button type="primary" @click="openEdit(row)" size="mini" :disabled="row.isSend!=0">
编辑
</el-button>
<el-button type="danger" @click="doDelete(row)" size="mini">删除</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<el-form :model="formData" ref="addForm" :rules="formRules" label-width="150px"
style="width: 50%;margin: auto">
<el-row gutter="20">
<el-col :span="24">
<el-form-item prop="blessingName" label="祝福名称">
<el-input v-model="formData.blessingName" style="width: 100%"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item prop="blessingMode" label="祝福模式">
<el-select v-model="formData.blessingMode" placeholder="请选择祝福模式" filterable clearable
style="width: 100%">
<el-option label="生日祝福(定时发送)" value="birthday"></el-option>
<el-option label="其它祝福(即时发送)" value="other"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item prop="activityGroupId" label="发送人员范围">
<div style="display: flex; justify-content: space-between">
<div style="width: 99%">
<el-select @change="changeActivity" clearable filterable placeholder="请选择可报名人员范围"
style="width: 99%" v-model="formData.activityGroupId">
<el-option :key="item.groupId"
:label="item.groupName"
:value="item.groupId"
v-for="item in activityGroupList"></el-option>
</el-select>
</div>
<div>
<el-button
@click="$refs.drawerUserScope.userScopeDialog = true"
type="primary">设置
</el-button>
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="发送方式" prop="sendTypes">
<el-checkbox-group v-model="formData.sendTypes" size="medium">
<el-checkbox border label="msg" disabled>短信发送</el-checkbox>
<el-checkbox border label="WeChat">微信发送</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="24" v-if="formData.blessingMode==='birthday'">
<el-form-item label="发送日期和时间" prop="blessingCron">
<el-input v-for="a in cronExecuteDate" :value="a" readonly></el-input>
<el-button type="primary" @click="showDialog">设置日期和时间</el-button>
<sapn style="color: red" v-if="cronExecuteDate.length>2">只展示最近五次执行时间</sapn>
</el-form-item>
</el-col>
<el-col :span="24" v-if="formData.blessingMode==='birthday'">
<el-form-item prop="isSend" label="是否启动定时发送">
<el-switch
v-model="formData.isSend"
active-color="#13ce66"
active-value="1"
inactive-value="0"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item prop="blessingContent" label="祝福内容">
<el-input v-model="formData.blessingContent" style="width: 100%"
type="textarea" rows="4"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-row style="float: right">
<el-button type="primary" @click="formData.id?doEdit():doAdd()">
<span v-if="formData.blessingMode==='birthday'">创建祝福计划</span>
<span v-else>发送</span>
</el-button>
</el-row>
</el-form-item>
</el-form>
</template>
<template #view>
<el-form label-suffix="" label-width="140px" label-position="left" style="width: 50%;margin: auto">
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="祝福名称">
<el-input readonly :value="viewData.blessingName"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发送范围">
<el-input readonly :value="viewData.groupName"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="祝福模式">
<el-input readonly :value="viewData.blessingMode==='other'?'其它祝福':'生日祝福'"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否发送">
<el-input readonly
:value="viewData.isSend==='0'?'未开启':viewData.isSend==='1'?'进行中':'任务已完成'"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="最近五次执行时间">
<el-input readonly v-for="a in viewData.blessingDate" :value="a"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="祝福内容">
<el-input style="width: 100%" readonly :value="viewData.blessingContent" rows="4"
type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
</guava>
<el-dialog title="生成发送日期和时间" :visible.sync="showCron">
<vcron :expression="formData.blessingCron"
@hide="showCron=false"
@fill="crontabFill"
ref="cron"></vcron>
</el-dialog>
<drawer-user-scope
@group_change="getActivityGroup"
ref="drawerUserScope"
:group_id.sync="formData.groupId"
></drawer-user-scope>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
userScopeDialog: false,
userDataScopeDialog: false,
cronExecuteDate: [],
viewData: {},
formData: {
sendTypes: ['WeChat'],
blessingCron: ''
},
pageForm: {
blessingName: ''
},
activityGroupList: [],
dialogVisible: false,
tableColumns: [
{prop: 'blessingName', label: '祝福名称'},
{prop: 'groupName', label: '发送范围'},
{prop: 'blessingMode', label: '祝福模式'},
{prop: 'sendTypesName', label: '发送方式',},
{prop: 'isSend', label: '是否发送',},
],
formRules: {
blessingName: [{required: true, message: '请填写祝福名称', trigger: ['blur', 'change']}],
activityGroupId: [{required: true, message: '请选择发送范围', trigger: ['blur', 'change']}],
blessingMode: [{required: true, message: '请选择祝福模式', trigger: ['blur', 'change']}],
sendTypes: [{required: true, message: '请选择发送方式', trigger: ['blur', 'change']}],
blessingContent: [{required: true, message: '请填写祝福内容', trigger: ['blur', 'change']}],
},
showCron: false,
}
},
components: {
"vcron": vcrontab.default,
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
},
watch: {
'formData.activityGroupId': {
async handler(newVal, oldVal) {
this.activityGroupList = await getActivityGroup()
this.userScopeDialog = false
},
deep: true
},
},
methods: {
changeActivity(val) {
if (val) {
const group = this.activityGroupList.find(v => v.groupId === val)
this.$set(this.formData, "activityGroupName", group.groupName)
} else {
this.$set(this.formData, "activityGroupName", "全部教职工")
}
},
async openView(row) {
const {data} = await $.post(loc() + '/findOne', {id: row.id})
this.viewData = row
this.viewData.blessingDate = data.blessingDate
this.$refs.guava.view()
},
async openEdit(row) {
const {data} = await $.post(loc() + '/findOne', {id: row.id})
this.$set(this, "formData", data)
this.$refs.guava.edit()
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
},
async doDelete(row) {
const confirm = await this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const data = await $.post('/platform/blessing/applyList/doDelete', {id: row.id})
if (data.code == 0) {
this.$message.success(data.msg);
this.$refs.guava.index()
this.doSearch()
} else {
this.$message.error(data.msg);
}
}
},
async doEdit() {
this.$refs["addForm"].validate(async valid => {
if (valid) {
const confirm = await this.$confirm('确定要修改吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const data = await $.post(loc() + '/doEdit', {Blessing: JSON.stringify(this.formData)})
if (data.code == 0) {
this.$message.success(data.msg);
this.$refs.guava.index()
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
this.doSearch()
} else {
this.$message.error(data.msg);
}
}
}
})
},
doAdd() {
this.$refs["addForm"].validate(async valid => {
if (valid) {
const confirm = await this.$confirm('确定要' + (this.formData.blessingMode === 'birthday' ? '创建祝福计划' : '发送祝福') + '吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const data = await $.post(loc() + '/doAdd', {Blessing: JSON.stringify(this.formData)})
if (data.code === 0) {
this.$message.success(data.msg);
window.location.reload();
} else {
this.$message.error(data.msg);
}
}
}
})
},
async getActivityGroup() {
const {data} = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
this.activityGroupList = data
},
openAdd() {
this.$refs.guava.edit()
this.formData = {
isSend: 0,
sendTypes: ["WeChat"],
blessingCron: ''
}
},
crontabFill(value) {
this.$set(this.formData, 'blessingCron', value)
this.cronExecuteDate = this.$refs.cron.cronExecuteDate
},
showDialog() {
this.expression = this.input
this.showCron = true
},
pageData() {
sublime.showLoadingbar();
this.tableLoading = true
$.post(loc() + "/pageData", this.pageForm, (data) => {
sublime.closeLoadingbar();
this.tableLoading = false
if (data.code == 0) {
data.data.list.forEach(v => {
const a = JSON.parse(v.sendTypes).map(z => {
if (z == "msg") {
return "短信"
} else {
return "微信"
}
})
v.sendTypesName = a.toString()
})
this.tableData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message.error(data.msg);
}
}, "json");
}
},
async created() {
await this.getActivityGroup()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,223 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.box {
width: 500px;
height: 100px;
margin: 150px auto 0;
}
.inp {
width: 300px !important;
margin-right: 20px;
}
</style>
<div id="app" class="platform" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">祝福名称:</div>
<div class="search-item-option">
<el-input placeholder="请输入祝福名称" v-model="pageForm.blessingName" clearable>
<template slot="prepend">祝福名称</template>
</el-input>
</div>
</div>
<div class="search-item">
<div class="search-item-label">职工信息:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
style="width: 100%"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
style="width: 80px;">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">祝福时间:</div>
<div class="search-item-option">
<el-date-picker
v-model="pageForm.data"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
style="width: 100%">
</el-date-picker>
</div>
</div>
<template v-if="searchMore">
<div class="search-item">
<div class="search-item-label">人员类型:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.personType" style="width: 100%" clearable
placeholder="人员类型"
code="UserType"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">在职状态:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.userState" style="width: 100%" clearable
placeholder="在职状态"
code="UserState"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">&emsp;&emsp;别:</div>
<div class="search-item-option">
<el-select v-model="pageForm.sex" style="width: 100%" clearable
placeholder="请选择">
<el-option v-for="sex in sexOptions" :label="sex" :value="sex"></el-option>
</el-select>
</div>
</div>
</template>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
<more v-model="searchMore"></more>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<table-tool label="用户列表" :app="this">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
ref="table"
:size="tableSize" class="vi-table">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
"vcron": vcrontab.default,
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
},
data() {
return {
pageForm: {
data: moment().format('YYYY-MM-DD'),
searchName: "username",
blessingName: ''
},
sexOptions: ['男', '女'],
unions: [],
units: [],
activityGroupList: [],
dialogVisible: false,
tableColumns: [
{prop: 'blessingName', label: '祝福名称'},
{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别'},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'birthday', label: '出生日期', sortable: true},
{prop: 'applyDate', label: '发送时间', sortable: true},
],
formRules: {},
showCron: false,
}
},
methods: {
async getActivityGroup() {
const {data} = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
this.activityGroupList = data
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
}
},
async created() {
await this.getActivityGroup()
this.pageData()
this.unions = await getUnions()
this.flushUnits()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,327 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-upload__tip {
margin-top: 0px;
color: #c33714;
}
</style>
<div id="app">
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">礼物名称:</div>
<div class="search-item-option">
<el-input placeholder="请输入礼物名称" v-model="pageForm.giftName" clearable
@keyup.enter.native="doSearch">
</el-input>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<table-tool label="礼物列表" :app="this">
<template #func>
<el-button icon="el-icon-s-promotion" type="primary" size="small"
@click="openAdd">新建礼物
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
ref="table"
:size="tableSize" class="vi-table">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop === 'files'" scope="{row}">
<el-image v-if="row.files"
style="width: 50px; height: 50px"
:preview-src-list="srcList"
@click="showImage(APP_DOMAIN+FILE_STREAM_PREVIEW_ADDRESS + '?id=' + row.files[0].id)"
:src="APP_DOMAIN+FILE_STREAM_PREVIEW_ADDRESS + '?id=' + row.files[0].id">
</el-image>
<div v-else>暂无</div>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="300px">
<template scope="scope">
<el-button size="mini" @click="openView(scope.row)">查看</el-button>
<el-button size="mini" type="primary" @click="openEdit(scope.row)">编辑</el-button>
<el-button size="mini" type="danger" @click="doDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<template>
<div v-if="formData.id==null || formData.id==''">
<vi-title title="新建礼物信息"></vi-title>
</div>
<div v-else>
<vi-title title="修改礼物信息"></vi-title>
</div>
</template>
<template>
<el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm">
<el-row gutter="20" type="flex">
<el-col :span="12">
<el-form-item label="创建人" prop="username">
<el-input readonly type="text" v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间" prop="createDate">
<el-input readonly type="text" v-model="formData.createDate"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row gutter="20" type="flex">
<el-col :span="12">
<el-form-item label="礼物名称" prop="giftName">
<el-input maxlength="100" placeholder="礼物名称"
v-model="formData.giftName"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="显示顺序" prop="sortField">
<el-input maxlength="100" placeholder="请输入显示顺序"
v-model="formData.sortField"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="图片上传" prop="files">
<file-upload :files.sync="formData.files" card :max="1"
:type="['jpg','jpeg','png','JPG','JPEG','PNG']">
</file-upload>
<div class="el-upload__tip">请上传一张jpg/png/jpeg等格式,且不大于2M的照片</div>
</el-form-item>
<el-form-item>
<el-row class="pull-right offscreen-right mt5">
<el-button @click="doSubmit" type="primary">提交</el-button>
</el-row>
</el-form-item>
</el-form>
</template>
</template>
<template #view>
<div style="margin-left: 100px;margin-right: 100px">
<el-descriptions class="margin-top" title="礼物信息" :column="2" size="" border>
<el-descriptions-item>
<template slot="label">
创建人
</template>
{{viewData.username}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
创建时间
</template>
{{viewData.createDate}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
礼物名称
</template>
{{viewData.giftName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
显示顺序
</template>
{{viewData.sortField}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
礼物图片
</template>
<file-upload :files="viewData.files" view></file-upload>
</el-descriptions-item>
</el-descriptions>
</div>
</template>
</guava>
</div>
<script>
new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
srcList: [],
tableData: [],
viewData: {},
formData: {
files: '',
},
pageForm: {
giftName: '',
},
tableColumns: [
{prop: 'giftName', label: '礼物名称', sortable: true},
{prop: 'files', label: '礼物图片'},
{prop: 'username', label: '创建人', sortable: true},
{prop: 'createDate', label: '创建时间', sortable: true},
{prop: 'sortField', label: '排序字段', sortable: true},
],
formRules: {
username: [{required: true, message: '请填写创建人', trigger: ['blur', 'change']}],
createDate: [{required: true, message: '请填写创建时间', trigger: ['blur', 'change']}],
giftName: [{required: true, message: '请填写礼物名称', trigger: ['blur', 'change']}],
files: [{required: true, message: '请选择图片', trigger: ['blur', 'change']}],
}
}
},
methods: {
showImage(data) {
this.srcList = [];
this.srcList.push(data)
},
doSearch() {
this.pageData();
},
openView(data) {
if (!(typeof data.files == 'object')) {
data.files = JSON.parse(data.files)
}
this.viewData = data
this.$refs.guava.view()
},
openAdd() {
this.reset();
this.$refs.guava.edit()
},
openEdit(data) {
if (this.$refs["addForm"]) {
this.$refs["addForm"].resetFields()
}
if (!(typeof data.files == 'object')) {
data.files = JSON.parse(data.files)
}
this.formData = data
this.$refs.guava.edit()
},
async doDelete(row) {
const confirm = await this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const data = await $.post('/platform/blessing/giftList/doDelete', {id: row.id})
if (data.code === 0) {
this.$message.success(data.msg);
this.doSearch()
} else {
this.$message.error(data.msg);
}
}
},
async doSubmit() {
const valid = await this.$refs["addForm"].validate()
if (valid) {
const confirm = await this.$confirm('确定提交?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'info',
})
if ("confirm" === confirm) {
let data = clone(this.formData)
if (data.files) {
data.files = JSON.stringify(data.files)
}
const resp = await $.post(loc() + '/doSubmit', data)
if (resp.code === 0) {
this.pageData()
this.reset();
this.$refs.guava.index();
}
}
}
},
pageData() {
sublime.showLoadingbar();
this.tableLoading = true
$.post(loc() + "/pageData", this.pageForm, (data) => {
sublime.closeLoadingbar();
this.tableLoading = false
if (data.code === 0) {
data.data.list.forEach(v => {
if (!(typeof v.files == 'object')) {
v.files = JSON.parse(v.files)
}
})
this.tableData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message.error(data.msg);
}
}, "json");
},
initData() {
this.formData = {
username: '${@shiro.getPrincipalProperty("username")}',
createBy: '${@shiro.getPrincipalProperty("id")}',
createDate: moment().format('YYYY-MM-DD HH:mm:ss'),
}
},
reset() {
this.formData = {
id: '',
username: '${@shiro.getPrincipalProperty("username")}',
createBy: '${@shiro.getPrincipalProperty("id")}',
createDate: moment().format('YYYY-MM-DD HH:mm:ss'),
files: '',
sortField: '',
fileName: '',
}
}
},
created() {
this.showImage();
this.pageData();
this.initData();
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
},
})
</script>
<!--#
}
#-->