This commit is contained in:
2024-12-09 16:02:46 +08:00
parent 0267d27b2a
commit 8da42abcf1
14 changed files with 346 additions and 337 deletions
@@ -72,11 +72,11 @@ public class XssSqlFilterProcessor extends AbstractProcessor {
//use remove -|, //use remove -|,
String regEx_sql = """ String regEx_sql = """
and|exec|execute|insert|select|delete|update|count|drop|*|%|chr|mid|master|truncate| and|exec|execute|insert|select|delete|update|count|drop|chr|mid|master|truncate|
char|declare|sitename|net user|xp_cmdshell|;|or|+|like'|and|exec|execute|insert|create|drop| char|declare|sitename|net user|xp_cmdshell|or|like'|and|exec|execute|insert|create|drop|
table|from|grant|group_concat|column_name| table|from|grant|group_concat|column_name|
information_schema.columns|table_schema|union|where|select|delete|update|order|by|count|*| information_schema.columns|table_schema|union|where|select|delete|update|order|by|count|
chr|mid|master|truncate|char|declare|or|;|--|+|like|//|/|%|# chr|mid|master|truncate|char|declare|or|like
"""; """;
String regEx_xss = "script|iframe|img"; String regEx_xss = "script|iframe|img";
//SQL过滤 //SQL过滤
@@ -137,10 +137,8 @@ public class ActivityUnionManageController {
cnd.and(group); cnd.and(group);
} }
cnd.limit(1, 30);
sql.setCondition(cnd); sql.setCondition(cnd);
return sysUserService.listMap(sql); return sysUserService.listPageMap(1, 30, sql);
} }
/** /**
@@ -66,7 +66,7 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
$condition $condition
"""); """);
cnd.andEx("YEAR(tissue.startTime)", "=", year); cnd.andEx("YEAR(tissue.applyTime)", "=", year);
cnd.andEx("tissue.projectTypeCode", "!=", "50004"); cnd.andEx("tissue.projectTypeCode", "!=", "50004");
cnd.andEx("tissue.unionId", "=", unionId); cnd.andEx("tissue.unionId", "=", unionId);
cnd.andEx("tissue.type", "=", type); cnd.andEx("tissue.type", "=", type);
@@ -148,9 +148,8 @@ public class WelfareListController {
cnd.andEX("wcn.courierNumber", "=", courierNumber); cnd.andEX("wcn.courierNumber", "=", courierNumber);
cnd.groupBy("wl.id"); cnd.groupBy("wl.id");
cnd.asc("wl.unitid"); cnd.asc("wl.unitCode");
cnd.asc("wl.userSortNum"); cnd.asc("wl.loginname");
cnd.desc("wl.id");
if (!ShiroUtil.hasAnyRoles("sysadmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("wl.unionid", "=", Vi.getUnionId()); cnd.and("wl.unionid", "=", Vi.getUnionId());
@@ -160,7 +160,6 @@ public class WelfareMemberAdjustmentController {
cnd.and(pageForm); cnd.and(pageForm);
cnd.desc("his.changeTime"); cnd.desc("his.changeTime");
cnd.asc("u.unitid"); cnd.asc("u.unitid");
cnd.asc("COALESCE(u.userSortNum, 999999)");
cnd.desc("u.id"); cnd.desc("u.id");
pageParam.participate(cnd, "u"); pageParam.participate(cnd, "u");
@@ -96,7 +96,6 @@ public class WelfareMemberMangeController {
pageParam.participate(cnd); pageParam.participate(cnd);
cnd.and(pageForm); cnd.and(pageForm);
cnd.asc("unitid"); cnd.asc("unitid");
cnd.asc("COALESCE(userSortNum, 999999)");
cnd.desc("id"); cnd.desc("id");
sql.setCondition(cnd); sql.setCondition(cnd);
return welfareMemberService.list(pageForm, sql); return welfareMemberService.list(pageForm, sql);
@@ -167,7 +167,6 @@ public class WelfareMemberCheckUnionController {
cnd.and(pageForm); cnd.and(pageForm);
cnd.desc("his.changeTime"); cnd.desc("his.changeTime");
cnd.asc("u.unitid"); cnd.asc("u.unitid");
cnd.asc("COALESCE(u.userSortNum, 999999)");
cnd.desc("u.id"); cnd.desc("u.id");
if (Lang.isNotEmpty(changeTypes)) { if (Lang.isNotEmpty(changeTypes)) {
@@ -91,7 +91,7 @@ public class zczjlbController {
Double surplusMoney = zcxxes.stream().filter(z -> !List.of("报废", "丢失").contains(z.getZczt())).mapToDouble(Zgfw_Zcxx::getSurplusMoney).sum(); Double surplusMoney = zcxxes.stream().filter(z -> !List.of("报废", "丢失").contains(z.getZczt())).mapToDouble(Zgfw_Zcxx::getSurplusMoney).sum();
//累计折旧 //累计折旧
Double depreciationMoney = allMoney - surplusMoney; Double depreciationMoney = allMoney - surplusMoney;
return Map.of("allMoney", allMoney, "surplusMoney", surplusMoney, "depreciationMoney", depreciationMoney); return Map.of("allMoney", allMoney, "surplusMoney", surplusMoney, "depreciationMoney", String.format("%.2f", depreciationMoney));
} }
@@ -19,6 +19,8 @@ public class ZgfwZcxxTemp {
private String zcgbflh; private String zcgbflh;
@Excel(name = "资产名称", width = 20) @Excel(name = "资产名称", width = 20)
private String zcmc; private String zcmc;
@Excel(name = "型号规格", width = 20) @Excel(name = "型号规格", width = 20)
@@ -1112,13 +1112,19 @@ module.exports = {
if (applyTime && applyTime.length) { if (applyTime && applyTime.length) {
form.applyStartTime = applyTime[0] form.applyStartTime = applyTime[0]
form.applyEndTime = applyTime[1] form.applyEndTime = applyTime[1]
form.applyTime = undefined form.applyTime = []
} else {
form.applyStartTime = ""
form.applyEndTime = ""
} }
if (time && time.length) { if (time && time.length) {
form.startTime = time[0] form.startTime = time[0]
form.endTime = time[1] form.endTime = time[1]
form.time = undefined form.time = []
}else{
form.startTime = ""
form.endTime = ""
} }
if (this.eventForm.checkedEventId == "allItems") { if (this.eventForm.checkedEventId == "allItems") {
@@ -1,18 +1,20 @@
<template> <template>
<div> <div>
<div ref="editorRef"></div> <div ref="editorDom"></div>
<input type="file" style="display: none" /> <input type="file" style="display: none;">
</div> </div>
</template> </template>
<script>
const { $, BtnMenu, Panel, Tooltip } = wangEditor
//注册上传word按钮 <script src="/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script>
class DocMenu extends BtnMenu { <script>
const {$, BtnMenu, DropListMenu, PanelMenu, DropList, Panel, Tooltip} = wangEditor
class AlertMenu extends BtnMenu {
constructor(editor) { constructor(editor) {
const $elem = wangEditor.$( const $elem = wangEditor.$(
`<div class="w-e-menu" data-title="上传文档"> `<div class="w-e-menu" data-title="上传word">
<i class="fa fa-file-word-o" aria-hidden="true" /></i> <i class="fa fa-file-word-o" aria-hidden="true" /></i>
</div>` </div>`
) )
@@ -20,88 +22,68 @@ class DocMenu extends BtnMenu {
} }
clickHandler() { clickHandler() {
const fileInputId = this.editor.textElemId + "input-file" const _this = this
const existingInput = document.getElementById(fileInputId) const inputFileElement = document.querySelector('#'+this.editor.textElemId).parentElement.parentElement.nextElementSibling
if (existingInput) { inputFileElement.click()
existingInput.remove() inputFileElement.addEventListener('change', function () {
} const loading = ELEMENT.Loading.service({
lock: true,
text: '解析中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
const input = document.createElement("input") })
input.type = "file"
input.accept = "application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" const file = this.files[0];
input.id = fileInputId const fileName = file.name
input.style.display = "none"
input.addEventListener("change", (event) => { if (!fileName.toLowerCase().endsWith('.doc') && !fileName.toLowerCase().endsWith('.docx')) {
const files = event.target.files alert('请上传doc或者docx的文件')
if (!files || files.length === 0) { _this.clearInputFile()
loading.close()
return return
} }
let loading = null
if (window.ELEMENT) {
loading = ELEMENT.Loading.service({
lock: true,
text: "文件读取中",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)"
})
} else if (window.vant) {
loading = vant.Toast.loading({
message: "文件读取中",
forbidClick: true,
overlay: true,
duration: 0
})
}
const formData = new FormData() const formData = new FormData()
formData.append("file", files[0]) formData.append('file', file, file.name)
axios.post('/file_server/word2Html', formData, {}).then(response => {
axios console.log(response.data)
.post("/file_server/convertHtml", formData, {
headers: { "Content-Type": "multipart/form-data", "x-requested-with": "XMLHttpRequest" }
})
.then((response) => {
loading.close() loading.close()
if (response.data.code === 0) { if (response.data.code === 0) {
this.editor.txt.html(response.data.data) _this.editor.txt.html(response.data.data)
} else { } else {
if (window.ELEMENT) { alert(response.data.msg + ',上传word失败,请联系管理员!')
ELEMENT.Message.error(response.data.msg) _this.clearInputFile()
} else if (window.vant) {
vant.Toast(response.data.msg)
} else {
alert(response.data.msg)
} }
} }).catch(error => {
}) loading.close()
.catch((error) => {
console.log(error) console.log(error)
alert("上传word失败,请联系管理员!") _this.clearInputFile()
}) alert('上传word失败,请联系管理员!')
.finally(() => { });
input.remove() });
})
})
input.click()
document.body.appendChild(input)
} }
tryChangeActive() {} clearInputFile() {
const obj = document.getElementById('fileInput');
obj.outerHTML = obj.outerHTML
} }
wangEditor.registerMenu("docMenu", DocMenu) tryChangeActive() {
this.active()
}
}
wangEditor.registerMenu('alertMenuKey', AlertMenu)
module.exports = { module.exports = {
name: "textEditor", name: "textEditor",
props: { props: {
content: {
type: String,
default: ""
},
// 定义值属性,用于接收父组件传递的值 // 定义值属性,用于接收父组件传递的值
value: { value: {
type: String, type: String,
default: "" default: ''
}, },
height: { height: {
type: Number, type: Number,
@@ -111,38 +93,37 @@ module.exports = {
type: Array, type: Array,
default: () => { default: () => {
return [ return [
"head", //标题 'head',//标题
"bold", //加粗 'bold',//加粗
"fontSize", //字号 'fontSize',//字号
"fontName", //字体 'fontName',//字体
"italic", //斜体 'italic',//斜体
"underline", //下划线 'underline',//下划线
"strikeThrough", //删除线 'strikeThrough',//删除线
"indent", //缩进 'indent',//缩进
"lineHeight", //行高 'lineHeight',//行高
"foreColor", //文字颜色 'foreColor',//文字颜色
"backColor", //背景颜色 'backColor',//背景颜色
//'link',//链接 //'link',//链接
"list", //序列 'list',//序列
"todo", //待办 'todo',//待办
"justify", //对齐 'justify',//对齐
"quote", //引用 'quote',//引用
// 'emoticon',//表情 // 'emoticon',//表情
"image", 'image',
//'video', //'video',
"table", 'table',
//'code', //'code',
"splitLine", //分割线 'splitLine',//分割线
"undo", 'undo',
"redo" 'redo',
] ]
} }
} }
}, },
data() { data() {
return { return {
editor: null, editor: null
cursorPos: 0
} }
}, },
mounted() { mounted() {
@@ -167,8 +148,9 @@ module.exports = {
methods: { methods: {
initEditor() { initEditor() {
let _this = this let _this = this
this.editor = new wangEditor(this.$refs.editorRef) this.editor = new wangEditor(this.$refs.editorDom)
this.editor.config.focus = false this.editor.config.focus = false
//内容change回调 //内容change回调
this.editor.config.onchange = (newHtml) => { this.editor.config.onchange = (newHtml) => {
this.cursorPos = this.editor.selection.getCursorPos() this.cursorPos = this.editor.selection.getCursorPos()
@@ -176,38 +158,52 @@ module.exports = {
range.setStart(range.startContainer, Math.max(this.cursorPos, range.endOffset)) range.setStart(range.startContainer, Math.max(this.cursorPos, range.endOffset))
this.$emit("input", newHtml) this.$emit("input", newHtml)
} }
this.editor.config.linkImgCheck = function (imgSrc, alt, href) {
// 1. 返回 true ,说明检查通过
return true
}
//配置图片上传 //配置图片上传
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) { this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
// resultFiles 是 input 中选中的文件列表 // resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法 // insertImgFn 是获取图片 url 后,插入到编辑器的方法
Promise.all(_this.uploadFiles(resultFiles)).then((res) => {
res.forEach((v) => { Promise.all(_this.uploadFiles(resultFiles)).then(res => {
if (v.data && v.data.code === 0) { res.forEach(v => {
insertImgFn(v.data.data) if (v.code === 0) {
insertImgFn(APP_DOMAIN + CREATE_PREVIEW_URL(v.data.filepath))
} else { } else {
ELEMENT.message.error("图片上传失败") ELEMENT.message.warning('图片上传失败')
} }
}) })
}) })
} }
//粘贴过滤
this.editor.config.pasteFilterStyle = false this.editor.config.pasteFilterStyle = false
//高度
this.editor.config.height = this.height this.editor.config.height = this.height
//菜单
this.editor.config.menus = this.menus this.editor.config.menus = this.menus
this.editor.create() this.editor.create()
}, },
isEmptyEditor() {
const children = this.editor.$textElem.children()
for (let i = 0; i < children.elems.length; i++) {
const node = children.elems[i]
if (node && node.nodeType === Node.TEXT_NODE && node.textContent.trim().length !== '') {
return false
}
if (node && node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'p' && node.innerText.trim() !== '') {
return false
}
}
return true
},
uploadFiles(resultFiles) { uploadFiles(resultFiles) {
return resultFiles.map(async (file) => { return resultFiles.map(async file => {
const formData = new FormData() const formData = new FormData()
formData.append("file", file, file.name) formData.append('file', file, file.name)
formData.append("folderPath", "/wangEditorImg/") formData.append("folderPath", "/wangEditorImg/")
return jQuery.ajax({ return jQuery.ajax({
url: "/file_server/uploadFile", url: '/file_server/uploadFile',
type: "post", type: 'post',
data: formData, data: formData,
processData: false, processData: false,
contentType: false contentType: false
@@ -215,8 +211,14 @@ module.exports = {
}) })
} }
}, },
created() {} created() {
} }
}
</script> </script>
<style scoped></style>
<style scoped>
</style>
@@ -126,8 +126,11 @@ layout("/layouts/platform.html"){
</template> </template>
<template scope="{row}" v-else-if="column.prop=='startTime'"> <template scope="{row}" v-else-if="column.prop=='startTime'">
<span v-if="row.startTime">
{{moment(row.startTime).format('YYYY-MM-DD')}} - {{moment(row.startTime).format('YYYY-MM-DD')}} -
{{moment(row.endTime).format('YYYY-MM-DD')}} {{moment(row.endTime).format('YYYY-MM-DD')}}
</span>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='isDisabled'"> <template scope="{row}" v-else-if="column.prop=='isDisabled'">
@@ -613,7 +613,7 @@
style="width: 100%" style="width: 100%"
v-model="formData.tissuePersonList"> v-model="formData.tissuePersonList">
<el-option <el-option
:disabled="userData.map(v=>v.userId).includes(item.userId)" :disabled="item.disabled"
:key="item.userId" :key="item.userId"
:label="item.userName+'-'+item.loginName+'-'+item.unitName" :label="item.userName+'-'+item.loginName+'-'+item.unitName"
:value="item.userId" :value="item.userId"
@@ -785,7 +785,14 @@
serachWord: query, serachWord: query,
activity_type: type activity_type: type
}) })
this.userList = data data.list.map(d => {
if (this.userData.map(v => v.userId).includes(d.userId)) {
d.disabled = true
} else {
d.disabled = false
}
})
this.userList = data.list
this.selectLoading = false; this.selectLoading = false;
} }
}, },
@@ -794,8 +801,9 @@
this.dialogVisible = true this.dialogVisible = true
}, },
doAddUser() { doAddUser() {
this.formData.tissuePersonList = this.userList.filter(v => this.formData.tissuePersonList.some(x => v.userId === x)) const userList = this.userList.filter(v => this.formData.tissuePersonList.some(x => v.userId === x))
this.userData = this.userData.concat(this.formData.tissuePersonList) this.userData = this.userData.concat(userList)
this.formData.tissuePersonList = this.userData
this.dialogVisible = false this.dialogVisible = false
}, },
async delUser(row) { async delUser(row) {
@@ -3,8 +3,8 @@ layout("/layouts/platform.html"){
#--> #-->
<div id="app" class="platform" v-cloak> <div class="platform" id="app" v-cloak>
<guava ref="guava" padding="0 5%"> <guava padding="0 5%" ref="guava">
<template> <template>
<el-card shadow="never"> <el-card shadow="never">
@@ -14,11 +14,11 @@ layout("/layouts/platform.html"){
<div class="search-item-label">年&emsp;&emsp;度:</div> <div class="search-item-label">年&emsp;&emsp;度:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-date-picker <el-date-picker
v-model="pageForm.year" placeholder="请选择"
type="year"
style="width: 100%" style="width: 100%"
value-format="yyyy" type="year"
placeholder="请选择"> v-model="pageForm.year"
value-format="yyyy">
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
@@ -26,56 +26,56 @@ layout("/layouts/platform.html"){
<div class="search-item"> <div class="search-item">
<div class="search-item-label">项目名称:</div> <div class="search-item-label">项目名称:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.name" <el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
@keyup.enter.native="doSearch" style="width:100%"></el-input> style="width:100%" v-model="pageForm.name"></el-input>
</div> </div>
</div> </div>
<div class="search-query"> <div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索 <el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
</el-button> </el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card shadow="never" class="mt10"> <el-card class="mt10" shadow="never">
<table-tool label="体检项目" :app="this"> <table-tool :app="this" label="体检项目">
<template #func> <template #func>
<el-button type="primary" size="small" <el-button @click="openAdd" icon="el-icon-plus"
icon="el-icon-plus" size="small"
@click="openAdd">新建体检项目 type="primary">新建体检项目
</el-button> </el-button>
</template> </template>
</table-tool> </table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
@sort-change="pageOrder" :size="tableSize" class="vi-table" ref="table"
v-loading="tableLoading" ref="table" class="vi-table"> row-key="id" style="width: 100%" v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" <el-table-column :index="indexMethod" align="center" header-align="center"
:index="indexMethod" label="序号" label="序号" type="index"
width="80px"></el-table-column> width="80px"></el-table-column>
<el-table-column <el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center" align="center"
header-align="center" header-align="center"
v-for="column in tableColumns" min-width="100px" show-overflow-tooltip v-for="column in tableColumns">
show-overflow-tooltip
:sortable="column.sortable"
:label="column.label"
:prop="column.prop" :width="column.width" min-width="100px">
<template v-if="column.prop=='choiceTime'" scope="{row}"> <template scope="{row}" v-if="column.prop=='choiceTime'">
{{row.choiceTimeStart}}-{{row.choiceTimeEnd}} {{row.choiceTimeStart}}-{{row.choiceTimeEnd}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" <el-table-column align="center" header-align="center" label="操作"
label="操作" width="100px"> prop="userOnline" width="100px">
<template scope="{row}"> <template scope="{row}">
<el-dropdown @command="dropdownCommand"> <el-dropdown @command="dropdownCommand">
@@ -87,16 +87,18 @@ layout("/layouts/platform.html"){
<el-dropdown-item :command="{type:'view',data:row}"> <el-dropdown-item :command="{type:'view',data:row}">
查看 查看
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-if="row.isWithinChoiceTime && !row.isHasUserList" <el-dropdown-item
:command="{type:'created',data:row}"> :command="{type:'created',data:row}"
v-if="row.isWithinChoiceTime && !row.isHasUserList">
生成名单 生成名单
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-if="row.isWithinChoiceTime && row.isHasUserList" <el-dropdown-item
:command="{type:'renew',data:row}"> :command="{type:'renew',data:row}"
v-if="row.isWithinChoiceTime && row.isHasUserList">
更新名单 更新名单
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-if="row.isWithinChoiceTime" <el-dropdown-item :command="{type:'reset',data:row}"
:command="{type:'reset',data:row}"> v-if="row.isWithinChoiceTime">
重置名单 重置名单
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :command="{type:'edit',data:row}"> <el-dropdown-item :command="{type:'edit',data:row}">
@@ -122,39 +124,39 @@ layout("/layouts/platform.html"){
</template> </template>
<template #edit> <template #edit>
<el-form :model="formData" ref="form" :rules="formRules" label-width="120px" <el-form :model="formData" :rules="formRules" label-width="120px" ref="form"
v-loading="formLoading"> v-loading="formLoading">
<vi-title title="体检项目信息"></vi-title> <vi-title title="体检项目信息"></vi-title>
<el-form-item prop="name" label="项目名称"> <el-form-item label="项目名称" prop="name">
<el-input v-model="formData.name" placeholder="项目名称" maxlength="100"></el-input> <el-input maxlength="100" placeholder="项目名称" v-model="formData.name"></el-input>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col span="12"> <el-col span="12">
<el-form-item prop="choiceTime" label="选择时间"> <el-form-item label="选择时间" prop="choiceTime">
<el-date-picker <el-date-picker
style="width: 80%" end-placeholder="结束时间"
v-model="formData.choiceTime"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-" range-separator="-"
start-placeholder="开始时间" start-placeholder="开始时间"
end-placeholder="结束时间"> style="width: 80%"
type="datetimerange"
v-model="formData.choiceTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="12"> <el-col span="12">
<el-form-item prop="activityGroupId" label="可报名人员范围"> <el-form-item label="可报名人员范围" prop="activityGroupId">
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between">
<div style="width: 99%"> <div style="width: 99%">
<el-select prop="activityGroupId" placeholder="参加人员范围" <el-select clearable filterable
v-model="formData.activityGroupId" placeholder="参加人员范围"
prop="activityGroupId"
style="width: 99%;" style="width: 99%;"
clearable v-model="formData.activityGroupId">
filterable> <el-option :label="item.groupName"
<el-option v-for="item in activityGroupList" :value="item.groupId"
:label="item.groupName" v-for="item in activityGroupList"></el-option>
:value="item.groupId"></el-option>
</el-select> </el-select>
</div> </div>
<div> <div>
@@ -167,7 +169,7 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="24"> <el-col span="24">
<el-form-item prop="healthCheckupType" label="体检对象类型"> <el-form-item label="体检对象类型" prop="healthCheckupType">
<el-radio-group v-model="formData.healthCheckupType"> <el-radio-group v-model="formData.healthCheckupType">
<el-radio-button label="jzg">教职工</el-radio-button> <el-radio-button label="jzg">教职工</el-radio-button>
<el-radio-button label="js">家属</el-radio-button> <el-radio-button label="js">家属</el-radio-button>
@@ -185,9 +187,9 @@ layout("/layouts/platform.html"){
label="套餐名称"> label="套餐名称">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-input v-model="row.optionName" autosize <el-input autosize class="text-input"
class="text-input"
data-type="option" data-type="option"
v-model="row.optionName"
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
@@ -196,9 +198,9 @@ layout("/layouts/platform.html"){
header-align="center" header-align="center"
label="排序"> label="排序">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-input v-model="row.optionSort" autosize <el-input autosize class="text-input"
class="text-input"
data-type="option" data-type="option"
v-model="row.optionSort"
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
@@ -207,10 +209,10 @@ layout("/layouts/platform.html"){
header-align="center" header-align="center"
label="图片" width="130px"> label="图片" width="130px">
<template slot-scope="{row,$index}"> <template slot-scope="{row,$index}">
<image-Upload ref="imageUpload" :height="100" <image-Upload :file-size="10" :file-type="['png','jpg']"
:width="100" :limit="1" :height="100" :limit="1"
:file-type="['png','jpg']" :width="100"
:file-size="10" ref="imageUpload"
v-model="row.imgUrl"></image-Upload> v-model="row.imgUrl"></image-Upload>
</template> </template>
</el-table-column> </el-table-column>
@@ -218,8 +220,8 @@ layout("/layouts/platform.html"){
header-align="center" header-align="center"
label="说明"> label="说明">
<template slot-scope="{row,$index}"> <template slot-scope="{row,$index}">
<el-link type="primary" <el-link @click="openDescRichText(row.description,$index)"
@click="openDescRichText(row.description,$index)"> type="primary">
编辑说明 编辑说明
</el-link> </el-link>
</template> </template>
@@ -232,14 +234,14 @@ layout("/layouts/platform.html"){
width="100px"> width="100px">
<template slot-scope="{row,$index}"> <template slot-scope="{row,$index}">
<div class="option-delete"> <div class="option-delete">
<el-button circle <el-button @click="openCnd(row,$index,true)"
icon="el-icon-s-tools" circle
size="mini" type="primary" icon="el-icon-s-tools" size="mini"
@click="openCnd(row,$index,true)"></el-button> type="primary"></el-button>
<el-button circle <el-button @click="deleteRow(row,$index)"
icon="el-icon-delete" circle
size="mini" type="danger" icon="el-icon-delete" size="mini"
@click="deleteRow(row,$index)"></el-button> type="danger"></el-button>
</div> </div>
</template> </template>
@@ -247,8 +249,8 @@ layout("/layouts/platform.html"){
</el-table> </el-table>
<div class="s-operation"> <div class="s-operation">
<el-button size="small" type="primary" <el-button @click="formData.healthCheckupProjectSubjects.push({optionNameId:'',optionName:'套餐'+(formData.healthCheckupProjectSubjects.length+1),optionSort:formData.healthCheckupProjectSubjects.length+1,imgUrl:null})" size="small"
@click="formData.healthCheckupProjectSubjects.push({optionNameId:'',optionName:'套餐'+(formData.healthCheckupProjectSubjects.length+1),optionSort:formData.healthCheckupProjectSubjects.length+1,imgUrl:null})"> type="primary">
添加项目 添加项目
</el-button> </el-button>
</div> </div>
@@ -257,16 +259,16 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
<el-form-item label="项目封面" prop="cover"> <el-form-item label="项目封面" prop="cover">
<image-Upload ref="imageUpload" :height="200" <image-Upload :file-size="10" :file-type="['png','jpg']"
:width="200" :limit="1" :height="200" :limit="1"
:file-type="['png','jpg']" :width="200"
:file-size="10" ref="imageUpload"
v-model="formData.cover"></image-Upload> v-model="formData.cover"></image-Upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-button @click="doAdd" type="primary" style="float: right"> <el-button @click="doAdd" style="float: right" type="primary">
提交 提交
</el-button> </el-button>
</template> </template>
@@ -297,15 +299,15 @@ layout("/layouts/platform.html"){
:src="CREATE_PREVIEW_URL(i.imgUrl)" :src="CREATE_PREVIEW_URL(i.imgUrl)"
@click="preview(i.imgUrl,i.imgUrl)" @click="preview(i.imgUrl,i.imgUrl)"
fit="cover" fit="cover"
v-if="i.imgUrl" style="width: 100px; height: 100px;"
style="width: 100px; height: 100px;"></el-image> v-if="i.imgUrl"></el-image>
<div v-else>暂无</div> <div v-else>暂无</div>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="报名条件"> <el-descriptions-item label="报名条件">
<el-button circle <el-button @click="openCnd(i,null,false)"
icon="el-icon-s-tools" circle
size="mini" type="primary" icon="el-icon-s-tools" size="mini"
@click="openCnd(i,null,false)"></el-button> type="primary"></el-button>
</el-descriptions-item> </el-descriptions-item>
</template> </template>
@@ -314,32 +316,31 @@ layout("/layouts/platform.html"){
</guava> </guava>
<drawer-user-scope <drawer-user-scope
:group_id.sync="formData.activityGroupId"
@group_change="getActivityGroup" @group_change="getActivityGroup"
ref="drawerUserScope" ref="drawerUserScope"
:group_id.sync="formData.activityGroupId"
></drawer-user-scope> ></drawer-user-scope>
<send-msg ref="sendMsg" :url="url"></send-msg> <send-msg :url="url" ref="sendMsg"></send-msg>
<open-qr-code ref="openQRCode" :url="url"></open-qr-code> <open-qr-code :url="url" ref="openQRCode"></open-qr-code>
<el-dialog <el-dialog
:append-to-body="true"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="richTextDialog" :visible.sync="richTextDialog"
title="编辑说明" title="编辑说明"
:append-to-body="true"
width="60%"> width="60%">
<div id="descRichText"> <text-editor v-model="descRichTextContent"></text-editor>
</div> <span class="dialog-footer" slot="footer">
<span slot="footer" class="dialog-footer">
<el-button @click="richTextDialog = false">取 消</el-button> <el-button @click="richTextDialog = false">取 消</el-button>
<el-button type="primary" @click="getRichText">确 定</el-button> <el-button @click="getRichText" type="primary">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<condition ref="cnd" v-model="conditions" :fields="fields" <condition :fields="fields" :show_submit="showSubmit" @confirm="cndConfirm"
:show_submit="showSubmit" ref="cnd"
@confirm="cndConfirm"></condition> v-model="conditions"></condition>
</div> </div>
<script> <script>
@@ -374,7 +375,11 @@ layout("/layouts/platform.html"){
choiceTime: [{required: true, message: '必填', trigger: ['blur', 'change']}], choiceTime: [{required: true, message: '必填', trigger: ['blur', 'change']}],
activityGroupId: [{required: true, message: '必填', trigger: ['blur', 'change']}], activityGroupId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
// cover: [{required: true, message: '必填', trigger: ['blur', 'change']}], // cover: [{required: true, message: '必填', trigger: ['blur', 'change']}],
healthCheckupType: [{required: true, message: '必填', trigger: ['blur', 'change']}], healthCheckupType: [{
required: true,
message: '必填',
trigger: ['blur', 'change']
}],
healthCheckupProjectSubjects: [{ healthCheckupProjectSubjects: [{
required: true, required: true,
message: '必填', message: '必填',
@@ -391,6 +396,7 @@ layout("/layouts/platform.html"){
{label: '出生日期', value: 'birthday', type: "date"}, {label: '出生日期', value: 'birthday', type: "date"},
], ],
deleteRowIds: [], deleteRowIds: [],
descRichTextContent: ""
} }
}, },
components: { components: {
@@ -577,21 +583,9 @@ layout("/layouts/platform.html"){
openDescRichText(richText, sIdx) { openDescRichText(richText, sIdx) {
this.richTextDialog = true this.richTextDialog = true
this.subjectIndex = sIdx this.subjectIndex = sIdx
this.$nextTick(() => {
$("#descRichText").html("")
descRichTextEditor = new wangEditor("#descRichText")
descRichTextEditor.config.onchange = (html) => {
richText = (html ? html : "")
}
descRichTextEditor.config.uploadImgShowBase64 = true
descRichTextEditor.create()
if (richText) {
descRichTextEditor.txt.html(richText)
}
})
}, },
getRichText() { getRichText() {
this.formData.healthCheckupProjectSubjects[this.subjectIndex].description = descRichTextEditor.txt.html() this.formData.healthCheckupProjectSubjects[this.subjectIndex].description = this.descRichTextContent
this.richTextDialog = false this.richTextDialog = false
}, },
async openCnd(row, index, showSubmit) { async openCnd(row, index, showSubmit) {